This commit is contained in:
2025-05-22 20:40:00 +09:00
parent 94380b4ced
commit b01c96cefe

View File

@@ -76,27 +76,10 @@ if settings.startup['PHI-CT'].value then
script.on_event(defines.events.on_player_cheat_mode_disabled, hidden_recipe_enable) script.on_event(defines.events.on_player_cheat_mode_disabled, hidden_recipe_enable)
end end
if settings.startup['PHI-CT'].value or settings.startup['PHI-MI'].value or (settings.startup['PHI-SA'].value and settings.startup['PHI-SA-GENERIC'].value) or settings.startup['PHI-VP'].value then if (settings.startup['PHI-SA'].value and settings.startup['PHI-SA-GENERIC'].value) or settings.startup['PHI-VP'].value then
function gui_create(player) script.on_nth_tick(3600, function(_)
if player.gui.relative.inserter_config then for _, s in pairs(game.surfaces) do
player.gui.relative.inserter_config.destroy() local ec = s.find_entities_filtered{type='cargo-landing-pad', force='player'}
end
local frame = player.gui.relative.add({type = 'frame', name = 'inserter_config', anchor = {gui = defines.relative_gui_type.inserter_gui, position = defines.relative_gui_position.right}})
frame.add({type = 'drop-down', name = 'i_sub_direction', items = {'[virtual-signal=signal-0]', '[virtual-signal=signal-1]', '[virtual-signal=signal-2]', '[virtual-signal=signal-3]'}, selected_index = 1})
end
function gui_update(player, inserter)
if not (inserter.supports_direction or ((inserter.prototype and inserter.prototype.allow_custom_vectors) or (inserter.ghost_prototype and inserter.ghost_prototype.allow_custom_vectors))) then
return
end
local gui = player.gui.relative.inserter_config
gui['i_sub_direction'].selected_index = ((inserter_direction_reversed[inserter.direction] - 1) % 4) + 1
end
script.on_nth_tick(3600, function(_)
local ec = game.surfaces['nauvis'].find_entities_filtered{type='cargo-landing-pad', force='player'}
if (not ec) or #ec == 1 then if (not ec) or #ec == 1 then
return return
@@ -140,7 +123,28 @@ if settings.startup['PHI-CT'].value or settings.startup['PHI-MI'].value or (sett
ec[1].insert{name = k, count = v.e, quality = 'normal'} ec[1].insert{name = k, count = v.e, quality = 'normal'}
end end
end end
end
end) end)
end
if settings.startup['PHI-CT'].value or settings.startup['PHI-MI'].value or (settings.startup['PHI-SA'].value and settings.startup['PHI-SA-GENERIC'].value) or settings.startup['PHI-VP'].value then
function gui_create(player)
if player.gui.relative.inserter_config then
player.gui.relative.inserter_config.destroy()
end
local frame = player.gui.relative.add({type = 'frame', name = 'inserter_config', anchor = {gui = defines.relative_gui_type.inserter_gui, position = defines.relative_gui_position.right}})
frame.add({type = 'drop-down', name = 'i_sub_direction', items = {'[virtual-signal=signal-0]', '[virtual-signal=signal-1]', '[virtual-signal=signal-2]', '[virtual-signal=signal-3]'}, selected_index = 1})
end
function gui_update(player, inserter)
if not (inserter.supports_direction or ((inserter.prototype and inserter.prototype.allow_custom_vectors) or (inserter.ghost_prototype and inserter.ghost_prototype.allow_custom_vectors))) then
return
end
local gui = player.gui.relative.inserter_config
gui['i_sub_direction'].selected_index = ((inserter_direction_reversed[inserter.direction] - 1) % 4) + 1
end
script.on_init(function(_) script.on_init(function(_)
for _, player in pairs(game.players) do for _, player in pairs(game.players) do