From d9ca0f3c8345c0b05c19674bfb4440013531506c Mon Sep 17 00:00:00 2001 From: William JCM Date: Sat, 7 Aug 2021 14:48:18 +0200 Subject: [PATCH] SaveTool: fix a node styling issue. Unlocked children of locked nodes, as well as tooltips for locked nodes, used the "disabled text" colour when they shouldn't. --- src/SaveTool/SaveTool_MainManager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/SaveTool/SaveTool_MainManager.cpp b/src/SaveTool/SaveTool_MainManager.cpp index ec1fc1d..78eda67 100644 --- a/src/SaveTool/SaveTool_MainManager.cpp +++ b/src/SaveTool/SaveTool_MainManager.cpp @@ -500,6 +500,9 @@ void SaveTool::drawNode(Node& node) { } if(has_children) { bool open = ImGui::TreeNodeEx(node.name(), ImGuiTreeNodeFlags_SpanAvailWidth|(node.state() == Node::State::Unlocked ? ImGuiTreeNodeFlags_Selected : 0)); + if(node.state() == Node::State::Unavailable) { + ImGui::PopStyleColor(); + } nodeTooltip(); if(open) { for(Node* child : node.children()) { @@ -511,11 +514,11 @@ void SaveTool::drawNode(Node& node) { else { ImGui::TreeNodeEx(node.name(), ImGuiTreeNodeFlags_SpanAvailWidth|ImGuiTreeNodeFlags_Leaf|ImGuiTreeNodeFlags_NoTreePushOnOpen| ImGuiTreeNodeFlags_Bullet|(node.state() == Node::State::Unlocked ? ImGuiTreeNodeFlags_Selected : 0)); + if(node.state() == Node::State::Unavailable) { + ImGui::PopStyleColor(); + } nodeTooltip(); } - if(node.state() == Node::State::Unavailable) { - ImGui::PopStyleColor(); - } } void SaveTool::drawMassManager() {