summaryrefslogtreecommitdiff
path: root/internal.lua
diff options
context:
space:
mode:
Diffstat (limited to 'internal.lua')
-rw-r--r--internal.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/internal.lua b/internal.lua
index 4d9c10b..c35bd4c 100644
--- a/internal.lua
+++ b/internal.lua
@@ -1,3 +1,10 @@
+local S
+if intllib then
+ S = intllib.Getter()
+else
+ S = function(s) return s end
+end
+
-- This pair of encoding functions is used where variable text must go in
-- button names, where the text might contain formspec metacharacters.
-- We can escape button names for the formspec, to avoid screwing up
@@ -36,11 +43,13 @@ function unified_inventory.get_formspec(player, page)
-- Main buttons
for i, def in pairs(unified_inventory.buttons) do
+ local tooltip = def.tooltip or ""
if def.type == "image" then
formspec = formspec.."image_button["
..(0.65 * (i - 1))..",9;0.8,0.8;"
..minetest.formspec_escape(def.image)..";"
- ..minetest.formspec_escape(def.name)..";]"
+ ..minetest.formspec_escape(def.name)..";;;;;"
+ ..tooltip.."]"
end
end