Skip to content

@modoki/engine / index / FieldHint

Interface: FieldHint

ECS Core

accept?

optional accept?: string[]


alphaField?

optional alphaField?: string

For a color field: the name of a sibling 0..1 number field that holds its alpha. The Inspector folds that field into the color picker as an A slider and hides it as a standalone row (e.g. UIElement.backgroundColor ↔ backgroundOpacity).


display?

optional display?: "degrees"


editorPanel?

optional editorPanel?: string

For an asset-ref field (one with accept): the id of a registered editor panel that edits this asset kind. The Inspector renders an "Open" button on the field that selects the referenced asset AND docks/focuses that panel — the affordance that lets e.g. a FieldSource.level field jump straight into the game's Field Editor. Just a string (JSON/structured-clone safe, no editor import), so it can be declared from runtime trait registration.


entityId?

optional entityId?: object

This numeric field holds a LIVE koota entity id (e.g. EntityAttributes.parentId, PrefabInstance.rootInstanceId) — a raw ecs id from the file/dying-world side, which is meaningless after a respawn until remapped through the loader's idMap. loadSceneFile.ts drives ONE declarative remap loop off every field flagged here, instead of a hand-maintained list per field (the bug class base-scene-and- persistence-plan.md's "A8" finding closes structurally — Phase 15). onMissing says what to do when the referenced id has no live counterpart in this load:

  • 'root' → silently write 0 (the field's schema default). Use when losing the link degrades to a legitimate, already-handled state (e.g. an orphaned parent — sceneValidation.ts warns on that at author time).
  • 'stripTrait' → remove the WHOLE trait from the entity and warn loudly. Use when neither 0 nor the stale value is safe to keep (e.g. a prefab- instance root pointer — either would let the entity poison downstream instance-membership lookups).

ECS Core

onMissing

onMissing: "root" | "stripTrait"


group?

optional group?: string


hidden?

optional hidden?: boolean

Never rendered in the Inspector; still a real registered field for every serialize/snapshot path (buildSceneSchema, snapshotPersistentEntities, the override-map field guard in loadSceneFile). Use this instead of leaving a field out of fields entirely — an unregistered field needs a hardcoded name-check wherever code walks meta.fields (see EntityAttributes.editorFolder, the wart this exists to avoid repeating).


label?

optional label?: string


max?

optional max?: number


min?

optional min?: number


multiline?

optional multiline?: boolean


options?

optional options?: string[]


optionsSource?

optional optionsSource?: "uiActions" | "animationClips" | "skeletonBones" | "physicsLayers"

Named provider for DYNAMIC enum options resolved at inspector-render time:

  • 'uiActions' → registered UIAction names (global)
  • 'animationClips' → clip names from THIS entity's SkinnedModel GLB (per-entity)
  • 'skeletonBones' → bone names from the entity referenced by THIS entity's BoneAttachment.target (per-entity) Stays a string so the field schema remains JSON/structured-clone safe when pushed to the validator.

readOnly?

optional readOnly?: boolean


runtimeOnly?

optional runtimeOnly?: boolean

Pure runtime state — recomputed every frame by the trait's system (e.g. Time.elapsed/frame). Excluded from scene serialization so a save doesn't bake a transient snapshot or churn the file every time; the loader/system re-derives it from the schema default. Independent of readOnly (a field can be read-only in the Inspector yet still authored/persisted).


section?

optional section?: string


sectionDefaultOpen?

optional sectionDefaultOpen?: boolean


sectionDivider?

optional sectionDivider?: boolean


showWhen?

optional showWhen?: Record<string, string[]>


step?

optional step?: number


tooltip?

optional tooltip?: string


type

type: FieldType

Built with Modoki.