Commit b091ddb
committed
Move RML generation to Editor:Finalize() method
Fixed architecture - RML is now generated when editor initializes, not when opened:
editor.lua changes:
- Editor:Finalize() now detects RmlUi mode and calls _FinalizeRmlUi()
- _FinalizeRmlUi() loops through fields, calls GenerateRml(), stores result
- Generated RML stored in editor.generatedRml
- Added ShowRmlUi() and HideRmlUi() methods for visibility
view.lua changes:
- OpenEditor() now uses pre-generated editor.generatedRml
- No longer generates RML on-the-fly
- Much cleaner - just displays what was already generated
This is the correct flow:
1. Editor constructor calls init()
2. Editor adds fields with AddField()
3. Editor calls Finalize() which:
- RmlUi mode: generates RML → editor.generatedRml
- Chili mode: creates Chili controls → editor.window
4. User clicks button → OpenEditor() displays editor.generatedRml
All field generation happens during editor initialization!1 parent d172d2b commit b091ddb
2 files changed
+62
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
118 | 127 | | |
119 | 128 | | |
120 | 129 | | |
| |||
655 | 664 | | |
656 | 665 | | |
657 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| 443 | + | |
443 | 444 | | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
456 | 453 | | |
457 | 454 | | |
458 | 455 | | |
459 | 456 | | |
460 | 457 | | |
461 | 458 | | |
462 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| |||
0 commit comments