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

Mainmenu: Unify gamedata.errormessage and messagebox formspecs (#14716)

This commit is contained in:
grorp 2024-06-01 17:03:06 +02:00 committed by GitHub
parent 140b9e5a5a
commit 981d67324b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 16 deletions

View file

@ -78,15 +78,12 @@ function dialog_create(name,get_formspec,buttonhandler,eventhandler)
return self
end
-- "message" must already be formspec-escaped, e.g. via fgettext or
-- core.formspec_escape.
function messagebox(name, message)
return dialog_create(name,
function()
return ([[
formspec_version[3]
size[8,3]
textarea[0.375,0.375;7.25,1.2;;;%s]
button[3,1.825;2,0.8;ok;%s]
]]):format(message, fgettext("OK"))
return ui.get_message_formspec("", message, "ok")
end,
function(this, fields)
if fields.ok then