mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-03 05:08:13 +00:00
CogAbility: UI improvements
Attribute Window: - Fix ID conflicts - Add attribute set column (hidden by default) - Improve indentation when displaying attribute set or categories
This commit is contained in:
@@ -201,13 +201,13 @@ void FCogAbilityWindow_Abilities::RenderAbilitiesMenuColorSettings()
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void FCogAbilityWindow_Abilities::RenderAbilityActivation(FGameplayAbilitySpec& Spec)
|
||||
{
|
||||
FCogWindowWidgets::PushStyleCompact();
|
||||
bool IsActive = Spec.IsActive();
|
||||
if (ImGui::Checkbox("##Activation", &IsActive))
|
||||
{
|
||||
AbilityHandleToActivate = Spec.Handle;
|
||||
}
|
||||
FCogWindowWidgets::PopStyleCompact();
|
||||
FCogWindowWidgets::PushStyleCompact();
|
||||
bool IsActive = Spec.IsActive();
|
||||
if (ImGui::Checkbox("##Activation", &IsActive))
|
||||
{
|
||||
AbilityHandleToActivate = Spec.Handle;
|
||||
}
|
||||
FCogWindowWidgets::PopStyleCompact();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -216,15 +216,15 @@ void FCogAbilityWindow_Abilities::RenderAbilitiesTableAbilityName(UAbilitySystem
|
||||
const ImVec4 Color = GetAbilityColor(AbilitySystemComponent, Spec);
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, Color);
|
||||
|
||||
if (ImGui::Selectable(TCHAR_TO_ANSI(*GetAbilityName(Ability)), SelectedIndex == Index, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap | ImGuiSelectableFlags_AllowDoubleClick))
|
||||
{
|
||||
SelectedIndex = Index;
|
||||
if (ImGui::Selectable(TCHAR_TO_ANSI(*GetAbilityName(Ability)), SelectedIndex == Index, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap | ImGuiSelectableFlags_AllowDoubleClick))
|
||||
{
|
||||
SelectedIndex = Index;
|
||||
|
||||
if (ImGui::IsMouseDoubleClicked(0))
|
||||
{
|
||||
OpenAbility(Spec.Handle);
|
||||
}
|
||||
}
|
||||
if (ImGui::IsMouseDoubleClicked(0))
|
||||
{
|
||||
OpenAbility(Spec.Handle);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(1);
|
||||
}
|
||||
@@ -232,26 +232,26 @@ void FCogAbilityWindow_Abilities::RenderAbilitiesTableAbilityName(UAbilitySystem
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void FCogAbilityWindow_Abilities::RenderAbilitiesTableAbilityBlocking(UAbilitySystemComponent& AbilitySystemComponent, UGameplayAbility* Ability)
|
||||
{
|
||||
if (Ability->DoesAbilitySatisfyTagRequirements(AbilitySystemComponent) == false)
|
||||
{
|
||||
FGameplayTagContainer OwnedGameplayTags;
|
||||
AbilitySystemComponent.GetOwnedGameplayTags(OwnedGameplayTags);
|
||||
if (Ability->DoesAbilitySatisfyTagRequirements(AbilitySystemComponent) == false)
|
||||
{
|
||||
FGameplayTagContainer OwnedGameplayTags;
|
||||
AbilitySystemComponent.GetOwnedGameplayTags(OwnedGameplayTags);
|
||||
|
||||
if (const FGameplayTagContainer* ActivationBlockedTags = &PRIVATE_ACCESS_PTR(Ability, GameplayAbility_ActivationBlockedTags))
|
||||
{
|
||||
FGameplayTagContainer AllBlockingTags;
|
||||
AbilitySystemComponent.GetBlockedAbilityTags(AllBlockingTags);
|
||||
AllBlockingTags.AppendTags(OwnedGameplayTags);
|
||||
if (const FGameplayTagContainer* ActivationBlockedTags = &PRIVATE_ACCESS_PTR(Ability, GameplayAbility_ActivationBlockedTags))
|
||||
{
|
||||
FGameplayTagContainer AllBlockingTags;
|
||||
AbilitySystemComponent.GetBlockedAbilityTags(AllBlockingTags);
|
||||
AllBlockingTags.AppendTags(OwnedGameplayTags);
|
||||
|
||||
FCogAbilityHelper::RenderTagContainer(*ActivationBlockedTags, AllBlockingTags, false, true, true, ImVec4(0, 0, 0, 0), FCogImguiHelper::ToImVec4(Config->BlockedTagsColor));
|
||||
}
|
||||
FCogAbilityHelper::RenderTagContainer(*ActivationBlockedTags, AllBlockingTags, false, true, true, ImVec4(0, 0, 0, 0), FCogImguiHelper::ToImVec4(Config->BlockedTagsColor));
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (const FGameplayTagContainer* ActivationRequiredTags = &PRIVATE_ACCESS_PTR(Ability, GameplayAbility_ActivationRequiredTags))
|
||||
{
|
||||
FCogAbilityHelper::RenderTagContainer(*ActivationRequiredTags, OwnedGameplayTags, true, true, true, ImVec4(0, 0, 0, 0), FCogImguiHelper::ToImVec4(Config->BlockedTagsColor));
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (const FGameplayTagContainer* ActivationRequiredTags = &PRIVATE_ACCESS_PTR(Ability, GameplayAbility_ActivationRequiredTags))
|
||||
{
|
||||
FCogAbilityHelper::RenderTagContainer(*ActivationRequiredTags, OwnedGameplayTags, true, true, true, ImVec4(0, 0, 0, 0), FCogImguiHelper::ToImVec4(Config->BlockedTagsColor));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -271,8 +271,8 @@ void FCogAbilityWindow_Abilities::RenderAbilitiesTable(UAbilitySystemComponent&
|
||||
|
||||
if (ShouldShowAbility(AbilitySystemComponent, Spec, Ability) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto AbilityName = StringCast<ANSICHAR>(*GetAbilityName(Ability));
|
||||
if (Filter.PassFilter(AbilityName.Get()) == false)
|
||||
@@ -390,11 +390,10 @@ void FCogAbilityWindow_Abilities::RenderAbilitiesTableRow(UAbilitySystemComponen
|
||||
//------------------------
|
||||
// Popup
|
||||
//------------------------
|
||||
if (ImGui::IsItemHovered())
|
||||
if (FCogWindowWidgets::BeginItemTableTooltip())
|
||||
{
|
||||
FCogWindowWidgets::BeginTableTooltip();
|
||||
RenderAbilityInfo(AbilitySystemComponent, Spec);
|
||||
FCogWindowWidgets::EndTableTooltip();
|
||||
FCogWindowWidgets::EndItemTableTooltip();
|
||||
}
|
||||
|
||||
//------------------------
|
||||
@@ -537,7 +536,7 @@ void FCogAbilityWindow_Abilities::RenderAbilityInfo(const UAbilitySystemComponen
|
||||
|
||||
if (ImGui::BeginTable("Ability", 2, ImGuiTableFlags_Borders))
|
||||
{
|
||||
constexpr ImVec4 TextColor(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
constexpr ImVec4 TextColor(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
|
||||
ImGui::TableSetupColumn("Property");
|
||||
ImGui::TableSetupColumn("Value");
|
||||
@@ -665,8 +664,8 @@ void FCogAbilityWindow_Abilities::RenderAbilityInfo(const UAbilitySystemComponen
|
||||
}
|
||||
|
||||
//------------------------
|
||||
// Additional info
|
||||
//------------------------
|
||||
// Additional info
|
||||
//------------------------
|
||||
RenderAbilityAdditionalInfo(AbilitySystemComponent, Spec, *Ability, TextColor);
|
||||
|
||||
ImGui::EndTable();
|
||||
|
||||
@@ -61,10 +61,17 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
ImGui::Checkbox("Group by Attribute Set", &Config->GroupByAttributeSet);
|
||||
ImGui::Checkbox("Group by Category", &Config->GroupByCategory);
|
||||
ImGui::Checkbox("Show Only Modified", &Config->ShowOnlyModified);
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
FCogWindowWidgets::InputText("Attribute Set Prefixes", Config->AttributeSetPrefixes);
|
||||
ImGui::SetItemTooltip("Prefixes to remove from the attribute set name. Separate multiple prefixes with the semicolon character ';'");
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::ColorEdit4("Positive Color", (float*)&AlignmentConfig->PositiveColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_AlphaPreviewHalf);
|
||||
ImGui::ColorEdit4("Negative Color", (float*)&AlignmentConfig->NegativeColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_AlphaPreviewHalf);
|
||||
ImGui::ColorEdit4("Neutral Color", (float*)&AlignmentConfig->NeutralColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_AlphaPreviewHalf);
|
||||
ImGui::ColorEdit4("AttributeSet Color", (float*)&Config->AttributeSetColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_AlphaPreviewHalf);
|
||||
ImGui::ColorEdit4("Category Color", (float*)&Config->CategoryColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_AlphaPreviewHalf);
|
||||
ImGui::Separator();
|
||||
if (ImGui::MenuItem("Reset"))
|
||||
{
|
||||
@@ -78,10 +85,12 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
|
||||
bool bGroupByAttributeSetValue = Filter.IsActive() == false && Config->ShowOnlyModified == false && Config->GroupByAttributeSet;
|
||||
bool bGroupByCategoryValue = Filter.IsActive() == false && Config->ShowOnlyModified == false && Config->GroupByCategory;
|
||||
const bool bGroupByAttributeSetValue = Filter.IsActive() == false && Config->ShowOnlyModified == false && Config->GroupByAttributeSet;
|
||||
const bool bGroupByCategoryValue = Filter.IsActive() == false && Config->ShowOnlyModified == false && Config->GroupByCategory;
|
||||
const float bShowGroup = bGroupByAttributeSetValue | bGroupByCategoryValue;
|
||||
const float FirstColWidth = ((int32)bGroupByAttributeSetValue + (int32)bGroupByCategoryValue) * ImGui::GetFontSize() * 2;
|
||||
|
||||
if (ImGui::BeginTable("Attributes", 3, ImGuiTableFlags_SizingFixedFit
|
||||
if (ImGui::BeginTable("Attributes", 5, ImGuiTableFlags_SizingFixedFit
|
||||
| ImGuiTableFlags_Resizable
|
||||
| ImGuiTableFlags_NoBordersInBodyUntilResize
|
||||
| ImGuiTableFlags_ScrollY
|
||||
@@ -91,6 +100,8 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
| ImGuiTableFlags_Hideable))
|
||||
{
|
||||
ImGui::TableSetupScrollFreeze(0, 1);
|
||||
ImGui::TableSetupColumn("-", ImGuiTableColumnFlags_NoHide | ImGuiTableColumnFlags_NoHeaderLabel | ImGuiTableColumnFlags_NoResize | ImGuiTableColumnFlags_WidthFixed, FirstColWidth);
|
||||
ImGui::TableSetupColumn("Set", bShowGroup ? ImGuiTableColumnFlags_DefaultHide : ImGuiTableColumnFlags_None);
|
||||
ImGui::TableSetupColumn("Attribute");
|
||||
ImGui::TableSetupColumn("Base");
|
||||
ImGui::TableSetupColumn("Current");
|
||||
@@ -102,23 +113,46 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
//------------------------------------------------------------------------------------------
|
||||
// Draw all the attribute sets
|
||||
//------------------------------------------------------------------------------------------
|
||||
for (const UAttributeSet* Set : AbilitySystemComponent->GetSpawnedAttributes())
|
||||
for (const UAttributeSet* AttributeSet : AbilitySystemComponent->GetSpawnedAttributes())
|
||||
{
|
||||
ImGui::PushID(TCHAR_TO_ANSI(*AttributeSet->GetName()));
|
||||
|
||||
FString AttributeSetName = AttributeSet->GetName();
|
||||
if (Config->AttributeSetPrefixes.IsEmpty() == false)
|
||||
{
|
||||
TArray<FString> Prefixes;
|
||||
Config->AttributeSetPrefixes.ParseIntoArray(Prefixes, TEXT(";"));
|
||||
|
||||
for (const FString& Prefix : Prefixes)
|
||||
{
|
||||
if (AttributeSetName.RemoveFromStart(Prefix, ESearchCase::IgnoreCase))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const auto AttributeSetNameStr = StringCast<ANSICHAR>(*AttributeSetName);
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// Add an tree node categories are shown
|
||||
// Add a tree node with the name of the attribute set if grouping by attribute set
|
||||
//------------------------------------------------------------------------------------------
|
||||
bool bOpenAttributeSet = true;
|
||||
if (bGroupByAttributeSetValue)
|
||||
{
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
bOpenAttributeSet = ImGui::TreeNodeEx(TCHAR_TO_ANSI(*Set->GetName()), ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, FCogImguiHelper::ToImVec4(Config->AttributeSetColor));
|
||||
bOpenAttributeSet = ImGui::TreeNodeEx(AttributeSetNameStr.Get(), ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_SpanAllColumns | ImGuiTreeNodeFlags_LabelSpanAllColumns);
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
}
|
||||
|
||||
if (bOpenAttributeSet)
|
||||
{
|
||||
TArray<FGameplayAttribute> AllAttributes;
|
||||
for (TFieldIterator<FProperty> It(Set->GetClass()); It; ++It)
|
||||
for (TFieldIterator<FProperty> It(AttributeSet->GetClass()); It; ++It)
|
||||
{
|
||||
FGameplayAttribute Attribute = *It;
|
||||
if (Attribute.IsValid())
|
||||
@@ -176,7 +210,9 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
{
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
bOpenCategory = ImGui::TreeNodeEx(TCHAR_TO_ANSI(*It.Key), ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, FCogImguiHelper::ToImVec4(Config->CategoryColor));
|
||||
bOpenCategory = ImGui::TreeNodeEx(TCHAR_TO_ANSI(*It.Key), ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_SpanAllColumns | ImGuiTreeNodeFlags_LabelSpanAllColumns);
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
if (bOpenCategory)
|
||||
@@ -201,50 +237,55 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
for (const FGameplayAttribute& Attribute : AttributesInCategory)
|
||||
{
|
||||
if (!Attribute.IsValid())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
{ continue; }
|
||||
|
||||
const auto AttributeName = StringCast<ANSICHAR>(*Attribute.GetName());
|
||||
const auto AttributeNameStr = StringCast<ANSICHAR>(*Attribute.GetName());
|
||||
|
||||
if (Filter.PassFilter(AttributeName.Get()) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (Filter.PassFilter(AttributeNameStr.Get()) == false)
|
||||
{ continue; }
|
||||
|
||||
const float BaseValue = AbilitySystemComponent->GetNumericAttributeBase(Attribute);
|
||||
const float CurrentValue = AbilitySystemComponent->GetNumericAttribute(Attribute);
|
||||
|
||||
if (Config->ShowOnlyModified && FMath::IsNearlyEqual(CurrentValue, BaseValue))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
{ continue; }
|
||||
|
||||
ImGui::PushID(AttributeNameStr.Get());
|
||||
|
||||
ImGui::TableNextRow();
|
||||
|
||||
//------------------------
|
||||
// Selectable
|
||||
//------------------------
|
||||
ImGui::TableNextColumn();
|
||||
if (ImGui::Selectable("", Selected == Index, ImGuiSelectableFlags_SpanAllColumns))
|
||||
{
|
||||
Selected = Index;
|
||||
}
|
||||
|
||||
const ImVec4 Color = FCogImguiHelper::ToImVec4(AlignmentConfig->GetAttributeColor(*AbilitySystemComponent, Attribute));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, Color);
|
||||
|
||||
//------------------------
|
||||
// Name
|
||||
// Attribute Set
|
||||
//------------------------
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", AttributeSetNameStr.Get());
|
||||
|
||||
//------------------------
|
||||
// Attribute Name
|
||||
//------------------------
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("");
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Selectable(AttributeName.Get(), Selected == Index, ImGuiSelectableFlags_SpanAllColumns))
|
||||
{
|
||||
Selected = Index;
|
||||
}
|
||||
ImGui::Text("%s", AttributeNameStr.Get());
|
||||
ImGui::PopStyleColor(1);
|
||||
|
||||
//------------------------
|
||||
// Popup
|
||||
//------------------------
|
||||
if (ImGui::IsItemHovered())
|
||||
if (FCogWindowWidgets::BeginItemTableTooltip())
|
||||
{
|
||||
FCogWindowWidgets::BeginTableTooltip();
|
||||
DrawAttributeInfo(*AbilitySystemComponent, Attribute);
|
||||
FCogWindowWidgets::EndTableTooltip();
|
||||
DrawAttributeInfo(*AbilitySystemComponent, AttributeSetNameStr.Get(), Attribute);
|
||||
FCogWindowWidgets::EndItemTableTooltip();
|
||||
}
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, Color);
|
||||
@@ -263,6 +304,8 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
|
||||
ImGui::PopStyleColor(1);
|
||||
|
||||
ImGui::PopID();
|
||||
|
||||
Index++;
|
||||
}
|
||||
}
|
||||
@@ -274,10 +317,15 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
}
|
||||
}
|
||||
|
||||
if (bOpenAttributeSet && bGroupByAttributeSetValue)
|
||||
if (bGroupByAttributeSetValue)
|
||||
{
|
||||
ImGui::TreePop();
|
||||
if (bOpenAttributeSet)
|
||||
{
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
||||
ImGui::EndTable();
|
||||
@@ -285,11 +333,11 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void FCogAbilityWindow_Attributes::DrawAttributeInfo(const UAbilitySystemComponent& AbilitySystemComponent, const FGameplayAttribute& Attribute)
|
||||
void FCogAbilityWindow_Attributes::DrawAttributeInfo(const UAbilitySystemComponent& AbilitySystemComponent, const char* AttributeSetName, const FGameplayAttribute& Attribute)
|
||||
{
|
||||
if (ImGui::BeginTable("Attribute", 2, ImGuiTableFlags_Borders))
|
||||
{
|
||||
const ImVec4 TextColor(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
constexpr ImVec4 TextColor(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
|
||||
ImGui::TableSetupColumn("Property");
|
||||
ImGui::TableSetupColumn("Value", ImGuiTableColumnFlags_WidthStretch);
|
||||
@@ -297,6 +345,15 @@ void FCogAbilityWindow_Attributes::DrawAttributeInfo(const UAbilitySystemCompone
|
||||
const float BaseValue = AbilitySystemComponent.GetNumericAttributeBase(Attribute);
|
||||
const float CurrentValue = AbilitySystemComponent.GetNumericAttribute(Attribute);
|
||||
|
||||
//------------------------
|
||||
// Attribute Set
|
||||
//------------------------
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(TextColor, "Attribute Set");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", AttributeSetName);
|
||||
|
||||
//------------------------
|
||||
// Name
|
||||
//------------------------
|
||||
@@ -329,7 +386,7 @@ void FCogAbilityWindow_Attributes::DrawAttributeInfo(const UAbilitySystemCompone
|
||||
//------------------------
|
||||
// Modifiers
|
||||
//------------------------
|
||||
FGameplayEffectQuery Query;
|
||||
const FGameplayEffectQuery Query;
|
||||
for (const FActiveGameplayEffectHandle& ActiveHandle : AbilitySystemComponent.GetActiveEffects(Query))
|
||||
{
|
||||
const FActiveGameplayEffect* ActiveEffect = AbilitySystemComponent.GetActiveGameplayEffect(ActiveHandle);
|
||||
|
||||
@@ -213,11 +213,10 @@ void FCogAbilityWindow_Effects::RenderEffectRow(UAbilitySystemComponent& Ability
|
||||
//------------------------
|
||||
// Popup
|
||||
//------------------------
|
||||
if (ImGui::IsItemHovered())
|
||||
if (FCogWindowWidgets::BeginItemTableTooltip())
|
||||
{
|
||||
FCogWindowWidgets::BeginTableTooltip();
|
||||
RenderEffectInfo(AbilitySystemComponent, ActiveEffect, Effect);
|
||||
FCogWindowWidgets::EndTableTooltip();
|
||||
FCogWindowWidgets::EndItemTableTooltip();
|
||||
}
|
||||
|
||||
//------------------------
|
||||
|
||||
@@ -134,11 +134,10 @@ void FCogAbilityWindow_Tags::RenderTagContainer(const UAbilitySystemComponent& A
|
||||
//------------------------
|
||||
// Tooltip
|
||||
//------------------------
|
||||
if (ImGui::IsItemHovered())
|
||||
if (FCogWindowWidgets::BeginItemTableTooltip())
|
||||
{
|
||||
FCogWindowWidgets::BeginTableTooltip();
|
||||
RenderTag(AbilitySystemComponent, Tag);
|
||||
FCogWindowWidgets::EndTableTooltip();
|
||||
FCogWindowWidgets::EndItemTableTooltip();
|
||||
}
|
||||
|
||||
ImGui::PopID();
|
||||
|
||||
@@ -2,11 +2,8 @@
|
||||
|
||||
#include "AbilitySystemGlobals.h"
|
||||
#include "AbilitySystemComponent.h"
|
||||
#include "CogAbilityDataAsset.h"
|
||||
#include "CogAbilityHelper.h"
|
||||
#include "CogAbilityReplicator.h"
|
||||
#include "CogImguiHelper.h"
|
||||
#include "CogWindowHelper.h"
|
||||
#include "CogWindowWidgets.h"
|
||||
#include "imgui.h"
|
||||
|
||||
@@ -177,7 +174,7 @@ void FCogAbilityWindow_Tasks::RenderTasksTable(UAbilitySystemComponent& AbilityS
|
||||
continue;
|
||||
}
|
||||
|
||||
FilteredTasks.Add(Task);
|
||||
FilteredTasks.Add(Task);
|
||||
}
|
||||
|
||||
if (Config->SortByName)
|
||||
@@ -237,11 +234,10 @@ void FCogAbilityWindow_Tasks::RenderTasksTable(UAbilitySystemComponent& AbilityS
|
||||
//------------------------
|
||||
// Popup
|
||||
//------------------------
|
||||
if (ImGui::IsItemHovered())
|
||||
if (FCogWindowWidgets::BeginItemTableTooltip())
|
||||
{
|
||||
FCogWindowWidgets::BeginTableTooltip();
|
||||
RenderTaskInfo(Task);
|
||||
FCogWindowWidgets::EndTableTooltip();
|
||||
FCogWindowWidgets::EndItemTableTooltip();
|
||||
}
|
||||
|
||||
//------------------------
|
||||
@@ -254,7 +250,7 @@ void FCogAbilityWindow_Tasks::RenderTasksTable(UAbilitySystemComponent& AbilityS
|
||||
// IsTicking
|
||||
//------------------------
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text(Task->IsTickingTask() ? "Yes" : "No");
|
||||
ImGui::Text(Task->IsTickingTask() ? "Yes" : "No");
|
||||
|
||||
ImGui::PopID();
|
||||
}
|
||||
@@ -275,7 +271,7 @@ void FCogAbilityWindow_Tasks::RenderTaskInfo(const UGameplayTask* Task)
|
||||
|
||||
if (ImGui::BeginTable("Task", 2, ImGuiTableFlags_Borders))
|
||||
{
|
||||
constexpr ImVec4 TextColor(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
constexpr ImVec4 TextColor(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
|
||||
ImGui::TableSetupColumn("Property");
|
||||
ImGui::TableSetupColumn("Value");
|
||||
@@ -290,8 +286,8 @@ void FCogAbilityWindow_Tasks::RenderTaskInfo(const UGameplayTask* Task)
|
||||
ImGui::Text("%s", StringCast<ANSICHAR>(*Task->GetName()).Get());
|
||||
|
||||
//------------------------
|
||||
// Instance Name
|
||||
//------------------------
|
||||
// Instance Name
|
||||
//------------------------
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(TextColor, "Instance Name");
|
||||
@@ -299,8 +295,8 @@ void FCogAbilityWindow_Tasks::RenderTaskInfo(const UGameplayTask* Task)
|
||||
ImGui::Text("%s", StringCast<ANSICHAR>(*Task->GetInstanceName().ToString()).Get());
|
||||
|
||||
//------------------------
|
||||
// Owner
|
||||
//------------------------
|
||||
// Owner
|
||||
//------------------------
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(TextColor, "Ability");
|
||||
@@ -316,9 +312,9 @@ void FCogAbilityWindow_Tasks::RenderTaskInfo(const UGameplayTask* Task)
|
||||
ImGui::TableNextColumn();
|
||||
RenderTaskState(Task);
|
||||
|
||||
//------------------------
|
||||
// Priority
|
||||
//------------------------
|
||||
//------------------------
|
||||
// Priority
|
||||
//------------------------
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(TextColor, "Priority");
|
||||
@@ -326,17 +322,17 @@ void FCogAbilityWindow_Tasks::RenderTaskInfo(const UGameplayTask* Task)
|
||||
ImGui::Text("%d", (int32)Task->GetPriority());
|
||||
|
||||
//------------------------
|
||||
// IsTicking
|
||||
//------------------------
|
||||
// IsTicking
|
||||
//------------------------
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(TextColor, "Is Ticking");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text(Task->IsTickingTask() ? "Yes" : "No");
|
||||
|
||||
//------------------------
|
||||
// IsSimulated
|
||||
//------------------------
|
||||
//------------------------
|
||||
// IsSimulated
|
||||
//------------------------
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(TextColor, "Is Simulated");
|
||||
@@ -344,8 +340,8 @@ void FCogAbilityWindow_Tasks::RenderTaskInfo(const UGameplayTask* Task)
|
||||
ImGui::Text(Task->IsSimulatedTask() ? "Yes" : "No");
|
||||
|
||||
//------------------------
|
||||
// IsSimulating
|
||||
//------------------------
|
||||
// IsSimulating
|
||||
//------------------------
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(TextColor, "Is Simulating");
|
||||
@@ -353,15 +349,15 @@ void FCogAbilityWindow_Tasks::RenderTaskInfo(const UGameplayTask* Task)
|
||||
ImGui::Text(Task->IsSimulating() ? "Yes" : "No");
|
||||
|
||||
//------------------------
|
||||
// Debug
|
||||
//------------------------
|
||||
// Debug
|
||||
//------------------------
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(TextColor, "Debug");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::PushTextWrapPos(FCogWindowWidgets::GetFontWidth() * 80);
|
||||
ImGui::Text("%s", StringCast<ANSICHAR>(*Task->GetDebugString()).Get());
|
||||
ImGui::PopTextWrapPos();
|
||||
ImGui::PopTextWrapPos();
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "CogWindow.h"
|
||||
#include "CogAbilityWindow_Attributes.generated.h"
|
||||
|
||||
class UAttributeSet;
|
||||
class UAbilitySystemComponent;
|
||||
class UCogAbilityConfig_Attributes;
|
||||
class UCogAbilityConfig_Alignment;
|
||||
@@ -29,7 +30,7 @@ protected:
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
virtual void DrawAttributeInfo(const UAbilitySystemComponent& AbilitySystemComponent, const FGameplayAttribute& Attribute);
|
||||
virtual void DrawAttributeInfo(const UAbilitySystemComponent& AbilitySystemComponent, const char* AttributeSetName, const FGameplayAttribute& Attribute);
|
||||
|
||||
private:
|
||||
|
||||
@@ -60,6 +61,15 @@ public:
|
||||
UPROPERTY(Config)
|
||||
bool ShowOnlyModified = false;
|
||||
|
||||
UPROPERTY(Config)
|
||||
FString AttributeSetPrefixes;
|
||||
|
||||
UPROPERTY(Config)
|
||||
FVector4f CategoryColor = FVector4f(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
|
||||
UPROPERTY(Config)
|
||||
FVector4f AttributeSetColor = FVector4f(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
|
||||
virtual void Reset() override
|
||||
{
|
||||
Super::Reset();
|
||||
@@ -68,5 +78,8 @@ public:
|
||||
GroupByAttributeSet = false;
|
||||
GroupByCategory = false;
|
||||
ShowOnlyModified = false;
|
||||
AttributeSetPrefixes = FString();
|
||||
CategoryColor = FVector4f(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
AttributeSetColor = FVector4f(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user