From 8c3efd3c2828dae25ed46aa1e48d1494a11cb519 Mon Sep 17 00:00:00 2001 From: bas080 Date: Tue, 23 Jul 2013 02:46:18 +0200 Subject: [PATCH] Added digiboard, digilines keyboard which uses channel keyboard --- digiboard/depends.txt | 2 ++ digiboard/init.lua | 42 +++++++++++++++++++++++++ digiboard/textures/keyboard_bottom.png | Bin 0 -> 218 bytes digiboard/textures/keyboard_side.png | Bin 0 -> 209 bytes digiboard/textures/keyboard_top.png | Bin 0 -> 251 bytes 5 files changed, 44 insertions(+) create mode 100644 digiboard/depends.txt create mode 100644 digiboard/init.lua create mode 100644 digiboard/textures/keyboard_bottom.png create mode 100644 digiboard/textures/keyboard_side.png create mode 100644 digiboard/textures/keyboard_top.png diff --git a/digiboard/depends.txt b/digiboard/depends.txt new file mode 100644 index 0000000..2cec86e --- /dev/null +++ b/digiboard/depends.txt @@ -0,0 +1,2 @@ +default +digilines diff --git a/digiboard/init.lua b/digiboard/init.lua new file mode 100644 index 0000000..c996ff6 --- /dev/null +++ b/digiboard/init.lua @@ -0,0 +1,42 @@ +--Digiboard by bas080 +minetest.register_node("digiboard:keyboard", { + description = "Digilines Keyboard", + tiles = {"keyboard_top.png", "keyboard_bottom.png", "keyboard_side.png", "keyboard_side.png", "keyboard_side.png", "keyboard_side.png"}, + walkable = true, + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-4/8, -4/8, 0, 4/8, -3/8, 4/8}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-4/8, -4/8, 0, 4/8, -3/8, 4/8}, + }, + }, + digiline = { receptor = {}, + effector = { + action = function(pos, node, channel, msg) + end + }, + }, + groups = {choppy = 3, dig_immediate = 2}, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + meta:set_string("formspec", "field[text;;]") + meta:set_string("infotext", "Keyboard") + meta:set_int("lines", 0) + end, + on_receive_fields = function(pos, formname, fields, sender) + local meta = minetest.env:get_meta(pos) + local text = fields.text + local channel = "keyboard" + if text ~= nil then + digiline:receptor_send(pos, digiline.rules.default, channel, text) + end + end, +}) diff --git a/digiboard/textures/keyboard_bottom.png b/digiboard/textures/keyboard_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..47155a581a4ea6e81cac5c6cf4dbda4cd63bff8c GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnH3?%tPCZz)@&H$efR|bZ3A0MBzv@|8wJ?nvj zj3q&S!3+-1Zlr-YN#5=*3>~bp9w6lf9+AZi4BWyX%*Zfnjs#GUy~NYkmHjTeID@Ld zi+k6e0EHw=Tq8=H^K)}k^GX<;i&7IyQd1PlGfOfQ+&z5*!W;R-fr?Z;T^vIsE+=!e zGPSJ`pIWV367o;LdzVG7hML!PC{xWt~$(698O~ BI4l4F literal 0 HcmV?d00001 diff --git a/digiboard/textures/keyboard_side.png b/digiboard/textures/keyboard_side.png new file mode 100644 index 0000000000000000000000000000000000000000..c5183f4fe667ef14e76775f72612a4a3647999fb GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYU7SJH+9gSU2~a4`)5S3);_%z+8+i{na4&Hj$*IQ7P`+H}eV&ZM=ITY}YkF^AE(m|C{fkq?!37A8 w&6)gP+=V5zGV~zBoY1fL+4g;uHu5iEd}1VVWsZbl9MC2PPgg&ebxsLQ099B*NB{r; literal 0 HcmV?d00001 diff --git a/digiboard/textures/keyboard_top.png b/digiboard/textures/keyboard_top.png new file mode 100644 index 0000000000000000000000000000000000000000..3e20f9cc1573e06234f20702cc9d36c6fd76def2 GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnH3?%tPCZz)@o&cW^*HqnfA0MBzw6yyA`uk>@ zAaTZ$AirP+hi5m^K%69RcNc~ZR#^`qhqJ&VvY3H^TNs2H8D`Cq01C2~c>21s-(?qP zP>~a>J+%lZBw6AbQR1ARo12*a3)z4*}Q$iB}J6}h0 literal 0 HcmV?d00001