mod defined permission/action
Posted: Fri May 12, 2017 9:40 am
Hi,
I do not know if it was suggested somewhere, but I think for some mods additional actions/permissions would be useful.
My suggestion therefore is to add a mod-setting like the following:
The only difference to the runtime-per-user settings would be: these mod-settings can be managed in the permission dialog. The handling inside the control.lua would be not different from normal runtime-per-user settings: accessing readonly by game.players.mod_settings["my-custom-action"].value and change notification via on_runtime_mod_setting_changed.
Additionaly it can be managed with LuaPermssionGroup.allows_action("my-customu-action") and LuaPermssionGroup.set_allows_action("my-custom-action", true/false).
Kind regards,
Gerhard
I do not know if it was suggested somewhere, but I think for some mods additional actions/permissions would be useful.
My suggestion therefore is to add a mod-setting like the following:
Code: Select all
data:extend{
{
type = "bool-setting",
name = "my-custom-action",
setting_type = "user-mod-action",
default_value = true,
}
}
Additionaly it can be managed with LuaPermssionGroup.allows_action("my-customu-action") and LuaPermssionGroup.set_allows_action("my-custom-action", true/false).
Kind regards,
Gerhard