diff --git a/Content/Core/Debug/DA_Debug_Abilities.uasset b/Content/Core/Debug/DA_Debug_Ability.uasset similarity index 82% rename from Content/Core/Debug/DA_Debug_Abilities.uasset rename to Content/Core/Debug/DA_Debug_Ability.uasset index e752dba..a710f50 100644 Binary files a/Content/Core/Debug/DA_Debug_Abilities.uasset and b/Content/Core/Debug/DA_Debug_Ability.uasset differ diff --git a/Content/Core/Debug/DA_Debug_Actions.uasset b/Content/Core/Debug/DA_Debug_Actions.uasset deleted file mode 100644 index 5af8457..0000000 Binary files a/Content/Core/Debug/DA_Debug_Actions.uasset and /dev/null differ diff --git a/Content/Core/Debug/DA_Debug_Collisions.uasset b/Content/Core/Debug/DA_Debug_Collisions.uasset deleted file mode 100644 index 942f177..0000000 Binary files a/Content/Core/Debug/DA_Debug_Collisions.uasset and /dev/null differ diff --git a/Content/Core/Debug/DA_Debug_Engine.uasset b/Content/Core/Debug/DA_Debug_Engine.uasset new file mode 100644 index 0000000..13b7002 Binary files /dev/null and b/Content/Core/Debug/DA_Debug_Engine.uasset differ diff --git a/Content/Core/Debug/DA_Debug_Input.uasset b/Content/Core/Debug/DA_Debug_Input.uasset new file mode 100644 index 0000000..3adc3de Binary files /dev/null and b/Content/Core/Debug/DA_Debug_Input.uasset differ diff --git a/Content/Core/Debug/DA_Debug_Spawns.uasset b/Content/Core/Debug/DA_Debug_Spawns.uasset deleted file mode 100644 index f6e5b6c..0000000 Binary files a/Content/Core/Debug/DA_Debug_Spawns.uasset and /dev/null differ diff --git a/Content/Core/Debug/Tweaks/GE_Tweak_MaxHealth.uasset b/Content/Core/Debug/Tweaks/GE_Tweak_MaxHealth.uasset index 3bcd84f..321dc8c 100644 Binary files a/Content/Core/Debug/Tweaks/GE_Tweak_MaxHealth.uasset and b/Content/Core/Debug/Tweaks/GE_Tweak_MaxHealth.uasset differ diff --git a/Content/Core/Debug/Tweaks/GE_Tweak_MaxStamina.uasset b/Content/Core/Debug/Tweaks/GE_Tweak_MaxStamina.uasset index 08ccccd..a0cfbd1 100644 Binary files a/Content/Core/Debug/Tweaks/GE_Tweak_MaxStamina.uasset and b/Content/Core/Debug/Tweaks/GE_Tweak_MaxStamina.uasset differ diff --git a/Content/Core/Debug/Tweaks/GE_Tweak_Scale.uasset b/Content/Core/Debug/Tweaks/GE_Tweak_Scale.uasset index 2a1a03c..e4fc25f 100644 Binary files a/Content/Core/Debug/Tweaks/GE_Tweak_Scale.uasset and b/Content/Core/Debug/Tweaks/GE_Tweak_Scale.uasset differ diff --git a/Content/Core/Debug/Tweaks/GE_Tweak_Speed.uasset b/Content/Core/Debug/Tweaks/GE_Tweak_Speed.uasset index df33dda..4bc8ec0 100644 Binary files a/Content/Core/Debug/Tweaks/GE_Tweak_Speed.uasset and b/Content/Core/Debug/Tweaks/GE_Tweak_Speed.uasset differ diff --git a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Collisions.cpp b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Collisions.cpp index 754bd82..67be8c8 100644 --- a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Collisions.cpp +++ b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Collisions.cpp @@ -2,6 +2,7 @@ #include "CogDebugDrawHelper.h" #include "CogDebugSettings.h" +#include "CogEngineDataAsset.h" #include "CogImGuiHelper.h" #include "Components/BoxComponent.h" #include "Components/CapsuleComponent.h" @@ -368,7 +369,7 @@ void UCogEngineWindow_Collisions::RenderContent() } //-------------------------------------------------------------------------------------------------------------------------- -void UCogEngineWindow_Collisions::SetCollisionsAsset(const UCogEngineDataAsset_Collisions* Asset) +void UCogEngineWindow_Collisions::SetAsset(const UCogEngineDataAsset* Asset) { if (Asset == nullptr) { diff --git a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Spawns.cpp b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Spawns.cpp index afa2e61..8b8db90 100644 --- a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Spawns.cpp +++ b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Spawns.cpp @@ -1,5 +1,7 @@ #include "CogEngineWindow_Spawns.h" +#include "CogEngineDataAsset.h" + //-------------------------------------------------------------------------------------------------------------------------- void UCogEngineWindow_Spawns::RenderHelp() { diff --git a/Plugins/CogEngine/Source/CogEngine/Public/CogEngineDataAsset_Spawns.h b/Plugins/CogEngine/Source/CogEngine/Public/CogEngineDataAsset.h similarity index 58% rename from Plugins/CogEngine/Source/CogEngine/Public/CogEngineDataAsset_Spawns.h rename to Plugins/CogEngine/Source/CogEngine/Public/CogEngineDataAsset.h index 098dcb6..036e536 100644 --- a/Plugins/CogEngine/Source/CogEngine/Public/CogEngineDataAsset_Spawns.h +++ b/Plugins/CogEngine/Source/CogEngine/Public/CogEngineDataAsset.h @@ -2,7 +2,20 @@ #include "CoreMinimal.h" #include "Engine/DataAsset.h" -#include "CogEngineDataAsset_Spawns.generated.h" +#include "CogEngineDataAsset.generated.h" + +//-------------------------------------------------------------------------------------------------------------------------- +USTRUCT() +struct COGENGINE_API FCogCollisionChannel +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere) + TEnumAsByte Channel = ECollisionChannel::ECC_WorldStatic; + + UPROPERTY(EditAnywhere) + FLinearColor Color = FLinearColor(0.5f, 0.5f, 0.5f, 1.0f); +}; //-------------------------------------------------------------------------------------------------------------------------- USTRUCT() @@ -35,12 +48,17 @@ struct COGENGINE_API FCogEngineSpawnGroup //-------------------------------------------------------------------------------------------------------------------------- UCLASS(Blueprintable) -class COGENGINE_API UCogEngineDataAsset_Spawns : public UPrimaryDataAsset +class COGENGINE_API UCogEngineDataAsset : public UPrimaryDataAsset { GENERATED_BODY() public: - UPROPERTY(EditAnywhere, meta = (TitleProperty = "Name")) + UCogEngineDataAsset() {} + + UPROPERTY(Category = "Spawns", EditAnywhere, meta = (TitleProperty = "Name")) TArray SpawnGroups; + + UPROPERTY(Category = "Collisions", EditAnywhere, meta = (TitleProperty = "Channel")) + TArray Channels; }; diff --git a/Plugins/CogEngine/Source/CogEngine/Public/CogEngineDataAsset_Collisions.h b/Plugins/CogEngine/Source/CogEngine/Public/CogEngineDataAsset_Collisions.h deleted file mode 100644 index 91dffde..0000000 --- a/Plugins/CogEngine/Source/CogEngine/Public/CogEngineDataAsset_Collisions.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include "CoreMinimal.h" -#include "Engine/DataAsset.h" -#include "CogEngineDataAsset_Collisions.generated.h" - -//-------------------------------------------------------------------------------------------------------------------------- -USTRUCT() -struct COGENGINE_API FCogCollisionChannel -{ - GENERATED_BODY() - - UPROPERTY(EditAnywhere) - TEnumAsByte Channel = ECollisionChannel::ECC_WorldStatic; - - UPROPERTY(EditAnywhere) - FLinearColor Color = FLinearColor(0.5f, 0.5f, 0.5f, 1.0f); -}; - -//-------------------------------------------------------------------------------------------------------------------------- -UCLASS(Blueprintable) -class COGENGINE_API UCogEngineDataAsset_Collisions : public UPrimaryDataAsset -{ - GENERATED_BODY() - -public: - - UCogEngineDataAsset_Collisions() {} - - UPROPERTY(EditAnywhere, meta = (TitleProperty = "Channel")) - TArray Channels; -}; diff --git a/Plugins/CogEngine/Source/CogEngine/Public/CogEngineWindow_Collisions.h b/Plugins/CogEngine/Source/CogEngine/Public/CogEngineWindow_Collisions.h index 9ff5bf8..98fbc35 100644 --- a/Plugins/CogEngine/Source/CogEngine/Public/CogEngineWindow_Collisions.h +++ b/Plugins/CogEngine/Source/CogEngine/Public/CogEngineWindow_Collisions.h @@ -15,7 +15,7 @@ public: UCogEngineWindow_Collisions(); - void SetCollisionsAsset(const UCogEngineDataAsset_Collisions* Asset); + void SetAsset(const UCogEngineDataAsset* Asset); private: @@ -29,7 +29,7 @@ private: FColor Color; }; - TWeakObjectPtr CollisionsAsset; + TWeakObjectPtr CollisionsAsset; FChannel Channels[ECC_MAX]; diff --git a/Plugins/CogEngine/Source/CogEngine/Public/CogEngineWindow_Spawns.h b/Plugins/CogEngine/Source/CogEngine/Public/CogEngineWindow_Spawns.h index eaf9002..ca407e7 100644 --- a/Plugins/CogEngine/Source/CogEngine/Public/CogEngineWindow_Spawns.h +++ b/Plugins/CogEngine/Source/CogEngine/Public/CogEngineWindow_Spawns.h @@ -4,7 +4,7 @@ #include "CogWindow.h" #include "CogEngineWindow_Spawns.generated.h" -class UCogEngineDataAsset_Spawns; +class UCogEngineDataAsset; struct FCogEngineSpawnGroup; UCLASS() @@ -14,9 +14,9 @@ class COGENGINE_API UCogEngineWindow_Spawns : public UCogWindow public: - const UCogEngineDataAsset_Spawns* GetSpawnsAsset() const { return SpawnAsset; } + const UCogEngineDataAsset* GetSpawnsAsset() const { return SpawnAsset; } - void SetSpawnsAsset(const UCogEngineDataAsset_Spawns* Value) { SpawnAsset = Value; } + void SetAsset(const UCogEngineDataAsset* Value) { SpawnAsset = Value; } protected: @@ -30,5 +30,5 @@ protected: private: - const UCogEngineDataAsset_Spawns* SpawnAsset = nullptr; + const UCogEngineDataAsset* SpawnAsset = nullptr; }; diff --git a/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp b/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp index 2373677..476e179 100644 --- a/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp +++ b/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp @@ -1,6 +1,6 @@ #include "CogInputWindow_Actions.h" -#include "CogInputDataAsset_Actions.h" +#include "CogInputDataAsset.h" #include "CogWindowWidgets.h" #include "Engine/LocalPlayer.h" #include "EnhancedInputSubsystems.h" @@ -15,7 +15,7 @@ void UCogInputWindow_Actions::RenderHelp() "This window displays the current state of each Input Action. " "It can also be used to inject inputs to help debugging. " "The input action are read from a Input Mapping Context defined in '%s' data asset. " - , TCHAR_TO_ANSI(*GetNameSafe(ActionsAsset.Get())) + , TCHAR_TO_ANSI(*GetNameSafe(Asset.Get())) ); } @@ -30,13 +30,13 @@ void UCogInputWindow_Actions::RenderContent() { Super::RenderContent(); - if (ActionsAsset == nullptr) + if (Asset == nullptr) { ImGui::Text("No Actions Asset"); return; } - if (ActionsAsset->MappingContext == nullptr) + if (Asset->MappingContext == nullptr) { ImGui::Text("No MappingContext"); return; @@ -77,7 +77,7 @@ void UCogInputWindow_Actions::RenderContent() if (Actions.Num() == 0) { - for (const FEnhancedActionKeyMapping& Mapping : ActionsAsset->MappingContext->GetMappings()) + for (const FEnhancedActionKeyMapping& Mapping : Asset->MappingContext->GetMappings()) { if (Mapping.Action != nullptr && Actions.ContainsByPredicate([&Mapping](const FCogInjectActionInfo& ActionInfo) { return Mapping.Action == ActionInfo.Action; }) == false) { diff --git a/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Gamepad.cpp b/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Gamepad.cpp index 9457f99..bf93f2f 100644 --- a/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Gamepad.cpp +++ b/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Gamepad.cpp @@ -1,6 +1,7 @@ #include "CogInputWindow_Gamepad.h" #include "CogImguiHelper.h" +#include "CogInputDataAsset.h" #include "Engine/LocalPlayer.h" #include "EnhancedInputSubsystems.h" #include "imgui_internal.h" @@ -16,10 +17,10 @@ void UCogInputWindow_Gamepad::PreRender(ImGuiWindowFlags& WindowFlags) if (bShowAsOverlay) { WindowFlags = ImGuiWindowFlags_NoTitleBar - | ImGuiWindowFlags_NoScrollbar - | ImGuiWindowFlags_NoCollapse - | ImGuiWindowFlags_NoBackground - | ImGuiWindowFlags_NoResize; + | ImGuiWindowFlags_NoScrollbar + | ImGuiWindowFlags_NoCollapse + | ImGuiWindowFlags_NoBackground + | ImGuiWindowFlags_NoResize; } } @@ -197,7 +198,7 @@ void UCogInputWindow_Gamepad::RenderContent() return; } - if (ActionsAsset != nullptr && ActionsAsset->MappingContext != nullptr) + if (Asset != nullptr && Asset->MappingContext != nullptr) { if (Actions.Num() == 0) { @@ -228,7 +229,7 @@ void UCogInputWindow_Gamepad::RenderContent() Actions.FindOrAdd(EKeys:: Gamepad_DPad_Right); Actions.FindOrAdd(EKeys:: Gamepad_DPad_Left); - for (const FEnhancedActionKeyMapping& Mapping : ActionsAsset->MappingContext->GetMappings()) + for (const FEnhancedActionKeyMapping& Mapping : Asset->MappingContext->GetMappings()) { if (Mapping.Action != nullptr) { diff --git a/Plugins/CogInput/Source/CogInput/Public/CogInputDataAsset_Actions.h b/Plugins/CogInput/Source/CogInput/Public/CogInputDataAsset.h similarity index 59% rename from Plugins/CogInput/Source/CogInput/Public/CogInputDataAsset_Actions.h rename to Plugins/CogInput/Source/CogInput/Public/CogInputDataAsset.h index 2aad86f..6dc5f12 100644 --- a/Plugins/CogInput/Source/CogInput/Public/CogInputDataAsset_Actions.h +++ b/Plugins/CogInput/Source/CogInput/Public/CogInputDataAsset.h @@ -1,18 +1,18 @@ #pragma once #include "CoreMinimal.h" -#include "CogInputDataAsset_Actions.generated.h" +#include "CogInputDataAsset.generated.h" class UInputAction; class UInputMappingContext; UCLASS(Blueprintable) -class COGINPUT_API UCogInputDataAsset_Actions : public UPrimaryDataAsset +class COGINPUT_API UCogInputDataAsset : public UPrimaryDataAsset { GENERATED_BODY() public: - UCogInputDataAsset_Actions() {} + UCogInputDataAsset() {} UPROPERTY(EditAnywhere) TObjectPtr MappingContext; diff --git a/Plugins/CogInput/Source/CogInput/Public/CogInputWindow_Actions.h b/Plugins/CogInput/Source/CogInput/Public/CogInputWindow_Actions.h index 3480b46..aade226 100644 --- a/Plugins/CogInput/Source/CogInput/Public/CogInputWindow_Actions.h +++ b/Plugins/CogInput/Source/CogInput/Public/CogInputWindow_Actions.h @@ -6,7 +6,7 @@ #include "CogInputWindow_Actions.generated.h" class UInputAction; -class UCogInputDataAsset_Actions; +class UCogInputDataAsset; UCLASS(Config = Cog) class COGINPUT_API UCogInputWindow_Actions : public UCogWindow @@ -17,7 +17,7 @@ public: UCogInputWindow_Actions(); - TWeakObjectPtr ActionsAsset; + TWeakObjectPtr Asset; protected: diff --git a/Plugins/CogInput/Source/CogInput/Public/CogInputWindow_Gamepad.h b/Plugins/CogInput/Source/CogInput/Public/CogInputWindow_Gamepad.h index 6eeb992..eca897a 100644 --- a/Plugins/CogInput/Source/CogInput/Public/CogInputWindow_Gamepad.h +++ b/Plugins/CogInput/Source/CogInput/Public/CogInputWindow_Gamepad.h @@ -5,6 +5,7 @@ #include "CogInputWindow_Gamepad.generated.h" class UEnhancedPlayerInput; +class UCogInputDataAsset; struct ImDrawList; UCLASS(Config = Cog) @@ -22,13 +23,16 @@ public: virtual void RenderTick(float DeltaSeconds) override; - TWeakObjectPtr ActionsAsset; + TWeakObjectPtr Asset; private: void AddButton(const FKey& Key, const ImVec2& Position, const ImVec2& Size, const ImVec2& Alignment, float Rounding, ImDrawFlags Flags = 0); + void AddStick(const FKey& Key2D, const FKey& KeyBool, bool InvertY, float Amplitude, const ImVec2& Position, float Radius); + void InputContextMenu(const FKey& Key, FCogInjectActionInfo* ActionInfoBool, FCogInjectActionInfo* ActionInfo2D); + void OnButtonClicked(FCogInjectActionInfo* ActionInfo); UPROPERTY(Config) @@ -61,10 +65,16 @@ private: TMap Actions; UEnhancedPlayerInput* Input = nullptr; + ImDrawList* DrawList = nullptr; + float RepeatPeriod = 0.5f; + float RepeatTime = 0.0f; + ImVec2 CanvasMin; + ImVec2 CanvasSize; + ImVec2 CanvasMax; }; diff --git a/Source/CogSample/CogSampleGameState.cpp b/Source/CogSample/CogSampleGameState.cpp index 89f578a..47b6374 100644 --- a/Source/CogSample/CogSampleGameState.cpp +++ b/Source/CogSample/CogSampleGameState.cpp @@ -20,8 +20,7 @@ #include "CogAbilityWindow_Tweaks.h" #include "CogDebugDrawImGui.h" #include "CogDebugPlot.h" -#include "CogEngineDataAsset_Collisions.h" -#include "CogEngineDataAsset_Spawns.h" +#include "CogEngineDataAsset.h" #include "CogEngineModule.h" #include "CogEngineWindow_Collisions.h" #include "CogEngineWindow_DebugSettings.h" @@ -38,7 +37,7 @@ #include "CogEngineWindow_Stats.h" #include "CogEngineWindow_TimeScale.h" #include "CogImguiModule.h" -#include "CogInputDataAsset_Actions.h" +#include "CogInputDataAsset.h" #include "CogInputWindow_Actions.h" #include "CogInputWindow_Gamepad.h" #include "CogWindowManager.h" @@ -127,8 +126,10 @@ void ACogSampleGameState::InitializeCog() //--------------------------------------- // Engine //--------------------------------------- + const UCogEngineDataAsset* EngineAsset = GetFirstAssetByClass(); + UCogEngineWindow_Collisions* CollisionsWindow = CogWindowManager->CreateWindow("Engine.Collision"); - CollisionsWindow->SetCollisionsAsset(GetFirstAssetByClass()); + CollisionsWindow->SetAsset(EngineAsset); CogWindowManager->CreateWindow("Engine.Debug Settings"); @@ -154,7 +155,7 @@ void ACogSampleGameState::InitializeCog() CogWindowManager->CreateWindow("Engine.Skeleton"); UCogEngineWindow_Spawns* SpawnWindow = CogWindowManager->CreateWindow("Engine.Spawns"); - SpawnWindow->SetSpawnsAsset(GetFirstAssetByClass()); + SpawnWindow->SetAsset(EngineAsset); UCogEngineWindow_Stats* StatsWindow = CogWindowManager->CreateWindow("Engine.Stats"); @@ -163,36 +164,38 @@ void ACogSampleGameState::InitializeCog() //--------------------------------------- // Abilities //--------------------------------------- - const UCogAbilityDataAsset* AbilitiesAsset = GetFirstAssetByClass(); + const UCogAbilityDataAsset* AbilityAsset = GetFirstAssetByClass(); UCogAbilityWindow_Abilities* AbilitiesWindow = CogWindowManager->CreateWindow("Gameplay.Abilities"); - AbilitiesWindow->Asset = AbilitiesAsset; + AbilitiesWindow->Asset = AbilityAsset; UCogAbilityWindow_Attributes* AttributesWindow = CogWindowManager->CreateWindow("Gameplay.Attributes"); - AttributesWindow->Asset = AbilitiesAsset; + AttributesWindow->Asset = AbilityAsset; UCogAbilityWindow_Cheats* CheatsWindow = CogWindowManager->CreateWindow("Gameplay.Cheats"); - CheatsWindow->SetAsset(AbilitiesAsset); + CheatsWindow->SetAsset(AbilityAsset); UCogAbilityWindow_Effects* EffectsWindow = CogWindowManager->CreateWindow("Gameplay.Effects"); - EffectsWindow->Asset = AbilitiesAsset; + EffectsWindow->Asset = AbilityAsset; UCogAbilityWindow_Pools* PoolsWindow = CogWindowManager->CreateWindow("Gameplay.Pools"); - PoolsWindow->Asset = AbilitiesAsset; + PoolsWindow->Asset = AbilityAsset; CogWindowManager->CreateWindow("Gameplay.Tags"); UCogAbilityWindow_Tweaks* TweaksWindow = CogWindowManager->CreateWindow("Gameplay.Tweaks"); - TweaksWindow->Asset = AbilitiesAsset; + TweaksWindow->Asset = AbilityAsset; //--------------------------------------- // Input //--------------------------------------- + const UCogInputDataAsset* InputAsset = GetFirstAssetByClass(); + UCogInputWindow_Actions* ActionsWindow = CogWindowManager->CreateWindow("Input.Actions"); - ActionsWindow->ActionsAsset = GetFirstAssetByClass(); + ActionsWindow->Asset = InputAsset; UCogInputWindow_Gamepad* GamepadWindow = CogWindowManager->CreateWindow("Input.Gamepad"); - GamepadWindow->ActionsAsset = GetFirstAssetByClass(); + GamepadWindow->Asset = InputAsset; //--------------------------------------- // Main Menu Widget