Merge devs into master (green mon, rename)
@ -1,5 +1,5 @@
|
|||||||
# Digimons - Digilines Monitors
|
# Digiterms - Digilines Terminals
|
||||||
Digilines monitors mod for Minetest using Display API / Font API.
|
Digilines monitors and keyboards mod for Minetest using Display API / Font API.
|
||||||
|
|
||||||
**Version**: Alpha
|
**Version**: Alpha
|
||||||
|
|
||||||
|
@ -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
|
(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
|
signs is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -18,7 +18,7 @@
|
|||||||
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
digimons.columns = 30
|
digiterms.columns = 30
|
||||||
|
|
||||||
local function get_lines(pos)
|
local function get_lines(pos)
|
||||||
local lines = {}
|
local lines = {}
|
||||||
@ -73,9 +73,9 @@ local function push_text(lines, text, maxlines, maxcolumns)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function digimons.push_text_on_screen(pos, text)
|
function digiterms.push_text_on_screen(pos, text)
|
||||||
local lines = get_lines(pos)
|
local lines = get_lines(pos)
|
||||||
push_text(lines, text, 6, 20)
|
push_text(lines, text, 6, digiterms.columns)
|
||||||
set_lines(pos, lines)
|
set_lines(pos, lines)
|
||||||
display_api.update_entities(pos)
|
display_api.update_entities(pos)
|
||||||
end
|
end
|
||||||
|
21
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
|
(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
|
signs is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -18,13 +18,14 @@
|
|||||||
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
digimons = {}
|
digiterms = {}
|
||||||
digimons.name = minetest.get_current_modname()
|
digiterms.name = minetest.get_current_modname()
|
||||||
digimons.path = minetest.get_modpath(digimons.name)
|
digiterms.path = minetest.get_modpath(digiterms.name)
|
||||||
|
digiterms.font = "mozart"
|
||||||
|
|
||||||
dofile(digimons.path.."/font_mozart.lua")
|
dofile(digiterms.path.."/font_mozart.lua")
|
||||||
dofile(digimons.path.."/functions.lua")
|
dofile(digiterms.path.."/functions.lua")
|
||||||
dofile(digimons.path.."/nodes.lua")
|
dofile(digiterms.path.."/nodes.lua")
|
||||||
--dofile(digimons.path.."/crafts.lua")
|
--dofile(digiterms.path.."/crafts.lua")
|
||||||
|
|
||||||
display_api.register_display_entity("digimons:screen")
|
display_api.register_display_entity("digiterms:screen")
|
||||||
|
206
nodes.lua
@ -1,86 +1,138 @@
|
|||||||
--[[
|
--[[
|
||||||
digimons mod for Minetest - Digiline monitors using Display API / Font API
|
digiterms mod for Minetest - Digilines monitors using Display API / Font API
|
||||||
(c) Pierre-Yves Rollo
|
(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
|
signs is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
signs is distributed in the hope that it will be useful,
|
signs is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
minetest.register_node('digimons:cathodic_amber_monitor', {
|
local common_node_def = {
|
||||||
description = "Cathodic amber monitor",
|
groups = { display_api = 1},
|
||||||
sunlight_propagates = false,
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
paramtype = "light",
|
minetest.rotate_node(itemstack, placer, pointed_thing)
|
||||||
paramtype2 = "facedir",
|
return display_api.on_place(itemstack, placer, pointed_thing)
|
||||||
tiles = { "digimons_amber_top.png", "digimons_amber_bottom.png",
|
end,
|
||||||
"digimons_amber_sides.png", "digimons_amber_sides.png^[transformFX]",
|
on_destruct = display_api.on_destruct,
|
||||||
"digimons_amber_back.png", "digimons_amber_front.png",},
|
on_rotate = display_api.on_rotate,
|
||||||
drawtype = "nodebox",
|
on_punch = display_api.update_entities,
|
||||||
groups = {choppy = 1, oddly_breakable_by_hand = 1, display_modpack_node = 1},
|
on_construct = function(pos)
|
||||||
node_box = {
|
minetest.get_meta(pos):set_string("formspec",
|
||||||
type = "fixed",
|
"field[channel;Channel;${channel}]")
|
||||||
fixed = {
|
display_api.on_construct(pos)
|
||||||
{-8/16, 8/16, -8/16, 8/16, 7/16, -7/16},
|
end,
|
||||||
{-8/16, -8/16, -8/16, 8/16, -5/16, -7/16},
|
on_receive_fields = function(pos, formname, fields, player)
|
||||||
{-8/16, 7/16, -8/16, -7/16, -5/16, -7/16},
|
local name = player:get_player_name()
|
||||||
{7/16, 7/16, -8/16, 8/16, -5/16, -7/16},
|
if minetest.is_protected(pos, name) then
|
||||||
{-8/16, -8/16, -7/16, 8/16, 8/16, 1/16},
|
minetest.record_protection_violation(pos, name)
|
||||||
{-6/16, 5/16, 1/16, 6/16, -8/16, 8/16}
|
return
|
||||||
},
|
end
|
||||||
},
|
|
||||||
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
|
|
||||||
|
|
||||||
if (fields.channel) then
|
if (fields.channel) then
|
||||||
minetest.get_meta(pos):set_string("channel", fields.channel)
|
minetest.get_meta(pos):set_string("channel", fields.channel)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_punch = display_api.update_entities,
|
digiline = {
|
||||||
digiline = {
|
receptor = {},
|
||||||
receptor = {},
|
effector = {
|
||||||
effector = {
|
action = function(pos, _, channel, msg)
|
||||||
action = function(pos, _, channel, msg)
|
if channel ~= minetest.get_meta(pos):get_string("channel") then
|
||||||
if channel ~= minetest.get_meta(pos):get_string("channel") then
|
return
|
||||||
return
|
end
|
||||||
end
|
digiterms.push_text_on_screen(pos, msg)
|
||||||
digimons.push_text_on_screen(pos, msg)
|
end,
|
||||||
end,
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
|
|
||||||
|
function digiterms.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, def)
|
||||||
|
end
|
||||||
|
|
||||||
|
digiterms.register_monitor('digiterms:cathodic_amber_monitor', {
|
||||||
|
description = "Cathodic amber monitor",
|
||||||
|
sunlight_propagates = false,
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
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 = {
|
||||||
|
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 = {
|
||||||
|
["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 = 20, lines = 6,
|
||||||
|
color = "#FFA000", font_name = digiterms.font, halign="left", valing="top",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
digiterms.register_monitor('digiterms:cathodic_green_monitor', {
|
||||||
|
description = "Cathodic green monitor",
|
||||||
|
sunlight_propagates = false,
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
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 = {
|
||||||
|
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 = {
|
||||||
|
["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 = 20, lines = 6,
|
||||||
|
color = "#00FF00", font_name = digiterms.font, halign="left", valing="top",
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
Before Width: | Height: | Size: 859 KiB After Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 646 B |
Before Width: | Height: | Size: 655 B |
Before Width: | Height: | Size: 567 B |
Before Width: | Height: | Size: 639 B |
Before Width: | Height: | Size: 592 B |
BIN
textures/digiterms_amber_back.png
Normal file
After Width: | Height: | Size: 642 B |
BIN
textures/digiterms_amber_bottom.png
Normal file
After Width: | Height: | Size: 666 B |
BIN
textures/digiterms_amber_front.png
Normal file
After Width: | Height: | Size: 571 B |
BIN
textures/digiterms_amber_front_off.png
Normal file
After Width: | Height: | Size: 572 B |
BIN
textures/digiterms_amber_sides.png
Normal file
After Width: | Height: | Size: 634 B |
BIN
textures/digiterms_amber_top.png
Normal file
After Width: | Height: | Size: 590 B |
BIN
textures/digiterms_green_back.png
Normal file
After Width: | Height: | Size: 615 B |
BIN
textures/digiterms_green_bottom.png
Normal file
After Width: | Height: | Size: 622 B |
BIN
textures/digiterms_green_front.png
Normal file
After Width: | Height: | Size: 567 B |
BIN
textures/digiterms_green_front_off.png
Normal file
After Width: | Height: | Size: 566 B |
BIN
textures/digiterms_green_sides.png
Normal file
After Width: | Height: | Size: 612 B |
BIN
textures/digiterms_green_top.png
Normal file
After Width: | Height: | Size: 576 B |