diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index f8c2936f76..f77343587f 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -63,7 +63,7 @@ static bool WindowFitsWithinSpace(const ScreenCoordsXY& loc, int32_t width, int3 { if (loc.x < 0) return false; - if (loc.y <= TOP_TOOLBAR_HEIGHT && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) + if (loc.y <= kTopToolbarHeight && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) return false; if (loc.x + width > ContextGetWidth()) return false; @@ -84,7 +84,7 @@ static bool WindowFitsOnScreen(const ScreenCoordsXY& loc, int32_t width, int32_t unk = screenWidth + (unk * 2); if (loc.x > unk) return false; - if (loc.y <= TOP_TOOLBAR_HEIGHT && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) + if (loc.y <= kTopToolbarHeight && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) return false; unk = screenHeight - (height / 4); if (loc.y > unk) @@ -101,7 +101,7 @@ static ScreenCoordsXY ClampWindowToScreen( else if (screenPos.x + width > screenWidth) screenPos.x = screenWidth - width; - auto toolbarAllowance = (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) ? 0 : (TOP_TOOLBAR_HEIGHT + 1); + auto toolbarAllowance = (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) ? 0 : (kTopToolbarHeight + 1); if (height - toolbarAllowance > screenHeight || screenPos.y < toolbarAllowance) screenPos.y = toolbarAllowance; else if (screenPos.y + height - toolbarAllowance > screenHeight) @@ -205,7 +205,7 @@ static ScreenCoordsXY GetCentrePositionForNewWindow(int32_t width, int32_t heigh auto uiContext = GetContext()->GetUiContext(); auto screenWidth = uiContext->GetWidth(); auto screenHeight = uiContext->GetHeight(); - return ScreenCoordsXY{ (screenWidth - width) / 2, std::max(TOP_TOOLBAR_HEIGHT + 1, (screenHeight - height) / 2) }; + return ScreenCoordsXY{ (screenWidth - width) / 2, std::max(kTopToolbarHeight + 1, (screenHeight - height) / 2) }; } WindowBase* WindowCreate( diff --git a/src/openrct2-ui/scripting/CustomListView.cpp b/src/openrct2-ui/scripting/CustomListView.cpp index 417a74cb02..c2546453b5 100644 --- a/src/openrct2-ui/scripting/CustomListView.cpp +++ b/src/openrct2-ui/scripting/CustomListView.cpp @@ -26,7 +26,7 @@ using namespace OpenRCT2::Ui::Windows; namespace OpenRCT2::Scripting { - constexpr size_t COLUMN_HEADER_HEIGHT = LIST_ROW_HEIGHT + 1; + constexpr size_t COLUMN_HEADER_HEIGHT = kListRowHeight + 1; template<> ColumnSortOrder FromDuk(const DukValue& d) { @@ -416,7 +416,7 @@ ScreenSize CustomListView::GetSize() } if (Scrollbars == ScrollbarType::Vertical || Scrollbars == ScrollbarType::Both) { - result.height = static_cast(Items.size() * LIST_ROW_HEIGHT); + result.height = static_cast(Items.size() * kListRowHeight); if (ShowColumnHeaders) { result.height += COLUMN_HEADER_HEIGHT; @@ -563,7 +563,7 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* s break; } - if (y + LIST_ROW_HEIGHT >= dpi.y) + if (y + kListRowHeight >= dpi.y) { const auto& itemIndex = static_cast(SortedItems[i]); const auto& item = Items[itemIndex]; @@ -571,7 +571,7 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* s if (item.IsSeparator) { const auto& text = item.Cells[0]; - ScreenSize cellSize = { LastKnownSize.width, LIST_ROW_HEIGHT }; + ScreenSize cellSize = { LastKnownSize.width, kListRowHeight }; PaintSeperator(dpi, { 0, y }, cellSize, text.c_str()); } else @@ -583,19 +583,19 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* s if (isSelected) { GfxFilterRect( - dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (LIST_ROW_HEIGHT - 1) } }, + dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (kListRowHeight - 1) } }, FilterPaletteID::PaletteDarken2); } else if (isHighlighted) { GfxFilterRect( - dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (LIST_ROW_HEIGHT - 1) } }, + dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (kListRowHeight - 1) } }, FilterPaletteID::PaletteDarken2); } else if (isStriped) { GfxFillRect( - dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (LIST_ROW_HEIGHT - 1) } }, + dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (kListRowHeight - 1) } }, ColourMapA[w->colours[1]].lighter | 0x1000000); } @@ -607,7 +607,7 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* s const auto& text = item.Cells[0]; if (!text.empty()) { - ScreenSize cellSize = { std::numeric_limits::max(), LIST_ROW_HEIGHT }; + ScreenSize cellSize = { std::numeric_limits::max(), kListRowHeight }; PaintCell(dpi, { 0, y }, cellSize, text.c_str(), isHighlighted); } } @@ -623,7 +623,7 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* s const auto& text = item.Cells[j]; if (!text.empty()) { - ScreenSize cellSize = { column.Width, LIST_ROW_HEIGHT }; + ScreenSize cellSize = { column.Width, kListRowHeight }; PaintCell(dpi, { x, y }, cellSize, text.c_str(), isHighlighted); } } @@ -633,7 +633,7 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* s } } - y += LIST_ROW_HEIGHT; + y += kListRowHeight; } if (ShowColumnHeaders) @@ -657,7 +657,7 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* s } bool isPressed = ColumnHeaderPressed == j && ColumnHeaderPressedCurrentState; - PaintHeading(w, dpi, { x, y }, { column.Width, LIST_ROW_HEIGHT }, column.Header, sortOrder, isPressed); + PaintHeading(w, dpi, { x, y }, { column.Width, kListRowHeight }, column.Header, sortOrder, isPressed); x += columnWidth; } } @@ -771,7 +771,7 @@ std::optional CustomListView::GetItemIndexAt(const ScreenCoordsXY& po // Check if we pressed the header auto& scroll = ParentWindow->scrolls[ScrollIndex]; int32_t absoluteY = pos.y - scroll.v_top; - if (ShowColumnHeaders && absoluteY >= 0 && absoluteY < LIST_ROW_HEIGHT) + if (ShowColumnHeaders && absoluteY >= 0 && absoluteY < kListRowHeight) { result = RowColumn(); result->Row = HEADER_ROW; @@ -780,7 +780,7 @@ std::optional CustomListView::GetItemIndexAt(const ScreenCoordsXY& po { // Check what row we pressed int32_t firstY = ShowColumnHeaders ? COLUMN_HEADER_HEIGHT : 0; - int32_t row = (pos.y - firstY) / LIST_ROW_HEIGHT; + int32_t row = (pos.y - firstY) / kListRowHeight; if (row >= 0 && row < static_cast(Items.size())) { result = RowColumn(); diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 4c227c27bc..0425c07c18 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -225,7 +225,7 @@ static Widget _windowChangelogWidgets[] = { auto uiContext = GetContext()->GetUiContext(); auto screenWidth = uiContext->GetWidth(); auto screenHeight = uiContext->GetHeight(); - return ScreenCoordsXY{ (screenWidth - width) / 2, std::max(TOP_TOOLBAR_HEIGHT + 1, (screenHeight - height) / 2) }; + return ScreenCoordsXY{ (screenWidth - width) / 2, std::max(kTopToolbarHeight + 1, (screenHeight - height) / 2) }; } private: diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 1319afcb74..5fde66cf74 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -640,7 +640,7 @@ static Widget _inventionListDragWidgets[] = { do { res = inventionListWindow->GetResearchItemAt(newScreenCoords); - newScreenCoords.y += LIST_ROW_HEIGHT; + newScreenCoords.y += kListRowHeight; } while (res.has_value() && res->research != nullptr && res->research->IsAlwaysResearched()); if (res.has_value()) diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index f7b516803b..fc1cc64269 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1241,7 +1241,7 @@ static std::vector _window_editor_object_selection_widgets = { screenPos.y += DrawTextWrapped( dpi, screenPos, _width2, STR_OBJECT_SELECTION_COMPAT_OBJECT_DESCRIPTION, {}, { COLOUR_BRIGHT_RED }) - + LIST_ROW_HEIGHT; + + kListRowHeight; } auto description = ObjectGetDescription(_loadedObject.get()); @@ -1251,7 +1251,7 @@ static std::vector _window_editor_object_selection_widgets = { ft.Add(STR_STRING); ft.Add(description.c_str()); - screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_WINDOW_COLOUR_2_STRINGID, ft) + LIST_ROW_HEIGHT; + screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_WINDOW_COLOUR_2_STRINGID, ft) + kListRowHeight; } if (GetSelectedObjectType() == ObjectType::Ride) { @@ -1305,14 +1305,14 @@ static std::vector _window_editor_object_selection_widgets = { void DrawDebugData(DrawPixelInfo& dpi) { ObjectListItem* listItem = &_listItems[selected_list_item]; - auto screenPos = windowPos + ScreenCoordsXY{ width - 5, height - (LIST_ROW_HEIGHT * 6) }; + auto screenPos = windowPos + ScreenCoordsXY{ width - 5, height - (kListRowHeight * 6) }; // Draw fallback image warning if (_loadedObject && _loadedObject->UsesFallbackImages()) { DrawTextBasic(dpi, screenPos, STR_OBJECT_USES_FALLBACK_IMAGES, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); } - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; // Draw ride type. if (GetSelectedObjectType() == ObjectType::Ride) @@ -1321,12 +1321,12 @@ static std::vector _window_editor_object_selection_widgets = { DrawTextBasic(dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); } - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; // Draw object source auto stringId = ObjectManagerGetSourceGameString(listItem->repositoryItem->GetFirstSourceGame()); DrawTextBasic(dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; // Draw object filename { @@ -1337,7 +1337,7 @@ static std::vector _window_editor_object_selection_widgets = { DrawTextBasic( dpi, { windowPos.x + this->width - 5, screenPos.y }, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_BLACK, TextAlignment::RIGHT }); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } // Draw object author (will be blank space if no author in file or a non JSON object) diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 04453ade98..7d0f851d93 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -368,7 +368,7 @@ static Widget _windowFinancesResearchWidgets[] = if (page != WINDOW_FINANCES_PAGE_SUMMARY) return; - auto screenCoords = ScreenCoordsXY{ 0, TABLE_CELL_HEIGHT + 2 }; + auto screenCoords = ScreenCoordsXY{ 0, kTableCellHeight + 2 }; Widget self = widgets[WIDX_SUMMARY_SCROLL]; int32_t row_width = std::max(scrolls[0].h_right, self.width()); @@ -381,10 +381,10 @@ static Widget _windowFinancesResearchWidgets[] = GfxFillRect( dpi, { screenCoords - ScreenCoordsXY{ 0, 1 }, - screenCoords + ScreenCoordsXY{ row_width, (TABLE_CELL_HEIGHT - 2) } }, + screenCoords + ScreenCoordsXY{ row_width, (kTableCellHeight - 2) } }, ColourMapA[colours[1]].lighter | 0x1000000); - screenCoords.y += TABLE_CELL_HEIGHT; + screenCoords.y += kTableCellHeight; } auto& gameState = GetGameState(); @@ -422,7 +422,7 @@ static Widget _windowFinancesResearchWidgets[] = dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT }); } - screenCoords.y += TABLE_CELL_HEIGHT; + screenCoords.y += kTableCellHeight; } screenCoords.y += 4; @@ -554,12 +554,11 @@ static Widget _windowFinancesResearchWidgets[] = if (i % 2 == 0) GfxFillRect( dpi, - { screenCoords - ScreenCoordsXY{ 0, 1 }, - screenCoords + ScreenCoordsXY{ 121, (TABLE_CELL_HEIGHT - 2) } }, + { screenCoords - ScreenCoordsXY{ 0, 1 }, screenCoords + ScreenCoordsXY{ 121, (kTableCellHeight - 2) } }, ColourMapA[colours[1]].lighter | 0x1000000); DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, _windowFinancesSummaryRowLabels[i]); - screenCoords.y += TABLE_CELL_HEIGHT; + screenCoords.y += kTableCellHeight; } // Horizontal rule below expenditure / income table @@ -809,7 +808,7 @@ static Widget _windowFinancesResearchWidgets[] = { // Count number of active campaigns int32_t numActiveCampaigns = static_cast(gMarketingCampaigns.size()); - int32_t y = std::max(1, numActiveCampaigns) * LIST_ROW_HEIGHT + 92; + int32_t y = std::max(1, numActiveCampaigns) * kListRowHeight + 92; // Update group box positions _windowFinancesMarketingWidgets[WIDX_ACTIVE_CAMPAIGNS_GROUP].bottom = y - 22; @@ -825,8 +824,8 @@ static Widget _windowFinancesResearchWidgets[] = { campaignButton->type = WindowWidgetType::Button; campaignButton->top = y; - campaignButton->bottom = y + BUTTON_FACE_HEIGHT + 1; - y += BUTTON_FACE_HEIGHT + 2; + campaignButton->bottom = y + kButtonFaceHeight + 1; + y += kButtonFaceHeight + 2; } else { @@ -886,13 +885,13 @@ static Widget _windowFinancesResearchWidgets[] = dpi, screenCoords + ScreenCoordsXY{ 304, 0 }, weeksRemaining == 1 ? STR_1_WEEK_REMAINING : STR_X_WEEKS_REMAINING, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } if (noCampaignsActive) { DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, STR_MARKETING_CAMPAIGNS_NONE); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } screenCoords.y += 34; @@ -908,7 +907,7 @@ static Widget _windowFinancesResearchWidgets[] = ft.Add(AdvertisingCampaignPricePerWeek[i]); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, ft); - screenCoords.y += BUTTON_FACE_HEIGHT + 2; + screenCoords.y += kButtonFaceHeight + 2; } } } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index a2be99c93f..bf023241fa 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1098,7 +1098,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); StatsBarsDraw(happiness, screenCoords, dpi, barColour, barBlink); // Energy - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_ENERGY_LABEL); int32_t energy = NormalizeGuestStatValue(peep->Energy - kPeepMinEnergy, kPeepMaxEnergy - kPeepMinEnergy, 10); @@ -1107,7 +1107,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); StatsBarsDraw(energy, screenCoords, dpi, barColour, barBlink); // Hunger - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_HUNGER_LABEL); int32_t hunger = NormalizeGuestStatValue(peep->Hunger - 32, 158, 0); @@ -1117,7 +1117,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); StatsBarsDraw(hunger, screenCoords, dpi, barColour, barBlink); // Thirst - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_THIRST_LABEL); int32_t thirst = NormalizeGuestStatValue(peep->Thirst - 32, 158, 0); @@ -1127,7 +1127,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); StatsBarsDraw(thirst, screenCoords, dpi, barColour, barBlink); // Nausea - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_NAUSEA_LABEL); int32_t nausea = NormalizeGuestStatValue(peep->Nausea - 32, 223, 0); @@ -1136,7 +1136,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); StatsBarsDraw(nausea, screenCoords, dpi, barColour, barBlink); // Toilet - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TOILET_LABEL); int32_t toilet = NormalizeGuestStatValue(peep->Toilet - 64, 178, 0); @@ -1145,7 +1145,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); StatsBarsDraw(toilet, screenCoords, dpi, barColour, barBlink); // Time in park - screenCoords.y += LIST_ROW_HEIGHT + 1; + screenCoords.y += kListRowHeight + 1; int32_t guestEntryTime = peep->GetParkEntryTime(); if (guestEntryTime != -1) { @@ -1155,14 +1155,14 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TIME_IN_PARK, ft); } - screenCoords.y += LIST_ROW_HEIGHT + 9; + screenCoords.y += kListRowHeight + 9; GfxFillRectInset( dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1], INSET_RECT_FLAG_BORDER_INSET); // Preferred Ride DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_PREFERRED_RIDE); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Intensity { @@ -1193,7 +1193,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); STR_PEEP_STAT_NAUSEA_TOLERANCE_AVERAGE, STR_PEEP_STAT_NAUSEA_TOLERANCE_HIGH, }; - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; auto nausea_tolerance = EnumValue(peep->NauseaTolerance) & 0x3; auto ft = Formatter(); ft.Add(_nauseaTolerances[nausea_tolerance]); @@ -1429,7 +1429,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); auto ft = Formatter(); ft.Add(peep->CashInPocket); DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_IN_POCKET, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } // Cash spent @@ -1437,7 +1437,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); auto ft = Formatter(); ft.Add(peep->CashSpent); DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_SPENT, ft); - screenCoords.y += LIST_ROW_HEIGHT * 2; + screenCoords.y += kListRowHeight * 2; } GfxFillRectInset( @@ -1449,7 +1449,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); auto ft = Formatter(); ft.Add(peep->PaidToEnter); DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_ENTRANCE_FEE, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } // Paid on rides { @@ -1464,7 +1464,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); { DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_RIDE, ft); } - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } // Paid on food { @@ -1479,7 +1479,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); { DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_FOOD, ft); } - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } // Paid on drinks @@ -1495,7 +1495,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); { DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_DRINK, ft); } - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } // Paid on souvenirs { @@ -1834,7 +1834,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); ft.Add(peep->Id); DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_SPRITE_INDEX, ft); } - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; { auto ft = Formatter(); ft.Add(peep->x); @@ -1842,7 +1842,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); ft.Add(peep->z); DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_POSITION, ft); } - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; { auto ft = Formatter(); ft.Add(peep->NextLoc.x); @@ -1863,7 +1863,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); } GfxDrawString(dpi, screenCoords, buffer, {}); } - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; { auto ft = Formatter(); ft.Add(peep->DestinationX); @@ -1871,7 +1871,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); ft.Add(peep->DestinationTolerance); DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_DEST, ft); } - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; { auto ft = Formatter(); ft.Add(peep->PathfindGoal.x); @@ -1880,9 +1880,9 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); ft.Add(peep->PathfindGoal.direction); DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_GOAL, ft); } - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; screenCoords.x += 10; for (auto& point : peep->PathfindHistory) @@ -1893,7 +1893,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); ft.Add(point.z); ft.Add(point.direction); DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY_ITEM, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } screenCoords.x -= 10; } diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 62661b9d0d..2e6e1dd513 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -176,7 +176,7 @@ static Widget window_install_track_widgets[] = { // Scenery not available DrawTextEllipsised( dpi, screenPos, 308, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); - screenPos.y -= LIST_ROW_HEIGHT; + screenPos.y -= kListRowHeight; } } @@ -190,7 +190,7 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(trackName); DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 1, 0 }, STR_TRACK_DESIGN_NAME, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } // Friendly Track name @@ -211,7 +211,7 @@ static Widget window_install_track_widgets[] = { } DrawTextBasic(dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft); - screenPos.y += LIST_ROW_HEIGHT + 4; + screenPos.y += kListRowHeight + 4; } // Stats @@ -220,21 +220,21 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(rating); DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } { fixed32_2dp rating = td6->intensity * 10; auto ft = Formatter(); ft.Add(rating); DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } { fixed32_2dp rating = td6->nausea * 10; auto ft = Formatter(); ft.Add(rating); DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT + 4; + screenPos.y += kListRowHeight + 4; } const auto& rtd = GetRideTypeDescriptor(td6->type); @@ -247,7 +247,7 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(holes); DrawTextBasic(dpi, screenPos, STR_HOLES, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } else { @@ -257,7 +257,7 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(speed); DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } // Average speed { @@ -265,7 +265,7 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(speed); DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } } @@ -274,7 +274,7 @@ static Widget window_install_track_widgets[] = { ft.Add(STR_RIDE_LENGTH_ENTRY); ft.Add(td6->ride_length); DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) @@ -285,7 +285,7 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(gForces); DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } // Maximum negative vertical Gs { @@ -293,7 +293,7 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(gForces); DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } // Maximum lateral Gs { @@ -301,7 +301,7 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(gForces); DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } if (td6->total_air_time != 0) { @@ -310,7 +310,7 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(airTime); DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } } @@ -321,11 +321,11 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(drops); DrawTextBasic(dpi, screenPos, STR_DROPS, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; // Drop height is multiplied by 0.75 DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } if (td6->type != RIDE_TYPE_MINI_GOLF) @@ -337,7 +337,7 @@ static Widget window_install_track_widgets[] = { auto ft = Formatter(); ft.Add(inversions); DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } } screenPos.y += 4; @@ -349,7 +349,7 @@ static Widget window_install_track_widgets[] = { ft.Add(td6->space_required_x); ft.Add(td6->space_required_y); DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } if (td6->cost != 0) @@ -435,7 +435,7 @@ static Widget window_install_track_widgets[] = { int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); - auto screenPos = ScreenCoordsXY{ screenWidth / 2 - 201, std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200) }; + auto screenPos = ScreenCoordsXY{ screenWidth / 2 - 201, std::max(kTopToolbarHeight + 1, screenHeight / 2 - 200) }; auto* window = WindowFocusOrCreate(WindowClass::InstallTrack, screenPos, WW, WH, 0); window->SetupTrack(path, std::move(trackDesign)); diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index a5318e8fa0..56c22bb2ad 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -963,11 +963,11 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { GfxFillRect( dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } }, RideKeyColours[i]); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, MapLabels[i], {}); - screenCoords.y += LIST_ROW_HEIGHT; + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ kListRowHeight, 0 }, MapLabels[i], {}); + screenCoords.y += kListRowHeight; if (i == 3) { - screenCoords += { _firstColumnWidth, -(LIST_ROW_HEIGHT * 4) }; + screenCoords += { _firstColumnWidth, -(kListRowHeight * 4) }; } } } @@ -1468,14 +1468,14 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) widgets[WIDX_MAP].bottom = height - 1 - 72; else if (selected_tab == PAGE_RIDES) - widgets[WIDX_MAP].bottom = height - 1 - (4 * LIST_ROW_HEIGHT + 4); + widgets[WIDX_MAP].bottom = height - 1 - (4 * kListRowHeight + 4); else widgets[WIDX_MAP].bottom = height - 1 - 14; } void CalculateTextLayout() { - int32_t textOffset = 4 + LIST_ROW_HEIGHT; + int32_t textOffset = 4 + kListRowHeight; _firstColumnWidth = 118; for (uint32_t i = 0; i < 4; i++) { diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 6978e8fc9f..51e1e02e6d 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -303,7 +303,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = { { int32_t numLines; GfxWrapString(NetworkGetServerName(), baseWidth, FontStyle::Medium, nullptr, &numLines); - baseHeight += (numLines + 1) * lineHeight + (LIST_ROW_HEIGHT / 2); + baseHeight += (numLines + 1) * lineHeight + (kListRowHeight / 2); } // Likewise, for the optional server description -- which can be a little longer. @@ -312,22 +312,22 @@ static constexpr StringId WindowMultiplayerPageTitles[] = { { int32_t numLines; GfxWrapString(descString, baseWidth, FontStyle::Medium, nullptr, &numLines); - baseHeight += (numLines + 1) * lineHeight + (LIST_ROW_HEIGHT / 2); + baseHeight += (numLines + 1) * lineHeight + (kListRowHeight / 2); } // Finally, account for provider info, if present. { const auto& providerName = NetworkGetServerProviderName(); if (!providerName.empty()) - baseHeight += LIST_ROW_HEIGHT; + baseHeight += kListRowHeight; const auto& providerEmail = NetworkGetServerProviderEmail(); if (!providerEmail.empty()) - baseHeight += LIST_ROW_HEIGHT; + baseHeight += kListRowHeight; const auto& providerWebsite = NetworkGetServerProviderWebsite(); if (!providerWebsite.empty()) - baseHeight += LIST_ROW_HEIGHT; + baseHeight += kListRowHeight; } // TODO: Are these casts still neccessary? @@ -686,7 +686,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = { auto ft = Formatter(); ft.Add(name.c_str()); screenCoords.y += DrawTextWrapped(clippedDPI, screenCoords, newWidth, STR_STRING, ft, { colours[1] }); - screenCoords.y += LIST_ROW_HEIGHT / 2; + screenCoords.y += kListRowHeight / 2; } const auto& description = NetworkGetServerDescription(); @@ -695,7 +695,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = { auto ft = Formatter(); ft.Add(description.c_str()); screenCoords.y += DrawTextWrapped(clippedDPI, screenCoords, newWidth, STR_STRING, ft, { colours[1] }); - screenCoords.y += LIST_ROW_HEIGHT / 2; + screenCoords.y += kListRowHeight / 2; } const auto& providerName = NetworkGetServerProviderName(); @@ -704,7 +704,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = { auto ft = Formatter(); ft.Add(providerName.c_str()); DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_NAME, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } const auto& providerEmail = NetworkGetServerProviderEmail(); @@ -713,7 +713,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = { auto ft = Formatter(); ft.Add(providerEmail.c_str()); DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_EMAIL, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } const auto& providerWebsite = NetworkGetServerProviderWebsite(); diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index f56ee24f69..ef633f9f3f 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -370,7 +370,7 @@ static Widget window_new_ride_widgets[] = { SetPage(_currentTab); break; case WIDX_FILTER_TEXT_BOX: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _filter.data(), TEXT_INPUT_SIZE); + WindowStartTextbox(*this, widgetIndex, STR_STRING, _filter.data(), kTextInputSize); break; case WIDX_FILTER_CLEAR_BUTTON: _filter.clear(); diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index 90613b6cd6..91658f2599 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -171,7 +171,7 @@ static Widget WindowNewsOptionsWidgets[] = { checkboxWidget->left = baseCheckBox.left; checkboxWidget->right = baseCheckBox.right; checkboxWidget->top = y; - checkboxWidget->bottom = checkboxWidget->top + LIST_ROW_HEIGHT + 3; + checkboxWidget->bottom = checkboxWidget->top + kListRowHeight + 3; checkboxWidget->text = ndef->caption; const bool* configValue = GetNotificationValuePtr(ndef); @@ -179,7 +179,7 @@ static Widget WindowNewsOptionsWidgets[] = { checkboxWidgetIndex++; checkboxWidget++; - y += LIST_ROW_HEIGHT + 3; + y += kListRowHeight + 3; } // Remove unused checkboxes diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 199a12147e..40368b4d43 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -992,7 +992,7 @@ static constexpr WindowParkAward _parkAwards[] = { auto ft = Formatter(); ft.Add(parkSize); DrawTextBasic(dpi, screenCoords, stringIndex, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Draw number of rides / attractions if (_numberOfRides != -1) @@ -1001,7 +1001,7 @@ static constexpr WindowParkAward _parkAwards[] = { ft.Add(_numberOfRides); DrawTextBasic(dpi, screenCoords, STR_NUMBER_OF_RIDES_LABEL, ft); } - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Draw number of staff if (_numberOfStaff != -1) @@ -1010,13 +1010,13 @@ static constexpr WindowParkAward _parkAwards[] = { ft.Add(_numberOfStaff); DrawTextBasic(dpi, screenCoords, STR_STAFF_LABEL, ft); } - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Draw number of guests in park ft = Formatter(); ft.Add(gameState.NumGuestsInPark); DrawTextBasic(dpi, screenCoords, STR_GUESTS_IN_PARK_LABEL, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; ft = Formatter(); ft.Add(gameState.TotalAdmissions); @@ -1116,7 +1116,7 @@ static constexpr WindowParkAward _parkAwards[] = { // Your objective: DrawTextBasic(dpi, screenCoords, STR_OBJECTIVE_LABEL); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Objective ft = Formatter(); diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 14d722d22b..eed24b5dca 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -630,7 +630,7 @@ static Widget *window_player_page_widgets[] = { ft.Add(NetworkGetPlayerCommandsRan(player)); DrawTextBasic(dpi, screenCoords, STR_COMMANDS_RAN, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; ft = Formatter(); ft.Add(NetworkGetPlayerMoneySpent(player)); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index d39afd4b54..f208f8b7b8 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -2805,7 +2805,7 @@ static_assert(std::size(RatingNames) == 6); // Excitement Factor if (rideEntry->excitement_multiplier != 0) { - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; ft = Formatter(); ft.Add(abs(rideEntry->excitement_multiplier)); @@ -2821,7 +2821,7 @@ static_assert(std::size(RatingNames) == 6); if (lineHeight != 10) screenCoords.x += 150; else - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; ft = Formatter(); ft.Add(abs(rideEntry->intensity_multiplier)); @@ -2835,7 +2835,7 @@ static_assert(std::size(RatingNames) == 6); // Nausea Factor if (rideEntry->nausea_multiplier != 0) { - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; ft = Formatter(); ft.Add(abs(rideEntry->nausea_multiplier)); @@ -5336,7 +5336,7 @@ static_assert(std::size(RatingNames) == 6); StringId stringId = !RideHasRatings(*ride) ? STR_EXCITEMENT_RATING_NOT_YET_AVAILABLE : STR_EXCITEMENT_RATING; DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Intensity ratingName = GetRatingName(ride->intensity); @@ -5351,7 +5351,7 @@ static_assert(std::size(RatingNames) == 6); stringId = STR_INTENSITY_RATING_RED; DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Nausea ratingName = GetRatingName(ride->nausea); @@ -5360,7 +5360,7 @@ static_assert(std::size(RatingNames) == 6); ft.Add(ratingName); stringId = !RideHasRatings(*ride) ? STR_NAUSEA_RATING_NOT_YET_AVAILABLE : STR_NAUSEA_RATING; DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += 2 * LIST_ROW_HEIGHT; + screenCoords.y += 2 * kListRowHeight; // Horizontal rule GfxFillRectInset( @@ -5375,7 +5375,7 @@ static_assert(std::size(RatingNames) == 6); ft = Formatter(); ft.Add(ride->holes); DrawTextBasic(dpi, screenCoords, STR_HOLES, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } else { @@ -5383,13 +5383,13 @@ static_assert(std::size(RatingNames) == 6); ft = Formatter(); ft.Add((ride->max_speed * 9) >> 18); DrawTextBasic(dpi, screenCoords, STR_MAX_SPEED, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Average speed ft = Formatter(); ft.Add((ride->average_speed * 9) >> 18); DrawTextBasic(dpi, screenCoords, STR_AVERAGE_SPEED, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Ride time ft = Formatter(); @@ -5429,7 +5429,7 @@ static_assert(std::size(RatingNames) == 6); ft.Add(0); ft.Add(0); DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_TIME, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } // Ride length @@ -5470,7 +5470,7 @@ static_assert(std::size(RatingNames) == 6); ft.Add(0); DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_LENGTH, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) { @@ -5480,7 +5480,7 @@ static_assert(std::size(RatingNames) == 6); ft = Formatter(); ft.Add(ride->max_positive_vertical_g); DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Max. negative vertical G's stringId = ride->max_negative_vertical_g <= RIDE_G_FORCES_RED_NEG_VERTICAL @@ -5489,7 +5489,7 @@ static_assert(std::size(RatingNames) == 6); ft = Formatter(); ft.Add(ride->max_negative_vertical_g); DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Max lateral G's stringId = ride->max_lateral_g > RIDE_G_FORCES_RED_LATERAL ? STR_MAX_LATERAL_G_RED @@ -5497,13 +5497,13 @@ static_assert(std::size(RatingNames) == 6); ft = Formatter(); ft.Add(ride->max_lateral_g); DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Total 'air' time ft = Formatter(); ft.Add(ride->total_air_time * 3); DrawTextBasic(dpi, screenCoords, STR_TOTAL_AIR_TIME, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) @@ -5513,14 +5513,14 @@ static_assert(std::size(RatingNames) == 6); ft = Formatter(); ft.Add(drops); DrawTextBasic(dpi, screenCoords, STR_DROPS, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Highest drop height auto highestDropHeight = (ride->highest_drop_height * 3) / 4; ft = Formatter(); ft.Add(highestDropHeight); DrawTextBasic(dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } if (ride->type != RIDE_TYPE_MINI_GOLF) @@ -5531,7 +5531,7 @@ static_assert(std::size(RatingNames) == 6); ft = Formatter(); ft.Add(ride->inversions); DrawTextBasic(dpi, screenCoords, STR_INVERSIONS, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } } } @@ -5735,7 +5735,7 @@ static_assert(std::size(RatingNames) == 6); // Anchor graph widget auto x = width - 4; - auto y = height - BUTTON_FACE_HEIGHT - 8; + auto y = height - kButtonFaceHeight - 8; widgets[WIDX_GRAPH].right = x; widgets[WIDX_GRAPH].bottom = y; @@ -5744,7 +5744,7 @@ static_assert(std::size(RatingNames) == 6); widgets[WIDX_GRAPH_ALTITUDE].top = y; widgets[WIDX_GRAPH_VERTICAL].top = y; widgets[WIDX_GRAPH_LATERAL].top = y; - y += BUTTON_FACE_HEIGHT + 1; + y += kButtonFaceHeight + 1; widgets[WIDX_GRAPH_VELOCITY].bottom = y; widgets[WIDX_GRAPH_ALTITUDE].bottom = y; widgets[WIDX_GRAPH_VERTICAL].bottom = y; @@ -6393,7 +6393,7 @@ static_assert(std::size(RatingNames) == 6); ft.Add(ride->income_per_hour); DrawTextBasic(dpi, screenCoords, STR_INCOME_PER_HOUR, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } // Running cost per hour @@ -6402,7 +6402,7 @@ static_assert(std::size(RatingNames) == 6); auto ft = Formatter(); ft.Add(costPerHour); DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Profit per hour if (ride->profit != kMoney64Undefined) @@ -6410,7 +6410,7 @@ static_assert(std::size(RatingNames) == 6); ft = Formatter(); ft.Add(ride->profit); DrawTextBasic(dpi, screenCoords, STR_PROFIT_PER_HOUR, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } screenCoords.y += 5; @@ -6550,14 +6550,14 @@ static_assert(std::size(RatingNames) == 6); auto ft = Formatter(); ft.Add(ride->num_riders); DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } // Customers per hour auto ft = Formatter(); ft.Add(RideCustomersPerHour(*ride)); DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Popularity popularity = ride->popularity; @@ -6573,7 +6573,7 @@ static_assert(std::size(RatingNames) == 6); ft = Formatter(); ft.Add(popularity); DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Satisfaction satisfaction = ride->satisfaction; @@ -6589,7 +6589,7 @@ static_assert(std::size(RatingNames) == 6); ft = Formatter(); ft.Add(satisfaction); DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Queue time if (ride->IsRide()) @@ -6610,7 +6610,7 @@ static_assert(std::size(RatingNames) == 6); ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); ft.Add(ride->no_primary_items_sold); DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } // Secondary shop items sold / on-ride photos sold @@ -6622,14 +6622,14 @@ static_assert(std::size(RatingNames) == 6); ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); ft.Add(ride->no_secondary_items_sold); DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } // Total customers ft = Formatter(); ft.Add(ride->total_customers); DrawTextBasic(dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; // Guests favourite if (ride->IsRide()) @@ -6638,7 +6638,7 @@ static_assert(std::size(RatingNames) == 6); ft.Add(ride->guests_favourite); stringId = ride->guests_favourite == 1 ? STR_FAVOURITE_RIDE_OF_GUEST : STR_FAVOURITE_RIDE_OF_GUESTS; DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } screenCoords.y += 2; diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 1b67f23f35..7c1a5bd134 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1939,7 +1939,7 @@ static Widget _rideConstructionWidgets[] = { widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].type = WindowWidgetType::Button; widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].text = STR_NUMERIC_DOWN; - ResizeSpinner(WIDX_SPEED_SETTING_SPINNER, { 12, 138 }, { 85, SPINNER_HEIGHT }); + ResizeSpinner(WIDX_SPEED_SETTING_SPINNER, { 12, 138 }, { 85, kSpinnerHeight }); hold_down_widgets |= (1uLL << WIDX_SPEED_SETTING_SPINNER_UP) | (1uLL << WIDX_SPEED_SETTING_SPINNER_DOWN); } diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 24ae36bb92..0022ef62db 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -211,7 +211,7 @@ static Widget _rideListWidgets[] = { widgets[WIDX_SORT].left = width - 60; widgets[WIDX_SORT].right = width - 60 + 54; - ResizeDropdown(WIDX_CURRENT_INFORMATION_TYPE, { 150, 46 }, { width - 216, DROPDOWN_HEIGHT }); + ResizeDropdown(WIDX_CURRENT_INFORMATION_TYPE, { 150, 46 }, { width - 216, kDropdownHeight }); // Refreshing the list can be a very intensive operation // owing to its use of ride_has_any_track_elements(). diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index d40760ae41..bcc966df15 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -765,7 +765,7 @@ static Widget _scenarioSelectWidgets[] = { int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); - ScreenCoordsXY screenPos = { (screenWidth - WW) / 2, std::max(TOP_TOOLBAR_HEIGHT + 1, (screenHeight - WH) / 2) }; + ScreenCoordsXY screenPos = { (screenWidth - WW) / 2, std::max(kTopToolbarHeight + 1, (screenHeight - WH) / 2) }; window = WindowCreate(WindowClass::ScenarioSelect, screenPos, WW, WH, 0, callback); return window; } diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index c1c566be51..5fdf66aaf6 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -276,7 +276,7 @@ static Widget WindowSceneryBaseWidgets[] = { Invalidate(); break; case WIDX_FILTER_TEXT_BOX: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _filteredSceneryTab.Filter.data(), TEXT_INPUT_SIZE); + WindowStartTextbox(*this, widgetIndex, STR_STRING, _filteredSceneryTab.Filter.data(), kTextInputSize); break; case WIDX_FILTER_CLEAR_BUTTON: _tabEntries[_activeTabIndex].Filter.clear(); diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 0919b44d35..35eb77fc00 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -936,13 +936,13 @@ static Widget _staffOptionsWidgets[] = { auto ft = Formatter(); ft.Add(GetStaffWage(staff->AssignedStaffType)); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_WAGES, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; } auto ft = Formatter(); ft.Add(staff->GetHireDate()); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_EMPLOYED_FOR, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; switch (staff->AssignedStaffType) { @@ -950,17 +950,17 @@ static Widget _staffOptionsWidgets[] = { ft = Formatter(); ft.Add(staff->StaffLawnsMown); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LAWNS_MOWN, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; ft = Formatter(); ft.Add(staff->StaffGardensWatered); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_GARDENS_WATERED, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; ft = Formatter(); ft.Add(staff->StaffLitterSwept); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LITTER_SWEPT, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; ft = Formatter(); ft.Add(staff->StaffBinsEmptied); @@ -970,7 +970,7 @@ static Widget _staffOptionsWidgets[] = { ft = Formatter(); ft.Add(staff->StaffRidesInspected); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_INSPECTED, ft); - screenCoords.y += LIST_ROW_HEIGHT; + screenCoords.y += kListRowHeight; ft = Formatter(); ft.Add(staff->StaffRidesFixed); diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 28ef29bfea..1cc2953fa5 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -252,33 +252,33 @@ static constexpr int32_t right_aligned_widgets_order[] = { #pragma endregion static Widget _topToolbarWidgets[] = { - MakeRemapWidget({ 0, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TOOLBAR_PAUSE, STR_PAUSE_GAME_TIP ), // Pause - MakeRemapWidget({ 60, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TOOLBAR_FILE, STR_DISC_AND_GAME_OPTIONS_TIP ), // File menu - MakeRemapWidget({250, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_G2_TOOLBAR_MUTE, STR_TOOLBAR_MUTE_TIP ), // Mute - MakeRemapWidget({100, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Secondary , SPR_TOOLBAR_ZOOM_OUT, STR_ZOOM_OUT_TIP ), // Zoom out - MakeRemapWidget({130, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Secondary , SPR_TOOLBAR_ZOOM_IN, STR_ZOOM_IN_TIP ), // Zoom in - MakeRemapWidget({160, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Secondary , SPR_TOOLBAR_ROTATE, STR_ROTATE_TIP ), // Rotate camera - MakeRemapWidget({190, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Secondary , SPR_TOOLBAR_VIEW, STR_VIEW_OPTIONS_TIP ), // Transparency menu - MakeRemapWidget({220, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Secondary , SPR_TOOLBAR_MAP, STR_SHOW_MAP_TIP ), // Map - MakeRemapWidget({267, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_LAND, STR_ADJUST_LAND_TIP ), // Land - MakeRemapWidget({297, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_WATER, STR_ADJUST_WATER_TIP ), // Water - MakeRemapWidget({327, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_SCENERY, STR_PLACE_SCENERY_TIP ), // Scenery - MakeRemapWidget({357, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_FOOTPATH, STR_BUILD_FOOTPATH_TIP ), // Path - MakeRemapWidget({387, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_CONSTRUCT_RIDE, STR_BUILD_RIDE_TIP ), // Construct ride - MakeRemapWidget({490, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TOOLBAR_RIDES, STR_RIDES_IN_PARK_TIP ), // Rides - MakeRemapWidget({520, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TOOLBAR_PARK, STR_PARK_INFORMATION_TIP ), // Park - MakeRemapWidget({550, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TAB_TOOLBAR, STR_STAFF_TIP ), // Staff - MakeRemapWidget({560, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TOOLBAR_GUESTS, STR_GUESTS_TIP ), // Guests - MakeRemapWidget({560, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_CLEAR_SCENERY, STR_CLEAR_SCENERY_TIP ), // Clear scenery - MakeRemapWidget({ 30, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TAB_TOOLBAR, STR_GAME_SPEED_TIP ), // Fast forward - MakeRemapWidget({ 30, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TAB_TOOLBAR, STR_CHEATS_TIP ), // Cheats - MakeRemapWidget({ 30, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TAB_TOOLBAR, STR_DEBUG_TIP ), // Debug - MakeRemapWidget({ 30, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TAB_TOOLBAR, STR_SCENARIO_OPTIONS_FINANCIAL_TIP), // Finances - MakeRemapWidget({ 30, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TAB_TOOLBAR, STR_FINANCES_RESEARCH_TIP ), // Research - MakeRemapWidget({ 30, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TAB_TOOLBAR, STR_SHOW_RECENT_MESSAGES_TIP ), // News - MakeRemapWidget({ 30, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_G2_TOOLBAR_MULTIPLAYER, STR_SHOW_MULTIPLAYER_STATUS_TIP ), // Network - MakeRemapWidget({ 30, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TAB_TOOLBAR, STR_TOOLBAR_CHAT_TIP ), // Chat - MakeWidget ({ 0, 0}, {10, 1}, WindowWidgetType::Empty, WindowColour::Primary ), // Artificial widget separator + MakeRemapWidget({ 0, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TOOLBAR_PAUSE, STR_PAUSE_GAME_TIP ), // Pause + MakeRemapWidget({ 60, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TOOLBAR_FILE, STR_DISC_AND_GAME_OPTIONS_TIP ), // File menu + MakeRemapWidget({250, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_G2_TOOLBAR_MUTE, STR_TOOLBAR_MUTE_TIP ), // Mute + MakeRemapWidget({100, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Secondary , SPR_TOOLBAR_ZOOM_OUT, STR_ZOOM_OUT_TIP ), // Zoom out + MakeRemapWidget({130, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Secondary , SPR_TOOLBAR_ZOOM_IN, STR_ZOOM_IN_TIP ), // Zoom in + MakeRemapWidget({160, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Secondary , SPR_TOOLBAR_ROTATE, STR_ROTATE_TIP ), // Rotate camera + MakeRemapWidget({190, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Secondary , SPR_TOOLBAR_VIEW, STR_VIEW_OPTIONS_TIP ), // Transparency menu + MakeRemapWidget({220, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Secondary , SPR_TOOLBAR_MAP, STR_SHOW_MAP_TIP ), // Map + MakeRemapWidget({267, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_LAND, STR_ADJUST_LAND_TIP ), // Land + MakeRemapWidget({297, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_WATER, STR_ADJUST_WATER_TIP ), // Water + MakeRemapWidget({327, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_SCENERY, STR_PLACE_SCENERY_TIP ), // Scenery + MakeRemapWidget({357, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_FOOTPATH, STR_BUILD_FOOTPATH_TIP ), // Path + MakeRemapWidget({387, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_CONSTRUCT_RIDE, STR_BUILD_RIDE_TIP ), // Construct ride + MakeRemapWidget({490, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TOOLBAR_RIDES, STR_RIDES_IN_PARK_TIP ), // Rides + MakeRemapWidget({520, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TOOLBAR_PARK, STR_PARK_INFORMATION_TIP ), // Park + MakeRemapWidget({550, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TAB_TOOLBAR, STR_STAFF_TIP ), // Staff + MakeRemapWidget({560, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TOOLBAR_GUESTS, STR_GUESTS_TIP ), // Guests + MakeRemapWidget({560, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Tertiary , SPR_TOOLBAR_CLEAR_SCENERY, STR_CLEAR_SCENERY_TIP ), // Clear scenery + MakeRemapWidget({ 30, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TAB_TOOLBAR, STR_GAME_SPEED_TIP ), // Fast forward + MakeRemapWidget({ 30, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TAB_TOOLBAR, STR_CHEATS_TIP ), // Cheats + MakeRemapWidget({ 30, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TAB_TOOLBAR, STR_DEBUG_TIP ), // Debug + MakeRemapWidget({ 30, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TAB_TOOLBAR, STR_SCENARIO_OPTIONS_FINANCIAL_TIP), // Finances + MakeRemapWidget({ 30, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TAB_TOOLBAR, STR_FINANCES_RESEARCH_TIP ), // Research + MakeRemapWidget({ 30, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Quaternary, SPR_TAB_TOOLBAR, STR_SHOW_RECENT_MESSAGES_TIP ), // News + MakeRemapWidget({ 30, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_G2_TOOLBAR_MULTIPLAYER, STR_SHOW_MULTIPLAYER_STATUS_TIP ), // Network + MakeRemapWidget({ 30, 0}, {30, kTopToolbarHeight + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TAB_TOOLBAR, STR_TOOLBAR_CHAT_TIP ), // Chat + MakeWidget ({ 0, 0}, {10, 1}, WindowWidgetType::Empty, WindowColour::Primary ), // Artificial widget separator kWidgetsEnd, }; // clang-format on @@ -3330,7 +3330,7 @@ static Widget _topToolbarWidgets[] = { WindowBase* TopToolbarOpen() { TopToolbar* window = WindowCreate( - WindowClass::TopToolbar, ScreenCoordsXY(0, 0), ContextGetWidth(), TOP_TOOLBAR_HEIGHT + 1, + WindowClass::TopToolbar, ScreenCoordsXY(0, 0), ContextGetWidth(), kTopToolbarHeight + 1, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); window->widgets = _topToolbarWidgets; diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 7283d4e41d..0e552236fc 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -198,7 +198,7 @@ static Widget _trackDeletePromptWidgets[] = { WindowCreate( std::move(trackDeletePromptWindow), WindowClass::TrackDeletePrompt, ScreenCoordsXY( - std::max(TOP_TOOLBAR_HEIGHT + 1, (screenWidth - WW_DELETE_PROMPT) / 2), (screenHeight - WH_DELETE_PROMPT) / 2), + std::max(kTopToolbarHeight + 1, (screenWidth - WW_DELETE_PROMPT) / 2), (screenHeight - WH_DELETE_PROMPT) / 2), WW_DELETE_PROMPT, WH_DELETE_PROMPT, WF_STICK_TO_FRONT | WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 6c360c2b29..47e8b70fe0 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -547,17 +547,17 @@ static Widget _trackListWidgets[] = { ft = Formatter(); ft.Add(_loadedTrackDesign->excitement * 10); DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; ft = Formatter(); ft.Add(_loadedTrackDesign->intensity * 10); DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; ft = Formatter(); ft.Add(_loadedTrackDesign->nausea * 10); DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT + 4; + screenPos.y += kListRowHeight + 4; // Information for tracked rides. if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) @@ -571,7 +571,7 @@ static Widget _trackListWidgets[] = { ft = Formatter(); ft.Add(_loadedTrackDesign->holes & 0x1F); DrawTextBasic(dpi, screenPos, STR_HOLES, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } else { @@ -579,13 +579,13 @@ static Widget _trackListWidgets[] = { ft = Formatter(); ft.Add(((_loadedTrackDesign->max_speed << 16) * 9) >> 18); DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; // Average speed ft = Formatter(); ft.Add(((_loadedTrackDesign->average_speed << 16) * 9) >> 18); DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } // Ride length @@ -593,7 +593,7 @@ static Widget _trackListWidgets[] = { ft.Add(STR_RIDE_LENGTH_ENTRY); ft.Add(_loadedTrackDesign->ride_length); DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) @@ -602,19 +602,19 @@ static Widget _trackListWidgets[] = { ft = Formatter(); ft.Add(_loadedTrackDesign->max_positive_vertical_g * 32); DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; // Maximum negative vertical Gs ft = Formatter(); ft.Add(_loadedTrackDesign->max_negative_vertical_g * 32); DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; // Maximum lateral Gs ft = Formatter(); ft.Add(_loadedTrackDesign->max_lateral_g * 32); DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; if (_loadedTrackDesign->total_air_time != 0) { @@ -622,7 +622,7 @@ static Widget _trackListWidgets[] = { ft = Formatter(); ft.Add(_loadedTrackDesign->total_air_time * 25); DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } } @@ -632,13 +632,13 @@ static Widget _trackListWidgets[] = { ft = Formatter(); ft.Add(_loadedTrackDesign->drops & 0x3F); DrawTextBasic(dpi, screenPos, STR_DROPS, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; // Drop height is multiplied by 0.75 ft = Formatter(); ft.Add((_loadedTrackDesign->highest_drop_height * 3) / 4); DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } if (_loadedTrackDesign->type != RIDE_TYPE_MINI_GOLF) @@ -650,7 +650,7 @@ static Widget _trackListWidgets[] = { ft.Add(inversions); // Inversions DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } } screenPos.y += 4; @@ -663,7 +663,7 @@ static Widget _trackListWidgets[] = { ft.Add(_loadedTrackDesign->space_required_x); ft.Add(_loadedTrackDesign->space_required_y); DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); - screenPos.y += LIST_ROW_HEIGHT; + screenPos.y += kListRowHeight; } if (_loadedTrackDesign->cost != 0) @@ -768,11 +768,11 @@ static Widget _trackListWidgets[] = { { int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); - screenPos = { screenWidth / 2 - 300, std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200) }; + screenPos = { screenWidth / 2 - 300, std::max(kTopToolbarHeight + 1, screenHeight / 2 - 200) }; } else { - screenPos = { 0, TOP_TOOLBAR_HEIGHT + 2 }; + screenPos = { 0, kTopToolbarHeight + 2 }; } return WindowCreate(WindowClass::TrackDesignList, WW, WH, 0, item); } diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index b1f34b9fb6..b8184d0a0c 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -1367,7 +1367,7 @@ void WindowRelocateWindows(int32_t width, int32_t height) // Calculate the new locations auto newWinPos = w->windowPos; - w->windowPos = { new_location, new_location + TOP_TOOLBAR_HEIGHT + 1 }; + w->windowPos = { new_location, new_location + kTopToolbarHeight + 1 }; // Move the next new location so windows are not directly on top new_location += 8; @@ -1612,7 +1612,7 @@ static void window_snap_bottom(WindowBase& w, int32_t proximity) void WindowMoveAndSnap(WindowBase& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity) { auto originalPos = w.windowPos; - int32_t minY = (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) ? 1 : TOP_TOOLBAR_HEIGHT + 2; + int32_t minY = (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) ? 1 : kTopToolbarHeight + 2; newWindowCoords.y = std::clamp(newWindowCoords.y, minY, ContextGetHeight() - 34); @@ -1670,8 +1670,8 @@ void WindowStartTextbox( // text. if (existing_text != STR_NONE) { - char tempBuf[TEXT_INPUT_SIZE]{}; - size_t len = FormatStringLegacy(tempBuf, TEXT_INPUT_SIZE, existing_text, &existing_args); + char tempBuf[kTextInputSize]{}; + size_t len = FormatStringLegacy(tempBuf, kTextInputSize, existing_text, &existing_args); gTextBoxInput.assign(tempBuf, len); } diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 139f6fcd89..2c0e189bc7 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -43,14 +43,14 @@ enum class CloseWindowModifier : uint8_t; constexpr uint8_t CloseButtonWidth = 10; #define SCROLLABLE_ROW_HEIGHT 12 -#define LIST_ROW_HEIGHT 12 -#define TABLE_CELL_HEIGHT 12 -#define BUTTON_FACE_HEIGHT 12 -#define SPINNER_HEIGHT 12 -#define DROPDOWN_HEIGHT 12 +constexpr uint8_t kListRowHeight = 12; +constexpr uint8_t kTableCellHeight = 12; +constexpr uint8_t kButtonFaceHeight = 12; +constexpr uint8_t kSpinnerHeight = 12; +constexpr uint8_t kDropdownHeight = 12; -#define TEXT_INPUT_SIZE 1024 -#define TOP_TOOLBAR_HEIGHT 27 +constexpr uint16_t kTextInputSize = 1024; +constexpr uint16_t kTopToolbarHeight = 27; extern u8string gTextBoxInput; extern int32_t gTextBoxFrameNo;