mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 02:08:11 -06:00
fixed massive number of things
This commit is contained in:
@@ -39,14 +39,14 @@ function inventory_tab.build(map_data, player_data)
|
||||
local search_network_name = player_data.search_network_name
|
||||
local search_network_mask = player_data.search_network_mask
|
||||
local search_surface_idx = player_data.search_surface_idx
|
||||
|
||||
|
||||
local inventory_provided = {}
|
||||
local inventory_in_transit = {}
|
||||
local inventory_requested = {}
|
||||
|
||||
local stations_sorted = {}
|
||||
|
||||
|
||||
|
||||
|
||||
for id, station in pairs(map_data.stations) do
|
||||
local entity = station.entity_stop
|
||||
@@ -61,12 +61,9 @@ function inventory_tab.build(map_data, player_data)
|
||||
end
|
||||
-- move surface comparison up higher in query to short circuit query earlier if surface doesn't match
|
||||
if search_surface_idx then
|
||||
if search_surface_idx == -1 then
|
||||
goto has_match
|
||||
elseif entity.surface.index ~= search_surface_idx then
|
||||
if entity.surface.index ~= search_surface_idx then
|
||||
goto continue
|
||||
end
|
||||
::has_match::
|
||||
end
|
||||
if search_network_name then
|
||||
if search_network_name == (NETWORK_EACH or NETWORK_ANYTHING) then
|
||||
@@ -76,21 +73,21 @@ function inventory_tab.build(map_data, player_data)
|
||||
goto continue
|
||||
end
|
||||
::has_match::
|
||||
local train_flag = get_network_flag(station, station.network_name)
|
||||
local train_flag = get_network_mask(station, station.network_name)
|
||||
if not bit32.btest(search_network_mask, train_flag) then
|
||||
goto continue
|
||||
end
|
||||
elseif search_network_mask ~= -1 then
|
||||
if station.network_name == NETWORK_EACH then
|
||||
local masks = station.network_flag--[[@as {}]]
|
||||
for _, network_flag in pairs(masks) do
|
||||
if bit32.btest(search_network_mask, network_flag) then
|
||||
local masks = station.network_mask--[[@as {}]]
|
||||
for _, network_mask in pairs(masks) do
|
||||
if bit32.btest(search_network_mask, network_mask) then
|
||||
goto has_match
|
||||
end
|
||||
end
|
||||
goto continue
|
||||
::has_match::
|
||||
elseif not bit32.btest(search_network_mask, station.network_flag) then
|
||||
elseif not bit32.btest(search_network_mask, station.network_mask) then
|
||||
goto continue
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@ local manager = require("scripts.gui.manager")
|
||||
|
||||
--- @class PlayerData
|
||||
--- @field is_manager_open boolean
|
||||
--- @field refs {[string]: LuaGuiElement}?
|
||||
--- @field refs {[string]: LuaGuiElement}
|
||||
--- @field search_query string?
|
||||
--- @field search_network_name string?
|
||||
--- @field search_network_mask int
|
||||
@@ -63,6 +63,7 @@ function manager_gui.on_player_created(e)
|
||||
trains_orderings_invert = {},
|
||||
pinning = false,
|
||||
refs = manager.create(player),
|
||||
selected_tab = "stations_tab",
|
||||
}
|
||||
global.manager.players[e.player_index] = player_data
|
||||
|
||||
@@ -95,7 +96,7 @@ end
|
||||
commands.add_command("cybersyn_rebuild_manager_windows", nil, function(command)
|
||||
local manager_data = global.manager
|
||||
if manager_data then
|
||||
|
||||
|
||||
---@param v PlayerData
|
||||
for i, v in pairs(manager_data.players) do
|
||||
local player = game.get_player(i)
|
||||
|
||||
@@ -67,7 +67,7 @@ function manager.create(player)
|
||||
name = "manager_text_search_field",
|
||||
type = "textfield",
|
||||
clear_and_focus_on_right_click = true,
|
||||
handler = manager.handle.manager_update_text_search, --on_gui_text_changed
|
||||
handler = { [defines.events.on_gui_text_changed] = manager.handle.manager_update_text_search },
|
||||
},
|
||||
{ type = "label", style = "subheader_caption_label", caption = { "cybersyn-gui.search-item-label" } },
|
||||
{ type= "choose-elem-button", name="manager_item_filter", style="slot_button_in_shallow_frame", elem_type="signal", handler=manager.handle.manager_update_item_search, },
|
||||
@@ -83,13 +83,13 @@ function manager.create(player)
|
||||
allow_negative = true,
|
||||
clear_and_focus_on_right_click = true,
|
||||
text = "-1",
|
||||
handler = manager.handle.manager_update_network_mask, --on_gui_text_changed
|
||||
handler = { [defines.events.on_gui_text_changed] = manager.handle.manager_update_network_mask },
|
||||
},
|
||||
{ type = "label", style = "caption_label", caption = { "cybersyn-gui.surface-label" } },
|
||||
{
|
||||
name = "manager_surface_dropdown",
|
||||
type = "drop-down",
|
||||
handler = manager.handle.manager_update_surface, --on_gui_selection_state_changed
|
||||
handler = { [defines.events.on_gui_selection_state_changed] = manager.handle.manager_update_surface },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -116,13 +116,13 @@ function manager.create(player)
|
||||
return refs
|
||||
end
|
||||
|
||||
--- @param player_data PlayerData
|
||||
function manager.build(player_data)
|
||||
local refs = player_data.refs
|
||||
-- Surface dropdown
|
||||
-- Surface dropdown
|
||||
--- @type LuaGuiElement
|
||||
local surface_dropdown = refs.manager_surface_dropdown
|
||||
local surfaces = game.surfaces
|
||||
local selected_surface_id = player_data.search_surface_idx
|
||||
local surface_dropdown = refs.manager_surface_dropdown
|
||||
local surfaces = game.surfaces
|
||||
local currently_selected_index = surface_dropdown.selected_index
|
||||
local currently_selected_surface = nil
|
||||
if currently_selected_index ~= (nil or 0) then
|
||||
@@ -130,26 +130,23 @@ function manager.build(player_data)
|
||||
end
|
||||
surface_dropdown.clear_items()
|
||||
surface_dropdown.add_item("all", 1)
|
||||
i = 1
|
||||
local i = 1
|
||||
for name, _ in pairs(surfaces) do
|
||||
i = i + 1
|
||||
surface_dropdown.add_item(name, i)
|
||||
--reselect same surface
|
||||
if name == currently_selected_surface then
|
||||
refs.manager_surface_dropdown.selected_index = i
|
||||
refs.manager_surface_dropdown.selected_index = i--[[@as uint]]
|
||||
end
|
||||
end
|
||||
-- Validate that the selected index still exist
|
||||
if selected_surface_id then
|
||||
local selected_surface = game.get_surface(selected_surface_id)
|
||||
-- If the surface was invalidated since last update, reset to all
|
||||
-- Validate that the selected index still exist
|
||||
if player_data.search_surface_idx then
|
||||
local selected_surface = game.get_surface(player_data.search_surface_idx)
|
||||
-- If the surface was invalidated since last update, reset to all
|
||||
if not selected_surface then
|
||||
player_data.search_surface_idx = -1
|
||||
player_data.search_surface_idx = nil
|
||||
end
|
||||
else
|
||||
player_data.search_surface_idx = -1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- @param map_data MapData
|
||||
@@ -271,7 +268,8 @@ end
|
||||
--- @param e GuiEventData
|
||||
function manager.handle.manager_update_item_search(player, player_data, refs, e)
|
||||
local element = e.element
|
||||
local signal = element.elem_value
|
||||
if not element then return end
|
||||
local signal = e.element.elem_value
|
||||
if signal then
|
||||
player_data.search_item = signal.name
|
||||
else
|
||||
@@ -283,8 +281,10 @@ end
|
||||
--- @param player LuaPlayer
|
||||
--- @param player_data PlayerData
|
||||
--- @param refs table<string, LuaGuiElement>
|
||||
--- @param e GuiEventData
|
||||
function manager.handle.manager_update_network_name(player, player_data, refs, e)
|
||||
local element = e.element
|
||||
if not element then return end
|
||||
local signal = element.elem_value
|
||||
if signal then
|
||||
player_data.search_network_name = signal.name
|
||||
@@ -295,23 +295,28 @@ end
|
||||
--- @param player LuaPlayer
|
||||
--- @param player_data PlayerData
|
||||
--- @param refs table<string, LuaGuiElement>
|
||||
--- @param e GuiEventData
|
||||
function manager.handle.manager_update_network_mask(player, player_data, refs, e)
|
||||
player_data.search_network_mask = tonumber(e.text) or -1
|
||||
e.text = tostring(player_data.search_network_mask)
|
||||
end
|
||||
--- @param player LuaPlayer
|
||||
--- @param player_data PlayerData
|
||||
--- @param refs table<string, LuaGuiElement>
|
||||
--- @param e GuiEventData
|
||||
function manager.handle.manager_update_surface(player, player_data, refs, e)
|
||||
--- @type LuaGuiElement
|
||||
local element = e.element
|
||||
if not element then return end
|
||||
local i = element.selected_index
|
||||
local refs = player_data.refs
|
||||
local surface_id = -1
|
||||
---@type uint?
|
||||
local surface_id = nil
|
||||
--all surfaces should always be the first entry with an index of 1
|
||||
if i > 1 then
|
||||
local surface_name = refs.manager_surface_dropdown.get_item(i)
|
||||
local surface = game.get_surface(surface_name)
|
||||
surface_id = surface.index
|
||||
if surface then
|
||||
surface_id = surface.index
|
||||
end
|
||||
end
|
||||
|
||||
player_data.search_surface_idx = surface_id
|
||||
|
||||
@@ -56,7 +56,6 @@ end
|
||||
|
||||
--- @param map_data MapData
|
||||
--- @param player_data PlayerData
|
||||
--- @return GuiElemDef
|
||||
function stations_tab.build(map_data, player_data, query_limit)
|
||||
|
||||
local widths = constants.gui["en"]
|
||||
@@ -87,7 +86,7 @@ function stations_tab.build(map_data, player_data, query_limit)
|
||||
goto continue
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- move surface comparison up higher in query to short circuit query earlier if surface doesn't match; this can exclude hundreds of stations instantly in SE
|
||||
if search_surface_idx then
|
||||
if search_surface_idx == -1 then
|
||||
@@ -102,21 +101,21 @@ function stations_tab.build(map_data, player_data, query_limit)
|
||||
if search_network_name ~= station.network_name then
|
||||
goto continue
|
||||
end
|
||||
local train_flag = get_network_flag(station, station.network_name)
|
||||
local train_flag = get_network_mask(station, station.network_name)
|
||||
if not bit32.btest(search_network_mask, train_flag) then
|
||||
goto continue
|
||||
end
|
||||
elseif search_network_mask ~= -1 then
|
||||
if station.network_name == NETWORK_EACH then
|
||||
local masks = station.network_flag--[[@as {}]]
|
||||
for _, network_flag in pairs(masks) do
|
||||
if bit32.btest(search_network_mask, network_flag) then
|
||||
local masks = station.network_mask--[[@as {}]]
|
||||
for _, network_mask in pairs(masks) do
|
||||
if bit32.btest(search_network_mask, network_mask) then
|
||||
goto has_match
|
||||
end
|
||||
end
|
||||
goto continue
|
||||
::has_match::
|
||||
elseif not bit32.btest(search_network_mask, station.network_flag) then
|
||||
elseif not bit32.btest(search_network_mask, station.network_mask) then
|
||||
goto continue
|
||||
end
|
||||
end
|
||||
@@ -222,10 +221,11 @@ function stations_tab.build(map_data, player_data, query_limit)
|
||||
for i, station_id in pairs(stations_sorted) do
|
||||
--- @type Station
|
||||
local station = stations[station_id]
|
||||
local network_sprite = "utility/close_black"
|
||||
local network_sprite = "utility/close_black"
|
||||
local network_name = station.network_name
|
||||
local network_flag = get_network_flag(station, network_name)
|
||||
if network_name ~= nil then
|
||||
local network_mask = -1;
|
||||
if network_name then
|
||||
network_mask = get_network_mask(station, network_name)
|
||||
network_sprite, _, _ = util.generate_item_references(network_name)
|
||||
end
|
||||
local color = i % 2 == 0 and "dark" or "light"
|
||||
@@ -242,7 +242,7 @@ function stations_tab.build(map_data, player_data, query_limit)
|
||||
},
|
||||
--templates.status_indicator(widths.stations.status, true), --repurposing status column for network name
|
||||
{ type = "sprite-button", style = "ltnm_small_slot_button_default", enabled = false, sprite = network_sprite, },
|
||||
{ type = "label", style_mods = { width = widths.stations.network_id, horizontal_align = "center" }, caption = network_flag },
|
||||
{ type = "label", style_mods = { width = widths.stations.network_id, horizontal_align = "center" }, caption = network_mask },
|
||||
templates.small_slot_table(widths.stations, color, "provided_requested"),
|
||||
templates.small_slot_table(widths.stations, color, "shipments"),
|
||||
templates.small_slot_table(widths.stations, color, "control_signals"),
|
||||
@@ -287,17 +287,17 @@ function stations_tab.handle.open_station_gui(player, player_data, refs, e)
|
||||
local station_comb1 = station.entity_comb1
|
||||
local station_comb2 = station.entity_comb2
|
||||
|
||||
if not station_entity or not station_entity.valid then
|
||||
util.error_flying_text(player, { "message.ltnm-error-station-is-invalid" })
|
||||
return
|
||||
end
|
||||
if not station_entity or not station_entity.valid then
|
||||
util.error_flying_text(player, { "message.ltnm-error-station-is-invalid" })
|
||||
return
|
||||
end
|
||||
|
||||
if e.shift then
|
||||
if e.shift then
|
||||
if station_entity.surface ~= player.surface then
|
||||
util.error_flying_text(player, { "cybersyn-message.error-cross-surface-camera-invalid" })
|
||||
else
|
||||
player.zoom_to_world(station_entity.position, 1, station_entity)
|
||||
|
||||
|
||||
rendering.draw_circle({
|
||||
color = constants.colors.red.tbl,
|
||||
target = station_entity.position,
|
||||
@@ -311,7 +311,7 @@ function stations_tab.handle.open_station_gui(player, player_data, refs, e)
|
||||
|
||||
if not player_data.pinning then util.close_manager_window(player, player_data, refs) end
|
||||
end
|
||||
elseif e.control then
|
||||
elseif e.control then
|
||||
if station_comb1 ~= nil and station_comb1.valid then
|
||||
player.opened = station_comb1
|
||||
else
|
||||
@@ -324,15 +324,15 @@ function stations_tab.handle.open_station_gui(player, player_data, refs, e)
|
||||
else
|
||||
util.error_flying_text(player, { "cybersyn-message.error-station-control-combinator-not-found" })
|
||||
end
|
||||
else
|
||||
player.opened = station_entity
|
||||
end
|
||||
else
|
||||
player.opened = station_entity
|
||||
end
|
||||
end
|
||||
|
||||
---@param player LuaPlayer
|
||||
---@param player_data PlayerData
|
||||
function stations_tab.handle.on_stations_tab_selected(player, player_data)
|
||||
player_data.selected_tab = "stations_tab"
|
||||
player_data.selected_tab = "stations_tab"
|
||||
end
|
||||
|
||||
gui.add_handlers(stations_tab.handle, stations_tab.wrapper)
|
||||
|
||||
@@ -47,7 +47,6 @@ end
|
||||
|
||||
--- @param map_data MapData
|
||||
--- @param player_data PlayerData
|
||||
--- @return GuiElemDef
|
||||
function trains_tab.build(map_data, player_data, query_limit)
|
||||
local widths = constants.gui["en"]
|
||||
local refs = player_data.refs
|
||||
@@ -57,7 +56,7 @@ function trains_tab.build(map_data, player_data, query_limit)
|
||||
local search_network_name = player_data.search_network_name
|
||||
local search_network_mask = player_data.search_network_mask
|
||||
local search_surface_idx = player_data.search_surface_idx
|
||||
|
||||
|
||||
local trains = map_data.trains
|
||||
|
||||
local trains_sorted = {}
|
||||
@@ -73,29 +72,26 @@ function trains_tab.build(map_data, player_data, query_limit)
|
||||
if search_network_name ~= train.network_name then
|
||||
goto continue
|
||||
end
|
||||
local train_flag = get_network_flag(train, search_network_name)
|
||||
local train_flag = get_network_mask(train, search_network_name)
|
||||
if not bit32.btest(search_network_mask, train_flag) then
|
||||
goto continue
|
||||
end
|
||||
elseif search_network_mask ~= -1 then
|
||||
if train.network_name == NETWORK_EACH then
|
||||
local masks = train.network_flag--[[@as {}]]
|
||||
for _, network_flag in pairs(masks) do
|
||||
if bit32.btest(search_network_mask, network_flag) then
|
||||
local masks = train.network_mask--[[@as {}]]
|
||||
for _, network_mask in pairs(masks) do
|
||||
if bit32.btest(search_network_mask, network_mask) then
|
||||
goto has_match
|
||||
end
|
||||
end
|
||||
goto continue
|
||||
::has_match::
|
||||
elseif not bit32.btest(search_network_mask, train.network_flag) then
|
||||
elseif not bit32.btest(search_network_mask, train.network_mask) then
|
||||
goto continue
|
||||
end
|
||||
end
|
||||
|
||||
if search_surface_idx then
|
||||
if search_surface_idx == -1 then
|
||||
goto has_match
|
||||
end
|
||||
local entity = get_any_train_entity(train.entity)
|
||||
if not entity then
|
||||
goto continue
|
||||
@@ -103,7 +99,6 @@ function trains_tab.build(map_data, player_data, query_limit)
|
||||
if entity.surface.index ~= search_surface_idx then
|
||||
goto continue
|
||||
end
|
||||
::has_match::
|
||||
end
|
||||
|
||||
if search_item then
|
||||
@@ -203,70 +198,73 @@ function trains_tab.build(map_data, player_data, query_limit)
|
||||
else
|
||||
locomotive = train_entity.locomotives["back_movers"][1]
|
||||
end
|
||||
local manifest = {}
|
||||
if train.manifest ~= nil then
|
||||
manifest = train.manifest
|
||||
end
|
||||
local manifest = train.manifest
|
||||
local network_sprite = "utility/close_black"
|
||||
local network_name = train.network_name
|
||||
local network_id = train.network_flag
|
||||
---@type int?
|
||||
local network_id = nil
|
||||
if network_name then
|
||||
if network_name == NETWORK_EACH then
|
||||
network_id = train.network_mask[search_network_name]--[[@as int?]]
|
||||
else
|
||||
network_id = train.network_mask--[[@as int]]
|
||||
end
|
||||
network_sprite, _, _ = util.generate_item_references(network_name)
|
||||
end
|
||||
local color = idx % 2 == 0 and "dark" or "light"
|
||||
gui.add(scroll_pane, {
|
||||
type = "frame",
|
||||
style = "ltnm_table_row_frame_" .. color,
|
||||
{
|
||||
type = "frame",
|
||||
style = "ltnm_table_inset_frame_" .. color,
|
||||
{
|
||||
type = "frame",
|
||||
style = "ltnm_table_inset_frame_" .. color,
|
||||
{
|
||||
type = "minimap",
|
||||
name = "train_minimap",
|
||||
style = "ltnm_train_minimap",
|
||||
type = "minimap",
|
||||
name = "train_minimap",
|
||||
style = "ltnm_train_minimap",
|
||||
|
||||
{ type = "label", style = "ltnm_minimap_label", caption = train_id },
|
||||
{
|
||||
type = "button",
|
||||
style = "ltnm_train_minimap_button",
|
||||
tooltip = { "cybersyn-gui.open-train-gui" },
|
||||
tags = { train_id = train_id },
|
||||
handler = trains_tab.handle.open_train_gui, --on_click
|
||||
},
|
||||
{ type = "label", style = "ltnm_minimap_label", caption = train_id },
|
||||
{
|
||||
type = "button",
|
||||
style = "ltnm_train_minimap_button",
|
||||
tooltip = { "cybersyn-gui.open-train-gui" },
|
||||
tags = { train_id = train_id },
|
||||
handler = trains_tab.handle.open_train_gui, --on_click
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type = "frame",
|
||||
style = "ltnm_table_row_frame_" .. color,
|
||||
style_mods = { width = widths.trains.status },
|
||||
{ type = "sprite-button", style = "ltnm_small_slot_button_default", enabled = false, sprite = network_sprite, number = network_id },
|
||||
},
|
||||
{
|
||||
type = "label",
|
||||
style_mods = { width = widths.trains.layout },
|
||||
caption = layouts_table[train.layout_id],
|
||||
},
|
||||
{
|
||||
type = "label",
|
||||
style_mods = { width = widths.trains.depot },
|
||||
caption = depot_name,
|
||||
},
|
||||
{
|
||||
type = "frame",
|
||||
name = "shipment_frame",
|
||||
style = "ltnm_small_slot_table_frame_" .. color,
|
||||
style_mods = { width = widths.trains.shipment },
|
||||
{
|
||||
type = "frame",
|
||||
style = "ltnm_table_row_frame_" .. color,
|
||||
style_mods = { width = widths.trains.status },
|
||||
{ type = "sprite-button", style = "ltnm_small_slot_button_default", enabled = false, sprite = network_sprite, number = network_id },
|
||||
type = "table",
|
||||
name = "shipment_table",
|
||||
style = "slot_table",
|
||||
column_count = widths.trains.shipment_columns,
|
||||
{ },
|
||||
},
|
||||
{
|
||||
type = "label",
|
||||
style_mods = { width = widths.trains.layout },
|
||||
caption = layouts_table[train.layout_id],
|
||||
},
|
||||
{
|
||||
type = "label",
|
||||
style_mods = { width = widths.trains.depot },
|
||||
caption = depot_name,
|
||||
},
|
||||
{
|
||||
type = "frame",
|
||||
name = "shipment_frame",
|
||||
style = "ltnm_small_slot_table_frame_" .. color,
|
||||
style_mods = { width = widths.trains.shipment },
|
||||
{
|
||||
type = "table",
|
||||
name = "shipment_table",
|
||||
style = "slot_table",
|
||||
column_count = widths.trains.shipment_columns,
|
||||
{ },
|
||||
},
|
||||
},
|
||||
}, refs)
|
||||
refs.train_minimap.entity = locomotive
|
||||
gui.add(refs.shipment_table, util.slot_table_build_from_manifest(manifest, "default"))
|
||||
},
|
||||
}, refs)
|
||||
refs.train_minimap.entity = locomotive
|
||||
gui.add(refs.shipment_table, util.slot_table_build_from_manifest(manifest, "default"))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -289,17 +287,17 @@ function trains_tab.handle.open_train_gui(player, player_data, refs, e)
|
||||
local train = global.trains[train_id]
|
||||
local train_entity = train.entity
|
||||
|
||||
if not train_entity or not train_entity.valid then
|
||||
util.error_flying_text(gui.player, { "message.ltnm-error-train-is-invalid" })
|
||||
return
|
||||
end
|
||||
if not train_entity or not train_entity.valid then
|
||||
util.error_flying_text(player, { "message.ltnm-error-train-is-invalid" })
|
||||
return
|
||||
end
|
||||
train_util.open_gui(player.index, train_entity)
|
||||
end
|
||||
|
||||
---@param player LuaPlayer
|
||||
---@param player_data PlayerData
|
||||
function trains_tab.handle.on_trains_tab_selected(player, player_data)
|
||||
player_data.selected_tab = "trains_tab"
|
||||
player_data.selected_tab = "trains_tab"
|
||||
end
|
||||
|
||||
gui.add_handlers(trains_tab.handle, trains_tab.wrapper)
|
||||
|
||||
@@ -58,7 +58,7 @@ end
|
||||
|
||||
|
||||
--- Updates a slot table based on the passed criteria.
|
||||
--- @param manifest Manifest
|
||||
--- @param manifest Manifest?
|
||||
--- @param color string
|
||||
--- @return GuiElemDef[]
|
||||
function util.slot_table_build_from_manifest(manifest, color)
|
||||
@@ -138,9 +138,9 @@ function util.slot_table_build_from_deliveries(station)
|
||||
---@type GuiElemDef[]
|
||||
local children = {}
|
||||
local deliveries = station.deliveries
|
||||
|
||||
|
||||
for item, count in pairs(deliveries) do
|
||||
|
||||
|
||||
local sprite, img_path, item_string = util.generate_item_references(item)
|
||||
if sprite ~= nil then
|
||||
local color
|
||||
@@ -182,7 +182,7 @@ function util.slot_table_build_from_control_signals(station)
|
||||
local name = item.name
|
||||
local sprite = ""
|
||||
local color = "default"
|
||||
if item.type ~= "virtual" then
|
||||
if item.type ~= "virtual" then
|
||||
goto continue
|
||||
else
|
||||
sprite = "virtual-signal" .. "/" .. name
|
||||
@@ -258,7 +258,7 @@ function util.build_train_layout_table(map_data)
|
||||
end
|
||||
return layouts_table
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
return util
|
||||
|
||||
Reference in New Issue
Block a user