1
0
mirror of https://github.com/mt-mods/signs_lib.git synced 2024-11-05 09:30:19 +01:00
Commit Graph

99 Commits

Author SHA1 Message Date
Vanessa Dannenberg
ae6e707ebe forgot to include onpole_widefont signs in conversion list 2019-09-22 04:28:01 -04:00
Vanessa Dannenberg
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
Vanessa Dannenberg
e4336e320c fix empty lines being skipped 2019-09-21 22:04:39 -04:00
Vanessa Dannenberg
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
Vanessa Dannenberg
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
Vanessa Dannenberg
dfece5275e rework horizontal pole detection slightly 2019-09-21 19:24:48 -04:00
Vanessa Dannenberg
6285d250d7 default "allow_onpole" to disabled
for consistency with other similar flags
2019-09-21 15:56:45 -04:00
Vanessa Dannenberg
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
Vanessa Dannenberg
c66c1b70bd disable backface culling on the sign entity
(allows for transparent signs i.e. glass)
2019-09-19 01:02:44 -04:00
Vanessa Dannenberg
831055095c remove debug prints 2019-09-18 20:28:42 -04:00
Vanessa Dannenberg
f0bc18154e fix corner case
Placing a "wallmounted" sign onto a streets lamp would cause a
weird rotation if you're pointing downward too far.  Now it
enforces NESW direction according to your yaw.

Also fixes bad orientation when you're really close to a post.
2019-09-18 20:25:41 -04:00
Vanessa Dannenberg
4eeaf90ae3 allow placement of "facedir" signs flat on floor
(and on ceiling, if hanging isn't available)
mimics the way wallmounted signs behave
2019-09-18 20:12:31 -04:00
Vanessa Dannenberg
906ddbbcc5 rotation fixups
* combine rotation functions -- one no longer needs to choose
  a particular rotation function for the node's paramtype2,
  it'll figure it out automatically.
* fix glitch in wallmounted rotation
* re-order rotation facing order to N, E, S, W, floor, ceiling.
* limit yard sign to simple NESW-only rotation
* allow rotation of hanging signs (NESW only)
* allow rotation of signs on poles/posts if there's nothing in
  the way of where the sign has to move to (NESW only).
2019-09-18 20:07:20 -04:00
Vanessa Dannenberg
01e2adaa46 allow visible text on
floor and when flat on a ceiling
2019-09-18 17:23:07 -04:00
Vanessa Dannenberg
03bd471230 fix a couple of global warnings 2019-09-18 16:33:56 -04:00
Vanessa Dannenberg
e5d525c272 in fact, just bail out if the sign needs no entity 2019-09-18 14:21:56 -04:00
Vanessa Dannenberg
a907f9535c bail out of make_sign_texture is the node is unknown 2019-09-18 14:08:17 -04:00
Vanessa Dannenberg
bbd580acb1 remove debug prints 2019-09-18 13:57:57 -04:00
Vanessa Dannenberg
2d29a539f8 fix minor global warning 2019-09-18 13:55:19 -04:00
Vanessa Dannenberg
4b2abfadce centralize entity handling
minor re-factor as needed for that
don't store entities statically, let the LBM generate them.

this works around Minetest's reload-positioning inaccuracy at very large
positive or negative X/Z coords (tested -18000/+18000 at all four corners,
both new signs and after reboot)
2019-09-18 13:51:53 -04:00
Vanessa Dannenberg
ee2dc495c3 treat streets:streetlamp_basic_top_* as a type of post
as far as sign placement is concerned.
2019-09-16 22:46:26 -04:00
Vanessa Dannenberg
f944337b1c fix non-writable signs not fitting onto a pole/fence 2019-09-15 18:37:03 -04:00
Vanessa Dannenberg
a5e711d354 Use sign formspec to switch between wide/narrow font
if available on a given sign.  The sign must have a
"foo:bar_widefont" variant, with the horizontal scaling set
appropriately (about half of the normal value for the
narrow-font sign)

Add new corresponding API to anto-generate those signs where
desired; use this feature in default wood and steel signs
2019-09-15 16:10:11 -04:00
Vanessa Dannenberg
bcb6a3aa39 add "wide font" overlay image 2019-09-15 03:18:52 -04:00
Vanessa Dannenberg
b021b9666f Allow mod to specify custom selbox for on-pole variants 2019-09-15 02:00:05 -04:00
Vanessa Dannenberg
c765d3b316 allow locked and all steel signs to hang from ceiling 2019-09-15 01:47:43 -04:00
Vanessa Dannenberg
78418de9c9 create a generic hanging sign feature and
move basic_signs' hanging wooden sign back to here, use it.
2019-09-15 01:23:40 -04:00
Vanessa Dannenberg
f6673dc0f1 added a proper register-sign API call
(see api.lua and standard_signs.lua for examples)

make selectionbox call now ignores the old onpole flag (it's automatic now)
removed debug print()'s
moved the signs-on-fences lbm settings to here, from basic_signs.
some misc cleanups

added reference models for standard wooden sign ("wallmounted" on wall,
"facedir" on wall, and pole-mount variants, using standard-size pole
mount), and a separate .blend with street_signs' OM3 sign on slim pole
mount.
2019-09-14 22:45:01 -04:00
Vanessa Dannenberg
fe57c23132 Add standard wood and steel signs sound defs
use them in standard signs.
2019-09-14 17:59:21 -04:00
Vanessa Dannenberg
94745e123e get standard sign groups directly from the original default node defs
(instead of hard-coding them)
2019-09-14 17:45:42 -04:00
Vanessa Dannenberg
5131eac4bb Move text entity out a bit further from sign surface
was ~7.81 mm (2/256), now ~11.72 mm (3/256)
2019-09-14 17:31:38 -04:00
Vanessa Dannenberg
de69b246ec fix wrong priv 2019-09-13 17:12:40 -04:00
Vanessa Dannenberg
e2d522373d add chat command to sweep-away
and regenerate all sign entities in loaded map
(uses LBM to log all loaded blocks,
but only those with nodes in "group:sign").
2019-09-13 16:51:51 -04:00
Vanessa Dannenberg
d262f95744 fix bad material order in facedir-onpole model 2019-09-12 12:01:51 -04:00
Vanessa Dannenberg
d34d27bb81 fix 'dummy' formspec images (the hacky way) 2019-09-12 11:31:19 -04:00
Vanessa Dannenberg
e86ab17aea Fix bad UV mapping and font settings on standard signs 2019-09-12 00:29:40 -04:00
Vanessa Dannenberg
261e519e72 allow rotation to all 6 faces for both wallmounted and facedir signs, make them follow the same rotation pattern. 2019-09-11 17:03:48 -04:00
Vanessa Dannenberg
fb77cc5708 Fix missing offsets on wallmount selboxes 2019-09-11 16:21:44 -04:00
Vanessa Dannenberg
4614d66cbe Fix broken/bad screwdriver rotation handling 2019-09-11 16:03:02 -04:00
Vanessa Dannenberg
eba3ce1308 fix incorrect "onpole" activation when placing on top/bottom of post 2019-09-11 15:17:19 -04:00
Vanessa Dannenberg
4ff54c9a4d Re-built onto the new API formerly part of my street_signs mod
Any sign can now use a 15 or 31 px font, at any reasonable visual scale,
line width, number of lines, etc.

Split most signs off into a separate mod, basic_signs, which depends on
this one.  Only the default minetest_game wood and steel signs remain in
signs_lib, completely redefined. The wall/yard/ceiling function for
wooden signs has been rewitten and moved to basic_signs, too.

signs_lib can now put almost any wall sign onto almost any kind of
posts/fence, as with most signs in my street_signs mod.  Mods can add
their fences/posts to its "allowed" list, if needed (signs_lib tries to
detect most kinds of suitable fences, poles, posts, etc).

All signs affected by these changes are similar to what they've always
been, for continuity.  The main difference is that they all use a 15px
font now, with a slightly larger scale, and the positions of some have
changed slightly.

Dropped the old "@KEYWORD" feature (but it could be re-added if it turns
out to be needed), and most of the old cruft like "|" for line breaks.

Created new wood and steel sign textures, derived from HDX.

See standard_signs.lua for examples of how the new API is used. The
"standard" text sizing/position/etc. variables are all at the top of
api.lua.
2019-09-11 12:03:04 -04:00
Vanessa Dannenberg
16f839943b remove redundant node redefine 2019-05-31 14:40:30 -04:00
Vanessa Dannenberg
1d33e15ea5 rework sign type and ownership checks
minor tweaks elsewhere to fit those changes

got rid of a couple of obsolete MT/mtg version checks
2019-05-27 13:32:16 -04:00
Vanessa Dannenberg
dfa47c2519 add protection and ownership checks to default metal sign 2019-05-25 04:45:30 -04:00
Vanessa Dannenberg
34a7242616 add protection checks to all rotate functions
add ownership check to rotation of locked sign
2019-05-25 04:38:17 -04:00
cheapie
c199a33bb8 Cache character textures 2018-11-21 18:49:13 -06:00
Vanessa Dannenberg
b057341a07 license fixups: use LGPL 3.0 for code,
CC-by-SA 4.0 for media and everything else
2018-11-08 19:02:48 -05:00
Vanessa Dannenberg
eee4cb8112 use basic_materials for padlock
to make locked sign
2018-10-31 13:29:06 -04:00
Vanessa Dannenberg
0f78ef70de add arrow symbols to fonts
accessible by putting ^1 to ^8 (think "arrow number 1", etc) in your text
for narrow-width arrows (good for "wide font" highway signs), or ^a to ^h
for double-width arrows (good for all of the normal narrow-font signs).

in order, arrows 1 and "a" point up, 2/b points up-and-right, 3/c points
right, and so on, turning clockwise

Any other ^x pair just renders directly (no escape char, sorry)
2018-10-09 07:49:41 -04:00
Vanessa Dannenberg
fac33e369f Merge branch 'patch-1' into 'master'
pass node information to sign update function, remove all entities on update incase of rogue

See merge request VanessaE/signs_lib!1
2018-09-26 19:21:22 +00:00