1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Don't break when multiple dialogs are shown on startup (#16204)

This commit is contained in:
grorp 2025-06-01 15:24:14 +02:00 committed by GitHub
parent a2460df316
commit 56a7f0b7cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 26 deletions

View file

@ -33,13 +33,13 @@ end
local function buttonhandler(this, fields)
if fields.reconfigure then
local parent = this.parent
close_dialog(this)
local maintab = ui.find_by_name("maintab")
local dlg = create_settings_dlg("controls_keyboard_and_mouse")
dlg:set_parent(maintab)
maintab:hide()
dlg:set_parent(parent)
parent:hide()
dlg:show()
return true
@ -74,7 +74,7 @@ local function create_rebind_keys_dlg()
return dlg
end
function migrate_keybindings()
function migrate_keybindings(parent)
-- Show migration dialog if the user upgraded from an earlier version
-- and this has not yet been shown before, *or* if keys settings had to be changed
if core.is_first_run then
@ -95,14 +95,14 @@ function migrate_keybindings()
end
if not has_migration then
return
return parent
end
local maintab = ui.find_by_name("maintab")
local dlg = create_rebind_keys_dlg()
dlg:set_parent(maintab)
maintab:hide()
dlg:set_parent(parent)
parent:hide()
dlg:show()
ui.update()
return dlg
end