diff --git a/comfy_panel/main.lua b/comfy_panel/main.lua index a578a08b..2dd272a2 100644 --- a/comfy_panel/main.lua +++ b/comfy_panel/main.lua @@ -40,17 +40,6 @@ function Public.add_tab_to_gui(tbl) end end ---- This modifies a given gui ---@param name ---@param state -function Public.modify_gui(name, state) - if not main_gui_tabs[name] then - return - end - - main_gui_tabs[name].disabled = state or false -end - function Public.screen_to_bypass(elem) screen_elements[elem] = true return screen_elements @@ -165,23 +154,13 @@ local function main_frame(player) tabbed_pane.add_tab(tab, name_frame) end else - if not func.disabled then - local tab = tabbed_pane.add({type = 'tab', caption = name, name = 'tab_' .. name}) - local name_frame = tabbed_pane.add({type = 'frame', name = name, direction = 'vertical'}) - name_frame.style.minimal_height = 480 - name_frame.style.maximal_height = 480 - name_frame.style.minimal_width = 800 - name_frame.style.maximal_width = 800 - tabbed_pane.add_tab(tab, name_frame) - elseif player.admin then - local tab = tabbed_pane.add({type = 'tab', caption = name, name = 'tab_' .. name}) - local name_frame = tabbed_pane.add({type = 'frame', name = name, direction = 'vertical'}) - name_frame.style.minimal_height = 480 - name_frame.style.maximal_height = 480 - name_frame.style.minimal_width = 800 - name_frame.style.maximal_width = 800 - tabbed_pane.add_tab(tab, name_frame) - end + local tab = tabbed_pane.add({type = 'tab', caption = name, name = 'tab_' .. name}) + local name_frame = tabbed_pane.add({type = 'frame', name = name, direction = 'vertical'}) + name_frame.style.minimal_height = 480 + name_frame.style.maximal_height = 480 + name_frame.style.minimal_width = 800 + name_frame.style.maximal_width = 800 + tabbed_pane.add_tab(tab, name_frame) end end diff --git a/maps/planet_prison.lua b/maps/planet_prison.lua index 4b595cc1..066bf6c2 100644 --- a/maps/planet_prison.lua +++ b/maps/planet_prison.lua @@ -4,7 +4,6 @@ local Global = require 'utils.global' local Session = require 'utils.datastore.session_data' local Event = require 'utils.event' -local ComfyGui = require 'comfy_panel.main' local Freeplay = require 'utils.freeplay' local Server = require 'utils.server' local MapFuntions = require 'tools.map_functions' @@ -520,7 +519,6 @@ this.bp = { } local function init_game() Freeplay.set('disabled', true) - ComfyGui.modify_gui('Players', true) LayersFunctions.init() ClaimsFunctions.init(MapConfig.claim_markers, MapConfig.claim_max_distance) @@ -926,7 +924,8 @@ local function init_player(p) this.perks[p.name] = { flashlight_enable = true, minimap = false, - chat_global = true + chat_global = true, + init = true } for i = 1, 7 do @@ -983,8 +982,9 @@ end local function on_player_joined_game(e) local p = game.players[e.player_index] player_reconnected(p) + redraw_gui(p) - if this.perks and this.perks[p.name] then + if this.perks and this.perks[p.name] and this.perks[p.name].init then return end init_player(p)