wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run
ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic 1804 vars into 126 states, 64 into lets; 23498 edits in 460 files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5ffe50ed02
commit
19fcf60599
459 changed files with 17862 additions and 17603 deletions
|
|
@ -6,7 +6,9 @@
|
|||
#
|
||||
# Running it prints: 50 2 1 50
|
||||
program LayerEvents {
|
||||
var step: int = 0
|
||||
state LayerEventsState {
|
||||
step: int = 0
|
||||
}
|
||||
|
||||
@On(layer_Hud_show) handler Shown { print(1) } # a mod reacts when the HUD returns
|
||||
@On(layer_Hud_hide) handler Hidden { print(2) } # ...and when it's hidden
|
||||
|
|
@ -16,11 +18,11 @@ program LayerEvents {
|
|||
handler Draw phase Update { print(50) } # only runs while Hud is enabled
|
||||
}
|
||||
layer Ctrl {
|
||||
handler Drive phase LateUpdate {
|
||||
step += 1
|
||||
if step == 1 { disable layer Hud } # frame 1: hide -> Hidden 2, Draw stops
|
||||
if step == 2 { enable layer Hud } # frame 2: show -> Shown 1, Draw resumes
|
||||
if step == 3 { quit() } # frame 3: after Draw ran again
|
||||
handler Drive(layer_events_st: mut LayerEventsState) phase LateUpdate {
|
||||
layer_events_st.step += 1
|
||||
if layer_events_st.step == 1 { disable layer Hud } # frame 1: hide -> Hidden 2, Draw stops
|
||||
if layer_events_st.step == 2 { enable layer Hud } # frame 2: show -> Shown 1, Draw resumes
|
||||
if layer_events_st.step == 3 { quit() } # frame 3: after Draw ran again
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue