wip(0.S2): migrate - a var nothing writes becomes a let; a state is keyed by its module, directory or program, so every program's plan agrees; paths normalized; program states named SceneDemoState / scene_demo_st; the LSP reads state, mut and entry/handler parameters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3eda72e8c2
commit
5ffe50ed02
463 changed files with 72045 additions and 67421 deletions
|
|
@ -1,25 +1,28 @@
|
|||
# hold.ludic - on-hold: every frame a control is held down - by the pointer (wherever it goes until it
|
||||
# is let go), or by Enter or the pad's A on the focus - with event.dt, the seconds since the last
|
||||
# frame, and event.t, how long it has been held, on the ui clock
|
||||
function hd_tick(ui_st: mut UiState, root: UiNode) -> void {
|
||||
var key = ui_st.fr_key_press
|
||||
if ui_st.fr_press_key != "" and ui_st.in_now.down { key = ui_st.fr_press_key }
|
||||
var hd_key: string = ""
|
||||
var hd_t0: float = 0.0
|
||||
var hd_last: float = 0.0
|
||||
function hd_tick(root: UiNode) -> void {
|
||||
var key = fr_key_press
|
||||
if fr_press_key != "" and in_now.down { key = fr_press_key }
|
||||
if key == "" {
|
||||
ui_st.hd_key = ""
|
||||
hd_key = ""
|
||||
return
|
||||
}
|
||||
let now = an_now(ui_st)
|
||||
if key != ui_st.hd_key {
|
||||
ui_st.hd_key = key
|
||||
ui_st.hd_t0 = now
|
||||
ui_st.hd_last = now
|
||||
let now = an_now()
|
||||
if key != hd_key {
|
||||
hd_key = key
|
||||
hd_t0 = now
|
||||
hd_last = now
|
||||
}
|
||||
let n = fr_node(root, key)
|
||||
if n != null {
|
||||
let v = Value.object()
|
||||
Value.put(v, "dt", Value.float(now - ui_st.hd_last))
|
||||
Value.put(v, "t", Value.float(now - ui_st.hd_t0))
|
||||
ui_fire(ui_st, n, "hold", v)
|
||||
Value.put(v, "dt", Value.float(now - hd_last))
|
||||
Value.put(v, "t", Value.float(now - hd_t0))
|
||||
ui_fire(n, "hold", v)
|
||||
}
|
||||
ui_st.hd_last = now
|
||||
hd_last = now
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue