This commit is contained in:
2025-04-07 22:51:33 +09:00
parent a04bc84fa9
commit 65aec1d3ee

View File

@@ -76,7 +76,10 @@ if settings.startup['PHI-CT'].value then
local gui = player.gui.relative.inserter_config
local pos_p = inserter.inserter_pickup_position
local pos_d = inserter.inserter_drop_position
pos_p.x, pos_p.y, pos_d.x, pos_d.y = pos_p.x or 0, pos_p.y or 0, pos_d.x or 0, pos_d.y or 0
local pos_p_x_int, pos_p_x_frac = math.modf(pos_p.x or 0)
local pos_p_y_int, pos_p_y_frac = math.modf(pos_p.y or 0)
local pos_d_x_int, pos_d_x_frac = math.modf(pos_d.x or 0)
local pos_d_y_int, pos_d_y_frac = math.modf(pos_d.y or 0)
local range = math.max(math.abs(math.floor(pos_p.x)), math.abs(math.floor(pos_p.y)), math.abs(math.floor(pos_d.x)), math.abs(math.floor(pos_d.y)))
gui.table['table_' .. (3 + (pos_p.x >= 0 and math.max(math.floor(pos_p.x), 2)) or (pos_p.x < 0 and math.min(math.floor(pos_p.x), -2))) .. '_' .. (pos_p.y >= 0 and math.max(math.floor(pos_p.y), 2)) or (pos_p.y < 0 and math.min(math.floor(pos_p.y), -2))].sprite = 'virtual-signal/up-arrow'
gui.table['table_' .. (3 + (pos_d.x >= 0 and math.max(math.floor(pos_d.x), 2)) or (pos_d.x < 0 and math.min(math.floor(pos_d.x), -2))) .. '_' .. (pos_d.y >= 0 and math.max(math.floor(pos_d.y), 2)) or (pos_d.y < 0 and math.min(math.floor(pos_d.y), -2))].sprite = 'virtual-signal/down-arrow'