As the title suggests, I'm trying to incorporate SRD_WindowSkinOption with YEP_OptionsCore. Yanfly's plugin allows you to add extra functionality to the options menu, but I don't know how to fill it out...
SRD Window Skin Option + Yanfly Options Core
Javascript/Plugin SupportSo you're trying to add an option for changing windowskin?
Yes, I'm trying to access SRD's window skin changing options via Yanfly's options core.
it was already answer somewhere, but here is the code (I save that😀 )
Symbol Parameter : windowSkin and/or fontStyle (same code!)
==================
"Draw Option 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);
var value = this.getConfigValue(symbol);
var rate = value / x; // change x to a number of windowskins/fontstyles
this.drawText(this.statusText(index), titleWidth, rect.y, statusWidth, 'center');
=================
"Process OK Code"
=================
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += 1;
if (value > x) { // change x to a number of windowskins/fontstyles
value = 0;
}
value = value.clamp(0, x); // change x to a number of windowskins/fontstyles
this.changeValue(symbol, value);
===================
"Cursor Right Code"
===================
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += 1;
value = value.clamp(0, x); // change x to a number of windowskins/fontstyles
this.changeValue(symbol, value);
===================
"Cursor Right Code"
===================
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value -= 1;
value = value.clamp(0, x); // change x to a number of windowskins/fontstyles
this.changeValue(symbol, value);
=====================
"Default Config Code"
=====================
ConfigManager[symbol] = 0;
==================
"Load Config Code"
==================
var value = config[symbol];
if (value !== undefined) {
ConfigManager[symbol] = Number(value).clamp(0, x); // change x to a number of windowskins/fontstyles
} else {
ConfigManager[symbol] = 0;
}
Symbol Parameter : windowSkin and/or fontStyle (same code!)
==================
"Draw Option 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);
var value = this.getConfigValue(symbol);
var rate = value / x; // change x to a number of windowskins/fontstyles
this.drawText(this.statusText(index), titleWidth, rect.y, statusWidth, 'center');
=================
"Process OK Code"
=================
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += 1;
if (value > x) { // change x to a number of windowskins/fontstyles
value = 0;
}
value = value.clamp(0, x); // change x to a number of windowskins/fontstyles
this.changeValue(symbol, value);
===================
"Cursor Right Code"
===================
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += 1;
value = value.clamp(0, x); // change x to a number of windowskins/fontstyles
this.changeValue(symbol, value);
===================
"Cursor Right Code"
===================
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value -= 1;
value = value.clamp(0, x); // change x to a number of windowskins/fontstyles
this.changeValue(symbol, value);
=====================
"Default Config Code"
=====================
ConfigManager[symbol] = 0;
==================
"Load Config Code"
==================
var value = config[symbol];
if (value !== undefined) {
ConfigManager[symbol] = Number(value).clamp(0, x); // change x to a number of windowskins/fontstyles
} else {
ConfigManager[symbol] = 0;
}
Suggestion:
instead of x (or static number) use (SRD.WindowSkinOptions.name.length-1)
Example:
var rate = value / (SRD.WindowSkinOptions.name.length-1)
Avoid to update every time the options code if you add a new windows skin during development
Enjoy!
instead of x (or static number) use (SRD.WindowSkinOptions.name.length-1)
Example:
var rate = value / (SRD.WindowSkinOptions.name.length-1)
Avoid to update every time the options code if you add a new windows skin during development
Enjoy!
Original thread: https://forums.rpgmakerweb.com/threads/srd-window-skin-option-yanfly-options-core.123437/