mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-31 20:21:40 +09:00
.
This commit is contained in:
@@ -19,6 +19,12 @@ local inserter_direction = {
|
|||||||
[16] = defines.direction.northnorthwest,
|
[16] = defines.direction.northnorthwest,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local inserter_direction_reversed = {}
|
||||||
|
|
||||||
|
for k, v in pairs(inserter_direction) do
|
||||||
|
inserter_direction_reversed[v] = k
|
||||||
|
end
|
||||||
|
|
||||||
if settings.startup['PHI-CT'].value then
|
if settings.startup['PHI-CT'].value then
|
||||||
local function trash_creation(event)
|
local function trash_creation(event)
|
||||||
local entity = event.created_entity or event.entity
|
local entity = event.created_entity or event.entity
|
||||||
@@ -92,9 +98,9 @@ if settings.startup['PHI-CT'].value then
|
|||||||
end
|
end
|
||||||
|
|
||||||
local gui = player.gui.relative.inserter_config
|
local gui = player.gui.relative.inserter_config
|
||||||
local d, ds = math.fmod(inserter.direction, 4)
|
local d, ds = math.fmod(inserter_direction_reversed[inserter.direction], 4)
|
||||||
gui['i_direction'].selected_index = d
|
gui['i_direction'].selected_index = (d or 0) + 1
|
||||||
gui['i_sub_direction'].selected_index = ds
|
gui['i_sub_direction'].selected_index = (ds or 0) + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
script.on_init(function(_)
|
script.on_init(function(_)
|
||||||
|
|||||||
Reference in New Issue
Block a user