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

Discussion in 'Javascript/Plugin Support' started by SleepyMachine, Apr 18, 2018.

Thread Status:
Not open for further replies.
  1. SleepyMachine

    SleepyMachine Weirdo Veteran

    Messages:
    38
    Likes Received:
    44
    Location:
    Toronto
    First Language:
    English
    Primarily Uses:
    RMMV
    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!
     
    #1
    Kike, Moxy and Oscar92player like this.
  2. Oscar92player

    Oscar92player Veteran Veteran

    Messages:
    443
    Likes Received:
    188
    Location:
    Benalmádena - Málaga - Spain
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    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.
     
    #2
    xizorandy, Kike, Esjitu and 4 others like this.
  3. SleepyMachine

    SleepyMachine Weirdo Veteran

    Messages:
    38
    Likes Received:
    44
    Location:
    Toronto
    First Language:
    English
    Primarily Uses:
    RMMV
    Oh my god, you are an actual lifesaver. Thank you so so much!
     
    #3
    Kike and Oscar92player like this.
  4. Moxy

    Moxy Villager Member

    Messages:
    20
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    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
     
    Last edited: Oct 16, 2018
    #4
    xizorandy likes this.
  5. slimmmeiske2

    slimmmeiske2 Little Red Riding Hood Moderator

    Messages:
    5,530
    Likes Received:
    4,118
    Location:
    Belgium
    First Language:
    Dutch
    Primarily Uses:
    RMXP

    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.

     
    #5
Thread Status:
Not open for further replies.

Share This Page