ludic.ui: ui_attr's miss is the node's own kept null (made with the pooled node), not a new one per ask - every control asking min/max/step/value per frame made one; a select's options without a value matched by index without asking
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2b02c0a931
commit
1786e144bb
3 changed files with 7 additions and 2 deletions
|
|
@ -105,6 +105,10 @@ function ct_numeric(v: Val) -> bool { return Value.kind(v) == 1 or Value.kind(v)
|
|||
function ct_option_num(nv: Val, opts: []UiNode) -> int {
|
||||
let x = Value.as_float(nv)
|
||||
for i in 0 .. len(opts) {
|
||||
if not ui_attr_has(opts[i], "value") {
|
||||
if x == float(i) { return i }
|
||||
continue
|
||||
}
|
||||
let ov = ui_attr(opts[i], "value")
|
||||
if Value.kind(ov) == 0 and x == float(i) { return i }
|
||||
if ct_numeric(ov) and Value.as_float(ov) == x { return i }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue