Changed default for network filter to be nothing rather than network each

This commit is contained in:
Will Berry
2023-03-09 13:24:23 -05:00
parent 547bb93390
commit 7aeab43598
3 changed files with 6 additions and 6 deletions

View File

@@ -36,7 +36,7 @@ inventory=Inventory
keep-open=Keep open keep-open=Keep open
loading-at=Loading at loading-at=Loading at
name=Name name=Name
network-name-label=Network: network-name-label=Network Filter:
network-id-label=Network ID: network-id-label=Network ID:
network-id=Network ID network-id=Network ID
no-alerts=[img=warning-white] No alerts no-alerts=[img=warning-white] No alerts

View File

@@ -79,7 +79,7 @@ function manager.create(player)
--}, --},
{ type = "empty-widget", style = "flib_horizontal_pusher" }, { type = "empty-widget", style = "flib_horizontal_pusher" },
{ type = "label", style = "caption_label", caption = { "cybersyn-gui.network-name-label" } }, { type = "label", style = "caption_label", caption = { "cybersyn-gui.network-name-label" } },
{ type= "choose-elem-button", name="network", style="slot_button_in_shallow_frame", elem_type="signal", tooltip={"cybersyn-gui.network-tooltip"}, signal=NETWORK_SIGNAL_GUI_DEFAULT, handler=manager.handle.manager_update_network_name, }, { type= "choose-elem-button", name="network", style="slot_button_in_shallow_frame", elem_type="signal", tooltip={"cybersyn-gui.network-tooltip"}, handler=manager.handle.manager_update_network_name, },
{ type = "label", style = "caption_label", caption = { "cybersyn-gui.network-id-label" } }, { type = "label", style = "caption_label", caption = { "cybersyn-gui.network-id-label" } },
{ {
name = "manager_network_mask_field", name = "manager_network_mask_field",

View File

@@ -99,15 +99,15 @@ function stations_tab.build(map_data, player_data)
end end
if search_network_name then if search_network_name then
--setting default for GUI to NETWORK_EACH, which will match all --nil matches all?
if search_network_name == (NETWORK_EACH or NETWORK_ANYTHING) then --NETWORK_ANYTHING prevents crash due station having a nil issue, may need to be addressed in a different way if search_network_name == nil then
goto has_match goto has_match
end end
if search_network_name ~= station.network_name then if search_network_name ~= station.network_name then
goto continue goto continue
end end
::has_match:: ::has_match::
local train_flag = get_network_flag(station, station.network_name) --we already validated search network name or a "match anything" local train_flag = get_network_flag(station, station.network_name)
if not bit32.btest(search_network_mask, train_flag) then if not bit32.btest(search_network_mask, train_flag) then
goto continue goto continue
end end
@@ -213,7 +213,7 @@ function stations_tab.build(map_data, player_data)
for i, station_id in pairs(stations_sorted) do for i, station_id in pairs(stations_sorted) do
--- @type Station --- @type Station
local station = stations[station_id] local station = stations[station_id]
local network_sprite = "virtual-signal/signal-everything" local network_sprite = "utility/close_black"
local network_name = station.network_name local network_name = station.network_name
local network_flag = get_network_flag(station, network_name) local network_flag = get_network_flag(station, network_name)
if network_name ~= nil then if network_name ~= nil then