Hello
I've been trying to make plugins for fun recently (for quite a while though, but interest is back up) and I'm trying to make a new plugin which will enable the user to select a mode for the plugin.
I don't want to use a string parameter as this could cause issues if the user write something wrong, so this is my last option.
Instead, I wanted to use the
I even went for a look at the script call list from Archeia and Caethyril to make sure they should work, and they should.
However, I must be missing something because when I use
So here is an example :
It will always return OnUnfocusStopAll, no matter what mode option is selected, and if I remove the alternative value, it returns Undefined.
Am I doing it wrong? Thanks for the intel! 👋
I've been trying to make plugins for fun recently (for quite a while though, but interest is back up) and I'm trying to make a new plugin which will enable the user to select a mode for the plugin.
I don't want to use a string parameter as this could cause issues if the user write something wrong, so this is my last option.
Instead, I wanted to use the
@type select with their @option value1 @option value2, etc...I even went for a look at the script call list from Archeia and Caethyril to make sure they should work, and they should.
However, I must be missing something because when I use
@type select or @type combo, the argument systematically returns "Undefined" (MV), unless I give it an OR value.So here is an example :
JavaScript:
* @param mode
* @type select
* @option OnUnfocusStopAll
* @option OnUnfocusPlayAll
* @desc Choose whether the game should stop or continue when the window loses focus.
* @default OnUnfocusStopAll
//...
var parameters = PluginManager.parameters('FocusControl');
var mode = parameters['mode'] || 'OnUnfocusStopAll';
//...
It will always return OnUnfocusStopAll, no matter what mode option is selected, and if I remove the alternative value, it returns Undefined.
Am I doing it wrong? Thanks for the intel! 👋