Commit e73dbfe
committed
Use SB.delay for editor initialization like Chili does
Found the correct mechanism! Chili uses SB.delay() in main_window_panel.lua
to defer editor creation until after SB.view is assigned.
SB.delay(func) defers execution until the next GameFrame, ensuring:
1. View() constructor completes
2. SB.view = View() is assigned in widget.lua
3. THEN editors are created (can safely access SB.view)
Changes:
- Added PreCreateAllEditors() that uses SB.delay() for all editors
- Called from InitializeRmlUi() to match Chili's upfront initialization
- Removes lazy creation in OpenEditor() - editors should already exist
- Catches errors early while avoiding SB.view nil issues
This is the proper architecture, matching the original Chili approach.1 parent 0215f40 commit e73dbfe
1 file changed
+24
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
82 | 100 | | |
83 | 101 | | |
84 | 102 | | |
| |||
326 | 344 | | |
327 | 345 | | |
328 | 346 | | |
329 | | - | |
| 347 | + | |
330 | 348 | | |
331 | 349 | | |
332 | 350 | | |
| |||
342 | 360 | | |
343 | 361 | | |
344 | 362 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
355 | 368 | | |
356 | 369 | | |
357 | | - | |
358 | 370 | | |
359 | 371 | | |
360 | 372 | | |
| |||
0 commit comments