MV How do you assign text to a variable's value? [YEP Option Core]

(I really should just compile all of my Option Core threads into one megathread......would be great if there was like a wiki or something for me to reference...)

Here's the situation:
I have a variable which is used to assign a formula to control difficulty.
Option core is already set up with the option working in game and functioning correctly. The problem is making it look right.
The option controls a variable through 3 values: 0, 1, and 2.
I would like the option to display the text "Disabled" for 0, "Limited" for 1, and "Standard" for 2.

Is there a way to make this happen? Maybe something similar to

Code:
this.drawOptionsOnOff(index, "Enabled", "Disabled")

This one is for switches, but is there one for variables?
drawOptionsOnOff is just a one-line shortcut for some draw calls at given coordinates. Similarly for drawOptionsGauge. I had a quick look at the code of YEP Options Core and didn't see anything for variables/lists, but it should be doable.

Maybe something like one of these (untested):
  1. Show only the text for the selected value:
    JavaScript:
    var list = ["Disabled", "Limited", "Standard"];
    var rect = this.itemRectForText(index);
    var statusWidth = this.statusWidth();
    var titleWidth = rect.width - statusWidth;
    var textWidth = Math.floor(statusWidth / list.length);
    var symbol = this.commandSymbol(index);
    var value = this.getConfigValue(symbol);
    var text = list[value];
    this.resetTextColor();
    this.changePaintOpacity(true);
    this.drawText(text, titleWidth, rect.y, textWidth, "center");

  2. Always show text for all values, with the non-selected ones dimmed out:
    JavaScript:
    var list = ["Disabled", "Limited", "Standard"];
    var rect = this.itemRectForText(index);
    var statusWidth = this.statusWidth();
    var titleWidth = rect.width - statusWidth;
    var textWidth = statusWidth;
    var symbol = this.commandSymbol(index);
    var value = this.getConfigValue(symbol);
    this.resetTextColor();
    for (var n = list.length; n--;) {
      var text = list[n];
      this.changePaintOpacity(value === n);
      this.drawText(text, titleWidth + textWidth * n, rect.y, textWidth, "center");
    }
@caethyril you need a tip jar. At this point you've basically coded my entire options menu :LZSlol: How do I pay my employees?

Here's the results of your hard work:
GameRules2.gif


We'll have a staff pizza party this weekend to celebrate the great work our team has done, dress business casual :LZSlol:

Thank you once again for your help.
😂 Nice, looks good! Haha, you're welcome~

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.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-assign-text-to-a-variables-value-yep-option-core.151823/