forked from mtcontrib/minetest_returnmirror
Add item documentation
This commit is contained in:
parent
2a772701f0
commit
cfb8c262ab
|
@ -1 +1,2 @@
|
||||||
mana?
|
mana?
|
||||||
|
doc_items?
|
||||||
|
|
20
init.lua
20
init.lua
|
@ -110,3 +110,23 @@ minetest.register_tool("returnmirror:mirror_active", {
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias("returnmirror:mirror_inactive", "returnmirror:returnmirror")
|
minetest.register_alias("returnmirror:mirror_inactive", "returnmirror:returnmirror")
|
||||||
|
|
||||||
|
if minetest.get_modpath("doc_items") ~= nil then
|
||||||
|
local longdesc, usagehelp
|
||||||
|
usagehelp = "Rightclick to set the mirror's teleport location. Leftclick to immediately teleport back to the mirror's teleport location."
|
||||||
|
if minetest.get_modpath("mana") ~= nil then
|
||||||
|
longdesc ="This item allows to teleport the user back to a previously set location, at the cost of mana."
|
||||||
|
usagehelp = usagehelp .. " " .. string.format("Setting the teleport location costs %d mana, teleporting costs %d mana.", returnmirror.cost_set, returnmirror.cost_teleport)
|
||||||
|
else
|
||||||
|
longdesc = "This item allows to teleport its user back to a previously set location."
|
||||||
|
end
|
||||||
|
|
||||||
|
doc.sub.items.set_items_longdesc({
|
||||||
|
["returnmirror:mirror_inactive"] = longdesc,
|
||||||
|
})
|
||||||
|
doc.sub.items.set_items_usagehelp({
|
||||||
|
["returnmirror:mirror_inactive"] = usagehelp
|
||||||
|
})
|
||||||
|
|
||||||
|
doc.add_entry_alias("tools", "returnmirror:mirror_inactive", "returnmirror:mirror_active")
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue