Commit 0215f40
committed
Restore lazy editor initialization - fixes SB.view nil errors
Removed upfront InitializeAllEditors() approach that was causing errors.
The problem:
1. widget.lua calls: SB.view = View()
2. Inside View() constructor, InitializeRmlUi() is called
3. InitializeRmlUi() called InitializeAllEditors()
4. Editors are created, but SB.view hasn't been assigned yet
5. CollisionView, ObjectPropertyWindow try to access SB.view → nil error
The fix:
- Restore lazy initialization (create editors on-demand when clicked)
- OpenEditor() now creates editors on first use
- By then, SB.view has been assigned in widget.lua
- No more nil access errors
This matches the original Chili architecture where editors are created
when users click buttons, not during View initialization.
Fixes: "attempt to index field 'view' (a nil value)" in collision_window.lua:2871 parent 5888f38 commit 0215f40
1 file changed
+15
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 82 | | |
106 | 83 | | |
107 | 84 | | |
| |||
365 | 342 | | |
366 | 343 | | |
367 | 344 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
373 | 355 | | |
374 | 356 | | |
| 357 | + | |
375 | 358 | | |
376 | 359 | | |
377 | 360 | | |
| |||
0 commit comments