1
0
mirror of https://github.com/pyrollo/display_modpack.git synced 2025-10-14 08:15:20 +02:00
This commit is contained in:
Pierre-Yves Rollo
2025-09-29 13:38:07 +02:00
parent d96ca765b1
commit ab28e82d40
4 changed files with 54 additions and 42 deletions

View File

@@ -62,12 +62,3 @@ function ontime_clocks.get_needles_properties(color, size, hour, minute)
visual_size = {x=size/64, y=size/64}
}
end
function ontime_clocks.get_roll_h12()
print(minetest.get_timeofday())
return minetest.get_timeofday() * math.pi / 12
end
function ontime_clocks.get_roll_m()
return 0
end

View File

@@ -24,15 +24,15 @@
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="true"
inkscape:zoom="7.6898429"
inkscape:cx="144.73638"
inkscape:cy="77.179731"
inkscape:zoom="87.00064"
inkscape:cx="98.171691"
inkscape:cy="82.947665"
inkscape:window-width="1720"
inkscape:window-height="1282"
inkscape:window-x="26"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:current-layer="layer1">
inkscape:current-layer="g5227">
<inkscape:grid
type="xygrid"
id="grid132"
@@ -46,7 +46,7 @@
inkscape:label="Guides"
inkscape:groupmode="layer"
id="layer1"
style="display:none">
style="display:inline">
<g
id="g1880"
inkscape:label="minutes 3x3"
@@ -72,6 +72,34 @@
d="m 32.808333,16.933333 v 6.35"
id="path1871" />
</g>
<g
id="g5227">
<g
id="g1880-0"
inkscape:label="minutes 3x3"
transform="matrix(2.0000002,0,0,0.66666675,-40.216673,9.8777759)"
style="display:inline;stroke-width:0.866025"
inkscape:export-filename="../textures/ontime_clocks_needle_minutes_3x3.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<rect
style="fill:#ff0000;fill-opacity:0.2;fill-rule:evenodd;stroke:none;stroke-width:0.433012;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stop-color:#000000"
id="rect236-23"
width="2.1166666"
height="6.3500009"
x="31.75"
y="16.933332"
inkscape:label="Size" />
</g>
<path
style="display:inline;fill:#ff0000;stroke:#ff0000;stroke-width:0.05;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
d="m 23.283334,23.283333 h 4.233333"
id="path1869-2" />
<path
style="display:inline;fill:#ff0000;stroke:#ff0000;stroke-width:0.05;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
d="M 25.4,21.166667 V 25.4"
id="path1869-2-2" />
</g>
<g
id="g1885"
inkscape:label="minutes 5x5"
@@ -89,11 +117,11 @@
y="14.816667"
inkscape:label="Size" />
<path
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0250001;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.025;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
d="M 37.041666,25.4 V 14.816666"
id="path1873" />
<path
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0250001;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.025;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
d="M 35.983333,20.108333 H 38.1"
id="path1875" />
</g>
@@ -139,11 +167,11 @@
y="14.816667"
inkscape:label="Size" />
<path
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0250001;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.025;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
d="M 37.041666,25.4 V 14.816666"
id="path1873-9" />
<path
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0250001;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.025;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
d="M 35.983333,20.108333 H 38.1"
id="path1875-2" />
</g>
@@ -179,6 +207,19 @@
y="14.816667"
ry="0" />
</g>
<g
id="g4762-3-3-8"
transform="matrix(0.99999925,0,0,0.1176471,-12.69997,21.011028)"
style="display:inline;stroke-width:2.91547">
<rect
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.145774;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.5;stop-color:#000000"
id="rect1943-5-6-9"
width="1.0583333"
height="8.9958334"
x="37.570831"
y="14.816667"
ry="0" />
</g>
</g>
<g
inkscape:groupmode="layer"

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@@ -266,7 +266,7 @@ minetest.register_node("ontime_clocks:large_clock_black", {
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
tiles = {"ontime_clocks_frameless_inventory.png"},
tiles = {"ontime_clocks_center.png^[colorize#FF0"},
groups = {ontime_clocks_tick = 1, oddly_breakable_by_hand = 1, not_blocking_trains = 1, display_api = 1, handy = 1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
@@ -276,10 +276,9 @@ minetest.register_node("ontime_clocks:large_clock_black", {
depth = 15/32,
on_display_update = function(pos, objref)
objref:set_properties({
textures={"ontime_clocks_needle_hours_5x5.png"},
textures={"ontime_clocks_needle_hours_5x5.png^[colorize:#FF0"},
visual_size = {x=1, y=5},
})
print( minetest.get_timeofday() )
objref:get_luaentity()["rotation"] = { z = math.floor(minetest.get_timeofday() * 24) / 6 * math.pi }
end
},
@@ -287,7 +286,7 @@ minetest.register_node("ontime_clocks:large_clock_black", {
depth = 14/32,
on_display_update = function(pos, objref)
objref:set_properties({
textures={"ontime_clocks_needle_minutes_5x5.png"},
textures={"ontime_clocks_needle_minutes_5x5.png^[colorize:#FF0"},
visual_size = {x=1, y=5},
})
objref:get_luaentity()["rotation"] = { z = math.floor(minetest.get_timeofday() * 288) / 6 * math.pi }
@@ -302,31 +301,12 @@ minetest.register_node("ontime_clocks:large_clock_black", {
on_timer = clock_on_timer,
})
function flatten(from, to)
local mt = getmetatable(from)
if mt ~= nil then
flatten(mt, to)
end
for k, v in pairs(from) do
to[k] = v
end
end
function dump(title, table)
print("=== " .. title .. " ===", table)
local t = {}
flatten(table, t)
for k,v in pairs(t) do
print(k, "=>", v)
end
end
minetest.register_lbm({
name = "ontime_clocks:nodetimer_init",
nodenames = {"group:ontime_clocks_tick"},
run_at_every_load = false,
action = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(1)
timer:start(5)
end
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B