diff --git a/Content/Blueprints/Characters/BP_Player.uasset b/Content/Blueprints/Characters/BP_Player.uasset index 539e9dd..1aae8ee 100644 Binary files a/Content/Blueprints/Characters/BP_Player.uasset and b/Content/Blueprints/Characters/BP_Player.uasset differ diff --git a/Content/Input/Actions/IA_CutsceneSkip.uasset b/Content/Input/Actions/IA_CutsceneSkip.uasset new file mode 100644 index 0000000..8b8a181 Binary files /dev/null and b/Content/Input/Actions/IA_CutsceneSkip.uasset differ diff --git a/Content/Input/Actions/IA_FlyUpDown.uasset b/Content/Input/Actions/IA_FlyUpDown.uasset index 68823e1..de5892f 100644 Binary files a/Content/Input/Actions/IA_FlyUpDown.uasset and b/Content/Input/Actions/IA_FlyUpDown.uasset differ diff --git a/Content/Input/Actions/IA_Interact.uasset b/Content/Input/Actions/IA_Interact.uasset index 7b8d0df..c665631 100644 Binary files a/Content/Input/Actions/IA_Interact.uasset and b/Content/Input/Actions/IA_Interact.uasset differ diff --git a/Content/Input/Actions/IA_Jump.uasset b/Content/Input/Actions/IA_Jump.uasset index 78c440e..9ca67bb 100644 Binary files a/Content/Input/Actions/IA_Jump.uasset and b/Content/Input/Actions/IA_Jump.uasset differ diff --git a/Content/Input/Actions/IA_Move.uasset b/Content/Input/Actions/IA_Move.uasset index b0d4875..e9e730f 100644 Binary files a/Content/Input/Actions/IA_Move.uasset and b/Content/Input/Actions/IA_Move.uasset differ diff --git a/Content/Input/Actions/IA_Run.uasset b/Content/Input/Actions/IA_Run.uasset index 41a69d2..dc53ed3 100644 Binary files a/Content/Input/Actions/IA_Run.uasset and b/Content/Input/Actions/IA_Run.uasset differ diff --git a/Content/Input/Actions/IA_TurnCameraMode.uasset b/Content/Input/Actions/IA_TurnCameraMode.uasset index 1f767f3..296dba6 100644 Binary files a/Content/Input/Actions/IA_TurnCameraMode.uasset and b/Content/Input/Actions/IA_TurnCameraMode.uasset differ diff --git a/Content/Input/IMC_Cutscene.uasset b/Content/Input/IMC_Cutscene.uasset new file mode 100644 index 0000000..74cc511 Binary files /dev/null and b/Content/Input/IMC_Cutscene.uasset differ diff --git a/Content/Input/IMC_Player.uasset b/Content/Input/IMC_Player.uasset index 6854026..f877227 100644 Binary files a/Content/Input/IMC_Player.uasset and b/Content/Input/IMC_Player.uasset differ diff --git a/Content/Levels/Test/Actors/CutsceneTest/BP_Test_CutsceneMultiple.uasset b/Content/Levels/Test/Actors/CutsceneTest/BP_Test_CutsceneMultiple.uasset new file mode 100644 index 0000000..a910bce Binary files /dev/null and b/Content/Levels/Test/Actors/CutsceneTest/BP_Test_CutsceneMultiple.uasset differ diff --git a/Content/Levels/Test/Actors/CutsceneTest/BP_Test_CutsceneSingle.uasset b/Content/Levels/Test/Actors/CutsceneTest/BP_Test_CutsceneSingle.uasset new file mode 100644 index 0000000..e109aac Binary files /dev/null and b/Content/Levels/Test/Actors/CutsceneTest/BP_Test_CutsceneSingle.uasset differ diff --git a/Content/Levels/Test/Actors/BP_Test_InteractablEdit.uasset b/Content/Levels/Test/Actors/InteractablesTest/BP_Test_InteractablEdit.uasset similarity index 79% rename from Content/Levels/Test/Actors/BP_Test_InteractablEdit.uasset rename to Content/Levels/Test/Actors/InteractablesTest/BP_Test_InteractablEdit.uasset index d5f6f3b..1777dcc 100644 Binary files a/Content/Levels/Test/Actors/BP_Test_InteractablEdit.uasset and b/Content/Levels/Test/Actors/InteractablesTest/BP_Test_InteractablEdit.uasset differ diff --git a/Content/Levels/Test/Actors/BP_Test_InteractableActivate.uasset b/Content/Levels/Test/Actors/InteractablesTest/BP_Test_InteractableActivate.uasset similarity index 73% rename from Content/Levels/Test/Actors/BP_Test_InteractableActivate.uasset rename to Content/Levels/Test/Actors/InteractablesTest/BP_Test_InteractableActivate.uasset index 6ad2a6e..2e3078f 100644 Binary files a/Content/Levels/Test/Actors/BP_Test_InteractableActivate.uasset and b/Content/Levels/Test/Actors/InteractablesTest/BP_Test_InteractableActivate.uasset differ diff --git a/Content/Levels/Test/Actors/BP_Test_InteractableMove.uasset b/Content/Levels/Test/Actors/InteractablesTest/BP_Test_InteractableMove.uasset similarity index 71% rename from Content/Levels/Test/Actors/BP_Test_InteractableMove.uasset rename to Content/Levels/Test/Actors/InteractablesTest/BP_Test_InteractableMove.uasset index ef0899f..0ea5acc 100644 Binary files a/Content/Levels/Test/Actors/BP_Test_InteractableMove.uasset and b/Content/Levels/Test/Actors/InteractablesTest/BP_Test_InteractableMove.uasset differ diff --git a/Content/Levels/Test/L_Test.umap b/Content/Levels/Test/L_Test.umap index 9b857cd..7f4b37e 100644 Binary files a/Content/Levels/Test/L_Test.umap and b/Content/Levels/Test/L_Test.umap differ diff --git a/Content/Levels/Test/Sequences/Seq_TestCutscene.uasset b/Content/Levels/Test/Sequences/Seq_TestCutscene.uasset new file mode 100644 index 0000000..fa3a336 Binary files /dev/null and b/Content/Levels/Test/Sequences/Seq_TestCutscene.uasset differ diff --git a/Content/Misc/Materials/PostProcess/M_PP_Inverse.uasset b/Content/Misc/Materials/PostProcess/M_PP_Inverse.uasset new file mode 100644 index 0000000..ac2afb4 Binary files /dev/null and b/Content/Misc/Materials/PostProcess/M_PP_Inverse.uasset differ diff --git a/Content/UI/BP_MainWidgetManager.uasset b/Content/UI/BP_MainWidgetManager.uasset index dad1f45..b6fb3de 100644 Binary files a/Content/UI/BP_MainWidgetManager.uasset and b/Content/UI/BP_MainWidgetManager.uasset differ diff --git a/Content/UI/Blueprints/Interactables/UI_InteractableHint.uasset b/Content/UI/Blueprints/Interactables/UI_InteractableHint.uasset index 75f857f..62f38fc 100644 Binary files a/Content/UI/Blueprints/Interactables/UI_InteractableHint.uasset and b/Content/UI/Blueprints/Interactables/UI_InteractableHint.uasset differ diff --git a/Content/UI/Blueprints/Interactables/UI_InteractableHintManager.uasset b/Content/UI/Blueprints/Interactables/UI_InteractableHintManager.uasset new file mode 100644 index 0000000..15a99d5 Binary files /dev/null and b/Content/UI/Blueprints/Interactables/UI_InteractableHintManager.uasset differ diff --git a/Content/UI/Blueprints/Interactables/UI_InteractableHintWidgetManager.uasset b/Content/UI/Blueprints/Interactables/UI_InteractableHintWidgetManager.uasset deleted file mode 100644 index 63df904..0000000 Binary files a/Content/UI/Blueprints/Interactables/UI_InteractableHintWidgetManager.uasset and /dev/null differ diff --git a/Content/UI/Blueprints/UI_CutsceneSkip.uasset b/Content/UI/Blueprints/UI_CutsceneSkip.uasset new file mode 100644 index 0000000..bad66f3 Binary files /dev/null and b/Content/UI/Blueprints/UI_CutsceneSkip.uasset differ diff --git a/Lost_Edge.uproject b/Lost_Edge.uproject index cae4d3a..4534c52 100644 --- a/Lost_Edge.uproject +++ b/Lost_Edge.uproject @@ -1,6 +1,6 @@ { "FileVersion": 3, - "EngineAssociation": "5.4", + "EngineAssociation": "{42CC8720-4DDD-EF11-BECE-CEBF292119D8}", "Category": "", "Description": "", "Modules": [ diff --git a/Source/Lost_Edge/Lost_Edge.Build.cs b/Source/Lost_Edge/Lost_Edge.Build.cs index afd935b..6146c8f 100644 --- a/Source/Lost_Edge/Lost_Edge.Build.cs +++ b/Source/Lost_Edge/Lost_Edge.Build.cs @@ -6,15 +6,10 @@ public class Lost_Edge : ModuleRules { public Lost_Edge(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; - PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OpenCV" }); // "OpenCVHelper" + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OpenCV" }); - //PrivateIncludePaths.AddRange(new string[] { "OpenCV/Private" }); - - PrivateDependencyModuleNames.AddRange(new string[] { "EnhancedInput", "UMG", "RHI", "RenderCore", "Lost_EdgeShaders", "TextureCompressor" }); // "Slate", "SlateCore" - // Uncomment if you are using online features - // PrivateDependencyModuleNames.Add("OnlineSubsystem"); - - // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true + PrivateDependencyModuleNames.AddRange(new string[] { "EnhancedInput", "UMG", "RHI", "RenderCore", "Lost_EdgeShaders", "TextureCompressor", + "LevelSequence", "MovieScene" }); // "Slate", "SlateCore" // UE_LOG(LogTemp, Log, TEXT("capture: %s"), (capture ? TEXT("true") : TEXT("false"))); // GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("1")); diff --git a/Source/Lost_Edge/Private/CutsceneManager.cpp b/Source/Lost_Edge/Private/CutsceneManager.cpp new file mode 100644 index 0000000..5007cac --- /dev/null +++ b/Source/Lost_Edge/Private/CutsceneManager.cpp @@ -0,0 +1,169 @@ +// Oleg Petruny proprietary. + + +#include "CutsceneManager.h" + +#include "EnhancedInputComponent.h" +#include "InputMappingContext.h" +#include "Kismet/GameplayStatics.h" +#include "LevelSequence.h" +#include "LevelSequencePlayer.h" + +#include "CustomGameInstanceBase.h" +#include "MainGameModeBase.h" +#include "PlayerBase.h" +#include "Widgets/CutsceneSkipWidget.h" +#include "Widgets/InputAnimatedWidgetInterface.h" +#include "Widgets/WidgetsManager.h" + +UCutsceneManager::UCutsceneManager() +{ + _inputContext = { FSoftObjectPath{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/IMC_Cutscene.IMC_Cutscene'") } }; + if(auto world = GetWorld()) + { + if(auto GI = Cast(world->GetGameInstance())) + { + GI->inputContexts.Add(_inputContext); + } + } +} + +void UCutsceneManager::EnqueueSequence(ULevelSequence* sequence, FCutsceneEndCallback endCallback) +{ + if(!sequence) + return; + + if(_nextSequences.IsEmpty() && !_sequencePlayer) // most first sequence, so widgets and binds don't exist + { + if(auto PC = UGameplayStatics::GetPlayerController(GetWorld(), 0)) + { + _lastPlayer = Cast(PC->GetPawn()); + if(_lastPlayer) + { + _lastPlayer->LockPlayer({ .walk = true, .jump = true, .run = true, .interaction = true, .camera = true }); + + auto& mapping = _inputContext.LoadSynchronous()->GetMapping(0); + int32 handler1 = _lastPlayer->inputComponent->BindAction(mapping.Action, ETriggerEvent::Started, this, &UCutsceneManager::OnInputHold).GetHandle(); + int32 handler2 = _lastPlayer->inputComponent->BindAction(mapping.Action, ETriggerEvent::Completed, this, &UCutsceneManager::OnInputUnhold).GetHandle(); + _handlers = { handler1, handler2 }; + + if(auto WM = AMainGameModeBase::GetWidgetsManager()) + { + WM->HideWidgets(); + static FSkipCutsceneDelegate skipCutsceneDelegate; + if(!skipCutsceneDelegate.IsBound()) + skipCutsceneDelegate.BindDynamic(this, &UCutsceneManager::SkipSequence); + WM->EnableCutsceneWidget(mapping.Key.GetDisplayName(false), skipCutsceneDelegate); + } + } + } + } + + _nextSequences.Enqueue(sequence); + _endCallbacks.Enqueue(endCallback); + + PlayNextSequence(); +} + +void UCutsceneManager::PlayNextSequence() +{ + if(_sequencePlayer) + { + if(_sequencePlayer->IsPlaying()) + return; + else + _sequencePlayer->MarkAsGarbage(); + } + + ULevelSequence* sequence; + _nextSequences.Dequeue(sequence); + _sequencePlayer = ULevelSequencePlayer::CreateLevelSequencePlayer(GetWorld(), sequence, FMovieSceneSequencePlaybackSettings{}, _sequencePlayerActor); + _sequencePlayer->OnStop.AddDynamic(this, &UCutsceneManager::OnSequenceEnd); + _sequencePlayer->Play(); +} + +void UCutsceneManager::SkipSequence() +{ + if(!_sequencePlayer || !_sequencePlayer->IsPlaying()) + return; + + _lastlySkipped = true; + _sequencePlayer->GoToEndAndStop(); +} + +void UCutsceneManager::ClearQueue() +{ + if(!_nextSequences.IsEmpty()) + _nextSequences.Empty(); + if(!_endCallbacks.IsEmpty()) + _endCallbacks.Empty(); +} + +void UCutsceneManager::LockCallback(bool lock) +{ + _lockCallback = lock; +} + +void UCutsceneManager::OnSequenceEnd() +{ + if(_lockCallback) + return; + + _sequencePlayer->MarkAsGarbage(); + _sequencePlayer = nullptr; + + FCutsceneEndCallback callback; + _endCallbacks.Dequeue(callback); + if(callback.IsBound()) + callback.Execute(); + + if(!_nextSequences.IsEmpty()) + { + PlayNextSequence(); + if(_lastlySkipped) + { + _lastlySkipped = false; + if(_holding) + { + OnInputHold(); + } + } + return; + } + + if(auto WM = AMainGameModeBase::GetWidgetsManager()) + { + WM->DisableCutsceneWidget(); + WM->ShowWidgets(); + } + + if(_lastPlayer) + { + _lastPlayer->UnlockPlayer({ .walk = true, .jump = true, .run = true, .interaction = true, .camera = true }); + + _lastPlayer->inputComponent->RemoveBindingByHandle(_handlers.Key); + _lastPlayer->inputComponent->RemoveBindingByHandle(_handlers.Value); + + _lastPlayer = nullptr; + } +} + +void UCutsceneManager::OnInputHold() +{ + _holding = true; + + if(auto WM = AMainGameModeBase::GetWidgetsManager()) + { + WM->AnimateCutsceneWidget(EInputAnimatedWidgetAnimation::Hold); + } +} + +void UCutsceneManager::OnInputUnhold() +{ + _holding = false; + + if(auto WM = AMainGameModeBase::GetWidgetsManager()) + { + WM->AnimateCutsceneWidget(EInputAnimatedWidgetAnimation::Unhold); + } +} diff --git a/Source/Lost_Edge/Private/CutsceneManager.h b/Source/Lost_Edge/Private/CutsceneManager.h new file mode 100644 index 0000000..49e6c68 --- /dev/null +++ b/Source/Lost_Edge/Private/CutsceneManager.h @@ -0,0 +1,48 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "UObject/Object.h" + +#include "CutsceneManager.generated.h" + +DECLARE_DYNAMIC_DELEGATE(FCutsceneEndCallback); + +UCLASS(BlueprintType) +class UCutsceneManager : public UObject +{ + GENERATED_BODY() + +public: + UCutsceneManager(); + + UFUNCTION(BlueprintCallable) + void EnqueueSequence(class ULevelSequence* sequence, FCutsceneEndCallback endCallback); + + UFUNCTION(BlueprintCallable) + void SkipSequence(); + + void ClearQueue(); + void LockCallback(bool lock); + +private: + void PlayNextSequence(); + UFUNCTION() + void OnSequenceEnd(); + + void OnInputHold(); + void OnInputUnhold(); + + class ULevelSequencePlayer* _sequencePlayer = nullptr; + class ALevelSequenceActor* _sequencePlayerActor = nullptr; + TQueue _nextSequences; + TQueue _endCallbacks; + + class APlayerBase* _lastPlayer = nullptr; + TSoftObjectPtr _inputContext; + TPair _handlers; + + bool _lockCallback = false; + bool _lastlySkipped = false; + bool _holding = false; +}; diff --git a/Source/Lost_Edge/Private/Interactable/Activators/InteractableActivator.h b/Source/Lost_Edge/Private/Interactable/Activators/InteractableActivator.h index 9a3011c..cdfac51 100644 --- a/Source/Lost_Edge/Private/Interactable/Activators/InteractableActivator.h +++ b/Source/Lost_Edge/Private/Interactable/Activators/InteractableActivator.h @@ -5,7 +5,7 @@ #include "Components/SceneComponent.h" #include "CoreMinimal.h" -#include "../Interactable.h" +#include "Interactable/Interactable.h" #include "InteractableActivator.generated.h" diff --git a/Source/Lost_Edge/Private/Interactable/Interactable.cpp b/Source/Lost_Edge/Private/Interactable/Interactable.cpp index 8f337b9..539a543 100644 --- a/Source/Lost_Edge/Private/Interactable/Interactable.cpp +++ b/Source/Lost_Edge/Private/Interactable/Interactable.cpp @@ -5,10 +5,10 @@ #include "Kismet/GameplayStatics.h" -#include "../MainGameModeBase.h" -#include "../PlayerBase.h" -#include "../Widgets/WidgetsManager.h" +#include "MainGameModeBase.h" #include "Modificators/InteractableModificator.h" +#include "PlayerBase.h" +#include "Widgets/WidgetsManager.h" int32 AInteractable::GetActivatedFlags() { @@ -90,7 +90,7 @@ void AInteractable::_Activate(EActivatorType type) || !activationLockers.IsEmpty()) return; - if(auto WM = AMainGameModeBase::GetWidgetManager()) + if(auto WM = AMainGameModeBase::GetWidgetsManager()) { for(const auto& modificator : modificators) { @@ -119,7 +119,7 @@ void AInteractable::_Deactivate(EActivatorType type) || !activationLockers.IsEmpty()) return; - if(auto WM = AMainGameModeBase::GetWidgetManager()) + if(auto WM = AMainGameModeBase::GetWidgetsManager()) { for(const auto& modificator : modificators) { diff --git a/Source/Lost_Edge/Private/Interactable/Interactable.h b/Source/Lost_Edge/Private/Interactable/Interactable.h index 18c372d..5f48267 100644 --- a/Source/Lost_Edge/Private/Interactable/Interactable.h +++ b/Source/Lost_Edge/Private/Interactable/Interactable.h @@ -7,8 +7,9 @@ #include "Interactable.generated.h" -#define INTERACTABLE_DEBUG +//#define INTERACTABLE_DEBUG //#define INTERACTABLE_ACTIVATOR_DEBUG +//#define INTERACTABLE_MODIFICATOR_DEBUG UENUM(BlueprintType, meta = (Bitflags, UseEnumValuesAsMaskValuesInEditor = "true")) enum class EActivatorType : uint8 diff --git a/Source/Lost_Edge/Private/Interactable/Modificators/ActivateInteractableModificator.cpp b/Source/Lost_Edge/Private/Interactable/Modificators/ActivateInteractableModificator.cpp index 15bfa89..a535557 100644 --- a/Source/Lost_Edge/Private/Interactable/Modificators/ActivateInteractableModificator.cpp +++ b/Source/Lost_Edge/Private/Interactable/Modificators/ActivateInteractableModificator.cpp @@ -51,6 +51,6 @@ void UActivateInteractableModificator::Unbind_Implementation() void UActivateInteractableModificator::ActivateInteractable() { - AMainGameModeBase::GetWidgetManager()->AnimateInteractionHint(this, 0, EInteractableHintWidgetAnimation::Click); + AMainGameModeBase::GetWidgetsManager()->AnimateInteractionHint(this, 0, EInputAnimatedWidgetAnimation::Click); OnActivated.Broadcast(); } diff --git a/Source/Lost_Edge/Private/Interactable/Modificators/EditInteractableModificator.cpp b/Source/Lost_Edge/Private/Interactable/Modificators/EditInteractableModificator.cpp index 804caa2..7f706b2 100644 --- a/Source/Lost_Edge/Private/Interactable/Modificators/EditInteractableModificator.cpp +++ b/Source/Lost_Edge/Private/Interactable/Modificators/EditInteractableModificator.cpp @@ -3,7 +3,7 @@ #include "EditInteractableModificator.h" -#include "../Interactable.h" +#include "Interactable/Interactable.h" UEditInteractableModificator::UEditInteractableModificator(const FObjectInitializer& ObjectInitializer) : UInteractableModificator(ObjectInitializer) diff --git a/Source/Lost_Edge/Private/Interactable/Modificators/InteractableModificator.h b/Source/Lost_Edge/Private/Interactable/Modificators/InteractableModificator.h index 4d3b4f0..fbc173f 100644 --- a/Source/Lost_Edge/Private/Interactable/Modificators/InteractableModificator.h +++ b/Source/Lost_Edge/Private/Interactable/Modificators/InteractableModificator.h @@ -31,11 +31,10 @@ public: virtual void Unbind_Implementation() {} protected: - - UPROPERTY(EditDefaultsOnly) + UPROPERTY(EditDefaultsOnly, NoClear) TSoftObjectPtr inputMapping; - UPROPERTY(EditAnywhere, meta = (Bitmask, BitmaskEnum = "EActivatorType")) + UPROPERTY(EditDefaultsOnly, NoClear, meta = (Bitmask, BitmaskEnum = "EActivatorType")) int32 activatorTypes = 0; }; diff --git a/Source/Lost_Edge/Private/Interactable/Modificators/MoveInteractableModificator.cpp b/Source/Lost_Edge/Private/Interactable/Modificators/MoveInteractableModificator.cpp index 19d7e15..59e35c4 100644 --- a/Source/Lost_Edge/Private/Interactable/Modificators/MoveInteractableModificator.cpp +++ b/Source/Lost_Edge/Private/Interactable/Modificators/MoveInteractableModificator.cpp @@ -99,30 +99,30 @@ void UMoveInteractableModificator::TurnOnHolding() holding = true; ProcessState(); distance = (player->GetCameraLocation() - actor->GetActorLocation()).Length(); - AMainGameModeBase::GetWidgetManager()->AnimateInteractionHint(this, 0, EInteractableHintWidgetAnimation::Hold); + AMainGameModeBase::GetWidgetsManager()->AnimateInteractionHint(this, 0, EInputAnimatedWidgetAnimation::Hold); OnHolding.Broadcast(); } void UMoveInteractableModificator::TurnOffHolding() { holding = false; ProcessState(); - AMainGameModeBase::GetWidgetManager()->AnimateInteractionHint(this, 0, EInteractableHintWidgetAnimation::Unhold); + AMainGameModeBase::GetWidgetsManager()->AnimateInteractionHint(this, 0, EInputAnimatedWidgetAnimation::Unhold); } void UMoveInteractableModificator::TurnOnRotating() { rotating = true; - player->cameraLocked = true; + player->LockPlayer({ .camera = true }); ProcessState(); - AMainGameModeBase::GetWidgetManager()->AnimateInteractionHint(this, 1, EInteractableHintWidgetAnimation::Hold); + AMainGameModeBase::GetWidgetsManager()->AnimateInteractionHint(this, 1, EInputAnimatedWidgetAnimation::Hold); OnRotating.Broadcast(); } void UMoveInteractableModificator::TurnOffRotating() { rotating = false; - player->cameraLocked = false; + player->UnlockPlayer({ .camera = true }); ProcessState(); - AMainGameModeBase::GetWidgetManager()->AnimateInteractionHint(this, 1, EInteractableHintWidgetAnimation::Unhold); + AMainGameModeBase::GetWidgetsManager()->AnimateInteractionHint(this, 1, EInputAnimatedWidgetAnimation::Unhold); } void UMoveInteractableModificator::ProcessState() @@ -150,10 +150,24 @@ void UMoveInteractableModificator::UpdatePosition() auto camLoc = player->GetCameraLocation(); auto dir = player->GetCameraDirection(); auto newLoc = camLoc + dir * distance; - //auto oldLoc = actor->GetActorLocation(); + auto oldLoc = actor->GetActorLocation(); //auto interpLoc = FMath::VInterpTo(oldLoc, newLoc, GetWorld()->GetDeltaSeconds(), 20.0f); //auto interpLoc = FMath::Lerp(oldLoc, newLoc, 0.5f); - actor->SetActorLocation(newLoc, true, nullptr, ETeleportType::None); + FHitResult hit; + actor->SetActorLocation(newLoc, true, &hit, ETeleportType::None); + + static bool indicating = false; + if(hit.bBlockingHit && !indicating) + { + indicating = true; + AMainGameModeBase::GetWidgetsManager()->AnimateInteractionHint(this, 0, EInputAnimatedWidgetAnimation::TurnOnIndication); + } + else if(!hit.bBlockingHit && indicating) + { + indicating = false; + AMainGameModeBase::GetWidgetsManager()->AnimateInteractionHint(this, 0, EInputAnimatedWidgetAnimation::TurnOffIndication); + } + } void UMoveInteractableModificator::Zooming(const FInputActionValue& value) diff --git a/Source/Lost_Edge/Private/Interactable/Modificators/SawInteractableModificator.cpp b/Source/Lost_Edge/Private/Interactable/Modificators/SawInteractableModificator.cpp index de1baeb..3166fde 100644 --- a/Source/Lost_Edge/Private/Interactable/Modificators/SawInteractableModificator.cpp +++ b/Source/Lost_Edge/Private/Interactable/Modificators/SawInteractableModificator.cpp @@ -3,7 +3,7 @@ #include "SawInteractableModificator.h" -#include "../Interactable.h" +#include "Interactable/Interactable.h" USawInteractableModificator::USawInteractableModificator(const FObjectInitializer& ObjectInitializer) : UInteractableModificator(ObjectInitializer) diff --git a/Source/Lost_Edge/Private/MainGameModeBase.cpp b/Source/Lost_Edge/Private/MainGameModeBase.cpp index 521ca9e..8db3f11 100644 --- a/Source/Lost_Edge/Private/MainGameModeBase.cpp +++ b/Source/Lost_Edge/Private/MainGameModeBase.cpp @@ -9,39 +9,53 @@ #include "UObject/ScriptInterface.h" #include "CustomGameInstanceBase.h" +#include "CutsceneManager.h" #include "Widgets/WidgetsManager.h" UWidgetsManager* AMainGameModeBase::_widgetsManager = nullptr; +UCutsceneManager* AMainGameModeBase::_cutsceneManager = nullptr; void AMainGameModeBase::StartPlay() { + _widgetsManager = NewObject(this, widgetManagerClass); + _cutsceneManager = NewObject(this); + AGameModeBase::StartPlay(); - _widgetsManager = NewObject(this, widgetManagerClass); _widgetsManager->Init(); } +void AMainGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason) +{ + _cutsceneManager->LockCallback(true); + _cutsceneManager->ClearQueue(); +} + bool AMainGameModeBase::SetPause(APlayerController* PC, FCanUnpause CanUnpauseDelegate) { if(_widgetsManager) { if(IsPaused()) { - _widgetsManager->HideOverlayWidgets(); + _widgetsManager->HideWidgets(); } else { - _widgetsManager->ShowOverlayWidgets(); + _widgetsManager->ShowWidgets(); } } return AGameModeBase::SetPause(PC, CanUnpauseDelegate); } -UWidgetsManager* AMainGameModeBase::GetWidgetManager() +UWidgetsManager* AMainGameModeBase::GetWidgetsManager() { return _widgetsManager; } +UCutsceneManager* AMainGameModeBase::GetCutsceneManager() +{ + return _cutsceneManager; +} void AMainGameModeBase::SwitchCameraMode() { @@ -72,6 +86,6 @@ void AMainGameModeBase::SwitchCameraMode() if(_widgetsManager) { - _widgetsManager->UpdateOverlayWidgetsOwner(); + _widgetsManager->UpdateWidgetsOwner(); } } diff --git a/Source/Lost_Edge/Private/MainGameModeBase.h b/Source/Lost_Edge/Private/MainGameModeBase.h index 0d91121..28287f2 100644 --- a/Source/Lost_Edge/Private/MainGameModeBase.h +++ b/Source/Lost_Edge/Private/MainGameModeBase.h @@ -14,11 +14,15 @@ class AMainGameModeBase : public AGameModeBase public: virtual void StartPlay() override; + virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; virtual bool SetPause(APlayerController* PC, FCanUnpause CanUnpauseDelegate = FCanUnpause()) override; void SwitchCameraMode(); - static class UWidgetsManager* GetWidgetManager(); + UFUNCTION(BlueprintCallable) + static class UWidgetsManager* GetWidgetsManager(); + UFUNCTION(BlueprintCallable) + static class UCutsceneManager* GetCutsceneManager(); protected: UPROPERTY(EditDefaultsOnly) @@ -26,4 +30,5 @@ protected: private: static class UWidgetsManager* _widgetsManager; + static class UCutsceneManager* _cutsceneManager; }; diff --git a/Source/Lost_Edge/Private/PlayerBase.cpp b/Source/Lost_Edge/Private/PlayerBase.cpp index 168acf3..0247800 100644 --- a/Source/Lost_Edge/Private/PlayerBase.cpp +++ b/Source/Lost_Edge/Private/PlayerBase.cpp @@ -14,6 +14,7 @@ #include "CustomGameInstanceBase.h" #include "CustomGameUserSettings.h" #include "Interactable/Activators/InteractableActivator.h" +#include "Interactable/Interactable.h" #include "Interactable/Modificators/InteractableModificator.h" #include "MainGameModeBase.h" @@ -87,26 +88,22 @@ void APlayerBase::BeginPlay() LoadInteractablesActivators(); } -APlayerBase* APlayerBase::LockCamera(UWorld* world, bool locked) +void APlayerBase::LockPlayer(FPlayerLock lock) { - if(auto PC = UGameplayStatics::GetPlayerController(world, 0)) - { - if(auto pawn = Cast(PC->GetPawn())) - { - pawn->cameraLocked = locked; - return pawn; - } - } - - return nullptr; + walkLocked += lock.walk; + jumpLocked += lock.jump; + runLocked += lock.run; + interactionLocked += lock.interaction; + cameraLocked += lock.camera; } -void APlayerBase::AttachToCamera(AActor* actor) +void APlayerBase::UnlockPlayer(FPlayerLock lock) { - if(!actor) - return; - - actor->AttachToComponent(camera, FAttachmentTransformRules::KeepWorldTransform); + walkLocked -= lock.walk; + jumpLocked -= lock.jump; + runLocked -= lock.run; + interactionLocked -= lock.interaction; + cameraLocked -= lock.camera; } FVector APlayerBase::GetCameraDirection() @@ -142,7 +139,7 @@ void APlayerBase::MoveCamera(FVector2D value) void APlayerBase::MoveCharacter(FVector2D value) { - if(moveLocked) + if(walkLocked) return; moveVector = GetActorRightVector() * value.X; diff --git a/Source/Lost_Edge/Private/PlayerBase.h b/Source/Lost_Edge/Private/PlayerBase.h index 7cb8ffe..cdc8f4f 100644 --- a/Source/Lost_Edge/Private/PlayerBase.h +++ b/Source/Lost_Edge/Private/PlayerBase.h @@ -2,16 +2,27 @@ #pragma once -#include "CoreMinimal.h" #include "GameFramework/Character.h" -#include "Interactable/Interactable.h" - #include "PlayerBase.generated.h" +enum class EActivatorType : uint8; + DECLARE_DYNAMIC_MULTICAST_DELEGATE(FPlayerMovedDelegate); -UCLASS() +USTRUCT(BlueprintType) +struct FPlayerLock +{ + GENERATED_BODY() + + uint8 walk : 1; + uint8 jump : 1; + uint8 run : 1; + uint8 interaction : 1; + uint8 camera : 1; +}; + +UCLASS(Blueprintable, BlueprintType) class APlayerBase : public ACharacter { GENERATED_BODY() @@ -22,21 +33,18 @@ public: virtual void Tick(float DeltaTime) override; virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; - static APlayerBase* LockCamera(UWorld* world, bool locked); - void AttachToCamera(AActor* actor); FVector GetCameraLocation(); FVector GetCameraDirection(); bool IsMoving() { return isMoving; } + void LockPlayer(const FPlayerLock lock); + void UnlockPlayer(const FPlayerLock lock); UPROPERTY(BlueprintAssignable) FPlayerMovedDelegate OnPlayerMoved; FVector moveVector; class UEnhancedInputComponent* inputComponent; - UPROPERTY(EditAnywhere) - bool interactionLocked = false; - UPROPERTY(EditAnywhere) - bool cameraLocked = false; + protected: virtual void BeginPlay() override; @@ -61,12 +69,16 @@ protected: UPROPERTY(EditAnywhere) float runSpeedMultiplier = 4; - UPROPERTY(EditAnywhere) - bool moveLocked = false; - UPROPERTY(EditAnywhere) - bool jumpLocked = false; - UPROPERTY(EditAnywhere) - bool runLocked = false; + UPROPERTY(EditAnywhere, BlueprintReadWrite) + uint8 walkLocked = 0; + UPROPERTY(EditAnywhere, BlueprintReadWrite) + uint8 jumpLocked = 0; + UPROPERTY(EditAnywhere, BlueprintReadWrite) + uint8 runLocked = 0; + UPROPERTY(EditAnywhere, BlueprintReadWrite) + uint8 interactionLocked = 0; + UPROPERTY(EditAnywhere, BlueprintReadWrite) + uint8 cameraLocked = 0; APlayerCameraManager* cameraManager; class UCameraComponent* camera; @@ -80,8 +92,8 @@ protected: private: void LoadInteractablesActivators(); - void InteractableActivated(AInteractable* interactable, EActivatorType type); - void InteractableDeactivated(AInteractable* interactable, EActivatorType type); + void InteractableActivated(class AInteractable* interactable, EActivatorType type); + void InteractableDeactivated(class AInteractable* interactable, EActivatorType type); FVector oldLocation; FRotator rotationInput; diff --git a/Source/Lost_Edge/Private/Widgets/CutsceneSkipWidget.h b/Source/Lost_Edge/Private/Widgets/CutsceneSkipWidget.h new file mode 100644 index 0000000..748c4bd --- /dev/null +++ b/Source/Lost_Edge/Private/Widgets/CutsceneSkipWidget.h @@ -0,0 +1,27 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "InputAnimatedWidgetInterface.h" +#include "ResolutionResponsiveUserWidget.h" + +#include "CutsceneSkipWidget.generated.h" + +DECLARE_DYNAMIC_DELEGATE(FSkipCutsceneDelegate); + +UCLASS(Blueprintable) +class UCutsceneSkipWidget : public UResolutionResponsiveUserWidget, public IInputAnimatedWidgetInterface +{ + GENERATED_BODY() + +public: + FSkipCutsceneDelegate skipCutsceneDelegate; + + UPROPERTY(meta = (BindWidget)) + class UTextBlock* keyText; + +protected: + UFUNCTION(BlueprintCallable) + void SkipCutscene() { skipCutsceneDelegate.Execute(); } + +}; diff --git a/Source/Lost_Edge/Private/Widgets/InputAnimatedWidgetInterface.h b/Source/Lost_Edge/Private/Widgets/InputAnimatedWidgetInterface.h new file mode 100644 index 0000000..f886a64 --- /dev/null +++ b/Source/Lost_Edge/Private/Widgets/InputAnimatedWidgetInterface.h @@ -0,0 +1,65 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "UObject/Interface.h" + +#include "InputAnimatedWidgetInterface.generated.h" + +UENUM(BlueprintType) +enum class EInputAnimatedWidgetAnimation : uint8 +{ + Click, + Hold, + Unhold, + TurnOnIndication, + TurnOffIndication +}; + +UINTERFACE(MinimalAPI, Blueprintable) +class UInputAnimatedWidgetInterface : public UInterface +{ + GENERATED_BODY() +}; + +class IInputAnimatedWidgetInterface +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "InputAnimatedWidget") + void OnClick(); + UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "InputAnimatedWidget") + void OnHold(); + UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "InputAnimatedWidget") + void OnUnhold(); + UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "InputAnimatedWidget") + void OnTurnOnIndication(); + UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "InputAnimatedWidget") + void OnTurnOffIndication(); + + // Unsafe C++ shortcut + void RunAnimation(const EInputAnimatedWidgetAnimation animation) + { + switch(animation) + { + case EInputAnimatedWidgetAnimation::Click: + Execute_OnClick(this->_getUObject()); + break; + case EInputAnimatedWidgetAnimation::Hold: + Execute_OnHold(this->_getUObject()); + break; + case EInputAnimatedWidgetAnimation::Unhold: + Execute_OnUnhold(this->_getUObject()); + break; + case EInputAnimatedWidgetAnimation::TurnOnIndication: + Execute_OnTurnOnIndication(this->_getUObject()); + break; + case EInputAnimatedWidgetAnimation::TurnOffIndication: + Execute_OnTurnOffIndication(this->_getUObject()); + break; + default: + break; + } + } +}; \ No newline at end of file diff --git a/Source/Lost_Edge/Private/Widgets/InteractableHintWidget.cpp b/Source/Lost_Edge/Private/Widgets/InteractableHintWidget.cpp deleted file mode 100644 index 9749e11..0000000 --- a/Source/Lost_Edge/Private/Widgets/InteractableHintWidget.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// Oleg Petruny proprietary. - - -#include "InteractableHintWidget.h" diff --git a/Source/Lost_Edge/Private/Widgets/InteractableHintWidget.h b/Source/Lost_Edge/Private/Widgets/InteractableHintWidget.h index c926143..329a7ae 100644 --- a/Source/Lost_Edge/Private/Widgets/InteractableHintWidget.h +++ b/Source/Lost_Edge/Private/Widgets/InteractableHintWidget.h @@ -2,34 +2,17 @@ #pragma once -#include "CoreMinimal.h" +#include "InputAnimatedWidgetInterface.h" #include "ResolutionResponsiveUserWidget.h" #include "InteractableHintWidget.generated.h" -UENUM(BlueprintType) -enum class EInteractableHintWidgetAnimation : uint8 -{ - Click, - Hold, - Unhold -}; - UCLASS(Blueprintable) -class UInteractableHintWidget : public UResolutionResponsiveUserWidget +class UInteractableHintWidget : public UResolutionResponsiveUserWidget, public IInputAnimatedWidgetInterface { GENERATED_BODY() public: - UFUNCTION(BlueprintImplementableEvent) - void OnClick(); - - UFUNCTION(BlueprintImplementableEvent) - void OnHold(); - - UFUNCTION(BlueprintImplementableEvent) - void OnUnhold(); - UPROPERTY(meta = (BindWidget)) class UTextBlock* keyText; UPROPERTY(meta = (BindWidget)) diff --git a/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.cpp b/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.cpp index 3718b15..5b76111 100644 --- a/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.cpp +++ b/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.cpp @@ -12,10 +12,16 @@ #include "Widgets/InteractableHintWidget.h" -void UInteractableHintWidgetManager::Append(const class UInteractableModificator* modificator) +void UInteractableHintWidgetManager::Append(const UInteractableModificator* modificator) { FScopeLock Lock(&hintsLock); + if(!modificator) + { + hints->SetVisibility(ESlateVisibility::Visible); + return; + } + if(hintsMap.Contains(modificator)) return; @@ -46,10 +52,16 @@ void UInteractableHintWidgetManager::Append(const class UInteractableModificator hintsMap.Add(modificator, { count - mappings.Num() + skipped, mappings.Num() - skipped }); } -void UInteractableHintWidgetManager::Remove(const class UInteractableModificator* modificator) +void UInteractableHintWidgetManager::Remove(const UInteractableModificator* modificator) { FScopeLock Lock(&hintsLock); + if(!modificator) + { + hints->SetVisibility(ESlateVisibility::Hidden); + return; + } + if(!hintsMap.Contains(modificator)) return; @@ -66,8 +78,8 @@ void UInteractableHintWidgetManager::Remove(const class UInteractableModificator hintsMap.Remove(modificator); } -void UInteractableHintWidgetManager::AnimateInteractionHint(const class UInteractableModificator* modificator, const int32 index, - const EInteractableHintWidgetAnimation animation) +void UInteractableHintWidgetManager::AnimateInteractionHint(const UInteractableModificator* modificator, const int32 index, + const EInputAnimatedWidgetAnimation animation) { FScopeLock Lock(&hintsLock); @@ -76,18 +88,5 @@ void UInteractableHintWidgetManager::AnimateInteractionHint(const class UInterac auto& indexAndCount = hintsMap[modificator]; auto hint = Cast(hints->GetChildAt(indexAndCount.Key + index)); - switch(animation) - { - case EInteractableHintWidgetAnimation::Click: - hint->OnClick(); - break; - case EInteractableHintWidgetAnimation::Hold: - hint->OnHold(); - break; - case EInteractableHintWidgetAnimation::Unhold: - hint->OnUnhold(); - break; - default: - break; - } + hint->RunAnimation(animation); } \ No newline at end of file diff --git a/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.h b/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.h index 02b0cfb..96fd045 100644 --- a/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.h +++ b/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.h @@ -6,6 +6,8 @@ #include "InteractableHintWidgetManager.generated.h" +enum class EInputAnimatedWidgetAnimation : uint8; + UCLASS(Blueprintable) class UInteractableHintWidgetManager : public UUserWidget { @@ -14,7 +16,7 @@ class UInteractableHintWidgetManager : public UUserWidget public: void Append(const class UInteractableModificator* modificator); void Remove(const class UInteractableModificator* modificator); - void AnimateInteractionHint(const class UInteractableModificator* modificator, const int32 index, const EInteractableHintWidgetAnimation animation); + void AnimateInteractionHint(const class UInteractableModificator* modificator, const int32 index, const EInputAnimatedWidgetAnimation animation); protected: UPROPERTY(EditDefaultsOnly) diff --git a/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp b/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp index cbc5926..b49fabc 100644 --- a/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp +++ b/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp @@ -4,6 +4,7 @@ #include "WidgetsManager.h" #include "Blueprint/UserWidget.h" +#include "Components/TextBlock.h" #include "Engine/World.h" #include "InputMappingContext.h" #include "Kismet/GameplayStatics.h" @@ -13,6 +14,7 @@ #include "Interactable/Interactable.h" #include "Interactable/Modificators/InteractableModificator.h" #include "InteractableHintWidgetManager.h" +#include "Widgets/CutsceneSkipWidget.h" void UWidgetsManager::Init() { @@ -37,66 +39,73 @@ void UWidgetsManager::Init() if(auto instance = CreateWidget(PC, interactableHintWidgetManagerClass)) { interactableHintWidgetManager = instance; - instance->AddToViewport(); + interactableHintWidgetManager->AddToViewport(); + } + if(auto instance = CreateWidget(PC, cutsceneSkipWidgetClass)) + { + cutsceneSkipWidget = instance; + cutsceneSkipWidget->SetVisibility(ESlateVisibility::Hidden); + cutsceneSkipWidget->AddToViewport(); } } } -void UWidgetsManager::HideOverlayWidgets() +void UWidgetsManager::HideWidgets() { for(auto& widget : overlayWidgetsInstances) - { - if(widget.IsValid()) - { - widget->SetVisibility(ESlateVisibility::Hidden); - } - } + widget->SetVisibility(ESlateVisibility::Hidden); + + if(interactableHintWidgetManager) + interactableHintWidgetManager->Remove(nullptr); } -void UWidgetsManager::ShowOverlayWidgets() +void UWidgetsManager::ShowWidgets() { for(auto& widget : overlayWidgetsInstances) - { - if(widget.IsValid()) - { - widget->SetVisibility(ESlateVisibility::Visible); - } - } + widget->SetVisibility(ESlateVisibility::Visible); + + if(interactableHintWidgetManager) + interactableHintWidgetManager->Append(nullptr); } -void UWidgetsManager::UpdateOverlayWidgetsOwner() +void UWidgetsManager::UpdateWidgetsOwner() { if(auto PC = UGameplayStatics::GetPlayerController(GetWorld(), 0)) { for(auto& widget : permaOverlayWidgetsInstances) - { - if(widget.IsValid()) - { - widget->SetOwningPlayer(PC); - } - } + widget->SetOwningPlayer(PC); for(auto& widget : overlayWidgetsInstances) - { - if(widget.IsValid()) - { - widget->SetOwningPlayer(PC); - } - } + widget->SetOwningPlayer(PC); } } void UWidgetsManager::ShowInteractionHints(const UInteractableModificator* modificator) { - if(interactableHintWidgetManager.IsValid()) + if(interactableHintWidgetManager) interactableHintWidgetManager->Append(modificator); } void UWidgetsManager::HideInteractionHints(const UInteractableModificator* modificator) { - if(interactableHintWidgetManager.IsValid()) + if(interactableHintWidgetManager) interactableHintWidgetManager->Remove(modificator); } -void UWidgetsManager::AnimateInteractionHint(const class UInteractableModificator* modificator, const int32 index, const EInteractableHintWidgetAnimation animation) +void UWidgetsManager::AnimateInteractionHint(const UInteractableModificator* modificator, const int32 index, const EInputAnimatedWidgetAnimation animation) { - if(interactableHintWidgetManager.IsValid()) + if(interactableHintWidgetManager) interactableHintWidgetManager->AnimateInteractionHint(modificator, index, animation); -} \ No newline at end of file +} + +void UWidgetsManager::EnableCutsceneWidget(FText keyText, FSkipCutsceneDelegate& skipCutsceneDelegate) +{ + cutsceneSkipWidget->keyText->SetText(keyText); + cutsceneSkipWidget->skipCutsceneDelegate = skipCutsceneDelegate; + cutsceneSkipWidget->SetVisibility(ESlateVisibility::Visible); +} +void UWidgetsManager::DisableCutsceneWidget() +{ + cutsceneSkipWidget->SetVisibility(ESlateVisibility::Hidden); +} +void UWidgetsManager::AnimateCutsceneWidget(const EInputAnimatedWidgetAnimation animation) +{ + cutsceneSkipWidget->RunAnimation(animation); +} diff --git a/Source/Lost_Edge/Private/Widgets/WidgetsManager.h b/Source/Lost_Edge/Private/Widgets/WidgetsManager.h index de71206..f2acf6f 100644 --- a/Source/Lost_Edge/Private/Widgets/WidgetsManager.h +++ b/Source/Lost_Edge/Private/Widgets/WidgetsManager.h @@ -2,12 +2,11 @@ #pragma once -#include "CoreMinimal.h" #include "UObject/Object.h" #include "WidgetsManager.generated.h" -enum class EInteractableHintWidgetAnimation : uint8; +enum class EInputAnimatedWidgetAnimation : uint8; UCLASS(Blueprintable) class UWidgetsManager : public UObject @@ -17,24 +16,32 @@ class UWidgetsManager : public UObject public: void Init(); - void HideOverlayWidgets(); - void ShowOverlayWidgets(); - void UpdateOverlayWidgetsOwner(); + void ShowWidgets(); + void HideWidgets(); + void UpdateWidgetsOwner(); void ShowInteractionHints(const class UInteractableModificator* modificator); void HideInteractionHints(const class UInteractableModificator* modificator); - void AnimateInteractionHint(const class UInteractableModificator* modificator, const int32 index, const EInteractableHintWidgetAnimation animation); + void AnimateInteractionHint(const class UInteractableModificator* modificator, const int32 index, const EInputAnimatedWidgetAnimation animation); + + void EnableCutsceneWidget(FText keyText, class FSkipCutsceneDelegate& skipCutsceneDelegate); + void DisableCutsceneWidget(); + void AnimateCutsceneWidget(const EInputAnimatedWidgetAnimation animation); protected: UPROPERTY(EditDefaultsOnly) TSet> permaOverlayWidgets; // never hidden - TArray> permaOverlayWidgetsInstances; + TArray permaOverlayWidgetsInstances; UPROPERTY(EditDefaultsOnly) TSet> overlayWidgets; // hidden in pause - TArray> overlayWidgetsInstances; + TArray overlayWidgetsInstances; UPROPERTY(EditDefaultsOnly) TSubclassOf interactableHintWidgetManagerClass; - TWeakObjectPtr interactableHintWidgetManager; + class UInteractableHintWidgetManager* interactableHintWidgetManager = nullptr; + + UPROPERTY(EditDefaultsOnly) + TSubclassOf cutsceneSkipWidgetClass; + class UCutsceneSkipWidget* cutsceneSkipWidget = nullptr; };