This repository has been archived by the owner on Apr 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
362 additions
and
64 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file modified
BIN
+11.3 KB
(110%)
Content/LightItUp/Lamps/-Shared/LampMenu/LampInteraction.uasset
Binary file not shown.
Binary file modified
BIN
-12.9 KB
(91%)
Content/LightItUp/Lamps/ConstructionLight/ConstructionLight.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-22.9 KB
(88%)
Content/LightItUp/Lamps/PortableLight/Widget_PortableLamp.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "FueledLampBase.h" | ||
#include "FGActorRepresentationManager.h" | ||
#include "Components/SpotLightComponent.h" | ||
#include "UnrealNetwork.h" | ||
|
||
AFueledLampBase::AFueledLampBase() { | ||
PowerConnectionProduction = CreateDefaultSubobject<UFGPowerConnectionComponent>("PowerConnectionProduction"); | ||
PowerConnectionProduction->SetIsHidden(true); | ||
|
||
PowerConnectionConsumption = CreateDefaultSubobject<UFGPowerConnectionComponent>("PowerConnectionConsumption"); | ||
PowerConnectionConsumption->SetIsHidden(true); | ||
} | ||
|
||
void AFueledLampBase::BeginPlay() { | ||
Super::BeginPlay(); | ||
|
||
if (HasAuthority()) { | ||
PowerConnectionProduction->SetPowerInfo(GetPowerInfo()); | ||
PowerConnectionConsumption->SetPowerInfo(GetPowerInfo()); | ||
PowerConnectionConsumption->AddHiddenConnection(PowerConnectionProduction); | ||
} | ||
} | ||
|
||
void AFueledLampBase::TickActor(float DeltaTime, ELevelTick TickType, FActorTickFunction& ThisTickFunction) { | ||
Super::TickActor(DeltaTime, TickType, ThisTickFunction); | ||
|
||
TArray<UActorComponent*> lights = GetComponentsByClass(ULightComponent::StaticClass()); | ||
bool bLampOn = HasPower() && !IsProductionPaused(); | ||
for (auto& light : lights) { | ||
Cast<ULightComponent>(light)->SetVisibilitySML(bLampOn, true); | ||
} | ||
} | ||
|
||
void AFueledLampBase::Factory_Tick(float dt) { | ||
if (HasAuthority()) GetPowerInfo()->SetTargetConsumption(GetPendingPotential() * mPowerProduction / 4.1); | ||
Super::Factory_Tick(dt); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
#include "FGBuildableGeneratorFuel.h" | ||
#include "FGPowerConnectionComponent.h" | ||
#include "FGPowerInfoComponent.h" | ||
#include "FueledLampBase.generated.h" | ||
|
||
UCLASS(Blueprintable) | ||
class AFueledLampBase : public AFGBuildableGeneratorFuel { | ||
GENERATED_BODY() | ||
|
||
public: | ||
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Light") | ||
UFGPowerConnectionComponent* PowerConnectionProduction; | ||
|
||
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Light") | ||
UFGPowerConnectionComponent* PowerConnectionConsumption; | ||
|
||
AFueledLampBase(); | ||
|
||
// Begin AActor | ||
virtual void BeginPlay() override; | ||
virtual void TickActor(float DeltaTime, ELevelTick TickType, FActorTickFunction& ThisTickFunction) override; | ||
// End AActor | ||
|
||
// Begin Buildable Interface | ||
void Factory_Tick(float dt) override; | ||
// End Buildable Interface | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.