Skip to content

Commit 4ff8706

Browse files
committed
Move the buildings sidebar tab on top
1 parent b9a9588 commit 4ff8706

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/TSMapEditor/UI/KeyboardCommands.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public KeyboardCommands()
5050
PlaceConnectedTile,
5151
RepeatConnectedTile,
5252

53+
BuildingMenu,
5354
InfantryMenu,
5455
VehicleMenu,
5556
AircraftMenu,
5657
NavalMenu,
57-
BuildingMenu,
5858
TerrainObjectMenu,
5959
OverlayMenu,
6060
SmudgeMenu
@@ -140,11 +140,11 @@ public void ClearCommandSubscriptions()
140140
public KeyboardCommand PlaceConnectedTile { get; } = new KeyboardCommand("PlaceConnectedTile", "Place Connected Tile", new KeyboardCommandInput(Keys.D, KeyboardModifiers.Alt));
141141
public KeyboardCommand RepeatConnectedTile { get; } = new KeyboardCommand("RepeatConnectedTile", "Repeat Last Connected Tile", new KeyboardCommandInput(Keys.D, KeyboardModifiers.Ctrl));
142142

143-
public KeyboardCommand InfantryMenu { get; } = new KeyboardCommand("InfantryMenu", "Infantry Menu", new KeyboardCommandInput(Keys.D1, KeyboardModifiers.None));
144-
public KeyboardCommand VehicleMenu { get; } = new KeyboardCommand("VehicleMenu", "Vehicle Menu", new KeyboardCommandInput(Keys.D2, KeyboardModifiers.None));
145-
public KeyboardCommand AircraftMenu { get; } = new KeyboardCommand("AircraftMenu", "Aircraft Menu", new KeyboardCommandInput(Keys.D3, KeyboardModifiers.None));
146-
public KeyboardCommand NavalMenu { get; } = new KeyboardCommand("NavalMenu", "Naval Menu", new KeyboardCommandInput(Keys.D4, KeyboardModifiers.None));
147-
public KeyboardCommand BuildingMenu { get; } = new KeyboardCommand("BuildingMenu", "Building Menu", new KeyboardCommandInput(Keys.D5, KeyboardModifiers.None));
143+
public KeyboardCommand BuildingMenu { get; } = new KeyboardCommand("BuildingMenu", "Building Menu", new KeyboardCommandInput(Keys.D1, KeyboardModifiers.None));
144+
public KeyboardCommand InfantryMenu { get; } = new KeyboardCommand("InfantryMenu", "Infantry Menu", new KeyboardCommandInput(Keys.D2, KeyboardModifiers.None));
145+
public KeyboardCommand VehicleMenu { get; } = new KeyboardCommand("VehicleMenu", "Vehicle Menu", new KeyboardCommandInput(Keys.D3, KeyboardModifiers.None));
146+
public KeyboardCommand AircraftMenu { get; } = new KeyboardCommand("AircraftMenu", "Aircraft Menu", new KeyboardCommandInput(Keys.D4, KeyboardModifiers.None));
147+
public KeyboardCommand NavalMenu { get; } = new KeyboardCommand("NavalMenu", "Naval Menu", new KeyboardCommandInput(Keys.D5, KeyboardModifiers.None));
148148
public KeyboardCommand TerrainObjectMenu { get; } = new KeyboardCommand("TerrainObjectMenu", "Terrain Objects Menu", new KeyboardCommandInput(Keys.D6, KeyboardModifiers.None));
149149
public KeyboardCommand OverlayMenu { get; } = new KeyboardCommand("OverlayMenu", "Overlay Menu", new KeyboardCommandInput(Keys.D7, KeyboardModifiers.None));
150150
public KeyboardCommand SmudgeMenu { get; } = new KeyboardCommand("SmudgeMenu", "Smudge Menu", new KeyboardCommandInput(Keys.D8, KeyboardModifiers.None));

src/TSMapEditor/UI/Sidebar/EditorSidebar.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

src/TSMapEditor/UI/Sidebar/SidebarMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace TSMapEditor.UI.Sidebar
55
/// </summary>
66
public enum SidebarMode
77
{
8+
Buildings,
89
Infantry,
910
Vehicles,
1011
Aircraft,
1112
Naval,
12-
Buildings,
1313
TerrainObjects,
1414
Overlay,
1515
Smudges,

0 commit comments

Comments
 (0)