mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-30 12:01:39 +09:00
.
This commit is contained in:
@@ -113,8 +113,13 @@ if settings.startup['PHI-CT'].value then
|
|||||||
for _, player in pairs(game.players) do
|
for _, player in pairs(game.players) do
|
||||||
gui_create(player)
|
gui_create(player)
|
||||||
|
|
||||||
if player.opened and player.opened.object_name == 'LuaEntity' and (player.opened.type == 'inserter' or (player.opened.type == 'entity-ghost' and player.opened.ghost_type == 'inserter')) then
|
if player.opened and player.opened.object_name == 'LuaEntity' then
|
||||||
gui_update(player, player.opened)
|
if player.opened.type == 'inserter' then
|
||||||
|
gui_update(player, player.opened.prototype)
|
||||||
|
|
||||||
|
elseif player.opened.type == 'entity-ghost' and player.opened.ghost_type == 'inserter' then
|
||||||
|
gui_update(player, player.opened.ghost_prototype)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -124,8 +129,13 @@ if settings.startup['PHI-CT'].value then
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
script.on_event(defines.events.on_gui_opened, function(e)
|
script.on_event(defines.events.on_gui_opened, function(e)
|
||||||
if e.entity and (e.entity.type == 'inserter' or (e.entity.type == 'entity-ghost' and e.entity.ghost_type == 'inserter')) then
|
if e.entity then
|
||||||
gui_update(game.players[e.player_index], e.entity)
|
if e.entity.type == 'inserter' then
|
||||||
|
gui_update(game.players[e.player_index], e.entity.prototype)
|
||||||
|
|
||||||
|
elseif e.entity.type == 'entity-ghost' and e.entity.ghost_type == 'inserter' then
|
||||||
|
gui_update(game.players[e.player_index], e.entity.ghost_prototype)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -135,10 +145,16 @@ if settings.startup['PHI-CT'].value then
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
script.on_event(defines.events.on_player_rotated_entity, function(e)
|
script.on_event(defines.events.on_player_rotated_entity, function(e)
|
||||||
if e.entity and (e.entity.type == 'inserter' or (e.entity.type == 'entity-ghost' and e.entity.ghost_type == 'inserter')) then
|
if e.entity then
|
||||||
for _, player in pairs(game.players) do
|
for _, player in pairs(game.players) do
|
||||||
if player.opened == e.entity then
|
if player.opened == e.entity then
|
||||||
gui_update(player, player.opened)
|
if player.opened.type == 'inserter' then
|
||||||
|
gui_update(player, player.opened.prototype)
|
||||||
|
|
||||||
|
elseif player.opened.type == 'entity-ghost' and player.opened.ghost_type == 'inserter' then
|
||||||
|
gui_update(player, player.opened.ghost_prototype)
|
||||||
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -146,10 +162,16 @@ if settings.startup['PHI-CT'].value then
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
script.on_event(defines.events.on_entity_settings_pasted, function(e)
|
script.on_event(defines.events.on_entity_settings_pasted, function(e)
|
||||||
if e.destination.type == 'inserter' or (e.destination.type == 'entity-ghost' and e.destination.ghost_type == 'inserter') then
|
if e.destination and e.destination.type == 'inserter' or (e.destination.type == 'entity-ghost' and e.destination.ghost_type == 'inserter') then
|
||||||
for _, player in pairs(game.players) do
|
for _, player in pairs(game.players) do
|
||||||
if player.opened == e.destination then
|
if player.opened == e.destination then
|
||||||
gui_update(player, player.opened)
|
if player.opened.type == 'inserter' then
|
||||||
|
gui_update(player, player.opened.prototype)
|
||||||
|
|
||||||
|
elseif player.opened.type == 'entity-ghost' and player.opened.ghost_type == 'inserter' then
|
||||||
|
gui_update(player, player.opened.ghost_prototype)
|
||||||
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user