1
0
mirror of https://github.com/pyrollo/display_modpack.git synced 2025-10-21 19:15:43 +02:00

feat: Add 3x3 and 5x5 frameless clocks

This commit is contained in:
Pierre-Yves Rollo
2025-10-17 18:54:59 +02:00
parent 2fad466d94
commit 1f04cb5f64
18 changed files with 626 additions and 149 deletions

View File

@@ -18,9 +18,13 @@
along with ontime_clocks. If not, see <http://www.gnu.org/licenses/>. along with ontime_clocks. If not, see <http://www.gnu.org/licenses/>.
--]] --]]
-- Entity for time display -- Entity for time display of most of clocks
display_api.register_display_entity("ontime_clocks:display") display_api.register_display_entity("ontime_clocks:display")
-- Entities for two needles of large clocks
display_api.register_display_entity("ontime_clocks:hours_needle")
display_api.register_display_entity("ontime_clocks:minutes_needle")
function ontime_clocks.get_h24() function ontime_clocks.get_h24()
return math.floor(minetest.get_timeofday()*24)%24 return math.floor(minetest.get_timeofday()*24)%24
end end
@@ -58,4 +62,3 @@ function ontime_clocks.get_needles_properties(color, size, hour, minute)
visual_size = {x=size/64, y=size/64} visual_size = {x=size/64, y=size/64}
} }
end end

View File

@@ -56,6 +56,24 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = 'ontime_clocks:3x3_clock_black',
recipe = {
{mat.steel_ingot, mat.dye_black, mat.steel_ingot},
{'', 'ontime_clocks:frameless_black', ''},
{'', '', ''},
}
})
minetest.register_craft({
output = 'ontime_clocks:5x5_clock_black',
recipe = {
{mat.steel_ingot, mat.dye_black, mat.steel_ingot},
{'', 'ontime_clocks:3x3_clock_black', ''},
{'', '', ''},
}
})
minetest.register_craft({ minetest.register_craft({
output = 'ontime_clocks:frameless_gold', output = 'ontime_clocks:frameless_gold',
recipe = { recipe = {
@@ -65,6 +83,24 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = 'ontime_clocks:3x3_clock_gold',
recipe = {
{mat.gold_ingot, '', mat.gold_ingot},
{'', 'ontime_clocks:frameless_gold', ''},
{'', '', ''},
}
})
minetest.register_craft({
output = 'ontime_clocks:5x5_clock_gold',
recipe = {
{mat.gold_ingot, '', mat.gold_ingot},
{'', 'ontime_clocks:3x3_clock_gold', ''},
{'', '', ''},
}
})
minetest.register_craft({ minetest.register_craft({
output = 'ontime_clocks:frameless_white', output = 'ontime_clocks:frameless_white',
recipe = { recipe = {
@@ -74,4 +110,21 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = 'ontime_clocks:3x3_clock_white',
recipe = {
{mat.steel_ingot, mat.dye_white, mat.steel_ingot},
{'', 'ontime_clocks:frameless_white', ''},
{'', '', ''},
}
})
minetest.register_craft({
output = 'ontime_clocks:5x5_clock_white',
recipe = {
{mat.steel_ingot, mat.dye_white, mat.steel_ingot},
{'', 'ontime_clocks:3x3_clock_white', ''},
{'', '', ''},
}
})

View File

@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="32"
height="32"
viewBox="0 0 8.4666665 8.4666666"
version="1.1"
id="svg5"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="ontime_clocks_large_clock_inventory.svg"
inkscape:export-filename="../textures/ontime_clocks_5x5_clock_inventory.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#">
<sodipodi:namedview
id="namedview7"
pagecolor="#cccccc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="px"
showgrid="true"
inkscape:zoom="7.6898428"
inkscape:cx="66.061168"
inkscape:cy="-37.321959"
inkscape:window-width="2514"
inkscape:window-height="1371"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
shape-rendering="crispEdges">
<inkscape:grid
type="xygrid"
id="grid132"
empspacing="8"
empcolor="#9f00e5"
empopacity="0.30196078"
originx="0"
originy="0" />
</sodipodi:namedview>
<defs
id="defs2" />
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="clock"
style="display:inline">
<path
id="rect2410-3-1-2-3-9-4-7-8-6"
style="display:inline;opacity:1;fill:#ffffff;fill-rule:evenodd;stroke-width:0.0273861;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.5;stop-color:#000000"
d="M 3.96875,1.5875 H 4.2333333 V 1.8520833 H 3.96875 Z M 3.7041667,1.8520833 H 4.2333333 V 2.1166666 H 3.7041667 Z M 3.4395833,2.1166666 H 3.9687499 V 2.3812499 H 3.4395833 Z M 3.175,2.3812499 H 3.7041666 V 2.6458332 H 3.175 Z M 2.9104166,2.6458333 H 3.4395832 V 2.9104166 H 2.9104166 Z M 2.6458333,2.9104166 H 3.1749999 V 3.1749999 H 2.6458333 Z M 2.2489583,3.7041667 H 2.5135417 V 3.96875 H 2.2489583 Z M 1.984375,3.4395833 H 2.6458334 V 3.7041666 H 1.984375 Z M 1.7197917,3.175 H 2.9104166 V 3.4395833 H 1.7197917 Z M 1.4552083,2.9104166 H 2.38125 V 3.1749999 H 1.4552083 Z M 1.190625,2.6458333 H 2.1166667 V 2.9104166 H 1.190625 Z M 0.9260416,2.3812499 H 1.8520833 V 2.6458332 H 0.9260416 Z M 0.79374999,2.1166666 H 1.5875 V 2.3812499 H 0.79374999 Z M 0.92604166,1.5875 H 1.0583333 V 1.8520833 H 0.92604166 Z M 0.79374999,1.8520833 H 1.3229166 V 2.1166666 H 0.79374999 Z"
inkscape:label="clock"
transform="matrix(2,0,0,1,-0.52916664,0.52916667)" />
</g>
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="5x5"
style="display:none;fill:#ffffff">
<path
id="rect1383"
style="display:inline;fill:#808080;fill-opacity:1;fill-rule:evenodd;stroke-width:0.0499999;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.5;stop-color:#000000"
d="m 1.0583333,6.0854167 v 0.79375 h 0.2645834 0.79375 V 6.6145833 h -0.79375 V 6.35 h 0.79375 V 6.0854167 h -0.79375 z m 1.0583334,0.79375 V 7.14375 H 2.38125 V 6.8791667 Z m 0,0.2645833 H 1.0583333 v 0.2645833 h 1.0583334 z m 1.5875,-1.0583333 v 0.79375 H 3.96875 4.7625 V 6.6145833 H 3.96875 V 6.35 H 4.7625 V 6.0854167 H 3.96875 Z M 4.7625,6.8791667 V 7.14375 H 5.0270833 V 6.8791667 Z m 0,0.2645833 H 3.7041667 V 7.4083333 H 4.7625 Z M 2.6458333,6.6145833 V 6.8791667 H 2.9104167 V 6.6145833 Z M 2.9104167,6.8791667 V 7.14375 H 3.175 V 6.8791667 Z m 0.2645833,0 H 3.4395833 V 6.6145833 H 3.175 Z m 0,0.2645833 V 7.4083333 H 3.4395833 V 7.14375 Z m -0.2645833,0 H 2.6458333 v 0.2645833 h 0.2645834 z"
inkscape:label="5x5" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="3x3"
style="display:none">
<path
id="rect1383-3"
style="display:inline;fill:#808080;fill-opacity:1;fill-rule:evenodd;stroke-width:0.0499999;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.5;stop-color:#000000"
d="M 1.0583333,6.0854167 V 6.35 H 2.1166667 V 6.0854167 Z M 2.1166667,6.35 V 6.6145833 H 2.38125 V 6.35 Z m 0,0.2645833 H 1.3229166 v 0.2645834 h 0.7937501 z m 0,0.2645834 V 7.14375 H 2.38125 V 6.8791667 Z m 0,0.2645833 H 1.0583333 v 0.2645833 h 1.0583334 z m 1.5875,-1.0583333 V 6.35 H 4.7624999 V 6.0854167 Z M 4.7624999,6.35 V 6.6145833 H 5.0270833 V 6.35 Z m 0,0.2645833 H 3.96875 v 0.2645834 h 0.7937499 z m 0,0.2645834 V 7.14375 H 5.0270833 V 6.8791667 Z m 0,0.2645833 H 3.7041667 V 7.4083333 H 4.7624999 Z M 2.6458334,6.6145833 V 6.8791667 H 2.9104167 V 6.6145833 Z M 2.9104167,6.8791667 V 7.14375 H 3.175 V 6.8791667 Z m 0.2645833,0 H 3.4395834 V 6.6145833 H 3.175 Z m 0,0.2645833 V 7.4083333 H 3.4395834 V 7.14375 Z m -0.2645833,0 H 2.6458334 v 0.2645833 h 0.2645833 z"
inkscape:label="3x3" />
</g>
<metadata
id="metadata209">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
</svg>

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -0,0 +1,304 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="35.98333mm"
height="21.166664mm"
viewBox="0 0 35.98333 21.166664"
version="1.1"
id="svg5"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="ontime_clocks_large_clock_parts.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="true"
inkscape:zoom="2.71877"
inkscape:cx="51.309968"
inkscape:cy="44.321513"
inkscape:window-width="1720"
inkscape:window-height="1282"
inkscape:window-x="26"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:current-layer="layer4">
<inkscape:grid
type="xygrid"
id="grid132"
empspacing="8"
empcolor="#9f00e5"
empopacity="0.30196078"
originx="-23.283334"
originy="-12.699997" />
</sodipodi:namedview>
<defs
id="defs2" />
<g
inkscape:label="Guides"
inkscape:groupmode="layer"
id="layer1"
style="display:none"
transform="translate(-23.283334,-12.699999)">
<g
id="g5227"
style="display:inline"
inkscape:label="center 3x3"
inkscape:export-filename="../textures/ontime_clocks_3x3_center.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<rect
style="display:inline;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"
transform="matrix(2.0000002,0,0,0.66666676,-40.216672,9.8777758)" />
<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="g792"
style="display:inline"
inkscape:label="center 5x5"
transform="translate(6.3500021)"
inkscape:export-filename="../textures/ontime_clocks_5x5_center.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<rect
style="display:inline;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="rect786"
width="2.1166666"
height="6.3500009"
x="31.75"
y="16.933332"
inkscape:label="Size"
transform="matrix(2.0000002,0,0,0.66666676,-40.216672,9.8777758)" />
<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="path788" />
<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="path790" />
</g>
<g
id="g1880"
inkscape:label="minutes 3x3"
transform="matrix(2.0000002,0,0,2.333333,-27.516673,-23.636104)"
style="stroke-width:0.46291"
inkscape:export-filename="../textures/ontime_clocks_3x3_needle_minutes.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.231455;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stop-color:#000000"
id="rect236"
width="2.1166666"
height="6.3500009"
x="31.75"
y="16.933332"
inkscape:label="Size" />
<path
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0231455;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
d="m 31.75,20.108333 h 2.116666"
id="path1869" />
<path
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0231455;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
d="m 32.808333,16.933333 v 6.35"
id="path1871" />
</g>
<g
id="g1885"
inkscape:label="minutes 5x5"
transform="matrix(1.9999998,0,0,1.9999995,-29.633327,-16.933326)"
style="stroke-width:0.5"
inkscape:export-filename="../textures/ontime_clocks_5x5_needle_minutes.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.250001;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stop-color:#000000"
id="rect236-3"
width="2.1166663"
height="10.583334"
x="35.983334"
y="14.816667"
inkscape:label="Size" />
<path
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.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>
<g
id="g1880-6"
inkscape:label="hours 3x3"
transform="matrix(2.0000002,0,0,2.333333,-14.816673,-23.636104)"
style="display:inline;stroke-width:0.46291"
inkscape:export-filename="../textures/ontime_clocks_3x3_needle_hours.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.231455;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stop-color:#000000"
id="rect236-2"
width="2.1166666"
height="6.3500009"
x="31.75"
y="16.933332"
inkscape:label="Size" />
<path
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0231455;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
d="m 31.75,20.108333 h 2.116666"
id="path1869-6" />
<path
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0231455;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.5"
d="m 32.808333,16.933333 v 6.35"
id="path1871-1" />
</g>
<g
id="g1885-8"
inkscape:label="hours 5x5"
transform="matrix(1.9999998,0,0,1.9999995,-16.933327,-16.933326)"
style="display:inline;stroke-width:0.5"
inkscape:export-filename="../textures/ontime_clocks_5x5_needle_hours.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.250001;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stop-color:#000000"
id="rect236-3-7"
width="2.1166663"
height="10.583334"
x="35.983334"
y="14.816667"
inkscape:label="Size" />
<path
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.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>
</g>
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="Centers"
style="display:inline"
transform="translate(-23.283334,-12.699999)">
<g
id="g4762-3-3-8"
transform="matrix(1.4999983,0,0,0.17647065,-31.749933,19.874876)"
style="display:inline;stroke-width:1.94365">
<rect
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.0971825;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
id="g4762-3-3-8-3"
transform="matrix(1.9999979,0,0,0.23529412,-44.449917,18.738726)"
style="display:inline;stroke-width:1.45774">
<rect
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.0728869;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.5;stop-color:#000000"
id="rect1943-5-6-9-6"
width="1.0583333"
height="8.9958334"
x="37.570831"
y="14.816667"
ry="0" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Minutes"
style="display:inline"
transform="translate(-23.283334,-12.699999)">
<g
id="g4762-7"
transform="matrix(0.9999994,0,0,1.2352942,6.350025,-5.6029436)"
style="stroke-width:0.899737">
<rect
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.0449866;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.5;stop-color:#000000"
id="rect1943-0"
width="1.0583333"
height="8.9958334"
x="37.570831"
y="14.816667"
ry="0" />
</g>
<g
id="g4762-3-3"
transform="matrix(0.50000006,0,0,0.85294118,19.049999,3.2372533)"
style="stroke-width:1.53128">
<rect
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.076564;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.5;stop-color:#000000"
id="rect1943-5-6"
width="1.0583333"
height="8.9958334"
x="37.570831"
y="14.816667"
ry="0" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Hours"
style="display:inline"
transform="translate(-23.283334,-12.699999)">
<g
id="g4762"
transform="matrix(1.4999979,0,0,1,8.3634505e-5,3.2499997e-8)"
style="stroke-width:0.816497">
<rect
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.0408248;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.5;stop-color:#000000"
id="rect1943"
width="1.0583333"
height="8.9958334"
x="37.570831"
y="14.816667"
ry="0" />
</g>
<g
id="g4762-3"
transform="matrix(1,0,0,0.76470588,12.700002,5.6029412)"
style="stroke-width:1.14354">
<rect
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.0571771;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.5;stop-color:#000000"
id="rect1943-5"
width="1.0583333"
height="8.9958334"
x="37.570831"
y="14.816667"
ry="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -2,6 +2,15 @@
Green digital clock=Grüne Digitaluhr Green digital clock=Grüne Digitaluhr
Red digital clock=Rote Digitaluhr Red digital clock=Rote Digitaluhr
White clock=Weiße Uhr White clock=Weiße Uhr
@1 frameless @2 clock=
gold=
black=
white=
Frameless @1 clock=
##### not used anymore #####
Frameless clock=Rahmenlose Uhr Frameless clock=Rahmenlose Uhr
Frameless gold clock=Rahmenlose goldene Uhr Frameless gold clock=Rahmenlose goldene Uhr
Frameless white clock=Rahmenlose weiße Uhr Frameless white clock=Rahmenlose weiße Uhr

View File

@@ -2,6 +2,8 @@
Green digital clock=Horloge numérique verte Green digital clock=Horloge numérique verte
Red digital clock=Horloge numérique rouge Red digital clock=Horloge numérique rouge
White clock=Horloge blanche White clock=Horloge blanche
Frameless clock=Horloge sans cadre @1 frameless @2 clock=Horloge @2 sans cadre @1
Frameless gold clock=Horloge dorée sans cadre gold=dorée
Frameless white clock=Horloge blanche sans cadre black=noire
white=blanche
Frameless @1 clock=Horloge @1 sans cadre

View File

@@ -2,6 +2,15 @@
Green digital clock=Jam digital hijau Green digital clock=Jam digital hijau
Red digital clock=Jam digital merah Red digital clock=Jam digital merah
White clock=Jam putih White clock=Jam putih
@1 frameless @2 clock=
gold=
black=
white=
Frameless @1 clock=
##### not used anymore #####
Frameless clock=Jam tanpa bingkai Frameless clock=Jam tanpa bingkai
Frameless gold clock=Jam emas tanpa bingkai Frameless gold clock=Jam emas tanpa bingkai
Frameless white clock=Jam putih tanpa bingkai Frameless white clock=Jam putih tanpa bingkai

View File

@@ -2,6 +2,8 @@
Green digital clock= Green digital clock=
Red digital clock= Red digital clock=
White clock= White clock=
Frameless clock= @1 frameless @2 clock=
Frameless gold clock= gold=
Frameless white clock= black=
white=
Frameless @1 clock=

View File

@@ -31,8 +31,31 @@ local function clock_on_timer(pos)
return true return true
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(5)
end
})
local function register_clock(name, def)
def.on_place = display_api.on_place
def.on_construct = clock_on_construct
def.on_destruct = display_api.on_destruct
def.on_blast = display_api.on_blast
def.on_rotate = display_api.on_rotate
def.on_timer = clock_on_timer
def.groups.ontime_clocks_tick = 1
def.groups.display_api = 1
minetest.register_node(name, def)
end
-- Green digital clock -- Green digital clock
minetest.register_node("ontime_clocks:green_digital", { register_clock("ontime_clocks:green_digital", {
description = S("Green digital clock"), description = S("Green digital clock"),
inventory_image = "ontime_clocks_green_digital_inventory.png", inventory_image = "ontime_clocks_green_digital_inventory.png",
wield_image = "ontime_clocks_green_digital_inventory.png", wield_image = "ontime_clocks_green_digital_inventory.png",
@@ -46,7 +69,7 @@ minetest.register_node("ontime_clocks:green_digital", {
wall_top = {-7/16, 0.5, -7/32, 7/16, 13/32, 3/16} wall_top = {-7/16, 0.5, -7/32, 7/16, 13/32, 3/16}
}, },
tiles = {"ontime_clocks_digital.png"}, tiles = {"ontime_clocks_digital.png"},
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1, handy = 1}, groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, handy = 1},
_mcl_hardness = 0.8, _mcl_hardness = 0.8,
_mcl_blast_resistance = 1, _mcl_blast_resistance = 1,
is_ground_content = false, is_ground_content = false,
@@ -59,17 +82,11 @@ minetest.register_node("ontime_clocks:green_digital", {
"#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_construct = clock_on_construct,
on_destruct = display_api.on_destruct,
on_blast = display_api.on_blast,
on_rotate = display_api.on_rotate,
on_timer = clock_on_timer,
}) })
-- Red digital clock -- Red digital clock
minetest.register_node("ontime_clocks:red_digital", { register_clock("ontime_clocks:red_digital", {
description = S("Red digital clock"), description = S("Red digital clock"),
inventory_image = "ontime_clocks_red_digital_inventory.png", inventory_image = "ontime_clocks_red_digital_inventory.png",
wield_image = "ontime_clocks_red_digital_inventory.png", wield_image = "ontime_clocks_red_digital_inventory.png",
@@ -83,7 +100,7 @@ minetest.register_node("ontime_clocks:red_digital", {
wall_top = {-7/16, 0.5, -7/32, 7/16, 13/32, 3/16} wall_top = {-7/16, 0.5, -7/32, 7/16, 13/32, 3/16}
}, },
tiles = {"ontime_clocks_digital.png"}, tiles = {"ontime_clocks_digital.png"},
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1, handy = 1}, groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, handy = 1},
_mcl_hardness = 0.8, _mcl_hardness = 0.8,
_mcl_blast_resistance = 1, _mcl_blast_resistance = 1,
is_ground_content = false, is_ground_content = false,
@@ -96,16 +113,10 @@ minetest.register_node("ontime_clocks:red_digital", {
"#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_construct = clock_on_construct,
on_destruct = display_api.on_destruct,
on_blast = display_api.on_blast,
on_rotate = display_api.on_rotate,
on_timer = clock_on_timer,
}) })
minetest.register_node("ontime_clocks:white", { register_clock("ontime_clocks:white", {
description = S("White clock"), description = S("White clock"),
inventory_image = "ontime_clocks_white_inventory.png", inventory_image = "ontime_clocks_white_inventory.png",
wield_image = "ontime_clocks_white_inventory.png", wield_image = "ontime_clocks_white_inventory.png",
@@ -119,7 +130,7 @@ minetest.register_node("ontime_clocks:white", {
wall_top = { -7/16, 0.5, -7/16, 7/16, 7/16, 7/16}, wall_top = { -7/16, 0.5, -7/16, 7/16, 7/16, 7/16},
}, },
tiles = {"ontime_clocks_white.png"}, tiles = {"ontime_clocks_white.png"},
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1, handy = 1}, groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, handy = 1},
_mcl_hardness = 0.8, _mcl_hardness = 0.8,
_mcl_blast_resistance = 1, _mcl_blast_resistance = 1,
is_ground_content = false, is_ground_content = false,
@@ -132,133 +143,105 @@ minetest.register_node("ontime_clocks:white", {
"#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_construct = clock_on_construct,
on_destruct = display_api.on_destruct,
on_blast = display_api.on_blast,
on_rotate = display_api.on_rotate,
on_timer = clock_on_timer,
}) })
local function register_large_clock(name, label, color, size)
local sstr = size .. "x" .. size -- Size string
register_clock("ontime_clocks:" .. sstr .. "_clock_" .. name, {
description = S("@1 frameless @2 clock", sstr, label),
inventory_image = "ontime_clocks_large_clock_inventory.png^[colorize:" ..
color .. "^ontime_clocks_" .. sstr .. "_clock_inventory.png",
wield_image = "ontime_clocks_large_clock_inventory.png^[colorize:" .. color,
paramtype = "light",
paramtype2 = "wallmounted",
drawtype = "nodebox",
use_texture_alpha = "clip",
node_box = {
type = "wallmounted",
wall_side = { -0.5, -7/16, -7/16, -15/32, 7/16, 7/16 },
wall_bottom = { -7/16, -0.5, -7/16, 7/16, -15/32, 7/16 },
wall_top = { -7/16, 0.5, -7/16, 7/16, 15/32, 7/16 }
},
tiles = {"ontime_clocks_" .. sstr .. "_center.png^[colorize:" .. color},
groups = {oddly_breakable_by_hand = 1, not_blocking_trains = 1, handy = 1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
is_ground_content = false,
display_entities = {
["ontime_clocks:hours_needle"] = {
depth = 14/32,
on_display_update = function(pos, objref)
objref:set_properties({
textures={"ontime_clocks_" .. sstr .. "_needle_hours.png^[colorize:" .. color},
visual_size = {x=1, y=size},
})
objref:get_luaentity()["rotation"] = {
z = math.floor(minetest.get_timeofday() * 24) / 6 * math.pi
}
end
},
["ontime_clocks:minutes_needle"] = {
depth = 13/32,
on_display_update = function(pos, objref)
objref:set_properties({
textures={"ontime_clocks_" .. sstr .. "_needle_minutes.png^[colorize:" .. color},
visual_size = {x=1, y=size},
})
objref:get_luaentity()["rotation"] = {
z = math.floor(minetest.get_timeofday() * 288) / 6 * math.pi
}
end
},
},
})
end
minetest.register_node("ontime_clocks:frameless_black", { local models = {
description = S("Frameless clock"), { name = "gold", label = S("gold"), color = "#FF0" },
inventory_image = "ontime_clocks_frameless_inventory.png", { name = "black", label = S("black"), color = "#000" },
wield_image = "ontime_clocks_frameless_inventory.png", { name = "white", label = S("white"), color = "#FFF" },
paramtype = "light", }
paramtype2 = "wallmounted",
drawtype = "nodebox",
use_texture_alpha = "clip",
node_box = {
type = "wallmounted",
wall_side = { -0.5, -7/16, -7/16, -0.45, 7/16, 7/16 },
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.png"},
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1, handy = 1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
is_ground_content = false,
display_entities = {
["ontime_clocks:display"] = {
depth = 7/16,
on_display_update = function(pos, objref)
objref:set_properties(
ontime_clocks.get_needles_properties(
"#000", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
end },
},
on_place = display_api.on_place,
on_construct = clock_on_construct,
on_destruct = display_api.on_destruct,
on_blast = display_api.on_blast,
on_rotate = display_api.on_rotate,
on_timer = clock_on_timer,
})
for _, model in ipairs(models) do
-- Frameless clock
register_clock("ontime_clocks:frameless_" .. model.name, {
description = S("Frameless @1 clock", model.label),
inventory_image = "ontime_clocks_frameless_inventory.png^[colorize:" .. model.color,
wield_image = "ontime_clocks_frameless_inventory.png^[colorize:" .. model.color,
paramtype = "light",
paramtype2 = "wallmounted",
drawtype = "nodebox",
use_texture_alpha = "clip",
node_box = {
type = "wallmounted",
wall_side = { -0.5, -7/16, -7/16, -0.45, 7/16, 7/16 },
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.png^[colorize:" .. model.color},
groups = { oddly_breakable_by_hand=1, not_blocking_trains=1, handy = 1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
is_ground_content = false,
display_entities = {
["ontime_clocks:display"] = {
depth = 7/16,
on_display_update = function(pos, objref)
objref:set_properties(
ontime_clocks.get_needles_properties(
model.color, 48,
ontime_clocks.get_h12(),
ontime_clocks.get_m12()
)
)
end },
},
})
minetest.register_node("ontime_clocks:frameless_gold", { -- 3x3 large clock
description = S("Frameless gold clock"), register_large_clock(model.name, model.label, model.color, 3)
inventory_image = "ontime_clocks_frameless_inventory.png^[colorize:#FF0",
wield_image = "ontime_clocks_frameless_inventory.png^[colorize:#FF0",
paramtype = "light",
paramtype2 = "wallmounted",
drawtype = "nodebox",
use_texture_alpha = "clip",
node_box = {
type = "wallmounted",
wall_side = { -0.5, -7/16, -7/16, -0.45, 7/16, 7/16 },
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.png^[colorize:#FF0"},
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1, handy = 1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
is_ground_content = false,
display_entities = {
["ontime_clocks:display"] = {
depth = 7/16,
on_display_update = function(pos, objref)
objref:set_properties(
ontime_clocks.get_needles_properties(
"#FF0", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
end },
},
on_place = display_api.on_place,
on_construct = clock_on_construct,
on_destruct = display_api.on_destruct,
on_blast = display_api.on_blast,
on_rotate = display_api.on_rotate,
on_timer = clock_on_timer,
})
-- 5x5 large clock
register_large_clock(model.name, model.label, model.color, 5)
end
minetest.register_node("ontime_clocks:frameless_white", {
description = S("Frameless white clock"),
inventory_image = "ontime_clocks_frameless_inventory.png^[colorize:#FFF",
wield_image = "ontime_clocks_frameless_inventory.png^[colorize:#FFF",
paramtype = "light",
paramtype2 = "wallmounted",
drawtype = "nodebox",
use_texture_alpha = "clip",
node_box = {
type = "wallmounted",
wall_side = { -0.5, -7/16, -7/16, -0.45, 7/16, 7/16 },
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.png^[colorize:#FFF"},
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1, handy = 1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
is_ground_content = false,
display_entities = {
["ontime_clocks:display"] = {
depth = 7/16,
on_display_update = function(pos, objref)
objref:set_properties(
ontime_clocks.get_needles_properties(
"#FFF", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
end },
},
on_place = display_api.on_place,
on_construct = clock_on_construct,
on_destruct = display_api.on_destruct,
on_blast = display_api.on_blast,
on_rotate = display_api.on_rotate,
on_timer = clock_on_timer,
})
minetest.register_lbm({
name = "ontime_clocks:nodetimer_init",
nodenames = {"ontime_clocks:green_digital", "ontime_clocks:red_digital", "ontime_clocks:white",
"ontime_clocks:frameless_black", "ontime_clocks:frameless_gold", "ontime_clocks:frameless_white"},
run_at_every_load = false,
action = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(5)
end
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B