diff --git a/doc/manual_ta4_DE.lua b/doc/manual_ta4_DE.lua index 8c9e495..a6a831b 100644 --- a/doc/manual_ta4_DE.lua +++ b/doc/manual_ta4_DE.lua @@ -392,12 +392,16 @@ return { "\n", "Das Display zeigt nach dem Platzieren seine Nummer an. Über diese Nummer kann das Display angesprochen werden. Auf dem Display können Texte ausgegeben werden\\, wobei das Display 5 Zeilen und damit 5 unterschiedliche Texte darstellen kann.\n".. "\n".. + "Textzeilen werden immer linksbündig ausgegeben. Soll der Text horizontal zentriert ausgerichtet werden\\, muss dem Text das Zeichen „t“ (Tabulator) vorangestellt werden.\n".. + "\n".. "Das Display wird maximal ein mal pro Sekunde aktualisiert.\n".. "\n".. "\n".. "\n", "Das TA4 Display XL hat die doppelte Größ wie das TA4 Display.\n".. "\n".. + "Textzeilen werden immer linksbündig ausgegeben. Soll der Text horizontal zentriert ausgerichtet werden\\, muss dem Text das Zeichen „t“ (Tabulator) vorangestellt werden.\n".. + "\n".. "Das Display wird maximal alle zwei Sekunden aktualisiert.\n".. "\n".. "\n".. diff --git a/doc/manual_ta4_EN.lua b/doc/manual_ta4_EN.lua index 725f8e6..89dc252 100644 --- a/doc/manual_ta4_EN.lua +++ b/doc/manual_ta4_EN.lua @@ -390,12 +390,16 @@ return { "\n", "The display shows its number after placement. The display can be addressed via this number. Texts can be output on the display\\, whereby the display can display 5 lines and thus 5 different texts.\n".. "\n".. + "Lines of text are always left-aligned. If the text is to be centered horizontally\\, the text must be preceded by the character \"t\" (tabulator).\n".. + "\n".. "The display is updated at most once per second.\n".. "\n".. "\n".. "\n", "The TA4 Display XL is twice the size of the TA4 display.\n".. "\n".. + "Lines of text are always left-aligned. If the text is to be centered horizontally\\, the text must be preceded by the character \"t\" (tabulator).\n".. + "\n".. "The display is updated every two seconds at most.\n".. "\n".. "\n".. diff --git a/init.lua b/init.lua index 17f3b88..2cb60d6 100644 --- a/init.lua +++ b/init.lua @@ -30,8 +30,8 @@ elseif minetest.global_exists("tubelib2") and tubelib2.version < 2.2 then elseif minetest.global_exists("minecart") and minecart.version < 2.04 then minetest.log("error", "[techage] Techage requires minecart version 2.04 or newer!") return -elseif minetest.global_exists("lcdlib") and lcdlib.version < 1.01 then - minetest.log("error", "[techage] Techage requires lcdlib version 1.01 or newer!") +elseif minetest.global_exists("lcdlib") and lcdlib.version < 1.02 then + minetest.log("error", "[techage] Techage requires lcdlib version 1.02 or newer!") return elseif minetest.global_exists("safer_lua") and safer_lua.version < 1.01 then minetest.log("error", "[techage] Techage requires safer_lua version 1.01 or newer!") diff --git a/lua_controller/commands.lua b/lua_controller/commands.lua index dfe48f3..ea2fb46 100644 --- a/lua_controller/commands.lua +++ b/lua_controller/commands.lua @@ -137,10 +137,9 @@ techage.lua_ctlr.register_action("display", { row = tonumber(row or 1) or 1 text = tostring(text or "") if not_protected(self.meta.owner, num) then - if text:byte(1) ~= 32 then -- left aligned? - text = "<"..text -- use the '<' lcdlib control char for left-aligned - else - text = text:sub(2) -- delete blank for centered + if text:byte(1) == 32 then -- left aligned? + -- use the '\t' lcdlib control char for left-aligned + text = "\t" .. text:sub(2) end if row == 0 then -- add line? techage.send_single(self.meta.number, num, "add", text) @@ -161,6 +160,29 @@ techage.lua_ctlr.register_action("display", { }) +techage.lua_ctlr.register_action("display2", { + cmnd = function(self, num, row, text) + num = tostring(num or "") + row = tonumber(row or 1) or 1 + text = tostring(text or "") + if not_protected(self.meta.owner, num) then + if row == 0 then -- add line? + techage.send_single(self.meta.number, num, "add", text) + else + local payload = safer_lua.Store() + payload.set("row", row) + payload.set("str", text) + techage.send_single(self.meta.number, num, "set", payload) + end + end + end, + help = " $display2(num, row, text)\n".. + " Alternative 'display' function with different\n".. + " control char. If the first char of the string\n".. + " is a '\t', the text will be horizontally centered." + +}) + techage.lua_ctlr.register_action("clear_screen", { cmnd = function(self, num) num = tostring(num or "") diff --git a/manuals/manual_ta4_DE.md b/manuals/manual_ta4_DE.md index 91c3e4e..fafb67e 100644 --- a/manuals/manual_ta4_DE.md +++ b/manuals/manual_ta4_DE.md @@ -412,6 +412,8 @@ Die Batterie muss in unmittelbarer Nähe zum Controller platziert werden, also a Das Display zeigt nach dem Platzieren seine Nummer an. Über diese Nummer kann das Display angesprochen werden. Auf dem Display können Texte ausgegeben werden, wobei das Display 5 Zeilen und damit 5 unterschiedliche Texte darstellen kann. +Textzeilen werden immer linksbündig ausgegeben. Soll der Text horizontal zentriert ausgerichtet werden, muss dem Text das Zeichen „\t“ (Tabulator) vorangestellt werden. + Das Display wird maximal ein mal pro Sekunde aktualisiert. [ta4_display|image] @@ -420,6 +422,8 @@ Das Display wird maximal ein mal pro Sekunde aktualisiert. Das TA4 Display XL hat die doppelte Größ wie das TA4 Display. +Textzeilen werden immer linksbündig ausgegeben. Soll der Text horizontal zentriert ausgerichtet werden, muss dem Text das Zeichen „\t“ (Tabulator) vorangestellt werden. + Das Display wird maximal alle zwei Sekunden aktualisiert. [ta4_displayXL|image] diff --git a/manuals/manual_ta4_EN.md b/manuals/manual_ta4_EN.md index 0be2aaf..f06ff11 100644 --- a/manuals/manual_ta4_EN.md +++ b/manuals/manual_ta4_EN.md @@ -403,6 +403,8 @@ The battery must be placed in close proximity to the controller, i.e. in one of The display shows its number after placement. The display can be addressed via this number. Texts can be output on the display, whereby the display can display 5 lines and thus 5 different texts. +Lines of text are always left-aligned. If the text is to be centered horizontally, the text must be preceded by the character "\t" (tabulator). + The display is updated at most once per second. [ta4_display|image] @@ -411,6 +413,8 @@ The display is updated at most once per second. The TA4 Display XL is twice the size of the TA4 display. +Lines of text are always left-aligned. If the text is to be centered horizontally, the text must be preceded by the character "\t" (tabulator). + The display is updated every two seconds at most. [ta4_displayXL|image] diff --git a/move_controller/movecontroller.lua b/move_controller/movecontroller.lua index a9a4baa..4aa2b6e 100644 --- a/move_controller/movecontroller.lua +++ b/move_controller/movecontroller.lua @@ -119,6 +119,7 @@ minetest.register_node("techage:ta4_movecontroller", { meta:set_string("status", S("Recording...")) local name = player:get_player_name() minetest.chat_send_player(name, S("Click on all blocks that shall be moved")) + mark.unmark_all(name) mark.start(name, MAX_BLOCKS) meta:set_string("formspec", formspec(nvm, meta)) elseif fields.done then diff --git a/ta4_power/laser.lua b/ta4_power/laser.lua index ad1eb73..f8acb13 100644 --- a/ta4_power/laser.lua +++ b/ta4_power/laser.lua @@ -91,6 +91,7 @@ minetest.register_node("techage:ta4_laser_emitter", { end, paramtype2 = "facedir", + on_rotate = screwdriver.disallow, groups = {choppy=2, cracky=2, crumbly=2}, is_ground_content = false, sounds = default.node_sound_wood_defaults(), @@ -121,6 +122,7 @@ minetest.register_node("techage:ta4_laser_receiver", { end, paramtype2 = "facedir", + on_rotate = screwdriver.disallow, groups = {choppy=2, cracky=2, crumbly=2}, is_ground_content = false, sounds = default.node_sound_wood_defaults(),