paterns_menu: Move it to it's own class

This commit is contained in:
2026-01-13 14:49:12 +01:00
parent 55341973b3
commit 81f1bc5e72
8 changed files with 70 additions and 19 deletions

View File

@@ -21,6 +21,7 @@ class SettingsMenu;
class SelectionMenu;
class ControlMenu;
class Selection;
class PaternsMenu;
typedef struct ctx {
std::shared_ptr<World> world = nullptr;
@@ -30,6 +31,7 @@ typedef struct ctx {
std::shared_ptr<SelectionMenu> selection_menu = nullptr;
std::shared_ptr<ControlMenu> control_menu = nullptr;
std::shared_ptr<Selection> selection = nullptr;
std::shared_ptr<PaternsMenu> paterns_menu = nullptr;
nlohmann::json config_json;
} ctx;

View File

@@ -31,7 +31,6 @@ public: // Keep those public for easy access
bool rand_ctrl_ = false;
bool edit_ctrl_ = false;
bool clear_ctrl_ = false;
bool paterns_ctrl_ = false;
};
} // namespace gol

24
includes/paterns_menu.hpp Normal file
View File

@@ -0,0 +1,24 @@
/*
* File name: paterns_menu.hpp
* Author: lejulien
* Date created: 01-01-1970 00:59:59
// Date modified: 12-01-2026 21:30:10
* ------
*/
#pragma once
namespace gol {
class PaternsMenu {
public:
PaternsMenu() = default;
~PaternsMenu() = default;
void Toogle();
bool isOpen();
void display();
private:
bool is_open_ = false;
};
} // namespace gol