Compare commits
191 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47abe2b2ef | ||
|
|
44264d6c8b | ||
|
|
d9d4ea32f7 | ||
|
|
0ec62a1732 | ||
|
|
0f6624f5a5 | ||
|
|
8156b45724 | ||
|
|
2878a1b45a | ||
|
|
4dc2bb661c | ||
|
|
c315900c24 | ||
|
|
394166ca56 | ||
|
|
fce192d288 | ||
|
|
27f582b041 | ||
|
|
afe8f517d7 | ||
|
|
03953f0fc0 | ||
|
|
cdc3cf55f5 | ||
|
|
7b87099f2c | ||
|
|
2c00acf230 | ||
|
|
2c1efede4d | ||
|
|
e25588cf91 | ||
|
|
d7d55fbb79 | ||
|
|
e52b742b9b | ||
|
|
bd59f7f78b | ||
|
|
1f8e99c9c5 | ||
|
|
ac4bb3d3d3 | ||
|
|
1440f35fa6 | ||
|
|
e0e0305836 | ||
| 889ee5a88d | |||
|
|
f5bd6d1046 | ||
|
|
e6c366df04 | ||
|
|
6135b3a60c | ||
|
|
33f34e3d60 | ||
|
|
d36bf7c525 | ||
|
|
b12d1f6b5e | ||
|
|
d63d32b42b | ||
|
|
d2c7abd98b | ||
|
|
ebadeb20d9 | ||
|
|
f27b5478b9 | ||
|
|
135cae7219 | ||
|
|
3a43e4ad81 | ||
|
|
09974f0c90 | ||
|
|
de915427ee | ||
|
|
2c845e4f68 | ||
|
|
4ae72c7fad | ||
|
|
4e9af449ff | ||
|
|
89fc7f863d | ||
|
|
4c872e829d | ||
|
|
2b142e9dfe | ||
|
|
6162f49bc1 | ||
|
|
b837f9d38c | ||
|
|
fd4c8e6c68 | ||
|
|
0ca85ac5c1 | ||
|
|
767c2653c2 | ||
|
|
882af249e0 | ||
|
|
1c15814156 | ||
|
|
010b7cc89f | ||
|
|
76dde2b6f5 | ||
|
|
7c4af47caf | ||
|
|
da1af1fdeb | ||
|
|
5d91a6de20 | ||
|
|
17923d5aea | ||
|
|
15ed431b3a | ||
|
|
2e98900cc0 | ||
|
|
b43c7046d7 | ||
|
|
2d63967938 | ||
|
|
ce65eb4e9b | ||
|
|
38e5d62caf | ||
|
|
ec6f742895 | ||
|
|
7221f59a9d | ||
|
|
ad6e62aa5b | ||
|
|
8735de0fce | ||
|
|
d7de025623 | ||
|
|
46cb9d82dd | ||
|
|
eae85369ca | ||
|
|
199f9c7a13 | ||
|
|
9194904b78 | ||
|
|
f1b92adb0f | ||
|
|
e2b597d09f | ||
|
|
b98e97157c | ||
|
|
fc40e54ed2 | ||
|
|
d073c9edb8 | ||
|
|
c9329d3789 | ||
|
|
8b896ab23f | ||
|
|
e75d6bc575 | ||
|
|
51a4a45a45 | ||
|
|
4604be9a8b | ||
|
|
523485df2b | ||
|
|
ea583b5250 | ||
|
|
4005b99c05 | ||
|
|
81e6dc89ae | ||
|
|
d013809244 | ||
|
|
4c8eee06b2 | ||
|
|
62c8de26b4 | ||
|
|
7793f6363f | ||
|
|
feb1b639ff | ||
|
|
b3c935768f | ||
|
|
4e5ebedc17 | ||
|
|
ffe113c62a | ||
|
|
ca28c5e835 | ||
|
|
e94a1b21f6 | ||
|
|
47cb8f2cd3 | ||
|
|
f46dd0a72e | ||
|
|
1856121098 | ||
|
|
b71d5a8f01 | ||
|
|
1d4c45e130 | ||
|
|
86db2d2c72 | ||
|
|
0f514c5c89 | ||
|
|
b16f9fc23b | ||
|
|
4d8dec3b79 | ||
|
|
5862997a02 | ||
|
|
9ce075d30b | ||
|
|
e46ece5ec6 | ||
|
|
a3e0d36a68 | ||
|
|
6900077558 | ||
|
|
ab5a510775 | ||
|
|
b88f67f015 | ||
|
|
6c92826e3c | ||
|
|
bcc181cb15 | ||
|
|
9ca3474360 | ||
|
|
03983f081e | ||
|
|
ba5b7aee52 | ||
|
|
52eb47626a | ||
|
|
1c51fa7723 | ||
|
|
b5b34899cc | ||
|
|
0f8db34368 | ||
|
|
cce3d84493 | ||
|
|
19f2da52ee | ||
|
|
367e5026dd | ||
|
|
7fc0f92e75 | ||
|
|
59ae9fa4d1 | ||
|
|
db66553fbf | ||
|
|
1f8451567f | ||
|
|
4eb72f0c3f | ||
|
|
6d9e45f43d | ||
|
|
07eb4737fa | ||
|
|
a35b0ec7b9 | ||
|
|
81fa9f60cf | ||
|
|
641dddfd51 | ||
|
|
d9b10f6c3e | ||
|
|
a720c1ffd7 | ||
|
|
36f94f81a4 | ||
|
|
1221cfcc4a | ||
|
|
3bb05ea6a6 | ||
|
|
4a57d08f2b | ||
|
|
b8357a505c | ||
|
|
e7856f70a7 | ||
|
|
77c8b0a5ec | ||
|
|
06e97a1631 | ||
|
|
9c5752f0d9 | ||
|
|
11ede12680 | ||
|
|
ab70424143 | ||
|
|
7a3f3bf875 | ||
|
|
377d5f2b8c | ||
|
|
61ea3b35f3 | ||
|
|
b2119e7ec1 | ||
|
|
5b841a9008 | ||
|
|
1d26bcd9f3 | ||
|
|
6827063fbd | ||
|
|
01ba1d47b1 | ||
|
|
c1835931e5 | ||
|
|
1a50b59995 | ||
|
|
06d35ec9bf | ||
|
|
b74407e11e | ||
|
|
95c9da849d | ||
|
|
bb24d91645 | ||
|
|
125cae3300 | ||
|
|
aac0ccf591 | ||
|
|
1c40830ddf | ||
|
|
f6b11d6cc6 | ||
|
|
5586b9d1c4 | ||
|
|
8fa161c90b | ||
|
|
a9c7e2235f | ||
|
|
44b911be9e | ||
|
|
969bd674c9 | ||
|
|
d22362a4ac | ||
|
|
12b556e929 | ||
|
|
508db92633 | ||
|
|
30af909da5 | ||
|
|
dfaf64cd61 | ||
|
|
c1f7b571b8 | ||
|
|
2793e0ab8f | ||
|
|
2f1899a35d | ||
|
|
35ead5a2a5 | ||
|
|
076adbe8ab | ||
|
|
8d94b1ffed | ||
|
|
80b616ab97 | ||
|
|
825557ff31 | ||
|
|
98272ebf63 | ||
|
|
e233ffb691 | ||
|
|
52973fbd84 | ||
|
|
f9a26194f0 | ||
|
|
4bfc237ddc |
10
.github/workflows/luacheck.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
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
@@ -1,3 +0,0 @@
|
||||
*~
|
||||
_*
|
||||
|
||||
19
.luacheckrc
Normal file
@@ -0,0 +1,19 @@
|
||||
unused_args = false
|
||||
|
||||
read_globals = {
|
||||
"minetest",
|
||||
"table",
|
||||
"vector",
|
||||
"xcompat"
|
||||
}
|
||||
|
||||
globals = {
|
||||
"boards",
|
||||
"display_api",
|
||||
"font_api",
|
||||
"ontime_clocks",
|
||||
"signs",
|
||||
"signs_api",
|
||||
"signs_road",
|
||||
"steles"
|
||||
}
|
||||
105
README.md
@@ -1,100 +1,119 @@
|
||||
# Display Modpack
|
||||
Version 1.1.1
|
||||
|
||||

|
||||
[](https://content.minetest.net/packages/mt-mods/display_modpack/)
|
||||
|
||||
Requires Minetest 5.4+
|
||||
|
||||
This modpack provides mods with dynamic display. Mods are:
|
||||
|
||||
- **display_api**: A library for adding display entities to nodes;
|
||||
- **font_api**: A library for displaying fonts on entities;
|
||||
- **signs_api**: A library for the easy creation of signs;
|
||||
- **[display_api](https://github.com/mt-mods/display_modpack/tree/master/display_api)**: A library for adding display entities to nodes;
|
||||
- **[font_api](https://github.com/mt-mods/display_modpack/tree/master/font_api)**: A library for displaying fonts on entities;
|
||||
- **[signs_api](https://github.com/mt-mods/display_modpack/tree/master/signs_api)**: A library for the easy creation of signs;
|
||||
- **[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**: A mod providing school boards;
|
||||
- **ontime_clocks**: A mod providing clocks which display the ingame time;
|
||||
- **signs**: A mod providing signs and direction signs displaying text;
|
||||
- **signs_road**: A mod providing road signs displaying text;
|
||||
- **steles**: A mod providing stone steles with text;
|
||||
- **[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.
|
||||
|
||||

|
||||

|
||||
|
||||
## Extra fonts
|
||||
|
||||
*Metro* and *Tiny Cursive* fonts are provided in **Display Modpack** (in **font_metro** and **boards** mods) but you can add more fonts by installing font mods. Be aware that each font mod comes with numerous textures. This can result in slowing media downloading and/or client display.
|
||||
|
||||
Extra font mods can be found here:
|
||||
* [OldWizard](https://github.com/pyrollo/font_oldwizard): An old style gothic font.
|
||||
* [Botic](https://github.com/pyrollo/font_botic): A scifi style font.
|
||||
|
||||
## Deprecation notice (for modders)
|
||||
|
||||
### December 2018
|
||||
Following objects are deprecated, shows a warning in log when used:
|
||||
* `display_modpack_node` group (use `display_api` group instead);
|
||||
* `display_lib_node` group (use `display_api` group instead);
|
||||
* `display_lib` global table (use `display_api` global table instead);
|
||||
* `font_lib` global table (use `font_api` global table instead);
|
||||
|
||||
These objects will be removed in the future.
|
||||
|
||||
## Changelog
|
||||
### 2019-03-14 (Version 1.3.1)
|
||||
- __dispay_api__: Display API now detects automatically whenr rotation restrictions have to be applied.
|
||||
- __sign_api__: Screwdriver behavior changed. Now, left click rotates and changes direction.
|
||||
|
||||
### 2019-03-09 (Version 1.3)
|
||||
- __display_api__: Display nodes can be rotated in every directions (if running Minetest 5 or above).
|
||||
- __display_api__: New setting to restrict rotations to Minetest 0.4 abilities (restriction enabled by default).
|
||||
- __sign_api__: Changed behavior of screwdriver if no rotation restriction.
|
||||
|
||||
### 2018-12-14 (Version 1.2.3)
|
||||
- __display_api__: New `yaw` attributes, entities can now have different angles with node.
|
||||
- __font_api__: New `Font:render` method for texture creation
|
||||
- __font_api__: Specific management for fixed width font. Allows number of columns based texture width.
|
||||
- __font_api__: Improve `display_api` integration into `font_api`. Display API fully optional. `font_api.on_display_update` defined only if `display_api` enabled.
|
||||
- __font_api__: Improve management of invalid UTF strings (should not crash anymore)
|
||||
- __font_api__: Deprecation of `font_lib`
|
||||
- __signs__: Fixed craft recipe for labels
|
||||
|
||||
### 2018-12-02 (Version 1.2.2)
|
||||
- Fixed a bug that prevented Display API from working on some systems (Raspberry Pi)
|
||||
|
||||
### 2018-11-01 (Version 1.2.1)
|
||||
- Now font can be chosen per sign / stele
|
||||
|
||||
### 2018-11-01 (Version 1.2)
|
||||
- Labels and woodend signs added.
|
||||
- Fallback mechanism for missing chars (For example: "é" --> "e" --> "E").
|
||||
- Several bug fixes by 12Me21 and naturefreshmilk.
|
||||
|
||||
### 2018-07-16 (Version 1.1.1)
|
||||
|
||||
- Boards mod added.
|
||||
|
||||
- Bug fix in default font chosing when multiple font registered.
|
||||
|
||||
### 2018-07-13 (Version 1.1.0)
|
||||
|
||||
- Font API rework introducing Font class.
|
||||
|
||||
- Replaced default Epilepsy Font by Metro Font for licensing purposes,
|
||||
|
||||
- Rework of all nodes displaying text accordingly to the Font API rework.
|
||||
|
||||
As font_epilepsy mod has been replaced by font_metro mod, **don't forget to activate font_metro mod after updating** or you won't have any text displayed.
|
||||
|
||||
### 2018-05-30 (Version 1.0.1)
|
||||
|
||||
Mostly bug fixes :
|
||||
|
||||
- Fix steles orientation when placing
|
||||
|
||||
- Update entity on mapblock load
|
||||
|
||||
- Use default formspec style
|
||||
|
||||
- Fix ndef nill value in steles mod when technics not installed
|
||||
|
||||
- Seperate signs API from signs définitions
|
||||
|
||||
- Allow a greater offset between display and block
|
||||
|
||||
### 2018-01-13 (Version 1.0)
|
||||
|
||||
- Switch to Epilepsy font by KREATIVE SOFTWARE
|
||||
|
||||
- Add settings "default_font"
|
||||
|
||||
- Add horizontal alignment
|
||||
|
||||
- Add tool for creating font textures from .ttf font files
|
||||
|
||||
- Fix UTF 8 to Unicode decoding
|
||||
|
||||
- Updated forum thread link in README.md
|
||||
|
||||
### 2017-12-19
|
||||
|
||||
This change is a preparation to merge Andrzej Pieńkowski fork (apienk) : new font and support of UTF chars.
|
||||
|
||||
- Font\_lib support for multiple fonts (nothing yet visible in mods) ;
|
||||
|
||||
- Font\_lib support for Unicode characters (limited to Unicode Plane 0: 0000-FFFF, see [Wikipedia](https://en.wikipedia.org/wiki/Unicode)) ;
|
||||
|
||||
- New "default" font with original textures from Vanessa Ezekowitz (VanessaE) ;
|
||||
|
||||
### 2017-12-10
|
||||
|
||||
- Compatibility of signs mod with signs_lib (thanks to gpcf) ;
|
||||
|
||||
- Added large banner in road signs (thanks to gpcf) ;
|
||||
|
||||
### 2017-08-26
|
||||
|
||||
- Changed signs from wallmounted to facedir to improve textures and make it possible to use screwdriver.
|
||||
**IMPORTANT** : Map will be updated to change to new nodes but inventory items will turn into "Unknown items" and have to be re-crafted.
|
||||
|
||||
- Intllib support added with french translation (whole modpack, thanks to fat115) ;
|
||||
|
||||
- Punch on nodes to update entity (signs, signs_road and steles). Usefull in case of /clearobjects ;
|
||||
|
||||
- Changed wooden direction sign textures (signs) ;
|
||||
|
||||
- Added back and side textures to all signs (road_signs) ;
|
||||
|
||||
- Added more sign types : White/yellow/green signs and direction signs (signs_road) ;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
theme: jekyll-theme-minimal
|
||||
@@ -1,166 +0,0 @@
|
||||
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.
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Code by Pierre-Yves Rollo (pyrollo)
|
||||
Font by (cyfry77)
|
||||
@@ -1,2 +0,0 @@
|
||||
default
|
||||
signs_api
|
||||
@@ -12,6 +12,8 @@
|
||||
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',
|
||||
{
|
||||
default = false, -- Don't register this font as a possible default font
|
||||
|
||||
@@ -22,21 +22,21 @@ boards = {}
|
||||
boards.name = minetest.get_current_modname()
|
||||
boards.path = minetest.get_modpath(boards.name)
|
||||
|
||||
-- Load support for intllib.
|
||||
local S, NS = dofile(boards.path.."/intllib.lua")
|
||||
boards.intllib = S
|
||||
local F = function(...) return minetest.formspec_escape(S(...)) end
|
||||
-- Translation support
|
||||
local S = minetest.get_translator(boards.name)
|
||||
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
||||
|
||||
-- Load font
|
||||
dofile(boards.path.."/font_tinycurs.lua")
|
||||
|
||||
local function set_formspec(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local display_text = minetest.formspec_escape(meta:get_string("display_text"))
|
||||
meta:set_string("formspec",
|
||||
"size[6,4]"..default.gui_bg..default.gui_bg_img..default.gui_slots..
|
||||
"textarea[0.5,0.7;5.5,3;display_text;"..F("Text")..";${display_text}]"..
|
||||
"button_exit[3,3.5;2,1;ok;"..F("Write").."]"..
|
||||
"button_exit[1,3.5;2,1;wipe;"..F("Wipe").."]")
|
||||
"size[6,3.5]"..
|
||||
"textarea[0.55,0.25;5.5,3;display_text;"..FS("Text")..";" .. display_text .. "]"..
|
||||
"button_exit[1,2.75;2,1;ok;"..FS("Write").."]"..
|
||||
"button[3,2.75;2,1;font;"..FS("Font").."]")
|
||||
end
|
||||
|
||||
-- On boards, everyone is allowed to write and wipe
|
||||
@@ -45,13 +45,16 @@ local function on_receive_fields(pos, formname, fields, player)
|
||||
if fields.ok or fields.key_enter then
|
||||
signs_api.set_display_text(pos, fields.display_text, fields.font)
|
||||
end
|
||||
if fields.wipe then
|
||||
signs_api.set_display_text(pos, "", fields.font)
|
||||
if fields.font then
|
||||
signs_api.set_display_text(pos, fields.display_text)
|
||||
font_api.show_font_list(player, pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
models = {
|
||||
local wood_texture = xcompat.textures.wood.planks
|
||||
|
||||
local models = {
|
||||
black_board = {
|
||||
depth = 1/16, width = 1, height = 1,
|
||||
entity_fields = {
|
||||
@@ -64,9 +67,10 @@ models = {
|
||||
},
|
||||
node_fields = {
|
||||
description = S("Black board"),
|
||||
tiles = { "default_wood.png", "default_wood.png",
|
||||
"default_wood.png", "default_wood.png",
|
||||
"default_wood.png", "board_black_front.png" },
|
||||
tiles = {wood_texture, wood_texture,
|
||||
wood_texture, wood_texture,
|
||||
wood_texture, "board_black_front.png"},
|
||||
_itemframe_texture = "board_black_front.png",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
@@ -79,6 +83,13 @@ models = {
|
||||
set_formspec(pos)
|
||||
display_api.on_construct(pos)
|
||||
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,
|
||||
},
|
||||
},
|
||||
@@ -94,10 +105,11 @@ models = {
|
||||
},
|
||||
node_fields = {
|
||||
description = S("Green board"),
|
||||
tiles = { "default_wood.png", "default_wood.png",
|
||||
"default_wood.png", "default_wood.png",
|
||||
"default_wood.png", "board_green_front.png" },
|
||||
tiles = {wood_texture, wood_texture,
|
||||
wood_texture, wood_texture,
|
||||
wood_texture, "board_green_front.png"},
|
||||
drawtype = "nodebox",
|
||||
_itemframe_texture = "board_green_front.png",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
@@ -109,6 +121,13 @@ models = {
|
||||
set_formspec(pos)
|
||||
display_api.on_construct(pos)
|
||||
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,
|
||||
},
|
||||
},
|
||||
@@ -121,11 +140,13 @@ do
|
||||
end
|
||||
|
||||
-- Recipes
|
||||
local mat = xcompat.materials
|
||||
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = "boards:black_board",
|
||||
recipe = {
|
||||
{"group:wood", "group:stone", "dye:black"},
|
||||
{"group:wood", "group:stone", mat.dye_black},
|
||||
}
|
||||
})
|
||||
|
||||
@@ -133,7 +154,7 @@ minetest.register_craft(
|
||||
{
|
||||
output = "boards:green_board",
|
||||
recipe = {
|
||||
{"group:wood", "group:stone", "dye:dark_green"},
|
||||
{"group:wood", "group:stone", mat.dye_dark_green},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
|
||||
-- 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
|
||||
6
boards/locale/boards.de.tr
Normal file
@@ -0,0 +1,6 @@
|
||||
# textdomain: boards
|
||||
Text=Text
|
||||
Write=Schreiben
|
||||
Font=Schriftart
|
||||
Black board=Schwarze Tafel
|
||||
Green board=Grüne Tafel
|
||||
6
boards/locale/boards.fr.tr
Normal file
@@ -0,0 +1,6 @@
|
||||
# textdomain: boards
|
||||
Text=Texte
|
||||
Write=Écrire
|
||||
Font=Police
|
||||
Black board=Tableau noir
|
||||
Green board=Tableau vert
|
||||
6
boards/locale/boards.ms.tr
Normal file
@@ -0,0 +1,6 @@
|
||||
# textdomain: boards
|
||||
Text=
|
||||
Write=
|
||||
Font=
|
||||
Black board=Papan hitam
|
||||
Green board=
|
||||
@@ -1,40 +0,0 @@
|
||||
# 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"
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# 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 ""
|
||||
6
boards/locale/template.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
# textdomain: boards
|
||||
Text=
|
||||
Write=
|
||||
Font=
|
||||
Black board=
|
||||
Green board=
|
||||
4
boards/mod.conf
Normal file
@@ -0,0 +1,4 @@
|
||||
name = boards
|
||||
title = Black boards
|
||||
description = Writable school boards using sign_api
|
||||
depends = signs_api, xcompat
|
||||
|
Before Width: | Height: | Size: 563 B After Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 232 B |
|
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 83 B |
|
Before Width: | Height: | Size: 230 B After Width: | Height: | Size: 82 B |
|
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 82 B |
|
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 77 B |
|
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 89 B |
|
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 111 B |
|
Before Width: | Height: | Size: 303 B After Width: | Height: | Size: 90 B |
|
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 105 B |
|
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 81 B |
|
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 79 B |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 81 B |
|
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 82 B |
|
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 72 B |
|
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 73 B |
|
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 71 B |
|
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 80 B |
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 90 B |
|
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 86 B |
|
Before Width: | Height: | Size: 320 B After Width: | Height: | Size: 94 B |
|
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 93 B |
|
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 97 B |
|
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 95 B |
|
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 92 B |
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 86 B |
|
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 94 B |
|
Before Width: | Height: | Size: 320 B After Width: | Height: | Size: 91 B |
|
Before Width: | Height: | Size: 294 B After Width: | Height: | Size: 76 B |
|
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 78 B |
|
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 86 B |
|
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 102 B |
|
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 87 B |
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 86 B |
|
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 87 B |
|
Before Width: | Height: | Size: 313 B After Width: | Height: | Size: 88 B |
|
Before Width: | Height: | Size: 303 B After Width: | Height: | Size: 86 B |
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 88 B |
|
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 100 B |
|
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 95 B |
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 87 B |
|
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 107 B |
|
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 93 B |
|
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 89 B |
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 91 B |
|
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 88 B |
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 83 B |
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 87 B |
|
Before Width: | Height: | Size: 313 B After Width: | Height: | Size: 91 B |
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 89 B |
|
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 94 B |
|
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 86 B |
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 93 B |
|
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 92 B |
|
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 94 B |
|
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 95 B |
|
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 100 B |
|
Before Width: | Height: | Size: 327 B After Width: | Height: | Size: 103 B |
|
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 84 B |
|
Before Width: | Height: | Size: 297 B After Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 83 B |
|
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 81 B |
|
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 73 B |
|
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 79 B |
|
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 81 B |
|
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 85 B |
|
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 82 B |
|
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 83 B |
|
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 83 B |
|
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 85 B |
|
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 87 B |
|
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 84 B |
|
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 78 B |
|
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 84 B |
|
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 85 B |
|
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 79 B |
|
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 83 B |
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 83 B |