mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Add HTTP API to main menu (#9998)
This commit is contained in:
parent
7ec0e3df35
commit
60bab8b2d7
9 changed files with 289 additions and 112 deletions
|
@ -67,3 +67,22 @@ function dialog_create(name,get_formspec,buttonhandler,eventhandler)
|
|||
ui.add(self)
|
||||
return self
|
||||
end
|
||||
|
||||
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"))
|
||||
end,
|
||||
function(this, fields)
|
||||
if fields.ok then
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
end,
|
||||
nil)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue