ludic.ui: a bar's min, max and value read without ui_attr's new null for a miss (ui_attr_float), and the action answer ring made full with the state - craft's bar kept a block a frame, pack/shop/journal kept one frame filling the ring
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8c72437ecc
commit
fc22c3f250
4 changed files with 17 additions and 7 deletions
|
|
@ -94,6 +94,11 @@ export function ui_attr_has(n: UiNode, key: string) -> bool {
|
|||
}
|
||||
return false
|
||||
}
|
||||
# an attribute as a number, `none` when it is not there - without ui_attr's new null for a miss
|
||||
export function ui_attr_float(n: UiNode, key: string, none: float) -> float {
|
||||
if not ui_attr_has(n, key) { return none }
|
||||
return Value.as_float(ui_attr(n, key))
|
||||
}
|
||||
export function ui_attr_text(n: UiNode, key: string) -> string {
|
||||
if n.akeys == null { return "" }
|
||||
for i in 0 .. len(n.akeys) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue