wall reset param works
This commit is contained in:
8
dist/index.html
vendored
8
dist/index.html
vendored
@@ -33,7 +33,7 @@
|
|||||||
<p id='fps'>Target FPS: 60</p>
|
<p id='fps'>Target FPS: 60</p>
|
||||||
<p id='fps-actual'></p>
|
<p id='fps-actual'></p>
|
||||||
<button id='reset-env' title='Restarts simulation with default organism.'>Reset</button>
|
<button id='reset-env' title='Restarts simulation with default organism.'>Reset</button>
|
||||||
<button id='clear-env' title="Removes all organisms and walls. Will disable 'reset on extinction'"">Clear</button>
|
<button id='clear-env' title="Removes all organisms. Will disable 'reset on extinction'"">Clear</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id='tab-container' class='control-set'>
|
<div id='tab-container' class='control-set'>
|
||||||
@@ -171,9 +171,9 @@
|
|||||||
<h3>Reset Options</h3>
|
<h3>Reset Options</h3>
|
||||||
<label for="reset-options">Starting state:</label>
|
<label for="reset-options">Starting state:</label>
|
||||||
<select name="reset-options" id="reset-options">
|
<select name="reset-options" id="reset-options">
|
||||||
<option value="default-org">Simple producer</option>
|
<option value="simple-prod">Simple producer</option>
|
||||||
<option value="rand-orgs">Random organisms</option>
|
<option value="rand-orgs">Random organisms</option>
|
||||||
<option value="empty">No organisms</option>
|
<option value="no-orgs">No organisms</option>
|
||||||
</select> <br>
|
</select> <br>
|
||||||
<label for="auto-reset">Reset on total extinction</label>
|
<label for="auto-reset">Reset on total extinction</label>
|
||||||
<input type="checkbox" id="auto-reset" checked>
|
<input type="checkbox" id="auto-reset" checked>
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
<button id="clear-walls" title="Clear All Walls. Hotkey: B">Clear all walls</button>
|
<button id="clear-walls" title="Clear All Walls. Hotkey: B">Clear all walls</button>
|
||||||
<br>
|
<br>
|
||||||
<label for="clear-walls-reset" title='When on, walls will be cleared when the environment resets'>Clear walls on reset</label>
|
<label for="clear-walls-reset" title='When on, walls will be cleared when the environment resets'>Clear walls on reset</label>
|
||||||
<input type="checkbox" id="clear-walls-reset" checked>
|
<input type="checkbox" id="clear-walls-reset">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id='hyperparameters' class='tab'>
|
<div id='hyperparameters' class='tab'>
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ class ControlPanel {
|
|||||||
this.defineMinMaxControls();
|
this.defineMinMaxControls();
|
||||||
this.defineHotkeys();
|
this.defineHotkeys();
|
||||||
this.defineEngineSpeedControls();
|
this.defineEngineSpeedControls();
|
||||||
this.defineGridSizeControls();
|
|
||||||
this.defineTabNavigation();
|
this.defineTabNavigation();
|
||||||
this.defineHyperparameterControls();
|
this.defineHyperparameterControls();
|
||||||
|
this.defineWorldControls();
|
||||||
this.defineModeControls();
|
this.defineModeControls();
|
||||||
this.defineChallenges();
|
this.defineChallenges();
|
||||||
this.fps = engine.fps;
|
this.fps = engine.fps;
|
||||||
@@ -149,7 +149,28 @@ class ControlPanel {
|
|||||||
}.bind(this));
|
}.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() {
|
$('#fill-window').change(function() {
|
||||||
if (this.checked)
|
if (this.checked)
|
||||||
$('.col-row-input').css('display' ,'none');
|
$('.col-row-input').css('display' ,'none');
|
||||||
@@ -172,27 +193,14 @@ class ControlPanel {
|
|||||||
this.stats_panel.reset();
|
this.stats_panel.reset();
|
||||||
|
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
|
||||||
|
|
||||||
defineTabNavigation() {
|
$('#auto-reset').change(function() {
|
||||||
this.tab_id = 'about';
|
env.auto_reset = this.checked;
|
||||||
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;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#clear-walls-reset').change(function() {
|
||||||
|
WorldConfig.clear_walls_on_reset = this.checked;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
defineHyperparameterControls() {
|
defineHyperparameterControls() {
|
||||||
@@ -336,9 +344,6 @@ class ControlPanel {
|
|||||||
$('#random-walls').click( function() {
|
$('#random-walls').click( function() {
|
||||||
this.env_controller.randomizeWalls();
|
this.env_controller.randomizeWalls();
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
$('#auto-reset').change(function() {
|
|
||||||
env.auto_reset = this.checked;
|
|
||||||
});
|
|
||||||
$('#clear-walls').click( function() {
|
$('#clear-walls').click( function() {
|
||||||
this.engine.env.clearWalls();
|
this.engine.env.clearWalls();
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|||||||
Reference in New Issue
Block a user