ludic.ui: a scroll box without scroll-top asks ui_attr_has first - ui_attr's miss made a new null every frame on every screen that scrolls (the gate's one kept block a frame on map, shop, journal and craft)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4e0c30488f
commit
ab6b666fd6
2 changed files with 13 additions and 2 deletions
|
|
@ -85,6 +85,15 @@ export function ui_attr(n: UiNode, key: string) -> Val {
|
|||
}
|
||||
return Value.null()
|
||||
}
|
||||
# whether an element has the attribute at all: ui_attr's miss is a new null, so a question asked
|
||||
# every frame asks this first
|
||||
export function ui_attr_has(n: UiNode, key: string) -> bool {
|
||||
if n.akeys == null { return false }
|
||||
for i in 0 .. len(n.akeys) {
|
||||
if n.akeys[i] == key { return true }
|
||||
}
|
||||
return false
|
||||
}
|
||||
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