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.
This commit is contained in:
Guillaume Jacquemin 2021-08-07 14:48:18 +02:00
parent 55b15381c6
commit d9ca0f3c83

View file

@ -500,6 +500,9 @@ void SaveTool::drawNode(Node& node) {
} }
if(has_children) { if(has_children) {
bool open = ImGui::TreeNodeEx(node.name(), ImGuiTreeNodeFlags_SpanAvailWidth|(node.state() == Node::State::Unlocked ? ImGuiTreeNodeFlags_Selected : 0)); 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(); nodeTooltip();
if(open) { if(open) {
for(Node* child : node.children()) { for(Node* child : node.children()) {
@ -511,11 +514,11 @@ void SaveTool::drawNode(Node& node) {
else { else {
ImGui::TreeNodeEx(node.name(), ImGuiTreeNodeFlags_SpanAvailWidth|ImGuiTreeNodeFlags_Leaf|ImGuiTreeNodeFlags_NoTreePushOnOpen| ImGui::TreeNodeEx(node.name(), ImGuiTreeNodeFlags_SpanAvailWidth|ImGuiTreeNodeFlags_Leaf|ImGuiTreeNodeFlags_NoTreePushOnOpen|
ImGuiTreeNodeFlags_Bullet|(node.state() == Node::State::Unlocked ? ImGuiTreeNodeFlags_Selected : 0)); ImGuiTreeNodeFlags_Bullet|(node.state() == Node::State::Unlocked ? ImGuiTreeNodeFlags_Selected : 0));
nodeTooltip();
}
if(node.state() == Node::State::Unavailable) { if(node.state() == Node::State::Unavailable) {
ImGui::PopStyleColor(); ImGui::PopStyleColor();
} }
nodeTooltip();
}
} }
void SaveTool::drawMassManager() { void SaveTool::drawMassManager() {