wip(0.S3): packages and examples migrated in one run - ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 15:02:45 +03:00
parent d490d4f9f1
commit 3eda72e8c2
172 changed files with 3094 additions and 2966 deletions

View file

@ -1,24 +1,21 @@
# dev.ludic - a developer's build: templates and stylesheets read again when they change (once a
# second), template errors drawn over the screen, and LUDIC_UI_DUMP=<screen> printing that screen's
# tree once, with every element's box and computed style
var dv_on: bool = false
var dv_frames: int = 0
var dv_dumped: bool = false
export function ui_dev(on: bool) -> void { dv_on = on }
function dv_before() -> void {
if not dv_on { return }
dv_frames += 1
if dv_frames % 60 == 0 { ui_reload() }
export function ui_dev(ui_st: mut UiState, on: bool) -> void { ui_st.dv_on = on }
function dv_before(ui_st: mut UiState) -> void {
if not ui_st.dv_on { return }
ui_st.dv_frames += 1
if ui_st.dv_frames % 60 == 0 { ui_reload(ui_st) }
}
function dv_after(screen: string, root: UiNode) -> void {
if not dv_on { return }
if not dv_dumped and Os.has_env("LUDIC_UI_DUMP") and Os.env("LUDIC_UI_DUMP") == screen {
dv_dumped = true
function dv_after(ui_st: mut UiState, screen: string, root: UiNode) -> void {
if not ui_st.dv_on { return }
if not ui_st.dv_dumped and Os.has_env("LUDIC_UI_DUMP") and Os.env("LUDIC_UI_DUMP") == screen {
ui_st.dv_dumped = true
print(ui_dump(root, 0))
}
if len(ui_errs) == 0 or ui_be == null or ui_be.rect == null { return }
let n = Math.min(len(ui_errs), 8)
let line = ui_px(26.0)
ui_be.rect(0.0, 0.0, 4000.0, line * float(n) + ui_px(8.0), 4194304, 0.85)
for i in 0 .. n { ui_be.text(ui_px(12.0), ui_px(6.0) + line * float(i), ui_errs[len(ui_errs) - n + i], ui_px(18.0), 16767449, 1.0) }
if len(ui_st.ui_errs) == 0 or ui_st.ui_be == null or ui_st.ui_be.rect == null { return }
let n = Math.min(len(ui_st.ui_errs), 8)
let line = ui_px(ui_st, 26.0)
ui_st.ui_be.rect(0.0, 0.0, 4000.0, line * float(n) + ui_px(ui_st, 8.0), 4194304, 0.85)
for i in 0 .. n { ui_st.ui_be.text(ui_px(ui_st, 12.0), ui_px(ui_st, 6.0) + line * float(i), ui_st.ui_errs[len(ui_st.ui_errs) - n + i], ui_px(ui_st, 18.0), 16767449, 1.0) }
}