CogAbility: Apply tweaks at start and when an new actor is spawned

The data asset is now loaded directly by the windows.
This commit is contained in:
Arnaud Jamin
2023-10-22 01:37:26 -04:00
parent 4c9f731475
commit 6f54b429f0
45 changed files with 257 additions and 138 deletions
@@ -1,6 +1,7 @@
#include "CogInputWindow_Actions.h"
#include "CogInputDataAsset.h"
#include "CogWindowHelper.h"
#include "CogWindowWidgets.h"
#include "Engine/LocalPlayer.h"
#include "EnhancedInputSubsystems.h"
@@ -23,6 +24,8 @@ void UCogInputWindow_Actions::RenderHelp()
UCogInputWindow_Actions::UCogInputWindow_Actions()
{
bHasMenu = true;
Asset = FCogWindowHelper::GetFirstAssetByClass<UCogInputDataAsset>();
}
//--------------------------------------------------------------------------------------------------------------------------
@@ -2,6 +2,7 @@
#include "CogImguiHelper.h"
#include "CogInputDataAsset.h"
#include "CogWindowHelper.h"
#include "CogWindowWidgets.h"
#include "Engine/LocalPlayer.h"
#include "EnhancedInputSubsystems.h"
@@ -11,6 +12,7 @@
//--------------------------------------------------------------------------------------------------------------------------
UCogInputWindow_Gamepad::UCogInputWindow_Gamepad()
{
Asset = FCogWindowHelper::GetFirstAssetByClass<UCogInputDataAsset>();
}
//--------------------------------------------------------------------------------------------------------------------------
@@ -17,10 +17,6 @@ public:
UCogInputWindow_Actions();
const UCogInputDataAsset* GetAsset() const { return Asset.Get(); }
void SetAsset(const UCogInputDataAsset* Value) { Asset = Value; }
protected:
void RenderHelp();
@@ -18,10 +18,6 @@ public:
UCogInputWindow_Gamepad();
const UCogInputDataAsset* GetAsset() const { return Asset.Get(); }
void SetAsset(const UCogInputDataAsset* Value) { Asset = Value; }
protected:
virtual void ResetConfig() override;