diff options
author | rubenwardy <rw@rubenwardy.com> | 2020-06-06 17:17:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-06 17:17:08 +0100 |
commit | 60bab8b2d7b61383188c10f5d931dc7b5522d042 (patch) | |
tree | 9647ed69c2e0297aa2665801faa0f4a3e544e094 /builtin/fstk | |
parent | 7ec0e3df35a11b66b48eababf0123170f2453a50 (diff) | |
download | minetest-60bab8b2d7b61383188c10f5d931dc7b5522d042.tar.gz minetest-60bab8b2d7b61383188c10f5d931dc7b5522d042.tar.bz2 minetest-60bab8b2d7b61383188c10f5d931dc7b5522d042.zip |
Add HTTP API to main menu (#9998)
Diffstat (limited to 'builtin/fstk')
-rw-r--r-- | builtin/fstk/dialog.lua | 19 | ||||
-rw-r--r-- | builtin/fstk/ui.lua | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/builtin/fstk/dialog.lua b/builtin/fstk/dialog.lua index df887f413..ea57df1d2 100644 --- a/builtin/fstk/dialog.lua +++ b/builtin/fstk/dialog.lua @@ -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 diff --git a/builtin/fstk/ui.lua b/builtin/fstk/ui.lua index 884100543..6d26aabf0 100644 --- a/builtin/fstk/ui.lua +++ b/builtin/fstk/ui.lua @@ -85,7 +85,7 @@ function ui.update() "box[0.5,1.2;13,5;#000]", ("textarea[0.5,1.2;13,5;;%s;%s]"):format( error_title, error_message), - "button[5,6.6;4,1;btn_error_confirm;" .. fgettext("Ok") .. "]" + "button[5,6.6;4,1;btn_error_confirm;" .. fgettext("OK") .. "]" } else local active_toplevel_ui_elements = 0 |