mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2025-01-26 01:40:22 +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
|
-- display node (or unknown_node image otherwise) at specified pos in formspec
|
||||||
local formspec_node = function(pos, nodename)
|
local formspec_node = function(pos, nodename)
|
||||||
return nodename and string.format("item_image[%s;1,1;%s]", pos, nodename)
|
if nodename then
|
||||||
or string.format("image[%s;1,1;worldedit_gui_unknown.png]", pos)
|
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
|
end
|
||||||
|
|
||||||
-- two further priv helpers
|
-- two further priv helpers
|
||||||
|
Loading…
Reference in New Issue
Block a user