From 8974ac0c2dcacbbe65315e0767513b0c555c8d74 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Mon, 3 Dec 2018 17:05:00 +0100 Subject: [PATCH 1/6] Preparation to add some more monitors --- nodes.lua | 173 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 96 insertions(+), 77 deletions(-) diff --git a/nodes.lua b/nodes.lua index 059a67c..f3e2cc6 100644 --- a/nodes.lua +++ b/nodes.lua @@ -1,86 +1,105 @@ --[[ - digimons mod for Minetest - Digiline monitors using Display API / Font API - (c) Pierre-Yves Rollo + digimons mod for Minetest - Digilines monitors using Display API / Font API + (c) Pierre-Yves Rollo - This file is part of digimons. + This file is part of digimons. - signs is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + signs is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - signs is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + signs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with signs. If not, see . + You should have received a copy of the GNU General Public License + along with signs. If not, see . --]] -minetest.register_node('digimons:cathodic_amber_monitor', { - description = "Cathodic amber monitor", - sunlight_propagates = false, - paramtype = "light", - paramtype2 = "facedir", - tiles = { "digimons_amber_top.png", "digimons_amber_bottom.png", - "digimons_amber_sides.png", "digimons_amber_sides.png^[transformFX]", - "digimons_amber_back.png", "digimons_amber_front.png",}, - drawtype = "nodebox", - groups = {choppy = 1, oddly_breakable_by_hand = 1, display_modpack_node = 1}, - node_box = { - type = "fixed", - fixed = { - {-8/16, 8/16, -8/16, 8/16, 7/16, -7/16}, - {-8/16, -8/16, -8/16, 8/16, -5/16, -7/16}, - {-8/16, 7/16, -8/16, -7/16, -5/16, -7/16}, - {7/16, 7/16, -8/16, 8/16, -5/16, -7/16}, - {-8/16, -8/16, -7/16, 8/16, 8/16, 1/16}, - {-6/16, 5/16, 1/16, 6/16, -8/16, 8/16} - }, - }, - display_entities = { - ["digimons:screen"] = { - on_display_update = font_api.on_display_update, - depth = -7/16 - display_api.entity_spacing, - top = -1/16, - aspect_ratio = 0.5, maxlines = 6, - size = { x = 23/32, y = 10/16 }, - color = "#FFA000", font_name = "mozart", halign="left", valing="top", - }, - }, - on_place = function(itemstack, placer, pointed_thing) - minetest.rotate_node(itemstack, placer, pointed_thing) - return display_api.on_place(itemstack, placer, pointed_thing) - end, - on_construct = function(pos) - minetest.get_meta(pos):set_string("formspec", - "field[channel;Channel;${channel}]") - display_api.on_construct(pos) - end, - on_destruct = display_api.on_destruct, - on_rotate = display_api.on_rotate, - on_receive_fields = function(pos, formname, fields, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return - end +local common_node_def = { + groups = { display_api = 1}, + on_place = function(itemstack, placer, pointed_thing) + minetest.rotate_node(itemstack, placer, pointed_thing) + return display_api.on_place(itemstack, placer, pointed_thing) + end, + on_destruct = display_api.on_destruct, + on_rotate = display_api.on_rotate, + on_punch = display_api.update_entities, + on_construct = function(pos) + minetest.get_meta(pos):set_string("formspec", + "field[channel;Channel;${channel}]") + display_api.on_construct(pos) + end, + on_receive_fields = function(pos, formname, fields, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return + end - if (fields.channel) then - minetest.get_meta(pos):set_string("channel", fields.channel) - end - end, - on_punch = display_api.update_entities, - digiline = { - receptor = {}, - effector = { - action = function(pos, _, channel, msg) - if channel ~= minetest.get_meta(pos):get_string("channel") then - return - end - digimons.push_text_on_screen(pos, msg) - end, - }, - }, + if (fields.channel) then + minetest.get_meta(pos):set_string("channel", fields.channel) + end + end, + digiline = { + receptor = {}, + effector = { + action = function(pos, _, channel, msg) + if channel ~= minetest.get_meta(pos):get_string("channel") then + return + end + digimons.push_text_on_screen(pos, msg) + end, + }, + }, +} + +function digimons.register_monitor(nodename, nodedef) + def = table.copy(common_node_def) + for key, value in pairs(nodedef) do + if key == 'groups' then + def[key] = def[key] or {} + for key2, value2 in pairs(value) do + def[key][key2] = value2 + end + else + def[key] = value + end + end + minetest.register_node(nodename, nodedef) +end + +digimons.register_monitor('digimons:cathodic_amber_monitor', { + description = "Cathodic amber monitor", + sunlight_propagates = false, + paramtype = "light", + paramtype2 = "facedir", + tiles = { "digimons_amber_top.png", "digimons_amber_bottom.png", + "digimons_amber_sides.png", "digimons_amber_sides.png^[transformFX]", + "digimons_amber_back.png", "digimons_amber_front.png",}, + drawtype = "nodebox", + groups = {choppy = 1, oddly_breakable_by_hand = 1}, + node_box = { + type = "fixed", + fixed = { + {-8/16, 8/16, -8/16, 8/16, 7/16, -7/16}, + {-8/16, -8/16, -8/16, 8/16, -5/16, -7/16}, + {-8/16, 7/16, -8/16, -7/16, -5/16, -7/16}, + {7/16, 7/16, -8/16, 8/16, -5/16, -7/16}, + {-8/16, -8/16, -7/16, 8/16, 8/16, 1/16}, + {-6/16, 5/16, 1/16, 6/16, -8/16, 8/16} + }, + }, + display_entities = { + ["digimons:screen"] = { + on_display_update = font_api.on_display_update, + depth = -7/16 - display_api.entity_spacing, + top = -1/16, + aspect_ratio = 0.5, maxlines = 6, + size = { x = 23/32, y = 10/16 }, + color = "#FFA000", font_name = "mozart", halign="left", valing="top", + }, + }, }) From eaaac83b960146f43fcc89d80573c137d82e08bd Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Tue, 4 Dec 2018 07:52:45 +0100 Subject: [PATCH 2/6] Added green monitor textures --- ...2_13_19_29.0.svg => cathodic_monitors.svg} | 781 +++++++++++++++++- textures/digimons_amber_back.png | Bin 646 -> 642 bytes textures/digimons_amber_bottom.png | Bin 655 -> 666 bytes textures/digimons_amber_front.png | Bin 567 -> 571 bytes textures/digimons_amber_front_off.png | Bin 0 -> 572 bytes textures/digimons_amber_sides.png | Bin 639 -> 634 bytes textures/digimons_amber_top.png | Bin 592 -> 590 bytes textures/digimons_green_back.png | Bin 0 -> 615 bytes textures/digimons_green_bottom.png | Bin 0 -> 622 bytes textures/digimons_green_front.png | Bin 0 -> 567 bytes textures/digimons_green_front_off.png | Bin 0 -> 566 bytes textures/digimons_green_sides.png | Bin 0 -> 612 bytes textures/digimons_green_top.png | Bin 0 -> 576 bytes 13 files changed, 763 insertions(+), 18 deletions(-) rename svg/{Nouveau document 2.2018_12_02_13_19_29.0.svg => cathodic_monitors.svg} (53%) create mode 100644 textures/digimons_amber_front_off.png create mode 100644 textures/digimons_green_back.png create mode 100644 textures/digimons_green_bottom.png create mode 100644 textures/digimons_green_front.png create mode 100644 textures/digimons_green_front_off.png create mode 100644 textures/digimons_green_sides.png create mode 100644 textures/digimons_green_top.png diff --git a/svg/Nouveau document 2.2018_12_02_13_19_29.0.svg b/svg/cathodic_monitors.svg similarity index 53% rename from svg/Nouveau document 2.2018_12_02_13_19_29.0.svg rename to svg/cathodic_monitors.svg index 3bf5bff..4bb4634 100644 --- a/svg/Nouveau document 2.2018_12_02_13_19_29.0.svg +++ b/svg/cathodic_monitors.svg @@ -15,7 +15,7 @@ viewBox="0 0 16 16" version="1.1" id="SVGRoot" - sodipodi:docname="Nouveau document 2.2018_12_02_13_19_29.0.svg" + sodipodi:docname="cathodic_monitors.svg" inkscape:version="0.92.3 (2405546, 2018-03-11)" inkscape:export-filename="/home/pyrollo/dev/minetest-mods/digimons/textures/digimons_amber_front.png" inkscape:export-xdpi="96" @@ -28,16 +28,16 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="16" - inkscape:cx="16.839668" - inkscape:cy="12.551387" + inkscape:cx="16.902168" + inkscape:cy="1.1659253" inkscape:document-units="px" inkscape:current-layer="g1617" showgrid="true" - inkscape:window-width="2172" - inkscape:window-height="902" - inkscape:window-x="69" - inkscape:window-y="432" - inkscape:window-maximized="0" + inkscape:window-width="2560" + inkscape:window-height="1376" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" inkscape:grid-bbox="true"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -230,7 +410,7 @@ image/svg+xml - + @@ -251,7 +431,7 @@ inkscape:export-xdpi="96" inkscape:export-ydpi="96" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/textures/digimons_amber_back.png b/textures/digimons_amber_back.png index 80524e3bb64c70c5427c39799ef3e3d2d45e2701..07fb8b6e46f55c615dca25ebf0e0909e427248fb 100644 GIT binary patch delta 544 zcmV+*0^j|H1%d^TZGQp(Nkl`7F!rZXm-hX_(S_(;+8D>UAu+}Dc zI0yhFQB{mFIF5t0Ciz1A>+gT@aL)6@%>iijE}V-wClP^YZsXvi4?n=n$jBh>GS$K` zGJ=+W zNLtPF^E2cA_J88OnUOg#-_5#(S2gZVcT?T0D%M)B1W6lLld;EjHy)0I%-kkc6{~8y z+=ZFr8O*hqYhq@&IcpVF3xM-FcY`qo0wk#3YCN~1h#(@Ud-EN?_6UNAAl)6z8M%{i zcg&3U-v1bY%%rRM^Y>qIhuiIjB)XgHyl^l)95W{}S%2##b4P0Cb-ip6bFRA*F>ZsF zNPu}=T-OPf$k=A64%BK&3PW=49u6_ia^~Lzz8Z6RiV1cDzb{FrzhMTopVyv z*szPdQPteB8r(4Gl{vhstOrNL;!G{_tjvGv25xllQl(!%0}HVRk9Mg>4v74gkH5* z4ip~_EaHOj`1lG~MOnqyfB!}lwrzuMs*3YCQ4rLwCV%E+1QGM%(wyhyT9J9qYm;Vd zgX&&3&huOW5}~@d-ERE%^&cW8GXg;v+jxeUF)vPyas>#QPk(;l^XI>=><8w~i`xrC zgvz43Igf*?CL$I@QAJcSbr7EK!px{lLs-0C3hM)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png new file mode 100644 index 0000000000000000000000000000000000000000..bbc37719541729ea64021a4476b02a94a7dded95 GIT binary patch literal 572 zcmV-C0>k}@P)lP3Nu3z5rLV}d(u>j2lpODv_^}dO+iE>S|h^o2*MqA2QvVWs4AYlctZ0v>2B+T z@wi10EylS87J;vTl29ho)M%10H{2Xnkh@{wLW`_j~2t}KwX)j4tQFBp| zn8z5ef!P3H``-43YVQ7rwwVQ40Js_EHe7mG0vaOz!XA&3AobUr!|~+5M1*5sE?)Je z_sC2#3wP(_#%?M=Du=(!*0000< KMNUMnLSTYtGWE#- literal 0 HcmV?d00001 diff --git a/textures/digimons_amber_sides.png b/textures/digimons_amber_sides.png index a883b0367c85ae629f6ba39dfc8029193bc36978..ec70f6c723bdd55d9e776d6cf3e67989ad25ee17 100644 GIT binary patch delta 535 zcmV+y0_gq!1o{M!Zh!YlL_t(IjeU}< zH{cz(27`f+;E@D{K%8^--|K?tpY4VgZF*I8t*Vkge*gOV=U;!@habF4BXHhh4$PG9 z=A)0lGTw5$tF5Zc=Oi=9Ow5h70+E6HcpG*Ts48woMj#>#cYn-`=-@aOk@^1w-HnLg zC-CX%iSE7)%rW`-yEnZ5-aEKE-Nl?2?(QyR7HV#cv1L}(CNo2I?=K>#DrQF0bT<(} zL_jwV%~}Vs7VZx00duFjS!)pys4CS>RgrnnUAQ^Ajzv}D!@S_)sbfbHmIqwNni@MKqY%?tz)#l2BDdgjI{GI*kPozWwnR zV3TweU%YybgP^8cwkgMP?1H#+90v~%51c4oeD(=r?0B01<)vxtjb#X7cLAGrB0ci*+WT+YJKxBR<{wHgq73|_zd^fYu=`g*|<$ICw2Kn)a?=Qdq@uz+C@rQr_jR0c|%#`lt%dfsR z-gCUVttxHKNoJCnm^%@H>cD-xkGlt`D(*%`AR-KR%#7&fIDZxq`TqmD8$>X7+>G=2 zOn2V^b56ed_8Xo&`GDb0cQNOQySo#ag_;?232B6qWCW^8b(2+O7Tt}TqiZd?8XwM_6E~--czk?hjKQ1}5xH$M z$3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{zB6TLUq$!%xqLw+%xO&YuTOe$v@Twb!xixqgwy~002ovPDHLkV1oYJ B6AS8$k?(KdIF-wpSFJv6O+xKtZILF1s1@pWi^P{_2K~?eYSgm}H z%gamT>FIa2*2qk1HMZL=?vA@tiZa!SQVOj#L={z~wMGIFBP>ZuQF0u8x7IK-LfX5eu;xGYo!$ z#K6oFM0n%(?%!3%;NJHmj{%i*_n=d!s=remhr{8bs?%;vz`ifbLZ-0I@i^&jA_CiF zCK17$#pv#Q{On0)CQA;+5UIh)L8g$B450`j0sz~z&GVLLOr zU=nB0HrXQ8R0N?Qc8JEf%@~&ufmubjF-^NkB^4qyAwU;N<_EcE1wrN8Z+`#)002ovPDHLk FV1j7F_N@Q_ literal 0 HcmV?d00001 diff --git a/textures/digimons_green_front_off.png b/textures/digimons_green_front_off.png new file mode 100644 index 0000000000000000000000000000000000000000..063aa4b589160c9a5e45d2420c08157c2f23da47 GIT binary patch literal 566 zcmV-60?GY}P)@na`Gm5lGtvyyR7PHHDG`+V45Z(97!z8pt~_M zBoPsq8DkXL-SPC+f-7yRRA-bDaFJF`HPMG6vL^!bpN5(1` zNoL?4xUB*$(Opbal9Dht+#K74*5^b7nXAa%lM^1?yAQzE@89@&altel;Ss^@O(Y1l zXm6yZTeJ!5rm7Bo|2RMA&AYdMv@l=JX^+xY_wX7U9@#w;N-Os4A)& zcjx%{4pntHn*Dx{`+8WCFf$^8qoav5Unzh7_=&38Zerd0-aboWjDaLhPapF5#UnmE zf6roIXJ5|7JTH+E%=3cKHaerb=oan)h%ss_UPujsUmbAr{x9qzXsw~DggYWaH$zqNDzoNRmGfh z_oIX1g6R{G zGw}0$jIjfgi^Bz(xlD`*++*z*jz~kznA87S!98%F0GzfXW`_0N&p$=vGO#x?5;a40 z#k^)XE22PEKYL*Gz6#S?LqwQ4$qdXsODH@)KLU%SGP%FM$3SRJmTYZo+qMc~#d1-FbR?q6%7DcfWq!V`i(i yhr?bN3PH#!s*)K62)%cH{P?*Wy53I56Mp~+|23!;j?IJs0000AxFx%2dwXS!4QTfJPF3UXG=-V1vu?~3cjx8h2LQ_PxDU*f?j|y*E>x9> z;C{Q4nYbIO#=cL^|2~8J{Z51tF_|+^Rj#)ynTd$t?nESzRMnZ_B$#uu@2e65?tZic zRfUKgi3Ug4-wDiY1=6@0>q_H3_*&#M*?$CxFe9KrMWCB~-+|`%Wca|$z9l#be!agV zBIn?~#wXoD@il?GzWxmNVYl0jZQBqL=A3NXMt5_$TzGhRKt#CwxzIFEPft`PGXfV8 zB35s=+l}r%-&IM-EUFSUMRiGC-KYwlSwt+^08|wb;d;H&-S`+}u9iLtBLY*UTF^Ns zYKFTXvlKD{Hv^iCKusBA5D|1YW=3Sv)p)}i+M)N-xEW(0s>_vCv@T&68K}xC402ld z@$qq8u43CZEEAa=GgxPt$(%vAVCFb1q>Lakk%I_XM45FuFSE{tGIO?V;J-gUsH)Q- zV+`h8+o-DNE|@v0^3RRB6!GWh=d7wz9y^9N=RB*AF%Fdk4wH*2?#5qRoJN5bzOfnr O0000 Date: Tue, 4 Dec 2018 08:01:07 +0100 Subject: [PATCH 3/6] Add green monitor --- nodes.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/nodes.lua b/nodes.lua index f3e2cc6..710f4bf 100644 --- a/nodes.lua +++ b/nodes.lua @@ -103,3 +103,36 @@ digimons.register_monitor('digimons:cathodic_amber_monitor', { }, }, }) + +digimons.register_monitor('digimons:cathodic_green_monitor', { + description = "Cathodic green monitor", + sunlight_propagates = false, + paramtype = "light", + paramtype2 = "facedir", + tiles = { "digimons_green_top.png", "digimons_green_bottom.png", + "digimons_green_sides.png", "digimons_green_sides.png^[transformFX]", + "digimons_green_back.png", "digimons_green_front.png",}, + drawtype = "nodebox", + groups = {choppy = 1, oddly_breakable_by_hand = 1}, + node_box = { + type = "fixed", + fixed = { + {-8/16, 8/16, -8/16, 8/16, 7/16, -7/16}, + {-8/16, -8/16, -8/16, 8/16, -5/16, -7/16}, + {-8/16, 7/16, -8/16, -7/16, -5/16, -7/16}, + {7/16, 7/16, -8/16, 8/16, -5/16, -7/16}, + {-8/16, -8/16, -7/16, 8/16, 8/16, 1/16}, + {-6/16, 5/16, 1/16, 6/16, -8/16, 8/16} + }, + }, + display_entities = { + ["digimons:screen"] = { + on_display_update = font_api.on_display_update, + depth = -7/16 - display_api.entity_spacing, + top = -1/16, + aspect_ratio = 0.5, maxlines = 6, + size = { x = 23/32, y = 10/16 }, + color = "#00FF00", font_name = "mozart", halign="left", valing="top", + }, + }, +}) From 50ecf5be9291b89b2de2d259a096a25fa00abfd3 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Tue, 4 Dec 2018 10:11:50 +0100 Subject: [PATCH 4/6] Fixed monitor definition --- nodes.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodes.lua b/nodes.lua index 710f4bf..7533670 100644 --- a/nodes.lua +++ b/nodes.lua @@ -68,7 +68,7 @@ function digimons.register_monitor(nodename, nodedef) def[key] = value end end - minetest.register_node(nodename, nodedef) + minetest.register_node(nodename, def) end digimons.register_monitor('digimons:cathodic_amber_monitor', { From 06e131841926e405485b5b2519e33169f556c9e7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Tue, 4 Dec 2018 18:03:34 +0100 Subject: [PATCH 5/6] Use new font_api columns attribute --- functions.lua | 2 +- init.lua | 1 + nodes.lua | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/functions.lua b/functions.lua index 801c74b..3c1a955 100644 --- a/functions.lua +++ b/functions.lua @@ -60,7 +60,7 @@ local function push_text(lines, text, maxlines, maxcolumns) function digimons.push_text_on_screen(pos, text) local lines = get_lines(pos) - push_text(lines, text, 6, 20) + push_text(lines, text, 6, digimons.columns) set_lines(pos, lines) display_api.update_entities(pos) end diff --git a/init.lua b/init.lua index 4a408ab..e966d1e 100644 --- a/init.lua +++ b/init.lua @@ -21,6 +21,7 @@ digimons = {} digimons.name = minetest.get_current_modname() digimons.path = minetest.get_modpath(digimons.name) +digimons.font = "mozart" dofile(digimons.path.."/font_mozart.lua") dofile(digimons.path.."/functions.lua") diff --git a/nodes.lua b/nodes.lua index 7533670..90dbf82 100644 --- a/nodes.lua +++ b/nodes.lua @@ -97,9 +97,9 @@ digimons.register_monitor('digimons:cathodic_amber_monitor', { on_display_update = font_api.on_display_update, depth = -7/16 - display_api.entity_spacing, top = -1/16, - aspect_ratio = 0.5, maxlines = 6, size = { x = 23/32, y = 10/16 }, - color = "#FFA000", font_name = "mozart", halign="left", valing="top", + columns = 30, maxlines = 6, + color = "#FFA000", font_name = digimons.font, halign="left", valing="top", }, }, }) @@ -130,9 +130,9 @@ digimons.register_monitor('digimons:cathodic_green_monitor', { on_display_update = font_api.on_display_update, depth = -7/16 - display_api.entity_spacing, top = -1/16, - aspect_ratio = 0.5, maxlines = 6, size = { x = 23/32, y = 10/16 }, - color = "#00FF00", font_name = "mozart", halign="left", valing="top", + columns = 30, lines = 6, + color = "#00FF00", font_name = digimons.font, halign="left", valing="top", }, }, }) From 827d912af8533c4334f39a6b9f276cc9dbb62c56 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Sat, 8 Dec 2018 16:01:34 +0100 Subject: [PATCH 6/6] Renamed digimons to digiterms --- README.md | 4 +- functions.lua | 10 ++--- init.lua | 22 +++++------ nodes.lua | 36 +++++++++--------- ...mber_back.png => digiterms_amber_back.png} | Bin ..._bottom.png => digiterms_amber_bottom.png} | Bin ...er_front.png => digiterms_amber_front.png} | Bin ..._off.png => digiterms_amber_front_off.png} | Bin ...er_sides.png => digiterms_amber_sides.png} | Bin ..._amber_top.png => digiterms_amber_top.png} | Bin ...reen_back.png => digiterms_green_back.png} | Bin ..._bottom.png => digiterms_green_bottom.png} | Bin ...en_front.png => digiterms_green_front.png} | Bin ..._off.png => digiterms_green_front_off.png} | Bin ...en_sides.png => digiterms_green_sides.png} | Bin ..._green_top.png => digiterms_green_top.png} | Bin 16 files changed, 36 insertions(+), 36 deletions(-) rename textures/{digimons_amber_back.png => digiterms_amber_back.png} (100%) rename textures/{digimons_amber_bottom.png => digiterms_amber_bottom.png} (100%) rename textures/{digimons_amber_front.png => digiterms_amber_front.png} (100%) rename textures/{digimons_amber_front_off.png => digiterms_amber_front_off.png} (100%) rename textures/{digimons_amber_sides.png => digiterms_amber_sides.png} (100%) rename textures/{digimons_amber_top.png => digiterms_amber_top.png} (100%) rename textures/{digimons_green_back.png => digiterms_green_back.png} (100%) rename textures/{digimons_green_bottom.png => digiterms_green_bottom.png} (100%) rename textures/{digimons_green_front.png => digiterms_green_front.png} (100%) rename textures/{digimons_green_front_off.png => digiterms_green_front_off.png} (100%) rename textures/{digimons_green_sides.png => digiterms_green_sides.png} (100%) rename textures/{digimons_green_top.png => digiterms_green_top.png} (100%) diff --git a/README.md b/README.md index 5791805..1e7231a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Digimons - Digilines Monitors -Digilines monitors mod for Minetest using Display API / Font API. +# Digiterms - Digilines Terminals +Digilines monitors and keyboards mod for Minetest using Display API / Font API. **Version**: Alpha diff --git a/functions.lua b/functions.lua index 3c1a955..bf73c8f 100644 --- a/functions.lua +++ b/functions.lua @@ -1,8 +1,8 @@ --[[ - digimons mod for Minetest - Digiline monitors using Display API / Font API + digiterms mod for Minetest - Digiline monitors using Display API / Font API (c) Pierre-Yves Rollo - This file is part of digimons. + This file is part of digiterms. signs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ along with signs. If not, see . --]] -digimons.columns = 30 +digiterms.columns = 30 local function get_lines(pos) local lines = {} @@ -58,9 +58,9 @@ local function push_text(lines, text, maxlines, maxcolumns) until (pos > (#text + 1)) end -function digimons.push_text_on_screen(pos, text) +function digiterms.push_text_on_screen(pos, text) local lines = get_lines(pos) - push_text(lines, text, 6, digimons.columns) + push_text(lines, text, 6, digiterms.columns) set_lines(pos, lines) display_api.update_entities(pos) end diff --git a/init.lua b/init.lua index e966d1e..1d16ddc 100644 --- a/init.lua +++ b/init.lua @@ -1,8 +1,8 @@ --[[ - digimons mod for Minetest - Digiline monitors using Display API / Font API + digiterms mod for Minetest - Digiline monitors using Display API / Font API (c) Pierre-Yves Rollo - This file is part of digimons. + This file is part of digiterms. signs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,14 +18,14 @@ along with signs. If not, see . --]] -digimons = {} -digimons.name = minetest.get_current_modname() -digimons.path = minetest.get_modpath(digimons.name) -digimons.font = "mozart" +digiterms = {} +digiterms.name = minetest.get_current_modname() +digiterms.path = minetest.get_modpath(digiterms.name) +digiterms.font = "mozart" -dofile(digimons.path.."/font_mozart.lua") -dofile(digimons.path.."/functions.lua") -dofile(digimons.path.."/nodes.lua") ---dofile(digimons.path.."/crafts.lua") +dofile(digiterms.path.."/font_mozart.lua") +dofile(digiterms.path.."/functions.lua") +dofile(digiterms.path.."/nodes.lua") +--dofile(digiterms.path.."/crafts.lua") -display_api.register_display_entity("digimons:screen") +display_api.register_display_entity("digiterms:screen") diff --git a/nodes.lua b/nodes.lua index 90dbf82..08793c1 100644 --- a/nodes.lua +++ b/nodes.lua @@ -1,8 +1,8 @@ --[[ - digimons mod for Minetest - Digilines monitors using Display API / Font API + digiterms mod for Minetest - Digilines monitors using Display API / Font API (c) Pierre-Yves Rollo - This file is part of digimons. + This file is part of digiterms. signs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -50,13 +50,13 @@ local common_node_def = { if channel ~= minetest.get_meta(pos):get_string("channel") then return end - digimons.push_text_on_screen(pos, msg) + digiterms.push_text_on_screen(pos, msg) end, }, }, } -function digimons.register_monitor(nodename, nodedef) +function digiterms.register_monitor(nodename, nodedef) def = table.copy(common_node_def) for key, value in pairs(nodedef) do if key == 'groups' then @@ -71,14 +71,14 @@ function digimons.register_monitor(nodename, nodedef) minetest.register_node(nodename, def) end -digimons.register_monitor('digimons:cathodic_amber_monitor', { +digiterms.register_monitor('digiterms:cathodic_amber_monitor', { description = "Cathodic amber monitor", sunlight_propagates = false, paramtype = "light", paramtype2 = "facedir", - tiles = { "digimons_amber_top.png", "digimons_amber_bottom.png", - "digimons_amber_sides.png", "digimons_amber_sides.png^[transformFX]", - "digimons_amber_back.png", "digimons_amber_front.png",}, + tiles = { "digiterms_amber_top.png", "digiterms_amber_bottom.png", + "digiterms_amber_sides.png", "digiterms_amber_sides.png^[transformFX]", + "digiterms_amber_back.png", "digiterms_amber_front.png",}, drawtype = "nodebox", groups = {choppy = 1, oddly_breakable_by_hand = 1}, node_box = { @@ -93,25 +93,25 @@ digimons.register_monitor('digimons:cathodic_amber_monitor', { }, }, display_entities = { - ["digimons:screen"] = { + ["digiterms:screen"] = { on_display_update = font_api.on_display_update, depth = -7/16 - display_api.entity_spacing, top = -1/16, size = { x = 23/32, y = 10/16 }, - columns = 30, maxlines = 6, - color = "#FFA000", font_name = digimons.font, halign="left", valing="top", + columns = 20, lines = 6, + color = "#FFA000", font_name = digiterms.font, halign="left", valing="top", }, }, }) -digimons.register_monitor('digimons:cathodic_green_monitor', { +digiterms.register_monitor('digiterms:cathodic_green_monitor', { description = "Cathodic green monitor", sunlight_propagates = false, paramtype = "light", paramtype2 = "facedir", - tiles = { "digimons_green_top.png", "digimons_green_bottom.png", - "digimons_green_sides.png", "digimons_green_sides.png^[transformFX]", - "digimons_green_back.png", "digimons_green_front.png",}, + tiles = { "digiterms_green_top.png", "digiterms_green_bottom.png", + "digiterms_green_sides.png", "digiterms_green_sides.png^[transformFX]", + "digiterms_green_back.png", "digiterms_green_front.png",}, drawtype = "nodebox", groups = {choppy = 1, oddly_breakable_by_hand = 1}, node_box = { @@ -126,13 +126,13 @@ digimons.register_monitor('digimons:cathodic_green_monitor', { }, }, display_entities = { - ["digimons:screen"] = { + ["digiterms:screen"] = { on_display_update = font_api.on_display_update, depth = -7/16 - display_api.entity_spacing, top = -1/16, size = { x = 23/32, y = 10/16 }, - columns = 30, lines = 6, - color = "#00FF00", font_name = digimons.font, halign="left", valing="top", + columns = 20, lines = 6, + color = "#00FF00", font_name = digiterms.font, halign="left", valing="top", }, }, }) diff --git a/textures/digimons_amber_back.png b/textures/digiterms_amber_back.png similarity index 100% rename from textures/digimons_amber_back.png rename to textures/digiterms_amber_back.png diff --git a/textures/digimons_amber_bottom.png b/textures/digiterms_amber_bottom.png similarity index 100% rename from textures/digimons_amber_bottom.png rename to textures/digiterms_amber_bottom.png diff --git a/textures/digimons_amber_front.png b/textures/digiterms_amber_front.png similarity index 100% rename from textures/digimons_amber_front.png rename to textures/digiterms_amber_front.png diff --git a/textures/digimons_amber_front_off.png b/textures/digiterms_amber_front_off.png similarity index 100% rename from textures/digimons_amber_front_off.png rename to textures/digiterms_amber_front_off.png diff --git a/textures/digimons_amber_sides.png b/textures/digiterms_amber_sides.png similarity index 100% rename from textures/digimons_amber_sides.png rename to textures/digiterms_amber_sides.png diff --git a/textures/digimons_amber_top.png b/textures/digiterms_amber_top.png similarity index 100% rename from textures/digimons_amber_top.png rename to textures/digiterms_amber_top.png diff --git a/textures/digimons_green_back.png b/textures/digiterms_green_back.png similarity index 100% rename from textures/digimons_green_back.png rename to textures/digiterms_green_back.png diff --git a/textures/digimons_green_bottom.png b/textures/digiterms_green_bottom.png similarity index 100% rename from textures/digimons_green_bottom.png rename to textures/digiterms_green_bottom.png diff --git a/textures/digimons_green_front.png b/textures/digiterms_green_front.png similarity index 100% rename from textures/digimons_green_front.png rename to textures/digiterms_green_front.png diff --git a/textures/digimons_green_front_off.png b/textures/digiterms_green_front_off.png similarity index 100% rename from textures/digimons_green_front_off.png rename to textures/digiterms_green_front_off.png diff --git a/textures/digimons_green_sides.png b/textures/digiterms_green_sides.png similarity index 100% rename from textures/digimons_green_sides.png rename to textures/digiterms_green_sides.png diff --git a/textures/digimons_green_top.png b/textures/digiterms_green_top.png similarity index 100% rename from textures/digimons_green_top.png rename to textures/digiterms_green_top.png