Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Plugins Needed:
- //YEP-Core Engine http://yanfly.moe/2015/10/09/yep-1-core-engine/
- //YEP-Options Core http://yanfly.moe/2018/04/13/yep-165-options-core-rpg-maker-mv/
- //YEP-Advance Switches and Variables http://yanfly.moe/2018/01/19/yep-162-advanced-switches-and-variables-rpg-maker-mv/
- //Advandce Switch/Variable Code:
- //Place this in the name of the id for the switch or variable you want.
- Eval: ConfigManager['symbol'] //where symbol = is the symbol you put in the options menu
- //For Switches:
- //In the Options Pluign:
- // Make Option:
- this.addCommand(name, symbol, enabled, ext);
- //Draw Option:
- 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);
- //Press OK:
- var index = this.index();
- var symbol = this.commandSymbol(index);
- var value = this.getConfigValue(symbol);
- this.changeValue(symbol, !value);
- //Crusor Right:
- var index = this.index();
- var symbol = this.commandSymbol(index);
- var value = this.getConfigValue(symbol);
- this.changeValue(symbol, true);
- //Crusor Left:
- var index = this.index();
- var symbol = this.commandSymbol(index);
- var value = this.getConfigValue(symbol);
- this.changeValue(symbol, false);
- //Default Config
- ConfigManager[symbol] = false; // Set to false if you want it off by default. Set it to true if you want it on by default
- //Save Config
- config[symbol] = ConfigManager[symbol];
- //Load Cofing
- ConfigManager[symbol] = !!config[symbol];
- //For Variables:
- //In the Options Pluign:
- // Make Option:
- this.addCommand(name, symbol, enabled, ext);
- //Draw Option:
- 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);
- //Press OK:
- var index = this.index();
- var symbol = this.commandSymbol(index);
- var value = this.getConfigValue(symbol);
- value += x; // set this to the increment you want your variable to move. ie plus 3
- if (value > y) { // set this to the highest value of your variable
- value = z; // set this to the lowest value of your variable
- }
- value = value.clamp(z, y); //set this to your lowest value of variable and highest value of your varaible
- this.changeValue(symbol, value);
- //Crusor Right:
- var index = this.index();
- var symbol = this.commandSymbol(index);
- var value = this.getConfigValue(symbol);
- value += w; // this should be the increment you want the variable to go by constiently, ie plus 3.
- if(value > x){ // this should be your biggest value of the variable
- value = y; // this should be the smallest value of the variable
- }
- this.changeValue(symbol, value);
- //Crusor Left:
- var index = this.index();
- var symbol = this.commandSymbol(index);
- var value = this.getConfigValue(symbol);
- value -= w; // this should be the increment you want the variable to go bu constiently, ie minus 3.
- if(value < x){ // this should be your smallest value of the variable
- value = y; // this should be the biggest value of the variable
- }
- this.changeValue(symbol, value);
- //Default Config
- ConfigManager[symbol] = x; // Set to default value you want the variable to be
- //Save Config
- config[symbol] = ConfigManager[symbol];
- //Load Cofing
- var value = config[symbol];
- if (value !== undefined) {
- ConfigManager[symbol] = Number(value).clamp(y, z); //y should be the smallest number a variable can be while z should be the biggest.
- } else {
- ConfigManager[symbol] = x; // this is the same value as the default config value
- }
Add Comment
Please, Sign In to add comment