Yanfly Options Core and SRD Options (Windowskin, Font & Language)

● ARCHIVED · READ-ONLY
Started by SleepyMachine 5 posts View original ↗
  1. Hiya!

    So, I'm currently using Yanfly's option core menu thing, and I was wondering how I would add SRD's windowskin, font & language options to it.

    I get how to add custom options, the problem I'm having is having the option display what it's using (Windowskin option showing which one is currently selected)

    I'm probably just horrible at this and there's a really simple way to do it.

    any help would be amazing!
  2. Maybe I can help you, since I was able to make the Window Skin option. Inside one of the Categories, just create a new option (call it whatever you want, Window Skins, Window Styles... and make a proper help description).

    Then you have to put this in the 'Symbol' parameter:
    Code:
    windowSkin

    Next you need to do, is to go to the 'Draw Option Code' and paste this:
    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 / 19;
    this.drawText(this.statusText(index), titleWidth, rect.y, statusWidth, 'center');

    BE VERY CAREFUL, since the line 'var rate = value / 19;' has the number of Window Skins you are going to have (withouth counting the Default one). That means that, if you have a default window skin and other 4 window skin options, you only need to put those 4, and the line will look like this:
    Code:
    var rate = value / 4;

    If you are going to configure more window skins in th SumRndmDde plugin, don't forget to add the new value there and in the next parameters we are going to see, ok?

    In the 'Process OK Code' parameter put this:
    Code:
    var index = this.index();
    var symbol = this.commandSymbol(index);
    var value = this.getConfigValue(symbol);
    value += 1;
    if (value > 19) {
      value = 0;
    }
    value = value.clamp(0, 19);
    this.changeValue(symbol, value);

    And again, BE CAREFUL with those numbers. Change the '19' number for the number of window skins you are going to use.

    In the 'Cursor Right Code' parameter put this:
    Code:
    var index = this.index();
    var symbol = this.commandSymbol(index);
    var value = this.getConfigValue(symbol);
    value += 1;
    value = value.clamp(0, 19);
    this.changeValue(symbol, value);

    Again, change the '19' number for the number of window skins you are going to use.

    In the 'Cursor Left Code' parameter put this:
    Code:
    var index = this.index();
    var symbol = this.commandSymbol(index);
    var value = this.getConfigValue(symbol);
    value -= 1;
    value = value.clamp(0, 19);
    this.changeValue(symbol, value);

    May I have to say the same thing about the '19' number?

    Put this in the 'Default Config Code' parameter:
    Code:
    ConfigManager[symbol] = 0;

    This will make that the default window will be there the first time the player plays the game.

    And finally, put this in the 'Load Config Code' parameter:
    Code:
    var value = config[symbol];
    if (value !== undefined) {
      ConfigManager[symbol] = Number(value).clamp(0, 19);
    } else {
      ConfigManager[symbol] = 0;
    }

    And once and for all, change the '19' number for the number of window skins you are going to use.

    Hope this can be useful to you, and for those who are going to use the Window Skins plugin with YEP Options Core.
  3. Oscar92player said:
    Maybe I can help you, since I was able to make the Window Skin option. Inside one of the Categories, just create a new option (call it whatever you want, Window Skins, Window Styles... and make a proper help description).

    Then you have to put this in the 'Symbol' parameter:
    Code:
    windowSkin

    Next you need to do, is to go to the 'Draw Option Code' and paste this:
    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 / 19;
    this.drawText(this.statusText(index), titleWidth, rect.y, statusWidth, 'center');

    BE VERY CAREFUL, since the line 'var rate = value / 19;' has the number of Window Skins you are going to have (withouth counting the Default one). That means that, if you have a default window skin and other 4 window skin options, you only need to put those 4, and the line will look like this:
    Code:
    var rate = value / 4;

    If you are going to configure more window skins in th SumRndmDde plugin, don't forget to add the new value there and in the next parameters we are going to see, ok?

    In the 'Process OK Code' parameter put this:
    Code:
    var index = this.index();
    var symbol = this.commandSymbol(index);
    var value = this.getConfigValue(symbol);
    value += 1;
    if (value > 19) {
      value = 0;
    }
    value = value.clamp(0, 19);
    this.changeValue(symbol, value);

    And again, BE CAREFUL with those numbers. Change the '19' number for the number of window skins you are going to use.

    In the 'Cursor Right Code' parameter put this:
    Code:
    var index = this.index();
    var symbol = this.commandSymbol(index);
    var value = this.getConfigValue(symbol);
    value += 1;
    value = value.clamp(0, 19);
    this.changeValue(symbol, value);

    Again, change the '19' number for the number of window skins you are going to use.

    In the 'Cursor Left Code' parameter put this:
    Code:
    var index = this.index();
    var symbol = this.commandSymbol(index);
    var value = this.getConfigValue(symbol);
    value -= 1;
    value = value.clamp(0, 19);
    this.changeValue(symbol, value);

    May I have to say the same thing about the '19' number?

    Put this in the 'Default Config Code' parameter:
    Code:
    ConfigManager[symbol] = 0;

    This will make that the default window will be there the first time the player plays the game.

    And finally, put this in the 'Load Config Code' parameter:
    Code:
    var value = config[symbol];
    if (value !== undefined) {
      ConfigManager[symbol] = Number(value).clamp(0, 19);
    } else {
      ConfigManager[symbol] = 0;
    }

    And once and for all, change the '19' number for the number of window skins you are going to use.

    Hope this can be useful to you, and for those who are going to use the Window Skins plugin with YEP Options Core.

    Oh my god, you are an actual lifesaver. Thank you so so much!
  4. This worked great for me! If anyone else is having issues with the SRD Font Plugin working with the Options Core Plugin, it's the same settings as above, with your number of fonts (minus the default), and the Command Symbol is fontStyle
  5. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.