so i’m trying to get my options menu to remember which boxes were checkmarked. so, when i click on a 'setTexture' checkbox, how, after I leave the options menu & come back or go to the next option page & come back, how can I make the game remember which boxes were checkmarked?
When clicking the 'Options' button on the title screen, what is keeping 'Option 1', 'Option 2', 'Option 3', & 'Option 4' from remembering that these checkboxes are checkmarked, but 'Sound Enabled' & 'Music Enabled' remembers which checkboxes are checkmarked just fine? I want to create my own variable IN 'Model.js' for EVERY single option in order to save the checkbox data by using ES6’ 'get' & 'set' if that makes sense.
I am trying to make the following function work with ANY option{s} :
@ldd : You misinterpret what I need to do. I simply need the OTHER options ( NOT 'Sound Enabled' & 'Music Enabled' ) to save their values with 'Model.js'' ES6 'get ( )' & 'set ( )' methods.
this is still not working :
class Model {
constructor ( ) {
this._soundOn = true;
this._musicOn = true;
this._optionOn = true;
this._bgMusicPlaying = false;
}
set musicOn ( value ) {
this._musicOn = value;
}
get musicOn ( ) {
return this._musicOn;
}
set soundOn ( value ) {
this._soundOn = value;
}
get soundOn ( ) {
return this._soundOn;
}
set bgMusicPlaying ( value ) {
this._bgMusicPlaying = value;
}
get bgMusicPlaying ( ) {
return this._bgMusicPlaying;
}
set optionOn ( value ) {
this._optionOn = value;
}
get optionOn ( ) {
return this._optionOn;
}
}
then, using just this.__Option[0] and this.__Option[1] set and get values to our new model.
The arrow buttons should change the starting index that you use, and presto! your menu works. It would probably be a good idea to keep all of that in one Scene though. I don’t really see why you need 3.
etc, etc.
Basically use the current page to calculate whether you are modifying indexes 0 and 1
or 1 and 2 (etc) in model.options
on top of that, you’d probably want to use the labels that I’ve defined and change those too, and test things out a little bit. ( you may need to call updateOptions on page change, for example.)
My goal isn’t to click on 'this.__musicButton' & 'this.__soundButton', those work. My goal is to click on 'Option 1', 'Option 2', 'Option 3' & 'Option 4'