mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 16:08:13 -06:00
Bind the on_gui_closed event for manager_window
This commit is contained in:
@@ -370,6 +370,14 @@ if settings.startup["cybersyn-manager-enabled"].value then
|
||||
key_sequence = "CONTROL + T",
|
||||
action = "lua",
|
||||
},
|
||||
{
|
||||
type = "custom-input",
|
||||
name = "cybersyn-manager-confirm-gui",
|
||||
key_sequence = "",
|
||||
action = "lua",
|
||||
linked_game_control = "confirm-gui"
|
||||
},
|
||||
-- TODO: bind this input to focusing on the station_name box
|
||||
--{
|
||||
-- type = "custom-input",
|
||||
-- name = "ltnm-linked-focus-search",
|
||||
|
||||
@@ -47,7 +47,7 @@ end
|
||||
local manager_gui = {}
|
||||
|
||||
function manager_gui.on_lua_shortcut(e)
|
||||
if e.prototype_name == "cybersyn-toggle-gui" or e.input_name == "cybersyn-toggle-gui" then
|
||||
if e.prototype_name == "cybersyn-toggle-gui" or e.input_name == "cybersyn-toggle-gui" or e.element.name == "manager_window" then
|
||||
manager.wrapper(e, manager.handle.manager_toggle)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -955,6 +955,7 @@ local function main()
|
||||
script.on_event(defines.events.on_player_removed, manager.on_player_removed)
|
||||
script.on_event(defines.events.on_player_created, manager.on_player_created)
|
||||
script.on_event(defines.events.on_lua_shortcut, manager.on_lua_shortcut)
|
||||
script.on_event(defines.events.on_gui_closed, manager.on_lua_shortcut)
|
||||
script.on_event("cybersyn-toggle-gui", manager.on_lua_shortcut)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user