Created Vision Links Viewport Widget

Has a functioning battery life bar
This commit is contained in:
Rafal Swierczek 2023-10-01 13:51:15 +01:00
parent e61b51d466
commit aca63055f3
9 changed files with 26 additions and 13 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:cc03486eff6b6773661f66c933fa9133c4cb06574cb449b416f5f79620ddc5d3 oid sha256:a4b1eb50312687772c3a03c0ef4e857d8db493b85d341ca5d9d4fda2cd8669f2
size 55610 size 69951

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fb578a8064dba062142046bcb432a36f7cf120096d75835630f55c95df96c3be
size 76094

View File

@ -8,6 +8,7 @@ void AVisionLink::BeginPlay()
Super::BeginPlay(); Super::BeginPlay();
SetActorTickEnabled(false); SetActorTickEnabled(false);
CooldownLength = CooldownTime; CooldownLength = CooldownTime;
InUseDuration = GadgetMaxUptime;
} }
@ -23,13 +24,13 @@ void AVisionLink::Activate()
Super::Activate(); Super::Activate();
SetActorTickEnabled(true); SetActorTickEnabled(true);
SwitchToActiveWatchFace(); VisionLinkActivated();
} }
void AVisionLink::FinishedUsing() void AVisionLink::FinishedUsing()
{ {
SetActorTickEnabled(false); SetActorTickEnabled(false);
SwitchToRechargingWatchFace(); VisionLinkRecharging();
Super::FinishedUsing(); Super::FinishedUsing();
} }

View File

@ -26,10 +26,13 @@ protected:
UPROPERTY(BlueprintReadOnly, Category = "Vision Link") UPROPERTY(BlueprintReadOnly, Category = "Vision Link")
float CooldownLength; float CooldownLength;
UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link") UPROPERTY(BlueprintReadOnly, Category = "Vision Link")
void SwitchToActiveWatchFace(); float InUseDuration;
UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link") UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link")
void SwitchToRechargingWatchFace(); void VisionLinkActivated();
UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link")
void VisionLinkRecharging();
}; };