summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-11-07 21:30:48 +0100
committerWuzzy <almikes@aol.com>2016-11-07 21:30:48 +0100
commitc72837b869c1d9f88915a8dd0d0e7c273d7c284d (patch)
tree64d8f569908f3248ca3ef2f1caec2d6e29bb7912
parent852fa83da33a63133861e628ecc85ab92209e439 (diff)
Use doc boundary box helper vars
-rw-r--r--init.lua21
1 files changed, 11 insertions, 10 deletions
diff --git a/init.lua b/init.lua
index f677bb5..57c2c47 100644
--- a/init.lua
+++ b/init.lua
@@ -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