Skip to content

Commit 41e64b9

Browse files
committed
Fix RMLui detection and graceful Chili fallback
Fixed two critical issues with RMLui integration: 1. **Incorrect RMLui detection**: - api_sb_rmlui.lua:21 was checking `Spring.RmlUi` instead of `RmlUi` - view.lua:6 had the same issue - The global `RmlUi` is the correct API (matches rml_setup2.lua and dbg_dev_console_rmlui.lua) 2. **Broken Chili fallback**: - rmlui_components.lua was loaded by IncludeDir during Chili fallback - It tried to extend RmlUiEditorBase without checking if it exists - Added guards to return early if RMLui base classes aren't loaded This ensures SpringBoard gracefully falls back to Chili UI when RMLui is not available.
1 parent 6343459 commit 41e64b9

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

LuaUI/widgets/api_sb_rmlui.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ local initialized = false
1818

1919
function widget:Initialize()
2020
-- Check if RmlUi is available
21-
if not Spring.RmlUi then
21+
if not RmlUi then
2222
Spring.Log("SpringBoard RmlUi", LOG.WARNING, "RmlUi not available in this Spring engine version")
2323
Spring.Log("SpringBoard RmlUi", LOG.WARNING, "Falling back to Chili UI (engine needs BAR 105.1.1+ for RmlUi)")
2424
widgetHandler:RemoveWidget(self)
2525
return false
2626
end
2727

28-
rmlui = Spring.RmlUi
28+
rmlui = RmlUi
2929
initialized = true
3030

3131
Spring.Log("SpringBoard RmlUi", LOG.NOTICE, "RmlUi Framework initialized")

scen_edit/view/rmlui_components.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
-- ALL EDITORS extend RmlUiEditorBase and use the generic template
66
-- They differ only in which fields they add programmatically
77

8+
-- Only define these classes if RmlUi infrastructure is loaded
9+
if not RmlUiEditorBase then
10+
return
11+
end
12+
813
-- General Windows
914
RmlUiScenarioInfoView = RmlUiEditorBase:extends{}
1015
function RmlUiScenarioInfoView:init()
@@ -175,6 +180,10 @@ function RmlUiCustomWindow:init()
175180
end
176181

177182
-- Dialog Variants - all use RmlUiFileDialog (100% programmatic)
183+
if not RmlUiFileDialog then
184+
return
185+
end
186+
178187
RmlUiImportFileDialog = RmlUiFileDialog:extends{}
179188
function RmlUiImportFileDialog:init(opts)
180189
opts = opts or {}

scen_edit/view/view.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ View = LCS.class{}
33
function View:init()
44
-- Try to initialize RmlUi if available
55
self.useRmlUi = false
6-
if Spring.RmlUi then
6+
if RmlUi then
77
-- Load RmlUi infrastructure
88
SB.Include(Path.Join(SB.DIRS.SRC, 'view/rmlui_manager.lua'))
99
SB.Include(Path.Join(SB.DIRS.SRC, 'view/rmlui_builder.lua'))

0 commit comments

Comments
 (0)