Page 1 of 1

mod defined permission/action

Posted: Fri May 12, 2017 9:40 am
by gheift
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:

Code: Select all

data:extend{
    {
         type = "bool-setting",
         name = "my-custom-action",
         setting_type = "user-mod-action",
         default_value = true,
     }
}
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

Re: mod defined permission/action

Posted: Fri Jun 22, 2018 12:56 pm
by Rseding91
The current permissions system the game uses isn't built to support this. The current system is purely built around input actions and how the game interprets them.

That might change in the future but for now that's how it is.