mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-30 04:40:54 +02:00
fix closing welcome window
This commit is contained in:
parent
88d97cf88b
commit
ef4c4db674
@ -1728,13 +1728,7 @@ local function on_player_changed_surface(event)
|
||||
|
||||
Roles.update_privileges(player)
|
||||
|
||||
-- Close the welcome window if open:
|
||||
if player.gui.center['welcome_window'] then
|
||||
if event.element.name == 'welcome_window' or event.element.parent.name == 'welcome_window' then
|
||||
player.gui.center['welcome_window'].destroy()
|
||||
return true
|
||||
end
|
||||
end
|
||||
GuiWelcome.close_welcome_window(player)
|
||||
end
|
||||
|
||||
function Public.player_entered_vehicle(player, vehicle)
|
||||
|
@ -64,7 +64,7 @@ function Public.handle_click(event)
|
||||
local player = game.players[event.player_index]
|
||||
if player.gui.center['welcome_window'] then
|
||||
if event.element.name == 'welcome_window' or event.element.parent.name == 'welcome_window' then
|
||||
player.gui.center['welcome_window'].destroy()
|
||||
Public.close_welcome_window(player)
|
||||
return true
|
||||
end
|
||||
end
|
||||
@ -72,4 +72,10 @@ function Public.handle_click(event)
|
||||
return false
|
||||
end
|
||||
|
||||
function Public.close_welcome_window(player)
|
||||
if player.gui.center['welcome_window'] then
|
||||
player.gui.center['welcome_window'].destroy()
|
||||
end
|
||||
end
|
||||
|
||||
return Public
|
Loading…
x
Reference in New Issue
Block a user