diff options
author | Wuzzy <almikes@aol.com> | 2016-11-07 21:30:48 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-11-07 21:30:48 +0100 |
commit | c72837b869c1d9f88915a8dd0d0e7c273d7c284d (patch) | |
tree | 64d8f569908f3248ca3ef2f1caec2d6e29bb7912 /init.lua | |
parent | 852fa83da33a63133861e628ecc85ab92209e439 (diff) |
Use doc boundary box helper vars
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -265,9 +265,9 @@ doc.new_category("nodes", { local formstring = "" if data.itemstring ~= "air" then if data.image ~= nil then - formstring = formstring .. "image[11,0;1,1;"..data.image.."]" + formstring = formstring .. "image["..(doc.FORMSPEC.ENTRY_END_X-1)..","..doc.FORMSPEC.ENTRY_START_Y..";1,1;"..data.image.."]" else - formstring = formstring .. "item_image[11,0;1,1;"..data.itemstring.."]" + formstring = formstring .. "item_image["..(doc.FORMSPEC.ENTRY_END_X-1)..","..doc.FORMSPEC.ENTRY_START_Y..";1,1;"..data.itemstring.."]" end end local datastring = "" @@ -729,7 +729,7 @@ doc.new_category("nodes", { datastring = datastring .. string.format(S("Itemstring: \"%s\""), data.itemstring) end - formstring = formstring .. doc.widgets.text(datastring, 0, 0.5, 10.8, 8) + formstring = formstring .. doc.widgets.text(datastring, nil, nil, doc.FORMSPEC.ENTRY_WIDTH - 1.2) return formstring else @@ -749,12 +749,13 @@ doc.new_category("tools", { local formstring = "" -- Hand if data.itemstring == "" then - formstring = formstring .. "image[11,0;1,1;"..minetest.registered_items[""].wield_image.."]" + formstring = formstring .. "image["..(doc.FORMSPEC.ENTRY_END_X-1)..","..doc.FORMSPEC.ENTRY_START_Y..";1,1;".. + minetest.registered_items[""].wield_image.."]" -- Other tools elseif data.image ~= nil then - formstring = formstring .. "image[11,0;1,1;"..data.image.."]" + formstring = formstring .. "image["..(doc.FORMSPEC.ENTRY_END_X-1)..","..doc.FORMSPEC.ENTRY_START_Y..";1,1;"..data.image.."]" else - formstring = formstring .. "item_image[11,0;1,1;"..data.itemstring.."]" + formstring = formstring .. "item_image["..(doc.FORMSPEC.ENTRY_END_X-1)..","..doc.FORMSPEC.ENTRY_START_Y..";1,1;"..data.itemstring.."]" end local datastring = "" if longdesc ~= nil then @@ -805,7 +806,7 @@ doc.new_category("tools", { datastring = datastring .. string.format(S("Itemstring: \"%s\""), data.itemstring) end - formstring = formstring .. doc.widgets.text(datastring, 0, 0.5, 10.8, 8) + formstring = formstring .. doc.widgets.text(datastring, nil, nil, doc.FORMSPEC.ENTRY_WIDTH - 1.2) return formstring else @@ -825,9 +826,9 @@ doc.new_category("craftitems", { local usagehelp = data.usagehelp local formstring = "" if data.image ~= nil then - formstring = formstring .. "image[11,0;1,1;"..data.image.."]" + formstring = formstring .. "image["..(doc.FORMSPEC.ENTRY_END_X-1)..","..doc.FORMSPEC.ENTRY_START_Y..";1,1;"..data.image.."]" else - formstring = formstring .. "item_image[11,0;1,1;"..data.itemstring.."]" + formstring = formstring .. "item_image["..(doc.FORMSPEC.ENTRY_END_X-1)..","..doc.FORMSPEC.ENTRY_START_Y..";1,1;"..data.itemstring.."]" end local datastring = "" if longdesc ~= nil then @@ -873,7 +874,7 @@ doc.new_category("craftitems", { datastring = datastring .. string.format(S("Itemstring: \"%s\""), data.itemstring) end - formstring = formstring .. doc.widgets.text(datastring, 0, 0.5, 10.8, 8) + formstring = formstring .. doc.widgets.text(datastring, nil, nil, doc.FORMSPEC.ENTRY_WIDTH - 1.2) return formstring else |