for a while now I've been making use of Yanfly's Options Core to add more options to my game, primarily difficulty options. recently however, I've noticed that none of my old difficulty options show which option is selected anymore (as pictured below)
I'm not aware of when this started happening, and I don't believe I've touched any of the code for these options in quite a while, so I wouldn't know why this is happening either. I'm pretty sure this is a code issue though, because all other options seem to be working perfectly fine (including those with more than just an off/on switch, as seen below)
all of these difficulty options basically have the exact same code with the exception of the "symbol" setting, which is different for each one, but it shouldn't be a problem as far as I'm aware. I have all the "functions" code listed below.
If anyone is able to spot what is wrong with my code or just tell me in general how this can be fixed, please let me know, as I'm planning on sharing this build of my game soon in order to get feedback on it in a month or so, and I'd like my difficulty options to be actually usable.
Thank you for your time
I'm not aware of when this started happening, and I don't believe I've touched any of the code for these options in quite a while, so I wouldn't know why this is happening either. I'm pretty sure this is a code issue though, because all other options seem to be working perfectly fine (including those with more than just an off/on switch, as seen below)
all of these difficulty options basically have the exact same code with the exception of the "symbol" setting, which is different for each one, but it shouldn't be a problem as far as I'm aware. I have all the "functions" code listed below.
JavaScript:
this.addCommand(name, symbol, enabled, ext);
JavaScript:
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var quarterWidth = statusWidth / 5;
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changePaintOpacity(value === 3);
var text = ("Less");
this.drawText(text, titleWidth + quarterWidth * 1, rect.y, quarterWidth, 'center');
this.changePaintOpacity(value === 2);
var text = ("Normal");
this.drawText(text, titleWidth + quarterWidth * 2, rect.y, quarterWidth, 'center');
this.changePaintOpacity(value === 1);
var text = ("More");
this.drawText(text, titleWidth + quarterWidth * 3, rect.y, quarterWidth, 'center');
JavaScript:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value -= 1;
if (value <= 0) value = 3;
value = value.clamp(1, 3);
this.changeValue(symbol, value);
JavaScript:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value -= 1;
value = value.clamp(1, 3);
this.changeValue(symbol, value);
JavaScript:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += 1;
value = value.clamp(1, 3);
this.changeValue(symbol, value);
JavaScript:
ConfigManager[symbol] = 2;
JavaScript:
config[symbol] = ConfigManager[symbol];
JavaScript:
ConfigManager[symbol] = config[symbol];
If anyone is able to spot what is wrong with my code or just tell me in general how this can be fixed, please let me know, as I'm planning on sharing this build of my game soon in order to get feedback on it in a month or so, and I'd like my difficulty options to be actually usable.
Thank you for your time