/tg/ Station 13 - Modules - Types — Var Details - Proc Details

body_marking_collection

Vars

entriesEvery worn entry in the order it was added. A zone's markings are this list filtered by zone.
key_cachezone -> cache key fragment. Dropped on a version bump or a new entry revision.
key_cache_revisionThe entry revision key_cache was built at.
key_cache_versionThe version key_cache was built at.
versionBumped by every structural change: a zone or an entry added, an entry removed or replaced. Read-only outside this type, where only BODY_MARKING_ZONE_VIEWS() reads it.
zone_cachezone -> that zone's entries in order, for every zone wearing any, in zone order. Built on first use after a version bump and always replaced rather than edited, so a list handed out earlier stays a stable snapshot. Read-only outside this type, where only BODY_MARKING_ZONE_VIEWS() reads it.
zone_cache_versionThe version zone_cache was built at. Read-only outside this type, where only BODY_MARKING_ZONE_VIEWS() reads it.
zonesZones in the order they first appeared. An emptied zone keeps its place, as the nested map kept its key.

Procs

add_entryAdds an entry after every entry already on its zone, adding the zone first when it is absent.
add_zoneAdds a zone with no markings yet, where a new key of the nested map would have gone: at the end.
blocking_entryReturns the entry that keeps a marking off a zone: one wearing the same marking or, unless told not to look, one wearing another marking of its exclusion group. add_entry(), replace_entry() and set_zone_entries() refuse through here, and character setup asks it which markings a zone can still take.
cache_key_for_zoneReturns a string standing for one zone's markings, in order, with their colours and glow.
copyReturns a new collection with new entries in the same zones and order, colours and glow. Nothing is shared.
enforce_zone_limitsDrops what editing could never have put on a zone, keeping the order of the rest: a second marking of an exclusion group, then every entry past MAXIMUM_MARKINGS_PER_LIMB. A save from before version 21 gets this once as it loads; nothing else calls it, so a save written since keeps what it holds.
entries_for_zoneReturns one zone's entries in order.
entry_countReturns how many entries there are across every zone.
find_entryReturns the entry wearing a marking on a zone.
has_zoneReturns whether a zone is present, with markings or emptied.
marking_namesReturns the names one zone wears, in order.
overwrite_zones_fromGives every zone another collection holds that collection's entries, as assigning its zone maps did.
remove_entryRemoves an entry. Its zone stays present, emptied or not.
replace_entryPuts a replacement in an entry's place, so it keeps its position on the zone.
reseed_colorsGives every marking its starting colour again, as a colour reset does, except locked ones: a locked marking keeps its colour, a custom one a save holds included. Glow is left alone.
serializeRebuilds the nested shape preferences.json stores: zone -> (marking name -> list(color, emissive)).
set_zone_entriesReplaces everything on one zone. An absent zone is added at the end, a present one keeps its place.
set_zone_from_listReplaces everything on one zone from the nested shape a savefile holds, with new entries.
shallow_copyReturns a new collection holding these same entries.
validate_for_speciesReturns the entries a species may not wear without mismatched parts, each asked of its marking's allows_species(): the one check of a whole character's markings against a species. This only reports mismatches: saved markings must never be removed because a character changes species.
zone_countReturns how many zones are present, emptied ones included.
zone_lengthReturns how many entries one zone wears.
zone_viewsReturns the entries of every zone that wears any, in zone order.

Var Details

entries

Every worn entry in the order it was added. A zone's markings are this list filtered by zone.

key_cache

zone -> cache key fragment. Dropped on a version bump or a new entry revision.

key_cache_revision

The entry revision key_cache was built at.

key_cache_version

The version key_cache was built at.

version

Bumped by every structural change: a zone or an entry added, an entry removed or replaced. Read-only outside this type, where only BODY_MARKING_ZONE_VIEWS() reads it.

zone_cache

zone -> that zone's entries in order, for every zone wearing any, in zone order. Built on first use after a version bump and always replaced rather than edited, so a list handed out earlier stays a stable snapshot. Read-only outside this type, where only BODY_MARKING_ZONE_VIEWS() reads it.

zone_cache_version

The version zone_cache was built at. Read-only outside this type, where only BODY_MARKING_ZONE_VIEWS() reads it.

zones

Zones in the order they first appeared. An emptied zone keeps its place, as the nested map kept its key.

Proc Details

add_entry

Adds an entry after every entry already on its zone, adding the zone first when it is absent.

A zone wears each marking at most once, which the name-keyed nested map used to guarantee, and at most one marking of an exclusion group.

Arguments:

Returns:

add_zone

Adds a zone with no markings yet, where a new key of the nested map would have gone: at the end.

Arguments:

Returns:

blocking_entry

Returns the entry that keeps a marking off a zone: one wearing the same marking or, unless told not to look, one wearing another marking of its exclusion group. add_entry(), replace_entry() and set_zone_entries() refuse through here, and character setup asks it which markings a zone can still take.

Arguments:

Returns:

cache_key_for_zone

Returns a string standing for one zone's markings, in order, with their colours and glow.

Arguments:

Returns:

copy

Returns a new collection with new entries in the same zones and order, colours and glow. Nothing is shared.

Arguments:

Returns:

enforce_zone_limits

Drops what editing could never have put on a zone, keeping the order of the rest: a second marking of an exclusion group, then every entry past MAXIMUM_MARKINGS_PER_LIMB. A save from before version 21 gets this once as it loads; nothing else calls it, so a save written since keeps what it holds.

Returns:

entries_for_zone

Returns one zone's entries in order.

Arguments:

Returns:

entry_count

Returns how many entries there are across every zone.

find_entry

Returns the entry wearing a marking on a zone.

Arguments:

Returns:

has_zone

Returns whether a zone is present, with markings or emptied.

Arguments:

marking_names

Returns the names one zone wears, in order.

Arguments:

Returns:

overwrite_zones_from

Gives every zone another collection holds that collection's entries, as assigning its zone maps did.

A zone present here keeps its place and a new one goes at the end. A zone the other holds emptied is emptied here too. Each zone is taken whole, as the other holds it. The entries are shared, not copied.

Arguments:

remove_entry

Removes an entry. Its zone stays present, emptied or not.

Arguments:

Returns:

replace_entry

Puts a replacement in an entry's place, so it keeps its position on the zone.

Arguments:

Returns:

reseed_colors

Gives every marking its starting colour again, as a colour reset does, except locked ones: a locked marking keeps its colour, a custom one a save holds included. Glow is left alone.

Arguments:

serialize

Rebuilds the nested shape preferences.json stores: zone -> (marking name -> list(color, emissive)).

Zones and entries keep their order, an emptied zone writes as [], colours are the stored lowercase #rrggbb and emissive is the integer 0 or 1, so a loaded save writes back byte for byte. With no zones this is an empty list, which json_encode() writes as [].

Returns:

set_zone_entries

Replaces everything on one zone. An absent zone is added at the end, a present one keeps its place.

Arguments:

Returns:

set_zone_from_list

Replaces everything on one zone from the nested shape a savefile holds, with new entries.

Arguments:

Returns:

shallow_copy

Returns a new collection holding these same entries.

Adding, removing or replacing entries on one leaves the other alone, but a recoloured entry changes in both: the sharing the nested lists' shallow Copy() gave, kept until each copy site is decided on.

Returns:

validate_for_species

Returns the entries a species may not wear without mismatched parts, each asked of its marking's allows_species(): the one check of a whole character's markings against a species. This only reports mismatches: saved markings must never be removed because a character changes species.

Arguments:

Returns:

zone_count

Returns how many zones are present, emptied ones included.

zone_length

Returns how many entries one zone wears.

Arguments:

zone_views

Returns the entries of every zone that wears any, in zone order.

The returned list and the lists inside it are shared and must not be edited: limbs hold these zone lists as their markings. A structural change builds new ones, so a list already handed out keeps what it held. A zone that wears nothing, emptied or absent, has no list here; has_zone() tells the two apart. Hot callers read the same views through BODY_MARKING_ZONE_VIEWS(), which calls this only when they are out of date.

Returns: