1
0
mirror of https://github.com/mt-mods/signs_lib.git synced 2025-06-28 13:56:06 +02:00

Compare commits

..

49 Commits

Author SHA1 Message Date
8b6e41c3fe Fix warnings regarding use_texture_alpha
Add use_texture_alpha = "clip" for standard signs.
Break Minetest 5.4< compatibility.
2021-02-28 12:27:34 +01:00
d077d23f1a mod.conf update to minetest 5.2.0+ compat 2021-02-27 05:15:21 +00:00
d71dcf4874 add text check for entity creation 2021-02-19 09:33:14 +00:00
ac8b00f826 Merge branch 'nonascii' into nonascii-european-test 2021-02-17 17:37:36 +01:00
707f633f0d Merge branch 'master' into nonascii 2021-02-17 17:37:11 +01:00
8527f1d5b2 writing [ or ] into a sign breaks the form for some users
the exact effect varies with client behavior and the particular text contents.
(characters erased, disappering formspec elements, loss of text)
2021-01-21 13:34:58 -05:00
3c824aedf8 Merge branch 'updateonoff' into 'master'
On/off switch doesn't reset the text anymore

See merge request VanessaE/signs_lib!5
2021-01-18 15:18:55 +00:00
fe72e32396 update on off 2021-01-16 11:57:06 +01:00
f7a4fefd34 Merge branch 'no_priv' into 'master'
Sign and land owners always able to edit a sign

See merge request VanessaE/signs_lib!4
2021-01-08 18:29:44 +00:00
664e99d34a Sign and land owners always able to edit a sign 2021-01-08 18:29:44 +00:00
e3c5fd2736 Merge branch 'separate_formspec' into 'master'
Signs formspec as separate formspecs (instead of dwelling in nodes metadata)

See merge request VanessaE/signs_lib!3
2021-01-03 18:39:29 +00:00
e7ab3e66a7 Signs formspec as separate formspecs (instead of dwelling in nodes metadata) 2021-01-03 18:39:29 +00:00
c82952befb Merge branch 'nonascii' into nonascii-european-test 2020-12-07 13:45:07 +01:00
26c3935c9b add texture generation scripts from https://github.com/zeuner/signs-font-generate 2020-12-07 13:38:31 +01:00
3ef11a995b recreate textures using latest version of https://github.com/zeuner/signs-font-generate 2020-12-05 18:55:42 +01:00
22af21aeaf Merge branch 'nonascii' into nonascii-european-test 2020-12-05 18:53:57 +01:00
af45e591e3 recreate textures using https://github.com/zeuner/signs-font-generate 2020-12-05 18:53:42 +01:00
b174cea893 Merge branch 'nonascii' into nonascii-european-test 2020-11-26 05:54:25 +01:00
4a196211ee Merge branch 'master' into nonascii 2020-11-26 05:53:45 +01:00
942e91e00e better align to existing font 2020-11-14 13:04:50 +01:00
4b2d4db848 test with some european languages 2020-11-13 12:08:39 +01:00
4b432eec08 support for non-ascii characters 2020-11-12 06:22:34 +01:00
d956c87dbc support for non-ascii characters 2020-11-12 06:02:56 +01:00
1a6b9f38ff enable static save on signs' entities 2020-11-01 12:43:55 -05:00
8b975d7fa1 add minimum minetest version key for contentdb 2020-06-03 13:00:34 -04:00
b633a4bf8c fix wrong default sign entity ref 2020-04-16 17:06:07 -04:00
bd20f9b776 add prefab_redo to opt depends 2020-02-26 16:03:48 +00:00
7c6a1c7611 add some missing aliases (and rearrange them) 2019-10-22 15:25:58 -04:00
bd8ae112d0 README tweaks 2019-10-11 06:00:31 -04:00
8669385718 various readability improvements
in API.md, MODELS.md, and README.md

I also added a couple of things to API.md that I forgot to
document before.
2019-09-26 03:27:01 -04:00
0398684bfb tweak README 2019-09-26 02:01:06 -04:00
b52913d506 fix wrong textures for stick and hangers 2019-09-26 01:17:44 -04:00
ebeb035fac allow using "Sneak"/Shift to skip the on-pole/hanging/yard checks
(makes it possible to directly place a sign flat on the ground or
ceiling, among other things.)
2019-09-26 01:16:51 -04:00
e92177b83e allowing true for horizontal pole function makes no sense 2019-09-26 01:02:00 -04:00
684e9237cd don't allow top of bottom to be considered
a mountable surface on a a pole/post.
2019-09-26 01:00:15 -04:00
3836215268 API changes to allow for more mounting styles
NODE NAMES:

The base name of a node can be whatever you want.  The basic wall sign
will keep the node name you give, while its hanging, on-pole, and yard
variants will, where applicable, use the same name, with "_onpole",
"_hanging", or "_yard" appended.

One exception:

If your node has "_wall" in its name, that bit will be stripped-out when
generating the above node variations.  For example:

"default:sign_wall_wood"

...will become...

"default:sign_wood_onpole"
"default:sign_wood_hanging"
"default:sign_wood_yard"

MODELS:

The base sign model and entity files must now be named:

sign:   mymod_foosign_wall.obj
        mymod_foosign_facedir_wall.obj

entity: mymod_foosign_entity_wall.obj

their other variants, where applicable, must be:

mymod_foosign_onpole.obj
mymod_foosign_hanging.obj
mymod_foosign_yard.obj

mymod_foosign_entity_onpole.obj
mymod_foosign_entity_hanging.obj
mymod_foosign_entity_yard.obj

For `facedir` signs, the "_facedir" in the base sign model filename is
automatically stripped from the name when generating the entity model
filename, as entities don't have a concept of wallmounted/facedir/etc.
For example:

"mymod_foosign_facedir_wall.obj"

...will become...

"mymod_foosign_entity_wall.obj"

* allow passing custom onpole, hanging, and yard sign models, for
situations where the filename(s) thereof can't be derived from the base
sign model filename.

* allow passing a custom pole mount, hanging, and yard sign stick
textures as the third, fourth, and fifth tiles{} entries, respectively
(independent of the above model file option)

* fine-tuned the pole mount on the standard sign models to eliminate
overlapping faces (so it looks better with basic_signs' glass sign.

* Move basic_signs wooden yard sign back to signs_lib.
2019-09-26 00:48:53 -04:00
6a4ddfddab attempt to work around engine player model bug
when the world loads and the player spawns in, or is
teleported to the same node space as a sign, occasionally, the
player's model goes flat and their skin gets changed to the
whatever the sign's text is.

Also, when checking if an entity needs spawned, or when
deleting, try to make absolutely sure that only sign-related
entities will be selected for re-use, or selected for deletion
(we don't want some player's prize cow to be deleted)

I think this will fix it, or at least it'll surely prevent
signs_lib from being able to cause it.

Also, moved another function to the entity-handling section of
the file and made it global (signs_lib namespace) in the
process.
2019-09-25 17:10:00 -04:00
1e05aa9309 fix bad selection box for prefab concrete rail
(when there's just one node not connected to anything)
2019-09-25 16:06:12 -04:00
80c0fc6a7e Add README and basic modeling instructions, and document the API
Also, tweaked the object names in the standard sign Blender
project file, renamed it, renamed the small/slim pole mount
project file as well, and added a copy of the standard pole
mount project file.
2019-09-24 06:37:33 -04:00
42091db05e treat cottages:table and prefab_redo:concrete_railing as vertical posts 2019-09-23 17:02:19 -04:00
de5926233a also include hanging widefont signs 2019-09-22 06:01:32 -04:00
ae6e707ebe forgot to include onpole_widefont signs in conversion list 2019-09-22 04:28:01 -04:00
dcdee22265 allow mods to pass a function or just true
to the pole and horiz pole check routines, in case they need
their own, custom checking routines, if the usual, simple
checks aren't good enough.

got rid of the allowed-poles table, as it's now obsolete

moved all existing special code into compat.lua, altered to
use this feature.
2019-09-22 03:19:31 -04:00
e4336e320c fix empty lines being skipped 2019-09-21 22:04:39 -04:00
d41e2ffd73 use a meta key to select wide-font mode
instead of using a separate node
add LBM to convert old nodes.
2019-09-21 21:42:46 -04:00
77987d12b9 detect streets:bigpole_tjunction
Treat T-junction as a vertical or horizontal pole (depending
on its orientation), if the sign could be placed flat against
the back or side of the junction.

In this instance, the "front" of the junction is the side with
the middle bit sticking out, and will just get a regular wall
signif targeted, as with any non-pole node.
2019-09-21 21:39:53 -04:00
dfece5275e rework horizontal pole detection slightly 2019-09-21 19:24:48 -04:00
6285d250d7 default "allow_onpole" to disabled
for consistency with other similar flags
2019-09-21 15:56:45 -04:00
9502812088 Add necessary bits to allow signs to be placed onto horizontal poles
(both wooden and steel signs)

only streets mod's "bigpole" supported for now.

Model changes:

To make a sign support horizontal mounting, make a single "_onpole"
model, with two copies of the pole mount, one rotated by 90°.  Make sure
the second copy appears has its own material entry, and that it is last
in the materials list in the exported .obj (`grep "g " file.obj` to
check).

When registered, signs_lib will set the "_onpole" and "_onpole_horiz"
tiles{} to reveal one mount or the other: entry 3 will expose the
vertical mount, entry 4 is the horizontal copy, with the opposite entry
being set to the "blank" image.
2019-09-21 15:45:48 -04:00
307 changed files with 2286 additions and 678 deletions

7
.gitignore vendored
View File

@ -1,7 +0,0 @@
# temporary files
*~
# eclipse project files
.project
.settings
.buildpath

351
API.md Normal file
View File

@ -0,0 +1,351 @@
# Signs_lib API
In this text, common terms such as `pos`, `node`, or `placer`/`digger` will not be explained unless they have a different meaning than what's usually used in Minetest mods. See [minetest/doc/lua_api.txt](https://github.com/minetest/minetest/blob/master/doc/lua_api.txt) for details on these and other common terms, if necessary. Similarly, common shorthand such as `int`, `float`, etc. should require no explanation.
## Registering a sign
* `signs_lib.register_sign(nodename, def)`
To put it simply, where you'd have used `minetest.register_node()` before, just replace it with this call. The syntax is identical, and in general, all settings/items allowed there are allowed here as well. Anything that `signs_lib` doesn't need to override or alter will be passed straight through to `register_node()`, unchanged (such as `description`, `tiles`, or `inventory_image`).
The supplied node name will be prepended with ":", so that any mod can register signs under any other mod's namespace, if desired.
Many items have default settings applied when omitted, most of which would produce something equivalent to "default:sign_wall_wood" if enough other node defintion settings were to be included.
* `drawtype = "string"`
Default: "mesh"
* `tiles = {table}`
Since this is a sign-specific library, this parameter behaves rather different from what you would normally use in `minetest.register_node()`. The first two entries are mandatory. The third, fourth and fifth entries are optional, depending on which mounting styles are enabled for a given node.
* entry 1: the front and back of the sign.
* entry 2: the sides/edges
* entry 3: texture for the pole mount. If unspecified, the standard pole mount image is used, if needed.
* entry 4: texture for the hanging part. If unspecified, the standard hanging chains image is used, if needed.
* entry 5: texture for the yard sign stick. If unspecified, "default_wood.png" is used, if needed.
* entry 6: ignored.
* `mesh = "string"`
Default: "signs_lib_standard_wall_sign.obj".
* `paramtype = "string"`
Default: "light"
* `paramtype2 = "string"`
As with any other node, this determines how param2 is interpreted. Since these are signs, only two modes make sense: "wallmounted" and "facedir". Any other string is the same as "facedir".
Default: "wallmounted"
* `wield_image = "string"`
Default: whatever the `inventory_image` is set to (if anything).
* `selection_box = {table}`
Works the same as usual. A helper function exists to create boxes by specifying only and X/Y size and offset:
`signs_lib.make_selection_boxes()` (see below).
* `groups = {table}`
Sets the sign's groups, as usual. In addition to whatever arbitrary groups you may have in mind, there are two presets available (both of which have `attached_node` removed, and `sign = 1` added):
* `signs_lib.standard_wood_groups`, inherited from "default:sign_wall_wood"
* `signs_lib.standard_steel_groups`, inherited from "default:sign_wall_steel"
Default: `signs_lib.standard_wood_groups`
* `sounds = something`
Sets the sign's sound profile, as usual. In addition to whatever sound profile you may have in mind, there are two presets available:
* `signs_lib.standard_wood_sign_sounds`, inherited from "default:sign_wall_wood"
* `signs_lib.standard_steel_sign_sounds`, inherited from "default:sign_wall_steel"
Default: `signs_lib.standard_wood_sign_sounds`
* `drop = something`
Default: inherited from the `nodename` argument given to `signs_lib.register_sign()`
* `after_place_node = function(pos, placer, itemstack, pointed_thing, locked)`
See below under "Main functions".
Default: `signs_lib.after_place_node`
* `on_rightclick = function(pos, node, player, itemstack, pointed_thing)`
See below under "Main functions".
Default: `signs_lib.rightclick_sign`
* `on_destruct = function(pos)`
See below under "Main functions".
Default: `signs_lib.destruct_sign`
* `on_punch = function(pos)`
See below under "Main functions".
Default: `signs_lib.update_sign`
* `onpole_mesh = "string"`
* `hanging_mesh = "string"`
* `yard_mesh = "string"`
If your node needs a custom model for its on-pole, hanging, and/or yard variants, specify them here, as needed. The materials and textures behave the same on these as on other sign models. All sign model filenames are still derived from the base sign model, when not overridden here (so these can be totally arbitrary filenames).
Defaults: the normal "_onpole", "_hanging", or "_yard" version of the model specified by `mesh`.
* `selection_box = {table}`
* `node_box = {table}`
As usual, the former sets the sign's selection box, while the latter sets its collision information (since signs use model meshes). At the very least, you'll want to specify `selection_box`. If the sign node is in "wallmounted" mode, this must contain proper `wall_top`, `wall_side`, and `wall_bottom` entries, as one normally uses with such nodes. Signs that use "facedir" mode just need the usual `fixed` setting.
Defaults: `selection_box` is a box that fits the standard wall sign, if not specified. `node_box` takes on the value given to `selection_box`, if not specified (or the standard wall sign setting, if neither is present).
* `onpole_selection_box = {table}`
* `hanging_selection_box = {table}`
* `yard_selection_box = {table}`
* `onpole_node_box = {table}`
* `hanging_node_box = {table}`
* `yard_node_box = {table}`
If your node needs special handling for its onpole-, hanging-, or yard-mode selection boxes or for their collision info (which `signs_lib` always uses the node's `node_box` item for), you can specify them here. Same syntax as the regular `selection_box` setting.
Defaults: whatever the `selection_box` and `node_box` entries are set to.
* `default_color = "string"`
Sets the default text color for this sign, in hexadecimal (one digit, lowercase), from the standard Linux/IRC/CGA color palette. Same as the colors shown in the sign's formspec.
Default: "0" (black)
* `number_of_lines = int`
Just what it says on the tin. How many lines you can fit will vary with overall sign node size, font size, scaling, line spacing, etc.
Default: 6
* `horiz_scaling = float`
* `vert_scaling = float`
Scaling factor applied to the entity texture horizontal or vertical resolution. Larger values increase the resolution. Since a given sign's entity is always displayed at a fixed visual scale, increasing these squeezes more pixels into the same space, making the text appear narrower or shorter. Increasing `vert_scaling` also increases the number of lines of text the sign will hold.
Defaults: 1.0 for both
* `line_spacing = int`
Number of blank pixels to add between lines.
Default: 1
* `font_size = int`
Selects which font to use, either 15 or 31 (pixel height). This setting directly affects the sign's vertical resolution.
Default: 15
* `x_offset = int`
* `y_offset = int`
Starting X and Y position in pixels, relative to the text entity UV map upper-left corner.
Defaults: 4 for X, 0 for Y
* `chars_per_line = int`
Approximate number of characters that should fit on a line. This, the selected font's average character width, and the `horiz_scaling` together set the horizontal resolution of the text entity's texture.
Default: 35
* `entity_info = something`
Describes the entity model and yaw table to use. May be one of:
* A table specifying the two settings directly, such as:
```lua
entity_info = {
mesh = "signs_lib_standard_wall_sign_entity.obj",
yaw = signs_lib.wallmounted_yaw
}
```
* `signs_lib.standard_yaw` is also available as a yaw preset, if desired.
* a string reading "standard", which tells `signs_lib` to use the standard wood/steel sign model, in wallmounted mode. Equivalent to the example above.
* nothing at all: if omitted, the sign will not have a formspec, basically all text-related settings will be ignored and/or omitted entirely, and no entity will be spawned for this sign, thus the sign will not be writable. This is the default, and is of course what one would want for any sign that's just an image wrapped around a model, as in most of the signs in [my street signs mod](https://forum.minetest.net/viewtopic.php?t=20866).
Default: **nil**
* `allow_hanging = bool`
* `allow_onpole = bool`
* `allow_onpole_horizontal = bool`
* `allow_yard = bool`
If **true**, these allow the registration function to create versions of the initial, base sign node that either hang from the ceiling, are mounted on a vertical pole/post, are mounted on a horizontal pole, or are free-standing, on a small stick. Their node names will be the same as the base wall sign node, except with "_hanging", "_onpole", "_onpole_horiz", or "_yard", respectively, appended to the end of the node name. If the base node name has "_wall" in it, that bit is deleted before appending the above.
These options are independent of one another.
Defaults: all **nil**
* `allow_widefont = bool`
Just what it says on the tin. If enabled, the formspec will have a little "on/off switch" left of the "Write" button, to select the font width.
Default: **nil**
* `locked = bool`
Sets this sign to be locked/owned, like the original default steel wall sign.
Default: **nil**
### Example sign definition:
```lua
signs_lib.register_sign("basic_signs:sign_wall_glass", {
description = S("Glass Sign"),
yard_mesh = "signs_lib_standard_sign_yard_two_sticks.obj",
tiles = {
{ name = "basic_signs_sign_wall_glass.png", backface_culling = true},
"basic_signs_sign_wall_glass_edges.png",
"basic_signs_pole_mount_glass.png",
nil,
nil,
"default_steel_block.png" -- the sticks on back of the yard sign model
},
inventory_image = "basic_signs_sign_wall_glass_inv.png",
default_color = "c",
locked = true,
entity_info = "standard",
sounds = default.node_sound_glass_defaults(),
groups = {cracky = 3, oddly_breakable_by_hand = 3},
allow_hanging = true,
allow_widefont = true,
allow_onpole = true,
allow_onpole_horizontal = true,
allow_yard = true,
use_texture_alpha = true,
})
```
### Main functions used within a sign definition
* `signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locked)`
Determines if the `pointed_thing` is a wall, floor, ceiling, or pole/post, and swaps the placed sign for the correct model.
* `locked`: if set to **true**, the sign's meta will be tweaked to indicate its ownership by the `placer`.
* `signs_lib.rightclick_sign(pos, node, player, itemstack, pointed_thing)`
Open the default sign formspec, if the player has the `signslib_edit` privilege.
* `signs_lib.destruct_sign(pos)`
Deletes the sign's entity, if any, when the sign is dug.
* `signs_lib.update_sign(pos, fields)`
If the sign's writable, this deletes any sign-related entities in the sign's node space, spawns a new one, and renders whatever text is in the sign's meta.
* `signs_lib.can_modify(pos, player)`
Returns **true** if the player is allowed to dig, edit, or change the font width of the sign.
* `signs_lib.handle_rotation(pos, node, player, mode)`
Just what it says on the tin. Limits the sign's rotation as needed (for example, a sign on a horizontal pole can only flip from one side to the other).
* `mode`: the screwdriver's mode, as passed from the screwdriver mod.
Returns **false** if the user tried to right-click with the screwdriver, **true** otherwise.
* `signs_lib.make_selection_boxes(x_size, y_size, foo, x_offset, y_offset, z_offset, is_facedir)`
* `x_size`/`y_size`: dimensions in inches. One node is 39.37 inches on a side. This function uses inches instead of metric because it started out as a selection box maker for [MUTCD-2009](https://mutcd.fhwa.dot.gov/pdfs/2009r1r2/mutcd2009r1r2edition.pdf)-compliant signs, which are measured in inches.
* `x_offset`/`y_offset`/`z_offset`: shift the selection box (inches, defaults to centered, with the back face flush with the back of the node).
* `is_facedir`: if unset, the selection boxes will be created with the assumption that `paramtype2 = "wallmounted"` mode is set on the node the box will be used on. Any other value creates a selection box for "facedir" mode.
* `foo` is ignored (leftover from an argument that's long since been rendered obsolete.
Returns a table suitable for the `selection_box` node definition entry.
#### Helper functions
You probably won't need to call any of these directly.
* `signs_lib.read_image_size(filename)`
Returns width and height of the indicated PNG file (return values will be gibberish if it isn't a PNG).
* `signs_lib.split_lines_and_words(text)`
Just what it says on the tin.
Returns a table of lines, each line entry being a table of words.
* `signs_lib.delete_objects(pos)`
Deletes all entities within the node space given by `pos`.
* `signs_lib.spawn_entity(pos, texture)`
Spawns a new text entity at the given position and assigns the supplied `texture` to it, if any.
* `signs_lib.check_for_pole(pos, pointed_thing)`
Attempts to determine if the `pointed_thing` qualifies as a vertical pole or post of some kind.
Returns **true** if a suitable pole/post is found
* `signs_lib.check_for_horizontal_pole(pos, pointed_thing)`
Same idea, but for horizontal poles/posts.
Returns **true** if a suitable pole/post is found.
* `signs_lib.check_for_ceiling(pointed_thing)`
Returns **true** if the `pointed_thing` appears to be the bottom of a node.
* `signs_lib.check_for_floor(pointed_thing)`
Returns **true** if the `pointed_thing` appears to be the top of a node.
* `signs_lib.set_obj_text(pos, text)`
Cooks the supplied `text` as needed and passes it to the entity rendering code. Essentially, this is where rendering text into an image starts.
## Options for pole/post nodes
Occasionally, you'll run into a node that either looks like a pole/post, or has one in the middle of its node space (with room to fit a sign in there), but which isn't detected as a pole/post by the standard sign placement code. In these situations, some kind of special check is needed.
Supplying one or both of the following in the pole/post node's definition will cause `signs_lib` to skip its usual pole/post detection code, in favor of the supplied function(s).
* `check_for_pole = function(pos, node, def, pole_pos, pole_node, pole_def)`
If supplied, this function will be run when the mod is looking for a normal vertical pole/post. Useful if the target node's orientation and/or shape determine what sides a sign can attach to. For example, [Pipeworks](https://forum.minetest.net/viewtopic.php?pid=27794) uses this to figure out if a sign can be attached to a tube or pipe, depending on the tube's/pipe's number of junctions, and on its orientation and that of the placed sign.
* `def`: the placed sign's node defintion
* `pole_pos`: the target node's position
* `pole_node`: the target node itself
* `pole_def`: its node definition
Your code must return **true** if the sign should attach to the target node.
If desired, this entry may simply be set to `check_for_pole = true` if a sign can always attach to this node regardless of facing direction (for example, [Home Decor](https://forum.minetest.net/viewtopic.php?pid=26061) has a round brass pole/post, which always stands vertical, and [Cottages](https://forum.minetest.net/viewtopic.php?id=5120) has a simple table that's basically a fencepost with a platform on top).
* `check_for_horiz_pole = function(pos, node, def, pole_pos, pole_node, pole_def)`
If supplied, this does the same thing for horizontal poles.
Your code must return **true** if the sign should attach to the target node.

104
MODELS.md Normal file
View File

@ -0,0 +1,104 @@
# Anatomy of a sign model
In the model files:
* The base sign model should be designed to look like a flat board placed on one side of the node space. The first material entry in the model file must be assigned to the front and back faces of the sign, the second material must be the sign's edges. The filename should be something along the lines of "mymod_my_cool_sign_wall.obj".
In each of the variants below, generally-speaking, the third material in the model must be assigned to whatever it is that that model uses for the sign's mounting method, and the mounting style will be the last word in the model filename.
* For most signs that are allowed to sit on a vertical pole/post such as a fencepost, the pole-mounted model is just a copy of the base model, shifted back a bit, with a pole mount added to the back. In these models, the third material in the model file must be assigned to the pole mount. Name the model file the same as the base sign, but end the name with "_onpole" instead of "_wall". For example, "mymod_my_cool_sign_onpole.obj".
For signs that allow mounting onto a horizontal pole (such as a Streets mod horizontal "bigpole"), the third material is still the vertical pole mount as above, but there must also be another the pole mount included, designed to wrap around such a pole/post, to which fourth material must be assigned. In most cases, this alternate mount will just be a copy of the vertical pole mount, but rotated by 90°, and explicitly centered vertically in the node space.
While vertical and horizontal pole/post mounting options are independent in the code, if horizontal mounting is enabled, the on-pole model must still have *four* materials, even if the third material is unused, with the horizontal pole mount assigned to the fourth material. In most situations, you'll probably have both vertical and horizontal pole mounts assigned to the third and fourth materials, as above.
* For hanging sign models, the third material must be assigned to whatever it is that makes the sign look like it's hanging from the ceiling (default signs have a simple, flat rectangle, meant to show an image of a simple pair of chains). The model file for these must be named the same as the base model, but ending with "_hanging". For example, "mymod_my_cool_sign_hanging.obj".
* For yard sign models, the third material must be assigned to the "stick" on the back of the sign. The model for this type must be named the same as the base model, but ending with "_yard". For example, "mymod_my_cool_sign_yard.obj".
* For most signs, the sign entity (if applicable) will be a simple rectangle, sized just slightly smaller than the width and height of the sign, and centered relative to the sign face. Its UV map should cover the entire image area, so that the image is shrunk down to fit within the sign's intended text area. The rectangle must be positioned slightly in front of the sign (by 10 millimeters or so, due to engine position precision limitations).
The entity should be named the same as the corresponding wall, on-pole, hanging, and/or yard models, but with "_entity" added just before the mounting style. For example: a sign using "mymod_my_cool_sign_wall.obj" for the base model file should have an entity model file named "mymod_my_cool_sign_entity_wall.obj", if one will be needed.
In your code:
* The first `tiles{}` entry in the sign definition needs to be the front-back texture (how things are arranged within the image file is up to you, provided you match your sign model's UV map to the layout of your image). The second entry will be the texture for the sign's edges.
* For signs that can be mounted on a pole/post, the third item in your `tiles{}` setting specifies the pole mount image to use. When `signs_lib` goes to register the on-pole node(s), the image you specified here will be passed to `register_node()` as either the third or *fourth* tile item, setting the other to the standard blank/empty image, thus revealing only the vertical or horizontal pole mount, respectively. If you don't specify a pole mount image, the standard pole mount texture will be used instead, if needed.
* For signs that can hang from a ceiling, the fourth entry in your `tiles{}` setting specifies the image to apply to the part of the model that makes it look like it's hanging. If not specified, the standard hanging chains image will be used instead, if needed.
* For signs that can stand up in the yard, the fifth `tiles{}` entry specifies the image to be wrapped around the "stick" that the sign's mounted on. If not specified, "default_wood.png" will be used instead, if needed.
* Some signs may allow for more complex entity shapes, images, and UV mapping. For example, [street_signs](https://forum.minetest.net/viewtopic.php?t=20866) has a standard city street intersection sign, the entity mesh for which consists of four simple rectangles. Two of them are identically UV-mapped to the top portion of the texture image, and placed on either side of the upper half of the sign portion of the model. The other two rectangles are also identically UV-mapped, but point to a lower section of the texture, and are rotated by 90° and shifted down in the model, to place them on either side of the lower half of the sign. This causes the first line of text to appear on both sides of the upper half of the sign, with the second line of text appearing on both sides of the lower half.
Signs which don't use the simple models described above may not be compatible with the wall/pole/ceiling/yard placement code, but these things can be overridden/disabled in the node definition, if needed (as with the above intersection sign).
* `signs_lib` automatically blanks-out all redundant `tiles{}` entries for each node.
## Blender users
Start a new project, open the "Sidebar" (usually by pressing `N`), and scroll down to the Display section. Set the Grid floor to 5 lines, Scale to 0.5, and Subdivisions to 8.
This will create an environment where the world origin/center will be the center of a node space at (0,0,0), with major divisions at half-node intervals. With the camera aligned to an axis, zooming in so that one node space fills the window should put the grid at 16 minor divisions per meter, so the grid will correspond to pixels in a typical 16px-apparent texture, if your UV mapping is correct (though a standard sign model uses 32px-apparent textures).
Zoom in a bit more, and you'll see 256 divisions per meter, which can be thought of as 16 divisions per pixel. This is where you'll want to be when positioning the sign entity. In my configuration, the grid maxes out at 256 divisions per meter, even when zoomed in extremely close (this may be standard behavior).
For signs that will use "wallmounted" mode, the model must be lying flat, with its front side facing up along Blender's Z axis, and centered on the X and Y axes. The back of the sign should be exactly flush with the -0.5m mark on the Z axis, putting the whole sign below the world center. The bottom edge of the sign faces the negative end of the Y axis.
For signs that will use "facedir" mode, the sign must be upright, with its back flush with the +0.5m mark along the Y axis, centered on X/Z, with the bottom edge of the sign facing down along the Z axis.
When adding materials, you MUST add them in the order you want them to appear in the exported model, as Blender provides no easy way to enforce a particular order if they come out wrong.
If you look in the `models/` directory, you'll find the standard sign project file, "standard wooden sign.blend", which contains all four variants of the standard sign model ("wallmounted" and "facedir", on-wall and on-pole), designed per the above requirements. This file also contains both entity variants (on-wall and on-pole). You'll notice that there are only two entities. This is because entity rotation has no concept of "wallmounted", "facedir", etc., so all standard signs use the same pair of entities.
To create the text entity model, assuming you're starting with a properly-UV-mapped, "wallmounted" base sign model with a simple one-piece flat design (comparable to, say, a standard wall sign or a [street_signs](https://forum.minetest.net/viewtopic.php?t=20866) warning diamond), do these steps:
1. Snap the cursor to the world center, and set your viewport to Orthographic (usually `5` on the keypad).
2. Switch to Object Mode.
3. Select the sign model.
4. Create a linked duplicate (`Alt-D` in my keymap), as distinct from a simple duplicate (`Shift-D`). Blender will automatically select the duplicate and immediately go into move/translate mode to let you move it around.
5. Without bothering to move the duplicate, press `R` `X` to go into rotatation mode around the X axis, which will also snap the duplicate back to its precise starting point in the process.
6. Rotate the duplicate by 90°, thus putting it upright, with its back side flush with the +0.5m mark on the Y axis.
7. With the duplicate still selected, switch to Edit Mode.
8. Select only the duplicate sign's front face.
9. Rotate your view to the right or left side (usually `3` or `Ctrl-3` on the keypad).
10. Zoom in close enough to get the grid to show 256 divisions per meter, while keeping the selected face in view.
11. Make a simple duplicate of the selected face (`Shift-D`). Blender will automatically select just the new, duplicate face and go into move/translate mode. Yeah, you're making a copy of a copy. 🙂
12. Press `Y` to limit movement to just the Y axis, and move the duplicate face in the negative direction, while snapping to the grid. Put it at least 2 minor divisions from the front of the sign (that is, 2/256 of a meter).
13. Zoom out far enough to get the grid back to 16 divisions per meter, and align your view forward along the Y axis (usually `1` on the keypad).
14. With the duplicate face still selected, scale it along X and/or Z until its edges are just within the limits of your sign model's intended text area. You could also directly move the face's edges inward, perhaps while snapping to the grid, if the sign shape lends itself to that. Make sure the face stays properly-positioned (usually centered) relative to the sign's front!
15. UV-map the duplicate face: `Mesh``UV Unwrap``Reset` followed by `Mesh``UV Unwrap``Project from view (bounds)`.
16. Separate the duplicate face into a new object (`P` in my keymap, then `Selection` in the menu that pops-up).
17. Switch to Object Mode
18. In the model/data tree at the upper-right (well, on my layout), rename the original sign mesh, its duplicate, and the entity mesh to something meaningful.
19. With only the text entity mesh selected, delete all materials from the list on the right, below the model/data tree (these were inherited from the base sign, and aren't needed with an entity mesh).
20. Save your project file.
21. Export the text entity mesh. It is highly recommended that you export to "Wavefront (.obj)" format, as with most other Minetest node models.
Note that the duplicate sign model you created can also be used directly as a "facedir" sign model, as well as being a position reference for the text entity mesh, so I suggest leaving it in your project file when you save.
Use the following export settings (I strongly advise saving them as an Operator Preset; applies to all models and modes):
Forward: [_Z_Forward_]
Up: [_Y_Up______]
🆇 Selection Only
🞎 Animation
🆇 Apply Modifiers
🞎 Use Modifiers Render Settings
🞎 Include Edges
🞎 Smooth Groups
🞎 Bitflag Smooth Groups
🆇 Write Normals
🆇 Include UVs
🞎 Write Materials
🞎 Triangulate Faces
🞎 Write Nurbs
🞎 Polygroups
🆇 Objects as OBJ Objects
🞎 Objects as OBJ Groups
🆇 Material Groups
🞎 Keep Vertex Order
(_Scale:________1.00_)
Path Mode: [_Auto____]

63
README.md Normal file
View File

@ -0,0 +1,63 @@
# signs_lib
This is kaeza's and my signs library mod, originally forked from PilzAdam's version and rewritten mostly by kaeza to include a number of new features, then rewritten again a couple more times (finding its way into my [street_signs](https://forum.minetest.net/viewtopic.php?t=20866) mod for a while, where it developed nicely 🙂).
The purpose of PilzAdam's original mod was to just provide a no-frills way make default signs show their text, via an entity placed right in front. It was hacky, but it worked!
While still hacky, this library is a modernized, feature-enhanced version of his code, which not only has visible text, but which allows that text to be colored, and displayed at any reasonable size, with any reasonable amount of text (as configured in a given node definition), with two font resolutions available. Plus, almost any sign can be attached to almost any kind of suitable pole or fencepost. Most signs that use the standard wall sign model can also be hung from a ceiling, or placed upright as a yard sign, in addition to being flat on a wall or floor. Unlike previous incarnations of this code, signs' text is visible when the sign is flat on the floor or ceiling, as well as all other supported orientations/mounting styles.
Without any other add-ons, this mod upgrades only the default wooden and steel signs.
## Text formatting
In general, text is rendered exactly as-written, left-to-right, top to bottom, without any translations or modifications. The standard fonts support 7-bit ASCII as well as Cyrllic.
That said, there are some basic text formatting options:
* Paragraph breaks (blank lines) may be inserted by simply hitting `Enter` twice.
* Eight arrow symbols are available, occupying positions 0x81 through 0x88 in the character set. These are produced by writing a "^" followed by a number 1 to 8:
"^1" = `⬆`, "^2" = `⬈`, "^3" = `➡`, "^4" = `⬊`, "^5" = `⬇`, "^6" = `⬋`, "^7" = `⬅`, "^8" = `⬉`
Writing "^" followed by a letter "a" through "h" will produce double-wide versions of these arrows, in the same order. These wide arrows occupy 0x89 to 0x91 in the character set.
* A color may be specified in the sign text by using "#" followed by a single hexadcimal digit (0-9 or a-f). These colors come from the standard Linux/IRC/CGA color set, and are shown in the sign's formspec. Any color change will remain in effect until changed again, or until the next line break. Any number of color changes in any arbitrary arrangement is allowed.
* Most writable signs can display double-wide text by flipping a switch in the sign's formspec.
## Sign placement and rotation notes
* Pointing at a wall while placing will, of course, place the sign on the wall.
* For most signs that use the standard sign model, pointing at the ground while placing creates an upright standalone yard sign. Others not using the standard model will most often end up flat on the ground.
* For most standard signs, pointing at the ceiling while placing will hang the sign from the ceiling by a pair of chains. Others not using the standard model will usually end up flat on the ceiling.
* Pointing at an X or Z side of something that's detected as a pole/post will mount the sign onto that pole, if possible. Note that the sign actually occupies the node space in front of the pole, since they're still separate nodes. But, I figure, no one's going to want to use the space in front of the sign anyway, because doing so would of course obscure the sign, so it doesn't matter if the sign logically occupies that node space.
* If you're holding the "Sneak" key (usually `Shift`) while placing, the on-pole/hanging/yard checks are skipped, allowing you to just place a sign flat onto the ground, ceiling, or top/bottom of a pole/post, like they used to work before `signs_lib` was a thing.
* If a sign is on the wall or flat on the ground, the screwdriver will spin it from one wall to the next, in clockwise order, whether there's a wall to attach to or not, followed by putting it flat on the ground, then flat against the ceiling, then back to wall orientation.
* If a sign is hanging from the ceiling (not flat against it), the screwdriver will just rotate it around its Y axis.
* If a sign is on a vertical pole/post, the screwdriver will rotate it around the pole, but only if there's nothing in the way.
* If a sign is on a horizontal pole/post, the screwdriver will flip it from one side to the other as long as there's nothing in the way.
## Chat commands
At present, only one command is defined:
* `/regen_signs`
This will read through the list of currently-loaded blocks known to contain one or more signs, delete all entities found in each sign's node space, and respawn and re-render each from scratch.
The list of loaded, sign-bearing blocks is created/populated by an LBM (and trimmed by this command if any listed blocks are found to have been unloaded).
## Privileges
* `signslib_edit`
Allows to rotate signs and to open (and consequently edit) any default sign formspec.

681
api.lua
View File

@ -2,11 +2,12 @@
local S = signs_lib.gettext
local function get_sign_formspec() end
signs_lib.lbm_restore_nodes = {}
signs_lib.old_fenceposts = {}
signs_lib.old_fenceposts_replacement_signs = {}
signs_lib.old_fenceposts_with_signs = {}
signs_lib.allowed_poles = {}
-- Settings used for a standard wood or steel wall sign
signs_lib.standard_lines = 6
@ -31,6 +32,11 @@ signs_lib.standard_steel_sign_sounds = table.copy(minetest.registered_items["def
signs_lib.default_text_scale = {x=10, y=10}
signs_lib.old_widefont_signs = {}
signs_lib.block_list = {}
signs_lib.totalblocks = 0
signs_lib.standard_yaw = {
0,
math.pi / -2,
@ -63,6 +69,20 @@ signs_lib.wall_fdir_to_back = {
{ 1, 0 },
}
signs_lib.fdir_flip_to_back = {
[0] = { 0, 2 },
[1] = { 2, 0 },
[2] = { 0, -2 },
[3] = { -2, 0 }
}
signs_lib.wall_fdir_flip_to_back = {
[2] = { 2, 0 },
[3] = { -2, 0 },
[4] = { 0, 2 },
[5] = { 0, -2 },
}
signs_lib.fdir_to_back_left = {
[0] = { -1, 1 },
[1] = { 1, 1 },
@ -114,25 +134,50 @@ signs_lib.rotate_facedir_simple = {
[5] = 0
}
signs_lib.flip_facedir = {
[0] = 2,
[1] = 3,
[2] = 0,
[3] = 1,
[4] = 6,
[5] = 4,
[6] = 4
}
signs_lib.flip_walldir = {
[0] = 1,
[1] = 0,
[2] = 3,
[3] = 2,
[4] = 5,
[5] = 4
}
-- Initialize character texture cache
local ctexcache = {}
local ctexcache_wide = {}
-- entity handling
minetest.register_entity("signs_lib:text", {
collisionbox = { 0, 0, 0, 0, 0, 0 },
visual = "mesh",
mesh = "signs_lib_standard_wall_sign_entity.obj",
mesh = "signs_lib_standard_sign_entity_wall.obj",
textures = {},
static_save = false,
static_save = true,
backface_culling = false
})
function signs_lib.delete_objects(pos)
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
if v then
local e = v:get_luaentity()
if e and string.match(e.name, "sign.*text") then
v:remove()
end
end
end
end
function signs_lib.spawn_entity(pos, texture)
@ -145,8 +190,17 @@ function signs_lib.spawn_entity(pos, texture)
local obj
if #objects > 0 then
obj = objects[1]
else
for _, v in ipairs(objects) do
if v then
local e = v:get_luaentity()
if e and e.name == "signs_lib:text" then
obj = v
end
end
end
end
if not obj then
obj = minetest.add_entity(pos, "signs_lib:text")
end
@ -193,6 +247,17 @@ function signs_lib.spawn_entity(pos, texture)
end
end
function signs_lib.set_obj_text(pos, text)
local split = signs_lib.split_lines_and_words
local text_ansi = Utf8ToAnsi(text)
local n = minetest.registered_nodes[minetest.get_node(pos).name]
signs_lib.delete_objects(pos)
-- only create sign entity for actual text
if text_ansi and text_ansi ~= "" then
signs_lib.spawn_entity(pos, signs_lib.make_sign_texture(split(text_ansi), pos) )
end
end
-- rotation
function signs_lib.handle_rotation(pos, node, user, mode)
@ -205,7 +270,8 @@ function signs_lib.handle_rotation(pos, node, user, mode)
local def = minetest.registered_items[node.name]
if string.match(node.name, "_onpole") then
local newparam2 = signs_lib.rotate_walldir_simple[node.param2] or 4
if not string.match(node.name, "_horiz") then
newparam2 = signs_lib.rotate_walldir_simple[node.param2] or 4
local t = signs_lib.wall_fdir_to_back_left
if def.paramtype2 ~= "wallmounted" then
@ -218,17 +284,30 @@ function signs_lib.handle_rotation(pos, node, user, mode)
y = pos.y,
z = pos.z + t[node.param2][2]
}
else
-- flip the sign to the other side of the horizontal pole
newparam2 = signs_lib.flip_walldir[node.param2] or 4
local t = signs_lib.wall_fdir_flip_to_back
if def.paramtype2 ~= "wallmounted" then
newparam2 = signs_lib.flip_facedir[node.param2] or 0
t = signs_lib.fdir_flip_to_back
end
tpos = {
x = pos.x + t[node.param2][1],
y = pos.y,
z = pos.z + t[node.param2][2]
}
end
local node2 = minetest.get_node(tpos)
local def2 = minetest.registered_items[node2.name]
if not def2 or not def2.buildable_to then return true end -- undefined, or not buildable_to.
minetest.set_node(tpos, {name = node.name, param2 = newparam2})
minetest.get_meta(tpos):from_table(minetest.get_meta(pos):to_table())
minetest.remove_node(pos)
signs_lib.delete_objects(pos)
elseif string.match(node.name, "_hanging") or string.match(node.name, "yard") then
minetest.swap_node(tpos, { name = node.name, param2 = signs_lib.rotate_facedir_simple[node.param2] or 0 })
elseif minetest.registered_items[node.name].paramtype2 == "wallmounted" then
@ -237,7 +316,6 @@ function signs_lib.handle_rotation(pos, node, user, mode)
minetest.swap_node(tpos, { name = node.name, param2 = signs_lib.rotate_facedir[node.param2] or 0 })
end
signs_lib.delete_objects(tpos)
signs_lib.update_sign(tpos)
return true
end
@ -256,8 +334,10 @@ end
local TP = signs_lib.path .. "/textures"
-- Font file formatter
local CHAR_FILE = "%s_%02x.png"
local CHAR_FILE_WIDE = "%s_%s.png"
-- Fonts path
local CHAR_PATH = TP .. "/" .. CHAR_FILE
local CHAR_PATH_WIDE = TP .. "/" .. CHAR_FILE_WIDE
-- Lots of overkill here. KISS advocates, go away, shoo! ;) -- kaeza
@ -317,6 +397,7 @@ end
local function build_char_db(font_size)
local cw = {}
local cw_wide = {}
-- To calculate average char width.
local total_width = 0
@ -332,20 +413,32 @@ local function build_char_db(font_size)
end
end
for i = 1, #signs_lib.wide_character_codes do
local ch = signs_lib.wide_character_codes[i]
local w, h = signs_lib.read_image_size(CHAR_PATH_WIDE:format("signs_lib_font_"..font_size.."px", ch))
if w and h then
cw_wide[ch] = w
total_width = total_width + w
char_count = char_count + 1
end
end
local cbw, cbh = signs_lib.read_image_size(TP.."/signs_lib_color_"..font_size.."px_n.png")
assert(cbw and cbh, "error reading bg dimensions")
return cw, cbw, cbh, (total_width / char_count)
return cw, cbw, cbh, (total_width / char_count), cw_wide
end
signs_lib.charwidth15,
signs_lib.colorbgw15,
signs_lib.lineheight15,
signs_lib.avgwidth15 = build_char_db(15)
signs_lib.avgwidth15,
signs_lib.charwidth_wide15 = build_char_db(15)
signs_lib.charwidth31,
signs_lib.colorbgw31,
signs_lib.lineheight31,
signs_lib.avgwidth31 = build_char_db(31)
signs_lib.avgwidth31,
signs_lib.charwidth_wide31 = build_char_db(31)
local sign_groups = {choppy=2, dig_immediate=2}
local fences_with_sign = { }
@ -381,7 +474,22 @@ local function char_tex(font_name, ch)
end
end
local function make_line_texture(line, lineno, pos, line_width, line_height, cwidth_tab, font_size, colorbgw)
local function char_tex_wide(font_name, ch)
if ctexcache_wide[font_name..ch] then
return ctexcache_wide[font_name..ch], true
else
local exists, tex = file_exists(CHAR_PATH_WIDE:format(font_name, ch))
if exists then
tex = CHAR_FILE_WIDE:format(font_name, ch)
else
tex = CHAR_FILE:format(font_name, 0x5f)
end
ctexcache_wide[font_name..ch] = tex
return tex, exists
end
end
local function make_line_texture(line, lineno, pos, line_width, line_height, cwidth_tab, font_size, colorbgw, cwidth_tab_wide)
local width = 0
local maxw = 0
local font_name = "signs_lib_font_"..font_size.."px"
@ -418,6 +526,27 @@ local function make_line_texture(line, lineno, pos, line_width, line_height, cwi
local word_l = #word
local i = 1
while i <= word_l do
local wide_c
if "&#x" == word:sub(i, i + 2) then
local j = i + 3
local collected = ""
while j <= word_l do
local c = word:sub(j, j)
if c == ";" then
wide_c = collected
break
elseif c < "0" then
break
elseif "f" < c then
break
elseif ("9" < c) and (c < "a") then
break
else
collected = collected .. c
j = j + 1
end
end
end
local c = word:sub(i, i)
if c == "#" then
local cc = tonumber(word:sub(i+1, i+1), 16)
@ -425,6 +554,25 @@ local function make_line_texture(line, lineno, pos, line_width, line_height, cwi
i = i + 1
cur_color = cc
end
elseif wide_c then
local w = cwidth_tab_wide[wide_c]
if w then
width = width + w + 1
if width >= (line_width - cwidth_tab[" "]) then
width = 0
else
maxw = math_max(width, maxw)
end
if #chars < MAX_INPUT_CHARS then
table.insert(chars, {
off = ch_offs,
tex = char_tex_wide(font_name, wide_c),
col = ("%X"):format(cur_color),
})
end
ch_offs = ch_offs + w
end
i = i + #wide_c + 3
else
local w = cwidth_tab[c]
if w then
@ -493,8 +641,10 @@ local function make_line_texture(line, lineno, pos, line_width, line_height, cwi
return table.concat(texture), lineno
end
local function make_sign_texture(lines, pos)
function signs_lib.make_sign_texture(lines, pos)
local node = minetest.get_node(pos)
local meta = minetest.get_meta(pos)
local def = minetest.registered_items[node.name]
if not def or not def.entity_info then return end
@ -502,19 +652,27 @@ local function make_sign_texture(lines, pos)
local line_width
local line_height
local char_width
local char_width_wide
local colorbgw
local widemult = 1
if meta:get_int("widefont") == 1 then
widemult = 0.5
end
if def.font_size and def.font_size == 31 then
font_size = 31
line_width = math.floor(signs_lib.avgwidth31 * def.chars_per_line) * def.horiz_scaling
line_width = math.floor(signs_lib.avgwidth31 * def.chars_per_line) * (def.horiz_scaling * widemult)
line_height = signs_lib.lineheight31
char_width = signs_lib.charwidth31
char_width_wide = signs_lib.charwidth_wide31
colorbgw = signs_lib.colorbgw31
else
font_size = 15
line_width = math.floor(signs_lib.avgwidth15 * def.chars_per_line) * def.horiz_scaling
line_width = math.floor(signs_lib.avgwidth15 * def.chars_per_line) * (def.horiz_scaling * widemult)
line_height = signs_lib.lineheight15
char_width = signs_lib.charwidth15
char_width_wide = signs_lib.charwidth_wide15
colorbgw = signs_lib.colorbgw15
end
@ -523,7 +681,7 @@ local function make_sign_texture(lines, pos)
local lineno = 0
for i = 1, #lines do
if lineno >= def.number_of_lines then break end
local linetex, ln = make_line_texture(lines[i], lineno, pos, line_width, line_height, char_width, font_size, colorbgw)
local linetex, ln = make_line_texture(lines[i], lineno, pos, line_width, line_height, char_width, font_size, colorbgw, char_width_wide)
table.insert(texture, linetex)
lineno = ln + 1
end
@ -534,56 +692,18 @@ end
function signs_lib.split_lines_and_words(text)
if not text then return end
local lines = { }
for _, line in ipairs(text:split("\n")) do
for _, line in ipairs(text:split("\n", true)) do
table.insert(lines, line:split(" "))
end
return lines
end
function signs_lib.set_obj_text(pos, text)
local split = signs_lib.split_lines_and_words
local text_ansi = Utf8ToAnsi(text)
local n = minetest.registered_nodes[minetest.get_node(pos).name]
signs_lib.delete_objects(pos)
signs_lib.spawn_entity(pos, make_sign_texture(split(text_ansi), pos))
end
function signs_lib.rightclick_sign(pos, node, player, itemstack, pointed_thing)
local function make_widefont_nodename(name)
if string.find(name, "_widefont") then return name end
if string.find(name, "_onpole") then
return string.gsub(name, "_onpole", "_widefont_onpole")
elseif string.find(name, "_hanging") then
return string.gsub(name, "_hanging", "_widefont_hanging")
else
return name.."_widefont"
end
end
if not signs_lib.can_modify(pos, player) then return end
function signs_lib.construct_sign(pos)
local form = "size[6,4]"..
"textarea[0,-0.3;6.5,3;text;;${text}]"..
"background[-0.5,-0.5;7,5;signs_lib_sign_bg.jpg]"
local node = minetest.get_node(pos)
local wname = make_widefont_nodename(node.name)
if minetest.registered_items[wname] then
local state = "off"
if string.find(node.name, "widefont") then state = "on" end
form = form.."label[1,3.4;Use wide font]"..
"image_button[1.1,3.7;1,0.6;signs_lib_switch_"..
state..".png;"..
state..";;;false;signs_lib_switch_interm.png]"..
"button_exit[3,3.4;2,1;ok;"..S("Write").."]"
else
form = form.."button_exit[2,3.4;2,1;ok;"..S("Write").."]"
end
local meta = minetest.get_meta(pos)
meta:set_string("formspec", form)
local i = meta:get_string("infotext")
if i == "" then -- it wasn't even set, so set it.
meta:set_string("infotext", "")
end
player:get_meta():set_string("signslib:pos", minetest.pos_to_string(pos))
minetest.show_formspec(player:get_player_name(), "signs_lib:sign", get_sign_formspec(pos, node.name))
end
function signs_lib.destruct_sign(pos)
@ -603,6 +723,11 @@ end
function signs_lib.update_sign(pos, fields)
local meta = minetest.get_meta(pos)
-- legacy udpate
if meta:get_string("formspec") ~= "" then
meta:set_string("formspec", "")
end
local text = fields and fields.text or meta:get_string("text")
text = trim_input(text)
@ -615,40 +740,6 @@ function signs_lib.update_sign(pos, fields)
signs_lib.set_obj_text(pos, text)
end
function signs_lib.receive_fields(pos, formname, fields, sender)
if not fields or not signs_lib.can_modify(pos, sender) then return end
if fields.text and fields.ok then
minetest.log("action", S("@1 wrote \"@2\" to sign at @3",
(sender:get_player_name() or ""),
fields.text:gsub('\\', '\\\\'):gsub("\n", "\\n"),
minetest.pos_to_string(pos)
))
signs_lib.update_sign(pos, fields)
elseif fields.on or fields.off then
local node = minetest.get_node(pos)
local newname
if fields.on and string.find(node.name, "widefont") then
newname = string.gsub(node.name, "_widefont", "")
elseif fields.off and not string.find(node.name, "widefont") then
newname = make_widefont_nodename(node.name)
end
if newname then
minetest.log("action", S("@1 flipped the wide-font switch to \"@2\" at @3",
(sender:get_player_name() or ""),
(fields.on and "off" or "on"),
minetest.pos_to_string(pos)
))
minetest.swap_node(pos, {name = newname, param2 = node.param2})
signs_lib.construct_sign(pos)
signs_lib.update_sign(pos, fields)
end
end
end
function signs_lib.can_modify(pos, player)
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
@ -661,7 +752,7 @@ function signs_lib.can_modify(pos, player)
if owner == ""
or playername == owner
or (minetest.check_player_privs(playername, {sign_editor=true}))
or (minetest.check_player_privs(playername, {signslib_edit=true}))
or (playername == minetest.settings:get("name")) then
return true
end
@ -700,21 +791,42 @@ function signs_lib.check_for_pole(pos, pointed_thing)
local pnode = minetest.get_node(ppos)
local pdef = minetest.registered_items[pnode.name]
if (signs_lib.allowed_poles[pnode.name]
or (pdef and pdef.drawtype == "fencelike")
or string.find(pnode.name, "default:fence_")
if not pdef then return end
if signs_lib.check_for_ceiling(pointed_thing) or signs_lib.check_for_floor(pointed_thing) then
return false
end
if type(pdef.check_for_pole) == "function" then
local node = minetest.get_node(pos)
local def = minetest.registered_items[node.name]
return pdef.check_for_pole(pos, node, def, ppos, pnode, pdef)
elseif pdef.check_for_pole
or pdef.drawtype == "fencelike"
or string.find(pnode.name, "_post")
or string.find(pnode.name, "fencepost")
or string.find(pnode.name, "streets:streetlamp_basic_top")
or (pnode.name == "streets:bigpole" and pnode.param2 < 4)
or (pnode.name == "streets:bigpole" and pnode.param2 > 19 and pnode.param2 < 24)
)
and
(pos.x ~= ppos.x or pos.z ~= ppos.z) then
or string.find(pnode.name, "fencepost") then
return true
end
end
function signs_lib.check_for_horizontal_pole(pos, pointed_thing)
local ppos = minetest.get_pointed_thing_position(pointed_thing)
local pnode = minetest.get_node(ppos)
local pdef = minetest.registered_items[pnode.name]
if not pdef then return end
if signs_lib.check_for_ceiling(pointed_thing) or signs_lib.check_for_floor(pointed_thing) then
return false
end
if type(pdef.check_for_horiz_pole) == "function" then
local node = minetest.get_node(pos)
local def = minetest.registered_items[node.name]
return pdef.check_for_horiz_pole(pos, node, def, ppos, pnode, pdef)
end
end
function signs_lib.check_for_ceiling(pointed_thing)
if pointed_thing.above.x == pointed_thing.under.x
and pointed_thing.above.z == pointed_thing.under.z
@ -733,13 +845,19 @@ end
function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locked)
local playername = placer:get_player_name()
local def = minetest.registered_items[itemstack:get_name()]
local controls = placer:get_player_control()
local signname = itemstack:get_name()
local no_wall_name = string.gsub(signname, "_wall", "")
local def = minetest.registered_items[signname]
local ppos = minetest.get_pointed_thing_position(pointed_thing)
local pnode = minetest.get_node(ppos)
local pdef = minetest.registered_items[pnode.name]
if (def.allow_onpole ~= false) and signs_lib.check_for_pole(pos, pointed_thing) then
if def.allow_onpole and signs_lib.check_for_pole(pos, pointed_thing) and not controls.sneak then
local newparam2
local lookdir = minetest.yaw_to_dir(placer:get_look_horizontal())
if def.paramtype2 == "wallmounted" then
@ -748,16 +866,31 @@ function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locke
newparam2 = minetest.dir_to_facedir(lookdir)
end
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = itemstack:get_name().."_onpole", param2 = newparam2})
elseif def.allow_hanging and signs_lib.check_for_ceiling(pointed_thing) then
minetest.swap_node(pos, {name = no_wall_name.."_onpole", param2 = newparam2})
elseif def.allow_onpole_horizontal and signs_lib.check_for_horizontal_pole(pos, pointed_thing) and not controls.sneak then
local newparam2
local lookdir = minetest.yaw_to_dir(placer:get_look_horizontal())
if def.paramtype2 == "wallmounted" then
newparam2 = minetest.dir_to_wallmounted(lookdir)
else
newparam2 = minetest.dir_to_facedir(lookdir)
end
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = no_wall_name.."_onpole_horiz", param2 = newparam2})
elseif def.allow_hanging and signs_lib.check_for_ceiling(pointed_thing) and not controls.sneak then
local newparam2 = minetest.dir_to_facedir(placer:get_look_dir())
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = itemstack:get_name().."_hanging", param2 = newparam2})
minetest.swap_node(pos, {name = no_wall_name.."_hanging", param2 = newparam2})
elseif def.allow_yard and signs_lib.check_for_floor(pointed_thing) and not controls.sneak then
local newparam2 = minetest.dir_to_facedir(placer:get_look_dir())
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = no_wall_name.."_yard", param2 = newparam2})
elseif def.paramtype2 == "facedir" and signs_lib.check_for_ceiling(pointed_thing) then
minetest.swap_node(pos, {name = itemstack:get_name(), param2 = 6})
minetest.swap_node(pos, {name = signname, param2 = 6})
elseif def.paramtype2 == "facedir" and signs_lib.check_for_floor(pointed_thing) then
minetest.swap_node(pos, {name = itemstack:get_name(), param2 = 4})
minetest.swap_node(pos, {name = signname, param2 = 4})
end
if locked then
local meta = minetest.get_meta(pos)
meta:set_string("owner", playername)
@ -769,179 +902,192 @@ function signs_lib.register_fence_with_sign()
minetest.log("warning", "[signs_lib] ".."Attempt to call no longer used function signs_lib.register_fence_with_sign()")
end
local function register_sign(name, rdef)
local def = table.copy(rdef)
function signs_lib.register_sign(name, raw_def)
local def = table.copy(raw_def)
if rdef.entity_info == "standard" then
if raw_def.entity_info == "standard" then
def.entity_info = {
mesh = "signs_lib_standard_wall_sign_entity.obj",
mesh = "signs_lib_standard_sign_entity_wall.obj",
yaw = signs_lib.wallmounted_yaw
}
elseif rdef.entity_info then
def.entity_info = rdef.entity_info
elseif raw_def.entity_info then
def.entity_info = raw_def.entity_info
end
def.after_place_node = rdef.after_place_node or signs_lib.after_place_node
def.after_place_node = raw_def.after_place_node or signs_lib.after_place_node
if rdef.entity_info then
def.on_rightclick = rdef.on_rightclick or signs_lib.construct_sign
def.on_construct = rdef.on_construct or signs_lib.construct_sign
def.on_destruct = rdef.on_destruct or signs_lib.destruct_sign
def.on_receive_fields = rdef.on_receive_fields or signs_lib.receive_fields
def.on_punch = rdef.on_punch or signs_lib.update_sign
def.number_of_lines = rdef.number_of_lines or signs_lib.standard_lines
def.horiz_scaling = rdef.horiz_scaling or signs_lib.standard_hscale
def.vert_scaling = rdef.vert_scaling or signs_lib.standard_vscale
def.line_spacing = rdef.line_spacing or signs_lib.standard_lspace
def.font_size = rdef.font_size or signs_lib.standard_fsize
def.x_offset = rdef.x_offset or signs_lib.standard_xoffs
def.y_offset = rdef.y_offset or signs_lib.standard_yoffs
def.chars_per_line = rdef.chars_per_line or signs_lib.standard_cpl
def.default_color = rdef.default_color or "0"
if rdef.locked and not rdef.after_place_node then
if raw_def.entity_info then
def.on_rightclick = raw_def.on_rightclick or signs_lib.rightclick_sign
def.on_destruct = raw_def.on_destruct or signs_lib.destruct_sign
def.on_punch = raw_def.on_punch or signs_lib.update_sign
def.number_of_lines = raw_def.number_of_lines or signs_lib.standard_lines
def.horiz_scaling = raw_def.horiz_scaling or signs_lib.standard_hscale
def.vert_scaling = raw_def.vert_scaling or signs_lib.standard_vscale
def.line_spacing = raw_def.line_spacing or signs_lib.standard_lspace
def.font_size = raw_def.font_size or signs_lib.standard_fsize
def.x_offset = raw_def.x_offset or signs_lib.standard_xoffs
def.y_offset = raw_def.y_offset or signs_lib.standard_yoffs
def.chars_per_line = raw_def.chars_per_line or signs_lib.standard_cpl
def.default_color = raw_def.default_color or "0"
if raw_def.locked and not raw_def.after_place_node then
def.after_place_node = function(pos, placer, itemstack, pointed_thing)
signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, true)
end
end
end
def.paramtype = rdef.paramtype or "light"
def.drawtype = rdef.drawtype or "mesh"
def.mesh = rdef.mesh or "signs_lib_standard_wall_sign.obj"
def.wield_image = rdef.wield_image or def.inventory_image
def.drop = rdef.drop or name
def.sounds = rdef.sounds or signs_lib.standard_wood_sign_sounds
def.paramtype2 = rdef.paramtype2 or "wallmounted"
def.on_rotate = rdef.on_rotate or signs_lib.handle_rotation
def.paramtype = raw_def.paramtype or "light"
def.drawtype = raw_def.drawtype or "mesh"
def.mesh = raw_def.mesh or "signs_lib_standard_sign_wall.obj"
def.wield_image = raw_def.wield_image or def.inventory_image
def.drop = raw_def.drop or name
def.sounds = raw_def.sounds or signs_lib.standard_wood_sign_sounds
def.paramtype2 = raw_def.paramtype2 or "wallmounted"
def.on_rotate = raw_def.on_rotate or signs_lib.handle_rotation
if rdef.groups then
def.groups = rdef.groups
if raw_def.groups then
def.groups = raw_def.groups
else
def.groups = signs_lib.standard_wood_groups
end
local cbox = signs_lib.make_selection_boxes(35, 25)
def.selection_box = rdef.selection_box or cbox
def.node_box = table.copy(rdef.node_box or rdef.selection_box or cbox)
def.selection_box = raw_def.selection_box or cbox
def.node_box = table.copy(raw_def.node_box or raw_def.selection_box or cbox)
if def.sunlight_propagates ~= false then
def.sunlight_propagates = true
end
def.tiles[3] = "signs_lib_blank.png"
def.tiles[4] = "signs_lib_blank.png"
def.tiles[5] = "signs_lib_blank.png"
def.tiles[6] = "signs_lib_blank.png"
minetest.register_node(":"..name, def)
table.insert(signs_lib.lbm_restore_nodes, name)
if rdef.allow_onpole ~= false then
local no_wall_name = string.gsub(name, "_wall", "")
local opdef = table.copy(def)
local othermounts_def = table.copy(def)
if raw_def.allow_onpole or raw_def.allow_onpole_horizontal then
local offset = 0.3125
if opdef.uses_slim_pole_mount then
if othermounts_def.uses_slim_pole_mount then
offset = 0.35
end
opdef.selection_box = rdef.onpole_selection_box or opdef.selection_box
opdef.node_box = rdef.onpole_node_box or opdef.selection_box
othermounts_def.selection_box = raw_def.onpole_selection_box or othermounts_def.selection_box
othermounts_def.node_box = raw_def.onpole_node_box or othermounts_def.selection_box
if opdef.paramtype2 == "wallmounted" then
opdef.node_box.wall_side[1] = def.node_box.wall_side[1] - offset
opdef.node_box.wall_side[4] = def.node_box.wall_side[4] - offset
if othermounts_def.paramtype2 == "wallmounted" then
othermounts_def.node_box.wall_side[1] = def.node_box.wall_side[1] - offset
othermounts_def.node_box.wall_side[4] = def.node_box.wall_side[4] - offset
opdef.selection_box.wall_side[1] = def.selection_box.wall_side[1] - offset
opdef.selection_box.wall_side[4] = def.selection_box.wall_side[4] - offset
othermounts_def.selection_box.wall_side[1] = def.selection_box.wall_side[1] - offset
othermounts_def.selection_box.wall_side[4] = def.selection_box.wall_side[4] - offset
else
opdef.node_box.fixed[3] = def.node_box.fixed[3] + offset
opdef.node_box.fixed[6] = def.node_box.fixed[6] + offset
othermounts_def.node_box.fixed[3] = def.node_box.fixed[3] + offset
othermounts_def.node_box.fixed[6] = def.node_box.fixed[6] + offset
opdef.selection_box.fixed[3] = def.selection_box.fixed[3] + offset
opdef.selection_box.fixed[6] = def.selection_box.fixed[6] + offset
othermounts_def.selection_box.fixed[3] = def.selection_box.fixed[3] + offset
othermounts_def.selection_box.fixed[6] = def.selection_box.fixed[6] + offset
end
opdef.groups.not_in_creative_inventory = 1
opdef.tiles[3] = "signs_lib_pole_mount.png"
opdef.mesh = string.gsub(opdef.mesh, ".obj$", "_onpole.obj")
othermounts_def.groups.not_in_creative_inventory = 1
othermounts_def.mesh = raw_def.onpole_mesh or string.gsub(othermounts_def.mesh, "wall.obj$", "onpole.obj")
if opdef.entity_info then
opdef.entity_info.mesh = string.gsub(opdef.entity_info.mesh, ".obj$", "_onpole.obj")
if othermounts_def.entity_info then
othermounts_def.entity_info.mesh = string.gsub(othermounts_def.entity_info.mesh, "entity_wall.obj$", "entity_onpole.obj")
end
minetest.register_node(":"..name.."_onpole", opdef)
table.insert(signs_lib.lbm_restore_nodes, name.."_onpole")
end
if rdef.allow_hanging then
-- setting one of item 3 or 4 to a texture and leaving the other "blank",
-- reveals either the vertical or horizontal pole mount part of the model
local hdef = table.copy(def)
hdef.paramtype2 = "facedir"
if raw_def.allow_onpole then
othermounts_def.tiles[3] = raw_def.tiles[3] or "signs_lib_pole_mount.png"
othermounts_def.tiles[4] = "signs_lib_blank.png"
othermounts_def.tiles[5] = "signs_lib_blank.png"
othermounts_def.tiles[6] = "signs_lib_blank.png"
minetest.register_node(":"..no_wall_name.."_onpole", othermounts_def)
table.insert(signs_lib.lbm_restore_nodes, no_wall_name.."_onpole")
end
if raw_def.allow_onpole_horizontal then
local onpole_horiz_def = table.copy(othermounts_def)
onpole_horiz_def.tiles[3] = "signs_lib_blank.png"
onpole_horiz_def.tiles[4] = raw_def.tiles[3] or "signs_lib_pole_mount.png"
onpole_horiz_def.tiles[5] = "signs_lib_blank.png"
onpole_horiz_def.tiles[6] = "signs_lib_blank.png"
minetest.register_node(":"..no_wall_name.."_onpole_horiz", onpole_horiz_def)
table.insert(signs_lib.lbm_restore_nodes, no_wall_name.."_onpole_horiz")
end
if raw_def.allow_hanging then
local hanging_def = table.copy(def)
hanging_def.paramtype2 = "facedir"
local hcbox = signs_lib.make_selection_boxes(35, 32, nil, 0, 3, -18.5, true)
hdef.selection_box = rdef.hanging_selection_box or hcbox
hdef.node_box = rdef.hanging_node_box or rdef.hanging_selection_box or hcbox
hanging_def.selection_box = raw_def.hanging_selection_box or hcbox
hanging_def.node_box = raw_def.hanging_node_box or raw_def.hanging_selection_box or hcbox
hdef.groups.not_in_creative_inventory = 1
hdef.tiles[3] = "signs_lib_hangers.png"
hdef.mesh = string.gsub(string.gsub(hdef.mesh, "_facedir.obj", ".obj"), ".obj$", "_hanging.obj")
hanging_def.groups.not_in_creative_inventory = 1
hanging_def.tiles[3] = raw_def.tiles[4] or "signs_lib_hangers.png"
hanging_def.tiles[4] = "signs_lib_blank.png"
hanging_def.tiles[5] = "signs_lib_blank.png"
hanging_def.tiles[6] = "signs_lib_blank.png"
if hdef.entity_info then
hdef.entity_info.mesh = string.gsub(string.gsub(hdef.entity_info.mesh, "_facedir.obj", ".obj"), ".obj$", "_hanging.obj")
hdef.entity_info.yaw = signs_lib.standard_yaw
hanging_def.mesh = raw_def.hanging_mesh or string.gsub(string.gsub(hanging_def.mesh, "wall.obj$", "hanging.obj"), "_facedir", "")
if hanging_def.entity_info then
hanging_def.entity_info.mesh = string.gsub(string.gsub(hanging_def.entity_info.mesh, "entity_wall.obj$", "entity_hanging.obj"), "_facedir", "")
hanging_def.entity_info.yaw = signs_lib.standard_yaw
end
minetest.register_node(":"..name.."_hanging", hdef)
table.insert(signs_lib.lbm_restore_nodes, name.."_hanging")
minetest.register_node(":"..no_wall_name.."_hanging", hanging_def)
table.insert(signs_lib.lbm_restore_nodes, no_wall_name.."_hanging")
end
end
--[[
The main sign registration function
===================================
if raw_def.allow_yard then
Example minimal recommended def for writable signs:
local ydef = table.copy(def)
ydef.paramtype2 = "facedir"
signs_lib.register_sign("foo:my_cool_sign", {
description = "Wooden cool sign",
inventory_image = "signs_lib_sign_cool_inv.png",
tiles = {
"signs_lib_sign_cool.png",
"signs_lib_sign_cool_edges.png"
},
number_of_lines = 2,
horiz_scaling = 0.8,
vert_scaling = 1,
line_spacing = 9,
font_size = 31,
x_offset = 7,
y_offset = 4,
chars_per_line = 40,
entity_info = "standard"
})
local ycbox = signs_lib.make_selection_boxes(35, 34.5, false, 0, -1.25, -19.69, true)
* default def assumes a wallmounted sign with on-pole being allowed.
ydef.selection_box = raw_def.yard_selection_box or ycbox
ydef.tiles[3] = raw_def.tiles[5] or "default_wood.png"
ydef.tiles[4] = "signs_lib_blank.png"
ydef.tiles[5] = "signs_lib_blank.png"
ydef.tiles[6] = "signs_lib_blank.png"
*For signs that can't support onpole, include in the def:
allow_onpole = false,
ydef.node_box = raw_def.yard_node_box or raw_def.yard_selection_box or ycbox
* "standard" entity info implies the standard wood/steel sign model, in
wallmounted mode. For facedir signs using the standard model, use:
ydef.groups.not_in_creative_inventory = 1
ydef.mesh = raw_def.yard_mesh or string.gsub(string.gsub(ydef.mesh, "wall.obj$", "yard.obj"), "_facedir", "")
entity_info = {
mesh = "signs_lib_standard_wall_sign_entity.obj",
yaw = signs_lib.standard_yaw
},
if ydef.entity_info then
ydef.entity_info.mesh = string.gsub(string.gsub(ydef.entity_info.mesh, "entity_wall.obj$", "entity_yard.obj"), "_facedir", "")
ydef.entity_info.yaw = signs_lib.standard_yaw
end
]]--
minetest.register_node(":"..no_wall_name.."_yard", ydef)
table.insert(signs_lib.lbm_restore_nodes, no_wall_name.."_yard")
end
function signs_lib.register_sign(name, rdef)
register_sign(name, rdef)
if rdef.allow_widefont then
local wdef = table.copy(minetest.registered_items[name])
wdef.groups.not_in_creative_inventory = 1
wdef.horiz_scaling = wdef.horiz_scaling / 2
register_sign(name.."_widefont", wdef)
if raw_def.allow_widefont then
table.insert(signs_lib.old_widefont_signs, name.."_widefont")
table.insert(signs_lib.old_widefont_signs, name.."_widefont_onpole")
table.insert(signs_lib.old_widefont_signs, name.."_widefont_hanging")
table.insert(signs_lib.old_widefont_signs, name.."_widefont_yard")
end
end
@ -991,8 +1137,21 @@ minetest.register_lbm({
end
})
signs_lib.block_list = {}
signs_lib.totalblocks = 0
-- Convert widefont sign nodes to use one base node with meta flag to select wide mode
minetest.register_lbm({
nodenames = signs_lib.old_widefont_signs,
name = "signs_lib:convert_widefont_signs",
label = "Convert widefont sign nodes",
run_at_every_load = false,
action = function(pos, node)
local basename = string.gsub(node.name, "_widefont", "")
minetest.swap_node(pos, {name = basename, param2 = node.param2})
local meta = minetest.get_meta(pos)
meta:set_int("widefont", 1)
signs_lib.update_sign(pos)
end
})
-- Maintain a list of currently-loaded blocks
minetest.register_lbm({
@ -1053,3 +1212,75 @@ minetest.register_chatcommand("regen_signs", {
minetest.chat_send_player(player_name, "Finished.")
end
})
minetest.register_privilege("signslib_edit", {})
--
-- local functions
--
function get_sign_formspec(pos, nodename)
local meta = minetest.get_meta(pos)
local txt = meta:get_string("text")
local formspec = {
"size[6,4]",
"textarea[0,-0.3;6.5,3;text;;" .. minetest.formspec_escape(txt) .. "]",
"background[-0.5,-0.5;7,5;signs_lib_sign_bg.jpg]",
"button_exit[2,3.4;2,1;ok;" .. S("Write") .. "]"
}
if minetest.registered_nodes[nodename].allow_widefont then
local state = "off"
if meta:get_int("widefont") == 1 then state = "on" end
formspec[5] = "label[0.5,3.4;Use wide font]"
formspec[6] = "image_button[0.6,3.7;1,0.6;signs_lib_switch_" .. state .. ".png;"
.. state .. ";;;false;signs_lib_switch_interm.png]"
end
return table.concat(formspec, "")
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "signs_lib:sign" then return end
local pos_string = player:get_meta():get_string("signslib:pos")
local pos = minetest.string_to_pos(pos_string)
local playername = player:get_player_name()
if fields.text and fields.ok then
minetest.log("action", S("@1 wrote \"@2\" to sign at @3",
(playername or ""),
fields.text:gsub('\\', '\\\\'):gsub("\n", "\\n"),
pos_string
))
signs_lib.update_sign(pos, fields)
elseif fields.on or fields.off then
local node = minetest.get_node(pos)
local meta = minetest.get_meta(pos)
local change
if fields.on and meta:get_int("widefont") == 1 then
meta:set_int("widefont", 0)
change = true
elseif fields.off and meta:get_int("widefont") == 0 then
meta:set_int("widefont", 1)
change = true
end
if change then
minetest.log("action", S("@1 flipped the wide-font switch to \"@2\" at @3",
(playername or ""),
(fields.on and "off" or "on"),
minetest.pos_to_string(pos)
))
signs_lib.update_sign(pos, fields)
minetest.show_formspec(playername, "signs_lib:sign", get_sign_formspec(pos, node.name))
end
end
end)

199
compat.lua Normal file
View File

@ -0,0 +1,199 @@
local default_fences = {
"default:fence_wood",
"default:fence_acacia_wood",
"default:fence_aspen_wood",
"default:fence_junglewood",
"default:fence_pine_wood"
}
for _, n in ipairs(default_fences) do
minetest.override_item(n, {
check_for_pole = true
})
end
if minetest.get_modpath("cottages") then
local cbox = table.copy(minetest.registered_items["cottages:table"].node_box)
minetest.override_item("cottages:table", {
check_for_pole = true,
selection_box = cbox
})
end
if minetest.get_modpath("prefab_redo") then
minetest.override_item("prefab_redo:concrete_railing", {
check_for_pole = true,
selection_box = {
type = "connected",
connect_right = { -0.125, -0.5, -0.125, 0.5, 0.375, 0.125 },
connect_left = { -0.5, -0.5, -0.125, 0.125, 0.375, 0.125 },
connect_back = { -0.125, -0.5, -0.125, 0.125, 0.375, 0.5 },
connect_front = { -0.125, -0.5, -0.5, 0.125, 0.375, 0.125 },
disconnected = { -0.125, -0.5, -0.125, 0.125, 0.25, 0.125 },
fixed = {}
}
})
end
if minetest.get_modpath("streetspoles") then
local htj_north = {
[1] = true,
[3] = true,
[9] = true,
[11] = true,
[21] = true,
[23] = true
}
local htj_east = {
[0] = true,
[2] = true,
[16] = true,
[18] = true,
[20] = true,
[22] = true
}
local htj_south = {
[1] = true,
[3] = true,
[5] = true,
[7] = true,
[21] = true,
[23] = true
}
local htj_west = {
[0] = true,
[2] = true,
[12] = true,
[14] = true,
[20] = true,
[22] = true
}
local vtj_north = {
[8] = true,
[10] = true,
[13] = true,
[15] = true,
[17] = true,
[19] = true
}
local vtj_east = {
[4] = true,
[6] = true,
[8] = true,
[10] = true,
[17] = true,
[19] = true
}
local vtj_south = {
[4] = true,
[6] = true,
[13] = true,
[15] = true,
[17] = true,
[10] = true
}
local vtj_west = {
[4] = true,
[6] = true,
[8] = true,
[10] = true,
[13] = true,
[15] = true
}
minetest.override_item("streets:bigpole", {
check_for_pole = function(pos, node, def, ppos, pnode, pdef)
if pnode.param2 < 4
or (pnode.param2 > 19 and pnode.param2 < 24)
and (pos.x ~= ppos.x or pos.z ~= ppos.z) then
return true
end
end,
check_for_horiz_pole = function(pos, node, def, ppos, pnode, pdef)
if pnode.param2 > 3 and pnode.param2 < 12 then
if def.paramtype2 == "wallmounted" then
if node.param2 == 2 or node.param2 == 3 -- E/W
then return true
end
else
if node.param2 == 1 or node.param2 == 3 -- E/W
then return true
end
end
elseif pnode.param2 > 11 and pnode.param2 < 20 then
if def.paramtype2 == "wallmounted" then
if node.param2 == 4 or node.param2 == 5 then
return true
end
else
if node.param2 == 0 or node.param2 == 2 then
return true
end
end
end
end
})
minetest.override_item("streets:bigpole_tjunction", {
check_for_pole = function(pos, node, def, ppos, pnode, pdef)
if def.paramtype2 == "wallmounted" then
if (node.param2 == 4 and vtj_north[pnode.param2])
or (node.param2 == 2 and vtj_east[pnode.param2])
or (node.param2 == 5 and vtj_south[pnode.param2])
or (node.param2 == 3 and vtj_west[pnode.param2]) then
return true
end
else
if (node.param2 == 0 and vtj_north[pnode.param2])
or (node.param2 == 1 and vtj_east[pnode.param2])
or (node.param2 == 2 and vtj_south[pnode.param2])
or (node.param2 == 3 and vtj_west[pnode.param2]) then
return true
end
end
end,
check_for_horiz_pole = function(pos, node, def, ppos, pnode, pdef)
if def.paramtype2 == "wallmounted" then
if (node.param2 == 4 and htj_north[pnode.param2])
or (node.param2 == 2 and htj_east[pnode.param2])
or (node.param2 == 5 and htj_south[pnode.param2])
or (node.param2 == 3 and htj_west[pnode.param2]) then
return true
end
else
if (node.param2 == 0 and htj_north[pnode.param2])
or (node.param2 == 1 and htj_east[pnode.param2])
or (node.param2 == 2 and htj_south[pnode.param2])
or (node.param2 == 3 and htj_west[pnode.param2]) then
return true
end
end
end
})
end
if minetest.get_modpath("streetlamps") then
minetest.override_item("streets:streetlamp_basic_top_on", {
selection_box = {
type = "fixed",
fixed = {
{-0.3,-0.4,-0.3,0.3,0.5,0.3},
{-0.15,-0.4,-0.15,0.15,-1.55,0.15},
{-0.18,-1.55,-0.18,0.18,-2.5,0.18},
}
},
check_for_pole = true
})
end

View File

@ -1,3 +0,0 @@
default
intllib?
screwdriver?

View File

@ -1 +0,0 @@
Adds signs with readable text.

View File

@ -203,6 +203,32 @@ local utf8_decode = {
[210] = {[144] = "\165", [145] = "\180"}
}
local wide_character_codes = {
}
signs_lib.unicode_install = function(
numbers
)
local scope = utf8_decode
for i = 1,#numbers-2 do
if not scope[numbers[i]] then
scope[numbers[i]] = {}
end
scope = scope[numbers[i]]
end
scope[numbers[#numbers-1]] = "&#x" .. numbers[#numbers] .. ";"
table.insert(
wide_character_codes,
numbers[#numbers]
)
end
signs_lib.unicode_install({38,"26"})
dofile(signs_lib.path.."/nonascii-de.lua")
dofile(signs_lib.path.."/nonascii-fr.lua")
dofile(signs_lib.path.."/nonascii-pl.lua")
local nmdc = {
[36] = "$",
[124] = "|"
@ -230,36 +256,33 @@ function AnsiToUtf8(s)
end
function Utf8ToAnsi(s)
local a, j, r, b = 0, 0, ""
local a, j, r, b, scope = 0, 0, ""
for i = 1, s and s:len() or 0 do
b = s:byte(i)
if b < 128 then
if b == 0x26 then
r = r .. "&#x26;"
elseif b < 128 then
if nmdc[b] then
r = r .. nmdc[b]
else
r = r .. string.char(b)
end
elseif a == 2 then
a, j = a - 1, b
elseif a == 1 then
--if j == nil or b == nil then return r end
--print(j)
--print(b)
--local ansi = utf8_decode[j]
--if ansi == nil then return r end
--if ansi[b] == nil then return r end
if utf8_decode[j] then
if utf8_decode[j][b] then
a, r = a - 1, r .. utf8_decode[j][b]
elseif scope then
if scope[b] then
scope = scope[b]
if "string" == type(scope) then
r, scope = r .. scope
end
else
r, scope = r .. "_"
end
elseif b == 226 then
a = 2
elseif b == 194 or b == 208 or b == 209 or b == 210 then
j, a = b, 1
elseif utf8_decode[b] then
scope = utf8_decode[b]
else
r = r .. "_"
end
end
return r
end
signs_lib.wide_character_codes = wide_character_codes

View File

@ -10,6 +10,7 @@ signs_lib.path = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(signs_lib.path .. "/intllib.lua")
signs_lib.gettext = S
dofile(signs_lib.path.."/api.lua")
dofile(signs_lib.path.."/encoding.lua")
dofile(signs_lib.path.."/api.lua")
dofile(signs_lib.path.."/standard_signs.lua")
dofile(signs_lib.path.."/compat.lua")

View File

@ -1 +1,6 @@
name = signs_lib
author = VanessaE
depends = default
optional_depends = intllib, screwdriver, streetspoles, streetlamps, cottages, prefab_redo
description = Adds signs with readable text.
min_minetest_version = 5.2.0

Binary file not shown.

View File

@ -1,78 +1,62 @@
# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden sign.blend'
# Blender v2.79 (sub 0) OBJ File: 'standard wooden sign.blend'
# www.blender.org
o sign_on_pole.001_Cube.002
o facedir,_on_pole_Cube.005
v 0.437500 -0.312500 0.812500
v 0.437500 -0.312500 0.750000
v 0.437500 0.312500 0.812500
v 0.437500 0.312500 0.750000
v -0.437500 -0.312500 0.812500
v -0.437500 -0.312500 0.750000
v -0.437500 0.312500 0.812500
v -0.437500 0.312500 0.750000
v 0.437500 -0.312500 0.812500
v 0.437500 -0.312500 0.750000
v 0.437500 0.312500 0.812500
v 0.437500 0.312500 0.750000
v -0.437500 -0.312500 0.812500
v -0.437500 -0.312500 0.750000
v -0.437500 0.312500 0.812500
v -0.437500 0.312500 0.750000
v -0.125000 -0.187500 0.812500
v -0.125000 -0.187500 0.875000
v -0.125000 0.187500 0.812500
v -0.125000 0.187500 0.875000
v 0.125000 0.187500 0.812500
v 0.125000 -0.187500 0.812500
v 0.125000 -0.187500 0.875000
v 0.125000 0.187500 0.875000
v -0.125000 -0.187500 1.125000
v -0.125000 -0.187500 0.812500
v -0.125000 -0.125000 1.125000
v -0.125000 -0.125000 0.812500
v -0.164063 -0.187500 1.125000
v -0.164063 -0.187500 0.812500
v -0.164063 -0.125000 1.125000
v -0.164063 -0.125000 0.812500
v -0.125000 0.125000 1.125000
v -0.125000 0.125000 0.812500
v -0.125000 0.187500 1.125000
v -0.125000 0.187500 0.812500
v -0.164063 0.125000 1.125000
v -0.164063 0.125000 0.812500
v -0.164063 0.187500 1.125000
v -0.164063 0.187500 0.812500
v 0.164062 -0.187500 1.125000
v 0.164062 -0.187500 0.812500
v 0.164062 -0.125000 1.125000
v 0.164062 -0.125000 0.812500
v 0.125000 -0.187500 1.125000
v 0.125000 -0.187500 0.812500
v 0.125000 -0.125000 1.125000
v 0.125000 -0.125000 0.812500
v 0.164062 0.125000 1.125000
v 0.164062 0.125000 0.812500
v 0.164062 0.187500 1.125000
v 0.164062 0.187500 0.812500
v 0.125000 0.125000 1.125000
v 0.125000 0.125000 0.812500
v 0.125000 0.187500 1.125000
v 0.125000 0.187500 0.812500
v -0.164063 -0.187500 1.164063
v 0.164062 -0.187500 1.164063
v -0.164063 -0.125000 1.164063
v 0.164062 -0.125000 1.164063
v -0.164063 -0.187500 1.125000
v 0.164062 -0.187500 1.125000
v -0.164063 -0.125000 1.164063
v 0.164062 -0.187500 1.164063
v -0.164063 -0.187500 1.164063
v 0.125000 0.125000 0.812500
v -0.125000 -0.125000 1.125000
v 0.164062 0.187500 0.812500
v 0.164062 0.187500 1.125000
v 0.164062 0.125000 0.812500
v 0.164062 0.125000 1.125000
v 0.125000 -0.125000 0.812500
v 0.125000 -0.125000 1.125000
v 0.164062 -0.125000 0.812500
v 0.164062 -0.187500 0.812500
v -0.164063 0.187500 0.812500
v -0.164063 0.125000 0.812500
v -0.125000 0.125000 0.812500
v -0.125000 0.125000 1.125000
v -0.164063 -0.125000 0.812500
v -0.164063 -0.125000 1.125000
v -0.164063 -0.187500 0.812500
v -0.164063 -0.187500 1.125000
v -0.125000 -0.125000 0.812500
v 0.125000 0.187500 0.875000
v 0.125000 -0.187500 0.875000
v 0.125000 0.187500 0.812500
v -0.125000 0.187500 0.812500
v 0.164062 -0.187500 1.125000
v 0.164062 -0.125000 1.125000
v -0.164063 0.125000 1.164063
v 0.164062 0.125000 1.164063
v -0.164063 0.187500 1.164063
v 0.164062 0.187500 1.164063
v -0.164063 0.125000 1.125000
v 0.164062 0.125000 1.125000
v -0.164063 0.187500 1.125000
v 0.164062 0.187500 1.125000
v 0.125000 -0.187500 1.125000
v 0.125000 0.187500 1.125000
v 0.125000 0.125000 1.125000
v -0.125000 0.187500 1.125000
v -0.125000 -0.187500 1.125000
v 0.125000 -0.125000 0.875000
v 0.125000 0.125000 0.875000
v -0.125000 0.125000 0.875000
v -0.125000 -0.125000 0.875000
vt 0.468750 0.812500
vt 0.031250 0.812500
vt 0.031250 0.187500
@ -99,148 +83,150 @@ vt 0.015625 0.507812
vt 0.015625 0.093750
vt 0.156250 0.093750
vt 0.156250 0.507812
vt 0.156250 0.031250
vt 0.703125 0.031250
vt 0.453125 0.640625
vt 0.453125 0.593750
vt 0.312500 0.593750
vt 0.312500 0.640625
vt 0.234375 0.593750
vt 0.234375 0.640625
vt 0.093750 0.640625
vt 0.093750 0.593750
vt 0.312500 0.640625
vt 0.312500 0.921875
vt 0.453125 0.921875
vt 0.453125 0.640625
vt 0.703125 0.664062
vt 0.703125 0.992188
vt 0.781250 0.992188
vt 0.781250 0.664062
vt 0.484375 0.664062
vt 0.484375 0.992188
vt 0.562500 0.992188
vt 0.562500 0.664062
vt 0.921875 0.992188
vt 0.921875 0.664062
vt 0.453125 0.640625
vt 0.453125 0.593750
vt 0.312500 0.593750
vt 0.312500 0.640625
vt 0.234375 0.593750
vt 0.234375 0.640625
vt 0.093750 0.640625
vt 0.093750 0.593750
vt 0.703125 0.664062
vt 0.703125 0.992188
vt 0.781250 0.992188
vt 0.781250 0.664062
vt 0.484375 0.664062
vt 0.484375 0.992188
vt 0.562500 0.992188
vt 0.562500 0.664062
vt 0.234375 0.640625
vt 0.234375 0.921875
vt 0.093750 0.921875
vt 0.093750 0.640625
vt 0.921875 0.992188
vt 0.921875 0.664062
vt 0.093750 0.640625
vt 0.093750 0.992188
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.234375 0.640625
vt 0.234375 0.921875
vt 0.093750 0.921875
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.093750 0.992188
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.093750 0.992188
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.234375 0.992188
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.093750 0.992188
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.234375 0.992188
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.703125 0.578125
vt 0.156250 0.578125
vt 0.156250 0.031250
vt 0.703125 0.031250
vt 0.312500 0.640625
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.312500 0.921875
vt 0.453125 0.921875
vt 0.453125 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.093750 0.992188
vt 0.093750 0.640625
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.312500 0.640625
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.453125 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.093750 0.992188
vt 0.093750 0.640625
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.312500 0.640625
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.453125 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.093750 0.992188
vt 0.093750 0.640625
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.312500 0.640625
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.453125 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.093750 0.992188
vt 0.093750 0.640625
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.781250 0.664062
vt 0.781250 0.992188
vt 0.921875 0.992188
vt 0.921875 0.664062
vt 0.484375 0.664062
vt 0.484375 0.992188
vt 0.562500 0.992188
vt 0.562500 0.664062
vt 0.703125 0.992188
vt 0.703125 0.664062
vt 0.234375 0.593750
vt 0.234375 0.640625
vt 0.093750 0.640625
vt 0.093750 0.593750
vt 0.453125 0.640625
vt 0.453125 0.593750
vt 0.312500 0.593750
vt 0.312500 0.640625
vt 0.781250 0.664062
vt 0.781250 0.992188
vt 0.921875 0.992188
vt 0.921875 0.664062
vt 0.484375 0.664062
vt 0.484375 0.992188
vt 0.562500 0.992188
vt 0.562500 0.664062
vt 0.703125 0.992188
vt 0.703125 0.664062
vt 0.234375 0.593750
vt 0.234375 0.640625
vt 0.093750 0.640625
vt 0.093750 0.593750
vt 0.453125 0.640625
vt 0.453125 0.593750
vt 0.312500 0.593750
vt 0.312500 0.640625
vt 0.703125 0.703125
vt 0.562500 0.703125
vt 0.562500 0.953125
vt 0.703125 0.953125
vt 0.703125 0.703125
vt 0.562500 0.703125
vt 0.562500 0.953125
vt 0.703125 0.953125
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
g sign_on_pole.001_Cube.002_front-back
g facedir,_on_pole_Cube.005_front-back
s off
f 8/1/1 4/2/1 2/3/1 6/4/1
f 3/5/2 7/6/2 5/7/2 1/8/2
g sign_on_pole.001_Cube.002_edges
f 13/9/3 14/10/3 10/11/3 9/12/3
f 11/13/4 12/14/4 16/15/4 15/16/4
f 11/13/5 9/17/5 10/18/5 12/14/5
f 13/9/6 15/16/6 16/15/6 14/10/6
g sign_on_pole.001_Cube.002_pole_mount
f 17/19/6 18/20/6 20/21/6 19/22/6
f 22/23/5 21/24/5 24/25/5 23/26/5
f 20/21/4 24/25/4 21/27/4 19/28/4
f 17/29/3 22/30/3 23/26/3 18/20/3
f 18/20/2 23/26/2 24/25/2 20/21/2
f 25/31/5 26/32/5 28/33/5 27/34/5
f 27/35/4 28/36/4 32/37/4 31/38/4
f 31/39/6 32/40/6 30/41/6 29/42/6
f 29/42/3 30/41/3 26/43/3 25/44/3
f 33/45/5 34/46/5 36/47/5 35/48/5
f 35/49/4 36/50/4 40/51/4 39/52/4
f 39/53/6 40/54/6 38/55/6 37/56/6
f 37/56/3 38/55/3 34/57/3 33/58/3
f 41/59/5 42/60/5 44/61/5 43/62/5
f 43/63/4 44/64/4 48/65/4 47/66/4
f 47/67/6 48/68/6 46/69/6 45/70/6
f 45/70/3 46/69/3 42/71/3 41/72/3
f 49/73/5 50/74/5 52/75/5 51/76/5
f 51/77/4 52/78/4 56/79/4 55/80/4
f 55/81/6 56/82/6 54/83/6 53/84/6
f 53/84/3 54/83/3 50/85/3 49/86/3
f 57/87/2 58/88/2 60/89/2 59/90/2
f 59/91/4 60/92/4 64/93/4 63/94/4
f 63/94/1 64/93/1 62/95/1 61/96/1
f 61/96/3 62/95/3 58/88/3 57/87/3
f 59/97/6 63/98/6 61/99/6 57/100/6
f 64/101/5 60/102/5 58/103/5 62/104/5
f 65/105/2 66/106/2 68/107/2 67/108/2
f 67/109/4 68/110/4 72/111/4 71/112/4
f 71/112/1 72/111/1 70/113/1 69/114/1
f 69/114/3 70/113/3 66/106/3 65/105/3
f 67/115/6 71/116/6 69/117/6 65/118/6
f 72/119/5 68/120/5 66/121/5 70/122/5
f 8/1/1 3/2/1 2/3/1 5/4/1
f 7/5/2 6/6/2 4/7/2 1/8/2
g facedir,_on_pole_Cube.005_edges
f 4/9/3 5/10/3 2/11/3 1/12/3
f 7/13/4 3/14/4 8/15/4 6/16/4
f 7/13/5 1/17/5 2/18/5 3/14/5
f 4/9/6 6/16/6 8/15/6 5/10/6
g facedir,_on_pole_Cube.005_pole_mount
f 9/19/6 10/20/6 11/21/6 39/22/6
f 12/23/5 38/24/5 36/25/5 37/26/5
f 20/27/5 45/28/5 43/29/5 22/30/5
f 44/31/6 47/32/6 46/33/6 42/34/6
f 52/35/5 10/36/5 56/37/5 18/38/5
f 46/39/3 22/40/3 43/41/3 42/42/3
f 44/43/4 45/44/4 20/45/4 47/46/4
f 42/42/2 43/41/2 45/47/2 44/48/2
f 41/49/5 13/50/5 15/51/5 40/52/5
f 14/53/6 32/54/6 34/55/6 16/56/6
f 34/57/3 40/58/3 15/59/3 16/60/3
f 14/61/4 13/62/4 41/63/4 32/64/4
f 24/65/6 53/66/6 37/67/6 48/68/6
f 16/60/2 15/59/2 13/69/2 14/70/2
f 50/71/3 17/72/3 21/73/3 22/74/3
f 20/75/4 19/76/4 38/77/4 49/78/4
f 49/79/6 36/80/6 54/81/6 50/71/6
f 22/30/5 21/82/5 19/83/5 20/27/5
f 48/68/3 12/84/3 26/85/3 40/86/3
f 41/87/4 25/88/4 23/89/4 24/90/4
f 40/52/5 26/91/5 25/92/5 41/49/5
f 46/33/3 28/93/3 29/94/3 30/95/3
f 47/32/6 27/96/6 28/93/6 46/33/6
f 51/97/4 39/98/4 27/99/4 47/100/4
f 34/55/3 33/101/3 9/102/3 52/103/3
f 32/54/6 31/104/6 33/101/6 34/55/6
f 18/105/4 35/106/4 31/107/4 32/108/4
f 10/20/2 37/26/2 36/25/2 11/21/2
f 9/109/3 12/110/3 37/26/3 10/20/3
f 11/21/4 36/25/4 38/111/4 39/112/4
f 30/113/5 55/114/5 11/115/5 51/116/5
f 52/117/1 18/118/1 24/119/1 48/120/1
f 30/121/1 51/122/1 49/123/1 50/124/1

View File

@ -0,0 +1,15 @@
# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden yard sign.blend'
# www.blender.org
o Plane
v 0.406250 -0.218750 -0.074219
v -0.406250 -0.218750 -0.074219
v 0.406250 0.343750 -0.074219
v -0.406250 0.343750 -0.074219
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vn 0.0000 -0.0000 -1.0000
g Plane_Plane_None
s off
f 1/1/1 2/2/1 4/3/1 3/4/1

View File

@ -1,22 +1,62 @@
# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden wall sign.blend'
# Blender v2.79 (sub 0) OBJ File: 'standard wooden sign.blend'
# www.blender.org
o Cube.003_Cube
o wallmounted,_on_pole_Cube.002
v 0.437500 -0.812500 -0.312500
v 0.437500 -0.750000 -0.312500
v 0.437500 -0.812500 0.312500
v 0.437500 -0.750000 0.312500
v -0.437500 -0.812500 -0.312500
v -0.437500 -0.750000 -0.312500
v -0.437500 -0.812500 0.312500
v -0.437500 -0.750000 0.312500
v 0.437500 -0.812500 -0.312500
v 0.437500 -0.750000 -0.312500
v 0.437500 -0.812500 0.312500
v 0.437500 -0.750000 0.312500
v -0.437500 -0.812500 -0.312500
v -0.437500 -0.750000 -0.312500
v -0.437500 -0.812500 0.312500
v -0.437500 -0.750000 0.312500
v -0.125000 -0.812500 -0.187500
v -0.125000 -0.875000 -0.187500
v -0.125000 -0.875000 0.187500
v 0.125000 -0.812500 -0.187500
v 0.164062 -1.164063 -0.125000
v -0.164063 -1.164063 -0.125000
v 0.164062 -1.164063 -0.187500
v -0.164063 -1.164063 -0.187500
v 0.125000 -0.812500 0.125000
v -0.125000 -1.125000 -0.125000
v 0.164062 -0.812500 0.187500
v 0.164062 -1.125000 0.187500
v 0.164062 -0.812500 0.125000
v 0.164062 -1.125000 0.125000
v 0.125000 -0.812500 -0.125000
v 0.125000 -1.125000 -0.125000
v 0.164062 -0.812500 -0.125000
v 0.164062 -0.812500 -0.187500
v -0.164063 -0.812500 0.187500
v -0.164063 -0.812500 0.125000
v -0.125000 -0.812500 0.125000
v -0.125000 -1.125000 0.125000
v -0.164063 -0.812500 -0.125000
v -0.164063 -1.125000 -0.125000
v -0.164063 -0.812500 -0.187500
v -0.164063 -1.125000 -0.187500
v -0.125000 -0.812500 -0.125000
v 0.125000 -0.875000 0.187500
v 0.125000 -0.875000 -0.187500
v 0.125000 -0.812500 0.187500
v -0.125000 -0.812500 0.187500
v 0.164062 -1.125000 -0.187500
v 0.164062 -1.125000 -0.125000
v -0.164063 -1.164063 0.125000
v 0.164062 -1.164063 0.125000
v -0.164063 -1.164063 0.187500
v 0.164062 -1.164063 0.187500
v -0.164063 -1.125000 0.125000
v -0.164063 -1.125000 0.187500
v 0.125000 -1.125000 -0.187500
v 0.125000 -1.125000 0.187500
v 0.125000 -1.125000 0.125000
v -0.125000 -1.125000 0.187500
v -0.125000 -1.125000 -0.187500
v 0.125000 -0.875000 -0.125000
v 0.125000 -0.875000 0.125000
v -0.125000 -0.875000 0.125000
v -0.125000 -0.875000 -0.125000
vt 0.468750 0.812500
vt 0.031250 0.812500
vt 0.031250 0.187500
@ -35,78 +75,6 @@ vt 0.390625 1.000000
vt 0.390625 -0.000000
vt 0.765625 0.000000
vt 0.765625 1.000000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
g Cube.003_Cube_front-back
s off
f 8/1/1 4/2/1 2/3/1 6/4/1
f 3/5/2 7/6/2 5/7/2 1/8/2
g Cube.003_Cube_edges
f 13/9/3 14/10/3 10/11/3 9/12/3
f 11/13/4 12/14/4 16/15/4 15/16/4
f 11/13/5 9/17/5 10/18/5 12/14/5
f 13/9/6 15/16/6 16/15/6 14/10/6
o Cube.001
v -0.125000 -0.812500 -0.187500
v -0.125000 -0.875000 -0.187500
v -0.125000 -0.812500 0.187500
v -0.125000 -0.875000 0.187500
v 0.125000 -0.812500 0.187500
v 0.125000 -0.812500 -0.187500
v 0.125000 -0.875000 -0.187500
v 0.125000 -0.875000 0.187500
v -0.125000 -1.125000 -0.187500
v -0.125000 -0.812500 -0.187500
v -0.125000 -1.125000 -0.125000
v -0.125000 -0.812500 -0.125000
v -0.164063 -1.125000 -0.187500
v -0.164063 -0.812500 -0.187500
v -0.164063 -1.125000 -0.125000
v -0.164063 -0.812500 -0.125000
v -0.125000 -1.125000 0.125000
v -0.125000 -0.812500 0.125000
v -0.125000 -1.125000 0.187500
v -0.125000 -0.812500 0.187500
v -0.164063 -1.125000 0.125000
v -0.164063 -0.812500 0.125000
v -0.164063 -1.125000 0.187500
v -0.164063 -0.812500 0.187500
v 0.164062 -1.125000 -0.187500
v 0.164062 -0.812500 -0.187500
v 0.164062 -1.125000 -0.125000
v 0.164062 -0.812500 -0.125000
v 0.125000 -1.125000 -0.187500
v 0.125000 -0.812500 -0.187500
v 0.125000 -1.125000 -0.125000
v 0.125000 -0.812500 -0.125000
v 0.164062 -1.125000 0.125000
v 0.164062 -0.812500 0.125000
v 0.164062 -1.125000 0.187500
v 0.164062 -0.812500 0.187500
v 0.125000 -1.125000 0.125000
v 0.125000 -0.812500 0.125000
v 0.125000 -1.125000 0.187500
v 0.125000 -0.812500 0.187500
v -0.164063 -1.164063 -0.187500
v 0.164062 -1.164063 -0.187500
v -0.164063 -1.164063 -0.125000
v 0.164062 -1.164063 -0.125000
v -0.164063 -1.125000 -0.187500
v 0.164062 -1.125000 -0.187500
v -0.164063 -1.125000 -0.125000
v 0.164062 -1.125000 -0.125000
v -0.164063 -1.164063 0.125000
v 0.164062 -1.164063 0.125000
v -0.164063 -1.164063 0.187500
v 0.164062 -1.164063 0.187500
v -0.164063 -1.125000 0.125000
v 0.164062 -1.125000 0.125000
v -0.164063 -1.125000 0.187500
v 0.164062 -1.125000 0.187500
vt 0.843750 0.507812
vt 0.703125 0.507812
vt 0.703125 0.093750
@ -115,140 +83,150 @@ vt 0.015625 0.507812
vt 0.015625 0.093750
vt 0.156250 0.093750
vt 0.156250 0.507812
vt 0.156250 0.031250
vt 0.703125 0.031250
vt 0.453125 0.640625
vt 0.453125 0.593750
vt 0.312500 0.593750
vt 0.312500 0.640625
vt 0.234375 0.593750
vt 0.234375 0.640625
vt 0.093750 0.640625
vt 0.093750 0.593750
vt 0.312500 0.640625
vt 0.312500 0.921875
vt 0.453125 0.921875
vt 0.453125 0.640625
vt 0.703125 0.664062
vt 0.703125 0.992188
vt 0.781250 0.992188
vt 0.781250 0.664062
vt 0.484375 0.664062
vt 0.484375 0.992188
vt 0.562500 0.992188
vt 0.562500 0.664062
vt 0.921875 0.992188
vt 0.921875 0.664062
vt 0.453125 0.640625
vt 0.453125 0.593750
vt 0.312500 0.593750
vt 0.312500 0.640625
vt 0.234375 0.593750
vt 0.234375 0.640625
vt 0.093750 0.640625
vt 0.093750 0.593750
vt 0.703125 0.664062
vt 0.703125 0.992188
vt 0.781250 0.992188
vt 0.781250 0.664062
vt 0.484375 0.664062
vt 0.484375 0.992188
vt 0.562500 0.992188
vt 0.562500 0.664062
vt 0.234375 0.640625
vt 0.234375 0.921875
vt 0.093750 0.921875
vt 0.093750 0.640625
vt 0.921875 0.992188
vt 0.921875 0.664062
vt 0.093750 0.640625
vt 0.093750 0.992188
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.234375 0.640625
vt 0.234375 0.921875
vt 0.093750 0.921875
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.093750 0.992188
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.093750 0.992188
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.234375 0.992188
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.093750 0.992188
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.234375 0.992188
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.703125 0.578125
vt 0.156250 0.578125
vt 0.156250 0.031250
vt 0.703125 0.031250
vt 0.312500 0.640625
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.312500 0.921875
vt 0.453125 0.921875
vt 0.453125 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.093750 0.992188
vt 0.093750 0.640625
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.312500 0.640625
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.453125 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.093750 0.992188
vt 0.093750 0.640625
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.312500 0.640625
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.453125 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.093750 0.992188
vt 0.093750 0.640625
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.312500 0.640625
vt 0.312500 0.992188
vt 0.453125 0.992188
vt 0.453125 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.312500 0.992188
vt 0.312500 0.640625
vt 0.234375 0.640625
vt 0.234375 0.992188
vt 0.093750 0.992188
vt 0.093750 0.640625
vt 0.015625 0.992188
vt 0.015625 0.640625
vt 0.781250 0.664062
vt 0.781250 0.992188
vt 0.921875 0.992188
vt 0.921875 0.664062
vt 0.484375 0.664062
vt 0.484375 0.992188
vt 0.562500 0.992188
vt 0.562500 0.664062
vt 0.703125 0.992188
vt 0.703125 0.664062
vt 0.234375 0.593750
vt 0.234375 0.640625
vt 0.093750 0.640625
vt 0.093750 0.593750
vt 0.453125 0.640625
vt 0.453125 0.593750
vt 0.312500 0.593750
vt 0.312500 0.640625
vt 0.781250 0.664062
vt 0.781250 0.992188
vt 0.921875 0.992188
vt 0.921875 0.664062
vt 0.484375 0.664062
vt 0.484375 0.992188
vt 0.562500 0.992188
vt 0.562500 0.664062
vt 0.703125 0.992188
vt 0.703125 0.664062
vt 0.234375 0.593750
vt 0.234375 0.640625
vt 0.093750 0.640625
vt 0.093750 0.593750
vt 0.453125 0.640625
vt 0.453125 0.593750
vt 0.312500 0.593750
vt 0.312500 0.640625
vn -1.0000 0.0000 0.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 -0.0000 1.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 -1.0000 -0.0000
vt 0.703125 0.703125
vt 0.562500 0.703125
vt 0.562500 0.953125
vt 0.703125 0.953125
vt 0.703125 0.703125
vt 0.562500 0.703125
vt 0.562500 0.953125
vt 0.703125 0.953125
vn 0.0000 1.0000 0.0000
g Cube.001_Cube.001_pole_mount
vn 0.0000 -1.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
g wallmounted,_on_pole_Cube.002_front-back
s off
f 17/19/7 18/20/7 20/21/7 19/22/7
f 22/23/8 21/24/8 24/25/8 23/26/8
f 20/21/9 24/25/9 21/27/9 19/28/9
f 17/29/10 22/30/10 23/26/10 18/20/10
f 18/20/11 23/26/11 24/25/11 20/21/11
f 25/31/8 26/32/8 28/33/8 27/34/8
f 27/35/9 28/36/9 32/37/9 31/38/9
f 31/39/7 32/40/7 30/41/7 29/42/7
f 29/42/10 30/41/10 26/43/10 25/44/10
f 33/45/8 34/46/8 36/47/8 35/48/8
f 35/49/9 36/50/9 40/51/9 39/52/9
f 39/53/7 40/54/7 38/55/7 37/56/7
f 37/56/10 38/55/10 34/57/10 33/58/10
f 41/59/8 42/60/8 44/61/8 43/62/8
f 43/63/9 44/64/9 48/65/9 47/66/9
f 47/67/7 48/68/7 46/69/7 45/70/7
f 45/70/10 46/69/10 42/71/10 41/72/10
f 49/73/8 50/74/8 52/75/8 51/76/8
f 51/77/9 52/78/9 56/79/9 55/80/9
f 55/81/7 56/82/7 54/83/7 53/84/7
f 53/84/10 54/83/10 50/85/10 49/86/10
f 57/87/11 58/88/11 60/89/11 59/90/11
f 59/91/9 60/92/9 64/93/9 63/94/9
f 63/94/12 64/93/12 62/95/12 61/96/12
f 61/96/10 62/95/10 58/88/10 57/87/10
f 59/97/7 63/98/7 61/99/7 57/100/7
f 64/101/8 60/102/8 58/103/8 62/104/8
f 65/105/11 66/106/11 68/107/11 67/108/11
f 67/109/9 68/110/9 72/111/9 71/112/9
f 71/112/12 72/111/12 70/113/12 69/114/12
f 69/114/10 70/113/10 66/106/10 65/105/10
f 67/115/7 71/116/7 69/117/7 65/118/7
f 72/119/8 68/120/8 66/121/8 70/122/8
f 8/1/1 3/2/1 2/3/1 5/4/1
f 7/5/2 6/6/2 4/7/2 1/8/2
g wallmounted,_on_pole_Cube.002_edges
f 4/9/3 5/10/3 2/11/3 1/12/3
f 7/13/4 3/14/4 8/15/4 6/16/4
f 7/13/5 1/17/5 2/18/5 3/14/5
f 4/9/6 6/16/6 8/15/6 5/10/6
g wallmounted,_on_pole_Cube.002_pole_mount
f 9/19/6 10/20/6 11/21/6 39/22/6
f 12/23/5 38/24/5 36/25/5 37/26/5
f 20/27/5 45/28/5 43/29/5 22/30/5
f 44/31/6 47/32/6 46/33/6 42/34/6
f 52/35/5 10/36/5 56/37/5 18/38/5
f 46/39/3 22/40/3 43/41/3 42/42/3
f 44/43/4 45/44/4 20/45/4 47/46/4
f 42/42/2 43/41/2 45/47/2 44/48/2
f 41/49/5 13/50/5 15/51/5 40/52/5
f 14/53/6 32/54/6 34/55/6 16/56/6
f 34/57/3 40/58/3 15/59/3 16/60/3
f 14/61/4 13/62/4 41/63/4 32/64/4
f 24/65/6 53/66/6 37/67/6 48/68/6
f 16/60/2 15/59/2 13/69/2 14/70/2
f 50/71/3 17/72/3 21/73/3 22/74/3
f 20/75/4 19/76/4 38/77/4 49/78/4
f 49/79/6 36/80/6 54/81/6 50/71/6
f 22/30/5 21/82/5 19/83/5 20/27/5
f 48/68/3 12/84/3 26/85/3 40/86/3
f 41/87/4 25/88/4 23/89/4 24/90/4
f 40/52/5 26/91/5 25/92/5 41/49/5
f 46/33/3 28/93/3 29/94/3 30/95/3
f 47/32/6 27/96/6 28/93/6 46/33/6
f 51/97/4 39/98/4 27/99/4 47/100/4
f 34/55/3 33/101/3 9/102/3 52/103/3
f 32/54/6 31/104/6 33/101/6 34/55/6
f 18/105/4 35/106/4 31/107/4 32/108/4
f 10/20/2 37/26/2 36/25/2 11/21/2
f 9/109/3 12/110/3 37/26/3 10/20/3
f 11/21/4 36/25/4 38/111/4 39/112/4
f 30/113/5 55/114/5 11/115/5 51/116/5
f 52/117/1 18/118/1 24/119/1 48/120/1
f 30/121/1 51/122/1 49/123/1 50/124/1

View File

@ -0,0 +1,85 @@
# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden yard sign.blend'
# www.blender.org
o Cube
v 0.437500 -0.250000 -0.000000
v 0.437500 -0.250000 -0.062500
v 0.437500 0.375000 0.000000
v 0.437500 0.375000 -0.062500
v -0.437500 -0.250000 -0.000000
v -0.437500 -0.250000 -0.062500
v -0.437500 0.375000 0.000000
v -0.437500 0.375000 -0.062500
v 0.437500 -0.250000 -0.000000
v 0.437500 -0.250000 -0.062500
v 0.437500 0.375000 0.000000
v 0.437500 0.375000 -0.062500
v -0.437500 -0.250000 -0.000000
v -0.437500 -0.250000 -0.062500
v -0.437500 0.375000 0.000000
v -0.437500 0.375000 -0.062500
v 0.062500 -0.500000 0.000000
v 0.062500 0.250000 0.000000
v 0.062500 -0.500000 0.062500
v 0.062500 0.250000 0.062500
v -0.062500 -0.500000 0.000000
v -0.062500 0.250000 0.000000
v -0.062500 -0.500000 0.062500
v -0.062500 0.250000 0.062500
vt 0.468750 0.812500
vt 0.031250 0.812500
vt 0.031250 0.187500
vt 0.468750 0.187500
vt 0.531250 0.812500
vt 0.968750 0.812500
vt 0.968750 0.187500
vt 0.531250 0.187500
vt 0.234375 0.000000
vt 0.234375 1.000000
vt 0.015625 1.000000
vt 0.015625 -0.000000
vt 0.609375 -0.000000
vt 0.609375 1.000000
vt 0.390625 1.000000
vt 0.390625 -0.000000
vt 0.765625 0.000000
vt 0.765625 1.000000
vt 0.000000 0.750000
vt 2.000000 0.750000
vt 2.000000 0.875000
vt 0.000000 0.875000
vt 0.000000 0.125000
vt 2.000000 0.125000
vt 2.000000 0.375000
vt 0.000000 0.375000
vt 2.000000 0.500000
vt 0.000000 0.500000
vt 0.812500 0.875000
vt 0.562500 0.875000
vt 0.562500 1.000000
vt 0.812500 1.000000
vt 0.125000 0.875000
vt 0.375000 0.875000
vt 0.375000 1.000000
vt 0.125000 1.000000
vn 0.0000 0.0000 -1.0000
vn 0.0000 -0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
g Cube_Cube_front-back
s off
f 8/1/1 4/2/1 2/3/1 6/4/1
f 3/5/2 7/6/2 5/7/2 1/8/2
g Cube_Cube_edges
f 13/9/3 14/10/3 10/11/3 9/12/3
f 11/13/4 12/14/4 16/15/4 15/16/4
f 11/13/5 9/17/5 10/18/5 12/14/5
f 13/9/6 15/16/6 16/15/6 14/10/6
g Cube_Cube_default_wood
f 17/19/5 18/20/5 20/21/5 19/22/5
f 19/23/2 20/24/2 24/25/2 23/26/2
f 23/26/6 24/25/6 22/27/6 21/28/6
f 21/28/1 22/27/1 18/20/1 17/19/1
f 19/29/3 23/30/3 21/31/3 17/32/3
f 24/33/4 20/34/4 18/35/4 22/36/4

View File

@ -0,0 +1,110 @@
# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden yard sign two sticks.blend'
# www.blender.org
o Cube
v 0.437500 -0.250000 -0.000000
v 0.437500 -0.250000 -0.062500
v 0.437500 0.375000 0.000000
v -0.437500 0.375000 0.000000
v -0.437500 0.375000 -0.062500
v 0.437500 0.375000 -0.062500
v -0.437500 -0.250000 -0.000000
v -0.437500 -0.250000 -0.062500
v 0.421875 -0.500000 0.000000
v 0.421875 0.250000 0.000000
v 0.421875 -0.500000 0.031250
v 0.390625 -0.500000 0.000000
v 0.390625 0.250000 0.000000
v 0.390625 -0.500000 0.031250
v -0.390625 -0.500000 0.000000
v -0.390625 -0.500000 0.031250
v -0.421875 -0.500000 0.000000
v -0.421875 0.250000 0.000000
v -0.421875 -0.500000 0.031250
v 0.421875 0.218750 0.031250
v 0.390625 0.218750 0.031250
v -0.390625 0.250000 0.000000
v -0.390625 0.218750 0.031250
v -0.421875 0.218750 0.031250
vt 0.468750 0.812500
vt 0.031250 0.812500
vt 0.031250 0.187500
vt 0.468750 0.187500
vt 0.531250 0.812500
vt 0.968750 0.812500
vt 0.968750 0.187500
vt 0.531250 0.187500
vt 0.234375 0.000000
vt 0.234375 1.000000
vt 0.015625 1.000000
vt 0.015625 -0.000000
vt 0.609375 -0.000000
vt 0.609375 1.000000
vt 0.390625 1.000000
vt 0.390625 -0.000000
vt 0.765625 0.000000
vt 0.765625 1.000000
vt 0.000000 0.375000
vt 1.437500 0.375000
vt 1.437500 0.437500
vt 0.000000 0.437500
vt 1.500000 0.500000
vt 0.000000 0.500000
vt 1.500000 0.562500
vt 0.000000 0.562500
vt 0.750000 0.875000
vt 0.625000 0.875000
vt 0.625000 1.000000
vt 0.750000 1.000000
vt 1.437500 0.625000
vt 0.000000 0.625000
vt 0.000000 0.375000
vt 1.437500 0.375000
vt 1.437500 0.437500
vt 0.000000 0.437500
vt 1.500000 0.500000
vt 0.000000 0.500000
vt 1.500000 0.562500
vt 0.000000 0.562500
vt 0.750000 0.875000
vt 0.625000 0.875000
vt 0.625000 1.000000
vt 0.750000 1.000000
vt 1.437500 0.625000
vt 0.000000 0.625000
vt 0.312500 1.000000
vt 0.187500 1.000000
vt 0.187500 0.875000
vt 0.312500 0.875000
vt 0.312500 1.000000
vt 0.187500 1.000000
vt 0.187500 0.875000
vt 0.312500 0.875000
vn 0.0000 0.0000 -1.0000
vn 0.0000 -0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn 1.0000 -0.0000 0.0000
vn -1.0000 -0.0000 0.0000
vn 0.0000 0.7071 0.7071
g Cube_Cube_front-back
s off
f 5/1/1 6/2/1 2/3/1 8/4/1
f 3/5/2 4/6/2 7/7/2 1/8/2
g Cube_Cube_edges
f 7/9/3 8/10/3 2/11/3 1/12/3
f 3/13/4 6/14/4 5/15/4 4/16/4
f 3/13/5 1/17/5 2/18/5 6/14/5
f 7/9/6 4/16/6 5/15/6 8/10/6
g Cube_Cube_sticks
f 11/19/2 20/20/2 21/21/2 14/22/2
f 14/22/6 21/21/6 13/23/6 12/24/6
f 12/24/1 13/23/1 10/25/1 9/26/1
f 11/27/3 14/28/3 12/29/3 9/30/3
f 9/26/5 10/25/5 20/31/5 11/32/5
f 16/33/2 23/34/2 24/35/2 19/36/2
f 19/36/6 24/35/6 18/37/6 17/38/6
f 17/38/1 18/37/1 22/39/1 15/40/1
f 16/41/3 19/42/3 17/43/3 15/44/3
f 15/40/5 22/39/5 23/45/5 16/46/5
f 10/47/7 13/48/7 21/49/7 20/50/7
f 22/51/7 18/52/7 24/53/7 23/54/7

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

7
nonascii-de.lua Normal file
View File

@ -0,0 +1,7 @@
signs_lib.unicode_install({195,132,"00c4"})
signs_lib.unicode_install({195,150,"00d6"})
signs_lib.unicode_install({195,156,"00dc"})
signs_lib.unicode_install({195,159,"00df"})
signs_lib.unicode_install({195,164,"00e4"})
signs_lib.unicode_install({195,182,"00f6"})
signs_lib.unicode_install({195,188,"00fc"})

16
nonascii-fr.lua Normal file
View File

@ -0,0 +1,16 @@
signs_lib.unicode_install({195,128,"00c0"})
signs_lib.unicode_install({195,134,"00c6"})
signs_lib.unicode_install({195,135,"00c7"})
signs_lib.unicode_install({195,136,"00c8"})
signs_lib.unicode_install({195,137,"00c9"})
signs_lib.unicode_install({195,138,"00ca"})
signs_lib.unicode_install({195,148,"00d4"})
signs_lib.unicode_install({195,153,"00d9"})
signs_lib.unicode_install({195,160,"00e0"})
signs_lib.unicode_install({195,166,"00e6"})
signs_lib.unicode_install({195,167,"00e7"})
signs_lib.unicode_install({195,168,"00e8"})
signs_lib.unicode_install({195,169,"00e9"})
signs_lib.unicode_install({195,170,"00ea"})
signs_lib.unicode_install({195,180,"00f4"})
signs_lib.unicode_install({195,185,"00f9"})

16
nonascii-pl.lua Normal file
View File

@ -0,0 +1,16 @@
signs_lib.unicode_install({195,147,"00d3"})
signs_lib.unicode_install({195,179,"00f3"})
signs_lib.unicode_install({196,132,"0104"})
signs_lib.unicode_install({196,133,"0105"})
signs_lib.unicode_install({196,134,"0106"})
signs_lib.unicode_install({196,135,"0107"})
signs_lib.unicode_install({196,152,"0118"})
signs_lib.unicode_install({196,153,"0119"})
signs_lib.unicode_install({197,129,"0141"})
signs_lib.unicode_install({197,130,"0142"})
signs_lib.unicode_install({197,154,"015a"})
signs_lib.unicode_install({197,155,"015b"})
signs_lib.unicode_install({197,185,"0179"})
signs_lib.unicode_install({197,186,"017a"})
signs_lib.unicode_install({197,187,"017b"})
signs_lib.unicode_install({197,188,"017c"})

View File

@ -6,10 +6,16 @@ signs_lib.register_sign("default:sign_wall_wood", {
tiles = {
"signs_lib_sign_wall_wooden.png",
"signs_lib_sign_wall_wooden_edges.png",
-- items 3 - 5 are not set, so signs_lib will use its standard pole
-- mount, hanging, and yard sign stick textures.
},
entity_info = "standard",
allow_hanging = true,
allow_widefont = true
allow_widefont = true,
allow_onpole = true,
allow_onpole_horizontal = true,
allow_yard = true,
use_texture_alpha = "clip",
})
signs_lib.register_sign("default:sign_wall_steel", {
@ -18,20 +24,44 @@ signs_lib.register_sign("default:sign_wall_steel", {
tiles = {
"signs_lib_sign_wall_steel.png",
"signs_lib_sign_wall_steel_edges.png",
nil, -- not set, so it'll use the standard pole mount texture
nil, -- not set, so it'll use the standard hanging chains texture
"default_steel_block.png" -- for the yard sign's stick
},
groups = signs_lib.standard_steel_groups,
sounds = signs_lib.standard_steel_sign_sounds,
locked = true,
entity_info = "standard",
allow_hanging = true,
allow_widefont = true
allow_widefont = true,
allow_onpole = true,
allow_onpole_horizontal = true,
allow_yard = true,
use_texture_alpha = "clip",
})
minetest.register_alias("signs:sign_hanging", "default:sign_wall_wood_hanging")
minetest.register_alias("basic_signs:hanging_sign", "default:sign_wall_wood_hanging")
minetest.register_alias("signs:sign_hanging", "default:sign_wood_hanging")
minetest.register_alias("basic_signs:hanging_sign", "default:sign_wood_hanging")
minetest.register_alias("signs:sign_yard", "default:sign_wood_yard")
minetest.register_alias("basic_signs:yard_sign", "default:sign_wood_yard")
minetest.register_alias("default:sign_wall_wood_onpole", "default:sign_wood_onpole")
minetest.register_alias("default:sign_wall_wood_onpole_horiz", "default:sign_wood_onpole_horiz")
minetest.register_alias("default:sign_wall_wood_hanging", "default:sign_wood_hanging")
minetest.register_alias("default:sign_wall_wood_yard", "default:sign_wood_yard")
minetest.register_alias("default:sign_wall_steel_onpole", "default:sign_steel_onpole")
minetest.register_alias("default:sign_wall_steel_onpole_horiz", "default:sign_steel_onpole_horiz")
minetest.register_alias("default:sign_wall_steel_hanging", "default:sign_steel_hanging")
minetest.register_alias("default:sign_wall_steel_yard", "default:sign_steel_yard")
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_hanging")
table.insert(signs_lib.lbm_restore_nodes, "basic_signs:hanging_sign")
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_yard")
table.insert(signs_lib.lbm_restore_nodes, "basic_signs:yard_sign")
table.insert(signs_lib.lbm_restore_nodes, "default:sign_wood_yard")
table.insert(signs_lib.lbm_restore_nodes, "default:sign_wall_wood_yard")
-- insert the old wood sign-on-fencepost into signs_lib's conversion LBM

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 B

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 B

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 B

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 B

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 B

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 B

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 B

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 B

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 B

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 B

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 B

After

Width:  |  Height:  |  Size: 305 B

Some files were not shown because too many files have changed in this diff Show More