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:
parent
140b9e5a5a
commit
981d67324b
3 changed files with 22 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue