1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-17 20:58:13 +02:00

planet_prison desync fix

This commit is contained in:
Gerkiz 2022-03-01 00:58:53 +01:00
parent 1cb79bb50d
commit a5e1f15cc2
2 changed files with 11 additions and 32 deletions

View File

@ -40,17 +40,6 @@ function Public.add_tab_to_gui(tbl)
end
end
--- This modifies a given gui
--@param name <string>
--@param state <boolean>
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

View File

@ -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)