@@ -37,11 +37,11 @@ public EditorSidebar(WindowManager windowManager, EditorState editorState, Map m
3737
3838 static List < string > sidebarModeNames = new List < string >
3939 {
40+ "Buildings" ,
4041 "Infantry" ,
4142 "Vehicles" ,
4243 "Aircraft" ,
4344 "Naval" ,
44- "Buildings" ,
4545 "Terrain Objects" ,
4646 "Overlays" ,
4747 "Smudges"
@@ -70,6 +70,10 @@ public override void Initialize()
7070 AddChild ( lbSelection ) ;
7171 lbSelection . EnableScrollbar = false ;
7272
73+ var buildingListPanel = new BuildingListPanel ( WindowManager , editorState , map , theaterGraphics , cursorActionTarget ) ;
74+ buildingListPanel . Name = nameof ( buildingListPanel ) ;
75+ InitPanel ( buildingListPanel ) ;
76+
7377 var infantryListPanel = new InfantryListPanel ( WindowManager , editorState , map , theaterGraphics , cursorActionTarget ) ;
7478 infantryListPanel . Name = nameof ( infantryListPanel ) ;
7579 InitPanel ( infantryListPanel ) ;
@@ -86,10 +90,6 @@ public override void Initialize()
8690 navalUnitListPanel . Name = nameof ( navalUnitListPanel ) ;
8791 InitPanel ( navalUnitListPanel ) ;
8892
89- var buildingListPanel = new BuildingListPanel ( WindowManager , editorState , map , theaterGraphics , cursorActionTarget ) ;
90- buildingListPanel . Name = nameof ( buildingListPanel ) ;
91- InitPanel ( buildingListPanel ) ;
92-
9393 var terrainObjectListPanel = new TerrainObjectListPanel ( WindowManager , editorState , map , theaterGraphics , cursorActionTarget ) ;
9494 terrainObjectListPanel . Name = nameof ( terrainObjectListPanel ) ;
9595 InitPanel ( terrainObjectListPanel ) ;
@@ -104,11 +104,11 @@ public override void Initialize()
104104
105105 modePanels = new XNAPanel [ ]
106106 {
107+ buildingListPanel ,
107108 infantryListPanel ,
108109 unitListPanel ,
109110 aircraftListPanel ,
110111 navalUnitListPanel ,
111- buildingListPanel ,
112112 terrainObjectListPanel ,
113113 overlayListPanel ,
114114 smudgeListPanel
@@ -121,11 +121,11 @@ public override void Initialize()
121121 // This is less extensible than using events, but with events we'd have to store
122122 // the delegates to be able to unsubscribe from them later on.
123123 // Thus, this results in neater code.
124+ KeyboardCommands . Instance . BuildingMenu . Action = ( ) => lbSelection . SelectedIndex = ( int ) SidebarMode . Buildings ;
124125 KeyboardCommands . Instance . InfantryMenu . Action = ( ) => lbSelection . SelectedIndex = ( int ) SidebarMode . Infantry ;
125126 KeyboardCommands . Instance . VehicleMenu . Action = ( ) => lbSelection . SelectedIndex = ( int ) SidebarMode . Vehicles ;
126127 KeyboardCommands . Instance . AircraftMenu . Action = ( ) => lbSelection . SelectedIndex = ( int ) SidebarMode . Aircraft ;
127128 KeyboardCommands . Instance . NavalMenu . Action = ( ) => lbSelection . SelectedIndex = ( int ) SidebarMode . Naval ;
128- KeyboardCommands . Instance . BuildingMenu . Action = ( ) => lbSelection . SelectedIndex = ( int ) SidebarMode . Buildings ;
129129 KeyboardCommands . Instance . TerrainObjectMenu . Action = ( ) => lbSelection . SelectedIndex = ( int ) SidebarMode . TerrainObjects ;
130130 KeyboardCommands . Instance . OverlayMenu . Action = ( ) => lbSelection . SelectedIndex = ( int ) SidebarMode . Overlay ;
131131 KeyboardCommands . Instance . SmudgeMenu . Action = ( ) => lbSelection . SelectedIndex = ( int ) SidebarMode . Smudges ;
0 commit comments