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/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 76986f68eb..beafebca55 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 1b2263df6d..ee782e207a 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..b4f7148cdb 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -809,7 +809,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; @@ -886,13 +886,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; diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 1226feaa97..fc37f7886d 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 - PEEP_MIN_ENERGY, PEEP_MAX_ENERGY - PEEP_MIN_ENERGY, 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..798f7e51be 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) 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 391f6879a6..759692f430 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/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..564d01aa1b 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; } } } @@ -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/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/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index b423ba8a4c..5b5de7eae6 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) diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 0bb4e6549a..805fd9f23c 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -43,7 +43,7 @@ enum class CloseWindowModifier : uint8_t; constexpr uint8_t CloseButtonWidth = 10; constexpr uint8_t kScrollableRowHeight = 12; -#define LIST_ROW_HEIGHT 12 +constexpr uint8_t kListRowHeight = 12; #define TABLE_CELL_HEIGHT 12 #define BUTTON_FACE_HEIGHT 12 #define SPINNER_HEIGHT 12