diff --git a/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Plots.cpp b/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Plots.cpp index 1fe6ea6..57ff336 100644 --- a/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Plots.cpp +++ b/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Plots.cpp @@ -13,6 +13,7 @@ void FCogEngineWindow_Plots::Initialize() Super::Initialize(); bHasMenu = true; + bNoPadding = true; Config = GetConfig(); } @@ -48,8 +49,13 @@ void FCogEngineWindow_Plots::RenderContent() RenderMenu(); - if (ImGui::BeginTable("PlotTable", 2, ImGuiTableFlags_RowBg | ImGuiTableFlags_Resizable)) + if (ImGui::BeginTable("PlotTable", 2, ImGuiTableFlags_RowBg + | ImGuiTableFlags_Resizable + | ImGuiTableFlags_BordersV + | ImGuiTableFlags_NoPadInnerX + | ImGuiTableFlags_NoPadOuterX)) { + ImGui::TableSetupColumn("PlotsList", ImGuiTableColumnFlags_WidthFixed, FCogWindowWidgets::GetFontWidth() * 20.0f); ImGui::TableSetupColumn("Plots", ImGuiTableColumnFlags_WidthStretch, 0.0f); ImGui::TableNextRow(); @@ -110,6 +116,57 @@ void FCogEngineWindow_Plots::RenderMenu() } } +//-------------------------------------------------------------------------------------------------------------------------- +void FCogEngineWindow_Plots::RenderPlotsList(TArray& VisiblePlots) +{ + if (ImGui::BeginChild("Plots", ImVec2(0, -1))) + { + int Index = 0; + + ImGui::Indent(6); + + for (FCogDebugPlotEntry& Entry : FCogDebugPlot::Plots) + { + if (Entry.CurrentYAxis != ImAxis_COUNT && Entry.CurrentRow != INDEX_NONE) + { + VisiblePlots.Add(&Entry); + } + + ImGui::PushID(Index); + + ImGui::PushStyleColor(ImGuiCol_Text, Entry.IsEventPlot ? IM_COL32(128, 128, 255, 255) : IM_COL32(255, 255, 255, 255)); + ImGui::Selectable(TCHAR_TO_ANSI(*Entry.Name.ToString()), false, 0); + ImGui::PopStyleColor(); + + if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None)) + { + const auto EntryName = StringCast(*Entry.Name.ToString()); + ImGui::SetDragDropPayload("DragAndDrop", EntryName.Get(), EntryName.Length() + 1); + ImGui::Text(EntryName.Get()); + ImGui::EndDragDropSource(); + } + + ImGui::PopID(); + Index++; + } + + ImGui::Unindent(); + } + ImGui::EndChild(); + + if (ImGui::BeginDragDropTarget()) + { + if (const ImGuiPayload* Payload = ImGui::AcceptDragDropPayload("DragAndDrop")) + { + if (FCogDebugPlotEntry* Plot = FCogDebugPlot::FindPlot(FName((const char*)Payload->Data))) + { + Plot->ResetAxis(); + } + } + ImGui::EndDragDropTarget(); + } +} + //-------------------------------------------------------------------------------------------------------------------------- void FCogEngineWindow_Plots::RenderPlots(const TArray& VisiblePlots) { @@ -295,54 +352,6 @@ void FCogEngineWindow_Plots::RenderPlots(const TArray& Visi ImGui::EndChild(); } -//-------------------------------------------------------------------------------------------------------------------------- -void FCogEngineWindow_Plots::RenderPlotsList(TArray& VisiblePlots) -{ - if (ImGui::BeginChild("Plots", ImVec2(0, -1))) - { - int Index = 0; - - for (FCogDebugPlotEntry& Plot : FCogDebugPlot::Plots) - { - const auto Label = StringCast(*Plot.Name.ToString()); - - if (Plot.CurrentYAxis != ImAxis_COUNT && Plot.CurrentRow != INDEX_NONE) - { - VisiblePlots.Add(&Plot); - } - - ImGui::PushID(Index); - - ImGui::PushStyleColor(ImGuiCol_Text, Plot.IsEventPlot ? IM_COL32(128, 128, 255, 255) : IM_COL32(255, 255, 255, 255)); - ImGui::Selectable(Label.Get(), false, 0); - ImGui::PopStyleColor(); - - if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None)) - { - ImGui::SetDragDropPayload("DragAndDrop", Label.Get(), Label.Length() + 1); - ImGui::TextUnformatted(Label.Get()); - ImGui::EndDragDropSource(); - } - - ImGui::PopID(); - Index++; - } - } - ImGui::EndChild(); - - if (ImGui::BeginDragDropTarget()) - { - if (const ImGuiPayload* Payload = ImGui::AcceptDragDropPayload("DragAndDrop")) - { - if (FCogDebugPlotEntry* Plot = FCogDebugPlot::FindPlot(FName((const char*)Payload->Data))) - { - Plot->ResetAxis(); - } - } - ImGui::EndDragDropTarget(); - } -} - //-------------------------------------------------------------------------------------------------------------------------- void FCogEngineWindow_Plots::RenderTimeMarker() { diff --git a/Plugins/Cog/Source/CogEngine/Public/CogEngineWindow_Plots.h b/Plugins/Cog/Source/CogEngine/Public/CogEngineWindow_Plots.h index 2bac407..e8512d8 100644 --- a/Plugins/Cog/Source/CogEngine/Public/CogEngineWindow_Plots.h +++ b/Plugins/Cog/Source/CogEngine/Public/CogEngineWindow_Plots.h @@ -25,7 +25,7 @@ protected: virtual void RenderTick(float DeltaTime) override; virtual void RenderContent() override; - + void RenderPlotsList(TArray& VisiblePlots); void RenderPlots(const TArray& VisiblePlots); diff --git a/Plugins/Cog/Source/CogWindow/Private/CogWindow.cpp b/Plugins/Cog/Source/CogWindow/Private/CogWindow.cpp index b19b23b..b3bda5a 100644 --- a/Plugins/Cog/Source/CogWindow/Private/CogWindow.cpp +++ b/Plugins/Cog/Source/CogWindow/Private/CogWindow.cpp @@ -63,8 +63,18 @@ void FCogWindow::Render(float DeltaTime) WindowFlags |= ImGuiWindowFlags_MenuBar; } + if (bNoPadding) + { + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0)); + } + if (ImGui::Begin(TCHAR_TO_ANSI(*WindowTitle), &bIsVisible, WindowFlags)) { + if (bNoPadding) + { + ImGui::PopStyleVar(1); + } + if (GetOwner()->GetShowHelp()) { if (ImGui::IsItemHovered()) @@ -102,6 +112,13 @@ void FCogWindow::Render(float DeltaTime) RenderContent(); ImGui::End(); } + else + { + if (bNoPadding) + { + ImGui::PopStyleVar(1); + } + } PostRender(); } diff --git a/Plugins/Cog/Source/CogWindow/Private/CogWindowManager.cpp b/Plugins/Cog/Source/CogWindow/Private/CogWindowManager.cpp index f6ffd5c..2137273 100644 --- a/Plugins/Cog/Source/CogWindow/Private/CogWindowManager.cpp +++ b/Plugins/Cog/Source/CogWindow/Private/CogWindowManager.cpp @@ -415,7 +415,7 @@ void UCogWindowManager::RenderMainMenu() if (i == 0) { ImGui::SameLine(); - FCogWindowWidgets::HelpMarker("Drag and drop the widget name to reorder them."); + FCogWindowWidgets::HelpMarker("Drag and drop the widget names to reorder them."); } ImGui::PopID(); diff --git a/Plugins/Cog/Source/CogWindow/Public/CogWindow.h b/Plugins/Cog/Source/CogWindow/Public/CogWindow.h index 3cf0518..4f8f751 100644 --- a/Plugins/Cog/Source/CogWindow/Public/CogWindow.h +++ b/Plugins/Cog/Source/CogWindow/Public/CogWindow.h @@ -110,6 +110,8 @@ protected: bool bHideMenu = false; + bool bNoPadding = false; + bool bHasMenu = false; bool bIsVisible = false; diff --git a/Plugins/CogAI/Source/CogAI/Private/CogAIWindow_Blackboard.cpp b/Plugins/CogAI/Source/CogAI/Private/CogAIWindow_Blackboard.cpp index 617b05f..fe97e49 100644 --- a/Plugins/CogAI/Source/CogAI/Private/CogAIWindow_Blackboard.cpp +++ b/Plugins/CogAI/Source/CogAI/Private/CogAIWindow_Blackboard.cpp @@ -12,6 +12,7 @@ void FCogAIWindow_Blackboard::Initialize() Super::Initialize(); bHasMenu = true; + bNoPadding = true; Config = GetConfig(); } @@ -119,7 +120,6 @@ void FCogAIWindow_Blackboard::RenderContent() | ImGuiTableFlags_NoBordersInBodyUntilResize | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg - | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable)) diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Abilities.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Abilities.cpp index 06b3a00..c699538 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Abilities.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Abilities.cpp @@ -17,6 +17,7 @@ void FCogAbilityWindow_Abilities::Initialize() Super::Initialize(); bHasMenu = true; + bNoPadding = true; Asset = GetAsset(); Config = GetConfig(); @@ -233,7 +234,6 @@ void FCogAbilityWindow_Abilities::RenderAbilitiesTable(UAbilitySystemComponent& | ImGuiTableFlags_NoBordersInBodyUntilResize | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg - | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable)) diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Attributes.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Attributes.cpp index 68f7706..f0ff18f 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Attributes.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Attributes.cpp @@ -18,6 +18,7 @@ void FCogAbilityWindow_Attributes::Initialize() Super::Initialize(); bHasMenu = true; + bNoPadding = true; Config = GetConfig(); AlignmentConfig = GetConfig(); @@ -87,7 +88,6 @@ void FCogAbilityWindow_Attributes::RenderContent() | ImGuiTableFlags_NoBordersInBodyUntilResize | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg - | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable)) diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Effects.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Effects.cpp index 43ed693..80bde1a 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Effects.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Effects.cpp @@ -18,6 +18,7 @@ void FCogAbilityWindow_Effects::Initialize() Super::Initialize(); bHasMenu = true; + bNoPadding = true; Asset = GetAsset(); Config = GetConfig(); @@ -97,7 +98,6 @@ void FCogAbilityWindow_Effects::RenderEffectsTable() | ImGuiTableFlags_NoBordersInBodyUntilResize | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg - | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable)) diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tags.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tags.cpp index d104eb5..46e7af2 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tags.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Tags.cpp @@ -11,6 +11,7 @@ void FCogAbilityWindow_Tags::Initialize() Super::Initialize(); bHasMenu = true; + bNoPadding = true; } //-------------------------------------------------------------------------------------------------------------------------- @@ -79,7 +80,6 @@ void FCogAbilityWindow_Tags::RenderTagContainer(const UAbilitySystemComponent& A | ImGuiTableFlags_NoBordersInBodyUntilResize | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg - | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable))