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

markings

Whole-body markings previews composed from the canvas, instead of drawing the painted body.

Paint sits at fixed layers: body paint at BODYPARTS_LAYER and hand paint at the hands' BODYPARTS_HIGH_LAYER. The body without paint is cut once per resource rebuild into three slices, each an iconforge recipe for every view from one walk: everything under body paint, everything between body and hand paint, and everything over hand paint. A preview is those slices with the canvas pixels between them, drawn as boxes. The canvas already shows exactly the paint the game shows, one region per pixel, so a preview costs no walk at all, and a view whose paint didn't change keeps its picture.

Bodies whose paint doesn't sit on those layers alone (a taur), and drafts a save would change (a region over its colour limit), keep drawing the painted body.

A composed preview's glow, for the window's lights-off view, is composed the same way: the slices' own emissive overlays, with the canvas between them as its paint shows on the emissive plane; see glow.dm.

The whole-body markings editor in character setup.

One canvas covers every region of the body. Each pixel belongs to one region, and saving writes each changed region into its own per-limb drawing, exactly as the per-limb editors stored them. Regions nobody edited aren't written at all.

Vars

baselineDirection -> the canvas as it stood when the draft opened or was last saved.
composed_framesDirection -> the canvas pixels its composed preview was drawn from.
focus_revisionBumped when character setup moves the selection, so the open window follows.
glow_slice_recipesDirection -> list(under, between, over) iconforge recipes of paintless_look's emissive overlays, null for an empty slice.
glow_slices_forThe paintless look glow_slice_recipes were cut from.
glow_slices_litWhether anything in paintless_look glows, rather than only blocking glow.
lock_reasonslocked_regions() as apply_region_locks() last worked it out, which the canvas enforces.
paintless_forThe guide appearance of the rebuild paintless_look was captured for.
paintless_lookThe paint-free look the slices are cut from, captured once per rebuild.
preview_composedWhether the current previews are composed from slices rather than flattened.
region_mapDirection -> row strings naming the region that owns each pixel.
region_zonesRegions in draw order. A region map character N means region_zones[N].
results_cacheregion_results() for the draft state in results_revision.
results_revisionWhich draft state results_cache belongs to.
saved_drawingsZone -> each region's drawing as saved when the draft opened or was last saved.
saved_markingsZone -> native marking records as saved, for regions that have native markings.
saved_pixelsZone -> decoded pixels of saved_drawings, reused read-only by every split.
selected_zoneThe region that region-specific actions act on.
slice_recipesDirection -> list(under, between, over) iconforge recipes of paintless_look, null for an empty slice.

Procs

apply_candidateReplaces the confirmed regions as one undoable action.
apply_region_locksKeeps locked regions out of the paintable mask, so the canvas shades them and every tool refuses them.
base_copy_contextMarking copies follow the draft's native records, independently of custom paint and candidate previews.
base_copy_originWhole-body and taur canvases use body coordinates, without a hairstyle's moving origin.
base_copy_placement_validCheck the existing placement parser and the saved palette of each affected region before admitting a copy.
body_packagesEvery present region's would-be-saved package, zone -> package, as a whole-body export holds them.
build_region_mapRebuilds which region owns each pixel from the preview body.
can_compose_previewsWhether previews can be composed right now, rather than flattened from the painted body.
candidate_keyA whole-body candidate is keyed by every region it would set and the body it's drawn on.
candidate_resultsWhat every region would hold with a candidate applied.
capture_paintless_lookThe preview body as previews show it, wearing the draft's base markings and none of its custom paint.
capture_region_previewsPuts exactly what saving would write on the preview body and captures its look. A region too colorful to save shows its saved paint.
composed_recipeOne view of the preview as an iconforge recipe: its slices with the canvas pixels between them.
cover_rows_forHand paint draws above the body's own parts and the taur's paint above nearly everything, so each region takes its own cover.
current_locksZone -> why it's locked, as the canvas enforces it. Worked out afresh only while the canvas isn't built.
export_problemWhy these regions can't be exported right now, or null.
focus_regionSelects a region from outside the window, such as a limb's Custom button.
glow_recipeA composed preview's glow is composed too: its slices' glows with the canvas's between them, or null when nothing in the view glows.
has_covered_paintWhether a region's saved paint in one view includes any the canvas can't show, under other limbs or outside every region.
initial_packageThe canvas is composed from every region's save instead of one package.
load_saved_stateReads what every region is measured against: the reference for spotting changes.
locked_regionsContext hook: zone -> why that region can't be changed right now. Character setup locks nothing.
map_follows_bodyContext hook: whether the region map follows the preview body after the draft opens. The salon keeps its first map, so paint never changes region.
mark_savedThe saved canvas becomes the reference for the next save.
marking_choicesThe base markings a region may take, as character setup offers them.
marking_sheets_keyWhat the editor's marking sheets know of the body they show, as a key: its species and the three mutant colours its markings can follow. The static data carries it, and a window holding sheets made for another asks for them again.
paint_recipesOne view's canvas pixels as recipes of boxes, list(everything but the hands, the hands), each null when it has no paint. Paint takes its limb's marking opacity, as in game. One pass over the canvas serves both.
palette_noticeExplains colors the window can't take: a region over its own limit first, then a canvas over the shared one.
preview_framesThe character thumbnail can show floating paint without changing the authoritative draft. Markings have one layer.
preview_receivedA whole-body file previews its regions; a single-region file its own; a drawing-only file goes into the selected region.
prompt_actionExport and Restore ask whether they mean the whole body or the selected region. Sleeps.
reference_packagesContext hook: zone -> the package each region is measured against, for every marking zone.
refresh_composed_previewsRefreshes composed previews. Only views whose canvas pixels changed are drawn again.
region_candidate_problemWhy candidate regions can't replace their parts of this draft, or null.
region_marking_rowsA region's native markings in layer order, as its Base markings section shows them. A locked marking's colour is its own.
region_packageOne region's would-be-saved package.
region_resultsWhat saving would write for every region right now, cached per draft state.
region_widthA taur organ widens the canvas, even while hidden, so it doesn't change size.
render_base_copy_frameSample each region's own native markings, never the body, clothing or taur organ artwork.
render_previewComposed previews come from the slices and the canvas; otherwise the painted body is drawn. Every view whose paint changed is drawn at once, with its glow while the lights are off.
render_region_previewsAll four views' data URLs of the preview body wearing these results, for import and restore previews.
restorable_regionsEach region's previous saved style that differs from what it would save now.
save_drawingSaves every changed region in one write. Untouched regions aren't written.
send_marking_sheetsSends the window what its marking sheets draw from, the first time it opens one, as character setup's markings room has it: each marking the editor's zones can take, with its colour mode, exclusion group and species; the colour each fixed one starts in, and the body's three mutant colours for the rest; and the body's species, whose bare body is under every thumbnail. The species' body sheet and the room's art come first, so the sheet draws whole as it opens. In an update of its own: the window keeps it, and nothing else sends it again.
show_region_candidatePreviews regions from an import or restoration before they replace anything.
slice_lookpaintless_look with only its overlays layered in (low, high], or null when that leaves nothing. Only the lowest slice has the body's own icon and underlays.
ui_assetsSalon artists reuse the preferences sheet already cached by the client.
view_glow_slice_recipesEvery view's glow slices as recipes, cut where the preview's slices are, the first time a glow is composed after each rebuild.
view_slice_recipesEvery view's slices as recipes, from one walk per slice, the first time a preview is composed after each rebuild.
write_region_markingRewrites one region's native markings as an undoable draft change.

Var Details

baseline

Direction -> the canvas as it stood when the draft opened or was last saved.

composed_frames

Direction -> the canvas pixels its composed preview was drawn from.

focus_revision

Bumped when character setup moves the selection, so the open window follows.

glow_slice_recipes

Direction -> list(under, between, over) iconforge recipes of paintless_look's emissive overlays, null for an empty slice.

glow_slices_for

The paintless look glow_slice_recipes were cut from.

glow_slices_lit

Whether anything in paintless_look glows, rather than only blocking glow.

lock_reasons

locked_regions() as apply_region_locks() last worked it out, which the canvas enforces.

paintless_for

The guide appearance of the rebuild paintless_look was captured for.

paintless_look

The paint-free look the slices are cut from, captured once per rebuild.

preview_composed

Whether the current previews are composed from slices rather than flattened.

region_map

Direction -> row strings naming the region that owns each pixel.

region_zones

Regions in draw order. A region map character N means region_zones[N].

results_cache

region_results() for the draft state in results_revision.

results_revision

Which draft state results_cache belongs to.

saved_drawings

Zone -> each region's drawing as saved when the draft opened or was last saved.

saved_markings

Zone -> native marking records as saved, for regions that have native markings.

saved_pixels

Zone -> decoded pixels of saved_drawings, reused read-only by every split.

selected_zone

The region that region-specific actions act on.

slice_recipes

Direction -> list(under, between, over) iconforge recipes of paintless_look, null for an empty slice.

Proc Details

apply_candidate

Replaces the confirmed regions as one undoable action.

apply_region_locks

Keeps locked regions out of the paintable mask, so the canvas shades them and every tool refuses them.

Locks can change while the window is open, such as when clothing goes on, so this also runs whenever the view locks are synced.

Returns TRUE when the locks changed.

base_copy_context

Marking copies follow the draft's native records, independently of custom paint and candidate previews.

base_copy_origin

Whole-body and taur canvases use body coordinates, without a hairstyle's moving origin.

base_copy_placement_valid

Check the existing placement parser and the saved palette of each affected region before admitting a copy.

body_packages

Every present region's would-be-saved package, zone -> package, as a whole-body export holds them.

build_region_map

Rebuilds which region owns each pixel from the preview body.

A changed map drops results worked out on the old one. A region that appeared since the draft opened gets its saved emission and base markings. A context whose map doesn't follow the body keeps the first one.

can_compose_previews

Whether previews can be composed right now, rather than flattened from the painted body.

candidate_key

A whole-body candidate is keyed by every region it would set and the body it's drawn on.

candidate_results

What every region would hold with a candidate applied.

capture_paintless_look

The preview body as previews show it, wearing the draft's base markings and none of its custom paint.

capture_region_previews

Puts exactly what saving would write on the preview body and captures its look. A region too colorful to save shows its saved paint.

composed_recipe

One view of the preview as an iconforge recipe: its slices with the canvas pixels between them.

cover_rows_for

Hand paint draws above the body's own parts and the taur's paint above nearly everything, so each region takes its own cover.

current_locks

Zone -> why it's locked, as the canvas enforces it. Worked out afresh only while the canvas isn't built.

export_problem

Why these regions can't be exported right now, or null.

focus_region

Selects a region from outside the window, such as a limb's Custom button.

A region this body doesn't have, or one that's locked, keeps the current selection and says why. With nothing usable selected, the torso is picked, or else the first region that isn't locked. When every region is locked one is still selected, so the window can name it and say why.

glow_recipe

A composed preview's glow is composed too: its slices' glows with the canvas's between them, or null when nothing in the view glows.

has_covered_paint

Whether a region's saved paint in one view includes any the canvas can't show, under other limbs or outside every region.

initial_package

The canvas is composed from every region's save instead of one package.

load_saved_state

Reads what every region is measured against: the reference for spotting changes.

locked_regions

Context hook: zone -> why that region can't be changed right now. Character setup locks nothing.

map_follows_body

Context hook: whether the region map follows the preview body after the draft opens. The salon keeps its first map, so paint never changes region.

mark_saved

The saved canvas becomes the reference for the next save.

marking_choices

The base markings a region may take, as character setup offers them.

Without allow mismatched parts, only markings meant for the body's species. The salon follows the recipient's preference, since the markings land on their character.

marking_sheets_key

What the editor's marking sheets know of the body they show, as a key: its species and the three mutant colours its markings can follow. The static data carries it, and a window holding sheets made for another asks for them again.

paint_recipes

One view's canvas pixels as recipes of boxes, list(everything but the hands, the hands), each null when it has no paint. Paint takes its limb's marking opacity, as in game. One pass over the canvas serves both.

With glow, the paint is drawn as the emissive plane holds it instead: red, as bright as the paint is opaque, where its region glows in this view, and black where it only blocks; a third entry says whether any of it glows.

palette_notice

Explains colors the window can't take: a region over its own limit first, then a canvas over the shared one.

Only a canvas over the shared limit can hold a region over its own, so ordinary strokes skip the check.

preview_frames

The character thumbnail can show floating paint without changing the authoritative draft. Markings have one layer.

preview_received

A whole-body file previews its regions; a single-region file its own; a drawing-only file goes into the selected region.

prompt_action

Export and Restore ask whether they mean the whole body or the selected region. Sleeps.

Returns TRUE when the window should update.

reference_packages

Context hook: zone -> the package each region is measured against, for every marking zone.

Character setup measures against the character's saved drawings and base markings.

refresh_composed_previews

Refreshes composed previews. Only views whose canvas pixels changed are drawn again.

Returns FALSE when previews can't be composed, so the painted body has to be flattened instead.

region_candidate_problem

Why candidate regions can't replace their parts of this draft, or null.

region_marking_rows

A region's native markings in layer order, as its Base markings section shows them. A locked marking's colour is its own.

region_package

One region's would-be-saved package.

region_results

What saving would write for every region right now, cached per draft state.

Returns zone -> list("drawing", "markings", "changed", "error"). markings is null for regions without native markings, such as the taur.

region_width

A taur organ widens the canvas, even while hidden, so it doesn't change size.

render_base_copy_frame

Sample each region's own native markings, never the body, clothing or taur organ artwork.

The native helper runs before live height/textures and with marking opacity neutralized; pasted custom paint receives those settings once. Regions without native records contribute no base pixels. Where native layers overlap at reduced global opacity, the copy takes the topmost layer's pixel rather than their blend.

render_preview

Composed previews come from the slices and the canvas; otherwise the painted body is drawn. Every view whose paint changed is drawn at once, with its glow while the lights are off.

render_region_previews

All four views' data URLs of the preview body wearing these results, for import and restore previews.

restorable_regions

Each region's previous saved style that differs from what it would save now.

save_drawing

Saves every changed region in one write. Untouched regions aren't written.

send_marking_sheets

Sends the window what its marking sheets draw from, the first time it opens one, as character setup's markings room has it: each marking the editor's zones can take, with its colour mode, exclusion group and species; the colour each fixed one starts in, and the body's three mutant colours for the rest; and the body's species, whose bare body is under every thumbnail. The species' body sheet and the room's art come first, so the sheet draws whole as it opens. In an update of its own: the window keeps it, and nothing else sends it again.

Arguments:

show_region_candidate

Previews regions from an import or restoration before they replace anything.

Regions this body doesn't have, and regions that are locked, are skipped and named in the preview with the reason. Nothing in the draft changes until the candidate is confirmed.

Returns TRUE when a preview is waiting for confirmation; otherwise transfer_error says why.

slice_look

paintless_look with only its overlays layered in (low, high], or null when that leaves nothing. Only the lowest slice has the body's own icon and underlays.

ui_assets

Salon artists reuse the preferences sheet already cached by the client.

view_glow_slice_recipes

Every view's glow slices as recipes, cut where the preview's slices are, the first time a glow is composed after each rebuild.

view_slice_recipes

Every view's slices as recipes, from one walk per slice, the first time a preview is composed after each rebuild.

write_region_marking

Rewrites one region's native markings as an undoable draft change.