paterns_menu: Move it to it's own class
This commit is contained in:
@@ -12,19 +12,13 @@
|
||||
|
||||
#include <control_menu.hpp>
|
||||
#include <settings_menu.hpp>
|
||||
#include <paterns_menu.hpp>
|
||||
#include <world.hpp>
|
||||
#include <rules.hpp>
|
||||
|
||||
namespace gol {
|
||||
|
||||
ControlMenu::ControlMenu(std::shared_ptr<ctx> context):context_(context) {
|
||||
play_ctrl_ = true;
|
||||
step_ctrl_ = false;
|
||||
step_back_ctrl_ = false;
|
||||
rand_ctrl_ = false;
|
||||
edit_ctrl_ = false;
|
||||
clear_ctrl_ = false;
|
||||
paterns_ctrl_ = false;
|
||||
}
|
||||
|
||||
void ControlMenu::update() {
|
||||
@@ -82,8 +76,8 @@ void ControlMenu::display() {
|
||||
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((context_->paterns_menu->isOpen()) ? "Hide paterns" : "Show paterns")) {
|
||||
context_->paterns_menu->Toogle();
|
||||
}
|
||||
if (ImGui::Button((context_->settings_menu->isOpen()) ? "Hide settings" : "Show settings")) {
|
||||
context_->settings_menu->Toogle();
|
||||
|
||||
Reference in New Issue
Block a user