summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-03 22:34:48 +0200
committerWuzzy <almikes@aol.com>2016-08-03 22:34:48 +0200
commiteedb68d35f577e099ee8dbf8838474d4d71b5c8f (patch)
tree8f4efc9106e5e2a1847b02d9800f8e76fb1869a4 /init.lua
parentbbf32f28e4c306a435a3a7adfc8c985ad36cccd5 (diff)
Add support for category descriptions (as tooltips)
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index dd9474b..eb8bac3 100644
--- a/init.lua
+++ b/init.lua
@@ -172,8 +172,14 @@ function doc.formspec_main()
for c=1,#doc.data.category_order do
local id = doc.data.category_order[c]
local data = doc.data.categories[id]
+ -- Category buton
local button = "button[0,"..y..";3,1;doc_button_category_"..id..";"..minetest.formspec_escape(data.def.name).."]"
- formstring = formstring .. button
+ local tooltip = ""
+ -- Optional description
+ if data.def.description ~= nil then
+ tooltip = "tooltip[doc_button_category_"..id..";"..minetest.formspec_escape(data.def.description).."]"
+ end
+ formstring = formstring .. button .. tooltip
y = y + 1
end
return formstring