mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-14 16:12:41 -06:00
saved progress
This commit is contained in:
@@ -5,9 +5,9 @@ local constants = require("scripts.gui.constants")
|
|||||||
--local actions = require("scripts.gui.actions")
|
--local actions = require("scripts.gui.actions")
|
||||||
local templates = require("scripts.gui.templates")
|
local templates = require("scripts.gui.templates")
|
||||||
|
|
||||||
local trains_tab = require("scripts.gui.trains")
|
local stations_tab = require("scripts.gui.stations")
|
||||||
|
--local trains_tab = require("scripts.gui.trains")
|
||||||
--local depots_tab = require("scripts.gui.depots")
|
--local depots_tab = require("scripts.gui.depots")
|
||||||
--local stations_tab = require("scripts.gui.stations")
|
|
||||||
--local inventory_tab = require("scripts.gui.inventory")
|
--local inventory_tab = require("scripts.gui.inventory")
|
||||||
--local history_tab = require("scripts.gui.history")
|
--local history_tab = require("scripts.gui.history")
|
||||||
--local alerts_tab = require("scripts.gui.alerts")
|
--local alerts_tab = require("scripts.gui.alerts")
|
||||||
@@ -28,7 +28,7 @@ function manager.create(player)
|
|||||||
type = "frame",
|
type = "frame",
|
||||||
direction = "vertical",
|
direction = "vertical",
|
||||||
visible = false,
|
visible = false,
|
||||||
handler = manager.handle.manager_close,
|
--handler = manager.handle.manager_close,
|
||||||
children = {
|
children = {
|
||||||
{
|
{
|
||||||
name = "manager_titlebar",
|
name = "manager_titlebar",
|
||||||
@@ -92,6 +92,10 @@ function manager.create(player)
|
|||||||
name = "manager_tabbed_pane",
|
name = "manager_tabbed_pane",
|
||||||
type = "tabbed-pane",
|
type = "tabbed-pane",
|
||||||
style = "ltnm_tabbed_pane",
|
style = "ltnm_tabbed_pane",
|
||||||
|
selected_tab_index = 1,
|
||||||
|
tabs = {
|
||||||
|
stations_tab.create(widths)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -174,6 +178,10 @@ function manager.handle.manager_close(player, player_data, refs)
|
|||||||
|
|
||||||
player_data.is_manager_open = false
|
player_data.is_manager_open = false
|
||||||
player.set_shortcut_toggled("ltnm-toggle-gui", false)
|
player.set_shortcut_toggled("ltnm-toggle-gui", false)
|
||||||
|
|
||||||
|
|
||||||
|
player_data.refs.manager_window.destroy()
|
||||||
|
player_data.refs = manager.create(player)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param player LuaPlayer
|
--- @param player LuaPlayer
|
||||||
@@ -216,10 +224,12 @@ end
|
|||||||
--- @param e GuiEventData
|
--- @param e GuiEventData
|
||||||
function manager.handle.manager_update_text_search(player, player_data, refs, e)
|
function manager.handle.manager_update_text_search(player, player_data, refs, e)
|
||||||
local query = e.text
|
local query = e.text
|
||||||
|
if query then
|
||||||
-- Input sanitization
|
-- Input sanitization
|
||||||
for pattern, replacement in pairs(constants.input_sanitizers) do
|
for pattern, replacement in pairs(constants.input_sanitizers) do
|
||||||
query = string.gsub(query, pattern, replacement)
|
query = string.gsub(query, pattern, replacement)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
player_data.search_query = query
|
player_data.search_query = query
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user