Add help buttion if doc mod was found

This commit is contained in:
Wuzzy 2017-09-03 01:45:35 +02:00
parent 5839868466
commit 1722d33330
1 changed files with 11 additions and 1 deletions

View File

@ -230,7 +230,7 @@ advschem.add_form("main", {
end
-- TODO: Show information regarding volume, pos1, pos2, etc... in formspec
return [[
local form = [[
size[7,8]
label[0.5,-0.1;Position: ]]..strpos..[[]
label[3,-0.1;Owner: ]]..name..[[]
@ -253,12 +253,22 @@ advschem.add_form("main", {
button[0.5,7.5;3,1;save;Save size]
]]..
border_button
if minetest.get_modpath("doc") then
form = form .. "image_button[6.4,-0.2;0.8,0.8;doc_button_icon_lores.png;doc;]" ..
"tooltip[doc;Help]"
end
return form
end,
handle = function(self, pos, name, fields)
local realmeta = minetest.get_meta(pos)
local meta = realmeta:to_table().fields
local hashpos = minetest.hash_node_position(pos)
if fields.doc then
doc.show_entry(name, "nodes", "advschem:creator", true)
return
end
-- Toggle border
if fields.border then
if meta.schem_border == "true" and advschem.markers[hashpos] then