add documentation

This commit is contained in:
FaceDeer 2020-02-02 17:53:19 -07:00
parent d797adb812
commit 325ed769df
3 changed files with 73 additions and 3 deletions

View File

@ -9,6 +9,14 @@ local automatic = minetest.settings:get_bool("death_compass_automatic", false)
local range_to_inactivate = 5
local documentation = S("This does nothing in its current inert form. If you have this in your inventory when you die, however, it will follow you into your next life's inventory and point toward the location of your previous life's end.")
local durationdesc
if duration > 0 then
durationdesc = S("The Death Compass' guidance will only last for @1 seconds.", duration)
else
durationdesc = S("The Death Compass will point toward your previous corpse until you find it.")
end
-- set a position to the compass stack
function set_target(stack, pos, name)
local meta=stack:get_meta()
@ -124,7 +132,7 @@ end)
for i = 0, 15 do
local image = "death_compass_16_"..i..".png"
local groups = {death_compass = 1, not_in_creative_inventory = 1}
minetest.register_tool("death_compass:dir"..i, {
minetest.register_craftitem("death_compass:dir"..i, {
description = S("Death Compass"),
inventory_image = image,
wield_image = image,
@ -134,12 +142,21 @@ for i = 0, 15 do
end
if not automatic then
minetest.register_tool("death_compass:inactive", {
description = S("Inactive Death Compass"),
local display_doc = function(itemstack, user)
local player_name = user:get_player_name()
minetest.chat_send_player(player_name, documentation .. "\n" .. durationdesc)
end
minetest.register_craftitem("death_compass:inactive", {
description = S("Death Compass"),
_doc_items_longdesc = documentation,
_doc_items_usagehelp = durationdesc,
inventory_image = "death_compass_inactive.png",
wield_image = "death_compass_inactive.png",
stack_max = 1,
groups = {death_compass = 1},
on_place = display_doc,
on_secondary_use = display_doc,
})
minetest.register_craft({

47
locale/template.pot Normal file
View File

@ -0,0 +1,47 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-02 17:50-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: death_compass\init.lua:12
msgid ""
"This does nothing in its current inert form. If you have this in your "
"inventory when you die, however, it will follow you into your next life's "
"inventory and point toward the location of your previous life's end."
msgstr ""
#: death_compass\init.lua:15
msgid "The Death Compass' guidance will only last for @1 seconds."
msgstr ""
#: death_compass\init.lua:17
msgid ""
"The Death Compass will point toward your previous corpse until you find it."
msgstr ""
#: death_compass\init.lua:96
msgid "@1m to @2's corpse, @3s remaining"
msgstr ""
#: death_compass\init.lua:99
msgid "@1m to @2's corpse, died @3s ago"
msgstr ""
#: death_compass\init.lua:136
#: death_compass\init.lua:151
msgid "Death Compass"
msgstr ""

6
locale/update.bat Normal file
View File

@ -0,0 +1,6 @@
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
cd ..
set LIST=
for /r %%X in (*.lua) do set LIST=!LIST! %%X
..\intllib\tools\xgettext.bat %LIST%