mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 02:08:11 -06:00
Fix escape and E not closing the combinator GUI when the manager is enabled
This commit is contained in:
@@ -201,9 +201,6 @@ function gui_opened(comb, player)
|
|||||||
combinator_update(global, comb, true)
|
combinator_update(global, comb, true)
|
||||||
|
|
||||||
local rootgui = player.gui.screen
|
local rootgui = player.gui.screen
|
||||||
if rootgui[COMBINATOR_NAME] then
|
|
||||||
rootgui[COMBINATOR_NAME].destroy()
|
|
||||||
end
|
|
||||||
local selected_index, signal, switch_state, bits = get_comb_gui_settings(comb)
|
local selected_index, signal, switch_state, bits = get_comb_gui_settings(comb)
|
||||||
|
|
||||||
local _, main_window = flib_gui.add(rootgui, {
|
local _, main_window = flib_gui.add(rootgui, {
|
||||||
|
|||||||
@@ -51,6 +51,15 @@ function manager_gui.on_lua_shortcut(e)
|
|||||||
if e.element then
|
if e.element then
|
||||||
if e.element.name == "manager_window" then
|
if e.element.name == "manager_window" then
|
||||||
manager.wrapper(e, manager.handle.manager_toggle)
|
manager.wrapper(e, manager.handle.manager_toggle)
|
||||||
|
elseif e.element.name == COMBINATOR_NAME and e.name == defines.events.on_gui_closed then
|
||||||
|
-- With the manager enabled, this handler overwrites the combinator's
|
||||||
|
-- on_gui_close handler. Copy the logic to close the combinator's GUI here
|
||||||
|
-- as well.
|
||||||
|
local player = game.get_player(e.player_index)
|
||||||
|
if not player then return end
|
||||||
|
if player.gui.screen[COMBINATOR_NAME] then
|
||||||
|
player.gui.screen[COMBINATOR_NAME].destroy()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
manager.wrapper(e, manager.handle.manager_toggle)
|
manager.wrapper(e, manager.handle.manager_toggle)
|
||||||
|
|||||||
Reference in New Issue
Block a user