mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2026-05-12 21:08:43 +09:00
.
This commit is contained in:
+1
-5
@@ -53,11 +53,7 @@ local function gui_create(player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function gui_update(player, entity)
|
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
|
lab.open(player)
|
||||||
player.opened = nil
|
|
||||||
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if entity.valid and entity.type and (entity.type == 'inserter' or (entity.type == 'entity-ghost' and entity.ghost_type == 'inserter')) then
|
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
|
player.gui.relative.phi_cl_inserter_config['i_sub_direction'].selected_index = ((inserter_direction_reversed[entity.direction] - 1) % 4) + 1
|
||||||
|
|||||||
@@ -1,5 +1,33 @@
|
|||||||
local main = {}
|
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)
|
function main.build(event)
|
||||||
if event.entity.type ~= 'lab' then
|
if event.entity.type ~= 'lab' then
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user