Compare commits
3 Commits
pyrollo/bi
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 21cfb2e59e | |||
| 0df11424ea | |||
| ad30eeab23 |
10
.github/workflows/luacheck.yml
vendored
@@ -1,10 +0,0 @@
|
|||||||
name: luacheck
|
|
||||||
on: [push, pull_request]
|
|
||||||
jobs:
|
|
||||||
luacheck:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@master
|
|
||||||
- name: Luacheck
|
|
||||||
uses: lunarmodules/luacheck@master
|
|
||||||
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
*~
|
||||||
|
_*
|
||||||
|
|
||||||
19
.luacheckrc
@@ -1,19 +0,0 @@
|
|||||||
unused_args = false
|
|
||||||
|
|
||||||
read_globals = {
|
|
||||||
"minetest",
|
|
||||||
"table",
|
|
||||||
"vector",
|
|
||||||
"xcompat"
|
|
||||||
}
|
|
||||||
|
|
||||||
globals = {
|
|
||||||
"boards",
|
|
||||||
"display_api",
|
|
||||||
"font_api",
|
|
||||||
"ontime_clocks",
|
|
||||||
"signs",
|
|
||||||
"signs_api",
|
|
||||||
"signs_road",
|
|
||||||
"steles"
|
|
||||||
}
|
|
||||||
28
README.md
@@ -1,26 +1,22 @@
|
|||||||
# Display Modpack
|
# Display Modpack
|
||||||
|
Version 1.3.1
|
||||||
|
|
||||||

|
This modpack provides mods with dynamic display. Mods are :
|
||||||
[](https://content.minetest.net/packages/mt-mods/display_modpack/)
|
|
||||||
|
|
||||||
Requires Minetest 5.4+
|
- **[display_api](https://github.com/pyrollo/display_modpack/tree/master/display_api)**: A library for adding display entities to nodes;
|
||||||
|
- **[font_api](https://github.com/pyrollo/display_modpack/tree/master/font_api)**: A library for displaying fonts on entities;
|
||||||
|
- **[signs_api](https://github.com/pyrollo/display_modpack/tree/master/signs_api)**: A library for the easy creation of signs;
|
||||||
|
- **[font_metro](https://github.com/pyrollo/display_modpack/tree/master/font_metro)**: A font mod used as default font (includes uppercase, lowercase and accentuated latin letters, usual signs, cyrillic and greek letters)
|
||||||
|
|
||||||
This modpack provides mods with dynamic display. Mods are:
|
- **[boards](https://github.com/pyrollo/display_modpack/tree/master/boards)**: A mod providing school boards (includes *tiny cursive font*, a handwriting style font);
|
||||||
|
- **[ontime_clocks](https://github.com/pyrollo/display_modpack/tree/master/ontime_clocks)**: A mod providing clocks which display the ingame time;
|
||||||
- **[display_api](https://github.com/mt-mods/display_modpack/tree/master/display_api)**: A library for adding display entities to nodes;
|
- **[signs](https://github.com/pyrollo/display_modpack/tree/master/signs)**: A mod providing signs and direction signs displaying text;
|
||||||
- **[font_api](https://github.com/mt-mods/display_modpack/tree/master/font_api)**: A library for displaying fonts on entities;
|
- **[signs_road](https://github.com/pyrollo/display_modpack/tree/master/signs_road)**: A mod providing road signs displaying text;
|
||||||
- **[signs_api](https://github.com/mt-mods/display_modpack/tree/master/signs_api)**: A library for the easy creation of signs;
|
- **[steles](https://github.com/pyrollo/display_modpack/tree/master/steles)**: A mod providing stone steles with text;
|
||||||
- **[font_metro](https://github.com/mt-mods/display_modpack/tree/master/font_metro)**: A font mod used as default font (includes uppercase, lowercase and accentuated latin letters, usual signs, cyrillic and greek letters)
|
|
||||||
|
|
||||||
- **[boards](https://github.com/mt-mods/display_modpack/tree/master/boards)**: A mod providing school boards (includes *tiny cursive font*, a handwriting style font);
|
|
||||||
- **[ontime_clocks](https://github.com/mt-mods/display_modpack/tree/master/ontime_clocks)**: A mod providing clocks which display the ingame time;
|
|
||||||
- **[signs](https://github.com/mt-mods/display_modpack/tree/master/signs)**: A mod providing signs and direction signs displaying text;
|
|
||||||
- **[signs_road](https://github.com/mt-mods/display_modpack/tree/master/signs_road)**: A mod providing road signs displaying text;
|
|
||||||
- **[steles](https://github.com/mt-mods/display_modpack/tree/master/steles)**: A mod providing stone steles with text;
|
|
||||||
|
|
||||||
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.
|
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Extra fonts
|
## Extra fonts
|
||||||
|
|
||||||
|
|||||||
1
_config.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
theme: jekyll-theme-minimal
|
||||||
166
boards/LICENSE.txt
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
||||||
|
|
||||||
2
boards/copyright.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Code by Pierre-Yves Rollo (pyrollo)
|
||||||
|
Font by (cyfry77)
|
||||||
@@ -7,13 +7,11 @@
|
|||||||
released under CC-BY-SA license
|
released under CC-BY-SA license
|
||||||
|
|
||||||
https://fontstruct.com/fontstructions/show/63155/tiny_cursive
|
https://fontstruct.com/fontstructions/show/63155/tiny_cursive
|
||||||
|
|
||||||
Derivative texture are under CC-BY-SA license
|
Derivative texture are under CC-BY-SA license
|
||||||
Code is under LGPL v3 license
|
Code is under LGPL v3 license
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
-- widths is not split into several lines, because the font is generated by 'make_font_lua.sh'
|
|
||||||
-- luacheck: ignore
|
|
||||||
font_api.register_font('tinycurs',
|
font_api.register_font('tinycurs',
|
||||||
{
|
{
|
||||||
default = false, -- Don't register this font as a possible default font
|
default = false, -- Don't register this font as a possible default font
|
||||||
@@ -21,7 +19,7 @@ font_api.register_font('tinycurs',
|
|||||||
marginbottom = -2,
|
marginbottom = -2,
|
||||||
linespacing = -4,
|
linespacing = -4,
|
||||||
height = 19,
|
height = 19,
|
||||||
widths = {
|
widths = {
|
||||||
[0]=9, [32]=9, [33]=6, [34]=7, [35]=10, [36]=14, [37]=14, [38]=12, [39]=3, [40]=6, [41]=6, [42]=9, [43]=8, [44]=3, [45]=7, [46]=3, [47]=9, [48]=9, [49]=7, [50]=10, [51]=9, [52]=9, [53]=10, [54]=10, [55]=9, [56]=10, [57]=8, [58]=5, [59]=5, [60]=8, [61]=8, [62]=8, [63]=8, [64]=12, [65]=9, [66]=7, [67]=9, [68]=10, [69]=8, [70]=8, [71]=8, [72]=10, [73]=7, [74]=8, [75]=9, [76]=9, [77]=12, [78]=10, [79]=9, [80]=9, [81]=9, [82]=11, [83]=11, [84]=8, [85]=11, [86]=11, [87]=12, [88]=12, [89]=11, [90]=11, [91]=8, [92]=5, [93]=8, [94]=8, [95]=8, [96]=5, [97]=6, [98]=6, [99]=6, [100]=7, [101]=6, [102]=5, [103]=6, [104]=6, [105]=4, [106]=5, [107]=7, [108]=5, [109]=9, [110]=8, [111]=6, [112]=9, [113]=8, [114]=7, [115]=7, [116]=6, [117]=8, [118]=8, [119]=11, [120]=10, [121]=8, [122]=8, [123]=8, [124]=6, [125]=9, [126]=10, [8216]=4, [8217]=4, [8220]=6, [8221]=6
|
[0]=9, [32]=9, [33]=6, [34]=7, [35]=10, [36]=14, [37]=14, [38]=12, [39]=3, [40]=6, [41]=6, [42]=9, [43]=8, [44]=3, [45]=7, [46]=3, [47]=9, [48]=9, [49]=7, [50]=10, [51]=9, [52]=9, [53]=10, [54]=10, [55]=9, [56]=10, [57]=8, [58]=5, [59]=5, [60]=8, [61]=8, [62]=8, [63]=8, [64]=12, [65]=9, [66]=7, [67]=9, [68]=10, [69]=8, [70]=8, [71]=8, [72]=10, [73]=7, [74]=8, [75]=9, [76]=9, [77]=12, [78]=10, [79]=9, [80]=9, [81]=9, [82]=11, [83]=11, [84]=8, [85]=11, [86]=11, [87]=12, [88]=12, [89]=11, [90]=11, [91]=8, [92]=5, [93]=8, [94]=8, [95]=8, [96]=5, [97]=6, [98]=6, [99]=6, [100]=7, [101]=6, [102]=5, [103]=6, [104]=6, [105]=4, [106]=5, [107]=7, [108]=5, [109]=9, [110]=8, [111]=6, [112]=9, [113]=8, [114]=7, [115]=7, [116]=6, [117]=8, [118]=8, [119]=11, [120]=10, [121]=8, [122]=8, [123]=8, [124]=6, [125]=9, [126]=10, [8216]=4, [8217]=4, [8220]=6, [8221]=6
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,21 +22,21 @@ boards = {}
|
|||||||
boards.name = minetest.get_current_modname()
|
boards.name = minetest.get_current_modname()
|
||||||
boards.path = minetest.get_modpath(boards.name)
|
boards.path = minetest.get_modpath(boards.name)
|
||||||
|
|
||||||
-- Translation support
|
-- Load support for intllib.
|
||||||
local S = minetest.get_translator(boards.name)
|
local S, NS = dofile(boards.path.."/intllib.lua")
|
||||||
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
boards.intllib = S
|
||||||
|
local F = function(...) return minetest.formspec_escape(S(...)) end
|
||||||
|
|
||||||
-- Load font
|
-- Load font
|
||||||
dofile(boards.path.."/font_tinycurs.lua")
|
dofile(boards.path.."/font_tinycurs.lua")
|
||||||
|
|
||||||
local function set_formspec(pos)
|
local function set_formspec(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local display_text = minetest.formspec_escape(meta:get_string("display_text"))
|
|
||||||
meta:set_string("formspec",
|
meta:set_string("formspec",
|
||||||
"size[6,3.5]"..
|
"size[6,4]"..default.gui_bg..default.gui_bg_img..default.gui_slots..
|
||||||
"textarea[0.55,0.25;5.5,3;display_text;"..FS("Text")..";" .. display_text .. "]"..
|
"textarea[0.5,0.7;5.5,3;display_text;"..F("Text")..";${display_text}]"..
|
||||||
"button_exit[1,2.75;2,1;ok;"..FS("Write").."]"..
|
"button_exit[3,3.5;2,1;ok;"..F("Write").."]"..
|
||||||
"button[3,2.75;2,1;font;"..FS("Font").."]")
|
"button_exit[1,3.5;2,1;wipe;"..F("Wipe").."]")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- On boards, everyone is allowed to write and wipe
|
-- On boards, everyone is allowed to write and wipe
|
||||||
@@ -45,16 +45,13 @@ local function on_receive_fields(pos, formname, fields, player)
|
|||||||
if fields.ok or fields.key_enter then
|
if fields.ok or fields.key_enter then
|
||||||
signs_api.set_display_text(pos, fields.display_text, fields.font)
|
signs_api.set_display_text(pos, fields.display_text, fields.font)
|
||||||
end
|
end
|
||||||
if fields.font then
|
if fields.wipe then
|
||||||
signs_api.set_display_text(pos, fields.display_text)
|
signs_api.set_display_text(pos, "", fields.font)
|
||||||
font_api.show_font_list(player, pos)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local wood_texture = xcompat.textures.wood.planks
|
models = {
|
||||||
|
|
||||||
local models = {
|
|
||||||
black_board = {
|
black_board = {
|
||||||
depth = 1/16, width = 1, height = 1,
|
depth = 1/16, width = 1, height = 1,
|
||||||
entity_fields = {
|
entity_fields = {
|
||||||
@@ -67,10 +64,9 @@ local models = {
|
|||||||
},
|
},
|
||||||
node_fields = {
|
node_fields = {
|
||||||
description = S("Black board"),
|
description = S("Black board"),
|
||||||
tiles = {wood_texture, wood_texture,
|
tiles = { "default_wood.png", "default_wood.png",
|
||||||
wood_texture, wood_texture,
|
"default_wood.png", "default_wood.png",
|
||||||
wood_texture, "board_black_front.png"},
|
"default_wood.png", "board_black_front.png" },
|
||||||
_itemframe_texture = "board_black_front.png",
|
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@@ -83,13 +79,6 @@ local models = {
|
|||||||
set_formspec(pos)
|
set_formspec(pos)
|
||||||
display_api.on_construct(pos)
|
display_api.on_construct(pos)
|
||||||
end,
|
end,
|
||||||
on_punch = function(pos)
|
|
||||||
set_formspec(pos)
|
|
||||||
display_api.update_entities(pos)
|
|
||||||
end,
|
|
||||||
on_rightclick = function(pos)
|
|
||||||
set_formspec(pos)
|
|
||||||
end,
|
|
||||||
on_receive_fields = on_receive_fields,
|
on_receive_fields = on_receive_fields,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -105,11 +94,10 @@ local models = {
|
|||||||
},
|
},
|
||||||
node_fields = {
|
node_fields = {
|
||||||
description = S("Green board"),
|
description = S("Green board"),
|
||||||
tiles = {wood_texture, wood_texture,
|
tiles = { "default_wood.png", "default_wood.png",
|
||||||
wood_texture, wood_texture,
|
"default_wood.png", "default_wood.png",
|
||||||
wood_texture, "board_green_front.png"},
|
"default_wood.png", "board_green_front.png" },
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
_itemframe_texture = "board_green_front.png",
|
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@@ -121,13 +109,6 @@ local models = {
|
|||||||
set_formspec(pos)
|
set_formspec(pos)
|
||||||
display_api.on_construct(pos)
|
display_api.on_construct(pos)
|
||||||
end,
|
end,
|
||||||
on_punch = function(pos)
|
|
||||||
set_formspec(pos)
|
|
||||||
display_api.update_entities(pos)
|
|
||||||
end,
|
|
||||||
on_rightclick = function(pos)
|
|
||||||
set_formspec(pos)
|
|
||||||
end,
|
|
||||||
on_receive_fields = on_receive_fields,
|
on_receive_fields = on_receive_fields,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -140,21 +121,20 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Recipes
|
-- Recipes
|
||||||
local mat = xcompat.materials
|
|
||||||
|
|
||||||
minetest.register_craft(
|
minetest.register_craft(
|
||||||
{
|
{
|
||||||
output = "boards:black_board",
|
output = "boards:black_board",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"group:wood", "group:stone", mat.dye_black},
|
{"group:wood", "group:stone", "dye:black"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft(
|
minetest.register_craft(
|
||||||
{
|
{
|
||||||
output = "boards:green_board",
|
output = "boards:green_board",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"group:wood", "group:stone", mat.dye_dark_green},
|
{"group:wood", "group:stone", "dye:dark_green"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.log("action", "[boards] loaded.")
|
||||||
|
|||||||
45
boards/intllib.lua
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
-- Fallback functions for when `intllib` is not installed.
|
||||||
|
-- Code released under Unlicense <http://unlicense.org>.
|
||||||
|
|
||||||
|
-- Get the latest version of this file at:
|
||||||
|
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
||||||
|
|
||||||
|
local function format(str, ...)
|
||||||
|
local args = { ... }
|
||||||
|
local function repl(escape, open, num, close)
|
||||||
|
if escape == "" then
|
||||||
|
local replacement = tostring(args[tonumber(num)])
|
||||||
|
if open == "" then
|
||||||
|
replacement = replacement..close
|
||||||
|
end
|
||||||
|
return replacement
|
||||||
|
else
|
||||||
|
return "@"..open..num..close
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
||||||
|
end
|
||||||
|
|
||||||
|
local gettext, ngettext
|
||||||
|
if minetest.get_modpath("intllib") then
|
||||||
|
if intllib.make_gettext_pair then
|
||||||
|
-- New method using gettext.
|
||||||
|
gettext, ngettext = intllib.make_gettext_pair()
|
||||||
|
else
|
||||||
|
-- Old method using text files.
|
||||||
|
gettext = intllib.Getter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Fill in missing functions.
|
||||||
|
|
||||||
|
gettext = gettext or function(msgid, ...)
|
||||||
|
return format(msgid, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
||||||
|
return format(n==1 and msgid or msgid_plural, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
return gettext, ngettext
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
# textdomain: boards
|
|
||||||
Text=Text
|
|
||||||
Write=Schreiben
|
|
||||||
Font=Schriftart
|
|
||||||
Black board=Schwarze Tafel
|
|
||||||
Green board=Grüne Tafel
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
# textdomain: boards
|
|
||||||
Text=Texte
|
|
||||||
Write=Écrire
|
|
||||||
Font=Police
|
|
||||||
Black board=Tableau noir
|
|
||||||
Green board=Tableau vert
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
# textdomain: boards
|
|
||||||
Text=
|
|
||||||
Write=
|
|
||||||
Font=
|
|
||||||
Black board=Papan hitam
|
|
||||||
Green board=
|
|
||||||
40
boards/locale/fr.po
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-07-16 10:00+0200\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=CHARSET\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Text"
|
||||||
|
msgstr "Texte"
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Write"
|
||||||
|
msgstr "Ecrire"
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Wipe"
|
||||||
|
msgstr "Effacer"
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Black board"
|
||||||
|
msgstr "Tableau noir"
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Green board"
|
||||||
|
msgstr "Tableau vert"
|
||||||
|
|
||||||
|
|
||||||
35
boards/locale/ms.po
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# Yaya (Nurul Azeera Hidayah @ Muhammad Nur Hidayat) <translation@mnh48.moe>, 2020.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Display Modpack\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-07-16 10:00+0200\n"
|
||||||
|
"PO-Revision-Date: 2020-07-05 11:31+0000\n"
|
||||||
|
"Language-Team: Malay <translation@mnh48.moe>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: Poedit 2.3\n"
|
||||||
|
"Last-Translator: Yaya MNH48 <translation@mnh48.moe>\n"
|
||||||
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
"Language: ms\n"
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Text"
|
||||||
|
msgstr "Teks"
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Write"
|
||||||
|
msgstr "Tulis"
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Wipe"
|
||||||
|
msgstr "Padam"
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Black board"
|
||||||
|
msgstr "Papan hitam"
|
||||||
34
boards/locale/template.pot
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-07-16 10:00+0200\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=CHARSET\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Text"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Write"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Wipe"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Black board"
|
||||||
|
msgstr ""
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
# textdomain: boards
|
|
||||||
Text=
|
|
||||||
Write=
|
|
||||||
Font=
|
|
||||||
Black board=
|
|
||||||
Green board=
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name = boards
|
name = boards
|
||||||
title = Black boards
|
title = Black boards
|
||||||
description = Writable school boards using sign_api
|
description = Writable school boards using sign_api
|
||||||
depends = signs_api, xcompat
|
depends = default,signs_api
|
||||||
|
|||||||
25
boards/tools/updatepo.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# To create a new translation:
|
||||||
|
# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot
|
||||||
|
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")/..";
|
||||||
|
|
||||||
|
# Extract translatable strings.
|
||||||
|
xgettext --from-code=UTF-8 \
|
||||||
|
--language=Lua \
|
||||||
|
--sort-by-file \
|
||||||
|
--keyword=S \
|
||||||
|
--keyword=NS:1,2 \
|
||||||
|
--keyword=N_ \
|
||||||
|
--keyword=F \
|
||||||
|
--add-comments='Translators:' \
|
||||||
|
--add-location=file \
|
||||||
|
-o locale/template.pot \
|
||||||
|
$(find . -name '*.lua')
|
||||||
|
|
||||||
|
# Update translations.
|
||||||
|
find locale -name '*.po' | while read -r file; do
|
||||||
|
echo $file
|
||||||
|
msgmerge --update $file locale/template.pot;
|
||||||
|
done
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
display_modpack (all mods):
|
|
||||||
- Original author: Pierre-Yves Rollo (pyrollo) License: LGPL v3, font_metro LGPL v2.1
|
|
||||||
- Many other contributors, see `git log`
|
|
||||||
|
|
||||||
boards:
|
|
||||||
- Font author: cyfry77 License: CC-BY-SA 3.0
|
|
||||||
|
|
||||||
font_metro:
|
|
||||||
- Font author: Christian Munk (CMunk) License: CC-BY-SA 3.0
|
|
||||||
166
display_api/LICENSE.txt
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ This library's purpose is to ease creation of nodes with one or more displays on
|
|||||||
|
|
||||||
**Limitations**: This lib uses entities to draw display. This means display has to be vertical (and "upside up") on Minetest before version 5.0.
|
**Limitations**: This lib uses entities to draw display. This means display has to be vertical (and "upside up") on Minetest before version 5.0.
|
||||||
|
|
||||||
**Dependencies**: xcompat
|
**Dependancies**:default
|
||||||
|
|
||||||
**License**: LGPLv2
|
**License**: LGPLv2
|
||||||
|
|
||||||
|
|||||||
5
display_api/copyright.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Code by Pierre-Yves Rollo (pyrollo)
|
||||||
|
Contributors:
|
||||||
|
(gpcf): Compatibility with signs lib
|
||||||
|
(Thomas--S): Fix /clearobjects bug
|
||||||
|
(12Me21): on_place and on_rotate improvements
|
||||||
@@ -19,17 +19,17 @@
|
|||||||
|
|
||||||
-- Deprecation
|
-- Deprecation
|
||||||
|
|
||||||
local function deprecated_group(old_group, replacement_group)
|
function deprecated_group(deprecated_group, replacement_group)
|
||||||
for name, ndef in pairs(minetest.registered_nodes) do
|
for name, ndef in pairs(minetest.registered_nodes) do
|
||||||
if ndef.groups and ndef.groups[old_group] then
|
if ndef.groups and ndef.groups[deprecated_group] then
|
||||||
minetest.log("warning", string.format(
|
minetest.log("warning", string.format(
|
||||||
'Node %s belongs to deprecated "%s" group which should be replaced with new "%s" group.',
|
'Node %s belongs to deprecated "%s" group which should be replaced with new "%s" group.',
|
||||||
name, old_group, replacement_group))
|
name, deprecated_group, replacement_group))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function deprecated_global_table(deprecated_global_name, replacement_global_name)
|
function deprecated_global_table(deprecated_global_name, replacement_global_name)
|
||||||
assert(type(deprecated_global_name) == 'string', "deprecated_global_name should be a string.")
|
assert(type(deprecated_global_name) == 'string', "deprecated_global_name should be a string.")
|
||||||
assert(type(replacement_global_name) == 'string', "replacement_global_name should be a string.")
|
assert(type(replacement_global_name) == 'string', "replacement_global_name should be a string.")
|
||||||
assert(deprecated_global_name ~= '', "deprecated_global_name should not be empty.")
|
assert(deprecated_global_name ~= '', "deprecated_global_name should not be empty.")
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ local function compute_values(r)
|
|||||||
for _ = 1, r.x do d, w, h = rx(d), rx(w), rx(h) end
|
for _ = 1, r.x do d, w, h = rx(d), rx(w), rx(h) end
|
||||||
for _ = 1, r.y do d, w, h = ry(d), ry(w), ry(h) end
|
for _ = 1, r.y do d, w, h = ry(d), ry(w), ry(h) end
|
||||||
|
|
||||||
return {rotation=r, depth=d, width=w, height=h}
|
return {
|
||||||
|
rotation=r, depth=d, width=w, height=h,
|
||||||
|
restricted=(r.x==0 and r.z==0) }
|
||||||
end
|
end
|
||||||
|
|
||||||
for i, r in pairs(facedir_rotations) do
|
for i, r in pairs(facedir_rotations) do
|
||||||
@@ -76,6 +78,25 @@ for i, r in pairs(wallmounted_rotations) do
|
|||||||
wallmounted_values[i] = compute_values(r)
|
wallmounted_values[i] = compute_values(r)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Detect rotation restriction
|
||||||
|
local rotation_restricted = nil
|
||||||
|
minetest.register_entity('display_api:dummy_entity', {
|
||||||
|
collisionbox = { 0, 0, 0, 0, 0, 0 },
|
||||||
|
visual = "upright_sprite",
|
||||||
|
textures = {} })
|
||||||
|
|
||||||
|
function display_api.is_rotation_restricted()
|
||||||
|
if rotation_restricted == nil then
|
||||||
|
local objref = minetest.add_entity(
|
||||||
|
{x=0, y=0, z=0}, 'display_api:dummy_entity')
|
||||||
|
if objref then
|
||||||
|
rotation_restricted = objref.set_rotation == nil
|
||||||
|
objref:remove()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return rotation_restricted
|
||||||
|
end
|
||||||
|
|
||||||
-- Clip position property to maximum entity position
|
-- Clip position property to maximum entity position
|
||||||
|
|
||||||
local function clip_pos_prop(posprop)
|
local function clip_pos_prop(posprop)
|
||||||
@@ -95,7 +116,7 @@ local function get_orientation_values(node)
|
|||||||
local paramtype2 = ndef.paramtype2
|
local paramtype2 = ndef.paramtype2
|
||||||
if paramtype2 == "wallmounted" or paramtype2 == "colorwallmounted" then
|
if paramtype2 == "wallmounted" or paramtype2 == "colorwallmounted" then
|
||||||
return wallmounted_values[node.param2 % 8]
|
return wallmounted_values[node.param2 % 8]
|
||||||
elseif paramtype2 == "facedir" or paramtype2 == "colorfacedir" then
|
elseif paramtype2 == "facedir" or paramtype2 == "colorfacedir" then
|
||||||
return facedir_values[node.param2 % 32]
|
return facedir_values[node.param2 % 32]
|
||||||
else
|
else
|
||||||
-- No orientation or unknown orientation type
|
-- No orientation or unknown orientation type
|
||||||
@@ -147,8 +168,7 @@ function display_api.update_entities(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for _, objref in pairs(get_display_objrefs(pos, true)) do
|
for _, objref in pairs(get_display_objrefs(pos, true)) do
|
||||||
local entity = objref:get_luaentity()
|
local edef = ndef.display_entities[objref:get_luaentity().name]
|
||||||
local edef = ndef.display_entities[entity.name]
|
|
||||||
local depth = clip_pos_prop(edef.depth)
|
local depth = clip_pos_prop(edef.depth)
|
||||||
local right = clip_pos_prop(edef.right)
|
local right = clip_pos_prop(edef.right)
|
||||||
local top = clip_pos_prop(edef.top)
|
local top = clip_pos_prop(edef.top)
|
||||||
@@ -161,19 +181,14 @@ function display_api.update_entities(pos)
|
|||||||
|
|
||||||
if objref.set_rotation then
|
if objref.set_rotation then
|
||||||
objref:set_rotation({
|
objref:set_rotation({
|
||||||
x = ov.rotation.x * math.pi / 2 +
|
x = ov.rotation.x*math.pi/2,
|
||||||
(entity.rotation and entity.rotation.x or 0),
|
y = ov.rotation.y*math.pi/2 + (edef.yaw or 0),
|
||||||
y = ov.rotation.y * math.pi / 2 +
|
z = ov.rotation.z*math.pi/2,
|
||||||
(entity.rotation and entity.rotation.y or 0) +
|
|
||||||
(edef.yaw or 0),
|
|
||||||
z = ov.rotation.z * math.pi / 2 +
|
|
||||||
(entity.rotation and entity.rotation.z or 0),
|
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
if ov.rotation.x ~=0 or ov.rotation.y ~= 0 then
|
if ov.rotation.x ~=0 or ov.rotation.y ~= 0 then
|
||||||
minetest.log("warning", string.format(
|
minetest.log("warning", string.format(
|
||||||
"[display_api] unable to rotate correctly entity for " ..
|
"[display_api] unable to rotate correctly entity for node at %s without set_rotation method.",
|
||||||
"node at %s without set_rotation method.",
|
|
||||||
minetest.pos_to_string(pos)))
|
minetest.pos_to_string(pos)))
|
||||||
end
|
end
|
||||||
objref:set_yaw(ov.rotation.y*math.pi/2 + (edef.yaw or 0))
|
objref:set_yaw(ov.rotation.y*math.pi/2 + (edef.yaw or 0))
|
||||||
@@ -228,6 +243,16 @@ function display_api.on_place(itemstack, placer, pointed_thing, override_param2)
|
|||||||
z = pointed_thing.under.z - pointed_thing.above.z,
|
z = pointed_thing.under.z - pointed_thing.above.z,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local rotation_restriction = display_api.is_rotation_restricted()
|
||||||
|
|
||||||
|
if rotation_restriction then
|
||||||
|
-- If item is not placed on a wall, use the player's view direction instead
|
||||||
|
if dir.x == 0 and dir.z == 0 then
|
||||||
|
dir = placer:get_look_dir()
|
||||||
|
end
|
||||||
|
dir.y = 0
|
||||||
|
end
|
||||||
|
|
||||||
local param2 = 0
|
local param2 = 0
|
||||||
if ndef then
|
if ndef then
|
||||||
if ndef.paramtype2 == "wallmounted" or
|
if ndef.paramtype2 == "wallmounted" or
|
||||||
@@ -235,8 +260,8 @@ function display_api.on_place(itemstack, placer, pointed_thing, override_param2)
|
|||||||
param2 = minetest.dir_to_wallmounted(dir)
|
param2 = minetest.dir_to_wallmounted(dir)
|
||||||
|
|
||||||
elseif ndef.paramtype2 == "facedir" or
|
elseif ndef.paramtype2 == "facedir" or
|
||||||
ndef.paramtype2 == "colorfacedir" then
|
ndef.paramtype2 == "colorfacedir" then
|
||||||
param2 = minetest.dir_to_facedir(dir, true)
|
param2 = minetest.dir_to_facedir(dir, not rotation_restriction)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return minetest.item_place(itemstack, placer, pointed_thing,
|
return minetest.item_place(itemstack, placer, pointed_thing,
|
||||||
@@ -257,15 +282,6 @@ function display_api.on_destruct(pos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function display_api.on_blast(pos, intensity)
|
|
||||||
if not minetest.is_protected(pos, "") then
|
|
||||||
local node = minetest.get_node(pos)
|
|
||||||
local drops = minetest.get_node_drops(node, "tnt:blast")
|
|
||||||
minetest.remove_node(pos)
|
|
||||||
return drops
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- On_rotate (screwdriver) callback for display_api items. Prevents invalid
|
-- On_rotate (screwdriver) callback for display_api items. Prevents invalid
|
||||||
-- rotations and reorients entities.
|
-- rotations and reorients entities.
|
||||||
function display_api.on_rotate(pos, node, user, _, new_param2)
|
function display_api.on_rotate(pos, node, user, _, new_param2)
|
||||||
@@ -275,34 +291,28 @@ function display_api.on_rotate(pos, node, user, _, new_param2)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.swap_node(pos, node)
|
if ov.restricted or not display_api.is_rotation_restricted() then
|
||||||
display_api.update_entities(pos)
|
minetest.swap_node(pos, node)
|
||||||
return true
|
display_api.update_entities(pos)
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Creates display entity with some fields and the on_activate callback
|
--- Creates display entity with some fields and the on_activate callback
|
||||||
function display_api.register_display_entity(entity_name)
|
function display_api.register_display_entity(entity_name)
|
||||||
|
if not minetest.registered_entities[entity_name] then
|
||||||
if minetest.registered_entities[entity_name] then
|
minetest.register_entity(':'..entity_name, {
|
||||||
return
|
collisionbox = { 0, 0, 0, 0, 0, 0 },
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_entity(':'..entity_name, {
|
|
||||||
initial_properties = {
|
|
||||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
|
||||||
visual = "upright_sprite",
|
visual = "upright_sprite",
|
||||||
textures = {},
|
textures = {},
|
||||||
collide_with_objects = false,
|
on_activate = display_api.on_activate,
|
||||||
pointable = false,
|
get_staticdata = function(self)
|
||||||
},
|
return minetest.serialize({ nodepos = self.nodepos })
|
||||||
on_activate = display_api.on_activate,
|
end,
|
||||||
get_staticdata = function(self)
|
})
|
||||||
return minetest.serialize({ nodepos = self.nodepos })
|
end
|
||||||
end,
|
|
||||||
on_blast = function(self, damage)
|
|
||||||
return false, false, {}
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_lbm({
|
minetest.register_lbm({
|
||||||
@@ -310,7 +320,6 @@ minetest.register_lbm({
|
|||||||
name = "display_api:update_entities",
|
name = "display_api:update_entities",
|
||||||
run_at_every_load = true,
|
run_at_every_load = true,
|
||||||
nodenames = {"group:display_api",
|
nodenames = {"group:display_api",
|
||||||
"group:display_modpack_node",
|
"group:display_modpack_node", "group:display_lib_node"}, -- See deprecated(1)
|
||||||
"group:display_lib_node"}, -- See deprecated(1)
|
|
||||||
action = function(pos, node) display_api.update_entities(pos) end,
|
action = function(pos, node) display_api.update_entities(pos) end,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -29,3 +29,5 @@ display_api.path = minetest.get_modpath(display_api.name)
|
|||||||
|
|
||||||
dofile(display_api.path.."/display.lua")
|
dofile(display_api.path.."/display.lua")
|
||||||
dofile(display_api.path.."/deprecation.lua")
|
dofile(display_api.path.."/deprecation.lua")
|
||||||
|
|
||||||
|
minetest.log("action", "[display_api] loaded.")
|
||||||
|
|||||||
166
font_api/LICENSE.txt
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
A library for rendernig text on textures (to be used with display_api for sign creation).
|
A library for rendernig text on textures (to be used with display_api for sign creation).
|
||||||
|
|
||||||
**Dependencies**: xcompat
|
**Dependancies**: default
|
||||||
|
|
||||||
**License**: LGPL
|
**License**: LGPL
|
||||||
|
|
||||||
|
|||||||
3
font_api/copyright.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Code by Pierre-Yves Rollo (pyrollo)
|
||||||
|
Contributors:
|
||||||
|
Andrzej Pieńkowski (apienk): Unicode support and tool for creating texturess
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
-- Deprecation
|
-- Deprecation
|
||||||
|
|
||||||
local function deprecated_global_table(deprecated_global_name, replacement_global_name)
|
function deprecated_global_table(deprecated_global_name, replacement_global_name)
|
||||||
assert(type(deprecated_global_name) == 'string', "deprecated_global_name should be a string.")
|
assert(type(deprecated_global_name) == 'string', "deprecated_global_name should be a string.")
|
||||||
assert(type(replacement_global_name) == 'string', "replacement_global_name should be a string.")
|
assert(type(replacement_global_name) == 'string', "replacement_global_name should be a string.")
|
||||||
assert(deprecated_global_name ~= '', "deprecated_global_name should not be empty.")
|
assert(deprecated_global_name ~= '', "deprecated_global_name should not be empty.")
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ return {
|
|||||||
['×'] = 'x', ['Ý'] = 'Y',
|
['×'] = 'x', ['Ý'] = 'Y',
|
||||||
|
|
||||||
-- Lower case accents
|
-- Lower case accents
|
||||||
['à'] = 'a', ['á'] = 'a', ['â'] = 'a',
|
['à'] = 'a', ['à'] = 'a', ['á'] = 'a', ['â'] = 'a',
|
||||||
['ã'] = 'a', ['ä'] = 'a', ['å'] = 'a',
|
['ã'] = 'a', ['ä'] = 'a', ['å'] = 'a',
|
||||||
['æ'] = 'ae', ['ç'] = 'c',
|
['æ'] = 'ae', ['ç'] = 'c',
|
||||||
['è'] = 'e', ['é'] = 'e', ['ê'] = 'e', ['ë'] = 'e',
|
['è'] = 'e', ['é'] = 'e', ['ê'] = 'e', ['ë'] = 'e',
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ end
|
|||||||
-- @return Texture string
|
-- @return Texture string
|
||||||
|
|
||||||
function Font:render(text, texturew, textureh, style)
|
function Font:render(text, texturew, textureh, style)
|
||||||
style = style or {}
|
local style = style or {}
|
||||||
|
|
||||||
-- Split text into lines (and limit to style.lines # of lines)
|
-- Split text into lines (and limit to style.lines # of lines)
|
||||||
local lines = {}
|
local lines = {}
|
||||||
@@ -243,17 +243,17 @@ function Font:render(text, texturew, textureh, style)
|
|||||||
|
|
||||||
y = y + (self.margintop or 0)
|
y = y + (self.margintop or 0)
|
||||||
|
|
||||||
for _, l in pairs(lines) do
|
for _, line in pairs(lines) do
|
||||||
if style.halign == "left" then
|
if style.halign == "left" then
|
||||||
x = 0
|
x = 0
|
||||||
elseif style.halign == "right" then
|
elseif style.halign == "right" then
|
||||||
x = texturew - l.width
|
x = texturew - line.width
|
||||||
else
|
else
|
||||||
x = (texturew - l.width) / 2
|
x = (texturew - line.width) / 2
|
||||||
end
|
end
|
||||||
|
|
||||||
while l.text ~= '' do
|
while line.text ~= '' do
|
||||||
codepoint, l.text = self:get_next_char(l.text)
|
codepoint, line.text = self:get_next_char(line.text)
|
||||||
if codepoint == nil then return '' end -- UTF Error
|
if codepoint == nil then return '' end -- UTF Error
|
||||||
|
|
||||||
-- Add image only if it is visible (at least partly)
|
-- Add image only if it is visible (at least partly)
|
||||||
|
|||||||
@@ -16,9 +16,6 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
local S = font_api.S
|
|
||||||
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
|
||||||
|
|
||||||
local modname = minetest.get_current_modname()
|
local modname = minetest.get_current_modname()
|
||||||
|
|
||||||
local contexts = {}
|
local contexts = {}
|
||||||
@@ -54,9 +51,15 @@ local function show_node_formspec(playername, pos)
|
|||||||
fs = fs:gsub("context", nodemeta)
|
fs = fs:gsub("context", nodemeta)
|
||||||
|
|
||||||
-- Change all ${} to their corresponding metadata values
|
-- Change all ${} to their corresponding metadata values
|
||||||
fs = fs:gsub("([^\\])${(.-)}", function(prefix, key)
|
local s, e
|
||||||
return prefix .. minetest.formspec_escape(meta:get_string(key))
|
repeat
|
||||||
end)
|
s, e = fs:find('%${.*}')
|
||||||
|
if s and e then
|
||||||
|
fs = fs:sub(1, s-1)..
|
||||||
|
minetest.formspec_escape(meta:get_string(fs:sub(s+2,e-1)))..
|
||||||
|
fs:sub(e+1)
|
||||||
|
end
|
||||||
|
until s == nil
|
||||||
|
|
||||||
local context = get_context(playername)
|
local context = get_context(playername)
|
||||||
context.node_pos = pos
|
context.node_pos = pos
|
||||||
@@ -98,8 +101,9 @@ local function show_font_formspec(playername)
|
|||||||
table.sort(fonts)
|
table.sort(fonts)
|
||||||
|
|
||||||
local fs = string.format(
|
local fs = string.format(
|
||||||
"size[4,%s]button_exit[0,%s;4,1;cancel;%s]",
|
"size[4,%s]%s%s%sbutton_exit[0,%s;4,1;cancel;Cancel]",
|
||||||
#fonts + 0.8, #fonts, FS("Cancel"))
|
#fonts + 0.8, default.gui_bg, default.gui_bg_img, default.gui_slots,
|
||||||
|
#fonts)
|
||||||
|
|
||||||
for line = 1, #fonts do
|
for line = 1, #fonts do
|
||||||
local font = font_api.get_font(fonts[line])
|
local font = font_api.get_font(fonts[line])
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ font_api = {}
|
|||||||
font_api.name = minetest.get_current_modname()
|
font_api.name = minetest.get_current_modname()
|
||||||
font_api.path = minetest.get_modpath(font_api.name)
|
font_api.path = minetest.get_modpath(font_api.name)
|
||||||
|
|
||||||
-- Translation support
|
|
||||||
font_api.S = minetest.get_translator(font_api.name)
|
|
||||||
|
|
||||||
-- Inclusions
|
-- Inclusions
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
@@ -36,3 +33,5 @@ if minetest.get_modpath("display_api") then
|
|||||||
dofile(font_api.path.."/display_api.lua")
|
dofile(font_api.path.."/display_api.lua")
|
||||||
end
|
end
|
||||||
dofile(font_api.path.."/deprecation.lua")
|
dofile(font_api.path.."/deprecation.lua")
|
||||||
|
|
||||||
|
minetest.log("action", "[font_api] loaded.")
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
# textdomain: font_api
|
|
||||||
Cancel=Schließen
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# textdomain: font_api
|
|
||||||
Cancel=Annuler
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# textdomain: font_api
|
|
||||||
Cancel=
|
|
||||||
@@ -58,9 +58,12 @@ local function get_default_font()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If failed, choose the first registered font
|
-- If failed, chose first font
|
||||||
if default_font == nil then
|
if default_font == nil then
|
||||||
default_font = next(font_api.registered_fonts)
|
for _, font in pairs(font_api.registered_fonts) do
|
||||||
|
default_font = font
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Error, no font registered
|
-- Error, no font registered
|
||||||
|
|||||||
3
font_metro/copyright.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Font by Christian Munk (CMunk)
|
||||||
|
Code by Pierre-Yves Rollo (pyrollo)
|
||||||
|
|
||||||
@@ -1,18 +1,16 @@
|
|||||||
--[[
|
--[[
|
||||||
|
|
||||||
Metro font for Font API
|
Metro font for Font API
|
||||||
|
|
||||||
Original font Metro Sans
|
Original font Metro Sans
|
||||||
by Christian Munk (CMunk)
|
by Christian Munk (CMunk)
|
||||||
released under CC-BY-SA license
|
released under CC-BY-SA license
|
||||||
|
|
||||||
https://fontstruct.com/fontstructions/show/723864/metro_sans
|
https://fontstruct.com/fontstructions/show/723864/metro_sans
|
||||||
|
|
||||||
Derivative textures and code are under CC-BY-SA license
|
Derivative textures and code are under CC-BY-SA license
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
-- widths is not split into several lines, because the font is generated by 'make_font_lua.sh'
|
|
||||||
-- luacheck: ignore
|
|
||||||
font_api.register_font(
|
font_api.register_font(
|
||||||
'metro',
|
'metro',
|
||||||
{
|
{
|
||||||
@@ -24,3 +22,4 @@ font_api.register_font(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
minetest.log("action", "[font_metro] loaded.")
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
name = display_modpack
|
|
||||||
description = Display modpack for Minetest, provides mods with dynamic display and font display: clocks, signs, and more.
|
|
||||||
title = Display Modpack
|
|
||||||
min_minetest_version = 5.4.0
|
|
||||||
0
modpack.txt
Normal file
166
ontime_clocks/LICENSE.txt
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ This mod provides clocks that display real ingame time.
|
|||||||
|
|
||||||
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.
|
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.
|
||||||
|
|
||||||
**Dependencies**: display_api, xcompat
|
**Dependancies**: display_api, default
|
||||||
|
|
||||||
**License**: Code under LGPL, textures under CC-BY-SA
|
**License**: Code under LGPL, textures under CC-BY-SA
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
--[[
|
--[[
|
||||||
ontime_clocks mod for Minetest - Clock nodes displaying ingame time
|
ontime_clocks mod for Minetest - Clock nodes displaying ingame time
|
||||||
(c) Pierre-Yves Rollo
|
(c) Pierre-Yves Rollo
|
||||||
|
|
||||||
This file is part of ontime_clocks.
|
This file is part of ontime_clocks.
|
||||||
@@ -18,13 +18,9 @@
|
|||||||
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 of most of clocks
|
-- Entity for time display
|
||||||
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
|
||||||
@@ -38,7 +34,7 @@ function ontime_clocks.get_m12()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ontime_clocks.get_digital_properties(color_off, color_on, hour, minute)
|
function ontime_clocks.get_digital_properties(color_off, color_on, hour, minute)
|
||||||
return
|
return
|
||||||
{
|
{
|
||||||
textures={"ontime_clocks_digital_background.png^[colorize:"..color_off
|
textures={"ontime_clocks_digital_background.png^[colorize:"..color_off
|
||||||
.."^([combine:21x7"
|
.."^([combine:21x7"
|
||||||
@@ -55,10 +51,11 @@ end
|
|||||||
function ontime_clocks.get_needles_properties(color, size, hour, minute)
|
function ontime_clocks.get_needles_properties(color, size, hour, minute)
|
||||||
return
|
return
|
||||||
{
|
{
|
||||||
textures={"[combine:"..size.."x"..size
|
textures={"[combine:"..size.."x"..size
|
||||||
..":0,"..(-size*hour).."=ontime_clocks_needle_h"..size..".png"
|
..":0,"..(-size*hour).."=ontime_clocks_needle_h"..size..".png"
|
||||||
..":0,"..(-size*minute).."=ontime_clocks_needle_m"..size..".png"
|
..":0,"..(-size*minute).."=ontime_clocks_needle_m"..size..".png"
|
||||||
.."^[colorize:"..color},
|
.."^[colorize:"..color},
|
||||||
visual_size = {x=size/64, y=size/64}
|
visual_size = {x=size/64, y=size/64}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
8
ontime_clocks/copyright.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Code, Textures and Models by Pierre-Yves Rollo (pyrollo)
|
||||||
|
intllib support (i18n) by (fat115)
|
||||||
|
intllib fallback code and tools by Diego Martínez (kaeza)
|
||||||
|
Extra contibutors:
|
||||||
|
(Thomas--S)
|
||||||
|
Translations:
|
||||||
|
Muhammad Nur Hidayat Yasuyoshi (MuhdNurHidayat)
|
||||||
|
(fat115)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
--[[
|
--[[
|
||||||
ontime_clocks mod for Minetest - Clock nodes displaying ingame time
|
ontime_clocks mod for Minetest - Clock nodes displaying ingame time
|
||||||
(c) Pierre-Yves Rollo
|
(c) Pierre-Yves Rollo
|
||||||
|
|
||||||
This file is part of ontime_clocks.
|
This file is part of ontime_clocks.
|
||||||
@@ -18,13 +18,11 @@
|
|||||||
along with ontime_clocks. If not, see <http://www.gnu.org/licenses/>.
|
along with ontime_clocks. If not, see <http://www.gnu.org/licenses/>.
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
local mat = xcompat.materials
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'ontime_clocks:green_digital',
|
output = 'ontime_clocks:green_digital',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'', mat.dye_green, ''},
|
{'', 'dye:green', ''},
|
||||||
{mat.glass, mat.mese_crystal, mat.glass},
|
{'default:glass', 'default:mese_crystal', 'default:glass'},
|
||||||
{'', '', ''},
|
{'', '', ''},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -32,8 +30,8 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'ontime_clocks:red_digital',
|
output = 'ontime_clocks:red_digital',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'', mat.dye_red, ''},
|
{'', 'dye:red', ''},
|
||||||
{mat.glass, mat.mese_crystal, mat.glass},
|
{'default:glass', 'default:mese_crystal', 'default:glass'},
|
||||||
{'', '', ''},
|
{'', '', ''},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -41,8 +39,8 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'ontime_clocks:white',
|
output = 'ontime_clocks:white',
|
||||||
recipe = {
|
recipe = {
|
||||||
{mat.steel_ingot, mat.paper, mat.steel_ingot},
|
{'default:steel_ingot', 'default:paper', 'default:steel_ingot'},
|
||||||
{'', mat.mese_crystal, ''},
|
{'', 'default:mese_crystal', ''},
|
||||||
{'', '', ''},
|
{'', '', ''},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -50,26 +48,8 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'ontime_clocks:frameless_black',
|
output = 'ontime_clocks:frameless_black',
|
||||||
recipe = {
|
recipe = {
|
||||||
{mat.steel_ingot, mat.dye_black, mat.steel_ingot},
|
{'default:steel_ingot', 'dye:black', 'default:steel_ingot'},
|
||||||
{'', mat.mese_crystal, ''},
|
{'', 'default:mese_crystal', ''},
|
||||||
{'', '', ''},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
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', ''},
|
|
||||||
{'', '', ''},
|
{'', '', ''},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -77,26 +57,8 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'ontime_clocks:frameless_gold',
|
output = 'ontime_clocks:frameless_gold',
|
||||||
recipe = {
|
recipe = {
|
||||||
{mat.gold_ingot, '', mat.gold_ingot},
|
{'default:gold_ingot', '', 'default:gold_ingot'},
|
||||||
{'', mat.mese_crystal, ''},
|
{'', 'default:mese_crystal', ''},
|
||||||
{'', '', ''},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
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', ''},
|
|
||||||
{'', '', ''},
|
{'', '', ''},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -104,27 +66,10 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'ontime_clocks:frameless_white',
|
output = 'ontime_clocks:frameless_white',
|
||||||
recipe = {
|
recipe = {
|
||||||
{mat.steel_ingot, mat.dye_white, mat.steel_ingot},
|
{'default:steel_ingot', 'dye:white', 'default:steel_ingot'},
|
||||||
{'', mat.mese_crystal, ''},
|
{'', 'default:mese_crystal', ''},
|
||||||
{'', '', ''},
|
{'', '', ''},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
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', ''},
|
|
||||||
{'', '', ''},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,112 +0,0 @@
|
|||||||
<?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>
|
|
||||||
|
Before Width: | Height: | Size: 5.9 KiB |
@@ -1,304 +0,0 @@
|
|||||||
<?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>
|
|
||||||
|
Before Width: | Height: | Size: 12 KiB |
@@ -1,5 +1,5 @@
|
|||||||
--[[
|
--[[
|
||||||
ontime_clocks mod for Minetest - Clock nodes displaying ingame time
|
ontime_clocks mod for Minetest - Clock nodes displaying ingame time
|
||||||
(c) Pierre-Yves Rollo
|
(c) Pierre-Yves Rollo
|
||||||
|
|
||||||
This file is part of ontime_clocks.
|
This file is part of ontime_clocks.
|
||||||
@@ -22,9 +22,12 @@ ontime_clocks = {}
|
|||||||
ontime_clocks.name = minetest.get_current_modname()
|
ontime_clocks.name = minetest.get_current_modname()
|
||||||
ontime_clocks.path = minetest.get_modpath(ontime_clocks.name)
|
ontime_clocks.path = minetest.get_modpath(ontime_clocks.name)
|
||||||
|
|
||||||
-- Translation support
|
-- Load support for intllib.
|
||||||
ontime_clocks.S = minetest.get_translator(ontime_clocks.name)
|
local S, NS = dofile(ontime_clocks.path.."/intllib.lua")
|
||||||
|
ontime_clocks.intllib = S
|
||||||
|
|
||||||
dofile(ontime_clocks.path.."/common.lua")
|
dofile(ontime_clocks.path.."/common.lua")
|
||||||
dofile(ontime_clocks.path.."/nodes.lua")
|
dofile(ontime_clocks.path.."/nodes.lua")
|
||||||
dofile(ontime_clocks.path.."/crafts.lua")
|
dofile(ontime_clocks.path.."/crafts.lua")
|
||||||
|
|
||||||
|
minetest.log("action", "[ontime_clocks] loaded.")
|
||||||
|
|||||||
45
ontime_clocks/intllib.lua
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
-- Fallback functions for when `intllib` is not installed.
|
||||||
|
-- Code released under Unlicense <http://unlicense.org>.
|
||||||
|
|
||||||
|
-- Get the latest version of this file at:
|
||||||
|
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
||||||
|
|
||||||
|
local function format(str, ...)
|
||||||
|
local args = { ... }
|
||||||
|
local function repl(escape, open, num, close)
|
||||||
|
if escape == "" then
|
||||||
|
local replacement = tostring(args[tonumber(num)])
|
||||||
|
if open == "" then
|
||||||
|
replacement = replacement..close
|
||||||
|
end
|
||||||
|
return replacement
|
||||||
|
else
|
||||||
|
return "@"..open..num..close
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
||||||
|
end
|
||||||
|
|
||||||
|
local gettext, ngettext
|
||||||
|
if minetest.get_modpath("intllib") then
|
||||||
|
if intllib.make_gettext_pair then
|
||||||
|
-- New method using gettext.
|
||||||
|
gettext, ngettext = intllib.make_gettext_pair()
|
||||||
|
else
|
||||||
|
-- Old method using text files.
|
||||||
|
gettext = intllib.Getter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Fill in missing functions.
|
||||||
|
|
||||||
|
gettext = gettext or function(msgid, ...)
|
||||||
|
return format(msgid, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
||||||
|
return format(n==1 and msgid or msgid_plural, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
return gettext, ngettext
|
||||||
43
ontime_clocks/locale/fr.po
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: \n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-08-05 09:50+0200\n"
|
||||||
|
"PO-Revision-Date: 2017-05-08 06:20+0200\n"
|
||||||
|
"Last-Translator: Peppy <peppy@twang-factory.com>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"Language: fr\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: Poedit 1.8.12\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Green digital clock"
|
||||||
|
msgstr "Horloge numérique verte"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Red digital clock"
|
||||||
|
msgstr "Horloge numérique rouge"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "White clock"
|
||||||
|
msgstr "Horloge blanche"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Frameless clock"
|
||||||
|
msgstr "Horloge sans cadre"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Frameless gold clock"
|
||||||
|
msgstr "Horloge dorée sans cadre"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Frameless white clock"
|
||||||
|
msgstr "Horloge blanche sans cadre"
|
||||||
42
ontime_clocks/locale/ms.po
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# Yaya (Nurul Azeera Hidayah @ Muhammad Nur Hidayat) <translation@mnh48.moe>, 2017.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Display Modpack\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-08-26 11:21+0200\n"
|
||||||
|
"PO-Revision-Date: 2020-07-05 11:32+0000\n"
|
||||||
|
"Last-Translator: Yaya MNH48 <translation@mnh48.moe>\n"
|
||||||
|
"Language-Team: Malay <translation@mnh48.moe>\n"
|
||||||
|
"Language: ms\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
"X-Generator: Poedit 2.3\n"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Green digital clock"
|
||||||
|
msgstr "Jam digital hijau"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Red digital clock"
|
||||||
|
msgstr "Jam digital merah"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "White clock"
|
||||||
|
msgstr "Jam putih"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Frameless clock"
|
||||||
|
msgstr "Jam tanpa bingkai"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Frameless gold clock"
|
||||||
|
msgstr "Jam emas tanpa bingkai"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Frameless white clock"
|
||||||
|
msgstr "Jam putih tanpa bingkai"
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# textdomain: ontime_clocks
|
|
||||||
Green digital clock=Grüne Digitaluhr
|
|
||||||
Red digital clock=Rote Digitaluhr
|
|
||||||
White clock=Weiße Uhr
|
|
||||||
@1 frameless @2 clock=@1 rahmenlose @2 Uhr
|
|
||||||
gold=goldene
|
|
||||||
black=schwarze
|
|
||||||
white=weiße
|
|
||||||
Frameless @1 clock=Rahmenlosse @1 Uhr
|
|
||||||
|
|
||||||
|
|
||||||
##### not used anymore #####
|
|
||||||
|
|
||||||
Frameless clock=Rahmenlose Uhr
|
|
||||||
Frameless gold clock=Rahmenlose goldene Uhr
|
|
||||||
Frameless white clock=Rahmenlose weiße Uhr
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# textdomain: ontime_clocks
|
|
||||||
Green digital clock=Horloge numérique verte
|
|
||||||
Red digital clock=Horloge numérique rouge
|
|
||||||
White clock=Horloge blanche
|
|
||||||
@1 frameless @2 clock=Horloge @2 sans cadre @1
|
|
||||||
gold=dorée
|
|
||||||
black=noire
|
|
||||||
white=blanche
|
|
||||||
Frameless @1 clock=Horloge @1 sans cadre
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# textdomain: ontime_clocks
|
|
||||||
Green digital clock=Jam digital hijau
|
|
||||||
Red digital clock=Jam digital merah
|
|
||||||
White clock=Jam putih
|
|
||||||
@1 frameless @2 clock=
|
|
||||||
gold=
|
|
||||||
black=
|
|
||||||
white=
|
|
||||||
Frameless @1 clock=
|
|
||||||
|
|
||||||
|
|
||||||
##### not used anymore #####
|
|
||||||
|
|
||||||
Frameless clock=Jam tanpa bingkai
|
|
||||||
Frameless gold clock=Jam emas tanpa bingkai
|
|
||||||
Frameless white clock=Jam putih tanpa bingkai
|
|
||||||
42
ontime_clocks/locale/template.pot
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-08-26 11:21+0200\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=CHARSET\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Green digital clock"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Red digital clock"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "White clock"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Frameless clock"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Frameless gold clock"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Frameless white clock"
|
||||||
|
msgstr ""
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# textdomain: ontime_clocks
|
|
||||||
Green digital clock=
|
|
||||||
Red digital clock=
|
|
||||||
White clock=
|
|
||||||
@1 frameless @2 clock=
|
|
||||||
gold=
|
|
||||||
black=
|
|
||||||
white=
|
|
||||||
Frameless @1 clock=
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
name = ontime_clocks
|
name = ontime_clocks
|
||||||
title = Ontime Clocks
|
title = Ontime Clocks
|
||||||
description = Clocks displaing real ingame time
|
description = Clocks displaing real ingame time
|
||||||
depends = display_api, xcompat
|
depends = default,dye,display_api
|
||||||
|
optional_depends = intllib
|
||||||
|
|||||||
@@ -18,44 +18,10 @@
|
|||||||
along with ontime_clocks. If not, see <http://www.gnu.org/licenses/>.
|
along with ontime_clocks. If not, see <http://www.gnu.org/licenses/>.
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
local S = ontime_clocks.S
|
local S = ontime_clocks.intllib
|
||||||
|
|
||||||
local function clock_on_construct(pos)
|
|
||||||
local timer = minetest.get_node_timer(pos)
|
|
||||||
timer:start(5)
|
|
||||||
display_api.on_construct(pos)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function clock_on_timer(pos)
|
|
||||||
display_api.update_entities(pos)
|
|
||||||
return true
|
|
||||||
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
|
||||||
register_clock("ontime_clocks:green_digital", {
|
minetest.register_node("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",
|
||||||
@@ -64,15 +30,12 @@ register_clock("ontime_clocks:green_digital", {
|
|||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "wallmounted",
|
type = "wallmounted",
|
||||||
wall_side = {-0.5, -3/16, -7/16, -13/32, 7/32, 7/16},
|
wall_side = { -0.5, -3/16, -7/16, -13/32, 7/32, 7/16 },
|
||||||
wall_bottom = {-7/16, -0.5, -3/16, 7/16, -13/32, 7/32},
|
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}
|
wall_bottom = { -7/16, -0.5, -3/16, 7/16, -13/32, 7/32 },
|
||||||
},
|
},
|
||||||
tiles = {"ontime_clocks_digital.png"},
|
tiles = {"ontime_clocks_digital.png"},
|
||||||
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, handy = 1},
|
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
||||||
_mcl_hardness = 0.8,
|
|
||||||
_mcl_blast_resistance = 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,
|
||||||
@@ -82,11 +45,21 @@ register_clock("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 = display_api.on_construct,
|
||||||
|
on_destruct = display_api.on_destruct,
|
||||||
|
on_rotate = display_api.on_rotate,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"ontime_clocks:green_digital"},
|
||||||
|
interval = 5,
|
||||||
|
chance = 1,
|
||||||
|
action = display_api.update_entities,
|
||||||
|
})
|
||||||
|
|
||||||
-- Red digital clock
|
-- Red digital clock
|
||||||
register_clock("ontime_clocks:red_digital", {
|
minetest.register_node("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",
|
||||||
@@ -95,15 +68,12 @@ register_clock("ontime_clocks:red_digital", {
|
|||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "wallmounted",
|
type = "wallmounted",
|
||||||
wall_side = {-0.5, -3/16, -7/16, -13/32, 7/32, 7/16},
|
wall_side = { -0.5, -3/16, -7/16, -13/32, 7/32, 7/16 },
|
||||||
wall_bottom = {-7/16, -0.5, -3/16, 7/16, -13/32, 7/32},
|
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
|
||||||
wall_top = {-7/16, 0.5, -7/32, 7/16, 13/32, 3/16}
|
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
|
||||||
},
|
},
|
||||||
tiles = {"ontime_clocks_digital.png"},
|
tiles = {"ontime_clocks_digital.png"},
|
||||||
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, handy = 1},
|
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
||||||
_mcl_hardness = 0.8,
|
|
||||||
_mcl_blast_resistance = 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,
|
||||||
@@ -113,10 +83,21 @@ register_clock("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 = display_api.on_construct,
|
||||||
|
on_destruct = display_api.on_destruct,
|
||||||
|
on_rotate = display_api.on_rotate,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"ontime_clocks:red_digital"},
|
||||||
|
interval = 5,
|
||||||
|
chance = 1,
|
||||||
|
action = display_api.update_entities,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
register_clock("ontime_clocks:white", {
|
minetest.register_node("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",
|
||||||
@@ -130,10 +111,7 @@ register_clock("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, handy = 1},
|
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
|
||||||
_mcl_hardness = 0.8,
|
|
||||||
_mcl_blast_resistance = 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,
|
||||||
@@ -143,105 +121,126 @@ register_clock("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 = display_api.on_construct,
|
||||||
|
on_destruct = display_api.on_destruct,
|
||||||
|
on_rotate = display_api.on_rotate,
|
||||||
})
|
})
|
||||||
|
|
||||||
local function register_large_clock(name, label, color, size)
|
minetest.register_abm({
|
||||||
local sstr = size .. "x" .. size -- Size string
|
nodenames = {"ontime_clocks:white"},
|
||||||
register_clock("ontime_clocks:" .. sstr .. "_clock_" .. name, {
|
interval = 5,
|
||||||
description = S("@1 frameless @2 clock", sstr, label),
|
chance = 1,
|
||||||
inventory_image = "ontime_clocks_large_clock_inventory.png^[colorize:" ..
|
action = display_api.update_entities,
|
||||||
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
|
|
||||||
|
|
||||||
local models = {
|
minetest.register_node("ontime_clocks:frameless_black", {
|
||||||
{ name = "gold", label = S("gold"), color = "#FF0" },
|
description = S("Frameless clock"),
|
||||||
{ name = "black", label = S("black"), color = "#000" },
|
inventory_image = "ontime_clocks_frameless_inventory.png",
|
||||||
{ name = "white", label = S("white"), color = "#FFF" },
|
wield_image = "ontime_clocks_frameless_inventory.png",
|
||||||
}
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
|
drawtype = "nodebox",
|
||||||
|
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},
|
||||||
|
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 = display_api.on_construct,
|
||||||
|
on_destruct = display_api.on_destruct,
|
||||||
|
on_rotate = display_api.on_rotate,
|
||||||
|
})
|
||||||
|
|
||||||
for _, model in ipairs(models) do
|
minetest.register_abm({
|
||||||
-- Frameless clock
|
nodenames = {"ontime_clocks:frameless_black"},
|
||||||
register_clock("ontime_clocks:frameless_" .. model.name, {
|
interval = 5,
|
||||||
description = S("Frameless @1 clock", model.label),
|
chance = 1,
|
||||||
inventory_image = "ontime_clocks_frameless_inventory.png^[colorize:" .. model.color,
|
action = display_api.update_entities,
|
||||||
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 },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- 3x3 large clock
|
minetest.register_node("ontime_clocks:frameless_gold", {
|
||||||
register_large_clock(model.name, model.label, model.color, 3)
|
description = S("Frameless gold clock"),
|
||||||
|
inventory_image = "ontime_clocks_frameless_inventory.png^[colorize:#FF0",
|
||||||
|
wield_image = "ontime_clocks_frameless_inventory.png^[colorize:#FF0",
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
|
drawtype = "nodebox",
|
||||||
|
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},
|
||||||
|
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 = display_api.on_construct,
|
||||||
|
on_destruct = display_api.on_destruct,
|
||||||
|
on_rotate = display_api.on_rotate,
|
||||||
|
})
|
||||||
|
|
||||||
-- 5x5 large clock
|
minetest.register_abm({
|
||||||
register_large_clock(model.name, model.label, model.color, 5)
|
nodenames = {"ontime_clocks:frameless_gold"},
|
||||||
end
|
interval = 5,
|
||||||
|
chance = 1,
|
||||||
|
action = display_api.update_entities,
|
||||||
|
})
|
||||||
|
|
||||||
|
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",
|
||||||
|
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},
|
||||||
|
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 = display_api.on_construct,
|
||||||
|
on_destruct = display_api.on_destruct,
|
||||||
|
on_rotate = display_api.on_rotate,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"ontime_clocks:frameless_white"},
|
||||||
|
interval = 5,
|
||||||
|
chance = 1,
|
||||||
|
action = display_api.update_entities,
|
||||||
|
})
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 162 B |
|
Before Width: | Height: | Size: 272 B |
|
Before Width: | Height: | Size: 163 B |
|
Before Width: | Height: | Size: 162 B |
|
Before Width: | Height: | Size: 162 B |
|
Before Width: | Height: | Size: 270 B |
|
Before Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 162 B |
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 463 B |
25
ontime_clocks/tools/updatepo.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# To create a new translation:
|
||||||
|
# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot
|
||||||
|
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")/..";
|
||||||
|
|
||||||
|
# Extract translatable strings.
|
||||||
|
xgettext --from-code=UTF-8 \
|
||||||
|
--language=Lua \
|
||||||
|
--sort-by-file \
|
||||||
|
--keyword=S \
|
||||||
|
--keyword=NS:1,2 \
|
||||||
|
--keyword=N_ \
|
||||||
|
--keyword=F \
|
||||||
|
--add-comments='Translators:' \
|
||||||
|
--add-location=file \
|
||||||
|
-o locale/template.pot \
|
||||||
|
$(find . -name '*.lua')
|
||||||
|
|
||||||
|
# Update translations.
|
||||||
|
find locale -name '*.po' | while read -r file; do
|
||||||
|
echo $file
|
||||||
|
msgmerge --update $file locale/template.pot;
|
||||||
|
done
|
||||||
166
signs/LICENSE.txt
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ This mod provides various signs with text display. Text is locked if area is pro
|
|||||||
|
|
||||||
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.
|
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.
|
||||||
|
|
||||||
**Dependencies**: xcompat, display\_lib, font\_lib
|
**Dependancies**: default, display\_lib, font\_lib
|
||||||
|
|
||||||
**License**: Code under LGPL, Textures and models under CC-BY-SA
|
**License**: Code under LGPL, Textures and models under CC-BY-SA
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
|
local S = signs.intllib
|
||||||
|
local F = function(...) return minetest.formspec_escape(S(...)) end
|
||||||
|
|
||||||
-- Generic callback for show_formspec displayed formspecs of "sign" mod
|
-- Generic callback for show_formspec displayed formspecs of "sign" mod
|
||||||
|
|
||||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
|
|||||||
@@ -61,16 +61,9 @@ minetest.register_lbm({ name = "signs:conpatibility_1",
|
|||||||
-- We need to have this entity registered to be able to remove it.
|
-- We need to have this entity registered to be able to remove it.
|
||||||
if minetest.registered_entities["signs:text"] == nil then
|
if minetest.registered_entities["signs:text"] == nil then
|
||||||
minetest.register_entity("signs:text", {
|
minetest.register_entity("signs:text", {
|
||||||
on_activate = function(self)
|
collisionbox = { 0, 0, 0, 0, 0, 0 },
|
||||||
if self.object then
|
visual = "upright_sprite",
|
||||||
self.object:remove()
|
textures = {},
|
||||||
end
|
|
||||||
end,
|
|
||||||
initial_properties = {
|
|
||||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
|
||||||
visual = "upright_sprite",
|
|
||||||
textures = {}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
10
signs/copyright.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Code, Textures and Models by Pierre-Yves Rollo (pyrollo)
|
||||||
|
intllib support (i18n) by (fat115)
|
||||||
|
intllib fallback code and tools by Diego Martínez (kaeza)
|
||||||
|
Extra contributors:
|
||||||
|
(gpcf)
|
||||||
|
(Thomas--S)
|
||||||
|
Translations:
|
||||||
|
Muhammad Nur Hidayat Yasuyoshi (MuhdNurHidayat)
|
||||||
|
(fat115)
|
||||||
|
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
local mat = xcompat.materials
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'signs:wooden_right_sign',
|
output = 'signs:wooden_right_sign',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
{'group:wood', 'group:wood', mat.dye_black},
|
{'group:wood', 'group:wood', 'dye:black'},
|
||||||
{'', '', ''},
|
{'', '', ''},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -18,7 +16,7 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'signs:wooden_long_sign',
|
output = 'signs:wooden_long_sign',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'group:wood', mat.dye_black, 'group:wood'},
|
{'group:wood', 'dye:black', 'group:wood'},
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
{'', '', ''},
|
{'', '', ''},
|
||||||
}
|
}
|
||||||
@@ -33,7 +31,7 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'signs:wooden_sign',
|
output = 'signs:wooden_sign',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'', mat.dye_black, ''},
|
{'', 'dye:black', ''},
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
{'group:wood', 'group:wood', 'group:wood'},
|
||||||
}
|
}
|
||||||
@@ -42,40 +40,22 @@ minetest.register_craft({
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'signs:paper_poster',
|
output = 'signs:paper_poster',
|
||||||
recipe = {
|
recipe = {
|
||||||
{mat.paper, mat.paper, mat.dye_black},
|
{'default:paper', 'default:paper', 'dye:black'},
|
||||||
{mat.paper, mat.paper, ''},
|
{'default:paper', 'default:paper', ''},
|
||||||
{mat.paper, mat.paper, ''},
|
{'default:paper', 'default:paper', ''},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
local dyes = {
|
|
||||||
mat.dye_white,
|
|
||||||
mat.dye_grey,
|
|
||||||
mat.dye_orange,
|
|
||||||
mat.dye_brown,
|
|
||||||
mat.dye_dark_grey,
|
|
||||||
mat.dye_yellow,
|
|
||||||
mat.dye_green,
|
|
||||||
mat.dye_red,
|
|
||||||
}
|
|
||||||
for i, dye in ipairs(dyes) do
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "shapeless",
|
|
||||||
output = minetest.itemstring_with_palette("signs:paper_poster", (i-1) * 32),
|
|
||||||
recipe = {"signs:paper_poster", dye},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'signs:label_small',
|
output = 'signs:label_small',
|
||||||
recipe = {
|
recipe = {
|
||||||
{mat.paper, mat.dye_black},
|
{'default:paper', 'dye:black'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'signs:label_medium',
|
output = 'signs:label_medium',
|
||||||
recipe = {
|
recipe = {
|
||||||
{mat.paper, mat.paper, mat.dye_black},
|
{'default:paper', 'default:paper', 'dye:black'},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -22,14 +22,13 @@ signs = {}
|
|||||||
signs.name = minetest.get_current_modname()
|
signs.name = minetest.get_current_modname()
|
||||||
signs.path = minetest.get_modpath(signs.name)
|
signs.path = minetest.get_modpath(signs.name)
|
||||||
|
|
||||||
-- Translation support
|
-- Load support for intllib.
|
||||||
signs.S = minetest.get_translator(signs.name)
|
local S, NS = dofile(signs.path.."/intllib.lua")
|
||||||
|
signs.intllib = S
|
||||||
|
|
||||||
dofile(signs.path.."/common.lua")
|
dofile(signs.path.."/common.lua")
|
||||||
dofile(signs.path.."/nodes.lua")
|
dofile(signs.path.."/nodes.lua")
|
||||||
dofile(signs.path.."/crafts.lua")
|
dofile(signs.path.."/crafts.lua")
|
||||||
dofile(signs.path.."/compatibility.lua")
|
dofile(signs.path.."/compatibility.lua")
|
||||||
|
|
||||||
|
minetest.log("action", "[signs] loaded.")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
45
signs/intllib.lua
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
-- Fallback functions for when `intllib` is not installed.
|
||||||
|
-- Code released under Unlicense <http://unlicense.org>.
|
||||||
|
|
||||||
|
-- Get the latest version of this file at:
|
||||||
|
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
||||||
|
|
||||||
|
local function format(str, ...)
|
||||||
|
local args = { ... }
|
||||||
|
local function repl(escape, open, num, close)
|
||||||
|
if escape == "" then
|
||||||
|
local replacement = tostring(args[tonumber(num)])
|
||||||
|
if open == "" then
|
||||||
|
replacement = replacement..close
|
||||||
|
end
|
||||||
|
return replacement
|
||||||
|
else
|
||||||
|
return "@"..open..num..close
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
||||||
|
end
|
||||||
|
|
||||||
|
local gettext, ngettext
|
||||||
|
if minetest.get_modpath("intllib") then
|
||||||
|
if intllib.make_gettext_pair then
|
||||||
|
-- New method using gettext.
|
||||||
|
gettext, ngettext = intllib.make_gettext_pair()
|
||||||
|
else
|
||||||
|
-- Old method using text files.
|
||||||
|
gettext = intllib.Getter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Fill in missing functions.
|
||||||
|
|
||||||
|
gettext = gettext or function(msgid, ...)
|
||||||
|
return format(msgid, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
||||||
|
return format(n==1 and msgid or msgid_plural, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
return gettext, ngettext
|
||||||
54
signs/locale/fr.po
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: \n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-08-26 13:20+0200\n"
|
||||||
|
"PO-Revision-Date: 2017-05-08 07:08+0200\n"
|
||||||
|
"Last-Translator: Peppy <peppy@twang-factory.com>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"Language: fr\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: Poedit 1.8.12\n"
|
||||||
|
|
||||||
|
#: common.lua nodes.lua
|
||||||
|
msgid "Text"
|
||||||
|
msgstr "Texte"
|
||||||
|
|
||||||
|
#: common.lua nodes.lua
|
||||||
|
msgid "Write"
|
||||||
|
msgstr "Écrire"
|
||||||
|
|
||||||
|
#: common.lua
|
||||||
|
#, lua-format
|
||||||
|
msgid " (first %s lines only)"
|
||||||
|
msgstr " (uniquement les %s premières lignes)"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Title"
|
||||||
|
msgstr "Titre"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Close"
|
||||||
|
msgstr "Fermer"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "(right-click to read more text)"
|
||||||
|
msgstr "(Clic-droit pour afficher le texte entier)"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Wooden direction sign"
|
||||||
|
msgstr "Panneau de direction en bois"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Poster"
|
||||||
|
msgstr "Affiche"
|
||||||
|
|
||||||
|
#~ msgid "Textd"
|
||||||
|
#~ msgstr "Texte"
|
||||||
51
signs/locale/ms.po
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# Yaya (Nurul Azeera Hidayah @ Muhammad Nur Hidayat) <translation@mnh48.moe>, 2017.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Display Modpack\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-08-26 13:20+0200\n"
|
||||||
|
"PO-Revision-Date: 2020-07-05 11:34+0000\n"
|
||||||
|
"Last-Translator: Yaya MNH48 <translation@mnh48.moe>\n"
|
||||||
|
"Language-Team: Malay <translation@mnh48.moe>\n"
|
||||||
|
"Language: ms\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
"X-Generator: Poedit 2.3\n"
|
||||||
|
|
||||||
|
#: common.lua nodes.lua
|
||||||
|
msgid "Text"
|
||||||
|
msgstr "Teks"
|
||||||
|
|
||||||
|
#: common.lua nodes.lua
|
||||||
|
msgid "Write"
|
||||||
|
msgstr "Tulis"
|
||||||
|
|
||||||
|
#: common.lua
|
||||||
|
#, lua-format
|
||||||
|
msgid " (first %s lines only)"
|
||||||
|
msgstr " (%s baris pertama sahaja)"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Title"
|
||||||
|
msgstr "Tajuk"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Close"
|
||||||
|
msgstr "Tutup"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "(right-click to read more text)"
|
||||||
|
msgstr "(klik-kanan untuk baca teks penuh)"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Wooden direction sign"
|
||||||
|
msgstr "Papan tanda arah kayu"
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Poster"
|
||||||
|
msgstr "Poster"
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# textdomain: signs
|
|
||||||
Close=Schließen
|
|
||||||
Edit=Bearbeiten
|
|
||||||
Title=Titel
|
|
||||||
Text=Text
|
|
||||||
Title font=Titel Schriftart
|
|
||||||
Write=Schreiben
|
|
||||||
(right-click to read more text)=(Rechtsklick für mehr Text)
|
|
||||||
Wooden sign=Hölzernes Schild
|
|
||||||
Wooden long sign=Langes hölzernes Schild
|
|
||||||
Wooden direction sign=Hölzerner Wegweiser
|
|
||||||
Poster=Poster
|
|
||||||
Small label=Kleines Etikett
|
|
||||||
Label=Etikett
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# textdomain: signs
|
|
||||||
Close=Fermer
|
|
||||||
Edit=Éditer
|
|
||||||
Title=Titre
|
|
||||||
Text=Texte
|
|
||||||
Title font=Police de titre
|
|
||||||
Write=Écrire
|
|
||||||
(right-click to read more text)=(Clic-droit pour afficher le texte entier)
|
|
||||||
Wooden sign=Signe en bois
|
|
||||||
Wooden long sign=Long signe en bois
|
|
||||||
Wooden direction sign=Panneau de direction en bois
|
|
||||||
Poster=Affiche
|
|
||||||
Small label=Petite étiquette
|
|
||||||
Label=Étiquette
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# textdomain: signs
|
|
||||||
Close=
|
|
||||||
Edit=
|
|
||||||
Title=
|
|
||||||
Text=
|
|
||||||
Title font=
|
|
||||||
Write=
|
|
||||||
(right-click to read more text)=(klik-kanan untuk baca teks penuh)
|
|
||||||
Wooden sign=
|
|
||||||
Wooden long sign=
|
|
||||||
Wooden direction sign=Papan tanda arah kayu
|
|
||||||
Poster=Poster
|
|
||||||
Small label=
|
|
||||||
Label=
|
|
||||||
51
signs/locale/template.pot
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-08-26 13:20+0200\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=CHARSET\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: common.lua nodes.lua
|
||||||
|
msgid "Text"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: common.lua nodes.lua
|
||||||
|
msgid "Write"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: common.lua
|
||||||
|
#, lua-format
|
||||||
|
msgid " (first %s lines only)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Title"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Close"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "(right-click to read more text)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Wooden direction sign"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
msgid "Poster"
|
||||||
|
msgstr ""
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# textdomain: signs
|
|
||||||
Close=
|
|
||||||
Edit=
|
|
||||||
Title=
|
|
||||||
Text=
|
|
||||||
Title font=
|
|
||||||
Write=
|
|
||||||
(right-click to read more text)=
|
|
||||||
Wooden sign=
|
|
||||||
Wooden long sign=
|
|
||||||
Wooden direction sign=
|
|
||||||
Poster=
|
|
||||||
Small label=
|
|
||||||
Label=
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
name = signs
|
name = signs
|
||||||
title = Signs
|
title = Signs
|
||||||
description = Basic signs and posters with text display using signs_api
|
description = Basic signs and posters with text display using signs_api
|
||||||
depends = signs_api, xcompat
|
depends = default,dye,signs_api
|
||||||
|
optional_depends = intllib
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
local S = signs.S
|
local S = signs.intllib
|
||||||
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
local F = function(...) return minetest.formspec_escape(S(...)) end
|
||||||
|
|
||||||
-- Poster specific formspec
|
-- Poster specific formspec
|
||||||
local function display_poster(pos, node, player)
|
local function display_poster(pos, node, player)
|
||||||
@@ -43,14 +43,15 @@ local function display_poster(pos, node, player)
|
|||||||
style_type[textarea;textcolor=#111]
|
style_type[textarea;textcolor=#111]
|
||||||
textarea[0.3,1.5;7,8;;%s;]]=],
|
textarea[0.3,1.5;7,8;;%s;]]=],
|
||||||
titletexture,
|
titletexture,
|
||||||
minetest.formspec_escape(meta:get_string("text")))
|
minetest.colorize("#111",
|
||||||
|
minetest.formspec_escape(meta:get_string("text"))))
|
||||||
|
|
||||||
if minetest.is_protected(pos, player:get_player_name()) then
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
fs = string.format("%sbutton_exit[2.5,8;2,1;ok;%s]", fs, FS("Close"))
|
fs = string.format("%sbutton_exit[2.5,8;2,1;ok;%s]", fs, F("Close"))
|
||||||
else
|
else
|
||||||
fs = string.format(
|
fs = string.format(
|
||||||
"%sbutton[1,8;2,1;edit;%s]button_exit[4,8;2,1;ok;%s]",
|
"%sbutton[1,8;2,1;edit;%s]button_exit[4,8;2,1;ok;%s]",
|
||||||
fs, FS("Edit"), FS("Close"))
|
fs, F("Edit"), F("Close"))
|
||||||
end
|
end
|
||||||
minetest.show_formspec(player:get_player_name(), fname, fs)
|
minetest.show_formspec(player:get_player_name(), fname, fs)
|
||||||
end
|
end
|
||||||
@@ -64,15 +65,15 @@ local function edit_poster(pos, node, player)
|
|||||||
|
|
||||||
if not minetest.is_protected(pos, player:get_player_name()) then
|
if not minetest.is_protected(pos, player:get_player_name()) then
|
||||||
fs = string.format([=[
|
fs = string.format([=[
|
||||||
size[6.5,7.5]
|
size[6.5,7.5]%s%s%s
|
||||||
field[0.5,0.7;6,1;display_text;%s;%s]
|
field[0.5,0.7;6,1;display_text;%s;%s]
|
||||||
textarea[0.5,1.7;6,6;text;%s;%s]
|
textarea[0.5,1.7;6,6;text;%s;%s]
|
||||||
button[1.25,7;2,1;font;%s]
|
button[1.25,7;2,1;font;%s]
|
||||||
button_exit[3.25,7;2,1;write;%s]]=],
|
button_exit[3.25,7;2,1;write;%s]]=],
|
||||||
FS("Title"),
|
default.gui_bg, default.gui_bg_img, default.gui_slots, F("Title"),
|
||||||
minetest.formspec_escape(meta:get_string("display_text")),
|
minetest.formspec_escape(meta:get_string("display_text")),
|
||||||
FS("Text"), minetest.formspec_escape(meta:get_string("text")),
|
F("Text"), minetest.formspec_escape(meta:get_string("text")),
|
||||||
FS("Title font"), FS("Write"))
|
F("Title font"), F("Write"))
|
||||||
minetest.show_formspec(player:get_player_name(), fname, fs)
|
minetest.show_formspec(player:get_player_name(), fname, fs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -94,17 +95,17 @@ local function on_receive_fields_poster(pos, formname, fields, player)
|
|||||||
meta:set_string("display_text", fields.display_text)
|
meta:set_string("display_text", fields.display_text)
|
||||||
meta:set_string("text", fields.text)
|
meta:set_string("text", fields.text)
|
||||||
meta:set_string("infotext", "\""..fields.display_text
|
meta:set_string("infotext", "\""..fields.display_text
|
||||||
.."\"\n"..FS("(right-click to read more text)"))
|
.."\"\n"..S("(right-click to read more text)"))
|
||||||
display_api.update_entities(pos)
|
display_api.update_entities(pos)
|
||||||
end
|
end
|
||||||
if (fields.write or fields.key_enter) then
|
if (fields.write or fields.key_enter) then
|
||||||
display_poster(pos, node, player)
|
display_poster(pos, node, player)
|
||||||
elseif (fields.font) then
|
elseif (fields.font) then
|
||||||
font_api.show_font_list(player, pos, function (playername, npos)
|
font_api.show_font_list(player, pos, function (playername, pos)
|
||||||
local user = minetest.get_player_by_name(playername)
|
local player = minetest.get_player_by_name(playername)
|
||||||
local node2 = minetest.get_node(npos)
|
local node = minetest.get_node(pos)
|
||||||
if user and node2 then
|
if player and node then
|
||||||
edit_poster(npos, node2, user)
|
edit_poster(pos, node, player)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@@ -130,8 +131,6 @@ local models = {
|
|||||||
tiles = { "signs_wooden.png" },
|
tiles = { "signs_wooden.png" },
|
||||||
inventory_image = "signs_wooden_inventory.png",
|
inventory_image = "signs_wooden_inventory.png",
|
||||||
groups= { dig_immediate = 2 },
|
groups= { dig_immediate = 2 },
|
||||||
_mcl_hardness = 0.8,
|
|
||||||
_mcl_blast_resistance = 1,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wooden_long_sign = {
|
wooden_long_sign = {
|
||||||
@@ -150,8 +149,6 @@ local models = {
|
|||||||
},
|
},
|
||||||
inventory_image = "signs_wooden_long_inventory.png",
|
inventory_image = "signs_wooden_long_inventory.png",
|
||||||
groups= { dig_immediate = 2 },
|
groups= { dig_immediate = 2 },
|
||||||
_mcl_hardness = 0.8,
|
|
||||||
_mcl_blast_resistance = 1,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wooden_right_sign = {
|
wooden_right_sign = {
|
||||||
@@ -171,10 +168,8 @@ local models = {
|
|||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "signs_dir_right.obj",
|
mesh = "signs_dir_right.obj",
|
||||||
selection_box = { type="fixed", fixed = {-0.5, -7/32, 0.5, 7/16, 7/32, 7/16}},
|
selection_box = { type="fixed", fixed = {-0.5, -7/32, 0.5, 7/16, 7/32, 7/16}},
|
||||||
collision_box = { type="fixed", fixed = {-7/16, -7/32, 0.5, 0.5, 7/32, 7/16}},
|
collision_box = { type="fixed", fixed = {-0,5, -7/32, 0.5, 7/16, 7/32, 7/16}},
|
||||||
groups= { dig_immediate = 2 },
|
groups= { dig_immediate = 2 },
|
||||||
_mcl_hardness = 0.8,
|
|
||||||
_mcl_blast_resistance = 1,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wooden_left_sign = {
|
wooden_left_sign = {
|
||||||
@@ -195,8 +190,6 @@ local models = {
|
|||||||
selection_box = { type="fixed", fixed = {-7/16, -7/32, 0.5, 0.5, 7/32, 7/16}},
|
selection_box = { type="fixed", fixed = {-7/16, -7/32, 0.5, 0.5, 7/32, 7/16}},
|
||||||
collision_box = { type="fixed", fixed = {-7/16, -7/32, 0.5, 0.5, 7/32, 7/16}},
|
collision_box = { type="fixed", fixed = {-7/16, -7/32, 0.5, 0.5, 7/32, 7/16}},
|
||||||
groups = { not_in_creative_inventory = 1, dig_immediate = 2 },
|
groups = { not_in_creative_inventory = 1, dig_immediate = 2 },
|
||||||
_mcl_hardness = 0.8,
|
|
||||||
_mcl_blast_resistance = 1,
|
|
||||||
drop = "signs:wooden_right_sign",
|
drop = "signs:wooden_right_sign",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -214,12 +207,7 @@ local models = {
|
|||||||
"signs_poster_sides.png", "signs_poster_sides.png",
|
"signs_poster_sides.png", "signs_poster_sides.png",
|
||||||
"signs_poster_sides.png", "signs_poster.png" },
|
"signs_poster_sides.png", "signs_poster.png" },
|
||||||
inventory_image = "signs_poster_inventory.png",
|
inventory_image = "signs_poster_inventory.png",
|
||||||
use_texture_alpha = "clip",
|
groups= { dig_immediate = 3 },
|
||||||
paramtype2 = "colorfacedir",
|
|
||||||
palette = "signs_poster_palette.png",
|
|
||||||
groups= { dig_immediate = 2 },
|
|
||||||
_mcl_hardness = 0.8,
|
|
||||||
_mcl_blast_resistance = 1,
|
|
||||||
on_construct = display_api.on_construct,
|
on_construct = display_api.on_construct,
|
||||||
on_rightclick = display_poster,
|
on_rightclick = display_poster,
|
||||||
on_receive_fields = on_receive_fields_poster,
|
on_receive_fields = on_receive_fields_poster,
|
||||||
@@ -239,9 +227,7 @@ local models = {
|
|||||||
description = S("Small label"),
|
description = S("Small label"),
|
||||||
tiles = { "signs_label.png" },
|
tiles = { "signs_label.png" },
|
||||||
inventory_image = "signs_label_small_inventory.png",
|
inventory_image = "signs_label_small_inventory.png",
|
||||||
groups= { dig_immediate = 2 },
|
groups= { dig_immediate = 3 },
|
||||||
_mcl_hardness = 0.8,
|
|
||||||
_mcl_blast_resistance = 1,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
label_medium = {
|
label_medium = {
|
||||||
@@ -255,9 +241,7 @@ local models = {
|
|||||||
description = S("Label"),
|
description = S("Label"),
|
||||||
tiles = { "signs_label.png" },
|
tiles = { "signs_label.png" },
|
||||||
inventory_image = "signs_label_medium_inventory.png",
|
inventory_image = "signs_label_medium_inventory.png",
|
||||||
groups= { dig_immediate = 2 },
|
groups= { dig_immediate = 3 },
|
||||||
_mcl_hardness = 0.8,
|
|
||||||
_mcl_blast_resistance = 1,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 101 B |
25
signs/tools/updatepo.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# To create a new translation:
|
||||||
|
# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot
|
||||||
|
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")/..";
|
||||||
|
|
||||||
|
# Extract translatable strings.
|
||||||
|
xgettext --from-code=UTF-8 \
|
||||||
|
--language=Lua \
|
||||||
|
--sort-by-file \
|
||||||
|
--keyword=S \
|
||||||
|
--keyword=NS:1,2 \
|
||||||
|
--keyword=N_ \
|
||||||
|
--keyword=F \
|
||||||
|
--add-comments='Translators:' \
|
||||||
|
--add-location=file \
|
||||||
|
-o locale/template.pot \
|
||||||
|
$(find . -name '*.lua')
|
||||||
|
|
||||||
|
# Update translations.
|
||||||
|
find locale -name '*.po' | while read -r file; do
|
||||||
|
echo $file
|
||||||
|
msgmerge --update $file locale/template.pot;
|
||||||
|
done
|
||||||
166
signs_api/LICENSE.txt
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
||||||
|
|
||||||
@@ -5,7 +5,7 @@ No actual signs get registered by this mod, the signs are defined in the sign su
|
|||||||
|
|
||||||
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.
|
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.
|
||||||
|
|
||||||
**Dependencies**: xcompat, display\_lib, font\_lib
|
**Dependancies**: default, display\_lib, font\_lib
|
||||||
|
|
||||||
**License**: Code under LGPL, Textures and models under CC-BY-SA
|
**License**: Code under LGPL, Textures and models under CC-BY-SA
|
||||||
|
|
||||||
|
|||||||
10
signs_api/copyright.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Code by Pierre-Yves Rollo (pyrollo)
|
||||||
|
intllib support (i18n) by (fat115)
|
||||||
|
intllib fallback code and tools by Diego Martínez (kaeza)
|
||||||
|
Extra contributors:
|
||||||
|
(gpcf)
|
||||||
|
(Thomas--S)
|
||||||
|
Translations:
|
||||||
|
Muhammad Nur Hidayat Yasuyoshi (MuhdNurHidayat)
|
||||||
|
(fat115)
|
||||||
|
|
||||||
@@ -22,14 +22,13 @@ signs_api = {}
|
|||||||
signs_api.name = minetest.get_current_modname()
|
signs_api.name = minetest.get_current_modname()
|
||||||
signs_api.path = minetest.get_modpath(signs_api.name)
|
signs_api.path = minetest.get_modpath(signs_api.name)
|
||||||
|
|
||||||
-- Translation support
|
-- Load support for intllib.
|
||||||
local S = minetest.get_translator(signs_api.name)
|
local S, NS = dofile(signs_api.path.."/intllib.lua")
|
||||||
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
signs_api.intllib = S
|
||||||
|
local F = function(...) return minetest.formspec_escape(S(...)) end
|
||||||
|
|
||||||
function signs_api.set_display_text(pos, text, font)
|
function signs_api.set_display_text(pos, text, font)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
-- Fix pasting from Windows: CR instead of LF
|
|
||||||
text = string.gsub(text, "\r\n?", "\n")
|
|
||||||
meta:set_string("display_text", text)
|
meta:set_string("display_text", text)
|
||||||
if text and text ~= "" then
|
if text and text ~= "" then
|
||||||
meta:set_string("infotext", "\""..text.."\"")
|
meta:set_string("infotext", "\""..text.."\"")
|
||||||
@@ -49,27 +48,27 @@ function signs_api.set_formspec(pos)
|
|||||||
and ndef.display_entities["signs:display_text"] then
|
and ndef.display_entities["signs:display_text"] then
|
||||||
local maxlines = ndef.display_entities["signs:display_text"].maxlines
|
local maxlines = ndef.display_entities["signs:display_text"].maxlines
|
||||||
local fs, y
|
local fs, y
|
||||||
local display_text = minetest.formspec_escape(meta:get_string("display_text"))
|
|
||||||
|
|
||||||
if maxlines == 1 then
|
if maxlines == 1 then
|
||||||
fs = "field[0.5,0.7;5.5,1;display_text;"..FS("Text")..
|
fs = "field[0.5,0.7;5.5,1;display_text;"..F("Text")..
|
||||||
";" .. display_text .. "]"
|
";${display_text}]"
|
||||||
y = 1.2
|
y = 1.2
|
||||||
else
|
else
|
||||||
local extralabel = ""
|
local extralabel = ""
|
||||||
if maxlines then
|
if maxlines then
|
||||||
extralabel = FS(" (first @1 lines only)", maxlines)
|
extralabel = F(" (first %s lines only)"):format(maxlines)
|
||||||
end
|
end
|
||||||
|
|
||||||
fs = "textarea[0.5,0.7;5.5,2;display_text;"..FS("Text")..""..
|
fs = "textarea[0.5,0.7;5.5,2;display_text;"..F("Text")..""..
|
||||||
extralabel..";" .. display_text .. "]"
|
extralabel..";${display_text}]"
|
||||||
y = 2.4
|
y = 2.4
|
||||||
end
|
end
|
||||||
|
|
||||||
fs = fs.."button[1,"..y..";2,1;font;"..FS("Font").."]"
|
fs = fs.."button[1,"..y..";2,1;font;"..F("Font").."]"
|
||||||
fs = fs.."button_exit[3,"..y..";2,1;ok;"..FS("Write").."]"
|
fs = fs.."button_exit[3,"..y..";2,1;ok;"..F("Write").."]"
|
||||||
y = y + 0.8
|
y = y + 0.8
|
||||||
fs = "size[6,"..y.."]"..fs
|
fs = "size[6,"..y.."]"..default.gui_bg..
|
||||||
|
default.gui_bg_img..default.gui_slots..fs
|
||||||
|
|
||||||
meta:set_string("formspec", fs)
|
meta:set_string("formspec", fs)
|
||||||
end
|
end
|
||||||
@@ -79,11 +78,9 @@ function signs_api.on_receive_fields(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
|
||||||
if fields and (fields.ok or fields.key_enter) then
|
if fields and (fields.ok or fields.key_enter) then
|
||||||
signs_api.set_display_text(pos, fields.display_text)
|
signs_api.set_display_text(pos, fields.display_text)
|
||||||
signs_api.set_formspec(pos)
|
|
||||||
end
|
end
|
||||||
if fields and (fields.font) then
|
if fields and (fields.font) then
|
||||||
signs_api.set_display_text(pos, fields.display_text)
|
signs_api.set_display_text(pos, fields.display_text)
|
||||||
signs_api.set_formspec(pos)
|
|
||||||
font_api.show_font_list(player, pos)
|
font_api.show_font_list(player, pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -94,6 +91,7 @@ end
|
|||||||
function signs_api.on_place_direction(itemstack, placer, pointed_thing)
|
function signs_api.on_place_direction(itemstack, placer, pointed_thing)
|
||||||
local name = itemstack:get_name()
|
local name = itemstack:get_name()
|
||||||
local ndef = minetest.registered_nodes[name]
|
local ndef = minetest.registered_nodes[name]
|
||||||
|
local restriction = display_api.is_rotation_restricted()
|
||||||
|
|
||||||
local bdir = {
|
local bdir = {
|
||||||
x = pointed_thing.under.x - pointed_thing.above.x,
|
x = pointed_thing.under.x - pointed_thing.above.x,
|
||||||
@@ -104,25 +102,33 @@ function signs_api.on_place_direction(itemstack, placer, pointed_thing)
|
|||||||
|
|
||||||
local ndir, test
|
local ndir, test
|
||||||
|
|
||||||
if ndef and (ndef.paramtype2 == "facedir" or ndef.paramtype2 == "colorfacedir") then
|
if ndef.paramtype2 == "facedir" then
|
||||||
-- Wall pointed
|
-- If legacy mode, only accept upright nodes
|
||||||
ndir = minetest.dir_to_facedir(bdir, true)
|
if restriction and bdir.x == 0 and bdir.z == 0 then
|
||||||
|
-- Ceiling or floor pointed (facedir chosen from player dir)
|
||||||
|
ndir = minetest.dir_to_facedir({x=pdir.x, y=0, z=pdir.z})
|
||||||
|
else
|
||||||
|
-- Wall pointed or no rotation restriction
|
||||||
|
ndir = minetest.dir_to_facedir(bdir, not restriction)
|
||||||
|
end
|
||||||
|
|
||||||
test = { [0]=-pdir.x, pdir.z, pdir.x, -pdir.z, -pdir.x, [8]=pdir.x }
|
test = { [0]=-pdir.x, pdir.z, pdir.x, -pdir.z, -pdir.x, [8]=pdir.x }
|
||||||
end
|
end
|
||||||
|
|
||||||
if ndef and ndef.paramtype2 == "wallmounted" then
|
if ndef.paramtype2 == "wallmounted" then
|
||||||
ndir = minetest.dir_to_wallmounted(bdir)
|
ndir = minetest.dir_to_wallmounted(bdir)
|
||||||
|
-- If legacy mode, only accept upright nodes
|
||||||
|
if restriction and (ndir == 0 or ndir == 1) then
|
||||||
|
ndir = minetest.dir_to_wallmounted({x=pdir.x, y=0, z=pdir.z})
|
||||||
|
end
|
||||||
|
|
||||||
test = { [0]=-pdir.x, -pdir.x, pdir.z, -pdir.z, -pdir.x, pdir.x}
|
test = { [0]=-pdir.x, -pdir.x, pdir.z, -pdir.z, -pdir.x, pdir.x}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Only for direction signs
|
-- Only for direction signs
|
||||||
-- TODO:Maybe improve ground and ceiling placement in every directions
|
-- TODO:Maybe improve ground and ceiling placement in every directions
|
||||||
if ndef and ndef.signs_other_dir then
|
if ndef.signs_other_dir then
|
||||||
if not test[ndir] then -- https://github.com/pyrollo/display_modpack/issues/48
|
if test[ndir] > 0 then
|
||||||
return itemstack
|
|
||||||
elseif test[ndir] > 0 then
|
|
||||||
itemstack:set_name(ndef.signs_other_dir)
|
itemstack:set_name(ndef.signs_other_dir)
|
||||||
end
|
end
|
||||||
itemstack = minetest.item_place(itemstack, placer, pointed_thing, ndir)
|
itemstack = minetest.item_place(itemstack, placer, pointed_thing, ndir)
|
||||||
@@ -135,12 +141,13 @@ function signs_api.on_place_direction(itemstack, placer, pointed_thing)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Handles screwdriver rotation
|
-- Handles screwdriver rotation
|
||||||
|
-- (see "if" block below for rotation restriction mode).
|
||||||
signs_api.on_rotate = function(pos, node, player, mode, new_param2)
|
signs_api.on_rotate = function(pos, node, player, mode, new_param2)
|
||||||
-- If rotation mode is 1 and sign is directional, swap direction between
|
-- If rotation mode is 1 and sign is directional, swap direction between
|
||||||
-- each rotation.
|
-- each rotation.
|
||||||
if mode == 1 then
|
if mode == 1 then
|
||||||
local ndef = minetest.registered_nodes[node.name]
|
local ndef = minetest.registered_nodes[node.name]
|
||||||
if ndef and ndef.signs_other_dir then
|
if ndef.signs_other_dir then
|
||||||
-- Switch direction
|
-- Switch direction
|
||||||
node = {name = ndef.signs_other_dir,
|
node = {name = ndef.signs_other_dir,
|
||||||
param1 = node.param1, param2 = node.param2}
|
param1 = node.param1, param2 = node.param2}
|
||||||
@@ -158,6 +165,25 @@ signs_api.on_rotate = function(pos, node, player, mode, new_param2)
|
|||||||
return display_api.on_rotate(pos, node, player, mode, new_param2)
|
return display_api.on_rotate(pos, node, player, mode, new_param2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Legacy mode with rotation restriction
|
||||||
|
-- TODO:When MT < 5.0 no more in use, to be removed
|
||||||
|
if display_api.is_rotation_restricted() then
|
||||||
|
signs_api.on_rotate = function(pos, node, player, mode, new_param2)
|
||||||
|
-- If rotation mode is 2 and sign is directional, swap direction.
|
||||||
|
-- Otherwise use display_api's on_rotate function.
|
||||||
|
if mode == 2 then
|
||||||
|
local ndef = minetest.registered_nodes[node.name]
|
||||||
|
if ndef.signs_other_dir then
|
||||||
|
minetest.swap_node(pos, {name = ndef.signs_other_dir,
|
||||||
|
param1 = node.param1, param2 = node.param2})
|
||||||
|
display_api.update_entities(pos)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return display_api.on_rotate(pos, node, player, mode, new_param2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function signs_api.register_sign(mod, name, model)
|
function signs_api.register_sign(mod, name, model)
|
||||||
-- Default fields
|
-- Default fields
|
||||||
local fields = {
|
local fields = {
|
||||||
@@ -170,9 +196,8 @@ function signs_api.register_sign(mod, name, model)
|
|||||||
fixed = {-model.width/2, -model.height/2, 0.5,
|
fixed = {-model.width/2, -model.height/2, 0.5,
|
||||||
model.width/2, model.height/2, 0.5 - model.depth},
|
model.width/2, model.height/2, 0.5 - model.depth},
|
||||||
},
|
},
|
||||||
groups = {choppy=2, dig_immediate=2, not_blocking_trains=1, display_api=1,signs_api_formspec_lbm=1},
|
groups = {choppy=2, dig_immediate=2, not_blocking_trains=1, display_api=1},
|
||||||
is_ground_content = false,
|
sounds = default.node_sound_defaults(),
|
||||||
sounds = xcompat.sounds.node_sound_default(),
|
|
||||||
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,
|
||||||
@@ -185,21 +210,20 @@ function signs_api.register_sign(mod, name, model)
|
|||||||
},
|
},
|
||||||
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 and 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_blast = display_api.on_blast,
|
|
||||||
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
|
||||||
@@ -226,13 +250,4 @@ end
|
|||||||
-- Text entity for all signs
|
-- Text entity for all signs
|
||||||
display_api.register_display_entity("signs:display_text")
|
display_api.register_display_entity("signs:display_text")
|
||||||
|
|
||||||
-- Update sign formspecs
|
minetest.log("action", "[signs_api] loaded.")
|
||||||
minetest.register_lbm({
|
|
||||||
label = "Update signs_api formspecs",
|
|
||||||
name = "signs_api:update_formspecs",
|
|
||||||
run_at_every_load = false,
|
|
||||||
nodenames = {"group:signs_api_formspec_lbm"},
|
|
||||||
action = function(pos)
|
|
||||||
signs_api.set_formspec(pos)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|||||||
45
signs_api/intllib.lua
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
-- Fallback functions for when `intllib` is not installed.
|
||||||
|
-- Code released under Unlicense <http://unlicense.org>.
|
||||||
|
|
||||||
|
-- Get the latest version of this file at:
|
||||||
|
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
||||||
|
|
||||||
|
local function format(str, ...)
|
||||||
|
local args = { ... }
|
||||||
|
local function repl(escape, open, num, close)
|
||||||
|
if escape == "" then
|
||||||
|
local replacement = tostring(args[tonumber(num)])
|
||||||
|
if open == "" then
|
||||||
|
replacement = replacement..close
|
||||||
|
end
|
||||||
|
return replacement
|
||||||
|
else
|
||||||
|
return "@"..open..num..close
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
||||||
|
end
|
||||||
|
|
||||||
|
local gettext, ngettext
|
||||||
|
if minetest.get_modpath("intllib") then
|
||||||
|
if intllib.make_gettext_pair then
|
||||||
|
-- New method using gettext.
|
||||||
|
gettext, ngettext = intllib.make_gettext_pair()
|
||||||
|
else
|
||||||
|
-- Old method using text files.
|
||||||
|
gettext = intllib.Getter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Fill in missing functions.
|
||||||
|
|
||||||
|
gettext = gettext or function(msgid, ...)
|
||||||
|
return format(msgid, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
||||||
|
return format(n==1 and msgid or msgid_plural, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
return gettext, ngettext
|
||||||
49
signs_api/locale/fr.po
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: \n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-02-01 05:56+0100\n"
|
||||||
|
"PO-Revision-Date: 2017-05-08 07:08+0200\n"
|
||||||
|
"Last-Translator: Peppy <peppy@twang-factory.com>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"Language: fr\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: Poedit 1.8.12\n"
|
||||||
|
|
||||||
|
#: common.lua
|
||||||
|
msgid "Text"
|
||||||
|
msgstr "Texte"
|
||||||
|
|
||||||
|
#: common.lua
|
||||||
|
msgid "Write"
|
||||||
|
msgstr "Écrire"
|
||||||
|
|
||||||
|
#: common.lua
|
||||||
|
#, lua-format
|
||||||
|
msgid " (first %s lines only)"
|
||||||
|
msgstr " (uniquement les %s premières lignes)"
|
||||||
|
|
||||||
|
#~ msgid "Title"
|
||||||
|
#~ msgstr "Titre"
|
||||||
|
|
||||||
|
#~ msgid "Close"
|
||||||
|
#~ msgstr "Fermer"
|
||||||
|
|
||||||
|
#~ msgid "(right-click to read more text)"
|
||||||
|
#~ msgstr "(Clic-droit pour afficher le texte entier)"
|
||||||
|
|
||||||
|
#~ msgid "Wooden direction sign"
|
||||||
|
#~ msgstr "Panneau de direction en bois"
|
||||||
|
|
||||||
|
#~ msgid "Poster"
|
||||||
|
#~ msgstr "Affiche"
|
||||||
|
|
||||||
|
#~ msgid "Textd"
|
||||||
|
#~ msgstr "Texte"
|
||||||
46
signs_api/locale/ms.po
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# Yaya (Nurul Azeera Hidayah @ Muhammad Nur Hidayat) <translation@mnh48.moe>, 2017.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Display Modpack\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-02-01 05:56+0100\n"
|
||||||
|
"PO-Revision-Date: 2020-07-05 11:31+0000\n"
|
||||||
|
"Last-Translator: Yaya MNH48 <translation@mnh48.moe>\n"
|
||||||
|
"Language-Team: Malay <translation@mnh48.moe>\n"
|
||||||
|
"Language: ms\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
"X-Generator: Poedit 2.3\n"
|
||||||
|
|
||||||
|
#: common.lua
|
||||||
|
msgid "Text"
|
||||||
|
msgstr "Teks"
|
||||||
|
|
||||||
|
#: common.lua
|
||||||
|
msgid "Write"
|
||||||
|
msgstr "Tulis"
|
||||||
|
|
||||||
|
#: common.lua
|
||||||
|
#, lua-format
|
||||||
|
msgid " (first %s lines only)"
|
||||||
|
msgstr " (%s baris pertama sahaja)"
|
||||||
|
|
||||||
|
#~ msgid "Title"
|
||||||
|
#~ msgstr "Tajuk"
|
||||||
|
|
||||||
|
#~ msgid "Close"
|
||||||
|
#~ msgstr "Tutup"
|
||||||
|
|
||||||
|
#~ msgid "(right-click to read more text)"
|
||||||
|
#~ msgstr "(klik-kanan untuk baca teks penuh)"
|
||||||
|
|
||||||
|
#~ msgid "Wooden direction sign"
|
||||||
|
#~ msgstr "Papan tanda arah kayu"
|
||||||
|
|
||||||
|
#~ msgid "Poster"
|
||||||
|
#~ msgstr "Poster"
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# textdomain: signs_api
|
|
||||||
Text=Text
|
|
||||||
(first @1 lines only)= (nur die ersten @1 Zeilen)
|
|
||||||
Font=Schriftart
|
|
||||||
Write=Schreiben
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# textdomain: signs_api
|
|
||||||
Text=Texte
|
|
||||||
(first @1 lines only)= (uniquement les @1 premières lignes)
|
|
||||||
Font=Police
|
|
||||||
Write=Écrire
|
|
||||||