diff --git a/computers.lua b/computers.lua index daec43f..ab20053 100644 --- a/computers.lua +++ b/computers.lua @@ -78,3 +78,19 @@ computer.register("computer:specter", { { 18, 0, 18, 12, 6, 14 }, -- Tape Player }); }); + +-- Nintendo Wii lookalike. +computer.register("computer:wee", { + description = "Nientiendo Wee"; + tiles_off = { front=true; }; + node_box = computer.pixelnodebox(32, { + -- X Y Z W H L + { 11, 0, 3, 10, 6, 26 }, -- Base + { 12, 6, 4, 8, 22, 24 }, -- Top + }); +}); + +-- Apple iPad lookalike. +computer.register_handheld("computer:piepad", { + description = "Snapple Piepad"; +}); diff --git a/init.lua b/init.lua index 6ad201c..f66f144 100644 --- a/init.lua +++ b/init.lua @@ -62,6 +62,21 @@ computer.register = function ( name, def ) }); end +computer.register_handheld = function ( name, def ) + local nodename = name; + if (name:sub(1, 1) == ":") then name = name:sub(2); end + local modname, basename = name:match("^([^:]+):(.*)"); + local TEXPFX = modname.."_"..basename.."_inv"; + local ONSTATE = modname..":"..basename; + local OFFSTATE = modname..":"..basename.."_off"; + local on_use = def.on_use; + minetest.register_craftitem(ONSTATE, { + description = def.description; + inventory_image = TEXPFX..".png"; + wield_image = TEXPFX..".png"; + }); +end + computer.pixelnodebox = function ( size, boxes ) local fixed = { }; local i, box; diff --git a/textures/computer_piepad_inv.png b/textures/computer_piepad_inv.png new file mode 100644 index 0000000..21d956a Binary files /dev/null and b/textures/computer_piepad_inv.png differ diff --git a/textures/computer_piepad_inv_off.png b/textures/computer_piepad_inv_off.png new file mode 100644 index 0000000..f261b3d Binary files /dev/null and b/textures/computer_piepad_inv_off.png differ diff --git a/textures/computer_slaystation2_bk.png b/textures/computer_slaystation2_bk.png new file mode 100644 index 0000000..a7af9b8 Binary files /dev/null and b/textures/computer_slaystation2_bk.png differ diff --git a/textures/computer_slaystation2_bt.png b/textures/computer_slaystation2_bt.png new file mode 100644 index 0000000..bac0f75 Binary files /dev/null and b/textures/computer_slaystation2_bt.png differ diff --git a/textures/computer_slaystation2_ft.png b/textures/computer_slaystation2_ft.png new file mode 100644 index 0000000..364059a Binary files /dev/null and b/textures/computer_slaystation2_ft.png differ diff --git a/textures/computer_slaystation2_ft_off.png b/textures/computer_slaystation2_ft_off.png new file mode 100644 index 0000000..6d06d57 Binary files /dev/null and b/textures/computer_slaystation2_ft_off.png differ diff --git a/textures/computer_slaystation2_lt.png b/textures/computer_slaystation2_lt.png new file mode 100644 index 0000000..5fe035b Binary files /dev/null and b/textures/computer_slaystation2_lt.png differ diff --git a/textures/computer_slaystation2_rt.png b/textures/computer_slaystation2_rt.png new file mode 100644 index 0000000..c0958c8 Binary files /dev/null and b/textures/computer_slaystation2_rt.png differ diff --git a/textures/computer_slaystation2_tp.png b/textures/computer_slaystation2_tp.png new file mode 100644 index 0000000..273ed87 Binary files /dev/null and b/textures/computer_slaystation2_tp.png differ diff --git a/textures/computer_slaystation_bk.png b/textures/computer_slaystation_bk.png new file mode 100644 index 0000000..d3da3bf Binary files /dev/null and b/textures/computer_slaystation_bk.png differ diff --git a/textures/computer_slaystation_bt.png b/textures/computer_slaystation_bt.png new file mode 100644 index 0000000..0bd1a46 Binary files /dev/null and b/textures/computer_slaystation_bt.png differ diff --git a/textures/computer_slaystation_ft.png b/textures/computer_slaystation_ft.png new file mode 100644 index 0000000..0354106 Binary files /dev/null and b/textures/computer_slaystation_ft.png differ diff --git a/textures/computer_slaystation_lt.png b/textures/computer_slaystation_lt.png new file mode 100644 index 0000000..ed698ae Binary files /dev/null and b/textures/computer_slaystation_lt.png differ diff --git a/textures/computer_slaystation_rt.png b/textures/computer_slaystation_rt.png new file mode 100644 index 0000000..06b40cc Binary files /dev/null and b/textures/computer_slaystation_rt.png differ diff --git a/textures/computer_slaystation_tp.png b/textures/computer_slaystation_tp.png new file mode 100644 index 0000000..eace288 Binary files /dev/null and b/textures/computer_slaystation_tp.png differ diff --git a/textures/computer_slaystation_tp_off.png b/textures/computer_slaystation_tp_off.png new file mode 100644 index 0000000..6fa3b7e Binary files /dev/null and b/textures/computer_slaystation_tp_off.png differ diff --git a/textures/computer_specter_bk.png b/textures/computer_specter_bk.png new file mode 100644 index 0000000..503a2e3 Binary files /dev/null and b/textures/computer_specter_bk.png differ diff --git a/textures/computer_specter_bt.png b/textures/computer_specter_bt.png new file mode 100644 index 0000000..c33a0b3 Binary files /dev/null and b/textures/computer_specter_bt.png differ diff --git a/textures/computer_specter_ft.png b/textures/computer_specter_ft.png new file mode 100644 index 0000000..c4ca02e Binary files /dev/null and b/textures/computer_specter_ft.png differ diff --git a/textures/computer_specter_lt.png b/textures/computer_specter_lt.png new file mode 100644 index 0000000..73b8d4d Binary files /dev/null and b/textures/computer_specter_lt.png differ diff --git a/textures/computer_specter_rt.png b/textures/computer_specter_rt.png new file mode 100644 index 0000000..50996af Binary files /dev/null and b/textures/computer_specter_rt.png differ diff --git a/textures/computer_specter_tp.png b/textures/computer_specter_tp.png new file mode 100644 index 0000000..0d5a92d Binary files /dev/null and b/textures/computer_specter_tp.png differ diff --git a/textures/computer_wee_bk.png b/textures/computer_wee_bk.png new file mode 100644 index 0000000..78bca44 Binary files /dev/null and b/textures/computer_wee_bk.png differ diff --git a/textures/computer_wee_bt.png b/textures/computer_wee_bt.png new file mode 100644 index 0000000..19f80ee Binary files /dev/null and b/textures/computer_wee_bt.png differ diff --git a/textures/computer_wee_ft.png b/textures/computer_wee_ft.png new file mode 100644 index 0000000..ca58d7e Binary files /dev/null and b/textures/computer_wee_ft.png differ diff --git a/textures/computer_wee_ft_off.png b/textures/computer_wee_ft_off.png new file mode 100644 index 0000000..4d50cc0 Binary files /dev/null and b/textures/computer_wee_ft_off.png differ diff --git a/textures/computer_wee_lt.png b/textures/computer_wee_lt.png new file mode 100644 index 0000000..5715763 Binary files /dev/null and b/textures/computer_wee_lt.png differ diff --git a/textures/computer_wee_rt.png b/textures/computer_wee_rt.png new file mode 100644 index 0000000..5715763 Binary files /dev/null and b/textures/computer_wee_rt.png differ diff --git a/textures/computer_wee_tp.png b/textures/computer_wee_tp.png new file mode 100644 index 0000000..ae658fc Binary files /dev/null and b/textures/computer_wee_tp.png differ