Skip to content

Commit 786924d

Browse files
committed
Add RmlUi UI framework integration for SpringBoard dialogs
Implement RmlUi-based UI system as a modern replacement for the legacy Chili framework. This initial conversion focuses on dialog components as they are self-contained and easier to migrate independently. New Infrastructure: - RmlUi Manager (scen_edit/view_rmlui/rmlui_manager.lua) - Context creation and lifecycle management - Document loading and event routing - Input handling (mouse, keyboard) - Screen resize and rendering coordination - RmlUi Widget (LuaUI/widgets/api_sb_rmlui.lua) - Spring engine integration - Drawing and input event forwarding - Layer -999 for proper rendering order Dialog Conversions: - Base Dialog class with common functionality - Event binding (OK, Cancel, ESC, Enter) - Field value management - Error message display - Lifecycle management (Show/Hide/Close) - NewProjectDialog - Create new SpringBoard projects - Project name input and validation - Map selection with dynamic field visibility - Blank map size configuration - FileDialog - Base file browser dialog - File/directory listing - Single/double-click selection - File type filtering support - SaveProjectDialog - Save project dialog - OpenProjectDialog - Open project dialog with validation Templates & Styling: - RML templates (scen_edit/view_rmlui/rml/) - base_dialog.rml - Generic dialog template - new_project_dialog.rml - New project UI - file_dialog.rml - File browser UI - RCSS stylesheet (scen_edit/view_rmlui/rcss/dialog.rcss) - Dialog window styling - Form field styles - Button styles with hover states - Dark theme matching Chili appearance Documentation: - RMLUI_CONVERSION.md - Comprehensive conversion guide - Architecture overview - Migration checklist - API reference - Testing instructions - scen_edit/view_rmlui/README.md - Technical documentation - Directory structure - Component mapping - Usage examples - Known limitations Requirements: - BAR Engine 105.1.1+ or Recoil Engine (RmlUi not in standard Spring 104.x) - Chili UI framework remains for non-converted components Status: Phase 1 (Dialogs) complete, testing pending with BAR Engine
1 parent d8cc6f2 commit 786924d

14 files changed

+1945
-0
lines changed

LuaUI/widgets/api_sb_rmlui.lua

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
function widget:GetInfo()
2+
return {
3+
name = "RmlUi Framework (SpringBoard)",
4+
desc = "RmlUi UI framework integration for SpringBoard",
5+
author = "SpringBoard Team",
6+
date = "2025",
7+
license = "GPL",
8+
layer = -999, -- Draw before other widgets
9+
enabled = true
10+
}
11+
end
12+
13+
-- RmlUi integration for SpringBoard
14+
-- This widget provides RmlUi rendering and input handling
15+
16+
local rmlui
17+
local initialized = false
18+
19+
function widget:Initialize()
20+
-- Check if RmlUi is available
21+
if not Spring.RmlUi then
22+
Spring.Log("SpringBoard RmlUi", LOG.WARNING, "RmlUi not available in this Spring engine version")
23+
widgetHandler:RemoveWidget(self)
24+
return false
25+
end
26+
27+
rmlui = Spring.RmlUi
28+
initialized = true
29+
30+
Spring.Log("SpringBoard RmlUi", LOG.NOTICE, "RmlUi Framework initialized")
31+
return true
32+
end
33+
34+
function widget:Shutdown()
35+
initialized = false
36+
end
37+
38+
function widget:ViewResize(vsx, vsy)
39+
if not initialized then
40+
return
41+
end
42+
43+
-- Update RmlUi context dimensions
44+
if SB and SB.rmlui then
45+
SB.rmlui:UpdateDimensions()
46+
end
47+
end
48+
49+
function widget:DrawScreen()
50+
if not initialized then
51+
return
52+
end
53+
54+
-- Render RmlUi context
55+
if SB and SB.rmlui then
56+
SB.rmlui:Render()
57+
end
58+
end
59+
60+
function widget:MouseMove(x, y, dx, dy, button)
61+
if not initialized then
62+
return false
63+
end
64+
65+
if SB and SB.rmlui then
66+
return SB.rmlui:MouseMove(x, y, dx, dy)
67+
end
68+
69+
return false
70+
end
71+
72+
function widget:MousePress(x, y, button)
73+
if not initialized then
74+
return false
75+
end
76+
77+
if SB and SB.rmlui then
78+
return SB.rmlui:MouseButton(x, y, button, true)
79+
end
80+
81+
return false
82+
end
83+
84+
function widget:MouseRelease(x, y, button)
85+
if not initialized then
86+
return false
87+
end
88+
89+
if SB and SB.rmlui then
90+
return SB.rmlui:MouseButton(x, y, button, false)
91+
end
92+
93+
return false
94+
end
95+
96+
function widget:MouseWheel(up, value)
97+
if not initialized then
98+
return false
99+
end
100+
101+
-- RmlUi mouse wheel handling would go here
102+
-- Implementation depends on RmlUi API availability
103+
104+
return false
105+
end
106+
107+
function widget:KeyPress(key, mods, isRepeat, label, unicode)
108+
if not initialized then
109+
return false
110+
end
111+
112+
if SB and SB.rmlui then
113+
local handled = SB.rmlui:KeyEvent(key, true, mods)
114+
if handled then
115+
return true
116+
end
117+
118+
-- Handle text input
119+
if unicode and unicode > 0 then
120+
return SB.rmlui:TextInput(unicode)
121+
end
122+
end
123+
124+
return false
125+
end
126+
127+
function widget:KeyRelease(key, mods, label, unicode)
128+
if not initialized then
129+
return false
130+
end
131+
132+
if SB and SB.rmlui then
133+
return SB.rmlui:KeyEvent(key, false, mods)
134+
end
135+
136+
return false
137+
end
138+
139+
-- Expose RmlUi to other widgets
140+
function widget:GetRmlUi()
141+
return rmlui
142+
end

0 commit comments

Comments
 (0)