German manual added

master
Joachim Stolberg 2020-10-21 19:26:03 +02:00
parent 62a5ed049d
commit 94c764da50
7 changed files with 144 additions and 31 deletions

View File

@ -526,6 +526,10 @@ minetest.register_craft({
},
})
dofile(minetest.get_modpath("ta4_jetpack") .. "/manual.lua")
techage.add_manual_items({ta4_jetpack = "ta4_jetpack.png"})
dofile(minetest.get_modpath("ta4_jetpack") .. "/manual_DE.lua")
dofile(minetest.get_modpath("ta4_jetpack") .. "/manual_EN.lua")
techage.add_manual_items({
ta4_jetpack = "ta4_jetpack.png",
ta4_jetpack_controller = 'ta4_jetpack_controller_inv.png'})

View File

@ -1,29 +1,32 @@
techage.add_to_manual('EN', {
techage.add_to_manual('DE', {
"1,TA4 Jetpack",
"2,Instructions",
"2,Important to know",
"2,Anleitung",
"2,Was du wissen solltest",
}, {
"The Jetpack is inspired by the jetpack from spirit689 (https://github.com/spirit689/jetpack)\n"..
"and by the historical game Lunar Lander.\n"..
"Das Jetpack ist inspiriert vom Jetpack von spirit689 (https://github.com/spirit689/jetpack) und durch das historische Spiel Lunar Lander.\n"..
"\n"..
"\n"..
"\n",
" - Craft TA4 Jetpack\\, Jetpack Controller and Training Mat\n"..
" - Use the armor extension (3d_armor) of the player menu to strap the Jetpack on your back\n"..
" - You can refuel the jetpack by left-clicking with the controller on a hydrogen tank\n"..
" - Turn the controller on by right-click and check the fuel tank level (the small colored bar below the controller icon)\n"..
" - Use the space bar to activate the Jetpack and the WASD keys to control the direction\n"..
" - Before your first flight you should do some training starts and landings on the Training Mat \n(The Jetpack is a bit stubborn\\, it takes some practice to keep the JetPack in the air)\n"..
" - TA4 Jetpack\\, Jetpack Controller und Trainingsmatte herstellen (craften)\n"..
" - Verwende die '3d_armor' Erweiterung des Spielermenüs\\, um das Jetpack auf deinem Rücken zu schnallen\n"..
" - Du kannst das Jetpack auftanken\\, indem du mit dem Controller und mit der linken Maustaste auf einen Wasserstofftanks klickst\n"..
" - Schalte den Controller mit der rechten Maustaste ein und überprüfe den Füllstand des Kraftstofftanks (der kleine farbige Balken unter dem Reglersymbol).\n"..
" - Verwende die Leertaste\\, um das Jetpack zu aktivieren und die WASD-Tasten\\, um die Richtung zu steuern\n"..
" - Vor dem ersten Flug solltest du einige Trainingsstarts und Landungen auf der Trainingsmatte durchführen\n (Das Jetpack ist etwas eigensinnig\\, es erfordert etwas Übung\\, das JetPack in der Luft zu halten.)\n"..
"\n"..
"\n"..
"\n",
" - 12 units of hydrogen are sufficient for a flight of 6 minutes\n"..
" - Maximum 5 items stacks in your inventory are allowed including the controller.\nOtherwise you would be too heavy :-)\n"..
" - The Jetpack also wears out and can be used for approximately 10 flights\n"..
" - Always hold the controller tight during the flight\\, otherwise it will switch off :)\n"..
" - 12 Einheiten Wasserstoff reichen für einen Flug von 6 Minuten\n"..
" - Maximal 5 Stapel von Gegenständen im Spieler-Inventar sind zulässig\\, einschließlich des Controllers\n(Sonst wärst du zu schwer :-)\n"..
" - Das Jetpack nutzt sich ab und kann für ca. 10 Flüge verwendet werden\n"..
" - Halte den Controller während des Fluges immer fest\\, sonst schaltet er sich aus :)\n"..
"\n"..
"\n"..
"\n",
}, {
"ta4_jetpack",
"",
"",
"ta4_jetpack_controller",
"ta4_jetpack_controller",
}, {
"",
"",

34
manual_DE.lua Normal file
View File

@ -0,0 +1,34 @@
techage.add_to_manual('DE', {
"1,TA4 Jetpack",
"2,Anleitung",
"2,Was du wissen solltest",
}, {
"Das Jetpack ist inspiriert vom Jetpack von spirit689 (https://github.com/spirit689/jetpack) und durch das historische Spiel Lunar Lander.\n"..
"\n"..
"\n"..
"\n",
" - TA4 Jetpack\\, Jetpack Controller und Trainingsmatte herstellen (craften)\n"..
" - Verwende die '3d_armor' Erweiterung des Spielermenüs\\, um das Jetpack auf deinem Rücken zu schnallen\n"..
" - Du kannst das Jetpack auftanken\\, indem du mit dem Controller und mit der linken Maustaste auf einen Wasserstofftanks klickst\n"..
" - Schalte den Controller mit der rechten Maustaste ein und überprüfe den Füllstand des Kraftstofftanks (der kleine farbige Balken unter dem Reglersymbol).\n"..
" - Verwende die Leertaste\\, um das Jetpack zu aktivieren und die WASD-Tasten\\, um die Richtung zu steuern\n"..
" - Vor dem ersten Flug solltest du einige Trainingsstarts und Landungen auf der Trainingsmatte durchführen\n (Das Jetpack ist etwas eigensinnig\\, es erfordert etwas Übung\\, das JetPack in der Luft zu halten.)\n"..
"\n"..
"\n"..
"\n",
" - 12 Einheiten Wasserstoff reichen für einen Flug von 6 Minuten\n"..
" - Maximal 5 Stapel von Gegenständen im Spieler-Inventar sind zulässig\\, einschließlich des Controllers\n(Sonst wärst du zu schwer :-)\n"..
" - Das Jetpack nutzt sich ab und kann für ca. 10 Flüge verwendet werden\n"..
" - Halte den Controller während des Fluges immer fest\\, sonst schaltet er sich aus :)\n"..
"\n"..
"\n"..
"\n",
}, {
"ta4_jetpack",
"ta4_jetpack_controller",
"ta4_jetpack_controller",
}, {
"",
"",
"",
})

29
manual_DE.md Normal file
View File

@ -0,0 +1,29 @@
# TA4 Jetpack
Das Jetpack ist inspiriert vom Jetpack von spirit689 (https://github.com/spirit689/jetpack) und durch das historische Spiel Lunar Lander.
[ta4_jetpack|image]
## Anleitung
- TA4 Jetpack, Jetpack Controller und Trainingsmatte herstellen (craften)
- Verwende die '3d_armor' Erweiterung des Spielermenüs, um das Jetpack auf deinem Rücken zu schnallen
- Du kannst das Jetpack auftanken, indem du mit dem Controller und mit der linken Maustaste auf einen Wasserstofftanks klickst
- Schalte den Controller mit der rechten Maustaste ein und überprüfe den Füllstand des Kraftstofftanks (der kleine farbige Balken unter dem Reglersymbol).
- Verwende die Leertaste, um das Jetpack zu aktivieren und die WASD-Tasten, um die Richtung zu steuern
- Vor dem ersten Flug solltest du einige Trainingsstarts und Landungen auf der Trainingsmatte durchführen
(Das Jetpack ist etwas eigensinnig, es erfordert etwas Übung, das JetPack in der Luft zu halten.)
[ta4_jetpack_controller|image]
## Was du wissen solltest
- 12 Einheiten Wasserstoff reichen für einen Flug von 6 Minuten
- Maximal 5 Stapel von Gegenständen im Spieler-Inventar sind zulässig, einschließlich des Controllers
(Sonst wärst du zu schwer :-)
- Das Jetpack nutzt sich ab und kann für ca. 10 Flüge verwendet werden
- Halte den Controller während des Fluges immer fest, sonst schaltet er sich aus :)
[ta4_jetpack_controller|image]

35
manual_EN.lua Normal file
View File

@ -0,0 +1,35 @@
techage.add_to_manual('EN', {
"1,TA4 Jetpack",
"2,Instructions",
"2,Important to know",
}, {
"The Jetpack is inspired by the jetpack from spirit689 (https://github.com/spirit689/jetpack)\n"..
"and by the historical game Lunar Lander.\n"..
"\n"..
"\n"..
"\n",
" - Craft TA4 Jetpack\\, Jetpack Controller and Training Mat\n"..
" - Use the armor extension (3d_armor) of the player menu to strap the Jetpack on your back\n"..
" - You can refuel the jetpack by left-clicking with the controller on a hydrogen tank\n"..
" - Turn the controller on by right-click and check the fuel tank level (the small colored bar below the controller icon)\n"..
" - Use the space bar to activate the Jetpack and the WASD keys to control the direction\n"..
" - Before your first flight you should do some training starts and landings on the Training Mat \n(The Jetpack is a bit stubborn\\, it takes some practice to keep the JetPack in the air)\n"..
"\n"..
"\n"..
"\n",
" - 12 units of hydrogen are sufficient for a flight of 6 minutes\n"..
" - Maximum 5 items stacks in your inventory are allowed including the controller.\nOtherwise you would be too heavy :-)\n"..
" - The Jetpack also wears out and can be used for approximately 10 flights\n"..
" - Always hold the controller tight during the flight\\, otherwise it will switch off :)\n"..
"\n"..
"\n"..
"\n",
}, {
"ta4_jetpack",
"ta4_jetpack_controller",
"ta4_jetpack_controller",
}, {
"",
"",
"",
})

View File

@ -16,6 +16,8 @@ and by the historical game Lunar Lander.
- Before your first flight you should do some training starts and landings on the Training Mat
(The Jetpack is a bit stubborn, it takes some practice to keep the JetPack in the air)
[ta4_jetpack_controller|image]
## Important to know
@ -25,3 +27,4 @@ and by the historical game Lunar Lander.
- The Jetpack also wears out and can be used for approximately 10 flights
- Always hold the controller tight during the flight, otherwise it will switch off :)
[ta4_jetpack_controller|image]

View File

@ -1,9 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import re
import mistune
import mistune # install v0.8.4 with: pip install mistune
__version__ = "1.0"
class WikiLinkInlineLexer(mistune.InlineLexer):
def enable_wiki_link(self):
@ -27,10 +28,8 @@ class WikiLinkInlineLexer(mistune.InlineLexer):
return self.renderer.wiki_link(name, itype)
class MarkdownToLua(mistune.Renderer):
def __init__(self, mod_name, dst_file_name, *args, **kwargs):
def __init__(self, *args, **kwargs):
mistune.Renderer.__init__(self, *args, **kwargs)
self.mod_name = mod_name
self.dst_file_name = dst_file_name
self.item_name = ""
self.plan_table = ""
self.is_first_header = True
@ -39,6 +38,7 @@ class MarkdownToLua(mistune.Renderer):
self.lText = []
self.lItemName = []
self.lPlanTable = []
print("Markdown-to-Lua v%s" % __version__)
def m2l_formspec_escape(self, text):
text = text.replace("\\", "")
@ -147,7 +147,7 @@ class MarkdownToLua(mistune.Renderer):
pass
def parse_md_file(self, src_name):
print("Read Lua file '%s'" % src_name)
print(" - Read MD file '%s'" % src_name)
inline = WikiLinkInlineLexer(self)
# enable the feature
inline.enable_wiki_link()
@ -178,17 +178,22 @@ class MarkdownToLua(mistune.Renderer):
lOut.append("}")
return "\n".join(lOut)
def gen_lua_file(self, dest_name):
print("Write Lua file '%s'" % dest_name)
def gen_lua_file(self, dest_name, language="EN"):
print(" - Write Lua file '%s'" % dest_name)
lOut = []
s = ", ".join([self.lua_table(self.lTitle),
self.lua_text_table(self.lText),
self.lua_table(self.lItemName),
self.lua_table(self.lPlanTable)])
open(dest_name, "w").write("techage.add_to_manual('EN', %s)\n" % s)
open(dest_name, "w").write("techage.add_to_manual('%s', %s)\n" % (language, s))
print("done.")
m2l = MarkdownToLua("ta4_jetpack", "manual")
m2l.parse_md_file("./manual.md")
m2l.gen_lua_file("./manual.lua")
m2l = MarkdownToLua()
m2l.parse_md_file("./manual_EN.md")
m2l.gen_lua_file("./manual_EN.lua", "EN")
m2l = MarkdownToLua()
m2l.parse_md_file("./manual_DE.md")
m2l.gen_lua_file("./manual_DE.lua", "DE")