From 44fbeec4175b81552c7b586a09d25094f46eabcb Mon Sep 17 00:00:00 2001 From: lejulien Date: Sat, 10 Jan 2026 00:24:14 +0100 Subject: [PATCH] create toogable window --- src/main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b30b652..7c1a398 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -108,6 +108,7 @@ int main(int ac, char **av) { bool edit_ctrl = false; bool clear_ctrl = false; bool settings_window = false; + bool paterns_ctrl = false; int width_ctrl = config_json["screen_width"].get(); int height_ctrl = config_json["screen_height"].get(); bool dark_theme_ctrl = config_json["dark_theme"].get(); @@ -281,12 +282,22 @@ int main(int ac, char **av) { ImGui::Checkbox("Edit", &edit_ctrl); ImGui::Checkbox("Clear", &clear_ctrl); ImGui::Checkbox("Randomize", &rand_ctrl); + if (ImGui::Button((paterns_ctrl) ? "Hide paterns" : "Show paterns")) { + paterns_ctrl = !paterns_ctrl; + } if (ImGui::Button((settings_window) ? "Hide settings" : "Show settings")) { settings_window = !settings_window; } ImGui::Text("Generation: %zu", world.getCycle()); ImGui::End(); - + if (paterns_ctrl) { + ImGuiWindowFlags paterns_flags = + ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize; + ImGui::SetNextWindowSize(ImVec2(150, 200), ImGuiCond_Always); + ImGui::Begin("paterns", &paterns_ctrl, paterns_flags); + ImGui::Button("refresh"); + ImGui::End(); + } if (settings_window) { ImGuiWindowFlags settings_flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize;