Fishing, RythmClick minigames, bugfixes
This commit is contained in:
parent
9c03eee1d5
commit
7c1610534c
BIN
Content/Audio/Music/Level2/Minigames/SW_Minigame_RythmClick.uasset
(Stored with Git LFS)
BIN
Content/Audio/Music/Level2/Minigames/SW_Minigame_RythmClick.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Audio/Music/Minigames/SW_Minigame_RythmClick.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Audio/Music/Minigames/SW_Minigame_RythmClick.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/BP_CustomGameInstance.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/BP_CustomGameInstance.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Characters/BP_Player.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Characters/BP_Player.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Characters/StealthGuard/BP_StealthGuardAIController.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Characters/StealthGuard/BP_StealthGuardAIController.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Minigames/AgeOfWar/BP_Minigame_AgeOfWar.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/AgeOfWar/BP_Minigame_AgeOfWar.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/CrossyRoad/BP_Minigame_CrossyRoadManager.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/CrossyRoad/BP_Minigame_CrossyRoadManager.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/Fishing/BP_Minigame_FishingManager.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/Fishing/BP_Minigame_FishingManager.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/Fishing/UI_Minigame_Fishing.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/Fishing/UI_Minigame_Fishing.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/RythmClick/BP_Minigame_RythmClickManager.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/RythmClick/BP_Minigame_RythmClickManager.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/RythmClick/UI/Textures/T_Minigame_RuthmClick_Button.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Minigames/RythmClick/UI/Textures/T_Minigame_RuthmClick_Button.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Minigames/RythmClick/UI/Textures/T_Minigame_RuthmClick_ButtonBorder.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Minigames/RythmClick/UI/Textures/T_Minigame_RuthmClick_ButtonBorder.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Minigames/RythmClick/UI/UIC_Minigame_RythmClick_Button.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Minigames/RythmClick/UI/UIC_Minigame_RythmClick_Button.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Minigames/RythmClick/UI/UI_Minigame_RythmClick_Canvas.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Minigames/RythmClick/UI/UI_Minigame_RythmClick_Canvas.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Minigames/RythmClick/UIC_Minigame_RythmClickButton.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/RythmClick/UIC_Minigame_RythmClickButton.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/RythmClick/UI_Minigame_RythmClickCanvas.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/RythmClick/UI_Minigame_RythmClickCanvas.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_Minigame_SubwaySurfManager.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_Minigame_SubwaySurfManager.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_Minigame_SubwaySurf_ObstacleBig.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_Minigame_SubwaySurf_ObstacleBig.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_Minigame_SubwaySurf_ObstacleHigh.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_Minigame_SubwaySurf_ObstacleHigh.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_Minigame_SubwaySurf_ObstacleLow.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_Minigame_SubwaySurf_ObstacleLow.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_SubwaySurf_Manager.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_SubwaySurf_Manager.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_SubwaySurf_ObstacleBig.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_SubwaySurf_ObstacleBig.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_SubwaySurf_ObstacleHigh.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_SubwaySurf_ObstacleHigh.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_SubwaySurf_ObstacleLow.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Minigames/SubwaySurf/BP_SubwaySurf_ObstacleLow.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Input/Minigame/Actions/IA_Minigame_Fishing.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Input/Minigame/Actions/IA_Minigame_Fishing.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Input/Minigame/Actions/IA_Minigame_SubwaySurf_Down.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Input/Minigame/Actions/IA_Minigame_SubwaySurf_Down.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Input/Minigame/Actions/IA_Minigame_SubwaySurf_Left.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Input/Minigame/Actions/IA_Minigame_SubwaySurf_Left.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Input/Minigame/Actions/IA_Minigame_SubwaySurf_Right.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Input/Minigame/Actions/IA_Minigame_SubwaySurf_Right.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Input/Minigame/Actions/IA_Minigame_SubwaySurf_Up.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Input/Minigame/Actions/IA_Minigame_SubwaySurf_Up.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/Input/Minigame/IMC_Minigame_Fishing.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Input/Minigame/IMC_Minigame_Fishing.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Input/Minigame/IMC_Minigame_SubwaySurf.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Input/Minigame/IMC_Minigame_SubwaySurf.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
Binary file not shown.
BIN
Content/Levels/Test/Actors/CutsceneTest/BP_Test_CutsceneMultiple.uasset
(Stored with Git LFS)
BIN
Content/Levels/Test/Actors/CutsceneTest/BP_Test_CutsceneMultiple.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Levels/Test/Actors/CutsceneTest/BP_Test_CutsceneSingle.uasset
(Stored with Git LFS)
BIN
Content/Levels/Test/Actors/CutsceneTest/BP_Test_CutsceneSingle.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Levels/Test/Actors/Minigame/BP_Test_AgeOfWar.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Levels/Test/Actors/Minigame/BP_Test_AgeOfWar.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Levels/Test/Actors/Minigame/BP_Test_CrossyRoad.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Levels/Test/Actors/Minigame/BP_Test_CrossyRoad.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Levels/Test/L_Test.umap
(Stored with Git LFS)
BIN
Content/Levels/Test/L_Test.umap
(Stored with Git LFS)
Binary file not shown.
BIN
Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset
(Stored with Git LFS)
BIN
Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset
(Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Plugins/FMODStudio/Binaries/Win64/UnrealEditor-FMODStudio.dll
(Stored with Git LFS)
BIN
Plugins/FMODStudio/Binaries/Win64/UnrealEditor-FMODStudio.dll
(Stored with Git LFS)
Binary file not shown.
BIN
Plugins/FMODStudio/Binaries/Win64/UnrealEditor-FMODStudio.pdb
(Stored with Git LFS)
BIN
Plugins/FMODStudio/Binaries/Win64/UnrealEditor-FMODStudio.pdb
(Stored with Git LFS)
Binary file not shown.
BIN
Plugins/FMODStudio/Binaries/Win64/UnrealEditor-FMODStudioEditor.dll
(Stored with Git LFS)
BIN
Plugins/FMODStudio/Binaries/Win64/UnrealEditor-FMODStudioEditor.dll
(Stored with Git LFS)
Binary file not shown.
BIN
Plugins/FMODStudio/Binaries/Win64/UnrealEditor-FMODStudioEditor.pdb
(Stored with Git LFS)
BIN
Plugins/FMODStudio/Binaries/Win64/UnrealEditor-FMODStudioEditor.pdb
(Stored with Git LFS)
Binary file not shown.
BIN
Plugins/FMODStudioNiagara/Binaries/Win64/UnrealEditor-FMODStudioNiagara.dll
(Stored with Git LFS)
BIN
Plugins/FMODStudioNiagara/Binaries/Win64/UnrealEditor-FMODStudioNiagara.dll
(Stored with Git LFS)
Binary file not shown.
BIN
Plugins/FMODStudioNiagara/Binaries/Win64/UnrealEditor-FMODStudioNiagara.pdb
(Stored with Git LFS)
BIN
Plugins/FMODStudioNiagara/Binaries/Win64/UnrealEditor-FMODStudioNiagara.pdb
(Stored with Git LFS)
Binary file not shown.
@ -29,9 +29,9 @@ UCutsceneManager::UCutsceneManager()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UCutsceneManager::EnqueueSequence(TSoftObjectPtr<class ULevelSequence> sequence, FCutsceneEndCallback endCallback)
|
void UCutsceneManager::EnqueueSequence(ULevelSequence* sequence, FCutsceneEndCallback endCallback)
|
||||||
{
|
{
|
||||||
if(!sequence.LoadSynchronous())
|
if(!sequence)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FScopeLock lock1(&_sequencesLock);
|
FScopeLock lock1(&_sequencesLock);
|
||||||
@ -81,9 +81,9 @@ void UCutsceneManager::PlayNextSequence()
|
|||||||
|
|
||||||
FScopeLock lock(&_sequencesLock);
|
FScopeLock lock(&_sequencesLock);
|
||||||
|
|
||||||
TSoftObjectPtr<ULevelSequence> sequence;
|
ULevelSequence* sequence;
|
||||||
_nextSequences.Dequeue(sequence);
|
_nextSequences.Dequeue(sequence);
|
||||||
_sequencePlayer = ULevelSequencePlayer::CreateLevelSequencePlayer(GetWorld(), sequence.LoadSynchronous(), FMovieSceneSequencePlaybackSettings{}, _sequencePlayerActor);
|
_sequencePlayer = ULevelSequencePlayer::CreateLevelSequencePlayer(GetWorld(), sequence, FMovieSceneSequencePlaybackSettings{}, _sequencePlayerActor);
|
||||||
_sequencePlayer->OnStop.AddDynamic(this, &UCutsceneManager::OnSequenceEnd);
|
_sequencePlayer->OnStop.AddDynamic(this, &UCutsceneManager::OnSequenceEnd);
|
||||||
_sequencePlayer->Play();
|
_sequencePlayer->Play();
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public:
|
|||||||
UCutsceneManager();
|
UCutsceneManager();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void EnqueueSequence(TSoftObjectPtr<class ULevelSequence> sequence, FCutsceneEndCallback endCallback);
|
void EnqueueSequence(class ULevelSequence* sequence, FCutsceneEndCallback endCallback);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SkipSequence();
|
void SkipSequence();
|
||||||
@ -38,7 +38,7 @@ private:
|
|||||||
|
|
||||||
class ULevelSequencePlayer* _sequencePlayer = nullptr;
|
class ULevelSequencePlayer* _sequencePlayer = nullptr;
|
||||||
class ALevelSequenceActor* _sequencePlayerActor = nullptr;
|
class ALevelSequenceActor* _sequencePlayerActor = nullptr;
|
||||||
TQueue<TSoftObjectPtr<class ULevelSequence>> _nextSequences;
|
TQueue<class ULevelSequence*> _nextSequences;
|
||||||
FCriticalSection _sequencesLock;
|
FCriticalSection _sequencesLock;
|
||||||
TQueue<FCutsceneEndCallback> _endCallbacks;
|
TQueue<FCutsceneEndCallback> _endCallbacks;
|
||||||
FCriticalSection _callbacksLock;
|
FCriticalSection _callbacksLock;
|
||||||
|
@ -284,5 +284,5 @@ void UInteractableScreenCapturer::Process()
|
|||||||
running = false;
|
running = false;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
// Oleg Petruny proprietary.
|
||||||
|
|
||||||
|
|
||||||
|
#include "AgeOfWarManager.h"
|
||||||
|
|
||||||
|
#include "MainGameModeBase.h"
|
||||||
|
#include "PlayerBase.h"
|
||||||
|
|
||||||
|
AAgeOfWarManager::AAgeOfWarManager()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void AAgeOfWarManager::Start(APlayerBase* playerPawn, FMinigameEndCallback delegate)
|
||||||
|
{
|
||||||
|
if(!playerPawn)
|
||||||
|
return;
|
||||||
|
|
||||||
|
AMinigame::Start(playerPawn, delegate);
|
||||||
|
|
||||||
|
player->LockPlayer(FPlayerLock::All());
|
||||||
|
}
|
||||||
|
|
||||||
|
void AAgeOfWarManager::End()
|
||||||
|
{
|
||||||
|
player->UnlockPlayer(FPlayerLock::All());
|
||||||
|
|
||||||
|
AMinigame::End();
|
||||||
|
}
|
19
Source/Lost_Edge/Private/Minigame/AgeOfWar/AgeOfWarManager.h
Normal file
19
Source/Lost_Edge/Private/Minigame/AgeOfWar/AgeOfWarManager.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Oleg Petruny proprietary.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Minigame/Minigame.h"
|
||||||
|
|
||||||
|
#include "AgeOfWarManager.generated.h"
|
||||||
|
|
||||||
|
UCLASS(Blueprintable, BlueprintType, MinimalAPI)
|
||||||
|
class AAgeOfWarManager : public AMinigame
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
AAgeOfWarManager();
|
||||||
|
|
||||||
|
virtual void Start(class APlayerBase* playerPawn, FMinigameEndCallback delegate) override;
|
||||||
|
virtual void End() override;
|
||||||
|
};
|
@ -0,0 +1,27 @@
|
|||||||
|
// Oleg Petruny proprietary.
|
||||||
|
|
||||||
|
|
||||||
|
#include "CrossyRoadManager.h"
|
||||||
|
|
||||||
|
#include "MainGameModeBase.h"
|
||||||
|
#include "PlayerBase.h"
|
||||||
|
|
||||||
|
ACrossyRoadManager::ACrossyRoadManager()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void ACrossyRoadManager::Start(APlayerBase* playerPawn, FMinigameEndCallback delegate)
|
||||||
|
{
|
||||||
|
if(!playerPawn)
|
||||||
|
return;
|
||||||
|
|
||||||
|
AMinigame::Start(playerPawn, delegate);
|
||||||
|
|
||||||
|
player->LockPlayer(FPlayerLock::All());
|
||||||
|
}
|
||||||
|
|
||||||
|
void ACrossyRoadManager::End()
|
||||||
|
{
|
||||||
|
player->UnlockPlayer(FPlayerLock::All());
|
||||||
|
|
||||||
|
AMinigame::End();
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
// Oleg Petruny proprietary.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Minigame/Minigame.h"
|
||||||
|
|
||||||
|
#include "CrossyRoadManager.generated.h"
|
||||||
|
|
||||||
|
UCLASS(Blueprintable, BlueprintType, MinimalAPI)
|
||||||
|
class ACrossyRoadManager : public AMinigame
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
ACrossyRoadManager();
|
||||||
|
|
||||||
|
virtual void Start(class APlayerBase* playerPawn, FMinigameEndCallback delegate) override;
|
||||||
|
virtual void End() override;
|
||||||
|
};
|
30
Source/Lost_Edge/Private/Minigame/Fishing/FishingManager.cpp
Normal file
30
Source/Lost_Edge/Private/Minigame/Fishing/FishingManager.cpp
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// Oleg Petruny proprietary.
|
||||||
|
|
||||||
|
|
||||||
|
#include "FishingManager.h"
|
||||||
|
|
||||||
|
#include "MainGameModeBase.h"
|
||||||
|
#include "PlayerBase.h"
|
||||||
|
|
||||||
|
AFishingManager::AFishingManager()
|
||||||
|
{
|
||||||
|
static ConstructorHelpers::FObjectFinder<UInputMappingContext> asset{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Minigame/IMC_Minigame_Fishing.IMC_Minigame_Fishing'") };
|
||||||
|
input = asset.Object;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AFishingManager::Start(APlayerBase* playerPawn, FMinigameEndCallback delegate)
|
||||||
|
{
|
||||||
|
if(!playerPawn)
|
||||||
|
return;
|
||||||
|
|
||||||
|
AMinigame::Start(playerPawn, delegate);
|
||||||
|
|
||||||
|
player->LockPlayer(FPlayerLock::All());
|
||||||
|
}
|
||||||
|
|
||||||
|
void AFishingManager::End()
|
||||||
|
{
|
||||||
|
player->UnlockPlayer(FPlayerLock::All());
|
||||||
|
|
||||||
|
AMinigame::End();
|
||||||
|
}
|
46
Source/Lost_Edge/Private/Minigame/Fishing/FishingManager.h
Normal file
46
Source/Lost_Edge/Private/Minigame/Fishing/FishingManager.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
// Oleg Petruny proprietary.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Minigame/Minigame.h"
|
||||||
|
|
||||||
|
#include "FishingManager.generated.h"
|
||||||
|
|
||||||
|
USTRUCT(BlueprintType)
|
||||||
|
struct FFishVariation
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
float difficulty;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
float size;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
float duration;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
int32 price;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
FLinearColor color;
|
||||||
|
};
|
||||||
|
|
||||||
|
UCLASS(Blueprintable, BlueprintType, MinimalAPI)
|
||||||
|
class AFishingManager : public AMinigame
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
AFishingManager();
|
||||||
|
|
||||||
|
virtual void Start(class APlayerBase* playerPawn, FMinigameEndCallback delegate) override;
|
||||||
|
virtual void End() override;
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
|
||||||
|
void CatchSucceed(int32 price);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
|
||||||
|
void CatchFailed();
|
||||||
|
};
|
@ -3,17 +3,24 @@
|
|||||||
|
|
||||||
#include "Minigame.h"
|
#include "Minigame.h"
|
||||||
|
|
||||||
|
#include "EnhancedInputSubsystems.h"
|
||||||
#include "InputMappingContext.h"
|
#include "InputMappingContext.h"
|
||||||
|
|
||||||
|
#include "PlayerBase.h"
|
||||||
|
|
||||||
AMinigame::AMinigame()
|
AMinigame::AMinigame()
|
||||||
: AActor()
|
|
||||||
{
|
{
|
||||||
PrimaryActorTick.bStartWithTickEnabled = false;
|
PrimaryActorTick.bStartWithTickEnabled = false;
|
||||||
PrimaryActorTick.bCanEverTick = true;
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMinigame::End()
|
void AMinigame::End()
|
||||||
{}
|
{
|
||||||
|
if(callback.IsBound())
|
||||||
|
callback.Execute(result, score);
|
||||||
|
|
||||||
|
OnEnd();
|
||||||
|
}
|
||||||
|
|
||||||
void AMinigame::Restart()
|
void AMinigame::Restart()
|
||||||
{}
|
{}
|
||||||
@ -23,8 +30,15 @@ UInputMappingContext* AMinigame::GetInputMappings()
|
|||||||
return input.LoadSynchronous();
|
return input.LoadSynchronous();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMinigame::Start(class APlayerBase* playerPawn, FMinigameEndCallback delegate)
|
void AMinigame::Start(APlayerBase* playerPawn, FMinigameEndCallback delegate)
|
||||||
{
|
{
|
||||||
player = playerPawn;
|
player = playerPawn;
|
||||||
callback = delegate;
|
callback = delegate;
|
||||||
|
|
||||||
|
if(input)
|
||||||
|
if(auto PC = Cast<APlayerController>(playerPawn->GetController()))
|
||||||
|
if(auto inputSubsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PC->GetLocalPlayer()))
|
||||||
|
inputSubsystem->AddMappingContext(input.LoadSynchronous(), 0);
|
||||||
|
|
||||||
|
OnStart();
|
||||||
}
|
}
|
||||||
|
@ -26,12 +26,18 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
virtual void Start(class APlayerBase* playerPawn, FMinigameEndCallback delegate);
|
virtual void Start(class APlayerBase* playerPawn, FMinigameEndCallback delegate);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
|
void OnStart();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
virtual void End();
|
virtual void End();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
virtual void Restart();
|
virtual void Restart();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
|
void OnEnd();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
class UInputMappingContext* GetInputMappings();
|
class UInputMappingContext* GetInputMappings();
|
||||||
|
|
||||||
@ -42,6 +48,9 @@ protected:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
int32 score = 0;
|
int32 score = 0;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
EMinigameResult result = EMinigameResult::Loss;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
bool ended = false;
|
bool ended = false;
|
||||||
|
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
// Oleg Petruny proprietary.
|
||||||
|
|
||||||
|
|
||||||
|
#include "RythmClickManager.h"
|
||||||
|
|
||||||
|
#include "MainGameModeBase.h"
|
||||||
|
#include "PlayerBase.h"
|
||||||
|
|
||||||
|
ARythmClickManager::ARythmClickManager()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void ARythmClickManager::Start(APlayerBase* playerPawn, FMinigameEndCallback delegate)
|
||||||
|
{
|
||||||
|
if(!playerPawn)
|
||||||
|
return;
|
||||||
|
|
||||||
|
AMinigame::Start(playerPawn, delegate);
|
||||||
|
|
||||||
|
player->LockPlayer(FPlayerLock::All());
|
||||||
|
}
|
||||||
|
|
||||||
|
void ARythmClickManager::End()
|
||||||
|
{
|
||||||
|
player->UnlockPlayer(FPlayerLock::All());
|
||||||
|
|
||||||
|
AMinigame::End();
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
// Oleg Petruny proprietary.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Minigame/Minigame.h"
|
||||||
|
|
||||||
|
#include "RythmClickManager.generated.h"
|
||||||
|
|
||||||
|
UCLASS(Blueprintable, BlueprintType, MinimalAPI)
|
||||||
|
class ARythmClickManager : public AMinigame
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
ARythmClickManager();
|
||||||
|
|
||||||
|
virtual void Start(class APlayerBase* playerPawn, FMinigameEndCallback delegate) override;
|
||||||
|
virtual void End() override;
|
||||||
|
};
|
@ -18,7 +18,7 @@
|
|||||||
ASubwaySurfManager::ASubwaySurfManager()
|
ASubwaySurfManager::ASubwaySurfManager()
|
||||||
: AMinigame()
|
: AMinigame()
|
||||||
{
|
{
|
||||||
static ConstructorHelpers::FObjectFinder<UInputMappingContext> asset{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Minigame/IMC_SubwaySurf.IMC_SubwaySurf'") };
|
static ConstructorHelpers::FObjectFinder<UInputMappingContext> asset{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Minigame/IMC_Minigame_SubwaySurf.IMC_Minigame_SubwaySurf'") };
|
||||||
input = asset.Object;
|
input = asset.Object;
|
||||||
|
|
||||||
auto root = CreateDefaultSubobject<USceneComponent>(TEXT("Scene"));
|
auto root = CreateDefaultSubobject<USceneComponent>(TEXT("Scene"));
|
||||||
@ -40,8 +40,6 @@ void ASubwaySurfManager::Start(APlayerBase* playerPawn, FMinigameEndCallback del
|
|||||||
|
|
||||||
AMinigame::Start(playerPawn, delegate);
|
AMinigame::Start(playerPawn, delegate);
|
||||||
|
|
||||||
AMainGameModeBase::GetWidgetsManager()->HideInteractionHints(nullptr);
|
|
||||||
|
|
||||||
player->LockPlayer(FPlayerLock::All());
|
player->LockPlayer(FPlayerLock::All());
|
||||||
player->SwitchToView(this);
|
player->SwitchToView(this);
|
||||||
|
|
||||||
@ -70,8 +68,6 @@ void ASubwaySurfManager::End()
|
|||||||
for(int32 handler : inputHandlers)
|
for(int32 handler : inputHandlers)
|
||||||
player->inputComponent->RemoveActionBindingForHandle(handler);
|
player->inputComponent->RemoveActionBindingForHandle(handler);
|
||||||
|
|
||||||
AMainGameModeBase::GetWidgetsManager()->ShowInteractionHints(nullptr);
|
|
||||||
|
|
||||||
player->UnlockPlayer(FPlayerLock::All());
|
player->UnlockPlayer(FPlayerLock::All());
|
||||||
player->ReturnPlayerView();
|
player->ReturnPlayerView();
|
||||||
|
|
||||||
@ -91,15 +87,13 @@ void ASubwaySurfManager::Hit()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(callback.IsBound())
|
result = EMinigameResult::Loss;
|
||||||
callback.Execute(EMinigameResult::Loss, score);
|
|
||||||
End();
|
End();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASubwaySurfManager::Finish()
|
void ASubwaySurfManager::Finish()
|
||||||
{
|
{
|
||||||
if(callback.IsBound())
|
result = EMinigameResult::Win;
|
||||||
callback.Execute(EMinigameResult::Win, score);
|
|
||||||
End();
|
End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +141,9 @@ void APlayerBase::LockPlayer(FPlayerLock lock)
|
|||||||
interactionLocked += lock.interaction;
|
interactionLocked += lock.interaction;
|
||||||
cameraLocked += lock.camera;
|
cameraLocked += lock.camera;
|
||||||
inventoryLocked += lock.inventory;
|
inventoryLocked += lock.inventory;
|
||||||
|
|
||||||
|
if(interactionLocked)
|
||||||
|
ResetIntractions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerBase::UnlockPlayer(FPlayerLock lock)
|
void APlayerBase::UnlockPlayer(FPlayerLock lock)
|
||||||
@ -158,6 +161,11 @@ void APlayerBase::FlyMode(bool on)
|
|||||||
GetCharacterMovement()->GravityScale = on ? 0.0f : 1.0f;
|
GetCharacterMovement()->GravityScale = on ? 0.0f : 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void APlayerBase::ResetIntractions()
|
||||||
|
{
|
||||||
|
InteractableDeactivated(lastInteractable, static_cast<EActivatorType>(0xFF));
|
||||||
|
}
|
||||||
|
|
||||||
FVector APlayerBase::GetCameraDirection()
|
FVector APlayerBase::GetCameraDirection()
|
||||||
{
|
{
|
||||||
return camera->GetForwardVector();
|
return camera->GetForwardVector();
|
||||||
|
@ -48,6 +48,7 @@ public:
|
|||||||
void LockPlayer(const FPlayerLock lock);
|
void LockPlayer(const FPlayerLock lock);
|
||||||
void UnlockPlayer(const FPlayerLock lock);
|
void UnlockPlayer(const FPlayerLock lock);
|
||||||
void FlyMode(bool on);
|
void FlyMode(bool on);
|
||||||
|
void ResetIntractions();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = Character)
|
UFUNCTION(BlueprintCallable, Category = Character)
|
||||||
void SwitchToView(class AActor* target);
|
void SwitchToView(class AActor* target);
|
||||||
|
Loading…
Reference in New Issue
Block a user