Merge 76601aaeac
into e0e0305836
This commit is contained in:
commit
51e0983db4
|
@ -36,6 +36,7 @@ minetest.register_node("ontime_clocks:green_digital", {
|
||||||
},
|
},
|
||||||
tiles = {"ontime_clocks_digital.png"},
|
tiles = {"ontime_clocks_digital.png"},
|
||||||
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
||||||
|
is_ground_content = false,
|
||||||
display_entities = {
|
display_entities = {
|
||||||
["ontime_clocks:display"] = {
|
["ontime_clocks:display"] = {
|
||||||
depth = 13/32 - 0.01,
|
depth = 13/32 - 0.01,
|
||||||
|
@ -43,7 +44,8 @@ minetest.register_node("ontime_clocks:green_digital", {
|
||||||
objref:set_properties(
|
objref:set_properties(
|
||||||
ontime_clocks.get_digital_properties(
|
ontime_clocks.get_digital_properties(
|
||||||
"#040", "#0F0", ontime_clocks.get_h24(), ontime_clocks.get_m12()))
|
"#040", "#0F0", ontime_clocks.get_h24(), ontime_clocks.get_m12()))
|
||||||
end },
|
end
|
||||||
|
},
|
||||||
},
|
},
|
||||||
on_place = display_api.on_place,
|
on_place = display_api.on_place,
|
||||||
on_construct = display_api.on_construct,
|
on_construct = display_api.on_construct,
|
||||||
|
@ -74,6 +76,7 @@ minetest.register_node("ontime_clocks:red_digital", {
|
||||||
},
|
},
|
||||||
tiles = {"ontime_clocks_digital.png"},
|
tiles = {"ontime_clocks_digital.png"},
|
||||||
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
||||||
|
is_ground_content = false,
|
||||||
display_entities = {
|
display_entities = {
|
||||||
["ontime_clocks:display"] = {
|
["ontime_clocks:display"] = {
|
||||||
depth = 13/32 - 0.01,
|
depth = 13/32 - 0.01,
|
||||||
|
@ -81,7 +84,8 @@ minetest.register_node("ontime_clocks:red_digital", {
|
||||||
objref:set_properties(
|
objref:set_properties(
|
||||||
ontime_clocks.get_digital_properties(
|
ontime_clocks.get_digital_properties(
|
||||||
"#400", "#F00", ontime_clocks.get_h24(), ontime_clocks.get_m12()))
|
"#400", "#F00", ontime_clocks.get_h24(), ontime_clocks.get_m12()))
|
||||||
end },
|
end
|
||||||
|
},
|
||||||
},
|
},
|
||||||
on_place = display_api.on_place,
|
on_place = display_api.on_place,
|
||||||
on_construct = display_api.on_construct,
|
on_construct = display_api.on_construct,
|
||||||
|
@ -112,6 +116,7 @@ minetest.register_node("ontime_clocks:white", {
|
||||||
},
|
},
|
||||||
tiles = {"ontime_clocks_white.png"},
|
tiles = {"ontime_clocks_white.png"},
|
||||||
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
||||||
|
is_ground_content = false,
|
||||||
display_entities = {
|
display_entities = {
|
||||||
["ontime_clocks:display"] = {
|
["ontime_clocks:display"] = {
|
||||||
depth = 6/16 - 0.01,
|
depth = 6/16 - 0.01,
|
||||||
|
@ -119,7 +124,8 @@ minetest.register_node("ontime_clocks:white", {
|
||||||
objref:set_properties(
|
objref:set_properties(
|
||||||
ontime_clocks.get_needles_properties(
|
ontime_clocks.get_needles_properties(
|
||||||
"#000", 36, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
|
"#000", 36, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
|
||||||
end },
|
end
|
||||||
|
},
|
||||||
},
|
},
|
||||||
on_place = display_api.on_place,
|
on_place = display_api.on_place,
|
||||||
on_construct = display_api.on_construct,
|
on_construct = display_api.on_construct,
|
||||||
|
@ -149,6 +155,7 @@ minetest.register_node("ontime_clocks:frameless_black", {
|
||||||
},
|
},
|
||||||
tiles = {"ontime_clocks_frameless.png"},
|
tiles = {"ontime_clocks_frameless.png"},
|
||||||
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
||||||
|
is_ground_content = false,
|
||||||
display_entities = {
|
display_entities = {
|
||||||
["ontime_clocks:display"] = {
|
["ontime_clocks:display"] = {
|
||||||
depth = 7/16,
|
depth = 7/16,
|
||||||
|
@ -156,7 +163,8 @@ minetest.register_node("ontime_clocks:frameless_black", {
|
||||||
objref:set_properties(
|
objref:set_properties(
|
||||||
ontime_clocks.get_needles_properties(
|
ontime_clocks.get_needles_properties(
|
||||||
"#000", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
|
"#000", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
|
||||||
end },
|
end
|
||||||
|
},
|
||||||
},
|
},
|
||||||
on_place = display_api.on_place,
|
on_place = display_api.on_place,
|
||||||
on_construct = display_api.on_construct,
|
on_construct = display_api.on_construct,
|
||||||
|
@ -186,6 +194,7 @@ minetest.register_node("ontime_clocks:frameless_gold", {
|
||||||
},
|
},
|
||||||
tiles = {"ontime_clocks_frameless.png^[colorize:#FF0"},
|
tiles = {"ontime_clocks_frameless.png^[colorize:#FF0"},
|
||||||
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
||||||
|
is_ground_content = false,
|
||||||
display_entities = {
|
display_entities = {
|
||||||
["ontime_clocks:display"] = {
|
["ontime_clocks:display"] = {
|
||||||
depth = 7/16,
|
depth = 7/16,
|
||||||
|
@ -193,7 +202,8 @@ minetest.register_node("ontime_clocks:frameless_gold", {
|
||||||
objref:set_properties(
|
objref:set_properties(
|
||||||
ontime_clocks.get_needles_properties(
|
ontime_clocks.get_needles_properties(
|
||||||
"#FF0", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
|
"#FF0", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
|
||||||
end },
|
end
|
||||||
|
},
|
||||||
},
|
},
|
||||||
on_place = display_api.on_place,
|
on_place = display_api.on_place,
|
||||||
on_construct = display_api.on_construct,
|
on_construct = display_api.on_construct,
|
||||||
|
@ -223,6 +233,7 @@ minetest.register_node("ontime_clocks:frameless_white", {
|
||||||
},
|
},
|
||||||
tiles = {"ontime_clocks_frameless.png^[colorize:#FFF"},
|
tiles = {"ontime_clocks_frameless.png^[colorize:#FFF"},
|
||||||
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
||||||
|
is_ground_content = false,
|
||||||
display_entities = {
|
display_entities = {
|
||||||
["ontime_clocks:display"] = {
|
["ontime_clocks:display"] = {
|
||||||
depth = 7/16,
|
depth = 7/16,
|
||||||
|
@ -230,7 +241,8 @@ minetest.register_node("ontime_clocks:frameless_white", {
|
||||||
objref:set_properties(
|
objref:set_properties(
|
||||||
ontime_clocks.get_needles_properties(
|
ontime_clocks.get_needles_properties(
|
||||||
"#FFF", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
|
"#FFF", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
|
||||||
end },
|
end
|
||||||
|
},
|
||||||
},
|
},
|
||||||
on_place = display_api.on_place,
|
on_place = display_api.on_place,
|
||||||
on_construct = display_api.on_construct,
|
on_construct = display_api.on_construct,
|
||||||
|
|
|
@ -193,37 +193,39 @@ function signs_api.register_sign(mod, name, model)
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-model.width/2, -model.height/2, 0.5,
|
fixed = {
|
||||||
model.width/2, model.height/2, 0.5 - model.depth},
|
-model.width/2, -model.height/2, 0.5,
|
||||||
|
model.width/2, model.height/2, 0.5 - model.depth
|
||||||
|
},
|
||||||
},
|
},
|
||||||
groups = {choppy=2, dig_immediate=2, not_blocking_trains=1, display_api=1},
|
groups = {choppy=2, dig_immediate=2, not_blocking_trains=1, display_api=1},
|
||||||
|
is_ground_content = false,
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
display_entities = {
|
display_entities = {
|
||||||
["signs:display_text"] = {
|
["signs:display_text"] = {
|
||||||
on_display_update = font_api.on_display_update,
|
on_display_update = font_api.on_display_update,
|
||||||
depth = 0.5 - display_api.entity_spacing - model.depth,
|
depth = 0.5 - display_api.entity_spacing - model.depth,
|
||||||
size = { x = model.width, y = model.height },
|
size = { x = model.width, y = model.height },
|
||||||
aspect_ratio = 1/2,
|
aspect_ratio = 1/2,
|
||||||
maxlines = 1,
|
maxlines = 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
on_place = display_api.on_place,
|
on_place = display_api.on_place,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
|
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("font", ndef.display_entities.font_name or
|
meta:set_string("font", ndef.display_entities.font_name or
|
||||||
font_api.get_default_font_name())
|
font_api.get_default_font_name())
|
||||||
signs_api.set_formspec(pos)
|
signs_api.set_formspec(pos)
|
||||||
display_api.on_construct(pos)
|
display_api.on_construct(pos)
|
||||||
end,
|
end,
|
||||||
on_destruct = display_api.on_destruct,
|
on_destruct = display_api.on_destruct,
|
||||||
on_rotate = signs_api.on_rotate,
|
on_rotate = signs_api.on_rotate,
|
||||||
on_receive_fields = signs_api.on_receive_fields,
|
on_receive_fields = signs_api.on_receive_fields,
|
||||||
on_punch = function(pos, node, player, pointed_thing)
|
on_punch = function(pos, node, player, pointed_thing)
|
||||||
signs_api.set_formspec(pos)
|
signs_api.set_formspec(pos)
|
||||||
display_api.update_entities(pos)
|
display_api.update_entities(pos)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Node fields override
|
-- Node fields override
|
||||||
|
|
|
@ -47,47 +47,48 @@ for i, material in ipairs(steles.materials) do
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
groups = groups,
|
groups = groups,
|
||||||
|
is_ground_content = false,
|
||||||
display_entities = {
|
display_entities = {
|
||||||
["steles:text"] = {
|
["steles:text"] = {
|
||||||
on_display_update = font_api.on_display_update,
|
on_display_update = font_api.on_display_update,
|
||||||
depth = -2/16 - display_api.entity_spacing,
|
depth = -2/16 - display_api.entity_spacing,
|
||||||
top = -2/16,
|
top = -2/16,
|
||||||
aspect_ratio = 0.4,
|
aspect_ratio = 0.4,
|
||||||
size = { x = 10/16, y = 12/16 },
|
size = { x = 10/16, y = 12/16 },
|
||||||
maxlines = 3,
|
maxlines = 3,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
minetest.rotate_node(itemstack, placer, pointed_thing)
|
minetest.rotate_node(itemstack, placer, pointed_thing)
|
||||||
return display_api.on_place(itemstack, placer, pointed_thing)
|
return display_api.on_place(itemstack, placer, pointed_thing)
|
||||||
end,
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec", string.format([=[
|
meta:set_string("formspec", string.format([=[
|
||||||
size[6,4]%s%s%s
|
size[6,4]%s%s%s
|
||||||
textarea[0.5,0.7;5.5,2;display_text;%s;${display_text}]
|
textarea[0.5,0.7;5.5,2;display_text;%s;${display_text}]
|
||||||
button[1,3;2,1;font;%s]
|
button[1,3;2,1;font;%s]
|
||||||
button_exit[3,3;2,1;ok;%s]]=],
|
button_exit[3,3;2,1;ok;%s]]=],
|
||||||
default.gui_bg, default.gui_bg_img, default.gui_slots,
|
default.gui_bg, default.gui_bg_img, default.gui_slots,
|
||||||
F("Displayed text (3 lines max)"),
|
F("Displayed text (3 lines max)"),
|
||||||
F("Font"), F("Write")))
|
F("Font"), F("Write")))
|
||||||
display_api.on_construct(pos)
|
display_api.on_construct(pos)
|
||||||
end,
|
end,
|
||||||
on_destruct = display_api.on_destruct,
|
on_destruct = display_api.on_destruct,
|
||||||
on_rotate = display_api.on_rotate,
|
on_rotate = display_api.on_rotate,
|
||||||
on_receive_fields = function(pos, formname, fields, player)
|
on_receive_fields = function(pos, formname, fields, player)
|
||||||
if not minetest.is_protected(pos, player:get_player_name()) then
|
if not minetest.is_protected(pos, player:get_player_name()) then
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if fields.ok or fields.font then
|
if fields.ok or fields.font then
|
||||||
meta:set_string("display_text", fields.display_text)
|
meta:set_string("display_text", fields.display_text)
|
||||||
meta:set_string("infotext", "\""..fields.display_text.."\"")
|
meta:set_string("infotext", "\""..fields.display_text.."\"")
|
||||||
display_api.update_entities(pos)
|
display_api.update_entities(pos)
|
||||||
end
|
|
||||||
if fields.font then
|
|
||||||
font_api.show_font_list(player, pos)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end,
|
if fields.font then
|
||||||
|
font_api.show_font_list(player, pos)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
on_punch = display_api.update_entities,
|
on_punch = display_api.update_entities,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue