/tg/ Station 13 - Modules - Types — Define Details

modular_aphelion/modules/custom_sprites/code/limits.dm

CUSTOM_SPRITE_WORK_VIEWDeferred work: draw the visible view's stale guide and preview.
CUSTOM_SPRITE_WORK_REFRESHDeferred work: refresh the preview after edits settle.
CUSTOM_SPRITE_WORK_REBUILDDeferred work: rebuild the preview body's resources, then the preview.
CUSTOM_SPRITE_WORK_NEW_BODYDeferred work: the rebuild needs a fresh preview body rather than the current one.
CUSTOM_SPRITE_WORK_CANDIDATEDeferred work: draw the previews of the import or restoration waiting for confirmation.
CUSTOM_SPRITE_REBUILD_SPACINGThe shortest time between two pieces of a player's costly work. Faster changes still end on the latest state.
CUSTOM_SPRITE_BURSTPieces of costly work a player may run back to back at the shortest spacing.
CUSTOM_SPRITE_REFILLHow long a used piece of the burst takes to come back, and so the pace of costly work that keeps coming.
CUSTOM_SPRITE_HAIRSTYLE_WINDOWHow long base hairstyle changes picked after one applies wait, to apply together as the latest pick.
CUSTOM_SPRITE_MAX_HISTORY_JUMPThe most history steps one undo or redo action may take. Windows only ever send one.
CUSTOM_SPRITE_STROKE_BUDGETStroke pixels a player may apply inside the action per second: four full tall-canvas strokes, far above a hand's pace. The rest queue.
CUSTOM_SPRITE_STROKE_QUEUEStrokes an editor holds for the background before refusing more; no person reaches it.
CUSTOM_SPRITE_WORK_STROKESDeferred work: apply the strokes that were over budget, in order.
CUSTOM_SPRITE_WORK_BASE_COPYDeferred, explicitly requested base-layer clipboard capture.
CUSTOM_SPRITE_WORK_OTHER_VIEWSReady the views the window isn't showing that the last rebuild or refresh left for later.
CUSTOM_SPRITE_OVERRUN_BUDGETOf each second, how many ms costly work may run past the ends of ticks. The budget refills whatever the server does, so waiting work always gets its turn.
CUSTOM_SPRITE_OVERRUN_BURSTHow many ms past the ends of ticks may build up for a burst: a new body and the drawing on it.
/var/SScustom_sprite_workKeeps the custom sprite editors cheap for the server, whatever a window sends.
/datum/custom_sprite_pacePaces one player's costly custom sprite work: resource rebuilds, new editors and previews of a previous saved style. Up to CUSTOM_SPRITE_BURST pieces run CUSTOM_SPRITE_REBUILD_SPACING apart, and each piece used comes back after CUSTOM_SPRITE_REFILL. A few changes in a row never wait more than the shortest spacing, while a window asking for such work nonstop gets one piece per refill. The player's base hairstyle window and stroke budget are kept here too.
/datum/custom_sprite_work_ownerAnything SScustom_sprite_work runs deferred work for, which goes in its queue: the custom sprite editors, and other work whose costly part shares their overrun budget, such as a graffiti paint job's steps.
/proc/custom_sprite_mask_tablesReads compact stroke masks by character code, which text2ascii() takes far faster than copytext() cuts a character.
/proc/custom_sprite_mask_pointsA stroke's points from its compact mask: CUSTOM_SPRITE_INDEX_ALPHABET characters, six canvas pixels each, row-major from the top left, lowest bit first. A whole view fits in one short string, so a long stroke reaches the server as one message instead of a point list tgui splits into many. With allowed, the mask's six-pixel slots in the same layout, each character is cut down to the pixels its slot allows as it is read, which checks the points for a canvas that paints only those.
/proc/custom_sprite_transaction_pixelsHow many pixels a stroke or placement touches, from what the window sent, before any validation.
/proc/custom_sprite_mask_pixelsThe pixels a compact stroke mask of size characters marks, or null when it is another size, which custom_sprite_mask_points() refuses unread, or a character isn't in the alphabet.
/proc/custom_sprite_history_jumpClamps an undo or redo step count to what a window can ask for. Anything else passes through for the history to refuse.

Define Details

CUSTOM_SPRITE_BURST

Pieces of costly work a player may run back to back at the shortest spacing.

CUSTOM_SPRITE_HAIRSTYLE_WINDOW

How long base hairstyle changes picked after one applies wait, to apply together as the latest pick.

CUSTOM_SPRITE_MAX_HISTORY_JUMP

The most history steps one undo or redo action may take. Windows only ever send one.

CUSTOM_SPRITE_OVERRUN_BUDGET

Of each second, how many ms costly work may run past the ends of ticks. The budget refills whatever the server does, so waiting work always gets its turn.

CUSTOM_SPRITE_OVERRUN_BURST

How many ms past the ends of ticks may build up for a burst: a new body and the drawing on it.

CUSTOM_SPRITE_REBUILD_SPACING

The shortest time between two pieces of a player's costly work. Faster changes still end on the latest state.

CUSTOM_SPRITE_REFILL

How long a used piece of the burst takes to come back, and so the pace of costly work that keeps coming.

CUSTOM_SPRITE_STROKE_BUDGET

Stroke pixels a player may apply inside the action per second: four full tall-canvas strokes, far above a hand's pace. The rest queue.

CUSTOM_SPRITE_STROKE_QUEUE

Strokes an editor holds for the background before refusing more; no person reaches it.

CUSTOM_SPRITE_WORK_BASE_COPY

Deferred, explicitly requested base-layer clipboard capture.

CUSTOM_SPRITE_WORK_CANDIDATE

Deferred work: draw the previews of the import or restoration waiting for confirmation.

CUSTOM_SPRITE_WORK_NEW_BODY

Deferred work: the rebuild needs a fresh preview body rather than the current one.

CUSTOM_SPRITE_WORK_OTHER_VIEWS

Ready the views the window isn't showing that the last rebuild or refresh left for later.

CUSTOM_SPRITE_WORK_REBUILD

Deferred work: rebuild the preview body's resources, then the preview.

CUSTOM_SPRITE_WORK_REFRESH

Deferred work: refresh the preview after edits settle.

CUSTOM_SPRITE_WORK_STROKES

Deferred work: apply the strokes that were over budget, in order.

CUSTOM_SPRITE_WORK_VIEW

Deferred work: draw the visible view's stale guide and preview.