Add item descriptions

This commit is contained in:
Wuzzy 2016-08-07 19:36:31 +02:00
parent fe06e55991
commit 20c2d44400
2 changed files with 29 additions and 0 deletions

View File

@ -1,4 +1,5 @@
intllib?
doc_items?
technic?
default?
mana?

View File

@ -185,4 +185,32 @@ if(minetest.get_modpath("default") ~= nil and minetest.get_modpath("technic") ~=
})
end
if(minetest.get_modpath("doc_items") ~= nil) then
local base = S("Point teleporters are short-range teleportation devices which allow the user to teleport instantly towards a block they point at.")
local inf = S("Infinite point teleporters are very powerful, they can be used without limits.")
local mana = string.format(S("Magical point teleporters are fueled by mana and require %d mana per teleportation."), teletool.settings.cost_mana)
local technic = S("Electronic point teleporters run on electricity and must be charged initially. Fully charged, they can be used about 50 times.")
local baseuse = S("To use this tool, point to the face of a block and punch to teleport in front of it. The target location must have a minimum amount of space for you to stand in, otherwise, teleportation will fail.")
local technicuse = S("To recharge this tool, place it in a powered battery box.")
local manause = string.format(S("First make sure you have at least %d mana."), teletool.settings.cost_mana)
local desc_inf = base .. "\n" .. inf
local desc_mana = base .. "\n" .. mana
local desc_technic = base .. "\n" .. technic
local use_inf = baseuse
local use_mana = manause .. " " .. baseuse
local use_technic = technicuse .. " " .. baseuse
doc.sub.items.set_items_longdesc({
["teletool:teletool_infinite"] = desc_inf,
["teletool:teletool_mana"] = desc_mana,
["teletool:teletool_technic"] = desc_technic,
})
doc.sub.items.set_items_usagehelp({
["teletool:teletool_infinite"] = use_inf,
["teletool:teletool_mana"] = use_mana,
["teletool:teletool_technic"] = use_technic,
})
end
minetest.register_alias("teletool:teletool", "teletool:teletool_infinite")