Implemented Vision Links Watch Face

This commit is contained in:
Rafal Swierczek 2023-09-30 22:11:10 +01:00
parent 5e36b9e25e
commit 8c7219c655
14 changed files with 98 additions and 14 deletions

Binary file not shown.

Binary file not shown.

View File

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

View File

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

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5187272f65c655c1bbca4f6a814ab42219fcb74a566fb68d72cc23cfa8b92999
size 101262
oid sha256:6c62d2b4827914f2af412d694fd0a91dd89833265ee15c3de4b1dd9123f1a94f
size 109679

View File

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

View File

@ -44,7 +44,7 @@ void AGadgetBase::Equip()
bool AGadgetBase::Unequip()
{
if (GadgetInUse) return false;
if (GadgetInUse && !UnequippableWhenInUse) return false;
SetActorRelativeLocation(UnequippedOffset);
Equipped = false;

View File

@ -44,6 +44,9 @@ protected:
UPROPERTY(EditDefaultsOnly, Category = "Gadget")
float CooldownTime;
UPROPERTY(EditDefaultsOnly, CAtegory = "Gadget")
bool UnequippableWhenInUse = false;
UPROPERTY(EditDefaultsOnly, Category = "Gadget")
UInputMappingContext* GadgetMappingContext;

View File

@ -0,0 +1,37 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "VisionLink.h"
void AVisionLink::BeginPlay()
{
Super::BeginPlay();
SetActorTickEnabled(false);
CooldownLength = CooldownTime;
}
void AVisionLink::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
}
void AVisionLink::Activate()
{
if (GadgetCantBeUsed()) return;
Super::Activate();
SetActorTickEnabled(true);
SwitchToActiveWatchFace();
}
void AVisionLink::FinishedUsing()
{
SetActorTickEnabled(false);
SwitchToRechargingWatchFace();
Super::FinishedUsing();
}

View File

@ -0,0 +1,35 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "EndlessVendetta/GadgetSystem/ReconGadget.h"
#include "VisionLink.generated.h"
/**
*
*/
UCLASS()
class ENDLESSVENDETTA_API AVisionLink : public AReconGadget
{
GENERATED_BODY()
virtual void BeginPlay() override;
virtual void Tick(float DeltaSeconds) override;
virtual void Activate() override;
virtual void FinishedUsing() override;
protected:
UPROPERTY(BlueprintReadOnly, Category = "Vision Link")
float CooldownLength;
UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link")
void SwitchToActiveWatchFace();
UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link")
void SwitchToRechargingWatchFace();
};