Skip to content

Commit 408254a

Browse files
committed
Add keyboard command for activating the Calculate Credits tool
1 parent a35ebd2 commit 408254a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: src/TSMapEditor/UI/KeyboardCommands.cs

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public KeyboardCommands()
4949
AdjustTileHeightDown,
5050
PlaceConnectedTile,
5151
RepeatConnectedTile,
52+
CalculateCredits,
5253

5354
BuildingMenu,
5455
InfantryMenu,
@@ -139,6 +140,7 @@ public void ClearCommandSubscriptions()
139140
public KeyboardCommand AdjustTileHeightDown { get; } = new KeyboardCommand("AdjustTileHeightDown", "Adjust Tile Height Down", new KeyboardCommandInput(Keys.PageDown, KeyboardModifiers.None), forActionsOnly:true);
140141
public KeyboardCommand PlaceConnectedTile { get; } = new KeyboardCommand("PlaceConnectedTile", "Place Connected Tile", new KeyboardCommandInput(Keys.D, KeyboardModifiers.Alt));
141142
public KeyboardCommand RepeatConnectedTile { get; } = new KeyboardCommand("RepeatConnectedTile", "Repeat Last Connected Tile", new KeyboardCommandInput(Keys.D, KeyboardModifiers.Ctrl));
143+
public KeyboardCommand CalculateCredits { get; } = new KeyboardCommand("CalculateCredits", "Calculate Credits", new KeyboardCommandInput(Keys.C, KeyboardModifiers.Shift));
142144

143145
public KeyboardCommand BuildingMenu { get; } = new KeyboardCommand("BuildingMenu", "Building Menu", new KeyboardCommandInput(Keys.D1, KeyboardModifiers.None));
144146
public KeyboardCommand InfantryMenu { get; } = new KeyboardCommand("InfantryMenu", "Infantry Menu", new KeyboardCommandInput(Keys.D2, KeyboardModifiers.None));

Diff for: src/TSMapEditor/UI/TopBar/TopBarMenu.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public override void Initialize()
217217
toolsContextMenu.AddItem("Check Distance...", () => mapUI.EditorState.CursorAction = checkDistanceCursorAction, null, null, null);
218218
toolsContextMenu.AddItem("Check Distance (Pathfinding)...", () => mapUI.EditorState.CursorAction = checkDistancePathfindingCursorAction);
219219
toolsContextMenu.AddItem(" ", null, () => false, null, null);
220-
toolsContextMenu.AddItem("Calculate Credits...", () => mapUI.EditorState.CursorAction = calculateTiberiumValueCursorAction, null, null, null);
220+
toolsContextMenu.AddItem("Calculate Credits...", () => mapUI.EditorState.CursorAction = calculateTiberiumValueCursorAction, null, null, null, KeyboardCommands.Instance.CalculateCredits.GetKeyDisplayString());
221221
toolsContextMenu.AddItem(" ", null, () => false, null, null);
222222
toolsContextMenu.AddItem("Load Map-Wide Overlay...", () => MapWideOverlayLoadRequested?.Invoke(this, EventArgs.Empty), null, null, null, null);
223223
toolsContextMenu.AddItem(" ", null, () => false, null, null);
@@ -260,6 +260,7 @@ public override void Initialize()
260260
KeyboardCommands.Instance.PlaceTunnel.Triggered += (s, e) => mapUI.EditorState.CursorAction = placeTubeCursorAction;
261261
KeyboardCommands.Instance.PlaceConnectedTile.Triggered += (s, e) => windowController.SelectConnectedTileWindow.Open();
262262
KeyboardCommands.Instance.RepeatConnectedTile.Triggered += (s, e) => RepeatLastConnectedTile();
263+
KeyboardCommands.Instance.CalculateCredits.Triggered += (s, e) => mapUI.EditorState.CursorAction = calculateTiberiumValueCursorAction;
263264
KeyboardCommands.Instance.Save.Triggered += (s, e) => SaveMap();
264265

265266
windowController.TerrainGeneratorConfigWindow.ConfigApplied += TerrainGeneratorConfigWindow_ConfigApplied;

0 commit comments

Comments
 (0)