1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-24 03:47:58 +02:00

fix for error on heavy mode : frame refresh code update on mutagen log

This commit is contained in:
Masamune 2020-02-01 23:05:05 +01:00
parent 6e82163c9d
commit 958835c8e1

View File

@ -5,7 +5,6 @@ local tables = require "maps.biter_battles_v2.tables"
local event = require 'utils.event' local event = require 'utils.event'
local bb_config = require "maps.biter_battles_v2.config" local bb_config = require "maps.biter_battles_v2.config"
local food_values = tables.food_values local food_values = tables.food_values
local frame_sciencelogs = nil
local food_long_and_short = tables.food_long_and_short local food_long_and_short = tables.food_long_and_short
local food_long_to_short = tables.food_long_to_short local food_long_to_short = tables.food_long_to_short
local forces_list = tables.forces_list local forces_list = tables.forces_list
@ -189,10 +188,16 @@ local function add_science_logs(player, element)
end end
end end
function comfy_panel_get_active_frame(player)
if not player.gui.left.comfy_panel then return false end
if not player.gui.left.comfy_panel.tabbed_pane.selected_tab_index then return player.gui.left.comfy_panel.tabbed_pane.tabs[1].content end
return player.gui.left.comfy_panel.tabbed_pane.tabs[player.gui.left.comfy_panel.tabbed_pane.selected_tab_index].content
end
local build_config_gui = (function (player, frame) local build_config_gui = (function (player, frame)
frame_sciencelogs = frame local frame_sciencelogs = comfy_panel_get_active_frame(player)
frame.clear() frame_sciencelogs.clear()
add_science_logs(player, frame) add_science_logs(player, frame_sciencelogs)
end) end)
@ -214,8 +219,6 @@ local function on_gui_selection_state_changed(event)
build_config_gui(player, frame_sciencelogs) build_config_gui(player, frame_sciencelogs)
end end
event.add(defines.events.on_gui_selection_state_changed, on_gui_selection_state_changed) event.add(defines.events.on_gui_selection_state_changed, on_gui_selection_state_changed)
comfy_panel_tabs["MutagenLog"] = build_config_gui comfy_panel_tabs["MutagenLog"] = build_config_gui