mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2025-01-12 02:50:28 +01:00
worldedit_gui: Add tooltips to node search result
This commit is contained in:
parent
45acf09e4a
commit
3bc7a0f97d
@ -52,8 +52,13 @@ end
|
||||
|
||||
-- display node (or unknown_node image otherwise) at specified pos in formspec
|
||||
local formspec_node = function(pos, nodename)
|
||||
return nodename and string.format("item_image[%s;1,1;%s]", pos, nodename)
|
||||
or string.format("image[%s;1,1;worldedit_gui_unknown.png]", pos)
|
||||
if nodename then
|
||||
local ndef = minetest.registered_nodes[nodename] or {}
|
||||
return string.format("item_image[%s;1,1;%s]", pos, nodename) ..
|
||||
string.format("tooltip[%s;1,1;%s]", pos, minetest.formspec_escape(ndef.description))
|
||||
else
|
||||
return string.format("image[%s;1,1;worldedit_gui_unknown.png]", pos)
|
||||
end
|
||||
end
|
||||
|
||||
-- two further priv helpers
|
||||
|
Loading…
Reference in New Issue
Block a user