1
0
mirror of https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git synced 2024-12-12 10:13:58 +02:00

Fix #246 gui crash on player self reset button click

This commit is contained in:
Oarcinae 2024-11-06 10:45:58 -05:00
parent 432db3bed0
commit cbb93db37a
4 changed files with 16 additions and 3 deletions

View File

@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 2.1.9
Date: 2024-11-06
Bugfixes:
- Fix crash when clicking player self reset button again before confirmation dialog is closed.
---------------------------------------------------------------------------------------------------
Version: 2.1.8
Date: 2024-11-05
Changes:

View File

@ -1,6 +1,6 @@
{
"name": "oarc-mod",
"version": "2.1.8",
"version": "2.1.9",
"factorio_version": "2.0",
"title": "Oarc Multiplayer Spawn",
"author": "Oarcinae",

View File

@ -311,6 +311,11 @@ end
---@param player LuaPlayer
---@return nil
function DisplayPlayerResetConfirmationGUI(player)
if (player.gui.screen.self_reset_confirm ~= nil) then
player.gui.screen.self_reset_confirm.destroy()
end
local self_reset_gui = player.gui.screen.add {
name = "self_reset_confirm",
type = "frame",

View File

@ -16,12 +16,15 @@ function DisplayWelcomeTextGui(player)
end
--Delete existing guis
if (player.gui.screen["welcome_msg"] ~= nil) then
if (player.gui.screen.welcome_msg ~= nil) then
player.gui.screen.welcome_msg.destroy()
end
if (player.gui.screen["spawn_opts"] ~= nil) then
if (player.gui.screen.spawn_opts ~= nil) then
player.gui.screen.spawn_opts.destroy()
end
if (player.gui.screen.self_reset_confirm ~= nil) then
player.gui.screen.self_reset_confirm.destroy()
end
local welcome_gui = player.gui.screen.add {
name = "welcome_msg",