@modoki/engine / index / FieldHint
Interface: FieldHint
ECS Core
accept?
optionalaccept?:string[]
alphaField?
optionalalphaField?: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?
optionaldisplay?:"degrees"
editorPanel?
optionaleditorPanel?: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?
optionalentityId?: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?
optionalgroup?:string
hidden?
optionalhidden?: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?
optionallabel?:string
max?
optionalmax?:number
min?
optionalmin?:number
multiline?
optionalmultiline?:boolean
options?
optionaloptions?:string[]
optionsSource?
optionaloptionsSource?:"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?
optionalreadOnly?:boolean
runtimeOnly?
optionalruntimeOnly?: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?
optionalsection?:string
sectionDefaultOpen?
optionalsectionDefaultOpen?:boolean
sectionDivider?
optionalsectionDivider?:boolean
showWhen?
optionalshowWhen?:Record<string,string[]>
step?
optionalstep?:number
tooltip?
optionaltooltip?:string
type
type:
FieldType