1
0
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:
danielmartin0 2024-09-09 17:20:54 +01:00
parent 88d97cf88b
commit ef4c4db674
2 changed files with 8 additions and 8 deletions

View File

@ -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)

View File

@ -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