Move the Show Region Logic Button next to the From Region Access.

This commit is contained in:
Anthony Stewart 2025-07-11 23:18:54 -05:00 committed by xxAtrain223
commit 52b767619c

View file

@ -431,6 +431,8 @@ static void DrawNode(LogicTrackerNode& node) {
} }
if (nodeOpen) { if (nodeOpen) {
ImGui::Indent(25.0f);
for (int i = 0; i < node.Connections.size(); i++) { for (int i = 0; i < node.Connections.size(); i++) {
auto& connection = node.Connections[i]; auto& connection = node.Connections[i];
ImGui::PushID(connection.ParentName.c_str()); ImGui::PushID(connection.ParentName.c_str());
@ -441,7 +443,8 @@ static void DrawNode(LogicTrackerNode& node) {
if (connection.ChildDayAccess && connection.ChildNightAccess && connection.AdultDayAccess && if (connection.ChildDayAccess && connection.ChildNightAccess && connection.AdultDayAccess &&
connection.AdultNightAccess) { connection.AdultNightAccess) {
access += "All"; access += "All";
} else { } else if (connection.ChildDayAccess || connection.ChildNightAccess || connection.AdultDayAccess ||
connection.AdultNightAccess) {
std::vector<std::string> accessParts; std::vector<std::string> accessParts;
if (connection.ChildDayAccess && connection.ChildNightAccess) { if (connection.ChildDayAccess && connection.ChildNightAccess) {
accessParts.push_back("Child"); accessParts.push_back("Child");
@ -471,15 +474,13 @@ static void DrawNode(LogicTrackerNode& node) {
access += accessParts[i]; access += accessParts[i];
} }
} }
} else {
access = "None";
} }
if (ImGui::Button(ICON_FA_COGS)) { if (expandingNode) {
LogicTrackerWindow::ShowRandomizerRegion(connection.ParentRandomizerRegion, node.RandomizerRegion); ImGui::SetNextItemOpen(expandNodeId == node.NodeId, ImGuiCond_Always);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Show Region Logic");
}
ImGui::SameLine();
bool connectionOpen = ImGui::CollapsingHeader( bool connectionOpen = ImGui::CollapsingHeader(
("From " + connection.ParentName).c_str(), ImGuiTreeNodeFlags_AllowOverlap | ImGuiTreeNodeFlags_SpanAvailWidth); ("From " + connection.ParentName).c_str(), ImGuiTreeNodeFlags_AllowOverlap | ImGuiTreeNodeFlags_SpanAvailWidth);
@ -493,6 +494,14 @@ static void DrawNode(LogicTrackerNode& node) {
ImGui::SetTooltip("Connection Access"); ImGui::SetTooltip("Connection Access");
} }
ImGui::SameLine();
if (ImGui::Button(ICON_FA_COGS)) {
LogicTrackerWindow::ShowRandomizerRegion(connection.ParentRandomizerRegion, node.RandomizerRegion);
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Show Region Logic");
}
if (connectionOpen) { if (connectionOpen) {
DrawNodeConnection(node, connection); DrawNodeConnection(node, connection);
} }
@ -500,6 +509,7 @@ static void DrawNode(LogicTrackerNode& node) {
ImGui::PopID(); ImGui::PopID();
} }
ImGui::Unindent(25.0f);
} }
ImGui::PopID(); ImGui::PopID();