So I'm trying to put an option in the options menu using Yanfly's Option Core plugin. Since I pretty much want what this guy here wanted, I read his thread and applied the same things:
https://forums.rpgmakerweb.com/inde...m-options-in-the-options-menu-yep-165.103087/
Unfortunately that discussion is now locked so I have to make my own topic asking for more or less the same thing. Or rather asking for help in finding the one thing that doesn't work. Because it mostly does.
What doesn't work is that sometimes when I toggle a switch ON/OFF outside of the menu and go back into the menu to toggle it fro there, it doesn'r register at first. I have to press three times before it registers the change. I assume this is because it won't draw the first change (but will actually toggle the switch), then when I press again it will both toggle the switch and draw the change but since that means that it's the same as it was before I started toggling the switch inside the options menu, it looks like nothing has changed. Then when I press a third time it toggles and draws the change as it's supposed to.
It doesn't matter if I start from ON or OFF. As soon as I toggle it outside of the menu, I have to press three times inside the menu before it shows the changes properly again.
Here's what I've put in the plugin parameters (I'm still using Switch 12 but I plan to change that to Switch 1 later).
It does work in general...except the problem I mentioned above so it would be fantastic if someone could help me find that little bug that must be hiding somewhere in the above copy-pasted code.
It would be very much appreciated.
https://forums.rpgmakerweb.com/inde...m-options-in-the-options-menu-yep-165.103087/
Unfortunately that discussion is now locked so I have to make my own topic asking for more or less the same thing. Or rather asking for help in finding the one thing that doesn't work. Because it mostly does.
What doesn't work is that sometimes when I toggle a switch ON/OFF outside of the menu and go back into the menu to toggle it fro there, it doesn'r register at first. I have to press three times before it registers the change. I assume this is because it won't draw the first change (but will actually toggle the switch), then when I press again it will both toggle the switch and draw the change but since that means that it's the same as it was before I started toggling the switch inside the options menu, it looks like nothing has changed. Then when I press a third time it toggles and draws the change as it's supposed to.
It doesn't matter if I start from ON or OFF. As soon as I toggle it outside of the menu, I have to press three times inside the menu before it shows the changes properly again.
Here's what I've put in the plugin parameters (I'm still using Switch 12 but I plan to change that to Switch 1 later).
Code:
this.addCommand(name, symbol, enabled, ext);
Code:
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var titleWidth = rect.width - statusWidth;
var halfStatusWidth = this.statusWidth() / 2;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
var value = $gameSwitches.value(12);
this.changePaintOpacity(!value);
this.drawText("off text", titleWidth, rect.y, halfStatusWidth, 'center');
this.changePaintOpacity(value);
this.drawText("on text", titleWidth + halfStatusWidth, rect.y, halfStatusWidth,'center');
Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = $gameSwitches.value(12);
$gameSwitches.setValue(12, !value);
this.changeValue(symbol, !value);
Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = $gameSwitches.value(12);
$gameSwitches.setValue(12, true);
this.changeValue(symbol, true);
Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = $gameSwitches.value(12);
$gameSwitches.setValue(12, false);
this.changeValue(symbol, false);
Code:
ConfigManager[symbol] = false;
Code:
config[symbol] = ConfigManager[symbol];
Code:
ConfigManager[symbol] = !!config[symbol];
It does work in general...except the problem I mentioned above so it would be fantastic if someone could help me find that little bug that must be hiding somewhere in the above copy-pasted code.
It would be very much appreciated.

