mt-mods / signs_lib

Other
4 stars 12 forks source link

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 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:

Sign placement and rotation notes

Chat commands

At present, only one command is defined:

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

Allows to rotate signs and to open (and consequently edit) any default sign formspec. (privilege can be set by signs_lib.edit_priv setting)