summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-12-15 12:24:40 +0100
committerWuzzy <almikes@aol.com>2016-12-15 12:24:40 +0100
commitd2ac96253d40b55c8d4f3a498acff6da94f263d0 (patch)
tree3a360690ca51056673f77889b06d05b0d5979d4e /init.lua
parented270627424fc6b9c7a9b5f9b961b9a4f43c7a9b (diff)
Make category buttons wider
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 72a1ed5..b239609 100644
--- a/init.lua
+++ b/init.lua
@@ -701,10 +701,11 @@ function doc.formspec_main(playername)
for c=1,#doc.data.category_order do
local id = doc.data.category_order[c]
local data = doc.data.categories[id]
+ local bw = doc.FORMSPEC.WIDTH / math.floor(((doc.data.category_count-1) / CATEGORYFIELDSIZE.HEIGHT)+1)
-- Skip categories which do not exist
if data ~= nil then
-- Category buton
- local button = "button["..((x-1)*3)..","..y..";3,1;doc_button_category_"..id..";"..minetest.formspec_escape(data.def.name).."]"
+ local button = "button["..((x-1)*bw)..","..y..";"..bw..",1;doc_button_category_"..id..";"..minetest.formspec_escape(data.def.name).."]"
local tooltip = ""
-- Optional description
if data.def.description ~= nil then