From 269f8ae469f82af99d66b106666d54f2ce55c2f3 Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Thu, 9 Jan 2025 15:15:42 -0500 Subject: [PATCH] CogInput: UI tweaks --- .../Cog/Source/CogWindow/Private/CogWindow.cpp | 2 +- .../Private/CogInputWindow_Actions.cpp | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Plugins/Cog/Source/CogWindow/Private/CogWindow.cpp b/Plugins/Cog/Source/CogWindow/Private/CogWindow.cpp index 76bb9ab..712013b 100644 --- a/Plugins/Cog/Source/CogWindow/Private/CogWindow.cpp +++ b/Plugins/Cog/Source/CogWindow/Private/CogWindow.cpp @@ -84,7 +84,7 @@ void FCogWindow::Render(float DeltaTime) ImGui::Checkbox("Hide Menu", &bHideMenu); } - if (ImGui::Button("Reset")) + if (ImGui::Button("Reset Settings")) { ResetConfig(); } diff --git a/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp b/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp index bd53fd8..747643f 100644 --- a/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp +++ b/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp @@ -201,15 +201,13 @@ void FCogInputWindow_Actions::RenderContent() ImGui::TableNextColumn(); ImGui::Text("%s", ActionName.Get()); - const ImVec4 ActiveColor(1, 0.8f, 0, 1); - const ImVec4 InactiveColor(0.3f, 0.3f, 0.3f, 1); - const ImVec2 ButtonSize(FCogWindowWidgets::GetFontWidth() * 10, 0); - ImGui::TableNextColumn(); ImGui::BeginDisabled(); bool Value = ActionValue.Get(); - ImGui::Checkbox("##Current", &Value); - ImGui::EndDisabled(); + FCogWindowWidgets::PushBackColor(ImVec4(0.8f, 0.8f, 0.8f, 1)); + ImGui::Checkbox("##Current", &Value); + FCogWindowWidgets::PopBackColor(); + ImGui::EndDisabled(); ImGui::TableNextColumn(); @@ -229,6 +227,12 @@ void FCogInputWindow_Actions::RenderContent() } } + if (ImGui::BeginPopupContextItem()) + { + ImGui::Checkbox("Repeat", &ActionInfo.bRepeat); + ImGui::EndPopup(); + } + if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort)) { ImGui::BeginTooltip(); @@ -324,7 +328,9 @@ void FCogInputWindow_Actions::DrawAxis(const char* Format, const char* ActionNam ImGui::TableNextColumn(); ImGui::SetNextItemWidth(-1); ImGui::BeginDisabled(); + FCogWindowWidgets::PushBackColor(ImVec4(0.8f, 0.8f, 0.8f, 1)); ImGui::SliderFloat("##Value", &CurrentValue, -1.0f, 1.0f, "%0.2f"); + FCogWindowWidgets::PopBackColor(); ImGui::EndDisabled(); ImGui::TableNextColumn();