🐛 Fixed GUI showing items when it shouldn't

This commit is contained in:
oof2win2
2021-08-14 14:06:13 +00:00
committed by Cooldude2606
parent 5d42fffa64
commit f3ce3eb80b
2 changed files with 5 additions and 1 deletions

View File

@@ -73,7 +73,8 @@ function Gui.update_top_flow(player)
end
-- Set the visible state
local allowed = type(authenticator) == 'function' and authenticator(player) or authenticator
local allowed = authenticator
if type(allowed) == 'function' then allowed = allowed(player) end
element.visible = is_visible and allowed or false
end
end

View File

@@ -114,6 +114,7 @@ local Event = require 'utils.event' --- @dep utils.event
local Groups = require 'expcore.permission_groups' --- @dep expcore.permission_groups
local Async = require 'expcore.async' --- @dep expcore.async
local Colours = require 'utils.color_presets' --- @dep utils.color_presets
local Gui = require 'expcore.gui' --- @dep expcore.gui
local write_json = _C.write_json --- @dep expcore.common
local Roles = {
@@ -378,6 +379,7 @@ function Roles.assign_player(player, roles, by_player_name, skip_checks, silent)
end
if valid_player then
emit_player_roles_updated(valid_player, 'assign', roles, by_player_name, silent)
Gui.update_top_flow(valid_player)
end
end
@@ -410,6 +412,7 @@ function Roles.unassign_player(player, roles, by_player_name, skip_checks, silen
end
if valid_player then
emit_player_roles_updated(valid_player, 'unassign', roles, by_player_name, silent)
Gui.update_top_flow(valid_player)
end
end