|
| 1 | +# SpringBoard Full RmlUi Conversion Status |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This document tracks the complete conversion of SpringBoard from Chili to RmlUi. This is a **proper full conversion** - not a compatibility layer, but a complete rewrite to use RmlUi as intended. |
| 6 | + |
| 7 | +## Conversion Approach |
| 8 | + |
| 9 | +### Proper RmlUi Usage |
| 10 | + |
| 11 | +RmlUi is designed around: |
| 12 | +1. **RML Templates** - HTML-like markup for UI structure |
| 13 | +2. **RCSS Stylesheets** - CSS-like styling |
| 14 | +3. **Lua Logic** - Event handling and business logic only |
| 15 | + |
| 16 | +This is fundamentally different from Chili's programmatic Lua-only approach. |
| 17 | + |
| 18 | +### Conversion Pattern |
| 19 | + |
| 20 | +For each component: |
| 21 | +1. Create RML template with proper structure |
| 22 | +2. Create/update RCSS for styling |
| 23 | +3. Convert Lua code to load RML and bind events |
| 24 | +4. Remove all programmatic UI creation |
| 25 | + |
| 26 | +## Progress |
| 27 | + |
| 28 | +### Core Infrastructure ✅ COMPLETE |
| 29 | + |
| 30 | +- [x] RmlUi Manager (`scen_edit/view_rmlui/rmlui_manager.lua`) |
| 31 | + - Context creation and lifecycle |
| 32 | + - Document loading |
| 33 | + - Input event routing |
| 34 | + - Rendering integration |
| 35 | + |
| 36 | +- [x] RmlUi Widget (`LuaUI/widgets/api_sb_rmlui.lua`) |
| 37 | + - Spring integration |
| 38 | + - Input forwarding |
| 39 | + - Rendering hooks |
| 40 | + |
| 41 | +- [x] Main UI Template (`scen_edit/view_rmlui/rml/springboard_main.rml`) |
| 42 | + - Complete UI structure in RML |
| 43 | + - Top menu, team selector, tabbed window, bottom bar |
| 44 | + - All major UI elements defined |
| 45 | + |
| 46 | +- [x] Main Stylesheet (`scen_edit/view_rmlui/rcss/springboard.rcss`) |
| 47 | + - Complete styling for all UI elements |
| 48 | + - Dark theme matching original Chili appearance |
| 49 | + - Responsive layout with flexbox |
| 50 | + |
| 51 | +### View System ✅ COMPLETE |
| 52 | + |
| 53 | +- [x] ViewRmlUi class (`scen_edit/view_rmlui/view_rmlui.lua`) |
| 54 | + - Loads main RML template |
| 55 | + - Initializes all UI subsystems |
| 56 | + - Event binding for top menu |
| 57 | + - Team selector integration |
| 58 | + - Bottom bar integration |
| 59 | + - Proper lifecycle management |
| 60 | + |
| 61 | +### Dialogs ✅ COMPLETE |
| 62 | + |
| 63 | +- [x] Base Dialog (`scen_edit/view_rmlui/dialog/rmlui_dialog.lua`) |
| 64 | +- [x] New Project Dialog (`scen_edit/view_rmlui/dialog/rmlui_new_project_dialog.lua`) |
| 65 | +- [x] File Dialog (`scen_edit/view_rmlui/dialog/rmlui_file_dialog.lua`) |
| 66 | +- [x] Save Project Dialog (`scen_edit/view_rmlui/dialog/rmlui_save_project_dialog.lua`) |
| 67 | +- [x] Open Project Dialog (`scen_edit/view_rmlui/dialog/rmlui_open_project_dialog.lua`) |
| 68 | +- [x] RML templates for all dialogs |
| 69 | +- [x] RCSS styling (`scen_edit/view_rmlui/rcss/dialog.rcss`) |
| 70 | + |
| 71 | +### Main UI Components 🚧 IN PROGRESS |
| 72 | + |
| 73 | +- [x] Top Left Menu (integrated in main template) |
| 74 | + - [x] Exit button |
| 75 | + - [x] Menu/Lobby button |
| 76 | + - [x] Upload Log button |
| 77 | + - [x] Data Directory button |
| 78 | + - [x] Project menu (New, Open, Save, Quick Save) |
| 79 | + |
| 80 | +- [x] Team Selector (integrated in main template) |
| 81 | + - [x] Team dropdown |
| 82 | + - [x] Lock team checkbox |
| 83 | + |
| 84 | +- [x] Bottom Bar (integrated in main template) |
| 85 | + - [x] Status window |
| 86 | + - [x] Command window (structure) |
| 87 | + - [x] Control buttons (Play/Pause) |
| 88 | + |
| 89 | +- [ ] Tabbed Window **NEEDS WORK** |
| 90 | + - [x] Structure in RML |
| 91 | + - [ ] Editor registration system |
| 92 | + - [ ] Tab switching logic |
| 93 | + - [ ] Dynamic tab creation |
| 94 | + |
| 95 | +- [ ] Selection Manager **NEEDS CONVERSION** |
| 96 | + - [ ] Convert to RmlUi |
| 97 | + - [ ] RML template |
| 98 | + - [ ] Event binding |
| 99 | + |
| 100 | +- [ ] Model Shaders **NEEDS CONVERSION** |
| 101 | + - [ ] Convert to RmlUi |
| 102 | + - [ ] RML template |
| 103 | + - [ ] Shader controls |
| 104 | + |
| 105 | +### Editor System ⏳ PENDING |
| 106 | + |
| 107 | +- [ ] Base Editor class |
| 108 | + - [ ] Convert to use RML templates |
| 109 | + - [ ] Field system integration with RmlUi |
| 110 | + - [ ] Registration system |
| 111 | + |
| 112 | +- [ ] Field Types (15+ types) |
| 113 | + - [ ] NumericField |
| 114 | + - [ ] StringField |
| 115 | + - [ ] BooleanField |
| 116 | + - [ ] ColorField |
| 117 | + - [ ] AssetField |
| 118 | + - [ ] ObjectField |
| 119 | + - [ ] TeamField |
| 120 | + - [ ] GroupField |
| 121 | + - [ ] ArrayField |
| 122 | + - [ ] ChoiceField |
| 123 | + - [ ] MaterialField |
| 124 | + - [ ] UnitTypeField |
| 125 | + - [ ] FeatureTypeField |
| 126 | + - [ ] Others... |
| 127 | + |
| 128 | +### Map Editors ⏳ PENDING |
| 129 | + |
| 130 | +- [ ] HeightmapEditor |
| 131 | +- [ ] TextureEditor |
| 132 | +- [ ] WaterEditor |
| 133 | +- [ ] GrassEditor |
| 134 | +- [ ] MetalEditor |
| 135 | +- [ ] LightingEditor |
| 136 | +- [ ] SkyEditor |
| 137 | +- [ ] TerrainSettingsEditor |
| 138 | +- [ ] DNTSEditor |
| 139 | +- [ ] MaterialBrowser |
| 140 | +- [ ] BrushDrawer |
| 141 | +- [ ] SavedBrushes |
| 142 | + |
| 143 | +### Object Editors ⏳ PENDING |
| 144 | + |
| 145 | +- [ ] ObjectPropertyWindow |
| 146 | +- [ ] ObjectDefsView |
| 147 | +- [ ] ObjectDefsPanel |
| 148 | +- [ ] CollisionWindow |
| 149 | +- [ ] AnimationsView |
| 150 | + |
| 151 | +### Trigger System ⏳ PENDING |
| 152 | + |
| 153 | +- [ ] TriggersWindow |
| 154 | +- [ ] TriggerWindow |
| 155 | +- [ ] EventWindow |
| 156 | +- [ ] ConditionWindow |
| 157 | +- [ ] ActionWindow |
| 158 | +- [ ] VariablesWindow |
| 159 | +- [ ] AreasWindow |
| 160 | +- [ ] RuntimeView |
| 161 | +- [ ] DebugVariableView |
| 162 | +- [ ] CustomWindow |
| 163 | +- [ ] Trigger field types |
| 164 | + - [ ] TriggerField |
| 165 | + - [ ] TriggerDataTypeField |
| 166 | + - [ ] FunctionField |
| 167 | + - [ ] NumericComparisonField |
| 168 | + - [ ] IdentityComparisonField |
| 169 | + - [ ] OrderWindow |
| 170 | + |
| 171 | +### General Editors ⏳ PENDING |
| 172 | + |
| 173 | +- [ ] PlayersWindow |
| 174 | +- [ ] PlayerWindow |
| 175 | +- [ ] DiplomacyWindow |
| 176 | +- [ ] ScenarioInfoView |
| 177 | + |
| 178 | +### Actions ⏳ PENDING |
| 179 | + |
| 180 | +- [ ] All action UI components (14 files) |
| 181 | + |
| 182 | +### Other Components ⏳ PENDING |
| 183 | + |
| 184 | +- [ ] AssetView |
| 185 | +- [ ] Clipboard (already loaded, may need updates) |
| 186 | + |
| 187 | +## Statistics |
| 188 | + |
| 189 | +| Category | Total Files | Converted | Remaining | |
| 190 | +|----------|-------------|-----------|-----------| |
| 191 | +| Core Infrastructure | 2 | 2 | 0 | |
| 192 | +| View System | 1 | 1 | 0 | |
| 193 | +| Dialogs | 8 | 5 | 3 | |
| 194 | +| Main UI | 6 | 3 | 3 | |
| 195 | +| Editors | 1 | 0 | 1 | |
| 196 | +| Fields | 15 | 0 | 15 | |
| 197 | +| Map Editors | 12 | 0 | 12 | |
| 198 | +| Object Editors | 5 | 0 | 5 | |
| 199 | +| Trigger System | 15 | 0 | 15 | |
| 200 | +| General Editors | 4 | 0 | 4 | |
| 201 | +| Actions | 14 | 0 | 14 | |
| 202 | +| Other | 21 | 0 | 21 | |
| 203 | +| **TOTAL** | **104** | **11** | **93** | |
| 204 | + |
| 205 | +**Conversion Progress: 11% (11/104 files)** |
| 206 | + |
| 207 | +## How to Complete Conversion |
| 208 | + |
| 209 | +### For Each Component: |
| 210 | + |
| 211 | +1. **Analyze Chili Code** |
| 212 | + - Understand UI structure |
| 213 | + - Identify dynamic elements |
| 214 | + - Map event handlers |
| 215 | + |
| 216 | +2. **Create RML Template** |
| 217 | + ```xml |
| 218 | + <rml> |
| 219 | + <head> |
| 220 | + <title>Component Name</title> |
| 221 | + <link type="text/rcss" href="component.rcss"/> |
| 222 | + </head> |
| 223 | + <body> |
| 224 | + <!-- UI structure here --> |
| 225 | + </body> |
| 226 | + </rml> |
| 227 | + ``` |
| 228 | + |
| 229 | +3. **Create/Update RCSS** |
| 230 | + ```css |
| 231 | + .component-class { |
| 232 | + /* Styling here */ |
| 233 | + } |
| 234 | + ``` |
| 235 | + |
| 236 | +4. **Convert Lua Code** |
| 237 | + ```lua |
| 238 | + -- Load RML |
| 239 | + local doc = SB.rmlui:LoadDocument(rmlPath, true) |
| 240 | + |
| 241 | + -- Get elements |
| 242 | + local button = doc:GetElementById("my-button") |
| 243 | + |
| 244 | + -- Bind events |
| 245 | + button:AddEventListener("click", function() |
| 246 | + -- Handle click |
| 247 | + end) |
| 248 | + ``` |
| 249 | + |
| 250 | +5. **Test Functionality** |
| 251 | + |
| 252 | +6. **Remove Old Chili Code** |
| 253 | + |
| 254 | +### Example Conversion |
| 255 | + |
| 256 | +**Before (Chili):** |
| 257 | +```lua |
| 258 | +local window = Window:New{ |
| 259 | + parent = screen0, |
| 260 | + children = { |
| 261 | + Button:New{ |
| 262 | + caption = "Click", |
| 263 | + OnClick = {function() DoSomething() end} |
| 264 | + } |
| 265 | + } |
| 266 | +} |
| 267 | +``` |
| 268 | + |
| 269 | +**After (RmlUi):** |
| 270 | + |
| 271 | +`component.rml`: |
| 272 | +```xml |
| 273 | +<body> |
| 274 | + <button id="my-button">Click</button> |
| 275 | +</body> |
| 276 | +``` |
| 277 | + |
| 278 | +`component.lua`: |
| 279 | +```lua |
| 280 | +local doc = SB.rmlui:LoadDocument("component.rml", true) |
| 281 | +local btn = doc:GetElementById("my-button") |
| 282 | +btn:AddEventListener("click", function() |
| 283 | + DoSomething() |
| 284 | +end) |
| 285 | +``` |
| 286 | + |
| 287 | +## Integration |
| 288 | + |
| 289 | +### Current State |
| 290 | + |
| 291 | +- RmlUi system is initialized but not fully integrated |
| 292 | +- ViewRmlUi is created but not used by default |
| 293 | +- Chili system still active as fallback |
| 294 | + |
| 295 | +### To Activate RmlUi |
| 296 | + |
| 297 | +Modify `scen_edit/widget.lua` to use RmlUi: |
| 298 | + |
| 299 | +```lua |
| 300 | +-- Replace: |
| 301 | +SB.Include(Path.Join(SB.DIRS.SRC, 'view/view.lua')) |
| 302 | +SB.view = View() |
| 303 | + |
| 304 | +-- With: |
| 305 | +if SB.Include(Path.Join(SB.DIRS.SRC, 'view_rmlui/init_rmlui.lua')) then |
| 306 | + SB.view = ViewRmlUi() |
| 307 | +else |
| 308 | + -- Fallback to Chili |
| 309 | + SB.Include(Path.Join(SB.DIRS.SRC, 'view/view.lua')) |
| 310 | + SB.view = View() |
| 311 | +end |
| 312 | +``` |
| 313 | + |
| 314 | +## Testing |
| 315 | + |
| 316 | +### Requirements |
| 317 | + |
| 318 | +- BAR Engine 105.1.1+ or Recoil Engine |
| 319 | +- RmlUi widget must be active (`api_sb_rmlui.lua`) |
| 320 | + |
| 321 | +### Test Plan |
| 322 | + |
| 323 | +1. Launch SpringBoard with BAR Engine |
| 324 | +2. Verify main UI loads from RML |
| 325 | +3. Test all menu buttons |
| 326 | +4. Test dialogs (New/Open/Save Project) |
| 327 | +5. Test team selector |
| 328 | +6. Test bottom bar controls |
| 329 | +7. Verify no Lua errors in console |
| 330 | + |
| 331 | +## Known Issues |
| 332 | + |
| 333 | +### Current Limitations |
| 334 | + |
| 335 | +1. **Tabbed Window**: Editor registration not fully implemented |
| 336 | +2. **Selection Manager**: Still uses Chili, needs conversion |
| 337 | +3. **Model Shaders**: Still uses Chili, needs conversion |
| 338 | +4. **Field System**: Not converted, editors won't work yet |
| 339 | +5. **Export/Import**: Disabled pending conversion |
| 340 | + |
| 341 | +### Blockers for Full Activation |
| 342 | + |
| 343 | +- Editor system must be converted |
| 344 | +- Field types must be converted |
| 345 | +- At least basic map editors needed |
| 346 | + |
| 347 | +## Next Steps |
| 348 | + |
| 349 | +### Immediate Priority |
| 350 | + |
| 351 | +1. Complete Tabbed Window implementation |
| 352 | +2. Convert Editor base class |
| 353 | +3. Convert basic field types (Numeric, String, Boolean) |
| 354 | +4. Convert one complete editor as example (e.g., HeightmapEditor) |
| 355 | + |
| 356 | +### Medium Priority |
| 357 | + |
| 358 | +5. Convert Selection Manager |
| 359 | +6. Convert Model Shaders |
| 360 | +7. Convert remaining field types |
| 361 | +8. Convert map editors |
| 362 | + |
| 363 | +### Long Term |
| 364 | + |
| 365 | +9. Convert object editors |
| 366 | +10. Convert trigger system |
| 367 | +11. Convert general editors |
| 368 | +12. Remove all Chili code |
| 369 | +13. Delete Chili widget |
| 370 | + |
| 371 | +## Success Criteria |
| 372 | + |
| 373 | +Conversion is complete when: |
| 374 | + |
| 375 | +- ✅ All 104 view files converted to RmlUi |
| 376 | +- ✅ No Chili code remaining |
| 377 | +- ✅ All UI functionality working |
| 378 | +- ✅ luacheck passes |
| 379 | +- ✅ Tested on BAR Engine |
| 380 | +- ✅ Documentation complete |
| 381 | +- ✅ Performance equal or better than Chili |
| 382 | + |
| 383 | +## Resources |
| 384 | + |
| 385 | +- **RmlUi Docs**: https://mikke89.github.io/RmlUiDoc/ |
| 386 | +- **Conversion Guide**: `RMLUI_CONVERSION.md` |
| 387 | +- **RmlUi README**: `scen_edit/view_rmlui/README.md` |
| 388 | + |
| 389 | +--- |
| 390 | + |
| 391 | +**Last Updated**: 2025-11-05 |
| 392 | +**Status**: 11% Complete (11/104 files) |
| 393 | +**Branch**: `claude/springboard-rmlui-conversion-011CUooEurKLbWKUu8vygDUw` |
0 commit comments