From ad99186f3cfb80578bc01bf59ed19b4861809b61 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sat, 25 Feb 2017 21:17:23 -0700 Subject: [PATCH] add documentation --- depends.txt | 1 + init.lua | 8 ++++++++ locale/template.pot | 30 +++++++++++++++++++++++++----- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/depends.txt b/depends.txt index 9dd7d9b..3e4cdce 100644 --- a/depends.txt +++ b/depends.txt @@ -1,3 +1,4 @@ default intllib? hopper? +doc? \ No newline at end of file diff --git a/init.lua b/init.lua index a390f54..b365cf2 100644 --- a/init.lua +++ b/init.lua @@ -4,8 +4,16 @@ local S, NS = dofile(MP.."/intllib.lua") minetest.register_alias("castle:workbench", "crafting_bench:workbench") +local usage_help = S("The inventory on the left is for raw materials, the inventory on the right holds finished products. The crafting grid in the center defines what recipe this workbench will make use of; place raw materials into it in the crafting pattern corresponding to what you want to build.") + +if minetest.get_modpath("hopper") and hopper ~= nil and hopper.add_container ~= nil then + usage_help = usage_help .. "\n\n" .. S("This workbench is compatible with hoppers. Hoppers will insert into the raw material inventory and remove items from the finished goods inventory.") +end + minetest.register_node("crafting_bench:workbench",{ description = S("Workbench"), + _doc_items_longdesc = S("A workbench that does work for you. Set a crafting recipe and provide raw materials and items will magically craft themselves once every five seconds."), + _doc_items_usagehelp = usage_help, tiles = { "crafting_bench_workbench_top.png", "crafting_bench_workbench_bottom.png", diff --git a/locale/template.pot b/locale/template.pot index 4c87ae1..4dc3633 100644 --- a/locale/template.pot +++ b/locale/template.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-25 19:50-0700\n" +"POT-Creation-Date: 2017-02-25 21:16-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,18 +16,38 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: init.lua:8 +#: init.lua:7 +msgid "" +"The inventory on the left is for raw materials, the inventory on the right " +"holds finished products. The crafting grid in the center defines what recipe " +"this workbench will make use of; place raw materials into it in the crafting " +"pattern corresponding to what you want to build." +msgstr "" + +#: init.lua:10 +msgid "" +"This workbench is compatible with hoppers. Hoppers will insert into the raw " +"material inventory and remove items from the finished goods inventory." +msgstr "" + +#: init.lua:14 msgid "Workbench" msgstr "" -#: init.lua:48 +#: init.lua:15 +msgid "" +"A workbench that does work for you. Set a crafting recipe and provide raw " +"materials and items will magically craft themselves once every five seconds." +msgstr "" + +#: init.lua:56 msgid "@1 moves stuff in workbench at @2" msgstr "" -#: init.lua:51 +#: init.lua:59 msgid "@1 moves stuff to workbench at @2" msgstr "" -#: init.lua:54 +#: init.lua:62 msgid "@1 takes stuff from workbench at @2" msgstr ""