Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 780c69c

Browse files
committed
Renamed Direction enum to Directions, for consistency. Also added the Any direction for future use
1 parent e72627f commit 780c69c

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

Menus/InventoryMenuGUI.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -928,18 +928,18 @@ namespace RTE {
928928
}
929929

930930
GUIButton *nextButtonToHighlight = nullptr;
931-
Direction pressedDirection = GetNonMouseButtonControllerMovement();
931+
Directions pressedDirection = GetNonMouseButtonControllerMovement();
932932
switch (pressedDirection) {
933-
case Direction::Up:
933+
case Directions::Up:
934934
nextButtonToHighlight = HandleNonMouseUpInput();
935935
break;
936-
case Direction::Down:
936+
case Directions::Down:
937937
nextButtonToHighlight = HandleNonMouseDownInput();
938938
break;
939-
case Direction::Left:
939+
case Directions::Left:
940940
nextButtonToHighlight = HandleNonMouseLeftInput();
941941
break;
942-
case Direction::Right:
942+
case Directions::Right:
943943
nextButtonToHighlight = HandleNonMouseRightInput();
944944
break;
945945
default:
@@ -955,14 +955,14 @@ namespace RTE {
955955
m_NonMouseHighlightedButton->OnMouseLeave(0, 0, 0, 0);
956956
m_NonMouseHighlightedButton = nextButtonToHighlight;
957957
m_NonMouseHighlightedButton->OnMouseEnter(0, 0, 0, 0);
958-
} else if (!nextButtonToHighlight && pressedDirection != Direction::None) {
958+
} else if (!nextButtonToHighlight && pressedDirection != Directions::None) {
959959
g_GUISound.UserErrorSound()->Play(m_MenuController->GetPlayer());
960960
}
961961
}
962962

963963
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
964964

965-
Direction InventoryMenuGUI::GetNonMouseButtonControllerMovement() {
965+
Directions InventoryMenuGUI::GetNonMouseButtonControllerMovement() {
966966
bool pressUp = m_MenuController->IsState(ControlState::PRESS_UP) || m_MenuController->IsState(ControlState::SCROLL_UP);
967967
bool pressDown = m_MenuController->IsState(ControlState::PRESS_DOWN) || m_MenuController->IsState(ControlState::SCROLL_DOWN);
968968
bool pressLeft = m_MenuController->IsState(ControlState::PRESS_LEFT);
@@ -984,15 +984,15 @@ namespace RTE {
984984
m_GUIRepeatTimer.Reset();
985985
}
986986
if (pressUp) {
987-
return Direction::Up;
987+
return Directions::Up;
988988
} else if (pressDown) {
989-
return Direction::Down;
989+
return Directions::Down;
990990
} else if (pressLeft) {
991-
return Direction::Left;
991+
return Directions::Left;
992992
} else if (pressRight) {
993-
return Direction::Right;
993+
return Directions::Right;
994994
}
995-
return Direction::None;
995+
return Directions::None;
996996
}
997997

998998
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Menus/InventoryMenuGUI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ namespace RTE {
392392
/// <summary>
393393
/// Gets any keyboard or gamepad directional input.
394394
/// </summary>
395-
/// <returns>The direction of found input. Priority matches ordering of the Direction enumeration.</returns>
396-
Direction GetNonMouseButtonControllerMovement();
395+
/// <returns>The direction of found input. Priority matches ordering of the Directions enumeration.</returns>
396+
Directions GetNonMouseButtonControllerMovement();
397397

398398
/// <summary>
399399
/// Breakdown of HandleNonMouseInput for handling pressing/holding up.

System/Constants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ namespace RTE {
229229
};
230230

231231
/// <summary>
232-
/// Enumeration for cardinal directions, as well as None.
232+
/// Enumeration for cardinal directions, as well as None and Any.
233233
/// </summary>
234-
enum class Direction { None = -1, Up, Down, Left, Right };
234+
enum Directions { None = -1, Up, Down, Left, Right, Any };
235235
#pragma endregion
236236

237237
#pragma region Un-Definitions

0 commit comments

Comments
 (0)