From adc826d6a6f9a87251e899a05497e687ee92d423 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Sat, 18 Dec 2021 12:49:47 -0600 Subject: [PATCH] wall reset param works --- dist/index.html | 8 ++--- src/Controllers/ControlPanel.js | 53 ++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/dist/index.html b/dist/index.html index e19e80c..935c500 100644 --- a/dist/index.html +++ b/dist/index.html @@ -33,7 +33,7 @@

Target FPS: 60

- +
@@ -171,9 +171,9 @@

Reset Options


@@ -185,7 +185,7 @@
- +
diff --git a/src/Controllers/ControlPanel.js b/src/Controllers/ControlPanel.js index 5e8030e..83dc3a8 100644 --- a/src/Controllers/ControlPanel.js +++ b/src/Controllers/ControlPanel.js @@ -9,9 +9,9 @@ class ControlPanel { this.defineMinMaxControls(); this.defineHotkeys(); this.defineEngineSpeedControls(); - this.defineGridSizeControls(); this.defineTabNavigation(); this.defineHyperparameterControls(); + this.defineWorldControls(); this.defineModeControls(); this.defineChallenges(); this.fps = engine.fps; @@ -149,7 +149,28 @@ class ControlPanel { }.bind(this)); } - defineGridSizeControls() { + defineTabNavigation() { + this.tab_id = 'about'; + var self = this; + $('.tabnav-item').click(function() { + $('.tab').css('display', 'none'); + var tab = '#'+this.id+'.tab'; + $(tab).css('display', 'grid'); + $('.tabnav-item').removeClass('open-tab') + $('#'+this.id+'.tabnav-item').addClass('open-tab'); + self.engine.organism_editor.is_active = (this.id == 'editor'); + self.stats_panel.stopAutoRender(); + if (this.id === 'stats') { + self.stats_panel.startAutoRender(); + } + else if (this.id === 'editor') { + self.editor_controller.refreshDetailsPanel(); + } + self.tab_id = this.id; + }); + } + + defineWorldControls() { $('#fill-window').change(function() { if (this.checked) $('.col-row-input').css('display' ,'none'); @@ -172,27 +193,14 @@ class ControlPanel { this.stats_panel.reset(); }.bind(this)); - } - defineTabNavigation() { - this.tab_id = 'about'; - var self = this; - $('.tabnav-item').click(function() { - $('.tab').css('display', 'none'); - var tab = '#'+this.id+'.tab'; - $(tab).css('display', 'grid'); - $('.tabnav-item').removeClass('open-tab') - $('#'+this.id+'.tabnav-item').addClass('open-tab'); - self.engine.organism_editor.is_active = (this.id == 'editor'); - self.stats_panel.stopAutoRender(); - if (this.id === 'stats') { - self.stats_panel.startAutoRender(); - } - else if (this.id === 'editor') { - self.editor_controller.refreshDetailsPanel(); - } - self.tab_id = this.id; + $('#auto-reset').change(function() { + env.auto_reset = this.checked; }); + + $('#clear-walls-reset').change(function() { + WorldConfig.clear_walls_on_reset = this.checked; + }) } defineHyperparameterControls() { @@ -336,9 +344,6 @@ class ControlPanel { $('#random-walls').click( function() { this.env_controller.randomizeWalls(); }.bind(this)); - $('#auto-reset').change(function() { - env.auto_reset = this.checked; - }); $('#clear-walls').click( function() { this.engine.env.clearWalls(); }.bind(this));