Jump to content

(MCM) Switch GlobalValue + CallFunction on the same button, is it possible ?


Recommended Posts

Hi all,

I want to have in Mod Configuration menu, a button that when pressed would show ON or OFF in the MCM menu and at the same time a function would be called.

From the MCM demo I don't see that possiblity.

 

Thanks

 

Link to comment
Share on other sites

Thanks for this info. The text on/off is the default used by MCM when you use a toggle switch button. But his option doesn't run a function. What I would like to do is, toggle a switch (it will by default display on or off) but at the same run a fuinction.

I'm not sure it's possible.

Link to comment
Share on other sites

I never created a mod with MCM, but out of curiosity I've downloaded the demo plugin, and checked config.json, there's an ON/OFF that calls a function:

        {
          "id": "bEnabled:Main",
          "text": "Mod Enabled",
          "type": "switcher",
          "help": "Controls whether the mod is enabled. (demo for ON/OFF switcher control)",
          "valueOptions": {
            "sourceType": "ModSettingBool"
          },
          "action": {
            "type": "CallFunction",
            "form": "MCM_Demo.esp|800",
            "function": "DoActionDemo",
            "params": ["{value}"]
          }
        },

I guess MCM will replace {value} with true/false depending on the option and passes it to DoActionDemo as argument.

  • Like 2
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...