cyborg_character 
Dedicated creator state, and the editor window character setup opens. Catalog/preview work is lazy and has no map registrations.
Vars | |
| context_generation | Invalidates frontend actions after slot/model/preset replacement. |
|---|---|
| dirty | Whether accepted edits still require a successful sidecar write. |
| draft | Canonical session-owned store, isolated from presets and the preference cache. |
| draft_revision | Ordinary edit revision; never used as a replacement-session token. |
| draft_slot | Character slot that owns the draft and every pending callback. |
| draft_timer | Stoppable two-second autosave callback. |
| editor_open | Whether the editor's window is open |
| editor_preferences | The character preferences the editor sets beside its name, which the window gets the values of |
| editor_values | The editor's preference values the window has, from its static data |
| editor_values_stale | Whether or not a preference may have changed since editor_values were read |
| encoded_parts | The draft's parts and layouts with their save text from its last encode (see cyborg_layout_encode()). Edits copy a part or layout before changing it, so these still match; raw draft updates drop them. |
| full_message | Why the draft would pass its character's or the account's limit, so it stays unstaged until edits shrink it. |
| gallery_department | The department the model gallery shows |
| gallery_open | Whether or not the model gallery is open |
| preview_arousal | The arousal state the preview shows the parts in |
| preview_direction | The direction the preview faces |
| preview_layout_source | Which layout the preview shows - active, or the chassis's model_default |
| preview_model | Catalog id of the chassis the preview shows |
| preview_moving | Whether or not the preview shows the chassis moving |
| preview_pending | Metadata/gallery work must not interrupt placement against unchanged stage pixels. |
| preview_pose | The pose the preview shows, like idle or rest |
| preview_resources | Per-session private resource payload and its pixel-only dependency key. |
| rendered_preview | Bounded view fields keep the old pixels and geometry coherent during a refresh. |
| resource_body_key | The chassis, direction, pose and movement the current resources show |
| resource_catalog | The model catalog the current resources were built from |
| resource_generation | Goes up whenever the resources are cleared, so older waits and timers give up |
| resource_key | Everything the preview resources were built from, or denied or unsupported while we show none |
| resource_layer_keys | Only the current six images/metadata are retained; shared FIFO eviction is harmless. |
| resource_part_keys | Each part slot's key in the current resources, so an unchanged part keeps its art |
| resource_refresh_at | The earliest world.time the next resource build may run, a second after the last one |
| resource_timer | One latest-state refresh, with a deadline that survives close/reopen and slot changes. |
| resources_pending | Whether or not newer resources are waiting to be built, which the editor shows |
| save_error | A retryable write or staging failure, kept across UI close/reopen. |
| save_requested | Whether the account's next queued save should stage the draft first. |
| selected_part | The part slot the editor's controls are on |
| staged_revision | Revision already encoded into the account tree; failed retries do not encode it again. |
| status_message | What the editor tells the player about their last edit, like why it was refused |
Procs | |
| Destroy | Closes the window, then saves and drops the draft |
| apply_to_human | A spawn first randomizes what the player asked it to, so we read the editor's values again |
| begin_draft | |
| begin_session | Starts editing the active layout, as the window opens. |
| build_resources | |
| clear_preview_resources | Cancel work and release private pixels immediately, without resetting admission time. |
| close_editor | Ends the editing session and asks for its save. Character setup closing calls it too, so it closes the window as well. |
| commit_draft | |
| discard_draft | Releases draft ownership on explicit replacement or teardown, never on write failure. |
| edit_layout | Checks a layout edit from the window, runs it through cyborg_layout_action() and takes the result as the draft |
| editor_preference_values | The values of the editor's preferences, as character setup sends them. A preference this character can't have is left out. |
| flush_timer | A stale timer cannot write a replaced draft or an older revision. |
| get_ui_data | Character setup refreshes after every change made there, randomizing included, so we read the editor's values again |
| on_new_character | Called when the player switches character slots - resets the view, so the window shows the new slot from the start |
| open_editor | Character setup's action - opens the editor's window, or brings it to the front. |
| post_set_preference | Called after a preference changes - puts a new part sprite in the draft, updates the borg's permissions and viewers, then refreshes the window |
| refresh_editor_values | Reads the editor's preference values again if one may have changed. Returns TRUE when the window's copy is out of date |
| refresh_resources | |
| refresh_resources_timer | The timer owns no layout snapshots: the next UI update reads the latest accepted draft. |
| request_save | Asks SScyborg_layout_saves to stage the draft and write the account, which happens outside this action or timer. |
| save_problem | What the save status shows, null when everything is saved or on its way. |
| schedule_draft_save | Rearm the save for this context without creating a revision for view-only changes. |
| set_editor_preference | Sets one of the editor's preferences through character setup's own action, so its checks and every middleware's hooks still run. |
| set_preview | Changes what the preview shows - chassis, direction, pose, arousal, gallery and which layout. Returns FALSE for a stale or bad request |
| sidecar_write_completed | A delayed account write can complete after this editor switched slots or closed. |
| stage_draft | |
| ui_act | Sends the window's actions to their handlers - preview changes, layout edits and preference changes |
| ui_close | Called when the window closes - ends the session and asks for its save |
| ui_data | Builds the window's data - the draft as the window needs it, the preview and the save status. Shared gallery work that may sleep goes first |
| ui_interact | Opens the window and starts the session, or updates the open one, bringing it to the front on an explicit open |
| ui_state | Always state, as ui_status() does the checking |
| ui_static_data | Static data is private to this window; never register sensitive PNGs globally. |
| ui_status | Only the player whose preferences these are can use the window |
| update_draft | |
Var Details
context_generation 
Invalidates frontend actions after slot/model/preset replacement.
dirty 
Whether accepted edits still require a successful sidecar write.
draft 
Canonical session-owned store, isolated from presets and the preference cache.
draft_revision 
Ordinary edit revision; never used as a replacement-session token.
draft_slot 
Character slot that owns the draft and every pending callback.
draft_timer 
Stoppable two-second autosave callback.
editor_open 
Whether the editor's window is open
editor_preferences 
The character preferences the editor sets beside its name, which the window gets the values of
editor_values 
The editor's preference values the window has, from its static data
editor_values_stale 
Whether or not a preference may have changed since editor_values were read
encoded_parts 
The draft's parts and layouts with their save text from its last encode (see cyborg_layout_encode()). Edits copy a part or layout before changing it, so these still match; raw draft updates drop them.
full_message 
Why the draft would pass its character's or the account's limit, so it stays unstaged until edits shrink it.
gallery_department 
The department the model gallery shows
gallery_open 
Whether or not the model gallery is open
preview_arousal 
The arousal state the preview shows the parts in
preview_direction 
The direction the preview faces
preview_layout_source 
Which layout the preview shows - active, or the chassis's model_default
preview_model 
Catalog id of the chassis the preview shows
preview_moving 
Whether or not the preview shows the chassis moving
preview_pending 
Metadata/gallery work must not interrupt placement against unchanged stage pixels.
preview_pose 
The pose the preview shows, like idle or rest
preview_resources 
Per-session private resource payload and its pixel-only dependency key.
rendered_preview 
Bounded view fields keep the old pixels and geometry coherent during a refresh.
resource_body_key 
The chassis, direction, pose and movement the current resources show
resource_catalog 
The model catalog the current resources were built from
resource_generation 
Goes up whenever the resources are cleared, so older waits and timers give up
resource_key 
Everything the preview resources were built from, or denied or unsupported while we show none
resource_layer_keys 
Only the current six images/metadata are retained; shared FIFO eviction is harmless.
resource_part_keys 
Each part slot's key in the current resources, so an unchanged part keeps its art
resource_refresh_at 
The earliest world.time the next resource build may run, a second after the last one
resource_timer 
One latest-state refresh, with a deadline that survives close/reopen and slot changes.
resources_pending 
Whether or not newer resources are waiting to be built, which the editor shows
save_error 
A retryable write or staging failure, kept across UI close/reopen.
save_requested 
Whether the account's next queued save should stage the draft first.
selected_part 
The part slot the editor's controls are on
staged_revision 
Revision already encoded into the account tree; failed retries do not encode it again.
status_message 
What the editor tells the player about their last edit, like why it was refused
Proc Details
Destroy
Closes the window, then saves and drops the draft
apply_to_human
A spawn first randomizes what the player asked it to, so we read the editor's values again
begin_draft
- Returns the owned canonical draft, decoding the slot's save text the first time.
- Callers must use the action path or update_draft to accept mutations.
- The sidecar is keyed by slot, so a draft left by a slot change is written to its own slot first.
begin_session
Starts editing the active layout, as the window opens.
build_resources
- Reuse the current session's unchanged resources, even after shared FIFO eviction.
- Retention stays bounded to one gallery and six part images/metadata, not edit history.
clear_preview_resources
Cancel work and release private pixels immediately, without resetting admission time.
close_editor
Ends the editing session and asks for its save. Character setup closing calls it too, so it closes the window as well.
commit_draft
- Stages the draft and writes the account now, for teardown and slot changes that can't wait for SScyborg_layout_saves.
- A failed write keeps the draft dirty for retry, and a draft past a limit stays unstaged until edits shrink it, while
- other slots' pending writes still go out.
discard_draft
Releases draft ownership on explicit replacement or teardown, never on write failure.
edit_layout
Checks a layout edit from the window, runs it through cyborg_layout_action() and takes the result as the draft
editor_preference_values
The values of the editor's preferences, as character setup sends them. A preference this character can't have is left out.
flush_timer
A stale timer cannot write a replaced draft or an older revision.
get_ui_data
Character setup refreshes after every change made there, randomizing included, so we read the editor's values again
on_new_character
Called when the player switches character slots - resets the view, so the window shows the new slot from the start
open_editor
Character setup's action - opens the editor's window, or brings it to the front.
post_set_preference
Called after a preference changes - puts a new part sprite in the draft, updates the borg's permissions and viewers, then refreshes the window
refresh_editor_values
Reads the editor's preference values again if one may have changed. Returns TRUE when the window's copy is out of date
refresh_resources
- Pixel dependencies exclude placement/rotation/scale, so a drag only resolves geometry.
- Full private payloads are limited to one pixel refresh per second per editor. A single
- pending timer coalesces later input while the old coherent stage remains visible.
refresh_resources_timer
The timer owns no layout snapshots: the next UI update reads the latest accepted draft.
request_save
Asks SScyborg_layout_saves to stage the draft and write the account, which happens outside this action or timer.
save_problem
What the save status shows, null when everything is saved or on its way.
schedule_draft_save
Rearm the save for this context without creating a revision for view-only changes.
set_editor_preference
Sets one of the editor's preferences through character setup's own action, so its checks and every middleware's hooks still run.
set_preview
Changes what the preview shows - chassis, direction, pose, arousal, gallery and which layout. Returns FALSE for a stale or bad request
sidecar_write_completed
A delayed account write can complete after this editor switched slots or closed.
stage_draft
- Encodes the draft into its slot of the account tree, unless that revision is already there. Returns FALSE while the
- draft is past CYBORG_LAYOUT_MAX_SLOT_BYTES or the account's limit, which leaves it unstaged until edits shrink it.
ui_act
Sends the window's actions to their handlers - preview changes, layout edits and preference changes
ui_close
Called when the window closes - ends the session and asks for its save
ui_data
Builds the window's data - the draft as the window needs it, the preview and the save status. Shared gallery work that may sleep goes first
ui_interact
Opens the window and starts the session, or updates the open one, bringing it to the front on an explicit open
ui_state
Always state, as ui_status() does the checking
ui_static_data
Static data is private to this window; never register sensitive PNGs globally.
ui_status
Only the player whose preferences these are can use the window
update_draft
-
Accepts canonical data and schedules the existing debounce. Staging encodes the draft, so callers keep their lists.
-
Arguments:
-
- layout - the new draft
-
- copied_on_write - whether every part list
layoutshares with the old draft is unchanged, as action results leave them
- copied_on_write - whether every part list