From e5f66ad55363bae62afe1c6f1ef7f2afbb1b9dbc Mon Sep 17 00:00:00 2001 From: Harry Hopkinson Date: Tue, 24 Sep 2024 19:47:20 +0100 Subject: [PATCH 1/6] Refactor ShortcutIds.h constants to kCamelCase --- src/openrct2-ui/input/ShortcutIds.h | 32 +++++++++++------------ src/openrct2-ui/input/ShortcutManager.cpp | 30 ++++++++++----------- src/openrct2-ui/input/Shortcuts.cpp | 32 +++++++++++------------ 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/openrct2-ui/input/ShortcutIds.h b/src/openrct2-ui/input/ShortcutIds.h index 4cd02eb3f8..d7c8bfba03 100644 --- a/src/openrct2-ui/input/ShortcutIds.h +++ b/src/openrct2-ui/input/ShortcutIds.h @@ -14,22 +14,22 @@ namespace OpenRCT2::Ui::ShortcutId { // Interface / general - constexpr std::string_view InterfaceCloseTop = "interface.general.close_top"; - constexpr std::string_view InterfaceCloseAll = "interface.general.close_all"; - constexpr std::string_view InterfaceRotateConstruction = "interface.general.rotate_construction"; - constexpr std::string_view InterfaceCancelConstruction = "interface.general.cancel_construction"; - constexpr std::string_view InterfacePause = "interface.general.pause"; - constexpr std::string_view InterfaceDecreaseSpeed = "interface.misc.decrease_speed"; - constexpr std::string_view InterfaceIncreaseSpeed = "interface.misc.increase_speed"; - constexpr std::string_view InterfaceToggleToolbars = "interface.misc.toggle_toolbars"; - constexpr std::string_view InterfaceScreenshot = "interface.misc.screenshot"; - constexpr std::string_view InterfaceGiantScreenshot = "interface.misc.giant_screenshot"; - constexpr std::string_view InterfaceLoadGame = "interface.misc.load_game"; - constexpr std::string_view InterfaceSaveGame = "interface.misc.save_game"; - constexpr std::string_view InterfaceMute = "interface.misc.mute"; - constexpr std::string_view InterfaceSceneryPicker = "interface.misc.scenery_picker"; - constexpr std::string_view InterfaceDisableClearance = "interface.misc.disable_clearance"; - constexpr std::string_view InterfaceMultiplayerChat = "interface.misc.multiplayer_chat"; + constexpr std::string_view kInterfaceCloseTop = "interface.general.close_top"; + constexpr std::string_view kInterfaceCloseAll = "interface.general.close_all"; + constexpr std::string_view kInterfaceRotateConstruction = "interface.general.rotate_construction"; + constexpr std::string_view kInterfaceCancelConstruction = "interface.general.cancel_construction"; + constexpr std::string_view kInterfacePause = "interface.general.pause"; + constexpr std::string_view kInterfaceDecreaseSpeed = "interface.misc.decrease_speed"; + constexpr std::string_view kInterfaceIncreaseSpeed = "interface.misc.increase_speed"; + constexpr std::string_view kInterfaceToggleToolbars = "interface.misc.toggle_toolbars"; + constexpr std::string_view kInterfaceScreenshot = "interface.misc.screenshot"; + constexpr std::string_view kInterfaceGiantScreenshot = "interface.misc.giant_screenshot"; + constexpr std::string_view kInterfaceLoadGame = "interface.misc.load_game"; + constexpr std::string_view kInterfaceSaveGame = "interface.misc.save_game"; + constexpr std::string_view kInterfaceMute = "interface.misc.mute"; + constexpr std::string_view kInterfaceSceneryPicker = "interface.misc.scenery_picker"; + constexpr std::string_view kInterfaceDisableClearance = "interface.misc.disable_clearance"; + constexpr std::string_view kInterfaceMultiplayerChat = "interface.misc.multiplayer_chat"; // Interface / graphics constexpr std::string_view InterfaceScaleToggleWindowMode = "interface.graphics.toggle_window_mode"; diff --git a/src/openrct2-ui/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index b1681b944a..d11ca7723c 100644 --- a/src/openrct2-ui/input/ShortcutManager.cpp +++ b/src/openrct2-ui/input/ShortcutManager.cpp @@ -356,15 +356,15 @@ void ShortcutManager::SaveUserBindings(const fs::path& path) std::string_view ShortcutManager::GetLegacyShortcutId(size_t index) { static constexpr std::string_view _legacyMap[] = { - ShortcutId::InterfaceCloseTop, - ShortcutId::InterfaceCloseAll, - ShortcutId::InterfaceCancelConstruction, - ShortcutId::InterfacePause, + ShortcutId::kInterfaceCloseTop, + ShortcutId::kInterfaceCloseAll, + ShortcutId::kInterfaceCancelConstruction, + ShortcutId::kInterfacePause, ShortcutId::ViewGeneralZoomOut, ShortcutId::ViewGeneralZoomIn, ShortcutId::ViewGeneralRotateClockwise, ShortcutId::ViewGeneralRotateAnticlockwise, - ShortcutId::InterfaceRotateConstruction, + ShortcutId::kInterfaceRotateConstruction, ShortcutId::ViewToggleUnderground, ShortcutId::ViewToggleBaseLand, ShortcutId::ViewToggleVerticalLand, @@ -388,19 +388,19 @@ std::string_view ShortcutManager::GetLegacyShortcutId(size_t index) ShortcutId::InterfaceOpenStaff, ShortcutId::InterfaceOpenMessages, ShortcutId::InterfaceOpenMap, - ShortcutId::InterfaceScreenshot, - ShortcutId::InterfaceDecreaseSpeed, - ShortcutId::InterfaceIncreaseSpeed, + ShortcutId::kInterfaceScreenshot, + ShortcutId::kInterfaceDecreaseSpeed, + ShortcutId::kInterfaceIncreaseSpeed, ShortcutId::InterfaceOpenCheats, - ShortcutId::InterfaceToggleToolbars, + ShortcutId::kInterfaceToggleToolbars, ShortcutId::ViewScrollUp, ShortcutId::ViewScrollLeft, ShortcutId::ViewScrollDown, ShortcutId::ViewScrollRight, - ShortcutId::InterfaceMultiplayerChat, - ShortcutId::InterfaceSaveGame, + ShortcutId::kInterfaceMultiplayerChat, + ShortcutId::kInterfaceSaveGame, ShortcutId::InterfaceShowOptions, - ShortcutId::InterfaceMute, + ShortcutId::kInterfaceMute, ShortcutId::InterfaceScaleToggleWindowMode, ShortcutId::InterfaceMultiplayerShow, std::string_view(), @@ -418,14 +418,14 @@ std::string_view ShortcutManager::GetLegacyShortcutId(size_t index) ShortcutId::WindowRideConstructionNext, ShortcutId::WindowRideConstructionBuild, ShortcutId::WindowRideConstructionDemolish, - ShortcutId::InterfaceLoadGame, + ShortcutId::kInterfaceLoadGame, ShortcutId::InterfaceClearScenery, ShortcutId::ViewToggleGridlines, ShortcutId::ViewToggleCutAway, ShortcutId::ViewToogleFootpathIssues, ShortcutId::InterfaceOpenTileInspector, ShortcutId::DebugAdvanceTick, - ShortcutId::InterfaceSceneryPicker, + ShortcutId::kInterfaceSceneryPicker, ShortcutId::InterfaceScaleIncrease, ShortcutId::InterfaceScaleDecrease, ShortcutId::WindowTileInspectorToggleInvisibility, @@ -440,7 +440,7 @@ std::string_view ShortcutManager::GetLegacyShortcutId(size_t index) ShortcutId::WindowTileInspectorDecreaseY, ShortcutId::WindowTileInspectorIncreaseHeight, ShortcutId::WindowTileInspectorDecreaseHeight, - ShortcutId::InterfaceDisableClearance, + ShortcutId::kInterfaceDisableClearance, }; return index < std::size(_legacyMap) ? _legacyMap[index] : std::string_view(); } diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 7167da4447..f864305897 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -727,8 +727,8 @@ void ShortcutManager::RegisterDefaultShortcuts() { // clang-format off // Interface - RegisterShortcut(ShortcutId::InterfaceCloseTop, STR_SHORTCUT_CLOSE_TOP_MOST_WINDOW, "BACKSPACE", WindowCloseTop); - RegisterShortcut(ShortcutId::InterfaceCloseAll, STR_SHORTCUT_CLOSE_ALL_FLOATING_WINDOWS, "SHIFT+BACKSPACE", []() { + RegisterShortcut(ShortcutId::kInterfaceCloseTop, STR_SHORTCUT_CLOSE_TOP_MOST_WINDOW, "BACKSPACE", WindowCloseTop); + RegisterShortcut(ShortcutId::kInterfaceCloseAll, STR_SHORTCUT_CLOSE_ALL_FLOATING_WINDOWS, "SHIFT+BACKSPACE", []() { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)) { WindowCloseAll(); @@ -738,8 +738,8 @@ void ShortcutManager::RegisterDefaultShortcuts() WindowCloseTop(); } }); - RegisterShortcut(ShortcutId::InterfaceRotateConstruction, STR_SHORTCUT_ROTATE_CONSTRUCTION_OBJECT, "Z", ShortcutRotateConstructionObject); - RegisterShortcut(ShortcutId::InterfaceCancelConstruction, STR_SHORTCUT_CANCEL_CONSTRUCTION_MODE, "ESCAPE", []() { + RegisterShortcut(ShortcutId::kInterfaceRotateConstruction, STR_SHORTCUT_ROTATE_CONSTRUCTION_OBJECT, "Z", ShortcutRotateConstructionObject); + RegisterShortcut(ShortcutId::kInterfaceCancelConstruction, STR_SHORTCUT_CANCEL_CONSTRUCTION_MODE, "ESCAPE", []() { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { auto window = WindowFindByClass(WindowClass::Error); @@ -753,25 +753,25 @@ void ShortcutManager::RegisterDefaultShortcuts() } } }); - RegisterShortcut(ShortcutId::InterfacePause, STR_SHORTCUT_PAUSE_GAME, "PAUSE", []() { + RegisterShortcut(ShortcutId::kInterfacePause, STR_SHORTCUT_PAUSE_GAME, "PAUSE", []() { if (!(gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_MANAGER))) { auto pauseToggleAction = PauseToggleAction(); GameActions::Execute(&pauseToggleAction); } }); - RegisterShortcut(ShortcutId::InterfaceDecreaseSpeed, STR_SHORTCUT_REDUCE_GAME_SPEED, "-", ShortcutReduceGameSpeed); - RegisterShortcut(ShortcutId::InterfaceIncreaseSpeed, STR_SHORTCUT_INCREASE_GAME_SPEED, "=", ShortcutIncreaseGameSpeed); - RegisterShortcut(ShortcutId::InterfaceToggleToolbars, STR_SHORTCUT_TOGGLE_VISIBILITY_OF_TOOLBARS, ShortcutRemoveTopBottomToolbarToggle); - RegisterShortcut(ShortcutId::InterfaceScreenshot, STR_SHORTCUT_SCREENSHOT, "CTRL+S", []() { gScreenshotCountdown = 2; }); - RegisterShortcut(ShortcutId::InterfaceGiantScreenshot, STR_SHORTCUT_GIANT_SCREENSHOT, "CTRL+SHIFT+S", ScreenshotGiant); - RegisterShortcut(ShortcutId::InterfaceLoadGame, STR_LOAD_GAME, "CTRL+L", ShortcutLoadGame); - RegisterShortcut(ShortcutId::InterfaceSaveGame, STR_SAVE_GAME, "CTRL+F10", ShortcutQuickSaveGame); - RegisterShortcut(ShortcutId::InterfaceMute, STR_SHORTCUT_MUTE_SOUND, OpenRCT2::Audio::ToggleAllSounds); - RegisterShortcut(ShortcutId::InterfaceSceneryPicker, STR_SHORTCUT_OPEN_SCENERY_PICKER, ShortcutOpenSceneryPicker); + RegisterShortcut(ShortcutId::kInterfaceDecreaseSpeed, STR_SHORTCUT_REDUCE_GAME_SPEED, "-", ShortcutReduceGameSpeed); + RegisterShortcut(ShortcutId::kInterfaceIncreaseSpeed, STR_SHORTCUT_INCREASE_GAME_SPEED, "=", ShortcutIncreaseGameSpeed); + RegisterShortcut(ShortcutId::kInterfaceToggleToolbars, STR_SHORTCUT_TOGGLE_VISIBILITY_OF_TOOLBARS, ShortcutRemoveTopBottomToolbarToggle); + RegisterShortcut(ShortcutId::kInterfaceScreenshot, STR_SHORTCUT_SCREENSHOT, "CTRL+S", []() { gScreenshotCountdown = 2; }); + RegisterShortcut(ShortcutId::kInterfaceGiantScreenshot, STR_SHORTCUT_GIANT_SCREENSHOT, "CTRL+SHIFT+S", ScreenshotGiant); + RegisterShortcut(ShortcutId::kInterfaceLoadGame, STR_LOAD_GAME, "CTRL+L", ShortcutLoadGame); + RegisterShortcut(ShortcutId::kInterfaceSaveGame, STR_SAVE_GAME, "CTRL+F10", ShortcutQuickSaveGame); + RegisterShortcut(ShortcutId::kInterfaceMute, STR_SHORTCUT_MUTE_SOUND, OpenRCT2::Audio::ToggleAllSounds); + RegisterShortcut(ShortcutId::kInterfaceSceneryPicker, STR_SHORTCUT_OPEN_SCENERY_PICKER, ShortcutOpenSceneryPicker); RegisterShortcut( - ShortcutId::InterfaceDisableClearance, STR_SHORTCUT_TOGGLE_CLEARANCE_CHECKS, ShortcutToggleClearanceChecks); - RegisterShortcut(ShortcutId::InterfaceMultiplayerChat, STR_SHORTCUT_SEND_MESSAGE, "C", []() { + ShortcutId::kInterfaceDisableClearance, STR_SHORTCUT_TOGGLE_CLEARANCE_CHECKS, ShortcutToggleClearanceChecks); + RegisterShortcut(ShortcutId::kInterfaceMultiplayerChat, STR_SHORTCUT_SEND_MESSAGE, "C", []() { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) && ChatAvailable()) { ChatToggle(); From 92e74e55b4e50a0a217c965f29394b1db3d11359 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson Date: Tue, 24 Sep 2024 19:51:43 +0100 Subject: [PATCH 2/6] Refactor Park.h constants to kCamelCase --- src/openrct2-ui/interface/Graph.cpp | 4 ++-- src/openrct2-ui/windows/EditorObjectiveOptions.cpp | 6 +++--- src/openrct2-ui/windows/Park.cpp | 4 ++-- src/openrct2/world/Park.cpp | 5 +++-- src/openrct2/world/Park.h | 10 +++++----- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/openrct2-ui/interface/Graph.cpp b/src/openrct2-ui/interface/Graph.cpp index 616bcc0e32..c1345969b7 100644 --- a/src/openrct2-ui/interface/Graph.cpp +++ b/src/openrct2-ui/interface/Graph.cpp @@ -184,7 +184,7 @@ namespace OpenRCT2::Graph void DrawRatingGraph(DrawPixelInfo& dpi, const GraphProperties& p) { - constexpr uint8_t noValue = ParkRatingHistoryUndefined; + constexpr uint8_t noValue = kParkRatingHistoryUndefined; const FmtString fmt("{BLACK}{COMMA32}"); // Since the park rating rating history is divided by 4, we have to fudge the max number here. DrawYLabels(dpi, p.internalBounds, p.min, kParkRatingMax, p.numYLabels, p.yLabelStepPx, p.lineCol, fmt); @@ -195,7 +195,7 @@ namespace OpenRCT2::Graph void DrawGuestGraph(DrawPixelInfo& dpi, const GraphProperties& p) { - constexpr uint32_t noValue = GuestsInParkHistoryUndefined; + constexpr uint32_t noValue = kGuestsInParkHistoryUndefined; const FmtString fmt("{BLACK}{COMMA32}"); DrawYLabels(dpi, p.internalBounds, p.min, p.max, p.numYLabels, p.yLabelStepPx, p.lineCol, fmt); DrawMonths(dpi, p.series, p.numPoints, p.internalBounds, p.xStepPx); diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index d1942cac62..96e99a21f1 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -666,18 +666,18 @@ namespace OpenRCT2::Ui::Windows { WindowTextInputRawOpen( this, WIDX_PARK_NAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, {}, gameState.Park.Name.c_str(), - ParkNameMaxLength); + kParkNameMaxLength); break; } case WIDX_SCENARIO_NAME: WindowTextInputRawOpen( this, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, {}, - gameState.ScenarioName.c_str(), ScenarioNameMaxLength); + gameState.ScenarioName.c_str(), kScenarioNameMaxLength); break; case WIDX_DETAILS: WindowTextInputRawOpen( this, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, {}, - gameState.ScenarioDetails.c_str(), ScenarioDetailsNameMaxLength); + gameState.ScenarioDetails.c_str(), kScenarioDetailsNameMaxLength); break; } } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index d0710b59a9..45cfebb08f 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -785,7 +785,7 @@ namespace OpenRCT2::Ui::Windows for (size_t i = 0; i < std::size(gameState.GuestsInParkHistory); i++) { auto value = gameState.GuestsInParkHistory[i]; - if (value == GuestsInParkHistoryUndefined) + if (value == kGuestsInParkHistoryUndefined) continue; while (value > _guestProps.max) _guestProps.max += 5000; @@ -1029,7 +1029,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_ENTER_NAME: WindowTextInputOpen( this, WIDX_ENTER_NAME, STR_ENTER_NAME, STR_PLEASE_ENTER_YOUR_NAME_FOR_THE_SCENARIO_CHART, {}, 0, 0, - ParkNameMaxLength); + kParkNameMaxLength); break; } } diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 8065b78e1c..3f701ac96a 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -581,9 +581,10 @@ namespace OpenRCT2::Park void ResetHistories(GameState_t& gameState) { - std::fill(std::begin(gameState.Park.RatingHistory), std::end(gameState.Park.RatingHistory), ParkRatingHistoryUndefined); std::fill( - std::begin(gameState.GuestsInParkHistory), std::end(gameState.GuestsInParkHistory), GuestsInParkHistoryUndefined); + std::begin(gameState.Park.RatingHistory), std::end(gameState.Park.RatingHistory), kParkRatingHistoryUndefined); + std::fill( + std::begin(gameState.GuestsInParkHistory), std::end(gameState.GuestsInParkHistory), kGuestsInParkHistoryUndefined); } void UpdateHistories(GameState_t& gameState) diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index 945bd6258a..26a87ee1a5 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -14,13 +14,13 @@ constexpr auto MAX_ENTRANCE_FEE = 999.00_GBP; -constexpr uint8_t ParkRatingHistoryUndefined = std::numeric_limits::max(); -constexpr uint32_t GuestsInParkHistoryUndefined = std::numeric_limits::max(); +constexpr uint8_t kParkRatingHistoryUndefined = std::numeric_limits::max(); +constexpr uint32_t kGuestsInParkHistoryUndefined = std::numeric_limits::max(); constexpr uint8_t kParkRatingHistorySize = 32; constexpr uint8_t kGuestsInParkHistorySize = 32; -constexpr uint8_t ParkNameMaxLength = 128; -constexpr uint8_t ScenarioNameMaxLength = 128; -constexpr uint16_t ScenarioDetailsNameMaxLength = 256; +constexpr uint8_t kParkNameMaxLength = 128; +constexpr uint8_t kScenarioNameMaxLength = 128; +constexpr uint16_t kScenarioDetailsNameMaxLength = 256; enum : uint32_t { From 0b772873701d82c3c6ef0acdfe3d670845206ff7 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson Date: Tue, 24 Sep 2024 20:39:22 +0100 Subject: [PATCH 3/6] Refactor SceneryGroupObject.cpp constants --- src/openrct2/object/SceneryGroupObject.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/openrct2/object/SceneryGroupObject.cpp b/src/openrct2/object/SceneryGroupObject.cpp index 8a3c96fec5..b83f314905 100644 --- a/src/openrct2/object/SceneryGroupObject.cpp +++ b/src/openrct2/object/SceneryGroupObject.cpp @@ -30,12 +30,13 @@ using namespace OpenRCT2; // Example entry: "$DAT:09F55406|00STBEN " // 5 for $DAT:, 8 for the checksum, 1 for the vertical bar, 8 for the .DAT name. -static constexpr uint8_t DatEntryPrefixLength = 5; -static constexpr uint8_t DatEntryFlagsLength = 8; -static constexpr uint8_t DatEntrySeparatorLength = 1; -static constexpr uint8_t DatEntryLength = DatEntryPrefixLength + DatEntryFlagsLength + DatEntrySeparatorLength + kDatNameLength; -static constexpr uint8_t DatEntryFlagsStart = DatEntryPrefixLength; -static constexpr uint8_t DatEntryNameStart = DatEntryPrefixLength + DatEntryFlagsLength + DatEntrySeparatorLength; +static constexpr uint8_t kDatEntryPrefixLength = 5; +static constexpr uint8_t kDatEntryFlagsLength = 8; +static constexpr uint8_t kDatEntrySeparatorLength = 1; +static constexpr uint8_t kDatEntryLength = kDatEntryPrefixLength + kDatEntryFlagsLength + kDatEntrySeparatorLength + + kDatNameLength; +static constexpr uint8_t kDatEntryFlagsStart = kDatEntryPrefixLength; +static constexpr uint8_t kDatEntryNameStart = kDatEntryPrefixLength + kDatEntryFlagsLength + kDatEntrySeparatorLength; void SceneryGroupObject::ReadLegacy(IReadObjectContext* context, IStream* stream) { @@ -209,7 +210,7 @@ std::vector SceneryGroupObject::ReadJsonEntries(IReadObje auto entryName = Json::GetString(jEntry); if (String::StartsWith(entryName, "$DAT:")) { - if (entryName.length() != DatEntryLength) + if (entryName.length() != kDatEntryLength) { std::string errorMessage = "Malformed DAT entry in scenery group: " + entryName; context->LogError(ObjectError::InvalidProperty, errorMessage.c_str()); @@ -219,8 +220,8 @@ std::vector SceneryGroupObject::ReadJsonEntries(IReadObje try { RCTObjectEntry entry = {}; - entry.flags = std::stoul(entryName.substr(DatEntryFlagsStart, DatEntryFlagsLength), nullptr, 16); - std::memcpy(entry.name, entryName.c_str() + DatEntryNameStart, kDatNameLength); + entry.flags = std::stoul(entryName.substr(kDatEntryFlagsStart, kDatEntryFlagsLength), nullptr, 16); + std::memcpy(entry.name, entryName.c_str() + kDatEntryNameStart, kDatNameLength); entry.checksum = 0; entries.emplace_back(entry); } From d34f17c945d8afd16ea8cec31d547bfffdd09dd1 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson Date: Tue, 24 Sep 2024 20:53:11 +0100 Subject: [PATCH 4/6] Refactor Colour.h constants to kCamelCase --- src/openrct2-ui/windows/Dropdown.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 8 +++--- src/openrct2/actions/CheatSetAction.cpp | 4 +-- src/openrct2/drawing/Drawing.Sprite.cpp | 7 +++-- src/openrct2/drawing/Drawing.cpp | 14 +++++----- src/openrct2/entity/Guest.cpp | 8 +++--- src/openrct2/interface/Colour.cpp | 2 +- src/openrct2/interface/Colour.h | 36 ++++++++++++------------- 8 files changed, 40 insertions(+), 41 deletions(-) diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 5d5aaa0e20..2c6fcd0af0 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -499,7 +499,7 @@ static constexpr colour_t kColoursDropdownOrder[] = { int32_t defaultIndex = -1; const bool specialColoursEnabled = !alwaysHideSpecialColours && GetGameState().Cheats.AllowSpecialColourSchemes; - auto numColours = specialColoursEnabled ? static_cast(COLOUR_COUNT) : COLOUR_NUM_NORMAL; + auto numColours = specialColoursEnabled ? static_cast(COLOUR_COUNT) : kColourNumNormal; // Set items for (uint64_t i = 0; i < numColours; i++) { diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index dd9fb3a759..242c43d533 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -4294,19 +4294,19 @@ namespace OpenRCT2::Ui::Windows for (auto i = 0; i < numItems; i++) { - colour_t colour = UtilRand() % COLOUR_NUM_NORMAL; + colour_t colour = UtilRand() % kColourNumNormal; auto vehicleSetBodyColourAction = RideSetAppearanceAction( rideId, RideSetAppearanceType::VehicleColourBody, colour, i); GameActions::Execute(&vehicleSetBodyColourAction); if (allowChangingTrimColour) { - colour = UtilRand() % COLOUR_NUM_NORMAL; + colour = UtilRand() % kColourNumNormal; auto vehicleSetTrimColourAction = RideSetAppearanceAction( rideId, RideSetAppearanceType::VehicleColourTrim, colour, i); GameActions::Execute(&vehicleSetTrimColourAction); if (allowChangingTertiaryColour) { - colour = UtilRand() % COLOUR_NUM_NORMAL; + colour = UtilRand() % kColourNumNormal; auto vehicleSetTertiaryColourAction = RideSetAppearanceAction( rideId, RideSetAppearanceType::VehicleColourTertiary, colour, i); GameActions::Execute(&vehicleSetTertiaryColourAction); @@ -4907,7 +4907,7 @@ namespace OpenRCT2::Ui::Windows if ((GetGameState().CurrentTicks % 64) == 0) { spriteColour++; - if (spriteColour >= COLOUR_NUM_NORMAL) + if (spriteColour >= kColourNumNormal) { spriteColour = COLOUR_BLACK; } diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index a5eb906970..cc81dd174e 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -687,12 +687,12 @@ void CheatSetAction::GiveObjectToGuests(int32_t object) const break; case OBJECT_BALLOON: peep->GiveItem(ShopItem::Balloon); - peep->BalloonColour = ScenarioRandMax(COLOUR_NUM_NORMAL); + peep->BalloonColour = ScenarioRandMax(kColourNumNormal); peep->UpdateAnimationGroup(); break; case OBJECT_UMBRELLA: peep->GiveItem(ShopItem::Umbrella); - peep->UmbrellaColour = ScenarioRandMax(COLOUR_NUM_NORMAL); + peep->UmbrellaColour = ScenarioRandMax(kColourNumOriginal); peep->UpdateAnimationGroup(); break; } diff --git a/src/openrct2/drawing/Drawing.Sprite.cpp b/src/openrct2/drawing/Drawing.Sprite.cpp index e0837e580c..95821849c8 100644 --- a/src/openrct2/drawing/Drawing.Sprite.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.cpp @@ -468,22 +468,21 @@ static std::optional FASTCALL GfxDrawSpriteGetPalette(ImageId imageI if (tertiaryPaletteMap.has_value()) { paletteMap.Copy( - PALETTE_OFFSET_REMAP_TERTIARY, tertiaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); + kPaletteOffsetRemapTertiary, tertiaryPaletteMap.value(), kPaletteOffsetRemapPrimary, kPaletteLengthRemap); } } auto primaryPaletteMap = GetPaletteMapForColour(imageId.GetPrimary()); if (primaryPaletteMap.has_value()) { - paletteMap.Copy( - PALETTE_OFFSET_REMAP_PRIMARY, primaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); + paletteMap.Copy(kPaletteOffsetRemapPrimary, primaryPaletteMap.value(), kPaletteOffsetRemapPrimary, kPaletteLengthRemap); } auto secondaryPaletteMap = GetPaletteMapForColour(imageId.GetSecondary()); if (secondaryPaletteMap.has_value()) { paletteMap.Copy( - PALETTE_OFFSET_REMAP_SECONDARY, secondaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); + kPaletteOffsetRemapSecondary, secondaryPaletteMap.value(), kPaletteOffsetRemapPrimary, kPaletteLengthRemap); } return paletteMap; diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 1e35a1129f..9ef52ab936 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -996,7 +996,7 @@ void UpdatePaletteEffects() paletteOffset[(i * 4) + 1] = -((0xFF - g1->offset[(i * 3) + 1]) / 2) - 1; paletteOffset[(i * 4) + 2] = -((0xFF - g1->offset[(i * 3) + 2]) / 2) - 1; } - UpdatePalette(gGamePalette, PALETTE_OFFSET_DYNAMIC, PALETTE_LENGTH_DYNAMIC); + UpdatePalette(gGamePalette, kPaletteOffsetDynamic, kPaletteLengthDynamic); } gClimateLightningFlash++; } @@ -1052,8 +1052,8 @@ void UpdatePaletteEffects() if (g1 != nullptr) { uint8_t* vs = &g1->offset[j * 3]; - uint8_t* vd = &gGamePalette[PALETTE_OFFSET_WATER_WAVES * 4]; - int32_t n = PALETTE_LENGTH_WATER_WAVES; + uint8_t* vd = &gGamePalette[kPaletteOffsetWaterWaves * 4]; + int32_t n = kPaletteLengthWaterWaves; for (int32_t i = 0; i < n; i++) { vd[0] = vs[0]; @@ -1077,8 +1077,8 @@ void UpdatePaletteEffects() if (g1 != nullptr) { uint8_t* vs = &g1->offset[j * 3]; - uint8_t* vd = &gGamePalette[PALETTE_OFFSET_WATER_SPARKLES * 4]; - int32_t n = PALETTE_LENGTH_WATER_SPARKLES; + uint8_t* vd = &gGamePalette[kPaletteOffsetWaterSparkles * 4]; + int32_t n = kPaletteLengthWaterSparkles; for (int32_t i = 0; i < n; i++) { vd[0] = vs[0]; @@ -1115,10 +1115,10 @@ void UpdatePaletteEffects() } } - UpdatePalette(gGamePalette, PALETTE_OFFSET_ANIMATED, PALETTE_LENGTH_ANIMATED); + UpdatePalette(gGamePalette, kPaletteOffsetAnimated, kPaletteLengthAnimated); if (gClimateLightningFlash == 2) { - UpdatePalette(gGamePalette, PALETTE_OFFSET_DYNAMIC, PALETTE_LENGTH_DYNAMIC); + UpdatePalette(gGamePalette, kPaletteOffsetDynamic, kPaletteLengthDynamic); gClimateLightningFlash = 0; } } diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 6cac0b9c92..36a3f94d14 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1639,16 +1639,16 @@ bool Guest::DecideAndBuyItem(Ride& ride, const ShopItem shopItem, money64 price) const auto hasRandomShopColour = ride.HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS); if (shopItem == ShopItem::TShirt) - TshirtColour = hasRandomShopColour ? ScenarioRandMax(COLOUR_NUM_NORMAL) : ride.track_colour[0].main; + TshirtColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.track_colour[0].main; if (shopItem == ShopItem::Hat) - HatColour = hasRandomShopColour ? ScenarioRandMax(COLOUR_NUM_NORMAL) : ride.track_colour[0].main; + HatColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.track_colour[0].main; if (shopItem == ShopItem::Balloon) - BalloonColour = hasRandomShopColour ? ScenarioRandMax(COLOUR_NUM_NORMAL) : ride.track_colour[0].main; + BalloonColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.track_colour[0].main; if (shopItem == ShopItem::Umbrella) - UmbrellaColour = hasRandomShopColour ? ScenarioRandMax(COLOUR_NUM_NORMAL) : ride.track_colour[0].main; + UmbrellaColour = hasRandomShopColour ? ScenarioRandMax(kColourNumNormal) : ride.track_colour[0].main; if (shopItem == ShopItem::Map) ResetPathfindGoal(); diff --git a/src/openrct2/interface/Colour.cpp b/src/openrct2/interface/Colour.cpp index b4bd48c3a4..2060010cba 100644 --- a/src/openrct2/interface/Colour.cpp +++ b/src/openrct2/interface/Colour.cpp @@ -44,7 +44,7 @@ void ColoursInitMaps() for (int32_t i = 0; i < COLOUR_COUNT; i++) { // Get palette index in g1 / g2 - const auto paletteIndex = (i < COLOUR_NUM_ORIGINAL) ? SPR_PALETTE_2_START : SPR_G2_PALETTE_BEGIN - COLOUR_NUM_ORIGINAL; + const auto paletteIndex = (i < kColourNumOriginal) ? SPR_PALETTE_2_START : SPR_G2_PALETTE_BEGIN - kColourNumOriginal; const G1Element* g1 = GfxGetG1Element(paletteIndex + i); if (g1 != nullptr) { diff --git a/src/openrct2/interface/Colour.h b/src/openrct2/interface/Colour.h index 0e8e8dfa08..edf055eef3 100644 --- a/src/openrct2/interface/Colour.h +++ b/src/openrct2/interface/Colour.h @@ -187,29 +187,29 @@ enum : PaletteIndex PALETTE_INDEX_254 = 254, // Primary remap 11 }; -constexpr size_t PALETTE_COUNT = 256; +constexpr size_t kPaletteCount = 256; -constexpr uint8_t PALETTE_OFFSET_DYNAMIC = PALETTE_INDEX_10; -constexpr uint8_t PALETTE_LENGTH_DYNAMIC = 236; +constexpr uint8_t kPaletteOffsetDynamic = PALETTE_INDEX_10; +constexpr uint8_t kPaletteLengthDynamic = 236; -constexpr uint8_t PALETTE_OFFSET_WATER_WAVES = PALETTE_INDEX_230; -constexpr uint8_t PALETTE_OFFSET_WATER_SPARKLES = PALETTE_INDEX_235; -constexpr uint8_t PALETTE_LENGTH_WATER_WAVES = 5; -constexpr uint8_t PALETTE_LENGTH_WATER_SPARKLES = 5; +constexpr uint8_t kPaletteOffsetWaterWaves = PALETTE_INDEX_230; +constexpr uint8_t kPaletteOffsetWaterSparkles = PALETTE_INDEX_235; +constexpr uint8_t kPaletteLengthWaterWaves = 5; +constexpr uint8_t kPaletteLengthWaterSparkles = 5; -constexpr uint8_t PALETTE_OFFSET_TRACK_RAILS = PALETTE_INDEX_240; -constexpr uint8_t PALETTE_LENGTH_TRACK_RAILS = 3; +constexpr uint8_t kPaletteOffsetTrackRails = PALETTE_INDEX_240; +constexpr uint8_t kPaletteLengthTrackRails = 3; -constexpr uint8_t PALETTE_OFFSET_REMAP_PRIMARY = PALETTE_INDEX_243; -constexpr uint8_t PALETTE_OFFSET_REMAP_SECONDARY = PALETTE_INDEX_202; -constexpr uint8_t PALETTE_OFFSET_REMAP_TERTIARY = PALETTE_INDEX_46; -constexpr uint8_t PALETTE_LENGTH_REMAP = 12; +constexpr uint8_t kPaletteOffsetRemapPrimary = PALETTE_INDEX_243; +constexpr uint8_t kPaletteOffsetRemapSecondary = PALETTE_INDEX_202; +constexpr uint8_t kPaletteOffsetRemapTertiary = PALETTE_INDEX_46; +constexpr uint8_t kPaletteLengthRemap = 12; -constexpr uint8_t PALETTE_OFFSET_ANIMATED = PALETTE_INDEX_230; -constexpr uint8_t PALETTE_LENGTH_ANIMATED = 16; +constexpr uint8_t kPaletteOffsetAnimated = PALETTE_INDEX_230; +constexpr uint8_t kPaletteLengthAnimated = 16; -constexpr uint8_t COLOUR_NUM_ORIGINAL = 32; -constexpr uint8_t COLOUR_NUM_NORMAL = 54; +constexpr uint8_t kColourNumOriginal = 32; +constexpr uint8_t kColourNumNormal = 54; static constexpr uint8_t kLegacyColourFlagTranslucent = (1 << 7); @@ -269,5 +269,5 @@ namespace OpenRCT2::Colour uint8_t BlendColours(const uint8_t paletteIndex1, const uint8_t paletteIndex2); #endif -typedef uint8_t BlendColourMapType[PALETTE_COUNT][PALETTE_COUNT]; +typedef uint8_t BlendColourMapType[kPaletteCount][kPaletteCount]; BlendColourMapType* GetBlendColourMap(); From 2fe36661abde0e0d89f7cfb61c86a5439aed5f1b Mon Sep 17 00:00:00 2001 From: Harry Hopkinson Date: Tue, 24 Sep 2024 21:14:03 +0100 Subject: [PATCH 5/6] Refactor Limits.h constants to kCamelCase --- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct1/RCT1.h | 28 ++++++++++----------- src/openrct2/rct1/S4Importer.cpp | 12 ++++----- src/openrct2/rct12/Limits.h | 22 ++++++++--------- src/openrct2/rct12/RCT12.h | 24 +++++++++--------- src/openrct2/rct2/RCT2.h | 42 ++++++++++++++++---------------- src/openrct2/rct2/S6Importer.cpp | 12 ++++----- 7 files changed, 71 insertions(+), 71 deletions(-) diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 47fa883b97..13b8bdeaa4 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -1605,7 +1605,7 @@ namespace OpenRCT2 static std::vector LegacyGetRideTypesBeenOn(const std::array& srcArray) { std::vector ridesTypesBeenOn; - for (ObjectEntryIndex i = 0; i < RCT2::Limits::MaxRideObjects; i++) + for (ObjectEntryIndex i = 0; i < RCT2::Limits::kMaxRideObjects; i++) { if (srcArray[i / 8] & (1 << (i % 8))) { diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index 4f93370de7..981dc0a384 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -626,14 +626,14 @@ namespace OpenRCT2::RCT1 uint8_t RidesBeenOn[32]; // 0x7C // 255 bit bitmap of every ride the peep has been on see // WindowPeepRidesUpdate for how to use. - uint32_t ID; // 0x9C - money32 CashInPocket; // 0xA0 - money32 CashSpent; // 0xA4 - int32_t ParkEntryTime; // 0xA8 - int8_t RejoinQueueTimeout; // 0xAC - RCT12RideId PreviousRide; // 0xAD - uint16_t PreviousRideTimeOut; // 0xAE - RCT12PeepThought Thoughts[Limits::MaxPeepThoughts]; // 0xB0 + uint32_t ID; // 0x9C + money32 CashInPocket; // 0xA0 + money32 CashSpent; // 0xA4 + int32_t ParkEntryTime; // 0xA8 + int8_t RejoinQueueTimeout; // 0xAC + RCT12RideId PreviousRide; // 0xAD + uint16_t PreviousRideTimeOut; // 0xAE + RCT12PeepThought Thoughts[Limits::kMaxPeepThoughts]; // 0xB0 uint8_t PadC4; union { @@ -758,7 +758,7 @@ namespace OpenRCT2::RCT1 uint32_t RideFeature2[128]; uint16_t GuestsInPark; uint16_t Unk198C9E; - money32 Expenditure[Limits::ExpenditureTableMonthCount][Limits::ExpenditureTypeCount]; + money32 Expenditure[Limits::kExpenditureTableMonthCount][Limits::kExpenditureTypeCount]; uint32_t GuestsInPark2; uint8_t Unk199024; colour_t HandymanColour; @@ -801,13 +801,13 @@ namespace OpenRCT2::RCT1 uint8_t MarketingStatus[20]; uint8_t MarketingAssoc[20]; uint8_t Unk199582[2]; - money32 CashHistory[Limits::FinanceGraphSize]; + money32 CashHistory[Limits::kFinanceGraphSize]; money32 TotalExpenditure; money32 Profit; uint8_t Unk199788[8]; - money32 WeeklyProfitHistory[Limits::FinanceGraphSize]; + money32 WeeklyProfitHistory[Limits::kFinanceGraphSize]; money32 ParkValue; - money32 ParkValueHistory[Limits::FinanceGraphSize]; + money32 ParkValueHistory[Limits::kFinanceGraphSize]; money32 CompletedCompanyValue; uint32_t NumAdmissions; money32 AdmissionTotalIncome; @@ -847,7 +847,7 @@ namespace OpenRCT2::RCT1 ResearchItem ResearchItemsLL[250]; uint8_t Unk19A0D9[5118]; RCT12Banner Banners[Limits::kMaxBanners]; - char StringTable[Limits::MaxUserStrings][Limits::MaxUserStringLength]; + char StringTable[Limits::kMaxUserStrings][Limits::kMaxUserStringLength]; uint32_t GameTimeCounter; Ride Rides[Limits::kMaxRidesInPark]; uint16_t UnkGameTimeCounter; @@ -865,7 +865,7 @@ namespace OpenRCT2::RCT1 RCT12RideMeasurement RideMeasurements[8]; uint32_t NextGuestIndex; uint16_t GameCounter5; - uint8_t PatrolAreas[(Limits::kMaxStaff + Limits::StaffTypeCount) * Limits::PatrolAreaSize]; + uint8_t PatrolAreas[(Limits::kMaxStaff + Limits::kStaffTypeCount) * Limits::kPatrolAreaSize]; uint8_t StaffModes[Limits::kMaxStaff]; uint8_t Unk1F431E[4]; uint8_t Unk1F4322[8]; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index c21e5cbd51..5bf44746fb 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1368,8 +1368,8 @@ namespace OpenRCT2::RCT1 // index in the array ----^ ^--- bit position in the 8-bit value // We do the opposite in this function to recover the x and y values. - int32_t peepOffset = staffId * Limits::PatrolAreaSize; - for (int32_t i = 0; i < Limits::PatrolAreaSize; i++) + int32_t peepOffset = staffId * Limits::kPatrolAreaSize; + for (int32_t i = 0; i < Limits::kPatrolAreaSize; i++) { if (_s4.PatrolAreas[peepOffset + i] == 0) { @@ -1439,16 +1439,16 @@ namespace OpenRCT2::RCT1 gameState.Park.Value = CorrectRCT1ParkValue(_s4.ParkValue); gameState.CurrentProfit = ToMoney64(_s4.Profit); - for (size_t i = 0; i < Limits::FinanceGraphSize; i++) + for (size_t i = 0; i < Limits::kFinanceGraphSize; i++) { gameState.CashHistory[i] = ToMoney64(_s4.CashHistory[i]); gameState.Park.ValueHistory[i] = CorrectRCT1ParkValue(_s4.ParkValueHistory[i]); gameState.WeeklyProfitHistory[i] = ToMoney64(_s4.WeeklyProfitHistory[i]); } - for (size_t i = 0; i < Limits::ExpenditureTableMonthCount; i++) + for (size_t i = 0; i < Limits::kExpenditureTableMonthCount; i++) { - for (size_t j = 0; j < Limits::ExpenditureTypeCount; j++) + for (size_t j = 0; j < Limits::kExpenditureTypeCount; j++) { gameState.ExpenditureTable[i][j] = ToMoney64(_s4.Expenditure[i][j]); } @@ -1538,7 +1538,7 @@ namespace OpenRCT2::RCT1 RCT12TileElement* srcElement = tilePointerIndex.GetFirstElementAt(coords); do { - if (srcElement->BaseHeight == Limits::MaxElementHeight) + if (srcElement->BaseHeight == Limits::kMaxElementHeight) continue; // Reserve 8 elements for import diff --git a/src/openrct2/rct12/Limits.h b/src/openrct2/rct12/Limits.h index e1a9d69009..394bcb7baa 100644 --- a/src/openrct2/rct12/Limits.h +++ b/src/openrct2/rct12/Limits.h @@ -12,7 +12,7 @@ namespace OpenRCT2::RCT12::Limits { - constexpr uint8_t MaxRideObjects = 128; + constexpr uint8_t kMaxRideObjects = 128; constexpr uint8_t kMaxRidesInPark = 255; constexpr uint8_t kMaxAwards = 4; @@ -23,26 +23,26 @@ namespace OpenRCT2::RCT12::Limits // The number of elements in the patrol_areas array per staff member. Every bit in the array represents a 4x4 square. // In RCT1, that's an 8-bit array. 8 * 128 = 1024 bits, which is also the number of 4x4 squares on a 128x128 map. // For RCT2, it's a 32-bit array. 32 * 128 = 4096 bits, which is also the number of 4x4 squares on a 256x256 map. - constexpr uint8_t PatrolAreaSize = 128; - constexpr uint8_t StaffTypeCount = 4; + constexpr uint8_t kPatrolAreaSize = 128; + constexpr uint8_t kStaffTypeCount = 4; constexpr uint8_t kNumColourSchemes = 4; constexpr uint8_t kMaxVehicleColours = 32; - constexpr uint8_t ExpenditureTableMonthCount = 16; - constexpr uint8_t ExpenditureTypeCount = 14; - constexpr uint8_t FinanceGraphSize = 128; + constexpr uint8_t kExpenditureTableMonthCount = 16; + constexpr uint8_t kExpenditureTypeCount = 14; + constexpr uint8_t kFinanceGraphSize = 128; - constexpr uint16_t MaxUserStrings = 1024; - constexpr uint8_t MaxUserStringLength = 32; + constexpr uint16_t kMaxUserStrings = 1024; + constexpr uint8_t kMaxUserStringLength = 32; - constexpr uint8_t MaxPeepThoughts = 5; + constexpr uint8_t kMaxPeepThoughts = 5; - constexpr uint16_t RideMeasurementMaxItems = 4800; + constexpr uint16_t kRideMeasurementMaxItems = 4800; constexpr uint16_t const kMaxInversions = 31; constexpr uint16_t const kMaxGolfHoles = 31; constexpr uint16_t const kMaxHelices = 31; - constexpr uint8_t MaxElementHeight = 255; + constexpr uint8_t kMaxElementHeight = 255; constexpr uint8_t kCustomerHistorySize = 10; constexpr uint8_t kMaxWaitingTime = 250; diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 140048ce08..7b37c420b0 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -830,17 +830,17 @@ static_assert(sizeof(RCT12PeepThought) == 4); struct RCT12RideMeasurement { - uint8_t RideIndex; // 0x0000 - uint8_t Flags; // 0x0001 - uint32_t LastUseTick; // 0x0002 - uint16_t NumItems; // 0x0006 - uint16_t CurrentItem; // 0x0008 - uint8_t VehicleIndex; // 0x000A - uint8_t CurrentStation; // 0x000B - int8_t Vertical[OpenRCT2::RCT12::Limits::RideMeasurementMaxItems]; // 0x000C - int8_t Lateral[OpenRCT2::RCT12::Limits::RideMeasurementMaxItems]; // 0x12CC - uint8_t Velocity[OpenRCT2::RCT12::Limits::RideMeasurementMaxItems]; // 0x258C - uint8_t Altitude[OpenRCT2::RCT12::Limits::RideMeasurementMaxItems]; // 0x384C + uint8_t RideIndex; // 0x0000 + uint8_t Flags; // 0x0001 + uint32_t LastUseTick; // 0x0002 + uint16_t NumItems; // 0x0006 + uint16_t CurrentItem; // 0x0008 + uint8_t VehicleIndex; // 0x000A + uint8_t CurrentStation; // 0x000B + int8_t Vertical[OpenRCT2::RCT12::Limits::kRideMeasurementMaxItems]; // 0x000C + int8_t Lateral[OpenRCT2::RCT12::Limits::kRideMeasurementMaxItems]; // 0x12CC + uint8_t Velocity[OpenRCT2::RCT12::Limits::kRideMeasurementMaxItems]; // 0x258C + uint8_t Altitude[OpenRCT2::RCT12::Limits::kRideMeasurementMaxItems]; // 0x384C }; static_assert(sizeof(RCT12RideMeasurement) == 0x4B0C); @@ -923,7 +923,7 @@ money64 RCT12CompletedCompanyValueToOpenRCT2(money32 origValue); template std::vector RCT12GetRideTypesBeenOn(T* srcPeep) { std::vector ridesTypesBeenOn; - for (uint16_t i = 0; i < OpenRCT2::RCT12::Limits::MaxRideObjects; i++) + for (uint16_t i = 0; i < OpenRCT2::RCT12::Limits::kMaxRideObjects; i++) { if (srcPeep->RideTypesBeenOn[i / 8] & (1 << (i % 8))) { diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 4563f0551f..719da26f88 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -30,7 +30,7 @@ namespace OpenRCT2::RCT2 // clang-format off constexpr uint16_t RCT2_OBJECT_ENTRY_COUNT = - Limits::MaxRideObjects + + Limits::kMaxRideObjects + Limits::kMaxSmallSceneryObjects + Limits::kMaxLargeSceneryObjects + Limits::kMaxWallSceneryObjects + @@ -46,7 +46,7 @@ namespace OpenRCT2::RCT2 // clang-format off constexpr int32_t RCT2ObjectEntryGroupCounts[] = { - Limits::MaxRideObjects, + Limits::kMaxRideObjects, Limits::kMaxSmallSceneryObjects, Limits::kMaxLargeSceneryObjects, Limits::kMaxWallSceneryObjects, @@ -612,17 +612,17 @@ namespace OpenRCT2::RCT2 uint8_t Direction; }; RCT12RideId InteractionRideIndex; - uint16_t TimeInQueue; // 0x7A - uint8_t RidesBeenOn[32]; // 0x7C - uint32_t Id; // 0x9C - money32 CashInPocket; // 0xA0 - money32 CashSpent; // 0xA4 - int32_t ParkEntryTime; // 0xA8 - int8_t RejoinQueueTimeout; // 0xAC - RCT12RideId PreviousRide; // 0xAD - uint16_t PreviousRideTimeOut; // 0xAE - RCT12PeepThought Thoughts[Limits::MaxPeepThoughts]; // 0xB0 - uint8_t PathCheckOptimisation; // 0xC4 + uint16_t TimeInQueue; // 0x7A + uint8_t RidesBeenOn[32]; // 0x7C + uint32_t Id; // 0x9C + money32 CashInPocket; // 0xA0 + money32 CashSpent; // 0xA4 + int32_t ParkEntryTime; // 0xA8 + int8_t RejoinQueueTimeout; // 0xAC + RCT12RideId PreviousRide; // 0xAD + uint16_t PreviousRideTimeOut; // 0xAE + RCT12PeepThought Thoughts[Limits::kMaxPeepThoughts]; // 0xB0 + uint8_t PathCheckOptimisation; // 0xC4 union { uint8_t StaffId; // 0xC5 @@ -790,7 +790,7 @@ namespace OpenRCT2::RCT2 RCTObjectEntry Objects[RCT2_OBJECT_ENTRY_COUNT]; struct { - RCTObjectEntry RideObjects[Limits::MaxRideObjects]; + RCTObjectEntry RideObjects[Limits::kMaxRideObjects]; RCTObjectEntry SceneryObjects[Limits::kMaxSmallSceneryObjects]; RCTObjectEntry LargeSceneryObjects[Limits::kMaxLargeSceneryObjects]; RCTObjectEntry WallSceneryObjects[Limits::kMaxWallSceneryObjects]; @@ -845,7 +845,7 @@ namespace OpenRCT2::RCT2 uint16_t GuestsHeadingForPark; // Ignored in scenario - money32 ExpenditureTable[Limits::ExpenditureTableMonthCount][Limits::ExpenditureTypeCount]; + money32 ExpenditureTable[Limits::kExpenditureTableMonthCount][Limits::kExpenditureTypeCount]; // SC6[8] uint16_t LastGuestsInPark; @@ -891,7 +891,7 @@ namespace OpenRCT2::RCT2 uint8_t CampaignRideIndex[22]; // Ignored in scenario - money32 BalanceHistory[Limits::FinanceGraphSize]; + money32 BalanceHistory[Limits::kFinanceGraphSize]; // SC6[11] money32 CurrentExpenditure; @@ -901,13 +901,13 @@ namespace OpenRCT2::RCT2 uint8_t Pad0135833A[2]; // Ignored in scenario - money32 WeeklyProfitHistory[Limits::FinanceGraphSize]; + money32 WeeklyProfitHistory[Limits::kFinanceGraphSize]; // SC6[12] money32 ParkValue; // Ignored in scenario - money32 ParkValueHistory[Limits::FinanceGraphSize]; + money32 ParkValueHistory[Limits::kFinanceGraphSize]; // SC6[13] money32 CompletedCompanyValue; @@ -957,7 +957,7 @@ namespace OpenRCT2::RCT2 char ScenarioFilename[256]; uint8_t SavedExpansionPackNames[3256]; RCT12Banner Banners[Limits::kMaxBanners]; - char CustomStrings[Limits::MaxUserStrings][Limits::MaxUserStringLength]; + char CustomStrings[Limits::kMaxUserStrings][Limits::kMaxUserStringLength]; uint32_t GameTicks1; Ride Rides[Limits::kMaxRidesInPark]; uint16_t SavedAge; // unused @@ -973,8 +973,8 @@ namespace OpenRCT2::RCT2 RCT12RideMeasurement RideMeasurements[8]; uint32_t NextGuestIndex; uint16_t GrassAndSceneryTilepos; - uint32_t PatrolAreas[(Limits::kMaxStaff + Limits::StaffTypeCount) * Limits::PatrolAreaSize]; - StaffMode StaffModes[Limits::kMaxStaff + Limits::StaffTypeCount]; + uint32_t PatrolAreas[(Limits::kMaxStaff + Limits::kStaffTypeCount) * Limits::kPatrolAreaSize]; + StaffMode StaffModes[Limits::kMaxStaff + Limits::kStaffTypeCount]; uint8_t Pad13CA73E; uint8_t Pad13CA73F; uint8_t Byte13CA740; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index c9ccb82b80..91abf668ec 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -363,9 +363,9 @@ namespace OpenRCT2::RCT2 gameState.NumGuestsInPark = _s6.GuestsInPark; gameState.NumGuestsHeadingForPark = _s6.GuestsHeadingForPark; - for (size_t i = 0; i < Limits::ExpenditureTableMonthCount; i++) + for (size_t i = 0; i < Limits::kExpenditureTableMonthCount; i++) { - for (size_t j = 0; j < Limits::ExpenditureTypeCount; j++) + for (size_t j = 0; j < Limits::kExpenditureTypeCount; j++) { gameState.ExpenditureTable[i][j] = ToMoney64(_s6.ExpenditureTable[i][j]); } @@ -435,7 +435,7 @@ namespace OpenRCT2::RCT2 gameState.Park.Value = ToMoney64(_s6.ParkValue); - for (size_t i = 0; i < Limits::FinanceGraphSize; i++) + for (size_t i = 0; i < Limits::kFinanceGraphSize; i++) { gameState.CashHistory[i] = ToMoney64(_s6.BalanceHistory[i]); gameState.WeeklyProfitHistory[i] = ToMoney64(_s6.WeeklyProfitHistory[i]); @@ -1190,7 +1190,7 @@ namespace OpenRCT2::RCT2 { do { - if (srcElement->BaseHeight == RCT12::Limits::MaxElementHeight) + if (srcElement->BaseHeight == RCT12::Limits::kMaxElementHeight) { continue; } @@ -1554,8 +1554,8 @@ namespace OpenRCT2::RCT2 { return; } - int32_t peepOffset = staffId * Limits::PatrolAreaSize; - for (int32_t i = 0; i < Limits::PatrolAreaSize; i++) + int32_t peepOffset = staffId * Limits::kPatrolAreaSize; + for (int32_t i = 0; i < Limits::kPatrolAreaSize; i++) { if (_s6.PatrolAreas[peepOffset + i] == 0) { From fd750130ec0f4f0621feb1c896bd9dae7a3e02e1 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson Date: Tue, 24 Sep 2024 21:27:00 +0100 Subject: [PATCH 6/6] Refactor ShortCutIds.h constants to kCamelCase --- src/openrct2-ui/input/InputManager.cpp | 10 +- src/openrct2-ui/input/ShortcutIds.h | 157 +++++++++++----------- src/openrct2-ui/input/ShortcutManager.cpp | 138 +++++++++---------- src/openrct2-ui/input/Shortcuts.cpp | 156 ++++++++++----------- 4 files changed, 230 insertions(+), 231 deletions(-) diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index 5c4bb40572..9bfe6b471c 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -194,7 +194,7 @@ void InputManager::Process(const InputEvent& e) auto& console = GetInGameConsole(); if (console.IsOpen()) { - if (!shortcutManager.ProcessEventForSpecificShortcut(e, ShortcutId::DebugToggleConsole)) + if (!shortcutManager.ProcessEventForSpecificShortcut(e, ShortcutId::kDebugToggleConsole)) { ProcessInGameConsole(e); } @@ -305,10 +305,10 @@ void InputManager::ProcessHoldEvents() auto& shortcutManager = GetShortcutManager(); if (!shortcutManager.IsPendingShortcutChange()) { - ProcessViewScrollEvent(ShortcutId::ViewScrollUp, { 0, -1 }); - ProcessViewScrollEvent(ShortcutId::ViewScrollDown, { 0, 1 }); - ProcessViewScrollEvent(ShortcutId::ViewScrollLeft, { -1, 0 }); - ProcessViewScrollEvent(ShortcutId::ViewScrollRight, { 1, 0 }); + ProcessViewScrollEvent(ShortcutId::kViewScrollUp, { 0, -1 }); + ProcessViewScrollEvent(ShortcutId::kViewScrollDown, { 0, 1 }); + ProcessViewScrollEvent(ShortcutId::kViewScrollLeft, { -1, 0 }); + ProcessViewScrollEvent(ShortcutId::kViewScrollRight, { 1, 0 }); } } } diff --git a/src/openrct2-ui/input/ShortcutIds.h b/src/openrct2-ui/input/ShortcutIds.h index d7c8bfba03..a8e5dad0a6 100644 --- a/src/openrct2-ui/input/ShortcutIds.h +++ b/src/openrct2-ui/input/ShortcutIds.h @@ -31,97 +31,96 @@ namespace OpenRCT2::Ui::ShortcutId constexpr std::string_view kInterfaceDisableClearance = "interface.misc.disable_clearance"; constexpr std::string_view kInterfaceMultiplayerChat = "interface.misc.multiplayer_chat"; - // Interface / graphics - constexpr std::string_view InterfaceScaleToggleWindowMode = "interface.graphics.toggle_window_mode"; - constexpr std::string_view InterfaceScaleIncrease = "interface.graphics.increase"; - constexpr std::string_view InterfaceScaleDecrease = "interface.graphics.decrease"; + constexpr std::string_view kInterfaceScaleToggleWindowMode = "interface.graphics.toggle_window_mode"; + constexpr std::string_view kInterfaceScaleIncrease = "interface.graphics.increase"; + constexpr std::string_view kInterfaceScaleDecrease = "interface.graphics.decrease"; // Interface / open - constexpr std::string_view InterfaceOpenLand = "interface.open.land"; - constexpr std::string_view InterfaceOpenWater = "interface.open.water"; - constexpr std::string_view InterfaceClearScenery = "interface.open.clear_scenery"; - constexpr std::string_view InterfaceOpenScenery = "interface.open.scenery"; - constexpr std::string_view InterfaceOpenFootpaths = "interface.open.footpaths"; - constexpr std::string_view InterfaceOpenNewRide = "interface.open.new_ride"; - constexpr std::string_view InterfaceOpenFinances = "interface.open.finances"; - constexpr std::string_view InterfaceOpenResearch = "interface.open.research"; - constexpr std::string_view InterfaceOpenRides = "interface.open.rides"; - constexpr std::string_view InterfaceOpenPark = "interface.open.park"; - constexpr std::string_view InterfaceOpenGuests = "interface.open.guests"; - constexpr std::string_view InterfaceOpenStaff = "interface.open.staff"; - constexpr std::string_view InterfaceOpenMessages = "interface.open.messages"; - constexpr std::string_view InterfaceOpenMap = "interface.open.map"; - constexpr std::string_view InterfaceShowOptions = "interface.open.options"; - constexpr std::string_view InterfaceOpenKeyboardShortcuts = "interface.open.keyboard_shortcuts"; - constexpr std::string_view InterfaceOpenTransparencyOptions = "interface.open.transparency_options"; - constexpr std::string_view InterfaceOpenCheats = "interface.open.cheats"; - constexpr std::string_view InterfaceOpenTileInspector = "interface.open.tileinspector"; - constexpr std::string_view InterfaceMultiplayerShow = "interface.open.multiplayer"; + constexpr std::string_view kInterfaceOpenLand = "interface.open.land"; + constexpr std::string_view kInterfaceOpenWater = "interface.open.water"; + constexpr std::string_view kInterfaceClearScenery = "interface.open.clear_scenery"; + constexpr std::string_view kInterfaceOpenScenery = "interface.open.scenery"; + constexpr std::string_view kInterfaceOpenFootpaths = "interface.open.footpaths"; + constexpr std::string_view kInterfaceOpenNewRide = "interface.open.new_ride"; + constexpr std::string_view kInterfaceOpenFinances = "interface.open.finances"; + constexpr std::string_view kInterfaceOpenResearch = "interface.open.research"; + constexpr std::string_view kInterfaceOpenRides = "interface.open.rides"; + constexpr std::string_view kInterfaceOpenPark = "interface.open.park"; + constexpr std::string_view kInterfaceOpenGuests = "interface.open.guests"; + constexpr std::string_view kInterfaceOpenStaff = "interface.open.staff"; + constexpr std::string_view kInterfaceOpenMessages = "interface.open.messages"; + constexpr std::string_view kInterfaceOpenMap = "interface.open.map"; + constexpr std::string_view kInterfaceShowOptions = "interface.open.options"; + constexpr std::string_view kInterfaceOpenKeyboardShortcuts = "interface.open.keyboard_shortcuts"; + constexpr std::string_view kInterfaceOpenTransparencyOptions = "interface.open.transparency_options"; + constexpr std::string_view kInterfaceOpenCheats = "interface.open.cheats"; + constexpr std::string_view kInterfaceOpenTileInspector = "interface.open.tileinspector"; + constexpr std::string_view kInterfaceMultiplayerShow = "interface.open.multiplayer"; // View / general - constexpr std::string_view ViewGeneralZoomOut = "view.general.zoom_out"; - constexpr std::string_view ViewGeneralZoomIn = "view.general.zoom_in"; - constexpr std::string_view ViewGeneralRotateClockwise = "view.general.rotate_clockwise"; - constexpr std::string_view ViewGeneralRotateAnticlockwise = "view.general.rotate_anticlockwise"; + constexpr std::string_view kViewGeneralZoomOut = "view.general.zoom_out"; + constexpr std::string_view kViewGeneralZoomIn = "view.general.zoom_in"; + constexpr std::string_view kViewGeneralRotateClockwise = "view.general.rotate_clockwise"; + constexpr std::string_view kViewGeneralRotateAnticlockwise = "view.general.rotate_anticlockwise"; // View / scroll - constexpr std::string_view ViewScrollUp = "view.scroll.up"; - constexpr std::string_view ViewScrollLeft = "view.scroll.left"; - constexpr std::string_view ViewScrollRight = "view.scroll.right"; - constexpr std::string_view ViewScrollDown = "view.scroll.down"; + constexpr std::string_view kViewScrollUp = "view.scroll.up"; + constexpr std::string_view kViewScrollLeft = "view.scroll.left"; + constexpr std::string_view kViewScrollRight = "view.scroll.right"; + constexpr std::string_view kViewScrollDown = "view.scroll.down"; // View / toggle - constexpr std::string_view ViewToggleUnderground = "view.toggle.show_underground"; - constexpr std::string_view ViewToggleTransparentWater = "view.toggle.transparent_water"; - constexpr std::string_view ViewToggleBaseLand = "view.toggle.hide_base_land"; - constexpr std::string_view ViewToggleVerticalLand = "view.toggle.hide_vertical_land"; - constexpr std::string_view ViewToggleRides = "view.toggle.transparent_rides"; - constexpr std::string_view ViewToggleVehicles = "view.toggle.transparent_vehicles"; - constexpr std::string_view ViewToggleVegetation = "view.toggle.transparent_vegetation"; - constexpr std::string_view ViewToggleScenery = "view.toggle.transparent_scenery"; - constexpr std::string_view ViewToggleFootpaths = "view.toggle.transparent_footpaths"; - constexpr std::string_view ViewToggleSupports = "view.toggle.hide_supports"; - constexpr std::string_view ViewToggleGuests = "view.toggle.hide_guests"; - constexpr std::string_view ViewToggleStaff = "view.toggle.hide_staff"; - constexpr std::string_view ViewToggleLandHeightMarkers = "view.toggle.show_land_height"; - constexpr std::string_view ViewToggleTrackHeightMarkers = "view.toggle.show_track_height"; - constexpr std::string_view ViewToggleFootpathHeightMarkers = "view.toggle.show_footpath_height"; - constexpr std::string_view ViewToggleGridlines = "view.toggle.show_gridlines"; - constexpr std::string_view ViewToggleCutAway = "view.toggle.toggle_cut_away"; - constexpr std::string_view ViewToogleFootpathIssues = "view.toggle.highlight_path_issues"; + constexpr std::string_view kViewToggleUnderground = "view.toggle.show_underground"; + constexpr std::string_view kViewToggleTransparentWater = "view.toggle.transparent_water"; + constexpr std::string_view kViewToggleBaseLand = "view.toggle.hide_base_land"; + constexpr std::string_view kViewToggleVerticalLand = "view.toggle.hide_vertical_land"; + constexpr std::string_view kViewToggleRides = "view.toggle.transparent_rides"; + constexpr std::string_view kViewToggleVehicles = "view.toggle.transparent_vehicles"; + constexpr std::string_view kViewToggleVegetation = "view.toggle.transparent_vegetation"; + constexpr std::string_view kViewToggleScenery = "view.toggle.transparent_scenery"; + constexpr std::string_view kViewToggleFootpaths = "view.toggle.transparent_footpaths"; + constexpr std::string_view kViewToggleSupports = "view.toggle.hide_supports"; + constexpr std::string_view kViewToggleGuests = "view.toggle.hide_guests"; + constexpr std::string_view kViewToggleStaff = "view.toggle.hide_staff"; + constexpr std::string_view kViewToggleLandHeightMarkers = "view.toggle.show_land_height"; + constexpr std::string_view kViewToggleTrackHeightMarkers = "view.toggle.show_track_height"; + constexpr std::string_view kViewToggleFootpathHeightMarkers = "view.toggle.show_footpath_height"; + constexpr std::string_view kViewToggleGridlines = "view.toggle.show_gridlines"; + constexpr std::string_view kViewToggleCutAway = "view.toggle.toggle_cut_away"; + constexpr std::string_view kViewToggleFootpathIssues = "view.toggle.highlight_path_issues"; // Window / ride construction - constexpr std::string_view WindowRideConstructionTurnLeft = "window.rideconstruction.turn_left"; - constexpr std::string_view WindowRideConstructionTurnRight = "window.rideconstruction.turn_right"; - constexpr std::string_view WindowRideConstructionDefault = "window.rideconstruction.default"; - constexpr std::string_view WindowRideConstructionSlopeDown = "window.rideconstruction.slope_down"; - constexpr std::string_view WindowRideConstructionSlopeUp = "window.rideconstruction.slope_up"; - constexpr std::string_view WindowRideConstructionChainLift = "window.rideconstruction.chain_lift"; - constexpr std::string_view WindowRideConstructionBankLeft = "window.rideconstruction.bank_left"; - constexpr std::string_view WindowRideConstructionBankRight = "window.rideconstruction.bank_right"; - constexpr std::string_view WindowRideConstructionPrevious = "window.rideconstruction.previous"; - constexpr std::string_view WindowRideConstructionNext = "window.rideconstruction.next"; - constexpr std::string_view WindowRideConstructionBuild = "window.rideconstruction.build"; - constexpr std::string_view WindowRideConstructionDemolish = "window.rideconstruction.demolish"; + constexpr std::string_view kWindowRideConstructionTurnLeft = "window.rideconstruction.turn_left"; + constexpr std::string_view kWindowRideConstructionTurnRight = "window.rideconstruction.turn_right"; + constexpr std::string_view kWindowRideConstructionDefault = "window.rideconstruction.default"; + constexpr std::string_view kWindowRideConstructionSlopeDown = "window.rideconstruction.slope_down"; + constexpr std::string_view kWindowRideConstructionSlopeUp = "window.rideconstruction.slope_up"; + constexpr std::string_view kWindowRideConstructionChainLift = "window.rideconstruction.chain_lift"; + constexpr std::string_view kWindowRideConstructionBankLeft = "window.rideconstruction.bank_left"; + constexpr std::string_view kWindowRideConstructionBankRight = "window.rideconstruction.bank_right"; + constexpr std::string_view kWindowRideConstructionPrevious = "window.rideconstruction.previous"; + constexpr std::string_view kWindowRideConstructionNext = "window.rideconstruction.next"; + constexpr std::string_view kWindowRideConstructionBuild = "window.rideconstruction.build"; + constexpr std::string_view kWindowRideConstructionDemolish = "window.rideconstruction.demolish"; // Window / tile inspector - constexpr std::string_view WindowTileInspectorToggleInvisibility = "window.tileinspector.toggle_invisibility"; - constexpr std::string_view WindowTileInspectorCopy = "window.tileinspector.copy"; - constexpr std::string_view WindowTileInspectorPaste = "window.tileinspector.paste"; - constexpr std::string_view WindowTileInspectorSort = "window.tileinspector.sort"; - constexpr std::string_view WindowTileInspectorRemove = "window.tileinspector.remove"; - constexpr std::string_view WindowTileInspectorMoveUp = "window.tileinspector.move_up"; - constexpr std::string_view WindowTileInspectorMoveDown = "window.tileinspector.move_down"; - constexpr std::string_view WindowTileInspectorIncreaseX = "window.tileinspector.increase_x"; - constexpr std::string_view WindowTileInspectorDecreaseX = "window.tileinspector.decrease_x"; - constexpr std::string_view WindowTileInspectorIncreaseY = "window.tileinspector.increase_y"; - constexpr std::string_view WindowTileInspectorDecreaseY = "window.tileinspector.decrease_y"; - constexpr std::string_view WindowTileInspectorIncreaseHeight = "window.tileinspector.increase_height"; - constexpr std::string_view WindowTileInspectorDecreaseHeight = "window.tileinspector.decrease_height"; - constexpr std::string_view WindowTileInspectorChangeWallSlope = "window.tileinspector.toggle_wall_slope"; + constexpr std::string_view kWindowTileInspectorToggleInvisibility = "window.tileinspector.toggle_invisibility"; + constexpr std::string_view kWindowTileInspectorCopy = "window.tileinspector.copy"; + constexpr std::string_view kWindowTileInspectorPaste = "window.tileinspector.paste"; + constexpr std::string_view kWindowTileInspectorSort = "window.tileinspector.sort"; + constexpr std::string_view kWindowTileInspectorRemove = "window.tileinspector.remove"; + constexpr std::string_view kWindowTileInspectorMoveUp = "window.tileinspector.move_up"; + constexpr std::string_view kWindowTileInspectorMoveDown = "window.tileinspector.move_down"; + constexpr std::string_view kWindowTileInspectorIncreaseX = "window.tileinspector.increase_x"; + constexpr std::string_view kWindowTileInspectorDecreaseX = "window.tileinspector.decrease_x"; + constexpr std::string_view kWindowTileInspectorIncreaseY = "window.tileinspector.increase_y"; + constexpr std::string_view kWindowTileInspectorDecreaseY = "window.tileinspector.decrease_y"; + constexpr std::string_view kWindowTileInspectorIncreaseHeight = "window.tileinspector.increase_height"; + constexpr std::string_view kWindowTileInspectorDecreaseHeight = "window.tileinspector.decrease_height"; + constexpr std::string_view kWindowTileInspectorChangeWallSlope = "window.tileinspector.toggle_wall_slope"; // Debug - constexpr std::string_view DebugToggleConsole = "debug.console"; - constexpr std::string_view DebugTogglePaintDebugWindow = "debug.toggle_paint_debug_window"; - constexpr std::string_view DebugAdvanceTick = "debug.advance_tick"; + constexpr std::string_view kDebugToggleConsole = "debug.console"; + constexpr std::string_view kDebugTogglePaintDebugWindow = "debug.toggle_paint_debug_window"; + constexpr std::string_view kDebugAdvanceTick = "debug.advance_tick"; } // namespace OpenRCT2::Ui::ShortcutId diff --git a/src/openrct2-ui/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index d11ca7723c..a24f6853ca 100644 --- a/src/openrct2-ui/input/ShortcutManager.cpp +++ b/src/openrct2-ui/input/ShortcutManager.cpp @@ -360,86 +360,86 @@ std::string_view ShortcutManager::GetLegacyShortcutId(size_t index) ShortcutId::kInterfaceCloseAll, ShortcutId::kInterfaceCancelConstruction, ShortcutId::kInterfacePause, - ShortcutId::ViewGeneralZoomOut, - ShortcutId::ViewGeneralZoomIn, - ShortcutId::ViewGeneralRotateClockwise, - ShortcutId::ViewGeneralRotateAnticlockwise, + ShortcutId::kViewGeneralZoomOut, + ShortcutId::kViewGeneralZoomIn, + ShortcutId::kViewGeneralRotateClockwise, + ShortcutId::kViewGeneralRotateAnticlockwise, ShortcutId::kInterfaceRotateConstruction, - ShortcutId::ViewToggleUnderground, - ShortcutId::ViewToggleBaseLand, - ShortcutId::ViewToggleVerticalLand, - ShortcutId::ViewToggleRides, - ShortcutId::ViewToggleScenery, - ShortcutId::ViewToggleSupports, - ShortcutId::ViewToggleGuests, - ShortcutId::ViewToggleLandHeightMarkers, - ShortcutId::ViewToggleTrackHeightMarkers, - ShortcutId::ViewToggleFootpathHeightMarkers, - ShortcutId::InterfaceOpenLand, - ShortcutId::InterfaceOpenWater, - ShortcutId::InterfaceOpenScenery, - ShortcutId::InterfaceOpenFootpaths, - ShortcutId::InterfaceOpenNewRide, - ShortcutId::InterfaceOpenFinances, - ShortcutId::InterfaceOpenResearch, - ShortcutId::InterfaceOpenRides, - ShortcutId::InterfaceOpenPark, - ShortcutId::InterfaceOpenGuests, - ShortcutId::InterfaceOpenStaff, - ShortcutId::InterfaceOpenMessages, - ShortcutId::InterfaceOpenMap, + ShortcutId::kViewToggleUnderground, + ShortcutId::kViewToggleBaseLand, + ShortcutId::kViewToggleVerticalLand, + ShortcutId::kViewToggleRides, + ShortcutId::kViewToggleScenery, + ShortcutId::kViewToggleSupports, + ShortcutId::kViewToggleGuests, + ShortcutId::kViewToggleLandHeightMarkers, + ShortcutId::kViewToggleTrackHeightMarkers, + ShortcutId::kViewToggleFootpathHeightMarkers, + ShortcutId::kInterfaceOpenLand, + ShortcutId::kInterfaceOpenWater, + ShortcutId::kInterfaceOpenScenery, + ShortcutId::kInterfaceOpenFootpaths, + ShortcutId::kInterfaceOpenNewRide, + ShortcutId::kInterfaceOpenFinances, + ShortcutId::kInterfaceOpenResearch, + ShortcutId::kInterfaceOpenRides, + ShortcutId::kInterfaceOpenPark, + ShortcutId::kInterfaceOpenGuests, + ShortcutId::kInterfaceOpenStaff, + ShortcutId::kInterfaceOpenMessages, + ShortcutId::kInterfaceOpenMap, ShortcutId::kInterfaceScreenshot, ShortcutId::kInterfaceDecreaseSpeed, ShortcutId::kInterfaceIncreaseSpeed, - ShortcutId::InterfaceOpenCheats, + ShortcutId::kInterfaceOpenCheats, ShortcutId::kInterfaceToggleToolbars, - ShortcutId::ViewScrollUp, - ShortcutId::ViewScrollLeft, - ShortcutId::ViewScrollDown, - ShortcutId::ViewScrollRight, + ShortcutId::kViewScrollUp, + ShortcutId::kViewScrollLeft, + ShortcutId::kViewScrollDown, + ShortcutId::kViewScrollRight, ShortcutId::kInterfaceMultiplayerChat, ShortcutId::kInterfaceSaveGame, - ShortcutId::InterfaceShowOptions, + ShortcutId::kInterfaceShowOptions, ShortcutId::kInterfaceMute, - ShortcutId::InterfaceScaleToggleWindowMode, - ShortcutId::InterfaceMultiplayerShow, + ShortcutId::kInterfaceScaleToggleWindowMode, + ShortcutId::kInterfaceMultiplayerShow, std::string_view(), - ShortcutId::DebugTogglePaintDebugWindow, - ShortcutId::ViewToggleFootpaths, - ShortcutId::WindowRideConstructionTurnLeft, - ShortcutId::WindowRideConstructionTurnRight, - ShortcutId::WindowRideConstructionDefault, - ShortcutId::WindowRideConstructionSlopeDown, - ShortcutId::WindowRideConstructionSlopeUp, - ShortcutId::WindowRideConstructionChainLift, - ShortcutId::WindowRideConstructionBankLeft, - ShortcutId::WindowRideConstructionBankRight, - ShortcutId::WindowRideConstructionPrevious, - ShortcutId::WindowRideConstructionNext, - ShortcutId::WindowRideConstructionBuild, - ShortcutId::WindowRideConstructionDemolish, + ShortcutId::kDebugTogglePaintDebugWindow, + ShortcutId::kViewToggleFootpaths, + ShortcutId::kWindowRideConstructionTurnLeft, + ShortcutId::kWindowRideConstructionTurnRight, + ShortcutId::kWindowRideConstructionDefault, + ShortcutId::kWindowRideConstructionSlopeDown, + ShortcutId::kWindowRideConstructionSlopeUp, + ShortcutId::kWindowRideConstructionChainLift, + ShortcutId::kWindowRideConstructionBankLeft, + ShortcutId::kWindowRideConstructionBankRight, + ShortcutId::kWindowRideConstructionPrevious, + ShortcutId::kWindowRideConstructionNext, + ShortcutId::kWindowRideConstructionBuild, + ShortcutId::kWindowRideConstructionDemolish, ShortcutId::kInterfaceLoadGame, - ShortcutId::InterfaceClearScenery, - ShortcutId::ViewToggleGridlines, - ShortcutId::ViewToggleCutAway, - ShortcutId::ViewToogleFootpathIssues, - ShortcutId::InterfaceOpenTileInspector, - ShortcutId::DebugAdvanceTick, + ShortcutId::kInterfaceClearScenery, + ShortcutId::kViewToggleGridlines, + ShortcutId::kViewToggleCutAway, + ShortcutId::kViewToggleFootpathIssues, + ShortcutId::kInterfaceOpenTileInspector, + ShortcutId::kDebugAdvanceTick, ShortcutId::kInterfaceSceneryPicker, - ShortcutId::InterfaceScaleIncrease, - ShortcutId::InterfaceScaleDecrease, - ShortcutId::WindowTileInspectorToggleInvisibility, - ShortcutId::WindowTileInspectorCopy, - ShortcutId::WindowTileInspectorPaste, - ShortcutId::WindowTileInspectorRemove, - ShortcutId::WindowTileInspectorMoveUp, - ShortcutId::WindowTileInspectorMoveDown, - ShortcutId::WindowTileInspectorIncreaseX, - ShortcutId::WindowTileInspectorDecreaseX, - ShortcutId::WindowTileInspectorIncreaseY, - ShortcutId::WindowTileInspectorDecreaseY, - ShortcutId::WindowTileInspectorIncreaseHeight, - ShortcutId::WindowTileInspectorDecreaseHeight, + ShortcutId::kInterfaceScaleIncrease, + ShortcutId::kInterfaceScaleDecrease, + ShortcutId::kWindowTileInspectorToggleInvisibility, + ShortcutId::kWindowTileInspectorCopy, + ShortcutId::kWindowTileInspectorPaste, + ShortcutId::kWindowTileInspectorRemove, + ShortcutId::kWindowTileInspectorMoveUp, + ShortcutId::kWindowTileInspectorMoveDown, + ShortcutId::kWindowTileInspectorIncreaseX, + ShortcutId::kWindowTileInspectorDecreaseX, + ShortcutId::kWindowTileInspectorIncreaseY, + ShortcutId::kWindowTileInspectorDecreaseY, + ShortcutId::kWindowTileInspectorIncreaseHeight, + ShortcutId::kWindowTileInspectorDecreaseHeight, ShortcutId::kInterfaceDisableClearance, }; return index < std::size(_legacyMap) ? _legacyMap[index] : std::string_view(); diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index f864305897..10a1dad985 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -777,34 +777,34 @@ void ShortcutManager::RegisterDefaultShortcuts() ChatToggle(); } }); - RegisterShortcut(ShortcutId::InterfaceScaleToggleWindowMode, STR_SHORTCUT_WINDOWED_MODE_TOGGLE, "ALT+RETURN", ToggleWindowedMode); - RegisterShortcut(ShortcutId::InterfaceScaleIncrease, STR_SHORTCUT_SCALE_UP, ShortcutScaleUp); - RegisterShortcut(ShortcutId::InterfaceScaleDecrease, STR_SHORTCUT_SCALE_DOWN, ShortcutScaleDown); - RegisterShortcut(ShortcutId::InterfaceOpenLand, STR_SHORTCUT_ADJUST_LAND, "F1", ShortcutAdjustLand); - RegisterShortcut(ShortcutId::InterfaceOpenWater, STR_SHORTCUT_ADJUST_WATER, "F2", ShortcutAdjustWater); - RegisterShortcut(ShortcutId::InterfaceClearScenery, STR_SHORTCUT_CLEAR_SCENERY, "B", ShortcutClearScenery); - RegisterShortcut(ShortcutId::InterfaceOpenScenery, STR_SHORTCUT_BUILD_SCENERY, "F3", ShortcutBuildScenery); - RegisterShortcut(ShortcutId::InterfaceOpenFootpaths, STR_SHORTCUT_BUILD_PATHS, "F4", ShortcutBuildPaths); - RegisterShortcut(ShortcutId::InterfaceOpenNewRide, STR_SHORTCUT_BUILD_NEW_RIDE, "F5", ShortcutBuildNewRide); - RegisterShortcut(ShortcutId::InterfaceOpenFinances, STR_SHORTCUT_SHOW_FINANCIAL_INFORMATION, "F", ShortcutShowFinancialInformation); - RegisterShortcut(ShortcutId::InterfaceOpenResearch, STR_SHORTCUT_SHOW_RESEARCH_INFORMATION, "D", ShortcutShowResearchInformation); - RegisterShortcut(ShortcutId::InterfaceOpenRides, STR_SHORTCUT_SHOW_RIDES_LIST, "R", ShortcutShowRidesList); - RegisterShortcut(ShortcutId::InterfaceOpenPark, STR_SHORTCUT_SHOW_PARK_INFORMATION, "P", ShortcutShowParkInformation); - RegisterShortcut(ShortcutId::InterfaceOpenGuests, STR_SHORTCUT_SHOW_GUEST_LIST, "G", ShortcutShowGuestList); - RegisterShortcut(ShortcutId::InterfaceOpenStaff, STR_SHORTCUT_SHOW_STAFF_LIST, "S", ShortcutShowStaffList); - RegisterShortcut(ShortcutId::InterfaceOpenMessages, STR_SHORTCUT_SHOW_RECENT_MESSAGES, "M", ShortcutShowRecentMessages); - RegisterShortcut(ShortcutId::InterfaceOpenMap, STR_SHORTCUT_SHOW_MAP, "TAB", ShortcutShowMap); - RegisterShortcut(ShortcutId::InterfaceShowOptions, STR_SHORTCUT_SHOW_OPTIONS, std::bind(ContextOpenWindow, WindowClass::Options)); - RegisterShortcut(ShortcutId::InterfaceOpenKeyboardShortcuts, STR_SHORTCUT_OPEN_KEYBOARD_SHORTCUTS_WINDOW, "SHIFT+/", ShortcutOpenKeyboardShortcutsWindow); - RegisterShortcut(ShortcutId::InterfaceOpenTransparencyOptions, STR_SHORTCUT_OPEN_TRANSPARENCY_OPTIONS, "CTRL+T", ShortcutOpenTransparencyWindow); - RegisterShortcut(ShortcutId::InterfaceOpenCheats, STR_SHORTCUT_OPEN_CHEATS_WINDOW, "CTRL+ALT+C", ShortcutOpenCheatWindow); - RegisterShortcut(ShortcutId::InterfaceOpenTileInspector, STR_SHORTCUT_OPEN_TILE_INSPECTOR, []() { + RegisterShortcut(ShortcutId::kInterfaceScaleToggleWindowMode, STR_SHORTCUT_WINDOWED_MODE_TOGGLE, "ALT+RETURN", ToggleWindowedMode); + RegisterShortcut(ShortcutId::kInterfaceScaleIncrease, STR_SHORTCUT_SCALE_UP, ShortcutScaleUp); + RegisterShortcut(ShortcutId::kInterfaceScaleDecrease, STR_SHORTCUT_SCALE_DOWN, ShortcutScaleDown); + RegisterShortcut(ShortcutId::kInterfaceOpenLand, STR_SHORTCUT_ADJUST_LAND, "F1", ShortcutAdjustLand); + RegisterShortcut(ShortcutId::kInterfaceOpenWater, STR_SHORTCUT_ADJUST_WATER, "F2", ShortcutAdjustWater); + RegisterShortcut(ShortcutId::kInterfaceClearScenery, STR_SHORTCUT_CLEAR_SCENERY, "B", ShortcutClearScenery); + RegisterShortcut(ShortcutId::kInterfaceOpenScenery, STR_SHORTCUT_BUILD_SCENERY, "F3", ShortcutBuildScenery); + RegisterShortcut(ShortcutId::kInterfaceOpenFootpaths, STR_SHORTCUT_BUILD_PATHS, "F4", ShortcutBuildPaths); + RegisterShortcut(ShortcutId::kInterfaceOpenNewRide, STR_SHORTCUT_BUILD_NEW_RIDE, "F5", ShortcutBuildNewRide); + RegisterShortcut(ShortcutId::kInterfaceOpenFinances, STR_SHORTCUT_SHOW_FINANCIAL_INFORMATION, "F", ShortcutShowFinancialInformation); + RegisterShortcut(ShortcutId::kInterfaceOpenResearch, STR_SHORTCUT_SHOW_RESEARCH_INFORMATION, "D", ShortcutShowResearchInformation); + RegisterShortcut(ShortcutId::kInterfaceOpenRides, STR_SHORTCUT_SHOW_RIDES_LIST, "R", ShortcutShowRidesList); + RegisterShortcut(ShortcutId::kInterfaceOpenPark, STR_SHORTCUT_SHOW_PARK_INFORMATION, "P", ShortcutShowParkInformation); + RegisterShortcut(ShortcutId::kInterfaceOpenGuests, STR_SHORTCUT_SHOW_GUEST_LIST, "G", ShortcutShowGuestList); + RegisterShortcut(ShortcutId::kInterfaceOpenStaff, STR_SHORTCUT_SHOW_STAFF_LIST, "S", ShortcutShowStaffList); + RegisterShortcut(ShortcutId::kInterfaceOpenMessages, STR_SHORTCUT_SHOW_RECENT_MESSAGES, "M", ShortcutShowRecentMessages); + RegisterShortcut(ShortcutId::kInterfaceOpenMap, STR_SHORTCUT_SHOW_MAP, "TAB", ShortcutShowMap); + RegisterShortcut(ShortcutId::kInterfaceShowOptions, STR_SHORTCUT_SHOW_OPTIONS, std::bind(ContextOpenWindow, WindowClass::Options)); + RegisterShortcut(ShortcutId::kInterfaceOpenKeyboardShortcuts, STR_SHORTCUT_OPEN_KEYBOARD_SHORTCUTS_WINDOW, "SHIFT+/", ShortcutOpenKeyboardShortcutsWindow); + RegisterShortcut(ShortcutId::kInterfaceOpenTransparencyOptions, STR_SHORTCUT_OPEN_TRANSPARENCY_OPTIONS, "CTRL+T", ShortcutOpenTransparencyWindow); + RegisterShortcut(ShortcutId::kInterfaceOpenCheats, STR_SHORTCUT_OPEN_CHEATS_WINDOW, "CTRL+ALT+C", ShortcutOpenCheatWindow); + RegisterShortcut(ShortcutId::kInterfaceOpenTileInspector, STR_SHORTCUT_OPEN_TILE_INSPECTOR, []() { if (Config::Get().interface.ToolbarShowCheats) { OpenWindow(WindowClass::TileInspector); } }); - RegisterShortcut(ShortcutId::InterfaceMultiplayerShow, STR_SHORTCUT_SHOW_MULTIPLAYER, []() { + RegisterShortcut(ShortcutId::kInterfaceMultiplayerShow, STR_SHORTCUT_SHOW_MULTIPLAYER, []() { if (NetworkGetMode() != NETWORK_MODE_NONE) { OpenWindow(WindowClass::Multiplayer); @@ -812,70 +812,70 @@ void ShortcutManager::RegisterDefaultShortcuts() }); // View - RegisterShortcut(ShortcutId::ViewGeneralZoomOut, STR_SHORTCUT_ZOOM_VIEW_OUT, "PAGEUP", std::bind(MainWindowZoom, false, false)); - RegisterShortcut(ShortcutId::ViewGeneralZoomIn, STR_SHORTCUT_ZOOM_VIEW_IN, "PAGEDOWN", std::bind(MainWindowZoom, true, false)); - RegisterShortcut(ShortcutId::ViewGeneralRotateClockwise, STR_SHORTCUT_ROTATE_VIEW_CLOCKWISE, "RETURN", "MOUSE 6", std::bind(RotateCamera, 1)); - RegisterShortcut(ShortcutId::ViewGeneralRotateAnticlockwise, STR_SHORTCUT_ROTATE_VIEW_ANTICLOCKWISE, "SHIFT+RETURN", "MOUSE 5", std::bind(RotateCamera, -1)); - RegisterShortcut(ShortcutId::ViewScrollUp, STR_SHORTCUT_SCROLL_MAP_UP, "UP", []() {}); - RegisterShortcut(ShortcutId::ViewScrollLeft, STR_SHORTCUT_SCROLL_MAP_LEFT, "LEFT", []() {}); - RegisterShortcut(ShortcutId::ViewScrollRight, STR_SHORTCUT_SCROLL_MAP_RIGHT, "RIGHT", []() {}); - RegisterShortcut(ShortcutId::ViewScrollDown, STR_SHORTCUT_SCROLL_MAP_DOWN, "DOWN", []() {}); - RegisterShortcut(ShortcutId::ViewToggleUnderground, STR_SHORTCUT_UNDERGROUND_VIEW_TOGGLE, "1", std::bind(ToggleViewFlag, VIEWPORT_FLAG_UNDERGROUND_INSIDE)); - RegisterShortcut(ShortcutId::ViewToggleTransparentWater, STR_VIEWPORT_TRANSPARENT_WATER, "2", ShortcutToggleTransparentWater); - RegisterShortcut(ShortcutId::ViewToggleBaseLand, STR_SHORTCUT_REMOVE_BASE_LAND_TOGGLE, "H", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_BASE)); - RegisterShortcut(ShortcutId::ViewToggleVerticalLand, STR_SHORTCUT_REMOVE_VERTICAL_LAND_TOGGLE, "V", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_VERTICAL)); - RegisterShortcut(ShortcutId::ViewToggleRides, STR_SHORTCUT_SEE_THROUGH_RIDES_TOGGLE, "3", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_RIDES)); - RegisterShortcut(ShortcutId::ViewToggleVehicles, STR_SHORTCUT_SEE_THROUGH_VEHICLES_TOGGLE, std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_VEHICLES)); - RegisterShortcut(ShortcutId::ViewToggleVegetation, STR_SHORTCUT_SEE_THROUGH_VEGETATION_TOGGLE, std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_VEGETATION)); - RegisterShortcut(ShortcutId::ViewToggleScenery, STR_SHORTCUT_SEE_THROUGH_SCENERY_TOGGLE, "4", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_SCENERY)); - RegisterShortcut(ShortcutId::ViewToggleFootpaths, STR_SHORTCUT_SEE_THROUGH_PATHS_TOGGLE, std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_PATHS)); - RegisterShortcut(ShortcutId::ViewToggleSupports, STR_SHORTCUT_INVISIBLE_SUPPORTS_TOGGLE, "5", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_SUPPORTS)); - RegisterShortcut(ShortcutId::ViewToggleGuests, STR_SHORTCUT_SEE_THROUGH_GUESTS_TOGGLE, "6", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_GUESTS)); - RegisterShortcut(ShortcutId::ViewToggleStaff, STR_SHORTCUT_SEE_THROUGH_STAFF_TOGGLE, std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_STAFF)); - RegisterShortcut(ShortcutId::ViewToggleLandHeightMarkers, STR_SHORTCUT_HEIGHT_MARKS_ON_LAND_TOGGLE, "8", std::bind(ToggleViewFlag, VIEWPORT_FLAG_LAND_HEIGHTS)); - RegisterShortcut(ShortcutId::ViewToggleTrackHeightMarkers, STR_SHORTCUT_HEIGHT_MARKS_ON_RIDE_TRACKS_TOGGLE, "9", std::bind(ToggleViewFlag, VIEWPORT_FLAG_TRACK_HEIGHTS)); - RegisterShortcut(ShortcutId::ViewToggleFootpathHeightMarkers, STR_SHORTCUT_HEIGHT_MARKS_ON_PATHS_TOGGLE, "0", std::bind(ToggleViewFlag, VIEWPORT_FLAG_PATH_HEIGHTS)); - RegisterShortcut(ShortcutId::ViewToggleGridlines, STR_SHORTCUT_GRIDLINES_DISPLAY_TOGGLE, "7", std::bind(ToggleViewFlag, VIEWPORT_FLAG_GRIDLINES)); - RegisterShortcut(ShortcutId::ViewToggleCutAway, STR_SHORTCUT_VIEW_CLIPPING, std::bind(OpenWindow, WindowClass::ViewClipping)); - RegisterShortcut(ShortcutId::ViewToogleFootpathIssues, STR_SHORTCUT_HIGHLIGHT_PATH_ISSUES_TOGGLE, "I", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)); + RegisterShortcut(ShortcutId::kViewGeneralZoomOut, STR_SHORTCUT_ZOOM_VIEW_OUT, "PAGEUP", std::bind(MainWindowZoom, false, false)); + RegisterShortcut(ShortcutId::kViewGeneralZoomIn, STR_SHORTCUT_ZOOM_VIEW_IN, "PAGEDOWN", std::bind(MainWindowZoom, true, false)); + RegisterShortcut(ShortcutId::kViewGeneralRotateClockwise, STR_SHORTCUT_ROTATE_VIEW_CLOCKWISE, "RETURN", "MOUSE 6", std::bind(RotateCamera, 1)); + RegisterShortcut(ShortcutId::kViewGeneralRotateAnticlockwise, STR_SHORTCUT_ROTATE_VIEW_ANTICLOCKWISE, "SHIFT+RETURN", "MOUSE 5", std::bind(RotateCamera, -1)); + RegisterShortcut(ShortcutId::kViewScrollUp, STR_SHORTCUT_SCROLL_MAP_UP, "UP", []() {}); + RegisterShortcut(ShortcutId::kViewScrollLeft, STR_SHORTCUT_SCROLL_MAP_LEFT, "LEFT", []() {}); + RegisterShortcut(ShortcutId::kViewScrollRight, STR_SHORTCUT_SCROLL_MAP_RIGHT, "RIGHT", []() {}); + RegisterShortcut(ShortcutId::kViewScrollDown, STR_SHORTCUT_SCROLL_MAP_DOWN, "DOWN", []() {}); + RegisterShortcut(ShortcutId::kViewToggleUnderground, STR_SHORTCUT_UNDERGROUND_VIEW_TOGGLE, "1", std::bind(ToggleViewFlag, VIEWPORT_FLAG_UNDERGROUND_INSIDE)); + RegisterShortcut(ShortcutId::kViewToggleTransparentWater, STR_VIEWPORT_TRANSPARENT_WATER, "2", ShortcutToggleTransparentWater); + RegisterShortcut(ShortcutId::kViewToggleBaseLand, STR_SHORTCUT_REMOVE_BASE_LAND_TOGGLE, "H", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_BASE)); + RegisterShortcut(ShortcutId::kViewToggleVerticalLand, STR_SHORTCUT_REMOVE_VERTICAL_LAND_TOGGLE, "V", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_VERTICAL)); + RegisterShortcut(ShortcutId::kViewToggleRides, STR_SHORTCUT_SEE_THROUGH_RIDES_TOGGLE, "3", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_RIDES)); + RegisterShortcut(ShortcutId::kViewToggleVehicles, STR_SHORTCUT_SEE_THROUGH_VEHICLES_TOGGLE, std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_VEHICLES)); + RegisterShortcut(ShortcutId::kViewToggleVegetation, STR_SHORTCUT_SEE_THROUGH_VEGETATION_TOGGLE, std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_VEGETATION)); + RegisterShortcut(ShortcutId::kViewToggleScenery, STR_SHORTCUT_SEE_THROUGH_SCENERY_TOGGLE, "4", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_SCENERY)); + RegisterShortcut(ShortcutId::kViewToggleFootpaths, STR_SHORTCUT_SEE_THROUGH_PATHS_TOGGLE, std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_PATHS)); + RegisterShortcut(ShortcutId::kViewToggleSupports, STR_SHORTCUT_INVISIBLE_SUPPORTS_TOGGLE, "5", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_SUPPORTS)); + RegisterShortcut(ShortcutId::kViewToggleGuests, STR_SHORTCUT_SEE_THROUGH_GUESTS_TOGGLE, "6", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_GUESTS)); + RegisterShortcut(ShortcutId::kViewToggleStaff, STR_SHORTCUT_SEE_THROUGH_STAFF_TOGGLE, std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIDE_STAFF)); + RegisterShortcut(ShortcutId::kViewToggleLandHeightMarkers, STR_SHORTCUT_HEIGHT_MARKS_ON_LAND_TOGGLE, "8", std::bind(ToggleViewFlag, VIEWPORT_FLAG_LAND_HEIGHTS)); + RegisterShortcut(ShortcutId::kViewToggleTrackHeightMarkers, STR_SHORTCUT_HEIGHT_MARKS_ON_RIDE_TRACKS_TOGGLE, "9", std::bind(ToggleViewFlag, VIEWPORT_FLAG_TRACK_HEIGHTS)); + RegisterShortcut(ShortcutId::kViewToggleFootpathHeightMarkers, STR_SHORTCUT_HEIGHT_MARKS_ON_PATHS_TOGGLE, "0", std::bind(ToggleViewFlag, VIEWPORT_FLAG_PATH_HEIGHTS)); + RegisterShortcut(ShortcutId::kViewToggleGridlines, STR_SHORTCUT_GRIDLINES_DISPLAY_TOGGLE, "7", std::bind(ToggleViewFlag, VIEWPORT_FLAG_GRIDLINES)); + RegisterShortcut(ShortcutId::kViewToggleCutAway, STR_SHORTCUT_VIEW_CLIPPING, std::bind(OpenWindow, WindowClass::ViewClipping)); + RegisterShortcut(ShortcutId::kViewToggleFootpathIssues, STR_SHORTCUT_HIGHLIGHT_PATH_ISSUES_TOGGLE, "I", std::bind(ToggleViewFlag, VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)); // Window - RegisterShortcut(ShortcutId::WindowRideConstructionTurnLeft, STR_SHORTCUT_CONSTRUCTION_TURN_LEFT, "NUMPAD 4", ShortcutConstructionTurnLeft); - RegisterShortcut(ShortcutId::WindowRideConstructionTurnRight, STR_SHORTCUT_CONSTRUCTION_TURN_RIGHT, "NUMPAD 6", ShortcutConstructionTurnRight); - RegisterShortcut(ShortcutId::WindowRideConstructionDefault, STR_SHORTCUT_CONSTRUCTION_USE_TRACK_DEFAULT, "NUMPAD 5", WindowRideConstructionKeyboardShortcutUseTrackDefault); - RegisterShortcut(ShortcutId::WindowRideConstructionSlopeDown, STR_SHORTCUT_CONSTRUCTION_SLOPE_DOWN, "NUMPAD 2", ShortcutConstructionSlopeDown); - RegisterShortcut(ShortcutId::WindowRideConstructionSlopeUp, STR_SHORTCUT_CONSTRUCTION_SLOPE_UP, "NUMPAD 8", ShortcutConstructionSlopeUp); - RegisterShortcut(ShortcutId::WindowRideConstructionChainLift, STR_SHORTCUT_CONSTRUCTION_CHAIN_LIFT_TOGGLE, "NUMPAD +", WindowRideConstructionKeyboardShortcutChainLiftToggle); - RegisterShortcut(ShortcutId::WindowRideConstructionBankLeft, STR_SHORTCUT_CONSTRUCTION_BANK_LEFT, "NUMPAD 1", WindowRideConstructionKeyboardShortcutBankLeft); - RegisterShortcut(ShortcutId::WindowRideConstructionBankRight, STR_SHORTCUT_CONSTRUCTION_BANK_RIGHT, "NUMPAD 3", WindowRideConstructionKeyboardShortcutBankRight); - RegisterShortcut(ShortcutId::WindowRideConstructionPrevious, STR_SHORTCUT_CONSTRUCTION_PREVIOUS_TRACK, "NUMPAD 7", WindowRideConstructionKeyboardShortcutPreviousTrack); - RegisterShortcut(ShortcutId::WindowRideConstructionNext, STR_SHORTCUT_CONSTRUCTION_NEXT_TRACK, "NUMPAD 9", WindowRideConstructionKeyboardShortcutNextTrack); - RegisterShortcut(ShortcutId::WindowRideConstructionBuild, STR_SHORTCUT_CONSTRUCTION_BUILD_CURRENT, "NUMPAD 0", ShortcutConstructionBuildCurrent); - RegisterShortcut(ShortcutId::WindowRideConstructionDemolish, STR_SHORTCUT_CONSTRUCTION_DEMOLISH_CURRENT, "NUMPAD -", ShortcutConstructionDemolishCurrent); - RegisterShortcut(ShortcutId::WindowTileInspectorToggleInvisibility, STR_SHORTCUT_TOGGLE_INVISIBILITY, WindowTileInspectorKeyboardShortcutToggleInvisibility); - RegisterShortcut(ShortcutId::WindowTileInspectorCopy, STR_SHORTCUT_COPY_ELEMENT, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_COPY)); - RegisterShortcut(ShortcutId::WindowTileInspectorPaste, STR_SHORTCUT_PASTE_ELEMENT, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE)); - RegisterShortcut(ShortcutId::WindowTileInspectorSort, STR_SHORTCUT_SORT_ELEMENTS, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_SORT)); - RegisterShortcut(ShortcutId::WindowTileInspectorRemove, STR_SHORTCUT_REMOVE_ELEMENT, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE)); - RegisterShortcut(ShortcutId::WindowTileInspectorMoveUp, STR_SHORTCUT_MOVE_ELEMENT_UP, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP)); - RegisterShortcut(ShortcutId::WindowTileInspectorMoveDown, STR_SHORTCUT_MOVE_ELEMENT_DOWN, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN)); - RegisterShortcut(ShortcutId::WindowTileInspectorIncreaseX, STR_SHORTCUT_INCREASE_X_COORD, std::bind(TileInspectorMouseDown, WC_TILE_INSPECTOR__WIDX_SPINNER_X_INCREASE)); - RegisterShortcut(ShortcutId::WindowTileInspectorDecreaseX, STR_SHORTCUT_DECREASE_X_COORD, std::bind(TileInspectorMouseDown, WC_TILE_INSPECTOR__WIDX_SPINNER_X_DECREASE)); - RegisterShortcut(ShortcutId::WindowTileInspectorIncreaseY, STR_SHORTCUT_INCREASE_Y_COORD, std::bind(TileInspectorMouseDown, WC_TILE_INSPECTOR__WIDX_SPINNER_Y_INCREASE)); - RegisterShortcut(ShortcutId::WindowTileInspectorDecreaseY, STR_SHORTCUT_DECREASE_Y_COORD, std::bind(TileInspectorMouseDown, WC_TILE_INSPECTOR__WIDX_SPINNER_Y_DECREASE)); - RegisterShortcut(ShortcutId::WindowTileInspectorIncreaseHeight, STR_SHORTCUT_INCREASE_ELEM_HEIGHT, ShortcutIncreaseElementHeight); - RegisterShortcut(ShortcutId::WindowTileInspectorDecreaseHeight, STR_SHORTCUT_DECREASE_ELEM_HEIGHT, ShortcutDecreaseElementHeight); - RegisterShortcut(ShortcutId::WindowTileInspectorChangeWallSlope, STR_SHORTCUT_TOGGLE_WALL_SLOPE, ShortcutToggleWallSlope); + RegisterShortcut(ShortcutId::kWindowRideConstructionTurnLeft, STR_SHORTCUT_CONSTRUCTION_TURN_LEFT, "NUMPAD 4", ShortcutConstructionTurnLeft); + RegisterShortcut(ShortcutId::kWindowRideConstructionTurnRight, STR_SHORTCUT_CONSTRUCTION_TURN_RIGHT, "NUMPAD 6", ShortcutConstructionTurnRight); + RegisterShortcut(ShortcutId::kWindowRideConstructionDefault, STR_SHORTCUT_CONSTRUCTION_USE_TRACK_DEFAULT, "NUMPAD 5", WindowRideConstructionKeyboardShortcutUseTrackDefault); + RegisterShortcut(ShortcutId::kWindowRideConstructionSlopeDown, STR_SHORTCUT_CONSTRUCTION_SLOPE_DOWN, "NUMPAD 2", ShortcutConstructionSlopeDown); + RegisterShortcut(ShortcutId::kWindowRideConstructionSlopeUp, STR_SHORTCUT_CONSTRUCTION_SLOPE_UP, "NUMPAD 8", ShortcutConstructionSlopeUp); + RegisterShortcut(ShortcutId::kWindowRideConstructionChainLift, STR_SHORTCUT_CONSTRUCTION_CHAIN_LIFT_TOGGLE, "NUMPAD +", WindowRideConstructionKeyboardShortcutChainLiftToggle); + RegisterShortcut(ShortcutId::kWindowRideConstructionBankLeft, STR_SHORTCUT_CONSTRUCTION_BANK_LEFT, "NUMPAD 1", WindowRideConstructionKeyboardShortcutBankLeft); + RegisterShortcut(ShortcutId::kWindowRideConstructionBankRight, STR_SHORTCUT_CONSTRUCTION_BANK_RIGHT, "NUMPAD 3", WindowRideConstructionKeyboardShortcutBankRight); + RegisterShortcut(ShortcutId::kWindowRideConstructionPrevious, STR_SHORTCUT_CONSTRUCTION_PREVIOUS_TRACK, "NUMPAD 7", WindowRideConstructionKeyboardShortcutPreviousTrack); + RegisterShortcut(ShortcutId::kWindowRideConstructionNext, STR_SHORTCUT_CONSTRUCTION_NEXT_TRACK, "NUMPAD 9", WindowRideConstructionKeyboardShortcutNextTrack); + RegisterShortcut(ShortcutId::kWindowRideConstructionBuild, STR_SHORTCUT_CONSTRUCTION_BUILD_CURRENT, "NUMPAD 0", ShortcutConstructionBuildCurrent); + RegisterShortcut(ShortcutId::kWindowRideConstructionDemolish, STR_SHORTCUT_CONSTRUCTION_DEMOLISH_CURRENT, "NUMPAD -", ShortcutConstructionDemolishCurrent); + RegisterShortcut(ShortcutId::kWindowTileInspectorToggleInvisibility, STR_SHORTCUT_TOGGLE_INVISIBILITY, WindowTileInspectorKeyboardShortcutToggleInvisibility); + RegisterShortcut(ShortcutId::kWindowTileInspectorCopy, STR_SHORTCUT_COPY_ELEMENT, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_COPY)); + RegisterShortcut(ShortcutId::kWindowTileInspectorPaste, STR_SHORTCUT_PASTE_ELEMENT, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE)); + RegisterShortcut(ShortcutId::kWindowTileInspectorSort, STR_SHORTCUT_SORT_ELEMENTS, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_SORT)); + RegisterShortcut(ShortcutId::kWindowTileInspectorRemove, STR_SHORTCUT_REMOVE_ELEMENT, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE)); + RegisterShortcut(ShortcutId::kWindowTileInspectorMoveUp, STR_SHORTCUT_MOVE_ELEMENT_UP, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP)); + RegisterShortcut(ShortcutId::kWindowTileInspectorMoveDown, STR_SHORTCUT_MOVE_ELEMENT_DOWN, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN)); + RegisterShortcut(ShortcutId::kWindowTileInspectorIncreaseX, STR_SHORTCUT_INCREASE_X_COORD, std::bind(TileInspectorMouseDown, WC_TILE_INSPECTOR__WIDX_SPINNER_X_INCREASE)); + RegisterShortcut(ShortcutId::kWindowTileInspectorDecreaseX, STR_SHORTCUT_DECREASE_X_COORD, std::bind(TileInspectorMouseDown, WC_TILE_INSPECTOR__WIDX_SPINNER_X_DECREASE)); + RegisterShortcut(ShortcutId::kWindowTileInspectorIncreaseY, STR_SHORTCUT_INCREASE_Y_COORD, std::bind(TileInspectorMouseDown, WC_TILE_INSPECTOR__WIDX_SPINNER_Y_INCREASE)); + RegisterShortcut(ShortcutId::kWindowTileInspectorDecreaseY, STR_SHORTCUT_DECREASE_Y_COORD, std::bind(TileInspectorMouseDown, WC_TILE_INSPECTOR__WIDX_SPINNER_Y_DECREASE)); + RegisterShortcut(ShortcutId::kWindowTileInspectorIncreaseHeight, STR_SHORTCUT_INCREASE_ELEM_HEIGHT, ShortcutIncreaseElementHeight); + RegisterShortcut(ShortcutId::kWindowTileInspectorDecreaseHeight, STR_SHORTCUT_DECREASE_ELEM_HEIGHT, ShortcutDecreaseElementHeight); + RegisterShortcut(ShortcutId::kWindowTileInspectorChangeWallSlope, STR_SHORTCUT_TOGGLE_WALL_SLOPE, ShortcutToggleWallSlope); // Debug - RegisterShortcut(ShortcutId::DebugToggleConsole, STR_CONSOLE, "`", ShortcutToggleConsole); - RegisterShortcut(ShortcutId::DebugAdvanceTick, STR_SHORTCUT_ADVANCE_TO_NEXT_TICK, []() { + RegisterShortcut(ShortcutId::kDebugToggleConsole, STR_CONSOLE, "`", ShortcutToggleConsole); + RegisterShortcut(ShortcutId::kDebugAdvanceTick, STR_SHORTCUT_ADVANCE_TO_NEXT_TICK, []() { if (!(gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_MANAGER))) { gDoSingleUpdate = true; } }); - RegisterShortcut(ShortcutId::DebugTogglePaintDebugWindow, STR_SHORTCUT_DEBUG_PAINT_TOGGLE, []() { + RegisterShortcut(ShortcutId::kDebugTogglePaintDebugWindow, STR_SHORTCUT_DEBUG_PAINT_TOGGLE, []() { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { auto window = WindowFindByClass(WindowClass::DebugPaint);