mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Fixed issues in expcore
This commit is contained in:
@@ -20,7 +20,7 @@ end)
|
|||||||
|
|
||||||
--- Admin Roles
|
--- Admin Roles
|
||||||
Roles.new_role('System','SYS')
|
Roles.new_role('System','SYS')
|
||||||
:set_permission_group('Admin')
|
:set_permission_group('Default', true)
|
||||||
:set_flag('is_admin')
|
:set_flag('is_admin')
|
||||||
:set_flag('is_spectator')
|
:set_flag('is_spectator')
|
||||||
:set_flag('report-immune')
|
:set_flag('report-immune')
|
||||||
|
|||||||
@@ -142,15 +142,15 @@ end
|
|||||||
@tparam boolean state the state that you want to set it to, true = allow, false = disallow
|
@tparam boolean state the state that you want to set it to, true = allow, false = disallow
|
||||||
@treturn Permissions_Groups._prototype returns self so function can be chained
|
@treturn Permissions_Groups._prototype returns self so function can be chained
|
||||||
|
|
||||||
@usage-- Set an action to be disalowed
|
@usage-- Set an action to be disallowed
|
||||||
group:set_action('toggle_map_editor', false)
|
group:set_action('toggle_map_editor', false)
|
||||||
|
|
||||||
]]
|
]]
|
||||||
function Permissions_Groups._prototype:set_action(action, state)
|
function Permissions_Groups._prototype:set_action(action, state)
|
||||||
if type(action) == 'string' then
|
local input_action = defines.input_action[action]
|
||||||
action = defines.input_action[action]
|
if input_action == nil then input_action = action end
|
||||||
end
|
assert(type(input_action) == 'number', tostring(action)..' is not a valid input action')
|
||||||
self.actions[action] = state
|
self.actions[input_action] = state
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user