attributes: @Clip(field) resolved as @Node is, and @OneOf takes constants as well as a prefix - one argument ending in _ is a prefix, otherwise each is a constant that must exist; reseeded

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 18:34:33 +03:00
parent ebfbabdfd8
commit 34c2ac2cb9
9 changed files with 73220 additions and 71912 deletions

View file

@ -636,10 +636,12 @@ the lines above it:
property Tool {
@Ref(Vendors) seller: int = 0 # an index into that registry: its entries are offered
@OneOf(GR_) grade: int = 0 # one of the constants whose names start GR_
@OneOf(GR_GOLD, GR_SILVER) medal: int = 0 # or one of these constants
@Range(0, 20.5) @Unit("kg") weight: float = 1.0
@Asset("gltf") model: string = "" # a file of that kind (any string)
@Color tint: int = 0
@Node(model) grip: string = "" # a node inside the glTF that `model` names
@Clip(model) swing: string = "" # a clip inside it
@Derived reach: float = 0.0 # worked out at boot: anything written is overwritten
@Text @Multiline blurb: string = "" # read by the player (so translated), and prose
@Key bind: int = 0 # a key code
@ -648,8 +650,10 @@ property Tool {
registry Tools of Tool as TL from "data/tools.lres"
```
They change nothing the program does. Two are checked, and every field that fails is reported, not
only the first: `@Ref` must name a registry the program declares, and `@Node(f)` must name a field
They change nothing the program does. Three are checked, and every field that fails is reported, not
only the first: `@Ref` must name a registry the program declares; `@OneOf` with one argument ending
in `_` is a prefix, and otherwise each argument is a constant that must exist; and `@Node(f)` or
`@Clip(f)` must name a field
`f` of the same record that is either `@Asset("gltf")` or an `@Ref` to a registry whose record has
exactly one `@Asset("gltf")` field (the model is then the referenced row's).