Commit 3574790
committed
Add button compatibility layer for RmlUi editors
Buttons (TabbedPanelButton and Button:New) now work automagically in both
Chili and RmlUi modes through the compatibility layer.
Changes:
- Add button compatibility layer in rmlui_field_compat.lua
- RmlUiTabbedPanelButton: Action buttons (Add, Set, Smooth, etc.)
- RmlUiButton: Regular buttons added via AddControl()
- Override TabbedPanelButton(), Button.New() to create RmlUi buttons
- Buttons store OnClick handlers, captions, images, tooltips
- SetPressedState() updates button CSS class when pressed
- Update Editor:_FinalizeRmlUi() to process buttons from children
- Extract action buttons and regular buttons from children array
- Generate HTML for action buttons panel at top of editor
- Generate HTML for regular buttons within fields section
- Store buttons for event binding
- Update View:BindFieldEvents() to bind button click events
- Bind action button clicks to their OnClick handlers
- Bind regular button clicks to their OnClick handlers
- Use CallListeners() to invoke handlers
- Add CSS styling for action buttons
- .action-buttons-panel: Horizontal button strip at editor top
- .action-button: 70x70dp buttons with icon + label
- .action-button.pressed: Green highlight when active
- .action-button-icon and .action-button-label styling
- Delete unused RmlUi editor files
- rmlui_editor_base.lua: Separate editor approach not used
- rmlui_components.lua: Empty editor stubs not used
- Keep rmlui_component.lua (used by picker windows)
All existing editors (heightmap, metal, grass, texture, etc.) now have
their action buttons working in RmlUi mode without any code changes.1 parent 330afc3 commit 3574790
File tree
6 files changed
+253
-402
lines changed- scen_edit/view
- rcss
6 files changed
+253
-402
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
729 | | - | |
730 | | - | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
731 | 748 | | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
732 | 761 | | |
733 | 762 | | |
734 | 763 | | |
735 | 764 | | |
736 | 765 | | |
737 | | - | |
| 766 | + | |
738 | 767 | | |
739 | | - | |
740 | | - | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
741 | 775 | | |
742 | 776 | | |
743 | 777 | | |
744 | 778 | | |
745 | | - | |
746 | | - | |
| 779 | + | |
| 780 | + | |
747 | 781 | | |
748 | 782 | | |
749 | 783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
211 | 268 | | |
212 | 269 | | |
213 | 270 | | |
| |||
This file was deleted.
0 commit comments