Plugin settings - Michaelgde/MSE-for-gdevelop GitHub Wiki
Plugin Settings in MSE (Music Sheet Editor)
MSE allows plugin developers to define custom settings for their plugins using a settings.json
file.
This gives users control over plugin behavior—such as enabling/disabling features, customizing numbers, or inputting strings—without touching the code.
Setting Up Plugin Settings
- Inside your plugin folder (where
script.js
resides), create a file namedsettings.json
. - Define your settings using the supported types below.
Supported Setting Types
bool
— A checkbox for true/false options.num_input
— A numeric input withmin
/max
bounds.str_input
— A text input with a default value.
settings.json
Example {
"enableFeature": {
"type": "bool",
"text": "Enable the checkbox!"
},
"numberValue": {
"type": "num_input",
"text": "Set custom value here",
"max": 100,
"min": 0
},
"customLabel": {
"type": "str_input",
"text": "Custom label text",
"value": "Default text here"
}
}
script.js
Accessing Settings in To access these settings in your plugin’s script, use the getSetting()
function with the following arguments:
getSetting("<your plugin name>", "<setting name>");
Full Example
if (getSetting("your-plugin-name", "enableFeature")) {
// This block runs only if the checkbox is enabled
const number = getSetting("your-plugin-name", "numberValue");
const string = getSetting("your-plugin-name", "customLabel");
console.log(`Number: ${number}`);
console.log(`String: ${string}`);
}
That's it! This is how you implement custom settings for your plugin in MSE!
By the way, if you want a visual way to generate your custom settings, then check this tool out: