diff --git a/Content/Core/Debug/DA_Debug_Abilities.uasset b/Content/Core/Debug/DA_Debug_Abilities.uasset index e21228f..e752dba 100644 Binary files a/Content/Core/Debug/DA_Debug_Abilities.uasset and b/Content/Core/Debug/DA_Debug_Abilities.uasset differ diff --git a/Content/Core/Debug/DA_Debug_Cheats.uasset b/Content/Core/Debug/DA_Debug_Cheats.uasset deleted file mode 100644 index b8e39b9..0000000 Binary files a/Content/Core/Debug/DA_Debug_Cheats.uasset and /dev/null differ diff --git a/Content/Core/Debug/DA_Debug_Pools.uasset b/Content/Core/Debug/DA_Debug_Pools.uasset deleted file mode 100644 index d2d75a9..0000000 Binary files a/Content/Core/Debug/DA_Debug_Pools.uasset and /dev/null differ diff --git a/Content/Core/Debug/DA_Debug_Tweaks.uasset b/Content/Core/Debug/DA_Debug_Tweaks.uasset deleted file mode 100644 index 2de255d..0000000 Binary files a/Content/Core/Debug/DA_Debug_Tweaks.uasset and /dev/null differ diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityReplicator.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityReplicator.cpp index 9b62aa3..f555831 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityReplicator.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityReplicator.cpp @@ -216,13 +216,13 @@ void ACogAbilityReplicator::Server_ResetAllTweaks_Implementation() } //-------------------------------------------------------------------------------------------------------------------------- -void ACogAbilityReplicator::SetTweakValue(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex, float Value) +void ACogAbilityReplicator::SetTweakValue(const UCogAbilityDataAsset* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex, float Value) { Server_SetTweakValue(TweaksAsset, TweakIndex, TweakCategoryIndex, Value); } //-------------------------------------------------------------------------------------------------------------------------- -void ACogAbilityReplicator::Server_SetTweakValue_Implementation(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex, float Value) +void ACogAbilityReplicator::Server_SetTweakValue_Implementation(const UCogAbilityDataAsset* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex, float Value) { if (TweaksAsset == nullptr) { @@ -252,7 +252,7 @@ void ACogAbilityReplicator::Server_SetTweakValue_Implementation(const UCogAbilit } //-------------------------------------------------------------------------------------------------------------------------- -void ACogAbilityReplicator::ApplyAllTweaksOnActor(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakCategoryIndex, AActor* Actor) +void ACogAbilityReplicator::ApplyAllTweaksOnActor(const UCogAbilityDataAsset* TweaksAsset, int32 TweakCategoryIndex, AActor* Actor) { if (TweaksAsset == nullptr) { @@ -297,7 +297,7 @@ void ACogAbilityReplicator::ApplyTweakOnActor(AActor* Actor, const FCogAbilityTw } //-------------------------------------------------------------------------------------------------------------------------- -float ACogAbilityReplicator::GetTweakCurrentValue(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex) +float ACogAbilityReplicator::GetTweakCurrentValue(const UCogAbilityDataAsset* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex) { float* Value = GetTweakCurrentValuePtr(TweaksAsset, TweakIndex, TweakCategoryIndex); if (Value == nullptr) @@ -309,7 +309,7 @@ float ACogAbilityReplicator::GetTweakCurrentValue(const UCogAbilityDataAsset_Twe } //-------------------------------------------------------------------------------------------------------------------------- -float* ACogAbilityReplicator::GetTweakCurrentValuePtr(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex) +float* ACogAbilityReplicator::GetTweakCurrentValuePtr(const UCogAbilityDataAsset* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex) { TweakCurrentValues.SetNum(TweaksAsset->Tweaks.Num() * TweaksAsset->TweaksCategories.Num()); @@ -324,7 +324,7 @@ float* ACogAbilityReplicator::GetTweakCurrentValuePtr(const UCogAbilityDataAsset } //-------------------------------------------------------------------------------------------------------------------------- -void ACogAbilityReplicator::SetTweakCurrentValue(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex, float Value) +void ACogAbilityReplicator::SetTweakCurrentValue(const UCogAbilityDataAsset* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex, float Value) { if (TweaksAsset == nullptr) { @@ -344,13 +344,13 @@ void ACogAbilityReplicator::SetTweakCurrentValue(const UCogAbilityDataAsset_Twea } //-------------------------------------------------------------------------------------------------------------------------- -void ACogAbilityReplicator::SetTweakProfile(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 ProfileIndex) +void ACogAbilityReplicator::SetTweakProfile(const UCogAbilityDataAsset* TweaksAsset, int32 ProfileIndex) { Server_SetTweakProfile(TweaksAsset, ProfileIndex); } //-------------------------------------------------------------------------------------------------------------------------- -void ACogAbilityReplicator::Server_SetTweakProfile_Implementation(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 ProfileIndex) +void ACogAbilityReplicator::Server_SetTweakProfile_Implementation(const UCogAbilityDataAsset* TweaksAsset, int32 ProfileIndex) { if (TweaksAsset == nullptr) { @@ -396,7 +396,7 @@ void ACogAbilityReplicator::Server_SetTweakProfile_Implementation(const UCogAbil } //-------------------------------------------------------------------------------------------------------------------------- -void ACogAbilityReplicator::GetActorsFromTweakCategory(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakCategoryIndex, TArray& Actors) +void ACogAbilityReplicator::GetActorsFromTweakCategory(const UCogAbilityDataAsset* TweaksAsset, int32 TweakCategoryIndex, TArray& Actors) { if (TweaksAsset == nullptr) { diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Abilities.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Abilities.cpp index 2fcd900..7201d89 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Abilities.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Abilities.cpp @@ -1,14 +1,12 @@ #include "CogAbilityWindow_Abilities.h" -#include "CogAbilityDataAsset_Abilities.h" +#include "CogAbilityDataAsset.h" #include "CogAbilityHelper.h" +#include "CogImguiHelper.h" #include "CogWindowWidgets.h" #include "imgui.h" #include "imgui_internal.h" -ImVec4 ActiveColor(1.0f, 0.8f, 0.0f, 1.0f); -ImVec4 DeactiveColor(1.0f, 1.0f, 1.0f, 1.0f); - //-------------------------------------------------------------------------------------------------------------------------- void UCogAbilityWindow_Abilities::RenderHelp() { @@ -17,7 +15,7 @@ void UCogAbilityWindow_Abilities::RenderHelp() "Click the ability check box to force its activation or deactivation. " "Right click an ability to open or close the ability separate window. " "Use the 'Give Ability' menu to manually give an ability from a list defined in the '%s' data asset. " - , TCHAR_TO_ANSI(*GetNameSafe(AbilitiesAsset.Get()))); + , TCHAR_TO_ANSI(*GetNameSafe(Asset.Get()))); } //-------------------------------------------------------------------------------------------------------------------------- @@ -108,10 +106,10 @@ void UCogAbilityWindow_Abilities::RenderAbiltiesMenu(AActor* Selection) { if (ImGui::BeginMenu("Give Ability")) { - if (AbilitiesAsset != nullptr) + if (Asset != nullptr) { int Index = 0; - for (TSubclassOf AbilityClass : AbilitiesAsset->Abilities) + for (TSubclassOf AbilityClass : Asset->Abilities) { ImGui::PushID(Index); @@ -164,7 +162,11 @@ void UCogAbilityWindow_Abilities::RenderAbilitiesTable(UAbilitySystemComponent& ImGui::PushID(Index); - ImVec4 Color = Spec.ActiveCount > 0 ? ActiveColor : DeactiveColor; + ImVec4 Color(1.0f, 1.0f, 1.0f, 1.0f); + if (Asset != nullptr) + { + Color = FCogImguiHelper::ToImVec4(Spec.ActiveCount > 0 ? Asset->AbilityActiveColor : Asset->AbilityInactiveColor); + } ImGui::PushStyleColor(ImGuiCol_Text, Color); //------------------------ @@ -332,6 +334,12 @@ void UCogAbilityWindow_Abilities::RenderAbilityInfo(const UAbilitySystemComponen ImGui::TableSetupColumn("Property"); ImGui::TableSetupColumn("Value"); + ImVec4 Color(1.0f, 1.0f, 1.0f, 1.0f); + if (Asset != nullptr) + { + Color = FCogImguiHelper::ToImVec4(Spec.ActiveCount > 0 ? Asset->AbilityActiveColor : Asset->AbilityInactiveColor); + } + //------------------------ // Name //------------------------ @@ -339,7 +347,6 @@ void UCogAbilityWindow_Abilities::RenderAbilityInfo(const UAbilitySystemComponen ImGui::TableNextColumn(); ImGui::TextColored(TextColor, "Name"); ImGui::TableNextColumn(); - ImVec4 Color = Spec.ActiveCount > 0 ? ActiveColor : DeactiveColor; ImGui::PushStyleColor(ImGuiCol_Text, Color); ImGui::Text("%s", TCHAR_TO_ANSI(*GetAbilityName(Ability))); ImGui::PopStyleColor(1); diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Attributes.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Attributes.cpp index ba89a7e..ea7ee41 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Attributes.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Attributes.cpp @@ -2,7 +2,9 @@ #include "AbilitySystemComponent.h" #include "AbilitySystemGlobals.h" +#include "CogAbilityDataAsset.h" #include "CogAbilityHelper.h" +#include "CogImguiHelper.h" #include "CogWindowWidgets.h" #include "AttributeSet.h" #include "EngineUtils.h" @@ -190,21 +192,24 @@ void UCogAbilityWindow_Attributes::RenderContent() ImGui::TableNextRow(); - ImVec4 Color; - if (CurrentValue > BaseValue) + FLinearColor Color = FLinearColor::White; + if (Asset != nullptr) { - Color = ImVec4(0.0f, 1.0f, 0.0f, 1.0f); - } - else if (CurrentValue < BaseValue) - { - Color = ImVec4(1.0f, 0.0f, 0.0f, 1.0f); - } - else - { - Color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); + if (CurrentValue > BaseValue) + { + Color = Asset->PositiveEffectColor; + } + else if (CurrentValue < BaseValue) + { + Color = Asset->NegativeEffectColor; + } + else + { + Color = Asset->NeutralEffectColor; + } } - ImGui::PushStyleColor(ImGuiCol_Text, Color); + ImGui::PushStyleColor(ImGuiCol_Text, FCogImguiHelper::ToImVec4(Color)); //------------------------ // Name @@ -228,7 +233,7 @@ void UCogAbilityWindow_Attributes::RenderContent() FCogWindowWidgets::EndTableTooltip(); } - ImGui::PushStyleColor(ImGuiCol_Text, Color); + ImGui::PushStyleColor(ImGuiCol_Text, FCogImguiHelper::ToImVec4(Color)); //------------------------ // Base Value diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Cheats.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Cheats.cpp index 369908d..c34a694 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Cheats.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Cheats.cpp @@ -1,7 +1,7 @@ #include "CogAbilityWindow_Cheats.h" #include "AbilitySystemGlobals.h" -#include "CogAbilityDataAsset_Cheats.h" +#include "CogAbilityDataAsset.h" #include "CogAbilityReplicator.h" #include "CogCommonAllegianceActorInterface.h" #include "CogDebugDraw.h" @@ -21,7 +21,7 @@ void UCogAbilityWindow_Cheats::RenderHelp() " [CTRL] to apply the cheat to controlled actor\n" " [ALT] to apply the cheat to the allies of the selected actor\n" " [SHIFT] to apply the cheat to the enemies of the selected actor\n" - , TCHAR_TO_ANSI(*GetNameSafe(CheatsAsset.Get())) + , TCHAR_TO_ANSI(*GetNameSafe(Asset.Get())) ); } @@ -32,9 +32,9 @@ UCogAbilityWindow_Cheats::UCogAbilityWindow_Cheats() } //-------------------------------------------------------------------------------------------------------------------------- -void UCogAbilityWindow_Cheats::SetCheatsAsset(const UCogAbilityDataAsset_Cheats* Value) +void UCogAbilityWindow_Cheats::SetAsset(const UCogAbilityDataAsset* Value) { - CheatsAsset = Value; + Asset = Value; if (bReapplyCheatsBetweenPlays == false) { @@ -48,7 +48,7 @@ void UCogAbilityWindow_Cheats::SetCheatsAsset(const UCogAbilityDataAsset_Cheats* } IsFirstLaunch = false; - if (CheatsAsset == nullptr) + if (Asset == nullptr) { return; } @@ -69,7 +69,7 @@ void UCogAbilityWindow_Cheats::SetCheatsAsset(const UCogAbilityDataAsset_Cheats* for (const FString& AppliedCheatName : AppliedCheats) { - if (const FCogAbilityCheat* Cheat = CheatsAsset->PersistentEffects.FindByPredicate( + if (const FCogAbilityCheat* Cheat = Asset->PersistentEffects.FindByPredicate( [AppliedCheatName](const FCogAbilityCheat& Cheat) { return Cheat.Name == AppliedCheatName; })) { Replicator->ApplyCheat(LocalPawn, Targets, *Cheat); @@ -88,7 +88,7 @@ void UCogAbilityWindow_Cheats::RenderContent() return; } - if (CheatsAsset == nullptr) + if (Asset == nullptr) { return; } @@ -128,7 +128,7 @@ void UCogAbilityWindow_Cheats::RenderContent() bool bHasChanged = false; int Index = 0; - for (const FCogAbilityCheat& CheatEffect : CheatsAsset->PersistentEffects) + for (const FCogAbilityCheat& CheatEffect : Asset->PersistentEffects) { ImGui::PushID(Index); bHasChanged |= AddCheat(ControlledActor, SelectedActor, CheatEffect, true); @@ -144,7 +144,7 @@ void UCogAbilityWindow_Cheats::RenderContent() { AppliedCheats.Empty(); - for (const FCogAbilityCheat& CheatEffect : CheatsAsset->PersistentEffects) + for (const FCogAbilityCheat& CheatEffect : Asset->PersistentEffects) { if (ACogAbilityReplicator::IsCheatActive(SelectedActor, CheatEffect)) { @@ -155,7 +155,7 @@ void UCogAbilityWindow_Cheats::RenderContent() ImGui::TableNextColumn(); - for (const FCogAbilityCheat& CheatEffect : CheatsAsset->InstantEffects) + for (const FCogAbilityCheat& CheatEffect : Asset->InstantEffects) { ImGui::PushID(Index); AddCheat(ControlledActor, SelectedActor, CheatEffect, false); @@ -180,17 +180,17 @@ bool UCogAbilityWindow_Cheats::AddCheat(AActor* ControlledActor, AActor* Selecte const FGameplayTagContainer& Tags = Cheat.Effect->GetDefaultObject()->InheritableGameplayEffectTags.CombinedTags; FLinearColor Color; - if (Tags.HasTag(CheatsAsset->NegativeEffectTag)) + if (Tags.HasTag(Asset->NegativeEffectTag)) { - Color = CheatsAsset->NegativeEffectColor; + Color = Asset->NegativeEffectColor; } - else if (Tags.HasTag(CheatsAsset->PositiveEffectTag)) + else if (Tags.HasTag(Asset->PositiveEffectTag)) { - Color = CheatsAsset->PositiveEffectColor; + Color = Asset->PositiveEffectColor; } else { - Color = CheatsAsset->NeutralEffectColor; + Color = Asset->NeutralEffectColor; } FCogWindowWidgets::PushBackColor(FCogImguiHelper::ToImVec4(Color)); diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Effects.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Effects.cpp index 9305d37..88e15df 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Effects.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Effects.cpp @@ -3,6 +3,7 @@ #include "AbilitySystemComponent.h" #include "AbilitySystemGlobals.h" #include "AttributeSet.h" +#include "CogAbilityDataAsset.h" #include "CogAbilityHelper.h" #include "CogWindowWidgets.h" #include "EngineUtils.h" @@ -20,7 +21,7 @@ void UCogAbilityWindow_Effects::RenderHelp() //-------------------------------------------------------------------------------------------------------------------------- UCogAbilityWindow_Effects::UCogAbilityWindow_Effects() { - bHasMenu = true; + bHasMenu = false; } //-------------------------------------------------------------------------------------------------------------------------- @@ -88,21 +89,24 @@ void UCogAbilityWindow_Effects::RenderEffectRow(const UAbilitySystemComponent& A const FGameplayTagContainer& Tags = Effect.InheritableGameplayEffectTags.CombinedTags; - ImVec4 Color; - if (Tags.HasTag(NegativeEffectTag)) + FLinearColor Color = FLinearColor::White; + if (Asset != nullptr) { - Color = ImVec4(1.0f, 0.5f, 0.5f, 1.0f); - } - else if (Tags.HasTag(PositiveEffectTag)) - { - Color = ImVec4(0.5f, 1.0f, 0.5f, 1.0f); - } - else - { - Color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); + if (Tags.HasTag(Asset->NegativeEffectTag)) + { + Color = Asset->NegativeEffectColor; + } + else if (Tags.HasTag(Asset->PositiveEffectTag)) + { + Color = Asset->PositiveEffectColor; + } + else + { + Color = Asset->NeutralEffectColor; + } } - ImGui::PushStyleColor(ImGuiCol_Text, Color); + ImGui::PushStyleColor(ImGuiCol_Text, FCogImguiHelper::ToImVec4(Color)); if (ImGui::Selectable(TCHAR_TO_ANSI(*GetEffectName(Effect)), Selected == Index, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowItemOverlap | ImGuiSelectableFlags_AllowDoubleClick)) { diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Pools.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Pools.cpp index f7f13b3..a4a5a28 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Pools.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Pools.cpp @@ -1,6 +1,7 @@ #include "CogAbilityWindow_Pools.h" #include "AbilitySystemComponent.h" +#include "CogAbilityDataAsset.h" #include "CogImguiHelper.h" //-------------------------------------------------------------------------------------------------------------------------- @@ -9,7 +10,7 @@ void UCogAbilityWindow_Pools::RenderHelp() ImGui::Text( "This window displays attributes of the selected actor as pools. " "The pools can be configured in the '%s' data asset." - , TCHAR_TO_ANSI(*GetNameSafe(PoolsAsset.Get())) + , TCHAR_TO_ANSI(*GetNameSafe(Asset.Get())) ); } @@ -18,7 +19,7 @@ void UCogAbilityWindow_Pools::RenderContent() { Super::RenderContent(); - if (PoolsAsset == nullptr) + if (Asset == nullptr) { return; } @@ -34,7 +35,7 @@ void UCogAbilityWindow_Pools::RenderContent() ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn("Pool", ImGuiTableColumnFlags_WidthStretch); - for (const FCogAbilityPool& Pool : PoolsAsset->Pools) + for (const FCogAbilityPool& Pool : Asset->Pools) { DrawPool(AbilitySystem, Pool); } diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tags.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tags.cpp index a74603c..f7827bb 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tags.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tags.cpp @@ -13,7 +13,7 @@ void UCogAbilityWindow_Tags::RenderHelp() //-------------------------------------------------------------------------------------------------------------------------- UCogAbilityWindow_Tags::UCogAbilityWindow_Tags() { - bHasMenu = true; + bHasMenu = false; } //-------------------------------------------------------------------------------------------------------------------------- diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tweaks.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tweaks.cpp index b86d135..71b08db 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tweaks.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tweaks.cpp @@ -1,6 +1,7 @@ #include "CogAbilityWindow_Tweaks.h" #include "AbilitySystemComponent.h" +#include "CogAbilityDataAsset.h" //-------------------------------------------------------------------------------------------------------------------------- void UCogAbilityWindow_Tweaks::RenderHelp() @@ -9,7 +10,7 @@ void UCogAbilityWindow_Tweaks::RenderHelp() "This window can be used to apply tweaks to all the loaded actors. " "The tweaks are used to test various gameplay settings by actor category. " "The tweaks can be configured in the '%s' data asset. " - , TCHAR_TO_ANSI(*GetNameSafe(TweaksAsset.Get())) + , TCHAR_TO_ANSI(*GetNameSafe(Asset.Get())) ); } @@ -18,7 +19,7 @@ void UCogAbilityWindow_Tweaks::RenderContent() { Super::RenderContent(); - if (TweaksAsset == nullptr) + if (Asset == nullptr) { return; } @@ -41,9 +42,9 @@ void UCogAbilityWindow_Tweaks::RenderContent() int32 CurrentTweakProfileIndex = Replicator->GetTweakProfileIndex(); FName CurrentProfileName = FName("None"); - if (TweaksAsset->TweakProfiles.IsValidIndex(CurrentTweakProfileIndex)) + if (Asset->TweakProfiles.IsValidIndex(CurrentTweakProfileIndex)) { - CurrentProfileName = TweaksAsset->TweakProfiles[CurrentTweakProfileIndex].Name; + CurrentProfileName = Asset->TweakProfiles[CurrentTweakProfileIndex].Name; } if (ImGui::BeginCombo("Profile", TCHAR_TO_ANSI(*CurrentProfileName.ToString()))) @@ -52,18 +53,18 @@ void UCogAbilityWindow_Tweaks::RenderContent() bool IsSelected = CurrentTweakProfileIndex == INDEX_NONE; if (ImGui::Selectable("None", IsSelected)) { - Replicator->SetTweakProfile(TweaksAsset.Get(), INDEX_NONE); + Replicator->SetTweakProfile(Asset.Get(), INDEX_NONE); } } - for (int32 TweakProfileIndex = 0; TweakProfileIndex < TweaksAsset->TweakProfiles.Num(); ++TweakProfileIndex) + for (int32 TweakProfileIndex = 0; TweakProfileIndex < Asset->TweakProfiles.Num(); ++TweakProfileIndex) { - const FCogAbilityTweakProfile& TweakProfile = TweaksAsset->TweakProfiles[TweakProfileIndex]; + const FCogAbilityTweakProfile& TweakProfile = Asset->TweakProfiles[TweakProfileIndex]; bool IsSelected = TweakProfileIndex == CurrentTweakProfileIndex; if (ImGui::Selectable(TCHAR_TO_ANSI(*TweakProfile.Name.ToString()), IsSelected)) { - Replicator->SetTweakProfile(TweaksAsset.Get(), TweakProfileIndex); + Replicator->SetTweakProfile(Asset.Get(), TweakProfileIndex); } } ImGui::EndCombo(); @@ -71,12 +72,12 @@ void UCogAbilityWindow_Tweaks::RenderContent() ImGui::Separator(); - if (ImGui::BeginTable("Tweaks", 1 + TweaksAsset->TweaksCategories.Num(), ImGuiTableFlags_Resizable | ImGuiTableFlags_NoBordersInBodyUntilResize)) + if (ImGui::BeginTable("Tweaks", 1 + Asset->TweaksCategories.Num(), ImGuiTableFlags_Resizable | ImGuiTableFlags_NoBordersInBodyUntilResize)) { ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch); - for (int32 TweakCategoryIndex = 0; TweakCategoryIndex < TweaksAsset->TweaksCategories.Num(); ++TweakCategoryIndex) + for (int32 TweakCategoryIndex = 0; TweakCategoryIndex < Asset->TweaksCategories.Num(); ++TweakCategoryIndex) { - FCogAbilityTweakCategory& Category = TweaksAsset->TweaksCategories[TweakCategoryIndex]; + const FCogAbilityTweakCategory& Category = Asset->TweaksCategories[TweakCategoryIndex]; ImGui::TableSetupColumn(TCHAR_TO_ANSI(*Category.Name), ImGuiTableColumnFlags_WidthStretch); } ImGui::TableHeadersRow(); @@ -84,7 +85,7 @@ void UCogAbilityWindow_Tweaks::RenderContent() ImGui::TableNextRow(); int32 TweakIndex = 0; - for (FCogAbilityTweak& Tweak : TweaksAsset->Tweaks) + for (const FCogAbilityTweak& Tweak : Asset->Tweaks) { if (Tweak.Effect != nullptr) { @@ -93,7 +94,7 @@ void UCogAbilityWindow_Tweaks::RenderContent() ImGui::TableNextColumn(); ImGui::Text("%s", TCHAR_TO_ANSI(*Tweak.Name.ToString())); - for (int TweakCategoryIndex = 0; TweakCategoryIndex < TweaksAsset->TweaksCategories.Num(); ++TweakCategoryIndex) + for (int TweakCategoryIndex = 0; TweakCategoryIndex < Asset->TweaksCategories.Num(); ++TweakCategoryIndex) { ImGui::TableNextColumn(); ImGui::PushID(TweakCategoryIndex); @@ -113,22 +114,22 @@ void UCogAbilityWindow_Tweaks::RenderContent() //-------------------------------------------------------------------------------------------------------------------------- void UCogAbilityWindow_Tweaks::DrawTweak(ACogAbilityReplicator* Replicator, int32 TweakIndex, int32 TweakCategoryIndex) { - if (TweaksAsset->TweaksCategories.IsValidIndex(TweakCategoryIndex) == false) + if (Asset->TweaksCategories.IsValidIndex(TweakCategoryIndex) == false) { return; } - float* Value = Replicator->GetTweakCurrentValuePtr(TweaksAsset.Get(), TweakIndex, TweakCategoryIndex); + float* Value = Replicator->GetTweakCurrentValuePtr(Asset.Get(), TweakIndex, TweakCategoryIndex); if (Value == nullptr) { return; } - const FCogAbilityTweakCategory& Category = TweaksAsset->TweaksCategories[TweakCategoryIndex]; + const FCogAbilityTweakCategory& Category = Asset->TweaksCategories[TweakCategoryIndex]; FCogWindowWidgets::PushBackColor(FCogImguiHelper::ToImVec4(Category.Color)); ImGui::PushItemWidth(-1); - ImGui::SliderFloat("##Value", Value, TweaksAsset->TweakMinValue, TweaksAsset->TweakMaxValue, "%+0.0f%%", 1.0f); + ImGui::SliderFloat("##Value", Value, Asset->TweakMinValue, Asset->TweakMaxValue, "%+0.0f%%", 1.0f); ImGui::PopItemWidth(); FCogWindowWidgets::PopBackColor(); @@ -146,6 +147,6 @@ void UCogAbilityWindow_Tweaks::DrawTweak(ACogAbilityReplicator* Replicator, int3 if (bUpdateValue) { - Replicator->SetTweakValue(TweaksAsset.Get(), TweakIndex, TweakCategoryIndex, *Value); + Replicator->SetTweakValue(Asset.Get(), TweakIndex, TweakCategoryIndex, *Value); } } \ No newline at end of file diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset.h new file mode 100644 index 0000000..ba87334 --- /dev/null +++ b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset.h @@ -0,0 +1,203 @@ +#pragma once + +#include "CoreMinimal.h" +#include "Engine/DataAsset.h" +#include "GameplayEffect.h" +#include "CogAbilityDataAsset.generated.h" + + +class UGameplayEffect; + +//-------------------------------------------------------------------------------------------------------------------------- +USTRUCT() +struct COGABILITY_API FCogAbilityCheat +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere) + FString Name; + + UPROPERTY(EditAnywhere) + TSubclassOf Effect; +}; + +//-------------------------------------------------------------------------------------------------------------------------- +USTRUCT() +struct COGABILITY_API FCogAbilityPool +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere) + FString Name; + + UPROPERTY(EditAnywhere) + FGameplayAttribute Value; + + UPROPERTY(EditAnywhere) + FGameplayAttribute Min; + + UPROPERTY(EditAnywhere) + FGameplayAttribute Max; + + UPROPERTY(EditAnywhere) + FGameplayAttribute Regen; + + UPROPERTY(EditAnywhere) + FLinearColor Color = FLinearColor(0.5f, 0.5f, 0.5f, 1.0f); + + UPROPERTY(EditAnywhere) + FLinearColor BackColor = FLinearColor(0.15, 0.15, 0.15, 1.0f); +}; + + +//-------------------------------------------------------------------------------------------------------------------------- +USTRUCT() +struct FCogAbilityTweak +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere) + FName Name; + + UPROPERTY(EditAnywhere) + TSubclassOf Effect; + + UPROPERTY(EditAnywhere) + float Multiplier = 0.01f; + + UPROPERTY(EditAnywhere) + float AddPostMultiplier = 1.0f; +}; + +//-------------------------------------------------------------------------------------------------------------------------- +USTRUCT() +struct FCogAbilityTweakCategory +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere) + FString Name; + + UPROPERTY(EditAnywhere) + FGameplayTag Id; + + UPROPERTY(EditAnywhere) + TSubclassOf ActorClass; + + UPROPERTY(EditAnywhere) + FGameplayTagContainer RequiredTags; + + UPROPERTY(EditAnywhere) + FGameplayTagContainer IgnoredTags; + + UPROPERTY(EditAnywhere) + FLinearColor Color = FLinearColor::White; +}; + +//-------------------------------------------------------------------------------------------------------------------------- +USTRUCT() +struct FCogAbilityTweakProfileValue +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere) + TSubclassOf Effect; + + UPROPERTY(EditAnywhere) + FGameplayTag CategoryId; + + UPROPERTY(EditAnywhere) + float Value = 0.0f; +}; + +//-------------------------------------------------------------------------------------------------------------------------- +USTRUCT() +struct FCogAbilityTweakProfile +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere) + FName Name; + + UPROPERTY(EditAnywhere) + TArray Tweaks; +}; + + +//-------------------------------------------------------------------------------------------------------------------------- +UCLASS(Blueprintable) +class COGABILITY_API UCogAbilityDataAsset : public UPrimaryDataAsset +{ + GENERATED_BODY() + +public: + + UCogAbilityDataAsset() {} + + //---------------------------------------------------------------------------------------------------------------------- + // Abilities + //---------------------------------------------------------------------------------------------------------------------- + + UPROPERTY(Category = "Abilities", EditAnywhere) + TArray> Abilities; + + UPROPERTY(Category = "Abilities", EditAnywhere) + FLinearColor AbilityActiveColor = FLinearColor(1.0f, 0.8f, 0.0f, 1.0f); + + UPROPERTY(Category = "Abilities", EditAnywhere) + FLinearColor AbilityInactiveColor = FLinearColor(1.0f, 1.0f, 1.0f, 1.0f); + + //---------------------------------------------------------------------------------------------------------------------- + // Cheats + //---------------------------------------------------------------------------------------------------------------------- + + UPROPERTY(Category="Cheats", EditAnywhere) + FGameplayTag NegativeEffectTag; + + UPROPERTY(Category = "Cheats", EditAnywhere) + FGameplayTag PositiveEffectTag; + + UPROPERTY(Category = "Cheats", EditAnywhere) + FLinearColor NeutralEffectColor = FLinearColor(0.5f, 0.5f, 0.5f, 1.0f); + + UPROPERTY(Category = "Cheats", EditAnywhere) + FLinearColor NegativeEffectColor = FLinearColor(1.0f, 0.5f, 0.5f, 1.0f); + + UPROPERTY(Category = "Cheats", EditAnywhere) + FLinearColor PositiveEffectColor = FLinearColor(0.0f, 1.0f, 0.5f, 1.0f); + + UPROPERTY(Category = "Cheats", EditAnywhere, meta = (TitleProperty = "Name")) + TArray PersistentEffects; + + UPROPERTY(Category = "Cheats", EditAnywhere, meta = (TitleProperty = "Name")) + TArray InstantEffects; + + //---------------------------------------------------------------------------------------------------------------------- + // Pools + //---------------------------------------------------------------------------------------------------------------------- + + UPROPERTY(Category = "Pools", EditAnywhere, meta = (TitleProperty = "Name")) + TArray Pools; + + //---------------------------------------------------------------------------------------------------------------------- + // Tweaks + //---------------------------------------------------------------------------------------------------------------------- + + UPROPERTY(Category = "Tweaks", EditAnywhere) + float TweakMinValue = -100.0f; + + UPROPERTY(Category = "Tweaks", EditAnywhere) + float TweakMaxValue = 200.0f; + + UPROPERTY(Category = "Tweaks", EditAnywhere) + FGameplayTag SetByCallerMagnitudeTag; + + UPROPERTY(Category = "Tweaks", EditAnywhere, meta = (TitleProperty = "Name")) + TArray Tweaks; + + UPROPERTY(Category = "Tweaks", EditAnywhere, meta = (TitleProperty = "Name")) + TArray TweaksCategories; + + UPROPERTY(Category = "Tweaks", EditAnywhere, meta = (TitleProperty = "Name")) + TArray TweakProfiles; +}; \ No newline at end of file diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Abilities.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Abilities.h deleted file mode 100644 index 922a76d..0000000 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Abilities.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "CoreMinimal.h" -#include "Engine/DataAsset.h" -#include "CogAbilityDataAsset_Abilities.generated.h" - -class UGameplayAbility; - -//-------------------------------------------------------------------------------------------------------------------------- -UCLASS(Blueprintable) -class COGABILITY_API UCogAbilityDataAsset_Abilities : public UPrimaryDataAsset -{ - GENERATED_BODY() - -public: - - UCogAbilityDataAsset_Abilities() {} - - UPROPERTY(EditAnywhere) - TArray> Abilities; -}; diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Cheats.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Cheats.h deleted file mode 100644 index 42ebe0e..0000000 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Cheats.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include "CoreMinimal.h" -#include "Engine/DataAsset.h" -#include "GameplayEffect.h" -#include "CogAbilityDataAsset_Cheats.generated.h" - -//-------------------------------------------------------------------------------------------------------------------------- -USTRUCT() -struct COGABILITY_API FCogAbilityCheat -{ - GENERATED_BODY() - - UPROPERTY(EditAnywhere) - FString Name; - - UPROPERTY(EditAnywhere) - TSubclassOf Effect; -}; - -//-------------------------------------------------------------------------------------------------------------------------- -UCLASS(Blueprintable) -class COGABILITY_API UCogAbilityDataAsset_Cheats : public UPrimaryDataAsset -{ - GENERATED_BODY() - -public: - - UCogAbilityDataAsset_Cheats() {} - - UPROPERTY(EditAnywhere) - FGameplayTag NegativeEffectTag; - - UPROPERTY(EditAnywhere) - FGameplayTag PositiveEffectTag; - - UPROPERTY(EditAnywhere) - FLinearColor NeutralEffectColor = FLinearColor(0.5f, 0.5f, 0.5f, 1.0f); - - UPROPERTY(EditAnywhere) - FLinearColor NegativeEffectColor = FLinearColor(1.0f, 0.5f, 0.5f, 1.0f); - - UPROPERTY(EditAnywhere) - FLinearColor PositiveEffectColor = FLinearColor(0.0f, 1.0f, 0.5f, 1.0f); - - UPROPERTY(EditAnywhere, meta = (TitleProperty = "Name")) - TArray PersistentEffects; - - UPROPERTY(EditAnywhere, meta = (TitleProperty = "Name")) - TArray InstantEffects; -}; \ No newline at end of file diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Pools.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Pools.h deleted file mode 100644 index e44c48e..0000000 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Pools.h +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once - -#include "CoreMinimal.h" -#include "Engine/DataAsset.h" -#include "CogAbilityDataAsset_Pools.generated.h" - -//-------------------------------------------------------------------------------------------------------------------------- -USTRUCT() -struct COGABILITY_API FCogAbilityPool -{ - GENERATED_BODY() - - UPROPERTY(EditAnywhere) - FString Name; - - UPROPERTY(EditAnywhere) - FGameplayAttribute Value; - - UPROPERTY(EditAnywhere) - FGameplayAttribute Min; - - UPROPERTY(EditAnywhere) - FGameplayAttribute Max; - - UPROPERTY(EditAnywhere) - FGameplayAttribute Regen; - - UPROPERTY(EditAnywhere) - FLinearColor Color = FLinearColor(0.5f, 0.5f, 0.5f, 1.0f); - - UPROPERTY(EditAnywhere) - FLinearColor BackColor = FLinearColor(0.15, 0.15, 0.15, 1.0f); -}; - -//-------------------------------------------------------------------------------------------------------------------------- -UCLASS(Blueprintable) -class COGABILITY_API UCogAbilityDataAsset_Pools : public UPrimaryDataAsset -{ - GENERATED_BODY() - -public: - - UCogAbilityDataAsset_Pools() {} - - UPROPERTY(EditAnywhere, meta = (TitleProperty = "Name")) - TArray Pools; -}; diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Tweaks.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Tweaks.h deleted file mode 100644 index 2e5a4da..0000000 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDataAsset_Tweaks.h +++ /dev/null @@ -1,108 +0,0 @@ -#pragma once - -#include "CoreMinimal.h" -#include "Engine/DataAsset.h" -#include "CogAbilityDataAsset_Tweaks.generated.h" - -class UGameplayEffect; - -//-------------------------------------------------------------------------------------------------------------------------- -USTRUCT() -struct FCogAbilityTweak -{ - GENERATED_BODY() - - UPROPERTY(EditAnywhere) - FName Name; - - UPROPERTY(EditAnywhere) - TSubclassOf Effect; - - UPROPERTY(EditAnywhere) - float Multiplier = 0.01f; - - UPROPERTY(EditAnywhere) - float AddPostMultiplier = 1.0f; -}; - -//-------------------------------------------------------------------------------------------------------------------------- -USTRUCT() -struct FCogAbilityTweakCategory -{ - GENERATED_BODY() - - UPROPERTY(EditAnywhere) - FString Name; - - UPROPERTY(EditAnywhere) - FGameplayTag Id; - - UPROPERTY(EditAnywhere) - TSubclassOf ActorClass; - - UPROPERTY(EditAnywhere) - FGameplayTagContainer RequiredTags; - - UPROPERTY(EditAnywhere) - FGameplayTagContainer IgnoredTags; - - UPROPERTY(EditAnywhere) - FLinearColor Color = FLinearColor::White; -}; - -//-------------------------------------------------------------------------------------------------------------------------- -USTRUCT() -struct FCogAbilityTweakProfileValue -{ - GENERATED_BODY() - - UPROPERTY(EditAnywhere) - TSubclassOf Effect; - - UPROPERTY(EditAnywhere) - FGameplayTag CategoryId; - - UPROPERTY(EditAnywhere) - float Value = 0.0f; -}; - -//-------------------------------------------------------------------------------------------------------------------------- -USTRUCT() -struct FCogAbilityTweakProfile -{ - GENERATED_BODY() - - UPROPERTY(EditAnywhere) - FName Name; - - UPROPERTY(EditAnywhere) - TArray Tweaks; -}; - -//-------------------------------------------------------------------------------------------------------------------------- -UCLASS(Blueprintable) -class COGABILITY_API UCogAbilityDataAsset_Tweaks : public UPrimaryDataAsset -{ - GENERATED_BODY() - -public: - UCogAbilityDataAsset_Tweaks() {} - - UPROPERTY(EditAnywhere) - float TweakMinValue = -100.0f; - - UPROPERTY(EditAnywhere) - float TweakMaxValue = 200.0f; - - UPROPERTY(EditAnywhere) - FGameplayTag SetByCallerMagnitudeTag; - - UPROPERTY(EditAnywhere, meta = (TitleProperty = "Name")) - TArray Tweaks; - - UPROPERTY(EditAnywhere, meta = (TitleProperty = "Name")) - TArray TweaksCategories; - - UPROPERTY(EditAnywhere, meta = (TitleProperty = "Name")) - TArray TweakProfiles; -}; diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityReplicator.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityReplicator.h index 7224231..31701e1 100644 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityReplicator.h +++ b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityReplicator.h @@ -6,7 +6,7 @@ class AActor; class UAbilitySystemComponent; -class UCogAbilityDataAsset_Tweaks; +class UCogAbilityDataAsset; struct FCogAbilityCheat; struct FCogAbilityTweak; struct FGameplayTag; @@ -38,15 +38,15 @@ public: void ResetAllTweaks(); - void SetTweakValue(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakIndex, int32 CategoryIndex, float Value); + void SetTweakValue(const UCogAbilityDataAsset* TweaksAsset, int32 TweakIndex, int32 CategoryIndex, float Value); - void SetTweakProfile(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 ProfileIndex); + void SetTweakProfile(const UCogAbilityDataAsset* TweaksAsset, int32 ProfileIndex); int32 GetTweakProfileIndex() const { return TweakProfileIndex; } - float GetTweakCurrentValue(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakIndex, int32 CategoryIndex); + float GetTweakCurrentValue(const UCogAbilityDataAsset* TweaksAsset, int32 TweakIndex, int32 CategoryIndex); - float* GetTweakCurrentValuePtr(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakIndex, int32 CategoryIndex); + float* GetTweakCurrentValuePtr(const UCogAbilityDataAsset* TweaksAsset, int32 TweakIndex, int32 CategoryIndex); private: @@ -63,15 +63,15 @@ private: void Server_ResetAllTweaks(); UFUNCTION(Reliable, Server) - void Server_SetTweakValue(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex, float Value); + void Server_SetTweakValue(const UCogAbilityDataAsset* TweaksAsset, int32 TweakIndex, int32 TweakCategoryIndex, float Value); UFUNCTION(Reliable, Server) - void Server_SetTweakProfile(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 ProfileIndex); + void Server_SetTweakProfile(const UCogAbilityDataAsset* TweaksAsset, int32 ProfileIndex); - void SetTweakCurrentValue(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakIndex, int32 CategoryIndex, float Value); + void SetTweakCurrentValue(const UCogAbilityDataAsset* TweaksAsset, int32 TweakIndex, int32 CategoryIndex, float Value); void ApplyTweakOnActor(AActor* Actor, const FCogAbilityTweak& Tweak, float Value, const FGameplayTag& SetByCallerMagnitudeTag); - void ApplyAllTweaksOnActor(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 TweakCategoryIndex, AActor* Actor); - void GetActorsFromTweakCategory(const UCogAbilityDataAsset_Tweaks* TweaksAsset, int32 CategoryIndex, TArray& Actors); + void ApplyAllTweaksOnActor(const UCogAbilityDataAsset* TweaksAsset, int32 TweakCategoryIndex, AActor* Actor); + void GetActorsFromTweakCategory(const UCogAbilityDataAsset* TweaksAsset, int32 CategoryIndex, TArray& Actors); TObjectPtr OwnerPlayerController; diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Abilities.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Abilities.h index 85984ba..30cb6ec 100644 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Abilities.h +++ b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Abilities.h @@ -5,7 +5,7 @@ #include "CogAbilityWindow_Abilities.generated.h" class UGameplayAbility; -class UCogAbilityDataAsset_Abilities; +class UCogAbilityDataAsset; struct FGameplayAbilitySpec; UCLASS() @@ -17,7 +17,7 @@ public: UCogAbilityWindow_Abilities(); - TWeakObjectPtr AbilitiesAsset; + TWeakObjectPtr Asset; protected: diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Attributes.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Attributes.h index 9f6c0a4..350a75d 100644 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Attributes.h +++ b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Attributes.h @@ -4,6 +4,8 @@ #include "CogWindow.h" #include "CogAbilityWindow_Attributes.generated.h" +class UCogAbilityDataAsset; + UCLASS(Config = Cog) class COGABILITY_API UCogAbilityWindow_Attributes : public UCogWindow { @@ -13,6 +15,8 @@ public: UCogAbilityWindow_Attributes(); + TWeakObjectPtr Asset; + protected: virtual void RenderHelp() override; diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Cheats.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Cheats.h index efe1215..51445d5 100644 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Cheats.h +++ b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Cheats.h @@ -5,7 +5,7 @@ #include "CogAbilityWindow_Cheats.generated.h" class AActor; -class UCogAbilityDataAsset_Cheats; +class UCogAbilityDataAsset; struct FCogAbilityCheat; UCLASS(Config = Cog) @@ -17,9 +17,9 @@ public: UCogAbilityWindow_Cheats(); - const UCogAbilityDataAsset_Cheats* GetCheatsAsset() const { return CheatsAsset.Get(); } + const UCogAbilityDataAsset* GetAsset() const { return Asset.Get(); } - void SetCheatsAsset(const UCogAbilityDataAsset_Cheats* Value); + void SetAsset(const UCogAbilityDataAsset* Value); protected: @@ -42,5 +42,5 @@ private: UPROPERTY(Config) TArray AppliedCheats; - TWeakObjectPtr CheatsAsset; + TWeakObjectPtr Asset; }; diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Effects.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Effects.h index 3b08088..1de1a4d 100644 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Effects.h +++ b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Effects.h @@ -5,6 +5,8 @@ #include "CogWindow.h" #include "CogAbilityWindow_Effects.generated.h" +class UCogAbilityDataAsset; + UCLASS() class COGABILITY_API UCogAbilityWindow_Effects : public UCogWindow { @@ -14,9 +16,7 @@ public: UCogAbilityWindow_Effects(); - FGameplayTag NegativeEffectTag; - - FGameplayTag PositiveEffectTag; + TWeakObjectPtr Asset; protected: diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Pools.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Pools.h index e57f00f..737d320 100644 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Pools.h +++ b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Pools.h @@ -5,7 +5,7 @@ #include "CogWindow.h" #include "CogAbilityWindow_Pools.generated.h" -class UCogAbilityDataAsset_Pools; +class UCogAbilityDataAsset; class UAbilitySystemComponent; struct FCogAbilityPool; @@ -16,7 +16,7 @@ class COGABILITY_API UCogAbilityWindow_Pools : public UCogWindow public: - TWeakObjectPtr PoolsAsset; + TWeakObjectPtr Asset; protected: diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Tweaks.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Tweaks.h index c6a0feb..c99f6d2 100644 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Tweaks.h +++ b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Tweaks.h @@ -5,7 +5,7 @@ #include "CogAbilityWindow_Tweaks.generated.h" class ACogAbilityReplicator; -class UCogAbilityDataAsset_Tweaks; +class UCogAbilityDataAsset; UCLASS() class COGABILITY_API UCogAbilityWindow_Tweaks : public UCogWindow @@ -13,7 +13,7 @@ class COGABILITY_API UCogAbilityWindow_Tweaks : public UCogWindow GENERATED_BODY() public: - TWeakObjectPtr TweaksAsset; + TWeakObjectPtr Asset; protected: diff --git a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Selection.cpp b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Selection.cpp index d3f6c50..89d49ff 100644 --- a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Selection.cpp +++ b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Selection.cpp @@ -5,6 +5,7 @@ #include "CogWindowManager.h" #include "CogWindowWidgets.h" #include "EngineUtils.h" +#include "GameFramework/Character.h" #include "imgui.h" #include "Kismet/GameplayStatics.h" @@ -23,6 +24,7 @@ void UCogEngineWindow_Selection::RenderHelp() UCogEngineWindow_Selection::UCogEngineWindow_Selection() { bHasMenu = true; + SubClasses = { AActor::StaticClass(), ACharacter::StaticClass() }; } //-------------------------------------------------------------------------------------------------------------------------- diff --git a/Source/CogSample/CogSample.Build.cs b/Source/CogSample/CogSample.Build.cs index d99cabe..64f3500 100644 --- a/Source/CogSample/CogSample.Build.cs +++ b/Source/CogSample/CogSample.Build.cs @@ -16,7 +16,6 @@ public class CogSample : ModuleRules "GameplayTasks", "GameplayAbilities", "GameplayTags", - "HeadMountedDisplay", "InputCore", "NetCore", }); diff --git a/Source/CogSample/CogSampleGameState.cpp b/Source/CogSample/CogSampleGameState.cpp index 6b3ecdf..89f578a 100644 --- a/Source/CogSample/CogSampleGameState.cpp +++ b/Source/CogSample/CogSampleGameState.cpp @@ -2,7 +2,6 @@ #include "AssetRegistry/AssetRegistryModule.h" #include "AssetRegistry/IAssetRegistry.h" -#include "CogCommon.h" #include "CogSampleFunctionLibrary_Tag.h" #include "GameFramework/Character.h" #include "GameFramework/GameMode.h" @@ -10,10 +9,7 @@ #include "Modules/ModuleManager.h" #if ENABLE_COG -#include "CogAbilityDataAsset_Abilities.h" -#include "CogAbilityDataAsset_Cheats.h" -#include "CogAbilityDataAsset_Pools.h" -#include "CogAbilityDataAsset_Tweaks.h" +#include "CogAbilityDataAsset.h" #include "CogAbilityModule.h" #include "CogAbilityWindow_Abilities.h" #include "CogAbilityWindow_Attributes.h" @@ -167,25 +163,27 @@ void ACogSampleGameState::InitializeCog() //--------------------------------------- // Abilities //--------------------------------------- - UCogAbilityWindow_Abilities* AbilitiesWindow = CogWindowManager->CreateWindow("Gameplay.Abilities"); - AbilitiesWindow->AbilitiesAsset = GetFirstAssetByClass(); + const UCogAbilityDataAsset* AbilitiesAsset = GetFirstAssetByClass(); - CogWindowManager->CreateWindow("Gameplay.Attributes"); + UCogAbilityWindow_Abilities* AbilitiesWindow = CogWindowManager->CreateWindow("Gameplay.Abilities"); + AbilitiesWindow->Asset = AbilitiesAsset; + + UCogAbilityWindow_Attributes* AttributesWindow = CogWindowManager->CreateWindow("Gameplay.Attributes"); + AttributesWindow->Asset = AbilitiesAsset; UCogAbilityWindow_Cheats* CheatsWindow = CogWindowManager->CreateWindow("Gameplay.Cheats"); - CheatsWindow->SetCheatsAsset(GetFirstAssetByClass()); + CheatsWindow->SetAsset(AbilitiesAsset); UCogAbilityWindow_Effects* EffectsWindow = CogWindowManager->CreateWindow("Gameplay.Effects"); - EffectsWindow->NegativeEffectTag = Tag_Effect_Alignment_Negative; - EffectsWindow->PositiveEffectTag = Tag_Effect_Alignment_Positive; + EffectsWindow->Asset = AbilitiesAsset; UCogAbilityWindow_Pools* PoolsWindow = CogWindowManager->CreateWindow("Gameplay.Pools"); - PoolsWindow->PoolsAsset = GetFirstAssetByClass(); + PoolsWindow->Asset = AbilitiesAsset; CogWindowManager->CreateWindow("Gameplay.Tags"); UCogAbilityWindow_Tweaks* TweaksWindow = CogWindowManager->CreateWindow("Gameplay.Tweaks"); - TweaksWindow->TweaksAsset = GetFirstAssetByClass(); + TweaksWindow->Asset = AbilitiesAsset; //--------------------------------------- // Input diff --git a/Source/CogSample/CogSampleGameState.h b/Source/CogSample/CogSampleGameState.h index c6adefd..c3af6a7 100644 --- a/Source/CogSample/CogSampleGameState.h +++ b/Source/CogSample/CogSampleGameState.h @@ -1,7 +1,7 @@ #pragma once #include "CoreMinimal.h" -#include "CogSampleDefines.h" +#include "CogCommon.h" #include "GameFramework/GameStateBase.h" #include "CogSampleGameState.generated.h" @@ -10,7 +10,7 @@ class UCogWindowManager; UCLASS() class ACogSampleGameState : public AGameStateBase { - GENERATED_BODY() + GENERATED_BODY() ACogSampleGameState(const FObjectInitializer& ObjectInitializer); @@ -22,6 +22,9 @@ class ACogSampleGameState : public AGameStateBase private: + //-------------------------------------------------------------- + // To make sure it doesn't get garbage collected. + //-------------------------------------------------------------- UPROPERTY() TObjectPtr CogWindowManagerRef = nullptr;