Commit 5605e26
committed
Implement RmlUi GridView support for Objects tab
This implements full dual-mode (Chili + RmlUi) support for GridView,
enabling the Objects tab (Units/Features) and other grid-based UIs
to work in RmlUi mode.
GridView Changes:
- Split initialization into _InitRmlUi() and _InitChili() methods
- Added wrapper methods to hide layoutPanel access from subclasses:
* ClearChildren(), AddChildItem(), GetChildItem(), Invalidate()
- Updated all public API methods for dual-mode support:
* GetSelectedItems(), SelectItem(), DeselectAll()
* StartMultiModify(), EndMultiModify()
* GetControl() returns placeholder in RmlUi mode
- Created RmlUi-compatible item abstraction in NewItem() and AddItem()
* Items are simple tables in RmlUi mode, Chili controls in Chili mode
* Added SetImage() wrapper method to items
- Implemented _UpdateRmlUiGrid() for DOM rendering
- Added _OnRmlUiItemClick() with selection and double-click support
- RmlUi grids use HTML/CSS flexbox layout instead of Chili LayoutPanel
Subclass Updates:
- ObjectDefsPanel: Use wrapper methods instead of direct layoutPanel access
* Updated FilterItems(), GetObjectDefID(), AddDrawIcon()
* item.SetImage() instead of item.imgCtrl.file assignment
- AssetView: Made double-click and showPath UI Chili-only
- SavedBrushes: Updated OnBrushImageUpdated() to use item:SetImage()
Editor Integration:
- _FinalizeRmlUi() and _FinalizeRmlUiNew() generate grid container div
- View:OpenEditor() triggers grid update after rendering
- ObjectDefsView stores gridView reference for rendering
CSS:
- Added .grid-container, .grid-item styles with flexbox layout
- Grid items show hover, selected states
- Proper image and label styling within grid items
This maintains full backward compatibility with Chili mode while
enabling the critical Objects tab functionality in RmlUi.1 parent 9f5b9b9 commit 5605e26
File tree
8 files changed
+461
-146
lines changed- scen_edit/view
- map
- object
- rcss
8 files changed
+461
-146
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | | - | |
| 37 | + | |
36 | 38 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | | - | |
| 44 | + | |
43 | 45 | | |
44 | | - | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| |||
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
116 | | - | |
| 121 | + | |
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
889 | | - | |
890 | | - | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
891 | 897 | | |
892 | 898 | | |
893 | 899 | | |
| |||
937 | 943 | | |
938 | 944 | | |
939 | 945 | | |
940 | | - | |
941 | | - | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
942 | 954 | | |
943 | 955 | | |
944 | 956 | | |
| |||
0 commit comments