Hello, this is my first post on this forum, so forgive me if I make any mistakes.
So, I'm having trouble figuring out how to make a singular toggle button in Yanfly's Option Core. I found a code for an on/off type of toggle, but I would like to make it a singular toggle. My experience with Javascript isn't beyond being able to read and edit pre-existing script, so I'm wondering as to how to do this.
This is what it currently looks like.
This is what I want it to look like, with a singular option to just turn on the switch, hiding the off button.
This is the code I am using:
It would be really great if someone could give me a pointer or two... Thank you and have a great day if you read this!
So, I'm having trouble figuring out how to make a singular toggle button in Yanfly's Option Core. I found a code for an on/off type of toggle, but I would like to make it a singular toggle. My experience with Javascript isn't beyond being able to read and edit pre-existing script, so I'm wondering as to how to do this.
This is what it currently looks like.
This is what I want it to look like, with a singular option to just turn on the switch, hiding the off button.
This is the code I am using:
Code:
this.addCommand(name, symbol, enabled, ext);
Code:
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
this.drawOptionsOnOff(index);
Code:
const index = this.index();
const symbol = this.commandSymbol(index);
const value = this.getConfigValue(symbol);
this.changeValue(symbol, !value);
const catalyst = $gameSwitches.value(41);
if (catalyst) {
$gameSwitches.setValue(41, false);
} else {
$gameSwitches.setValue(41, true);
}
Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, true);
$gameSwitches.setValue(41, true);
Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, false);
$gameSwitches.setValue(41, false);
It would be really great if someone could give me a pointer or two... Thank you and have a great day if you read this!