From 882c398f7a35e4ebb409dac11b5c636a335d89ea Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Sat, 2 May 2026 03:13:35 +0900 Subject: [PATCH] . --- PHI-CL/control.lua | 6 +----- PHI-CL/control/lab.lua | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/PHI-CL/control.lua b/PHI-CL/control.lua index 0382660..7ba8cce 100644 --- a/PHI-CL/control.lua +++ b/PHI-CL/control.lua @@ -53,11 +53,7 @@ local function gui_create(player) end local function gui_update(player, entity) - if entity.valid and entity.type == 'proxy-container' and entity.proxy_target_inventory and entity.proxy_target_inventory == defines.inventory.lab_input then - player.opened = nil - - return - end + lab.open(player) if entity.valid and entity.type and (entity.type == 'inserter' or (entity.type == 'entity-ghost' and entity.ghost_type == 'inserter')) then player.gui.relative.phi_cl_inserter_config['i_sub_direction'].selected_index = ((inserter_direction_reversed[entity.direction] - 1) % 4) + 1 diff --git a/PHI-CL/control/lab.lua b/PHI-CL/control/lab.lua index d81a36f..ae47919 100644 --- a/PHI-CL/control/lab.lua +++ b/PHI-CL/control/lab.lua @@ -1,5 +1,33 @@ local main = {} +function main.open(player) + if not player then + return + end + + if not player.opened then + return + end + + if not player.opened.valid then + return + end + + if player.opened.type ~= 'proxy-container' then + return + end + + if not player.opened.proxy_target_inventory then + return + end + + if player.opened.proxy_target_inventory ~= defines.inventory.lab_input then + return + end + + player.opened = nil +end + function main.build(event) if event.entity.type ~= 'lab' then return