SaveTool: improve the looks of nodes.

This commit is contained in:
Guillaume Jacquemin 2021-08-01 13:26:44 +02:00
parent f321a06a0e
commit 562758109c

View file

@ -495,6 +495,9 @@ void SaveTool::drawNode(Node& node) {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
bool has_children = (node.children().size() > 0); bool has_children = (node.children().size() > 0);
if(node.state() == Node::State::Unavailable) {
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyleColorVec4(ImGuiCol_TextDisabled));
}
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));
nodeTooltip(); nodeTooltip();
@ -510,6 +513,9 @@ void SaveTool::drawNode(Node& node) {
ImGuiTreeNodeFlags_Bullet|(node.state() == Node::State::Unlocked ? ImGuiTreeNodeFlags_Selected : 0)); ImGuiTreeNodeFlags_Bullet|(node.state() == Node::State::Unlocked ? ImGuiTreeNodeFlags_Selected : 0));
nodeTooltip(); nodeTooltip();
} }
if(node.state() == Node::State::Unavailable) {
ImGui::PopStyleColor();
}
} }
void SaveTool::drawMassManager() { void SaveTool::drawMassManager() {