Code & git cleanup #6

Merged
oleg.petruny merged 15 commits from Documentation into master 2024-12-15 13:32:54 +00:00
23 changed files with 20 additions and 46 deletions
Showing only changes of commit 60ba66b249 - Show all commits

View File

@ -27,6 +27,8 @@ void ACustomPlayerController::AppendInputContext(TSoftObjectPtr<class UInputMapp
void ACustomPlayerController::BeginPlay()
{
Super::BeginPlay();
instance = this;
subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer());

View File

@ -23,9 +23,6 @@ void ALevelBase::BeginPlay()
{
AMainGameModeBase::leadLevel = TStrongObjectPtr<ALevelBase>{ this };
for(TActorIterator<AMinigame> it(GetWorld()); it; ++it)
ACustomPlayerController::AppendInputContext(it->GetInputMappings());
ALevelScriptActor::BeginPlay();
BroadcastNewLevelBeginPlay();

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "AgeOfWarManager.h"
#include "Camera/CameraComponent.h"

View File

@ -1,12 +1,11 @@
// Oleg Petruny proprietary.
#include "AgeOfWarUnit.h"
#include "Components/BoxComponent.h"
#include "Components/StaticMeshComponent.h"
#include "AgeOfWarManager.h"
#include <Components/BoxComponent.h>
namespace
{

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "CrossyRoadManager.h"
#include "Camera/CameraComponent.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "CrossyRoadObstacle.h"
#include "CrossyRoadManager.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "FishingManager.h"
#include "EnhancedInputComponent.h"

View File

@ -1,11 +1,8 @@
// Oleg Petruny proprietary.
#include "Minigame.h"
#include "EnhancedInputSubsystems.h"
#include "InputMappingContext.h"
#include "CustomPlayerController.h"
#include "PlayerBase.h"
AMinigame::AMinigame()
@ -22,23 +19,13 @@ void AMinigame::End()
OnEnd();
}
void AMinigame::Restart()
{}
UInputMappingContext* AMinigame::GetInputMappings()
{
return context.LoadSynchronous();
}
void AMinigame::Start(APlayerBase* playerPawn, FMinigameEndCallback delegate)
{
player = playerPawn;
callback = delegate;
if(context)
if(auto PC = Cast<APlayerController>(playerPawn->GetController()))
if(auto inputSubsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PC->GetLocalPlayer()))
inputSubsystem->AddMappingContext(context.LoadSynchronous(), 0);
if(context.IsValid())
ACustomPlayerController::AppendInputContext(context);
OnStart();
}

View File

@ -15,7 +15,14 @@ enum class EMinigameResult : uint8
DECLARE_DYNAMIC_DELEGATE_TwoParams(FMinigameEndCallback, EMinigameResult, result, int32, score);
UCLASS(Blueprintable, BlueprintType, MinimalAPI, Abstract)
/**
* Interface for all minigame classes.
* Any minigame is started/ended/restarted by executing Start()/End()/Restart() on specific instance.
* Each call is after broadcasted into a blueprint event also.
* On start the caller can pass a OnEndCallback delegate to receive result and score on a minigame end.
* Each minigame can have its own contextInput
*/
UCLASS(Abstract, Blueprintable, BlueprintType, MinimalAPI)
class AMinigame : public AActor
{
GENERATED_BODY()
@ -25,21 +32,21 @@ public:
UFUNCTION(BlueprintCallable)
virtual void Start(class APlayerBase* playerPawn, FMinigameEndCallback delegate);
UFUNCTION(BlueprintImplementableEvent)
void OnStart();
UFUNCTION(BlueprintCallable)
virtual void End();
UFUNCTION(BlueprintCallable)
virtual void Restart();
UFUNCTION(BlueprintImplementableEvent)
void OnEnd();
UFUNCTION(BlueprintCallable)
virtual void Restart() {}
UFUNCTION(BlueprintImplementableEvent)
void OnRestart();
UFUNCTION(BlueprintPure)
class UInputMappingContext* GetInputMappings();
TSoftObjectPtr<class UInputMappingContext> GetInputMappings() { return context; }
protected:
FMinigameEndCallback callback;

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "RythmClickManager.h"
#include "MainGameModeBase.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "SubwaySurfManager.h"
#include "Camera/CameraComponent.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "SubwaySurfObstacle.h"
#include "SubwaySurfManager.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "AutohideWidget.h"
#include "Animation/WidgetAnimation.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "DialogueRowWidgetManager.h"
#include "Blueprint/WidgetTree.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "InteractableHintWidgetManager.h"
#include "Blueprint/WidgetTree.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "JournalWidget.h"
#include "Blueprint/WidgetTree.h"

View File

@ -1,5 +1,4 @@
// Oleg Petruny proprietary.
#include "MainMenuButtonWidget.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "MainMenuWidget.h"
#include "Animation/WidgetAnimation.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "QuickTimeEventWidget.h"
#include "Animation/WidgetAnimation.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "QuickTimeEventWidgetManager.h"
#include "Animation/UMGSequencePlayer.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "ResolutionResponsiveUserWidget.h"
#include "Components/PanelSlot.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "WidgetsManager.h"
#include "Blueprint/UserWidget.h"

View File

@ -1,6 +1,5 @@
// Oleg Petruny proprietary.
#include "WorldDilationResponsiveUserWidget.h"
#include "Animation/UMGSequencePlayer.h"