mirror of
git://repo.or.cz/minetest_schemedit.git
synced 2025-01-09 17:40:32 +01:00
Add help buttion if doc mod was found
This commit is contained in:
parent
5839868466
commit
1722d33330
12
init.lua
12
init.lua
@ -230,7 +230,7 @@ advschem.add_form("main", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- TODO: Show information regarding volume, pos1, pos2, etc... in formspec
|
-- TODO: Show information regarding volume, pos1, pos2, etc... in formspec
|
||||||
return [[
|
local form = [[
|
||||||
size[7,8]
|
size[7,8]
|
||||||
label[0.5,-0.1;Position: ]]..strpos..[[]
|
label[0.5,-0.1;Position: ]]..strpos..[[]
|
||||||
label[3,-0.1;Owner: ]]..name..[[]
|
label[3,-0.1;Owner: ]]..name..[[]
|
||||||
@ -253,12 +253,22 @@ advschem.add_form("main", {
|
|||||||
button[0.5,7.5;3,1;save;Save size]
|
button[0.5,7.5;3,1;save;Save size]
|
||||||
]]..
|
]]..
|
||||||
border_button
|
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,
|
end,
|
||||||
handle = function(self, pos, name, fields)
|
handle = function(self, pos, name, fields)
|
||||||
local realmeta = minetest.get_meta(pos)
|
local realmeta = minetest.get_meta(pos)
|
||||||
local meta = realmeta:to_table().fields
|
local meta = realmeta:to_table().fields
|
||||||
local hashpos = minetest.hash_node_position(pos)
|
local hashpos = minetest.hash_node_position(pos)
|
||||||
|
|
||||||
|
if fields.doc then
|
||||||
|
doc.show_entry(name, "nodes", "advschem:creator", true)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-- Toggle border
|
-- Toggle border
|
||||||
if fields.border then
|
if fields.border then
|
||||||
if meta.schem_border == "true" and advschem.markers[hashpos] then
|
if meta.schem_border == "true" and advschem.markers[hashpos] then
|
||||||
|
Loading…
Reference in New Issue
Block a user