Change all calls to DrawTextBasic to use Formatter

This commit is contained in:
Gymnasiast 2021-07-27 20:32:27 +02:00
parent c97e8d36f1
commit 676ef7205e
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
32 changed files with 558 additions and 384 deletions

View File

@ -162,9 +162,10 @@ namespace Graph
if (history[i] != MONEY64_UNDEFINED && yearOver32 % 4 == 0) if (history[i] != MONEY64_UNDEFINED && yearOver32 % 4 == 0)
{ {
// Draw month text // Draw month text
int32_t monthFormat = DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]; auto ft = Formatter();
ft.Add<rct_string_id>(DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, &monthFormat, dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft,
{ FontSpriteBase::SMALL, TextAlignment::CENTRE }); { FontSpriteBase::SMALL, TextAlignment::CENTRE });
// Draw month mark // Draw month mark
@ -260,9 +261,10 @@ namespace Graph
gfx_draw_dashed_line(dpi, { info.coords, { info.coords.x, cursorPosition.y } }, DefaultDashedLength, 0); gfx_draw_dashed_line(dpi, { info.coords, { info.coords.x, cursorPosition.y } }, DefaultDashedLength, 0);
} }
auto ft = Formatter();
ft.Add<money64>(info.money);
DrawTextBasic( DrawTextBasic(
dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, &info.money, dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, ft, { TextAlignment::CENTRE });
{ TextAlignment::CENTRE });
gfx_fill_rect( gfx_fill_rect(
dpi, { { info.coords - ScreenCoordsXY{ 2, 2 } }, info.coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10); dpi, { { info.coords - ScreenCoordsXY{ 2, 2 } }, info.coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);

View File

@ -710,7 +710,7 @@ void CustomListView::PaintSeperator(
// Draw string // Draw string
Formatter ft; Formatter ft;
ft.Add<const char*>(text); ft.Add<const char*>(text);
DrawTextBasic(dpi, { centreX, pos.y }, STR_STRING, ft.Data(), { baseColour, TextAlignment::CENTRE }); DrawTextBasic(dpi, { centreX, pos.y }, STR_STRING, ft, { baseColour, TextAlignment::CENTRE });
// Get string dimensions // Get string dimensions
format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_STRING, ft.Data()); format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_STRING, ft.Data());

View File

@ -222,8 +222,9 @@ static void window_clear_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi)
w->windowPos.y + window_clear_scenery_widgets[WIDX_PREVIEW].midY() }; w->windowPos.y + window_clear_scenery_widgets[WIDX_PREVIEW].midY() };
if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE) if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE)
{ {
DrawTextBasic( auto ft = Formatter();
dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &gLandToolSize, { TextAlignment::CENTRE }); ft.Add<uint16_t>(gLandToolSize);
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
} }
// Draw cost amount // Draw cost amount

View File

@ -241,5 +241,5 @@ static void custom_currency_window_paint(rct_window* w, rct_drawpixelinfo* dpi)
rct_string_id stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) rct_string_id stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix)
? STR_PREFIX ? STR_PREFIX
: STR_SUFFIX; : STR_SUFFIX;
DrawTextBasic(dpi, drawPos, stringId, w, { w->colours[1] }); DrawTextBasic(dpi, drawPos, stringId, {}, { w->colours[1] });
} }

View File

@ -497,7 +497,6 @@ static void window_editor_inventions_list_paint(rct_window* w, rct_drawpixelinfo
{ {
rct_widget* widget; rct_widget* widget;
ResearchItem* researchItem; ResearchItem* researchItem;
rct_string_id stringId;
int32_t width; int32_t width;
WindowDrawWidgets(w, dpi); WindowDrawWidgets(w, dpi);
@ -566,8 +565,9 @@ static void window_editor_inventions_list_paint(rct_window* w, rct_drawpixelinfo
// Item category // Item category
screenPos.x = w->windowPos.x + w->widgets[WIDX_RESEARCH_ORDER_SCROLL].right + 4; screenPos.x = w->windowPos.x + w->widgets[WIDX_RESEARCH_ORDER_SCROLL].right + 4;
stringId = researchItem->GetCategoryInventionString(); ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, &stringId); ft.Add<rct_string_id>(researchItem->GetCategoryInventionString());
DrawTextBasic(dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, ft);
} }
/** /**

View File

@ -790,7 +790,6 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
{ {
int32_t width; int32_t width;
rct_string_id stringId; rct_string_id stringId;
uint64_t arg;
WindowDrawWidgets(w, dpi); WindowDrawWidgets(w, dpi);
window_editor_objective_options_draw_tab_images(w, dpi); window_editor_objective_options_draw_tab_images(w, dpi);
@ -801,8 +800,9 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
// Objective value // Objective value
screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE].left + 1, w->widgets[WIDX_OBJECTIVE].top }; screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE].left + 1, w->widgets[WIDX_OBJECTIVE].top };
stringId = ObjectiveDropdownOptionNames[gScenarioObjective.Type]; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, &stringId); ft.Add<rct_string_id>(ObjectiveDropdownOptionNames[gScenarioObjective.Type]);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
if (w->widgets[WIDX_OBJECTIVE_ARG_1].type != WindowWidgetType::Empty) if (w->widgets[WIDX_OBJECTIVE_ARG_1].type != WindowWidgetType::Empty)
{ {
@ -836,34 +836,35 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
// Objective argument 1 value // Objective argument 1 value
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE_ARG_1].left + 1, w->widgets[WIDX_OBJECTIVE_ARG_1].top }; + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE_ARG_1].left + 1, w->widgets[WIDX_OBJECTIVE_ARG_1].top };
ft = Formatter();
switch (gScenarioObjective.Type) switch (gScenarioObjective.Type)
{ {
case OBJECTIVE_GUESTS_BY: case OBJECTIVE_GUESTS_BY:
case OBJECTIVE_GUESTS_AND_RATING: case OBJECTIVE_GUESTS_AND_RATING:
stringId = STR_WINDOW_OBJECTIVE_VALUE_GUEST_COUNT; stringId = STR_WINDOW_OBJECTIVE_VALUE_GUEST_COUNT;
arg = gScenarioObjective.NumGuests; ft.Add<uint16_t>(gScenarioObjective.NumGuests);
break; break;
case OBJECTIVE_PARK_VALUE_BY: case OBJECTIVE_PARK_VALUE_BY:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
case OBJECTIVE_MONTHLY_RIDE_INCOME: case OBJECTIVE_MONTHLY_RIDE_INCOME:
case OBJECTIVE_MONTHLY_FOOD_INCOME: case OBJECTIVE_MONTHLY_FOOD_INCOME:
stringId = STR_CURRENCY_FORMAT_LABEL; stringId = STR_CURRENCY_FORMAT_LABEL;
arg = gScenarioObjective.Currency; ft.Add<money64>(gScenarioObjective.Currency);
break; break;
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
stringId = STR_WINDOW_OBJECTIVE_VALUE_LENGTH; stringId = STR_WINDOW_OBJECTIVE_VALUE_LENGTH;
arg = gScenarioObjective.MinimumLength; ft.Add<uint16_t>(gScenarioObjective.MinimumLength);
break; break;
case OBJECTIVE_FINISH_5_ROLLERCOASTERS: case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
stringId = STR_WINDOW_OBJECTIVE_VALUE_RATING; stringId = STR_WINDOW_OBJECTIVE_VALUE_RATING;
arg = gScenarioObjective.MinimumExcitement; ft.Add<uint16_t>(gScenarioObjective.MinimumExcitement);
break; break;
default: default:
stringId = STR_WINDOW_OBJECTIVE_VALUE_RATING; stringId = STR_WINDOW_OBJECTIVE_VALUE_RATING;
arg = gScenarioObjective.Currency; ft.Add<money64>(gScenarioObjective.Currency);
break; break;
} }
DrawTextBasic(dpi, screenCoords, stringId, &arg, COLOUR_BLACK); DrawTextBasic(dpi, screenCoords, stringId, ft, COLOUR_BLACK);
} }
if (w->widgets[WIDX_OBJECTIVE_ARG_2].type != WindowWidgetType::Empty) if (w->widgets[WIDX_OBJECTIVE_ARG_2].type != WindowWidgetType::Empty)
@ -875,8 +876,9 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
// Objective argument 2 value // Objective argument 2 value
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE_ARG_2].left + 1, w->widgets[WIDX_OBJECTIVE_ARG_2].top }; + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE_ARG_2].left + 1, w->widgets[WIDX_OBJECTIVE_ARG_2].top };
arg = (gScenarioObjective.Year * MONTH_COUNT) - 1; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, &arg); ft.Add<uint16_t>((gScenarioObjective.Year * MONTH_COUNT) - 1);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, ft);
} }
// Park name // Park name
@ -887,7 +889,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark();
auto parkName = park.Name.c_str(); auto parkName = park.Name.c_str();
auto ft = Formatter(); ft = Formatter();
ft.Add<rct_string_id>(STR_STRING); ft.Add<rct_string_id>(STR_STRING);
ft.Add<const char*>(parkName); ft.Add<const char*>(parkName);
DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_PARK_NAME, ft); DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_PARK_NAME, ft);
@ -897,7 +899,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_SCENARIO_NAME].top }; screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_SCENARIO_NAME].top };
width = w->widgets[WIDX_SCENARIO_NAME].left - 16; width = w->widgets[WIDX_SCENARIO_NAME].left - 16;
auto ft = Formatter(); ft = Formatter();
ft.Add<rct_string_id>(STR_STRING); ft.Add<rct_string_id>(STR_STRING);
ft.Add<const char*>(gS6Info.name); ft.Add<const char*>(gS6Info.name);
DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft); DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft);
@ -921,8 +923,9 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
// Scenario category value // Scenario category value
screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CATEGORY].left + 1, w->widgets[WIDX_CATEGORY].top }; screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CATEGORY].left + 1, w->widgets[WIDX_CATEGORY].top };
stringId = ScenarioCategoryStringIds[gS6Info.category]; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, &stringId); ft.Add<rct_string_id>(ScenarioCategoryStringIds[gS6Info.category]);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
} }
/** /**

View File

@ -690,7 +690,9 @@ static void window_editor_scenario_options_financial_paint(rct_window* w, rct_dr
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_INITIAL_CASH].left + 1, w->widgets[WIDX_INITIAL_CASH].top }; + ScreenCoordsXY{ w->widgets[WIDX_INITIAL_CASH].left + 1, w->widgets[WIDX_INITIAL_CASH].top };
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &gInitialCash); auto ft = Formatter();
ft.Add<money64>(gInitialCash);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
} }
if (w->widgets[WIDX_INITIAL_LOAN].type != WindowWidgetType::Empty) if (w->widgets[WIDX_INITIAL_LOAN].type != WindowWidgetType::Empty)
@ -700,7 +702,9 @@ static void window_editor_scenario_options_financial_paint(rct_window* w, rct_dr
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_INITIAL_LOAN].left + 1, w->widgets[WIDX_INITIAL_LOAN].top }; + ScreenCoordsXY{ w->widgets[WIDX_INITIAL_LOAN].left + 1, w->widgets[WIDX_INITIAL_LOAN].top };
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &gBankLoan); auto ft = Formatter();
ft.Add<money64>(gBankLoan);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
} }
if (w->widgets[WIDX_MAXIMUM_LOAN].type != WindowWidgetType::Empty) if (w->widgets[WIDX_MAXIMUM_LOAN].type != WindowWidgetType::Empty)
@ -710,7 +714,9 @@ static void window_editor_scenario_options_financial_paint(rct_window* w, rct_dr
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_MAXIMUM_LOAN].left + 1, w->widgets[WIDX_MAXIMUM_LOAN].top }; + ScreenCoordsXY{ w->widgets[WIDX_MAXIMUM_LOAN].left + 1, w->widgets[WIDX_MAXIMUM_LOAN].top };
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &gMaxBankLoan); auto ft = Formatter();
ft.Add<money64>(gMaxBankLoan);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
} }
if (w->widgets[WIDX_INTEREST_RATE].type != WindowWidgetType::Empty) if (w->widgets[WIDX_INTEREST_RATE].type != WindowWidgetType::Empty)
@ -721,8 +727,9 @@ static void window_editor_scenario_options_financial_paint(rct_window* w, rct_dr
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_INTEREST_RATE].left + 1, w->widgets[WIDX_INTEREST_RATE].top }; + ScreenCoordsXY{ w->widgets[WIDX_INTEREST_RATE].left + 1, w->widgets[WIDX_INTEREST_RATE].top };
int16_t interestRate = std::clamp<int16_t>(static_cast<int16_t>(gBankLoanInterestRate), INT16_MIN, INT16_MAX); auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &interestRate); ft.Add<int16_t>(std::clamp<int16_t>(static_cast<int16_t>(gBankLoanInterestRate), INT16_MIN, INT16_MAX));
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
} }
} }
@ -955,7 +962,6 @@ static void window_editor_scenario_options_guests_invalidate(rct_window* w)
*/ */
static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawpixelinfo* dpi) static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
int32_t arg;
ScreenCoordsXY screenCoords{}; ScreenCoordsXY screenCoords{};
WindowDrawWidgets(w, dpi); WindowDrawWidgets(w, dpi);
@ -970,8 +976,9 @@ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawp
// Cash per guest value // Cash per guest value
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_CASH_PER_GUEST].left + 1, w->widgets[WIDX_CASH_PER_GUEST].top }; + ScreenCoordsXY{ w->widgets[WIDX_CASH_PER_GUEST].left + 1, w->widgets[WIDX_CASH_PER_GUEST].top };
money64 value = gGuestInitialCash; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); ft.Add<money64>(gGuestInitialCash);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
} }
// Guest initial happiness label // Guest initial happiness label
@ -981,8 +988,9 @@ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawp
// Guest initial happiness value // Guest initial happiness value
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].left + 1, w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].top }; + ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].left + 1, w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].top };
arg = (gGuestInitialHappiness * 100) / 255; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &arg); ft.Add<uint16_t>((gGuestInitialHappiness * 100) / 255);
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
// Guest initial hunger label // Guest initial hunger label
screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_GUEST_INITIAL_HUNGER].top }; screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_GUEST_INITIAL_HUNGER].top };
@ -991,8 +999,9 @@ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawp
// Guest initial hunger value // Guest initial hunger value
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_HUNGER].left + 1, w->widgets[WIDX_GUEST_INITIAL_HUNGER].top }; + ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_HUNGER].left + 1, w->widgets[WIDX_GUEST_INITIAL_HUNGER].top };
arg = ((255 - gGuestInitialHunger) * 100) / 255; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &arg); ft.Add<uint16_t>(((255 - gGuestInitialHunger) * 100) / 255);
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
// Guest initial thirst label // Guest initial thirst label
screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_GUEST_INITIAL_THIRST].top }; screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_GUEST_INITIAL_THIRST].top };
@ -1001,8 +1010,9 @@ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawp
// Guest initial thirst value // Guest initial thirst value
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_THIRST].left + 1, w->widgets[WIDX_GUEST_INITIAL_THIRST].top }; + ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_THIRST].left + 1, w->widgets[WIDX_GUEST_INITIAL_THIRST].top };
arg = ((255 - gGuestInitialThirst) * 100) / 255; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &arg); ft.Add<uint16_t>(((255 - gGuestInitialThirst) * 100) / 255);
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
} }
#pragma endregion #pragma endregion
@ -1317,7 +1327,6 @@ static void window_editor_scenario_options_park_invalidate(rct_window* w)
static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpixelinfo* dpi) static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
ScreenCoordsXY screenCoords{}; ScreenCoordsXY screenCoords{};
rct_string_id stringId;
WindowDrawWidgets(w, dpi); WindowDrawWidgets(w, dpi);
window_editor_scenario_options_draw_tab_images(w, dpi); window_editor_scenario_options_draw_tab_images(w, dpi);
@ -1330,8 +1339,9 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix
// Cost to buy land value // Cost to buy land value
screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_LAND_COST].left + 1, w->widgets[WIDX_LAND_COST].top }; screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_LAND_COST].left + 1, w->widgets[WIDX_LAND_COST].top };
money64 value = gLandPrice; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); ft.Add<money64>(gLandPrice);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
} }
if (w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].type != WindowWidgetType::Empty) if (w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].type != WindowWidgetType::Empty)
@ -1344,8 +1354,9 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].left + 1, + ScreenCoordsXY{ w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].left + 1,
w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].top }; w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].top };
money64 value = gConstructionRightsPrice; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); ft.Add<money64>(gConstructionRightsPrice);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
} }
if (w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].type != WindowWidgetType::Empty) if (w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].type != WindowWidgetType::Empty)
@ -1354,15 +1365,16 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].left + 1, w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].top }; + ScreenCoordsXY{ w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].left + 1, w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].top };
auto ft = Formatter();
// Pay for park and/or rides value // Pay for park and/or rides value
if (gParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES) if (gParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES)
stringId = STR_PAID_ENTRY_PAID_RIDES; ft.Add<rct_string_id>(STR_PAID_ENTRY_PAID_RIDES);
else if (gParkFlags & PARK_FLAGS_PARK_FREE_ENTRY) else if (gParkFlags & PARK_FLAGS_PARK_FREE_ENTRY)
stringId = STR_FREE_PARK_ENTER; ft.Add<rct_string_id>(STR_FREE_PARK_ENTER);
else else
stringId = STR_PAY_PARK_ENTER; ft.Add<rct_string_id>(STR_PAY_PARK_ENTER);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, &stringId); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
} }
if (w->widgets[WIDX_ENTRY_PRICE].type != WindowWidgetType::Empty) if (w->widgets[WIDX_ENTRY_PRICE].type != WindowWidgetType::Empty)
@ -1374,8 +1386,9 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix
// Entry price value // Entry price value
screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_ENTRY_PRICE].left + 1, w->widgets[WIDX_ENTRY_PRICE].top }; screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_ENTRY_PRICE].left + 1, w->widgets[WIDX_ENTRY_PRICE].top };
money64 value = gParkEntranceFee; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); ft.Add<money64>(gParkEntranceFee);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
} }
// Climate label // Climate label
@ -1384,8 +1397,9 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix
// Climate value // Climate value
screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CLIMATE].left + 1, w->widgets[WIDX_CLIMATE].top }; screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CLIMATE].left + 1, w->widgets[WIDX_CLIMATE].top };
stringId = ClimateNames[static_cast<uint8_t>(gClimate)]; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, &stringId); ft.Add<rct_string_id>(ClimateNames[static_cast<uint8_t>(gClimate)]);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
} }
#pragma endregion #pragma endregion

View File

@ -560,8 +560,10 @@ static void window_finances_summary_paint(rct_window* w, rct_drawpixelinfo* dpi)
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 167, 279 }, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, ft); DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 167, 279 }, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, ft);
// Current cash // Current cash
ft = Formatter();
ft.Add<money64>(gCash);
rct_string_id stringId = gCash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL; rct_string_id stringId = gCash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL;
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 8, 294 }, stringId, &gCash); DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 8, 294 }, stringId, ft);
// Objective related financial information // Objective related financial information
if (gScenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME) if (gScenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME)
@ -575,8 +577,12 @@ static void window_finances_summary_paint(rct_window* w, rct_drawpixelinfo* dpi)
else else
{ {
// Park value and company value // Park value and company value
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 280, 279 }, STR_PARK_VALUE_LABEL, &gParkValue); ft = Formatter();
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 280, 294 }, STR_COMPANY_VALUE_LABEL, &gCompanyValue); ft.Add<money64>(gParkValue);
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 280, 279 }, STR_PARK_VALUE_LABEL, ft);
ft = Formatter();
ft.Add<money64>(gCompanyValue);
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 280, 294 }, STR_COMPANY_VALUE_LABEL, ft);
} }
} }
@ -714,12 +720,14 @@ static void window_finances_financial_graph_paint(rct_window* w, rct_drawpixelin
// Cash (less loan) // Cash (less loan)
auto cashLessLoan = gCash - gBankLoan; auto cashLessLoan = gCash - gBankLoan;
auto ft = Formatter();
ft.Add<money64>(cashLessLoan);
DrawTextBasic( DrawTextBasic(
dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 },
cashLessLoan >= 0 ? STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_POSITIVE cashLessLoan >= 0 ? STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_POSITIVE
: STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_NEGATIVE, : STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_NEGATIVE,
&cashLessLoan); ft);
// Graph // Graph
gfx_fill_rect_inset(dpi, { graphTopLeft, graphBottomRight }, w->colours[1], INSET_RECT_F_30); gfx_fill_rect_inset(dpi, { graphTopLeft, graphBottomRight }, w->colours[1], INSET_RECT_F_30);
@ -747,7 +755,7 @@ static void window_finances_financial_graph_paint(rct_window* w, rct_drawpixelin
for (axisBase = MONEY(12, 00); axisBase >= MONEY(-12, 00); axisBase -= MONEY(6, 00)) for (axisBase = MONEY(12, 00); axisBase >= MONEY(-12, 00); axisBase -= MONEY(6, 00))
{ {
auto axisValue = axisBase << yAxisScale; auto axisValue = axisBase << yAxisScale;
auto ft = Formatter(); ft = Formatter();
ft.Add<money64>(axisValue); ft.Add<money64>(axisValue);
DrawTextBasic( DrawTextBasic(
dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
@ -821,8 +829,9 @@ static void window_finances_park_value_graph_paint(rct_window* w, rct_drawpixeli
auto graphBottomRight = w->windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; auto graphBottomRight = w->windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 };
// Park value // Park value
auto parkValue = gParkValue; auto ft = Formatter();
DrawTextBasic(dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, &parkValue); ft.Add<money64>(gParkValue);
DrawTextBasic(dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft);
// Graph // Graph
gfx_fill_rect_inset(dpi, { graphTopLeft, graphBottomRight }, w->colours[1], INSET_RECT_F_30); gfx_fill_rect_inset(dpi, { graphTopLeft, graphBottomRight }, w->colours[1], INSET_RECT_F_30);
@ -850,7 +859,7 @@ static void window_finances_park_value_graph_paint(rct_window* w, rct_drawpixeli
for (axisBase = MONEY(24, 00); axisBase >= MONEY(0, 00); axisBase -= MONEY(6, 00)) for (axisBase = MONEY(24, 00); axisBase >= MONEY(0, 00); axisBase -= MONEY(6, 00))
{ {
auto axisValue = axisBase << yAxisScale; auto axisValue = axisBase << yAxisScale;
auto ft = Formatter(); ft = Formatter();
ft.Add<money64>(axisValue); ft.Add<money64>(axisValue);
DrawTextBasic( DrawTextBasic(
dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
@ -923,10 +932,11 @@ static void window_finances_profit_graph_paint(rct_window* w, rct_drawpixelinfo*
auto graphBottomRight = w->windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; auto graphBottomRight = w->windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 };
// Weekly profit // Weekly profit
auto weeklyPofit = gCurrentProfit; auto ft = Formatter();
ft.Add<money64>(gCurrentProfit);
DrawTextBasic( DrawTextBasic(
dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 },
weeklyPofit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, &weeklyPofit); gCurrentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, ft);
// Graph // Graph
gfx_fill_rect_inset(dpi, { graphTopLeft, graphBottomRight }, w->colours[1], INSET_RECT_F_30); gfx_fill_rect_inset(dpi, { graphTopLeft, graphBottomRight }, w->colours[1], INSET_RECT_F_30);
@ -954,7 +964,7 @@ static void window_finances_profit_graph_paint(rct_window* w, rct_drawpixelinfo*
for (axisBase = MONEY(12, 00); axisBase >= MONEY(-12, 00); axisBase -= MONEY(6, 00)) for (axisBase = MONEY(12, 00); axisBase >= MONEY(-12, 00); axisBase -= MONEY(6, 00))
{ {
money64 axisValue = axisBase << yAxisScale; money64 axisValue = axisBase << yAxisScale;
auto ft = Formatter(); ft = Formatter();
ft.Add<money64>(axisValue); ft.Add<money64>(axisValue);
DrawTextBasic( DrawTextBasic(
dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
@ -1096,9 +1106,11 @@ static void window_finances_marketing_paint(rct_window* w, rct_drawpixelinfo* dp
// Duration // Duration
uint16_t weeksRemaining = campaign->WeeksLeft; uint16_t weeksRemaining = campaign->WeeksLeft;
ft = Formatter();
ft.Add<uint16_t>(weeksRemaining);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 304, 0 }, weeksRemaining == 1 ? STR_1_WEEK_REMAINING : STR_X_WEEKS_REMAINING, dpi, screenCoords + ScreenCoordsXY{ 304, 0 }, weeksRemaining == 1 ? STR_1_WEEK_REMAINING : STR_X_WEEKS_REMAINING,
&weeksRemaining); ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
@ -1117,9 +1129,10 @@ static void window_finances_marketing_paint(rct_window* w, rct_drawpixelinfo* dp
if (campaignButton->type != WindowWidgetType::Empty) if (campaignButton->type != WindowWidgetType::Empty)
{ {
// Draw button text // Draw button text
money64 pricePerWeek = AdvertisingCampaignPricePerWeek[i];
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, MarketingCampaignNames[i][0]); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, MarketingCampaignNames[i][0]);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, &pricePerWeek); auto ft = Formatter();
ft.Add<money64>(AdvertisingCampaignPricePerWeek[i]);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, ft);
screenCoords.y += BUTTON_FACE_HEIGHT + 2; screenCoords.y += BUTTON_FACE_HEIGHT + 2;
} }

View File

@ -633,8 +633,9 @@ static void window_footpath_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
{ {
money64 cost = _window_footpath_cost; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, &cost, { TextAlignment::CENTRE }); ft.Add<money64>(_window_footpath_cost);
DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
} }
} }
} }

View File

@ -264,10 +264,10 @@ public:
// Draw number for tool sizes bigger than 7 // Draw number for tool sizes bigger than 7
if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE) if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE)
{ {
auto ft = Formatter();
ft.Add<uint16_t>(gLandToolSize);
screenCoords = { windowPos.x + previewWidget->midX(), windowPos.y + previewWidget->midY() }; screenCoords = { windowPos.x + previewWidget->midX(), windowPos.y + previewWidget->midY() };
DrawTextBasic( DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &gLandToolSize,
{ TextAlignment::CENTRE });
} }
else if (gLandMountainMode) else if (gLandMountainMode)
{ {
@ -285,16 +285,18 @@ public:
// Draw raise cost amount // Draw raise cost amount
if (gLandToolRaiseCost != MONEY32_UNDEFINED && gLandToolRaiseCost != 0) if (gLandToolRaiseCost != MONEY32_UNDEFINED && gLandToolRaiseCost != 0)
{ {
price = gLandToolRaiseCost; auto ft = Formatter();
DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, &price, { TextAlignment::CENTRE }); ft.Add<money64>(gLandToolRaiseCost);
DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE });
} }
screenCoords.y += 10; screenCoords.y += 10;
// Draw lower cost amount // Draw lower cost amount
if (gLandToolLowerCost != MONEY32_UNDEFINED && gLandToolLowerCost != 0) if (gLandToolLowerCost != MONEY32_UNDEFINED && gLandToolLowerCost != 0)
{ {
price = gLandToolLowerCost; auto ft = Formatter();
DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, &price, { TextAlignment::CENTRE }); ft.Add<money64>(gLandToolLowerCost);
DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE });
} }
screenCoords.y += 50; screenCoords.y += 50;
@ -319,7 +321,7 @@ public:
{ {
auto ft = Formatter(); auto ft = Formatter();
ft.Add<money64>(price); ft.Add<money64>(price);
DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft.Data(), { TextAlignment::CENTRE }); DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
} }
} }
} }

View File

@ -262,16 +262,19 @@ static void window_land_rights_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Draw number for tool sizes bigger than 7 // Draw number for tool sizes bigger than 7
if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE) if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE)
{ {
DrawTextBasic( auto ft = Formatter();
dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &gLandToolSize, { TextAlignment::CENTRE }); ft.Add<uint16_t>(gLandToolSize);
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
} }
// Draw cost amount // Draw cost amount
if (_landRightsCost != MONEY32_UNDEFINED && _landRightsCost != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) if (_landRightsCost != MONEY32_UNDEFINED && _landRightsCost != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY))
{ {
auto ft = Formatter();
ft.Add<money64>(_landRightsCost);
screenCoords = { window_land_rights_widgets[WIDX_PREVIEW].midX() + w->windowPos.x, screenCoords = { window_land_rights_widgets[WIDX_PREVIEW].midX() + w->windowPos.x,
window_land_rights_widgets[WIDX_PREVIEW].bottom + w->windowPos.y + 32 }; window_land_rights_widgets[WIDX_PREVIEW].bottom + w->windowPos.y + 32 };
DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, &_landRightsCost, { TextAlignment::CENTRE }); DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
} }
} }

View File

@ -714,8 +714,10 @@ static void window_loadsave_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Draw name button indicator. // Draw name button indicator.
rct_widget sort_name_widget = window_loadsave_widgets[WIDX_SORT_NAME]; rct_widget sort_name_widget = window_loadsave_widgets[WIDX_SORT_NAME];
ft = Formatter();
ft.Add<rct_string_id>(id);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, &id, dpi, w->windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, ft,
{ COLOUR_GREY }); { COLOUR_GREY });
// Date button text // Date button text
@ -727,8 +729,10 @@ static void window_loadsave_paint(rct_window* w, rct_drawpixelinfo* dpi)
id = STR_NONE; id = STR_NONE;
rct_widget sort_date_widget = window_loadsave_widgets[WIDX_SORT_DATE]; rct_widget sort_date_widget = window_loadsave_widgets[WIDX_SORT_DATE];
ft = Formatter();
ft.Add<rct_string_id>(id);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, &id, dpi, w->windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, ft,
{ COLOUR_GREY }); { COLOUR_GREY });
} }

View File

@ -822,9 +822,9 @@ static void window_map_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Draw land tool size // Draw land tool size
if (WidgetIsActiveTool(w, WIDX_SET_LAND_RIGHTS) && _landRightsToolSize > MAX_TOOL_SIZE_WITH_SPRITE) if (WidgetIsActiveTool(w, WIDX_SET_LAND_RIGHTS) && _landRightsToolSize > MAX_TOOL_SIZE_WITH_SPRITE)
{ {
DrawTextBasic( auto ft = Formatter();
dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &_landRightsToolSize, ft.Add<uint16_t>(_landRightsToolSize);
{ TextAlignment::CENTRE }); DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
} }
screenCoords.y = w->windowPos.y + window_map_widgets[WIDX_LAND_TOOL].bottom + 5; screenCoords.y = w->windowPos.y + window_map_widgets[WIDX_LAND_TOOL].bottom + 5;
@ -853,7 +853,7 @@ static void window_map_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
gfx_fill_rect( gfx_fill_rect(
dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } }, RideKeyColours[i]); dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } }, RideKeyColours[i]);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, mapLabels[i], w); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, mapLabels[i], {});
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
if (i == 3) if (i == 3)
{ {

View File

@ -686,8 +686,6 @@ static void window_mapgen_base_invalidate(rct_window* w)
static void window_mapgen_base_paint(rct_window* w, rct_drawpixelinfo* dpi) static void window_mapgen_base_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
uint16_t arg;
WindowDrawWidgets(w, dpi); WindowDrawWidgets(w, dpi);
window_mapgen_draw_tab_images(dpi, w); window_mapgen_draw_tab_images(dpi, w);
@ -705,20 +703,24 @@ static void window_mapgen_base_paint(rct_window* w, rct_drawpixelinfo* dpi)
// The practical map size is 2 lower than the technical map size // The practical map size is 2 lower than the technical map size
// This needs to be cast down to a uint16_t because that's what the STR_RESOLUTION_X_BY_Y string takes. // This needs to be cast down to a uint16_t because that's what the STR_RESOLUTION_X_BY_Y string takes.
uint16_t mapSizeArgs[] = { static_cast<uint16_t>(_mapSize - 2), static_cast<uint16_t>(_mapSize - 2) }; auto ft = Formatter();
ft.Add<uint16_t>(static_cast<uint16_t>(_mapSize - 2));
ft.Add<uint16_t>(static_cast<uint16_t>(_mapSize - 2));
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_MAP_SIZE].left + 1, w->widgets[WIDX_MAP_SIZE].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_MAP_SIZE].left + 1, w->widgets[WIDX_MAP_SIZE].top + 1 },
STR_RESOLUTION_X_BY_Y, &mapSizeArgs, { w->colours[1] }); STR_RESOLUTION_X_BY_Y, ft, { w->colours[1] });
arg = (_baseHeight - 12) / 2; ft = Formatter();
ft.Add<uint16_t>((_baseHeight - 12) / 2);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_BASE_HEIGHT].left + 1, w->widgets[WIDX_BASE_HEIGHT].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_BASE_HEIGHT].left + 1, w->widgets[WIDX_BASE_HEIGHT].top + 1 },
STR_COMMA16, &arg, { w->colours[1] }); STR_COMMA16, ft, { w->colours[1] });
arg = (_waterLevel - 12) / 2; ft = Formatter();
ft.Add<uint16_t>((_waterLevel - 12) / 2);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_WATER_LEVEL].left + 1, w->widgets[WIDX_WATER_LEVEL].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_WATER_LEVEL].left + 1, w->widgets[WIDX_WATER_LEVEL].top + 1 },
STR_COMMA16, &arg, { w->colours[1] }); STR_COMMA16, ft, { w->colours[1] });
} }
#pragma endregion #pragma endregion
@ -1003,8 +1005,6 @@ static void window_mapgen_simplex_invalidate(rct_window* w)
static void window_mapgen_simplex_paint(rct_window* w, rct_drawpixelinfo* dpi) static void window_mapgen_simplex_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
uint16_t arg;
WindowDrawWidgets(w, dpi); WindowDrawWidgets(w, dpi);
window_mapgen_draw_tab_images(dpi, w); window_mapgen_draw_tab_images(dpi, w);
@ -1028,21 +1028,29 @@ static void window_mapgen_simplex_paint(rct_window* w, rct_drawpixelinfo* dpi)
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {},
{ textColour }); { textColour });
auto ft = Formatter();
ft.Add<uint16_t>(_simplex_low);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_LOW].left + 1, w->widgets[WIDX_SIMPLEX_LOW].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_LOW].left + 1, w->widgets[WIDX_SIMPLEX_LOW].top + 1 },
STR_COMMA16, &_simplex_low, { textColour }); STR_COMMA16, ft, { textColour });
ft = Formatter();
ft.Add<uint16_t>(_simplex_high);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_HIGH].left + 1, w->widgets[WIDX_SIMPLEX_HIGH].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_HIGH].left + 1, w->widgets[WIDX_SIMPLEX_HIGH].top + 1 },
STR_COMMA16, &_simplex_high, { textColour }); STR_COMMA16, ft, { textColour });
ft = Formatter();
ft.Add<uint16_t>(_simplex_base_freq);
DrawTextBasic( DrawTextBasic(
dpi, dpi,
w->windowPos w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_BASE_FREQ].left + 1, w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 }, + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_BASE_FREQ].left + 1, w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 },
STR_WINDOW_OBJECTIVE_VALUE_RATING, &_simplex_base_freq, { textColour }); STR_WINDOW_OBJECTIVE_VALUE_RATING, ft, { textColour });
ft = Formatter();
ft.Add<uint16_t>(_simplex_octaves);
DrawTextBasic( DrawTextBasic(
dpi, dpi,
w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_OCTAVES].left + 1, w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_OCTAVES].left + 1, w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1 },
STR_COMMA16, &_simplex_octaves, { textColour }); STR_COMMA16, ft, { textColour });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX].top + 1 }, STR_TERRAIN_LABEL, dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX].top + 1 }, STR_TERRAIN_LABEL,
{}, { textColour }); {}, { textColour });
@ -1052,18 +1060,21 @@ static void window_mapgen_simplex_paint(rct_window* w, rct_drawpixelinfo* dpi)
// The practical map size is 2 lower than the technical map size. // The practical map size is 2 lower than the technical map size.
// This needs to be cast down to a uint16_t because that's what the STR_RESOLUTION_X_BY_Y string takes. // This needs to be cast down to a uint16_t because that's what the STR_RESOLUTION_X_BY_Y string takes.
uint16_t mapSizeArgs[] = { static_cast<uint16_t>(_mapSize - 2), static_cast<uint16_t>(_mapSize - 2) }; ft = Formatter();
ft.Add<uint16_t>(static_cast<uint16_t>(_mapSize - 2));
ft.Add<uint16_t>(static_cast<uint16_t>(_mapSize - 2));
DrawTextBasic( DrawTextBasic(
dpi, dpi,
w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_MAP_SIZE].left + 1, w->widgets[WIDX_SIMPLEX_MAP_SIZE].top + 1 }, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_MAP_SIZE].left + 1, w->widgets[WIDX_SIMPLEX_MAP_SIZE].top + 1 },
STR_RESOLUTION_X_BY_Y, &mapSizeArgs, { textColour }); STR_RESOLUTION_X_BY_Y, ft, { textColour });
arg = (_waterLevel - 12) / 2; ft = Formatter();
ft.Add<uint16_t>((_waterLevel - 12) / 2);
DrawTextBasic( DrawTextBasic(
dpi, dpi,
w->windowPos w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_WATER_LEVEL].left + 1, w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_WATER_LEVEL].left + 1, w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 },
STR_COMMA16, &arg, { textColour }); STR_COMMA16, ft, { textColour });
} }
#pragma endregion #pragma endregion
@ -1216,45 +1227,53 @@ static void window_mapgen_heightmap_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Smooth strength label and value // Smooth strength label and value
const colour_t strengthColour = _heightmapSmoothMap ? enabledColour : disabledColour; const colour_t strengthColour = _heightmapSmoothMap ? enabledColour : disabledColour;
int16_t strength = _heightmapSmoothStrength;
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, STR_MAPGEN_SMOOTH_STRENGTH, {}, dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, STR_MAPGEN_SMOOTH_STRENGTH, {},
{ strengthColour }); { strengthColour });
auto ft = Formatter();
ft.Add<uint16_t>(_heightmapSmoothStrength);
DrawTextBasic( DrawTextBasic(
dpi, dpi,
w->windowPos w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_STRENGTH].left + 1, w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_STRENGTH].left + 1, w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 },
STR_COMMA16, &strength, { strengthColour }); STR_COMMA16, ft, { strengthColour });
// Low label and value // Low label and value
const colour_t labelColour = _heightmapLoaded ? enabledColour : disabledColour; const colour_t labelColour = _heightmapLoaded ? enabledColour : disabledColour;
int16_t low = _heightmapLow;
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {}, dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {},
{ labelColour }); { labelColour });
ft = Formatter();
ft.Add<uint16_t>(_heightmapLow);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_LOW].left + 1, w->widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_LOW].left + 1, w->widgets[WIDX_HEIGHTMAP_LOW].top + 1 },
STR_COMMA16, &low, { labelColour }); STR_COMMA16, ft, { labelColour });
// High label and value // High label and value
int16_t high = _heightmapHigh;
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {}, dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {},
{ labelColour }); { labelColour });
ft = Formatter();
ft.Add<uint16_t>(_heightmapHigh);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_HIGH].left + 1, w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_HIGH].left + 1, w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1 },
STR_COMMA16, &high, { labelColour }); STR_COMMA16, ft, { labelColour });
// Water level label and value // Water level label and value
int16_t waterLevel = _waterLevel;
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {},
{ labelColour }); { labelColour });
ft = Formatter();
ft.Add<uint16_t>(_waterLevel);
DrawTextBasic( DrawTextBasic(
dpi, dpi,
w->windowPos w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].left + 1, w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].left + 1, w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 },
STR_COMMA16, &waterLevel, { labelColour }); STR_COMMA16, ft, { labelColour });
} }
#pragma endregion #pragma endregion

View File

@ -431,21 +431,27 @@ static void window_multiplayer_information_paint(rct_window* w, rct_drawpixelinf
const utf8* providerName = network_get_server_provider_name(); const utf8* providerName = network_get_server_provider_name();
if (!str_is_null_or_empty(providerName)) if (!str_is_null_or_empty(providerName))
{ {
DrawTextBasic(dpi, screenCoords, STR_PROVIDER_NAME, static_cast<void*>(&providerName)); auto ft = Formatter();
ft.Add<const char*>(providerName);
DrawTextBasic(dpi, screenCoords, STR_PROVIDER_NAME, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
const utf8* providerEmail = network_get_server_provider_email(); const utf8* providerEmail = network_get_server_provider_email();
if (!str_is_null_or_empty(providerEmail)) if (!str_is_null_or_empty(providerEmail))
{ {
DrawTextBasic(dpi, screenCoords, STR_PROVIDER_EMAIL, static_cast<void*>(&providerEmail)); auto ft = Formatter();
ft.Add<const char*>(providerEmail);
DrawTextBasic(dpi, screenCoords, STR_PROVIDER_EMAIL, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
const utf8* providerWebsite = network_get_server_provider_website(); const utf8* providerWebsite = network_get_server_provider_website();
if (!str_is_null_or_empty(providerWebsite)) if (!str_is_null_or_empty(providerWebsite))
{ {
DrawTextBasic(dpi, screenCoords, STR_PROVIDER_WEBSITE, static_cast<void*>(&providerWebsite)); auto ft = Formatter();
ft.Add<const char*>(providerWebsite);
DrawTextBasic(dpi, screenCoords, STR_PROVIDER_WEBSITE, ft);
} }
} }
} }
@ -558,7 +564,9 @@ static void window_multiplayer_players_paint(rct_window* w, rct_drawpixelinfo* d
// Number of players // Number of players
stringId = w->no_list_items == 1 ? STR_MULTIPLAYER_PLAYER_COUNT : STR_MULTIPLAYER_PLAYER_COUNT_PLURAL; stringId = w->no_list_items == 1 ? STR_MULTIPLAYER_PLAYER_COUNT : STR_MULTIPLAYER_PLAYER_COUNT_PLURAL;
auto screenCoords = w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 }; auto screenCoords = w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 };
DrawTextBasic(dpi, screenCoords, stringId, &w->no_list_items, { w->colours[2] }); auto ft = Formatter();
ft.Add<uint16_t>(w->no_list_items);
DrawTextBasic(dpi, screenCoords, stringId, ft, { w->colours[2] });
} }
static void window_multiplayer_players_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) static void window_multiplayer_players_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)

View File

@ -346,20 +346,24 @@ public:
// Number of weeks // Number of weeks
rct_widget* spinnerWidget = &widgets[WIDX_WEEKS_SPINNER]; rct_widget* spinnerWidget = &widgets[WIDX_WEEKS_SPINNER];
auto ft = Formatter();
ft.Add<int16_t>(campaign.no_weeks);
DrawTextBasic( DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ spinnerWidget->left + 1, spinnerWidget->top }, &dpi, windowPos + ScreenCoordsXY{ spinnerWidget->left + 1, spinnerWidget->top },
campaign.no_weeks == 1 ? STR_MARKETING_1_WEEK : STR_X_WEEKS, &campaign.no_weeks, { colours[0] }); campaign.no_weeks == 1 ? STR_MARKETING_1_WEEK : STR_X_WEEKS, ft, { colours[0] });
screenCoords = windowPos + ScreenCoordsXY{ 14, 60 }; screenCoords = windowPos + ScreenCoordsXY{ 14, 60 };
// Price per week // Price per week
money64 pricePerWeek = AdvertisingCampaignPricePerWeek[campaign.campaign_type]; ft = Formatter();
DrawTextBasic(&dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, &pricePerWeek); ft.Add<money64>(AdvertisingCampaignPricePerWeek[campaign.campaign_type]);
DrawTextBasic(&dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, ft);
screenCoords.y += 13; screenCoords.y += 13;
// Total price // Total price
money64 totalPrice = AdvertisingCampaignPricePerWeek[campaign.campaign_type] * campaign.no_weeks; ft = Formatter();
DrawTextBasic(&dpi, screenCoords, STR_MARKETING_TOTAL_COST, &totalPrice); ft.Add<money64>(AdvertisingCampaignPricePerWeek[campaign.campaign_type] * campaign.no_weeks);
DrawTextBasic(&dpi, screenCoords, STR_MARKETING_TOTAL_COST, ft);
} }
}; };

View File

@ -896,7 +896,7 @@ static void window_options_display_paint(rct_window* w, rct_drawpixelinfo* dpi)
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_FULLSCREEN].top + 1 }, STR_FULLSCREEN_MODE, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_FULLSCREEN].top + 1 }, STR_FULLSCREEN_MODE,
w, { w->colours[1] }); {}, { w->colours[1] });
// Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)"
colour_t colour = w->colours[1]; colour_t colour = w->colours[1];
@ -906,19 +906,20 @@ static void window_options_display_paint(rct_window* w, rct_drawpixelinfo* dpi)
} }
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10 + 15, window_options_display_widgets[WIDX_RESOLUTION].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ 10 + 15, window_options_display_widgets[WIDX_RESOLUTION].top + 1 },
STR_DISPLAY_RESOLUTION, w, { colour }); STR_DISPLAY_RESOLUTION, {}, { colour });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_SCALE].top + 1 }, STR_UI_SCALING_DESC, w, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_SCALE].top + 1 }, STR_UI_SCALING_DESC, {},
{ w->colours[1] }); { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_DRAWING_ENGINE].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_DRAWING_ENGINE].top + 1 },
STR_DRAWING_ENGINE, w, { w->colours[1] }); STR_DRAWING_ENGINE, {}, { w->colours[1] });
int32_t scale = static_cast<int32_t>(gConfigGeneral.window_scale * 100); auto ft = Formatter();
ft.Add<int32_t>(static_cast<int32_t>(gConfigGeneral.window_scale * 100));
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SCALE].left + 1, w->widgets[WIDX_SCALE].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SCALE].left + 1, w->widgets[WIDX_SCALE].top + 1 },
STR_WINDOW_OBJECTIVE_VALUE_RATING, &scale, { w->colours[1] }); STR_WINDOW_OBJECTIVE_VALUE_RATING, ft, { w->colours[1] });
colour = w->colours[1]; colour = w->colours[1];
if (gConfigGeneral.drawing_engine == DrawingEngine::Software if (gConfigGeneral.drawing_engine == DrawingEngine::Software
@ -928,7 +929,7 @@ static void window_options_display_paint(rct_window* w, rct_drawpixelinfo* dpi)
} }
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 25, window_options_display_widgets[WIDX_SCALE_QUALITY].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ 25, window_options_display_widgets[WIDX_SCALE_QUALITY].top + 1 },
STR_SCALING_QUALITY, w, { colour }); STR_SCALING_QUALITY, {}, { colour });
} }
#pragma region Rendering Tab #pragma region Rendering Tab
@ -1331,21 +1332,21 @@ static void window_options_culture_paint(rct_window* w, rct_drawpixelinfo* dpi)
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_LANGUAGE].top + 1 }, STR_OPTIONS_LANGUAGE, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_LANGUAGE].top + 1 }, STR_OPTIONS_LANGUAGE,
w, { w->colours[1] }); {}, { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_CURRENCY].top + 1 }, STR_CURRENCY, w, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_CURRENCY].top + 1 }, STR_CURRENCY, {},
{ w->colours[1] }); { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_DISTANCE].top + 1 }, STR_DISTANCE_AND_SPEED, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_DISTANCE].top + 1 }, STR_DISTANCE_AND_SPEED,
w, { w->colours[1] }); {}, { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_TEMPERATURE].top + 1 }, STR_TEMPERATURE, w, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_TEMPERATURE].top + 1 }, STR_TEMPERATURE, {},
{ w->colours[1] }); { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_HEIGHT_LABELS].top + 1 }, STR_HEIGHT_LABELS, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_HEIGHT_LABELS].top + 1 }, STR_HEIGHT_LABELS,
w, { w->colours[1] }); {}, { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_DATE_FORMAT].top + 1 }, STR_DATE_FORMAT, w, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_DATE_FORMAT].top + 1 }, STR_DATE_FORMAT, {},
{ w->colours[1] }); { w->colours[1] });
} }
@ -1748,7 +1749,7 @@ static void window_options_controls_paint(rct_window* w, rct_drawpixelinfo* dpi)
DrawTextBasic( DrawTextBasic(
dpi, dpi,
w->windowPos + ScreenCoordsXY{ 10, window_options_controls_and_interface_widgets[WIDX_TOOLBAR_BUTTONS_GROUP].top + 15 }, w->windowPos + ScreenCoordsXY{ 10, window_options_controls_and_interface_widgets[WIDX_TOOLBAR_BUTTONS_GROUP].top + 15 },
STR_SHOW_TOOLBAR_BUTTONS_FOR, w, { w->colours[1] }); STR_SHOW_TOOLBAR_BUTTONS_FOR, {}, { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_controls_and_interface_widgets[WIDX_THEMES].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_controls_and_interface_widgets[WIDX_THEMES].top + 1 },
STR_THEMES_LABEL_CURRENT_THEME, {}, { w->colours[1] }); STR_THEMES_LABEL_CURRENT_THEME, {}, { w->colours[1] });
@ -1964,13 +1965,13 @@ static void window_options_misc_paint(rct_window* w, rct_drawpixelinfo* dpi)
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_TITLE_SEQUENCE].top + 1 }, STR_TITLE_SEQUENCE, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_TITLE_SEQUENCE].top + 1 }, STR_TITLE_SEQUENCE,
w, { w->colours[1] }); {}, { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_SCENARIO_GROUPING].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_SCENARIO_GROUPING].top + 1 },
STR_OPTIONS_SCENARIO_GROUPING, {}, { w->colours[1] }); STR_OPTIONS_SCENARIO_GROUPING, {}, { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].top + 1 },
STR_DEFAULT_INSPECTION_INTERVAL, w, { w->colours[1] }); STR_DEFAULT_INSPECTION_INTERVAL, {}, { w->colours[1] });
} }
#pragma region Advanced Tab #pragma region Advanced Tab
@ -2130,7 +2131,7 @@ static void window_options_advanced_paint(rct_window* w, rct_drawpixelinfo* dpi)
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 24, window_options_advanced_widgets[WIDX_AUTOSAVE].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ 24, window_options_advanced_widgets[WIDX_AUTOSAVE].top + 1 },
STR_OPTIONS_AUTOSAVE_FREQUENCY_LABEL, w, { w->colours[1] }); STR_OPTIONS_AUTOSAVE_FREQUENCY_LABEL, {}, { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, dpi,
w->windowPos w->windowPos
@ -2139,14 +2140,15 @@ static void window_options_advanced_paint(rct_window* w, rct_drawpixelinfo* dpi)
window_options_autosave_names[gConfigGeneral.autosave_frequency], {}, { w->colours[1] }); window_options_autosave_names[gConfigGeneral.autosave_frequency], {}, { w->colours[1] });
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 24, window_options_advanced_widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, dpi, w->windowPos + ScreenCoordsXY{ 24, window_options_advanced_widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 },
STR_AUTOSAVE_AMOUNT, w, { w->colours[1] }); STR_AUTOSAVE_AMOUNT, {}, { w->colours[1] });
int32_t autosavesToKeep = static_cast<int32_t>(gConfigGeneral.autosave_amount); auto ft = Formatter();
ft.Add<int32_t>(static_cast<int32_t>(gConfigGeneral.autosave_amount));
DrawTextBasic( DrawTextBasic(
dpi, dpi,
w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, w->widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, w->widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 },
STR_WINDOW_OBJECTIVE_VALUE_GUEST_COUNT, &autosavesToKeep, { w->colours[1] }); STR_WINDOW_OBJECTIVE_VALUE_GUEST_COUNT, ft, { w->colours[1] });
auto ft = Formatter(); ft = Formatter();
ft.Add<utf8*>(Platform::StrDecompToPrecomp(gConfigGeneral.rct1_path)); ft.Add<utf8*>(Platform::StrDecompToPrecomp(gConfigGeneral.rct1_path));
rct_widget pathWidget = window_options_advanced_widgets[WIDX_PATH_TO_RCT1_BUTTON]; rct_widget pathWidget = window_options_advanced_widgets[WIDX_PATH_TO_RCT1_BUTTON];

View File

@ -898,7 +898,9 @@ static void window_park_rating_paint(rct_window* w, rct_drawpixelinfo* dpi)
rct_widget* widget = &window_park_rating_widgets[WIDX_PAGE_BACKGROUND]; rct_widget* widget = &window_park_rating_widgets[WIDX_PAGE_BACKGROUND];
// Current value // Current value
DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, &gParkRating); auto ft = Formatter();
ft.Add<uint16_t>(gParkRating);
DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft);
// Graph border // Graph border
gfx_fill_rect_inset( gfx_fill_rect_inset(
@ -912,7 +914,7 @@ static void window_park_rating_paint(rct_window* w, rct_drawpixelinfo* dpi)
for (int i = 5; i >= 0; i--) for (int i = 5; i >= 0; i--)
{ {
uint32_t axisValue = i * 200; uint32_t axisValue = i * 200;
auto ft = Formatter(); ft = Formatter();
ft.Add<uint32_t>(axisValue); ft.Add<uint32_t>(axisValue);
DrawTextBasic( DrawTextBasic(
dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft,
@ -1033,8 +1035,9 @@ static void window_park_guests_paint(rct_window* w, rct_drawpixelinfo* dpi)
rct_widget* widget = &window_park_guests_widgets[WIDX_PAGE_BACKGROUND]; rct_widget* widget = &window_park_guests_widgets[WIDX_PAGE_BACKGROUND];
// Current value // Current value
DrawTextBasic( auto ft = Formatter();
dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, &gNumGuestsInPark); ft.Add<uint32_t>(gNumGuestsInPark);
DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft);
// Graph border // Graph border
gfx_fill_rect_inset( gfx_fill_rect_inset(
@ -1048,7 +1051,7 @@ static void window_park_guests_paint(rct_window* w, rct_drawpixelinfo* dpi)
for (int i = 5; i >= 0; i--) for (int i = 5; i >= 0; i--)
{ {
uint32_t axisValue = i * 1000; uint32_t axisValue = i * 1000;
auto ft = Formatter(); ft = Formatter();
ft.Add<uint32_t>(axisValue); ft.Add<uint32_t>(axisValue);
DrawTextBasic( DrawTextBasic(
dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft,
@ -1181,12 +1184,16 @@ static void window_park_price_paint(rct_window* w, rct_drawpixelinfo* dpi)
auto screenCoords = w->windowPos auto screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_PAGE_BACKGROUND].left + 4, w->widgets[WIDX_PAGE_BACKGROUND].top + 30 }; + ScreenCoordsXY{ w->widgets[WIDX_PAGE_BACKGROUND].left + 4, w->widgets[WIDX_PAGE_BACKGROUND].top + 30 };
DrawTextBasic(dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, &gTotalIncomeFromAdmissions); auto ft = Formatter();
ft.Add<money64>(gTotalIncomeFromAdmissions);
DrawTextBasic(dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft);
money64 parkEntranceFee = park_get_entrance_fee(); money64 parkEntranceFee = park_get_entrance_fee();
auto stringId = parkEntranceFee == 0 ? STR_FREE : STR_BOTTOM_TOOLBAR_CASH; auto stringId = parkEntranceFee == 0 ? STR_FREE : STR_BOTTOM_TOOLBAR_CASH;
screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_PRICE].left + 1, w->widgets[WIDX_PRICE].top + 1 }; screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_PRICE].left + 1, w->widgets[WIDX_PRICE].top + 1 };
DrawTextBasic(dpi, screenCoords, stringId, &parkEntranceFee, { w->colours[1] }); ft = Formatter();
ft.Add<money64>(parkEntranceFee);
DrawTextBasic(dpi, screenCoords, stringId, ft, { w->colours[1] });
} }
#pragma endregion #pragma endregion

View File

@ -561,8 +561,9 @@ void window_research_funding_page_paint(rct_window* w, rct_drawpixelinfo* dpi, r
return; return;
int32_t currentResearchLevel = gResearchFundingLevel; int32_t currentResearchLevel = gResearchFundingLevel;
money64 currentResearchCostPerWeek = research_cost_table[currentResearchLevel]; auto ft = Formatter();
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, &currentResearchCostPerWeek); ft.Add<money64>(research_cost_table[currentResearchLevel]);
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, ft);
} }
#pragma endregion #pragma endregion

View File

@ -2635,7 +2635,7 @@ static void window_ride_main_paint(rct_window* w, rct_drawpixelinfo* dpi)
widget = &window_ride_main_widgets[WIDX_VIEW]; widget = &window_ride_main_widgets[WIDX_VIEW];
DrawTextBasic( DrawTextBasic(
dpi, { w->windowPos.x + (widget->left + widget->right - 11) / 2, w->windowPos.y + widget->top }, dpi, { w->windowPos.x + (widget->left + widget->right - 11) / 2, w->windowPos.y + widget->top },
STR_WINDOW_COLOUR_2_STRINGID, ft.Data(), { TextAlignment::CENTRE }); STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE });
// Status // Status
ft = Formatter(); ft = Formatter();
@ -2922,19 +2922,22 @@ static void window_ride_vehicle_paint(rct_window* w, rct_drawpixelinfo* dpi)
screenCoords.y += 2; screenCoords.y += 2;
// Capacity // Capacity
DrawTextBasic(dpi, screenCoords, STR_CAPACITY, &rideEntry->capacity, COLOUR_BLACK); auto ft = Formatter();
ft.Add<rct_string_id>(rideEntry->capacity);
DrawTextBasic(dpi, screenCoords, STR_CAPACITY, ft);
// Excitement Factor // Excitement Factor
auto factor = static_cast<int16_t>(rideEntry->excitement_multiplier); if (rideEntry->excitement_multiplier > 0)
if (factor > 0)
{ {
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
DrawTextBasic(dpi, screenCoords, STR_EXCITEMENT_FACTOR, &factor, COLOUR_BLACK);
ft = Formatter();
ft.Add<int16_t>(rideEntry->intensity_multiplier);
DrawTextBasic(dpi, screenCoords, STR_EXCITEMENT_FACTOR, ft);
} }
// Intensity Factor // Intensity Factor
factor = rideEntry->intensity_multiplier; if (rideEntry->intensity_multiplier > 0)
if (factor > 0)
{ {
int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM);
if (lineHeight != 10) if (lineHeight != 10)
@ -2942,18 +2945,22 @@ static void window_ride_vehicle_paint(rct_window* w, rct_drawpixelinfo* dpi)
else else
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
DrawTextBasic(dpi, screenCoords, STR_INTENSITY_FACTOR, &factor, COLOUR_BLACK); ft = Formatter();
ft.Add<int16_t>(rideEntry->intensity_multiplier);
DrawTextBasic(dpi, screenCoords, STR_INTENSITY_FACTOR, ft);
if (lineHeight != 10) if (lineHeight != 10)
screenCoords.x -= 150; screenCoords.x -= 150;
} }
// Nausea Factor // Nausea Factor
factor = rideEntry->nausea_multiplier; if (rideEntry->nausea_multiplier > 0)
if (factor > 0)
{ {
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
DrawTextBasic(dpi, screenCoords, STR_NAUSEA_FACTOR, &factor, COLOUR_BLACK);
ft = Formatter();
ft.Add<int16_t>(rideEntry->nausea_multiplier);
DrawTextBasic(dpi, screenCoords, STR_NAUSEA_FACTOR, ft);
} }
} }
@ -3648,10 +3655,11 @@ static void window_ride_operating_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Number of block sections // Number of block sections
if (ride->IsBlockSectioned()) if (ride->IsBlockSectioned())
{ {
auto blockSections = ride->num_block_brakes + ride->num_stations; auto ft = Formatter();
ft.Add<uint16_t>(ride->num_block_brakes + ride->num_stations);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 21, ride->mode == RideMode::PoweredLaunchBlockSectioned ? 89 : 61 }, dpi, w->windowPos + ScreenCoordsXY{ 21, ride->mode == RideMode::PoweredLaunchBlockSectioned ? 89 : 61 },
STR_BLOCK_SECTIONS, &blockSections, COLOUR_BLACK); STR_BLOCK_SECTIONS, ft, COLOUR_BLACK);
} }
} }
@ -4050,29 +4058,32 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi)
screenCoords = w->windowPos + ScreenCoordsXY{ widget->left + 4, widget->top + 4 }; screenCoords = w->windowPos + ScreenCoordsXY{ widget->left + 4, widget->top + 4 };
uint16_t reliability = ride->reliability_percentage; uint16_t reliability = ride->reliability_percentage;
DrawTextBasic(dpi, screenCoords, STR_RELIABILITY_LABEL_1757, &reliability); auto ft = Formatter();
ft.Add<uint16_t>(reliability);
DrawTextBasic(dpi, screenCoords, STR_RELIABILITY_LABEL_1757, ft);
window_ride_maintenance_draw_bar( window_ride_maintenance_draw_bar(
w, dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, std::max<int32_t>(10, reliability), COLOUR_BRIGHT_GREEN); w, dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, std::max<int32_t>(10, reliability), COLOUR_BRIGHT_GREEN);
screenCoords.y += 11; screenCoords.y += 11;
uint16_t downTime = ride->downtime; uint16_t downTime = ride->downtime;
DrawTextBasic(dpi, screenCoords, STR_DOWN_TIME_LABEL_1889, &downTime); ft = Formatter();
ft.Add<uint16_t>(downTime);
DrawTextBasic(dpi, screenCoords, STR_DOWN_TIME_LABEL_1889, ft);
window_ride_maintenance_draw_bar(w, dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, downTime, COLOUR_BRIGHT_RED); window_ride_maintenance_draw_bar(w, dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, downTime, COLOUR_BRIGHT_RED);
screenCoords.y += 26; screenCoords.y += 26;
// Last inspection // Last inspection
uint16_t lastInspection = ride->last_inspection;
// Use singular form for 1 minute of time or less
rct_string_id stringId; rct_string_id stringId;
if (lastInspection <= 1) if (ride->last_inspection <= 1)
stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTE; stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTE;
else if (lastInspection <= 240) else if (ride->last_inspection <= 240)
stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTES; stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTES;
else else
stringId = STR_TIME_SINCE_LAST_INSPECTION_MORE_THAN_4_HOURS; stringId = STR_TIME_SINCE_LAST_INSPECTION_MORE_THAN_4_HOURS;
DrawTextBasic(dpi, screenCoords, stringId, &lastInspection); ft = Formatter();
ft.Add<uint16_t>(ride->last_inspection);
DrawTextBasic(dpi, screenCoords, stringId, ft);
screenCoords.y += 12; screenCoords.y += 12;
// Last / current breakdown // Last / current breakdown
@ -4080,8 +4091,9 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi)
return; return;
stringId = (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) ? STR_CURRENT_BREAKDOWN : STR_LAST_BREAKDOWN; stringId = (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) ? STR_CURRENT_BREAKDOWN : STR_LAST_BREAKDOWN;
rct_string_id breakdownMessage = RideBreakdownReasonNames[ride->breakdown_reason]; ft = Formatter();
DrawTextBasic(dpi, screenCoords, stringId, &breakdownMessage); ft.Add<rct_string_id>(RideBreakdownReasonNames[ride->breakdown_reason]);
DrawTextBasic(dpi, screenCoords, stringId, ft);
screenCoords.y += 12; screenCoords.y += 12;
// Mechanic status // Mechanic status
@ -4126,7 +4138,7 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi)
auto staff = GetEntity<Staff>(ride->mechanic); auto staff = GetEntity<Staff>(ride->mechanic);
if (staff != nullptr && staff->IsMechanic()) if (staff != nullptr && staff->IsMechanic())
{ {
auto ft = Formatter(); ft = Formatter();
staff->FormatNameTo(ft); staff->FormatNameTo(ft);
DrawTextWrapped(dpi, screenCoords, 280, stringId, ft, { TextAlignment::LEFT }); DrawTextWrapped(dpi, screenCoords, 280, stringId, ft, { TextAlignment::LEFT });
} }
@ -5524,9 +5536,6 @@ static void window_ride_measurements_invalidate(rct_window* w)
*/ */
static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi) static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
int16_t holes, maxSpeed, averageSpeed, drops, highestDropHeight, inversions, time;
int32_t maxPositiveVerticalGs, maxNegativeVerticalGs, maxLateralGs, totalAirTime, length;
WindowDrawWidgets(w, dpi); WindowDrawWidgets(w, dpi);
window_ride_draw_tab_images(dpi, w); window_ride_draw_tab_images(dpi, w);
@ -5598,20 +5607,23 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
if (ride->type == RIDE_TYPE_MINI_GOLF) if (ride->type == RIDE_TYPE_MINI_GOLF)
{ {
// Holes // Holes
holes = ride->holes; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_HOLES, &holes); ft.Add<uint16_t>(ride->holes);
DrawTextBasic(dpi, screenCoords, STR_HOLES, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
else else
{ {
// Max speed // Max speed
maxSpeed = (ride->max_speed * 9) >> 18; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_MAX_SPEED, &maxSpeed); ft.Add<int32_t>((ride->max_speed * 9) >> 18);
DrawTextBasic(dpi, screenCoords, STR_MAX_SPEED, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Average speed // Average speed
averageSpeed = (ride->average_speed * 9) >> 18; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_AVERAGE_SPEED, &averageSpeed); ft.Add<int32_t>((ride->average_speed * 9) >> 18);
DrawTextBasic(dpi, screenCoords, STR_AVERAGE_SPEED, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Ride time // Ride time
@ -5619,7 +5631,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
int32_t numTimes = 0; int32_t numTimes = 0;
for (int32_t i = 0; i < ride->num_stations; i++) for (int32_t i = 0; i < ride->num_stations; i++)
{ {
time = ride->stations[numTimes].SegmentTime; auto time = ride->stations[numTimes].SegmentTime;
if (time != 0) if (time != 0)
{ {
ft.Add<uint16_t>(STR_RIDE_TIME_ENTRY_WITH_SEPARATOR); ft.Add<uint16_t>(STR_RIDE_TIME_ENTRY_WITH_SEPARATOR);
@ -5656,7 +5668,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
int32_t numLengths = 0; int32_t numLengths = 0;
for (int32_t i = 0; i < ride->num_stations; i++) for (int32_t i = 0; i < ride->num_stations; i++)
{ {
length = ride->stations[i].SegmentLength; auto length = ride->stations[i].SegmentLength;
if (length != 0) if (length != 0)
{ {
length >>= 16; length >>= 16;
@ -5692,51 +5704,60 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
{ {
// Max. positive vertical G's // Max. positive vertical G's
maxPositiveVerticalGs = ride->max_positive_vertical_g; stringId = ride->max_positive_vertical_g >= RIDE_G_FORCES_RED_POS_VERTICAL ? STR_MAX_POSITIVE_VERTICAL_G_RED
stringId = maxPositiveVerticalGs >= RIDE_G_FORCES_RED_POS_VERTICAL ? STR_MAX_POSITIVE_VERTICAL_G_RED : STR_MAX_POSITIVE_VERTICAL_G;
: STR_MAX_POSITIVE_VERTICAL_G; ft = Formatter();
DrawTextBasic(dpi, screenCoords, stringId, &maxPositiveVerticalGs); ft.Add<fixed16_2dp>(ride->max_positive_vertical_g);
DrawTextBasic(dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Max. negative vertical G's // Max. negative vertical G's
maxNegativeVerticalGs = ride->max_negative_vertical_g; stringId = ride->max_negative_vertical_g <= RIDE_G_FORCES_RED_NEG_VERTICAL ? STR_MAX_NEGATIVE_VERTICAL_G_RED
stringId = maxNegativeVerticalGs <= RIDE_G_FORCES_RED_NEG_VERTICAL ? STR_MAX_NEGATIVE_VERTICAL_G_RED : STR_MAX_NEGATIVE_VERTICAL_G;
: STR_MAX_NEGATIVE_VERTICAL_G; ft = Formatter();
DrawTextBasic(dpi, screenCoords, stringId, &maxNegativeVerticalGs); ft.Add<fixed16_2dp>(ride->max_negative_vertical_g);
DrawTextBasic(dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Max lateral G's // Max lateral G's
maxLateralGs = ride->max_lateral_g; stringId = ride->max_lateral_g >= RIDE_G_FORCES_RED_LATERAL ? STR_MAX_LATERAL_G_RED : STR_MAX_LATERAL_G;
stringId = maxLateralGs >= RIDE_G_FORCES_RED_LATERAL ? STR_MAX_LATERAL_G_RED : STR_MAX_LATERAL_G; ft = Formatter();
DrawTextBasic(dpi, screenCoords, stringId, &maxLateralGs); ft.Add<fixed16_2dp>(ride->max_lateral_g);
DrawTextBasic(dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Total 'air' time // Total 'air' time
totalAirTime = ride->total_air_time * 3; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_TOTAL_AIR_TIME, &totalAirTime); ft.Add<fixed32_2dp>(ride->total_air_time * 3);
DrawTextBasic(dpi, screenCoords, STR_TOTAL_AIR_TIME, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_DROPS))
{ {
// Drops // Drops
drops = ride->drops & 0x3F; auto drops = ride->drops & 0x3F;
DrawTextBasic(dpi, screenCoords, STR_DROPS, &drops); ft = Formatter();
ft.Add<uint16_t>(drops);
DrawTextBasic(dpi, screenCoords, STR_DROPS, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Highest drop height // Highest drop height
highestDropHeight = (ride->highest_drop_height * 3) / 4; auto highestDropHeight = (ride->highest_drop_height * 3) / 4;
DrawTextBasic(dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, &highestDropHeight); ft = Formatter();
ft.Add<int32_t>(highestDropHeight);
DrawTextBasic(dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
if (ride->type != RIDE_TYPE_MINI_GOLF) if (ride->type != RIDE_TYPE_MINI_GOLF)
{ {
// Inversions // Inversions
inversions = ride->inversions; if (ride->inversions != 0)
if (inversions != 0)
{ {
DrawTextBasic(dpi, screenCoords, STR_INVERSIONS, &inversions); ft = Formatter();
ft.Add<uint16_t>(ride->inversions);
DrawTextBasic(dpi, screenCoords, STR_INVERSIONS, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
} }
@ -6077,15 +6098,20 @@ static void window_ride_graphs_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi
if (listType == GRAPH_ALTITUDE) if (listType == GRAPH_ALTITUDE)
scaled_yUnit /= 2; scaled_yUnit /= 2;
DrawTextBasic(dpi, { w->scrolls[0].h_left + 1, y - 4 }, stringID, &scaled_yUnit, { FontSpriteBase::SMALL }); auto ft = Formatter();
ft.Add<int16_t>(scaled_yUnit);
DrawTextBasic(dpi, { w->scrolls[0].h_left + 1, y - 4 }, stringID, ft, { FontSpriteBase::SMALL });
} }
// Time marks // Time marks
time = 0; time = 0;
for (int32_t x = 0; x < dpi->x + dpi->width; x += 80) for (int32_t x = 0; x < dpi->x + dpi->width; x += 80)
{ {
auto ft = Formatter();
ft.Add<int32_t>(time);
if (x + 80 >= dpi->x) if (x + 80 >= dpi->x)
DrawTextBasic(dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, &time, { FontSpriteBase::SMALL }); DrawTextBasic(dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontSpriteBase::SMALL });
time += 5; time += 5;
} }
@ -6608,7 +6634,7 @@ static void window_ride_income_invalidate(rct_window* w)
static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi) static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
rct_string_id stringId; rct_string_id stringId;
money64 profit, costPerHour; money64 profit;
ShopItem primaryItem, secondaryItem; ShopItem primaryItem, secondaryItem;
WindowDrawWidgets(w, dpi); WindowDrawWidgets(w, dpi);
@ -6640,7 +6666,10 @@ static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi)
stringId = STR_LOSS_PER_ITEM_SOLD; stringId = STR_LOSS_PER_ITEM_SOLD;
} }
DrawTextBasic(dpi, screenCoords, stringId, &profit); auto ft = Formatter();
ft.Add<money64>(profit);
DrawTextBasic(dpi, screenCoords, stringId, ft);
} }
screenCoords.y += 44; screenCoords.y += 44;
@ -6661,33 +6690,45 @@ static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi)
stringId = STR_LOSS_PER_ITEM_SOLD; stringId = STR_LOSS_PER_ITEM_SOLD;
} }
DrawTextBasic(dpi, screenCoords, stringId, &profit); auto ft = Formatter();
ft.Add<money64>(profit);
DrawTextBasic(dpi, screenCoords, stringId, ft);
} }
screenCoords.y += 18; screenCoords.y += 18;
// Income per hour // Income per hour
if (ride->income_per_hour != MONEY64_UNDEFINED) if (ride->income_per_hour != MONEY64_UNDEFINED)
{ {
DrawTextBasic(dpi, screenCoords, STR_INCOME_PER_HOUR, &ride->income_per_hour); auto ft = Formatter();
ft.Add<money64>(ride->income_per_hour);
DrawTextBasic(dpi, screenCoords, STR_INCOME_PER_HOUR, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
// Running cost per hour // Running cost per hour
costPerHour = ride->upkeep_cost * 16; money64 costPerHour = ride->upkeep_cost * 16;
stringId = ride->upkeep_cost == MONEY16_UNDEFINED ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR; stringId = ride->upkeep_cost == MONEY16_UNDEFINED ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR;
DrawTextBasic(dpi, screenCoords, stringId, &costPerHour); auto ft = Formatter();
ft.Add<money64>(costPerHour);
DrawTextBasic(dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Profit per hour // Profit per hour
if (ride->profit != MONEY64_UNDEFINED) if (ride->profit != MONEY64_UNDEFINED)
{ {
DrawTextBasic(dpi, screenCoords, STR_PROFIT_PER_HOUR, &ride->profit); ft = Formatter();
ft.Add<money64>(ride->profit);
DrawTextBasic(dpi, screenCoords, STR_PROFIT_PER_HOUR, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
screenCoords.y += 5; screenCoords.y += 5;
// Total profit // Total profit
DrawTextBasic(dpi, screenCoords, STR_TOTAL_PROFIT, &ride->total_profit); ft = Formatter();
ft.Add<money64>(ride->total_profit);
DrawTextBasic(dpi, screenCoords, STR_TOTAL_PROFIT, ft);
} }
#pragma endregion #pragma endregion
@ -6821,7 +6862,6 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
ShopItem shopItem; ShopItem shopItem;
int16_t popularity, satisfaction, queueTime; int16_t popularity, satisfaction, queueTime;
int32_t customersPerHour;
rct_string_id stringId; rct_string_id stringId;
WindowDrawWidgets(w, dpi); WindowDrawWidgets(w, dpi);
@ -6838,14 +6878,16 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Customers currently on ride // Customers currently on ride
if (ride->IsRide()) if (ride->IsRide())
{ {
int16_t customersOnRide = ride->num_riders; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, &customersOnRide); ft.Add<int16_t>(ride->num_riders);
DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
// Customers per hour // Customers per hour
customersPerHour = ride_customers_per_hour(ride); auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, &customersPerHour); ft.Add<int32_t>(ride_customers_per_hour(ride));
DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Popularity // Popularity
@ -6859,7 +6901,9 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi)
stringId = STR_POPULARITY_PERCENT; stringId = STR_POPULARITY_PERCENT;
popularity *= 4; popularity *= 4;
} }
DrawTextBasic(dpi, screenCoords, stringId, &popularity); ft = Formatter();
ft.Add<int16_t>(popularity);
DrawTextBasic(dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Satisfaction // Satisfaction
@ -6873,7 +6917,9 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi)
stringId = STR_SATISFACTION_PERCENT; stringId = STR_SATISFACTION_PERCENT;
satisfaction *= 5; satisfaction *= 5;
} }
DrawTextBasic(dpi, screenCoords, stringId, &satisfaction); ft = Formatter();
ft.Add<int16_t>(satisfaction);
DrawTextBasic(dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Queue time // Queue time
@ -6889,7 +6935,7 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi)
shopItem = ride->GetRideEntry()->shop_item[0]; shopItem = ride->GetRideEntry()->shop_item[0];
if (shopItem != ShopItem::None) if (shopItem != ShopItem::None)
{ {
auto ft = Formatter(); ft = Formatter();
ft.Add<rct_string_id>(GetShopItemDescriptor(shopItem).Naming.Plural); ft.Add<rct_string_id>(GetShopItemDescriptor(shopItem).Naming.Plural);
ft.Add<uint32_t>(ride->no_primary_items_sold); ft.Add<uint32_t>(ride->no_primary_items_sold);
DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft);
@ -6901,7 +6947,7 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi)
: ride->GetRideEntry()->shop_item[1]; : ride->GetRideEntry()->shop_item[1];
if (shopItem != ShopItem::None) if (shopItem != ShopItem::None)
{ {
auto ft = Formatter(); ft = Formatter();
ft.Add<rct_string_id>(GetShopItemDescriptor(shopItem).Naming.Plural); ft.Add<rct_string_id>(GetShopItemDescriptor(shopItem).Naming.Plural);
ft.Add<uint32_t>(ride->no_secondary_items_sold); ft.Add<uint32_t>(ride->no_secondary_items_sold);
DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft);
@ -6909,14 +6955,18 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi)
} }
// Total customers // Total customers
DrawTextBasic(dpi, screenCoords, STR_TOTAL_CUSTOMERS, &ride->total_customers); ft = Formatter();
ft.Add<uint32_t>(ride->total_customers);
DrawTextBasic(dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
// Guests favourite // Guests favourite
if (ride->IsRide()) if (ride->IsRide())
{ {
ft = Formatter();
ft.Add<uint16_t>(ride->guests_favourite);
stringId = ride->guests_favourite == 1 ? STR_FAVOURITE_RIDE_OF_GUEST : STR_FAVOURITE_RIDE_OF_GUESTS; stringId = ride->guests_favourite == 1 ? STR_FAVOURITE_RIDE_OF_GUEST : STR_FAVOURITE_RIDE_OF_GUESTS;
DrawTextBasic(dpi, screenCoords, stringId, &ride->guests_favourite); DrawTextBasic(dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT; screenCoords.y += LIST_ROW_HEIGHT;
} }
screenCoords.y += 2; screenCoords.y += 2;
@ -6925,7 +6975,9 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi)
// If the ride has a build date that is in the future, show it as built this year. // If the ride has a build date that is in the future, show it as built this year.
int16_t age = std::max(date_get_year(ride->GetAge()), 0); int16_t age = std::max(date_get_year(ride->GetAge()), 0);
stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ? STR_BUILT_LAST_YEAR : STR_BUILT_YEARS_AGO; stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ? STR_BUILT_LAST_YEAR : STR_BUILT_YEARS_AGO;
DrawTextBasic(dpi, screenCoords, stringId, &age); ft = Formatter();
ft.Add<int16_t>(age);
DrawTextBasic(dpi, screenCoords, stringId, ft);
} }
#pragma endregion #pragma endregion

View File

@ -2324,13 +2324,14 @@ static void window_ride_construction_paint(rct_window* w, rct_drawpixelinfo* dpi
// Draw cost // Draw cost
screenCoords = { w->windowPos.x + widget->midX(), w->windowPos.y + widget->bottom - 23 }; screenCoords = { w->windowPos.x + widget->midX(), w->windowPos.y + widget->bottom - 23 };
if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_PLACE) if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_PLACE)
DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, w, { TextAlignment::CENTRE }); DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE });
screenCoords.y += 11; screenCoords.y += 11;
if (_currentTrackPrice != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY)) if (_currentTrackPrice != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY))
{ {
money64 value = _currentTrackPrice; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, &value, { TextAlignment::CENTRE }); ft.Add<money64>(_currentTrackPrice);
DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
} }
} }

View File

@ -560,9 +560,11 @@ static void window_ride_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
window_ride_list_draw_tab_images(dpi, w); window_ride_list_draw_tab_images(dpi, w);
// Draw number of attractions on bottom // Draw number of attractions on bottom
auto ft = Formatter();
ft.Add<uint16_t>(w->no_list_items);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[w->page], dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[w->page],
&w->no_list_items); ft);
} }
/** /**

View File

@ -493,9 +493,9 @@ static void window_scenarioselect_paint(rct_window* w, rct_drawpixelinfo* dpi)
shorten_path(path, sizeof(path), scenario->path, w->width - 6, FontSpriteBase::MEDIUM); shorten_path(path, sizeof(path), scenario->path, w->width - 6, FontSpriteBase::MEDIUM);
const utf8* pathPtr = path; const utf8* pathPtr = path;
DrawTextBasic( auto ft = Formatter();
dpi, w->windowPos + ScreenCoordsXY{ 3, w->height - 3 - 11 }, STR_STRING, static_cast<void*>(&pathPtr), ft.Add<const char*>(pathPtr);
{ w->colours[1] }); DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 3, w->height - 3 - 11 }, STR_STRING, ft, { w->colours[1] });
} }
// Scenario name // Scenario name

View File

@ -216,8 +216,8 @@ static void window_scenery_scatter_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
auto preview = window_scenery_scatter_widgets[WIDX_PREVIEW]; auto preview = window_scenery_scatter_widgets[WIDX_PREVIEW];
auto screenCoords = ScreenCoordsXY{ w->windowPos.x + preview.midX(), w->windowPos.y + preview.midY() }; auto screenCoords = ScreenCoordsXY{ w->windowPos.x + preview.midX(), w->windowPos.y + preview.midY() };
DrawTextBasic( auto ft = Formatter();
dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &gWindowSceneryScatterSize, ft.Add<uint16_t>(gWindowSceneryScatterSize);
{ TextAlignment::CENTRE }); DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
} }
} }

View File

@ -401,19 +401,19 @@ static void window_server_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
WindowDrawWidgets(w, dpi); WindowDrawWidgets(w, dpi);
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PLAYER_NAME_INPUT].top }, STR_PLAYER_NAME, nullptr, dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PLAYER_NAME_INPUT].top }, STR_PLAYER_NAME, {}, { COLOUR_WHITE });
{ COLOUR_WHITE });
// Draw version number // Draw version number
std::string version = network_get_version(); std::string version = network_get_version();
const char* versionCStr = version.c_str(); auto ft = Formatter();
ft.Add<const char*>(version.c_str());
DrawTextBasic( DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 324, w->widgets[WIDX_START_SERVER].top + 1 }, STR_NETWORK_VERSION, dpi, w->windowPos + ScreenCoordsXY{ 324, w->widgets[WIDX_START_SERVER].top + 1 }, STR_NETWORK_VERSION, ft,
static_cast<void*>(&versionCStr), { COLOUR_WHITE });
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 8, w->height - 15 }, _statusText, static_cast<void*>(&_numPlayersOnline),
{ COLOUR_WHITE }); { COLOUR_WHITE });
ft = Formatter();
ft.Add<uint32_t>(_numPlayersOnline);
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 8, w->height - 15 }, _statusText, ft, { COLOUR_WHITE });
} }
static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)

View File

@ -1805,7 +1805,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
terrainNameId = surfaceStyle->NameStringId; terrainNameId = surfaceStyle->NameStringId;
} }
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, &terrainNameId, { COLOUR_WHITE }); auto ft = Formatter();
ft.Add<rct_string_id>(terrainNameId);
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { COLOUR_WHITE });
// Edge texture name // Edge texture name
rct_string_id terrainEdgeNameId = STR_EMPTY; rct_string_id terrainEdgeNameId = STR_EMPTY;
@ -1814,9 +1816,10 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
terrainEdgeNameId = edgeStyle->NameStringId; terrainEdgeNameId = edgeStyle->NameStringId;
} }
ft = Formatter();
ft.Add<rct_string_id>(terrainEdgeNameId);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, &terrainEdgeNameId, dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, ft, { COLOUR_WHITE });
{ COLOUR_WHITE });
// Land ownership // Land ownership
rct_string_id landOwnership; rct_string_id landOwnership;
@ -1830,15 +1833,16 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
landOwnership = STR_CONSTRUCTION_RIGHTS_SALE; landOwnership = STR_CONSTRUCTION_RIGHTS_SALE;
else else
landOwnership = STR_TILE_INSPECTOR_LAND_NOT_OWNED_AND_NOT_AVAILABLE; landOwnership = STR_TILE_INSPECTOR_LAND_NOT_OWNED_AND_NOT_AVAILABLE;
ft = Formatter();
ft.Add<rct_string_id>(landOwnership);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, &landOwnership, dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, ft, { COLOUR_WHITE });
{ COLOUR_WHITE });
// Water level // Water level
uint32_t waterLevel = tileElement->AsSurface()->GetWaterHeight(); ft = Formatter();
ft.Add<uint32_t>(tileElement->AsSurface()->GetWaterHeight());
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, &waterLevel, dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, ft, { COLOUR_WHITE });
{ COLOUR_WHITE });
// Properties // Properties
// Raise / lower label // Raise / lower label
@ -1848,8 +1852,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Current base height // Current base height
screenCoords.x = w->windowPos.x + w->widgets[WIDX_SURFACE_SPINNER_HEIGHT].left + 3; screenCoords.x = w->windowPos.x + w->widgets[WIDX_SURFACE_SPINNER_HEIGHT].left + 3;
int32_t baseHeight = tileElement->base_height; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); ft.Add<int32_t>(tileElement->base_height);
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE });
// Raised corners // Raised corners
screenCoords = w->windowPos screenCoords = w->windowPos
@ -1862,8 +1867,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
// Details // Details
// Path name // Path name
rct_string_id pathNameId = tileElement->AsPath()->GetSurfaceEntry()->string_idx; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, &pathNameId, { COLOUR_WHITE }); ft.Add<rct_string_id>(tileElement->AsPath()->GetSurfaceEntry()->string_idx);
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE });
// Path addition // Path addition
if (tileElement->AsPath()->HasAddition()) if (tileElement->AsPath()->HasAddition())
@ -1873,9 +1879,10 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
rct_string_id additionNameId = pathBitEntry != nullptr rct_string_id additionNameId = pathBitEntry != nullptr
? pathBitEntry->name ? pathBitEntry->name
: static_cast<rct_string_id>(STR_UNKNOWN_OBJECT_TYPE); : static_cast<rct_string_id>(STR_UNKNOWN_OBJECT_TYPE);
ft = Formatter();
ft.Add<rct_string_id>(additionNameId);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, &additionNameId, dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, ft, { COLOUR_WHITE });
{ COLOUR_WHITE });
} }
else else
DrawTextBasic( DrawTextBasic(
@ -1890,8 +1897,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Current base height // Current base height
screenCoords.x = w->windowPos.x + w->widgets[WIDX_PATH_SPINNER_HEIGHT].left + 3; screenCoords.x = w->windowPos.x + w->widgets[WIDX_PATH_SPINNER_HEIGHT].left + 3;
int32_t baseHeight = tileElement->base_height; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); ft.Add<int32_t>(tileElement->base_height);
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE });
// Path connections // Path connections
screenCoords = w->windowPos screenCoords = w->windowPos
@ -1909,31 +1917,35 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
auto ride = get_ride(rideId); auto ride = get_ride(rideId);
if (ride != nullptr) if (ride != nullptr)
{ {
auto rideName = ride->GetRideTypeDescriptor().Naming.Name; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, &rideName, { COLOUR_WHITE }); ft.Add<rct_string_id>(ride->GetRideTypeDescriptor().Naming.Name);
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, { COLOUR_WHITE });
} }
auto ft = Formatter();
ft.Add<int16_t>(trackElement->GetRideIndex());
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_ID, &rideId, { COLOUR_WHITE }); dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { COLOUR_WHITE });
if (ride != nullptr) if (ride != nullptr)
{ {
auto ft = Formatter(); ft = Formatter();
ride->FormatNameTo(ft); ride->FormatNameTo(ft);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft, { COLOUR_WHITE }); dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft, { COLOUR_WHITE });
} }
// Track // Track
auto trackType = trackElement->GetTrackType(); ft = Formatter();
int16_t sequenceNumber = trackElement->GetSequenceIndex(); ft.Add<track_type_t>(trackElement->GetTrackType());
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_TRACK_PIECE_ID, &trackType, dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_TRACK_PIECE_ID, ft, { COLOUR_WHITE });
{ COLOUR_WHITE });
ft = Formatter();
ft.Add<track_type_t>(trackElement->GetSequenceIndex());
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 44 }, STR_TILE_INSPECTOR_TRACK_SEQUENCE, &sequenceNumber, dpi, screenCoords + ScreenCoordsXY{ 0, 44 }, STR_TILE_INSPECTOR_TRACK_SEQUENCE, ft, { COLOUR_WHITE });
{ COLOUR_WHITE });
if (trackElement->IsStation()) if (trackElement->IsStation())
{ {
int16_t stationIndex = trackElement->GetStationIndex(); int16_t stationIndex = trackElement->GetStationIndex();
auto ft = Formatter(); ft = Formatter();
ft.Add<rct_string_id>(STR_COMMA16); ft.Add<rct_string_id>(STR_COMMA16);
ft.Add<int16_t>(stationIndex); ft.Add<int16_t>(stationIndex);
DrawTextBasic( DrawTextBasic(
@ -1942,17 +1954,17 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
else else
{ {
const char* stationNone = "-"; const char* stationNone = "-";
auto ft = Formatter(); ft = Formatter();
ft.Add<rct_string_id>(STR_STRING); ft.Add<rct_string_id>(STR_STRING);
ft.Add<char*>(stationNone); ft.Add<char*>(stationNone);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { COLOUR_WHITE }); dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { COLOUR_WHITE });
} }
rct_string_id colourScheme = ColourSchemeNames[trackElement->GetColourScheme()]; ft = Formatter();
ft.Add<rct_string_id>(ColourSchemeNames[trackElement->GetColourScheme()]);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, &colourScheme, dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, ft, { COLOUR_WHITE });
{ COLOUR_WHITE });
// Properties // Properties
// Raise / lower label // Raise / lower label
@ -1961,8 +1973,8 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Current base height // Current base height
screenCoords.x = w->windowPos.x + w->widgets[WIDX_TRACK_SPINNER_HEIGHT].left + 3; screenCoords.x = w->windowPos.x + w->widgets[WIDX_TRACK_SPINNER_HEIGHT].left + 3;
int32_t baseHeight = tileElement->base_height; ft.Add<int32_t>(tileElement->base_height);
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE });
break; break;
} }
@ -1970,8 +1982,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
// Details // Details
// Age // Age
int16_t age = tileElement->AsSmallScenery()->GetAge(); auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_AGE, &age, { COLOUR_WHITE }); ft.Add<int16_t>(tileElement->AsSmallScenery()->GetAge());
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_AGE, ft, { COLOUR_WHITE });
// Quadrant value // Quadrant value
const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry();
@ -1982,15 +1995,17 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
STR_TILE_INSPECTOR_SCENERY_QUADRANT_NW, STR_TILE_INSPECTOR_SCENERY_QUADRANT_NW,
STR_TILE_INSPECTOR_SCENERY_QUADRANT_NE, STR_TILE_INSPECTOR_SCENERY_QUADRANT_NE,
STR_TILE_INSPECTOR_SCENERY_QUADRANT_SE }; STR_TILE_INSPECTOR_SCENERY_QUADRANT_SE };
ft = Formatter();
ft.Add<rct_string_id>(quadrant_string_idx[quadrant]);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, ft, { COLOUR_WHITE });
&quadrant_string_idx[quadrant], { COLOUR_WHITE });
} }
// Scenery ID // Scenery ID
int16_t idx = tileElement->AsSmallScenery()->GetEntryIndex(); ft = Formatter();
ft.Add<ObjectEntryIndex>(tileElement->AsSmallScenery()->GetEntryIndex());
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, &idx, { COLOUR_WHITE }); dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, ft, { COLOUR_WHITE });
// Properties // Properties
// Raise / Lower // Raise / Lower
@ -1999,8 +2014,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Current base height // Current base height
screenCoords.x = w->windowPos.x + w->widgets[WIDX_SCENERY_SPINNER_HEIGHT].left + 3; screenCoords.x = w->windowPos.x + w->widgets[WIDX_SCENERY_SPINNER_HEIGHT].left + 3;
int32_t baseHeight = tileElement->base_height; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); ft.Add<int32_t>(tileElement->base_height);
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE });
// Quarter tile // Quarter tile
screenCoords = w->windowPos screenCoords = w->windowPos
@ -2018,55 +2034,57 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
// Details // Details
// Entrance type // Entrance type
rct_string_id entranceType = EntranceTypeStringIds[tileElement->AsEntrance()->GetEntranceType()]; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, &entranceType, { COLOUR_WHITE }); ft.Add<rct_string_id>(EntranceTypeStringIds[tileElement->AsEntrance()->GetEntranceType()]);
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, ft, { COLOUR_WHITE });
if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE)
{ {
// TODO: Make this work with Left/Right park entrance parts // TODO: Make this work with Left/Right park entrance parts
int16_t parkEntranceIndex = park_entrance_get_index( ft = Formatter();
{ windowTileInspectorToolMap, tileElement->GetBaseZ() }); ft.Add<rct_string_id>(park_entrance_get_index({ windowTileInspectorToolMap, tileElement->GetBaseZ() }));
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft,
&parkEntranceIndex, { COLOUR_WHITE }); { COLOUR_WHITE });
} }
else else
{ {
int16_t rideEntranceIndex = tileElement->AsEntrance()->GetStationIndex(); ft = Formatter();
ft.Add<int16_t>(tileElement->AsEntrance()->GetStationIndex());
if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE)
{ {
// Ride entrance ID // Ride entrance ID
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft,
&rideEntranceIndex, { COLOUR_WHITE }); { COLOUR_WHITE });
} }
else else
{ {
// Ride exit ID // Ride exit ID
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, ft,
&rideEntranceIndex, { COLOUR_WHITE }); { COLOUR_WHITE });
} }
} }
if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE)
{ {
// Entrance part // Entrance part
rct_string_id entrancePart = ParkEntrancePartStringIds[tileElement->AsEntrance()->GetSequenceIndex()]; ft = Formatter();
ft.Add<rct_string_id>(ParkEntrancePartStringIds[tileElement->AsEntrance()->GetSequenceIndex()]);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, &entrancePart, dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, ft, { COLOUR_WHITE });
{ COLOUR_WHITE });
} }
else else
{ {
// Ride ID // Ride ID
int16_t rideId = tileElement->AsEntrance()->GetRideIndex(); ft = Formatter();
ft.Add<ride_id_t>(tileElement->AsEntrance()->GetRideIndex());
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, &rideId, dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft, { COLOUR_WHITE });
{ COLOUR_WHITE });
// Station index // Station index
int16_t stationIndex = tileElement->AsEntrance()->GetStationIndex(); int16_t stationIndex = tileElement->AsEntrance()->GetStationIndex();
auto ft = Formatter(); ft = Formatter();
ft.Add<rct_string_id>(STR_COMMA16); ft.Add<rct_string_id>(STR_COMMA16);
ft.Add<int16_t>(stationIndex); ft.Add<int16_t>(stationIndex);
DrawTextBasic( DrawTextBasic(
@ -2080,7 +2098,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Current base height // Current base height
screenCoords.x = w->windowPos.x + w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].left + 3; screenCoords.x = w->windowPos.x + w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].left + 3;
auto ft = Formatter(); ft = Formatter();
ft.Add<int32_t>(tileElement->base_height); ft.Add<int32_t>(tileElement->base_height);
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE });
break; break;
@ -2090,14 +2108,15 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
// Details // Details
// Type // Type
int16_t wallType = tileElement->AsWall()->GetEntryIndex(); auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_TYPE, &wallType, { COLOUR_WHITE }); ft.Add<ObjectEntryIndex>(tileElement->AsWall()->GetEntryIndex());
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_TYPE, ft, { COLOUR_WHITE });
// Banner info // Banner info
auto banner = tileElement->AsWall()->GetBanner(); auto banner = tileElement->AsWall()->GetBanner();
if (banner != nullptr) if (banner != nullptr)
{ {
Formatter ft; ft = Formatter();
banner->FormatTextTo(ft); banner->FormatTextTo(ft);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft,
@ -2117,8 +2136,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Current base height // Current base height
screenCoords.x = w->windowPos.x + w->widgets[WIDX_WALL_SPINNER_HEIGHT].left + 3; screenCoords.x = w->windowPos.x + w->widgets[WIDX_WALL_SPINNER_HEIGHT].left + 3;
int32_t baseHeight = tileElement->base_height; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); ft.Add<int32_t>(tileElement->base_height);
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE });
// Slope label // Slope label
screenCoords = w->windowPos screenCoords = w->windowPos
@ -2136,8 +2156,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
colour = w->colours[0] | COLOUR_FLAG_INSET; colour = w->colours[0] | COLOUR_FLAG_INSET;
} }
screenCoords.x = w->windowPos.x + w->widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].left + 3; screenCoords.x = w->windowPos.x + w->widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].left + 3;
int32_t animationFrame = tileElement->AsWall()->GetAnimationFrame(); ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &animationFrame, { colour }); ft.Add<int32_t>(tileElement->AsWall()->GetAnimationFrame());
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colour });
break; break;
} }
@ -2146,13 +2167,16 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Details // Details
// Type // Type
auto sceneryElement = tileElement->AsLargeScenery(); auto sceneryElement = tileElement->AsLargeScenery();
int16_t largeSceneryType = sceneryElement->GetEntryIndex(); ObjectEntryIndex largeSceneryType = sceneryElement->GetEntryIndex();
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, &largeSceneryType, { COLOUR_WHITE }); auto ft = Formatter();
ft.Add<ObjectEntryIndex>(largeSceneryType);
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, ft, { COLOUR_WHITE });
// Part ID // Part ID
int16_t pieceID = sceneryElement->GetSequenceIndex(); ft = Formatter();
ft.Add<int16_t>(sceneryElement->GetSequenceIndex());
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, &pieceID, dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, ft,
{ COLOUR_WHITE }); { COLOUR_WHITE });
// Banner info // Banner info
@ -2162,7 +2186,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
auto banner = sceneryElement->GetBanner(); auto banner = sceneryElement->GetBanner();
if (banner != nullptr) if (banner != nullptr)
{ {
Formatter ft; ft = Formatter();
banner->FormatTextTo(ft); banner->FormatTextTo(ft);
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft,
@ -2183,8 +2207,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Current base height // Current base height
screenCoords.x = w->windowPos.x + w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].left + 3; screenCoords.x = w->windowPos.x + w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].left + 3;
int32_t baseHeight = tileElement->base_height; ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); ft.Add<int32_t>(tileElement->base_height);
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE });
break; break;
} }
@ -2207,8 +2232,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Current base height // Current base height
screenCoords.x = w->windowPos.x + w->widgets[WIDX_BANNER_SPINNER_HEIGHT].left + 3; screenCoords.x = w->windowPos.x + w->widgets[WIDX_BANNER_SPINNER_HEIGHT].left + 3;
int32_t baseHeight = tileElement->base_height; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); ft.Add<int32_t>(tileElement->base_height);
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE });
// Blocked paths // Blocked paths
screenCoords.y += 28; screenCoords.y += 28;
@ -2226,8 +2252,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Current base height // Current base height
screenCoords.x = w->windowPos.x + w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT].left + 3; screenCoords.x = w->windowPos.x + w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT].left + 3;
int32_t baseHeight = tileElement->base_height; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); ft.Add<int32_t>(tileElement->base_height);
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE });
break; break;
} }
@ -2329,7 +2356,6 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo*
typeName = buffer; typeName = buffer;
} }
const int32_t baseHeight = tileElement->base_height;
const int32_t clearanceHeight = tileElement->clearance_height; const int32_t clearanceHeight = tileElement->clearance_height;
const bool ghost = tileElement->IsGhost(); const bool ghost = tileElement->IsGhost();
const bool last = tileElement->IsLastForTile(); const bool last = tileElement->IsLastForTile();
@ -2346,7 +2372,7 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo*
// Base height // Base height
ft = Formatter(); ft = Formatter();
ft.Add<rct_string_id>(STR_FORMAT_INTEGER); ft.Add<rct_string_id>(STR_FORMAT_INTEGER);
ft.Add<int32_t>(baseHeight); ft.Add<int32_t>(tileElement->base_height);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ COL_X_BH, 0 }, stringFormat, ft); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ COL_X_BH, 0 }, stringFormat, ft);
// Clearance height // Clearance height

View File

@ -497,8 +497,9 @@ static void window_track_place_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Price // Price
if (_window_track_place_last_cost != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY)) if (_window_track_place_last_cost != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY))
{ {
money64 value = _window_track_place_last_cost; ft = Formatter();
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, &value, { TextAlignment::CENTRE }); ft.Add<money64>(_window_track_place_last_cost);
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
} }
} }

View File

@ -591,16 +591,19 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->bottom + 2 }; screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->bottom + 2 };
// Stats // Stats
fixed32_2dp rating = _loadedTrackDesign->excitement * 10; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, &rating); ft.Add<fixed32_2dp>(_loadedTrackDesign->excitement * 10);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
rating = _loadedTrackDesign->intensity * 10; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, &rating); ft.Add<fixed32_2dp>(_loadedTrackDesign->intensity * 10);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
rating = _loadedTrackDesign->nausea * 10; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, &rating); ft.Add<fixed32_2dp>(_loadedTrackDesign->nausea * 10);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft);
screenPos.y += LIST_ROW_HEIGHT + 4; screenPos.y += LIST_ROW_HEIGHT + 4;
// Information for tracked rides. // Information for tracked rides.
@ -611,20 +614,23 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
if (_loadedTrackDesign->type == RIDE_TYPE_MINI_GOLF) if (_loadedTrackDesign->type == RIDE_TYPE_MINI_GOLF)
{ {
// Holes // Holes
uint16_t holes = _loadedTrackDesign->holes & 0x1F; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_HOLES, &holes); ft.Add<uint16_t>(_loadedTrackDesign->holes & 0x1F);
DrawTextBasic(dpi, screenPos, STR_HOLES, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
} }
else else
{ {
// Maximum speed // Maximum speed
uint16_t speed = ((_loadedTrackDesign->max_speed << 16) * 9) >> 18; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, &speed); ft.Add<uint16_t>(((_loadedTrackDesign->max_speed << 16) * 9) >> 18);
DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
// Average speed // Average speed
speed = ((_loadedTrackDesign->average_speed << 16) * 9) >> 18; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, &speed); ft.Add<uint16_t>(((_loadedTrackDesign->average_speed << 16) * 9) >> 18);
DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
} }
@ -639,25 +645,29 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
{ {
// Maximum positive vertical Gs // Maximum positive vertical Gs
int32_t gForces = _loadedTrackDesign->max_positive_vertical_g * 32; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, &gForces); ft.Add<int32_t>(_loadedTrackDesign->max_positive_vertical_g * 32);
DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
// Maximum negative vertical Gs // Maximum negative vertical Gs
gForces = _loadedTrackDesign->max_negative_vertical_g * 32; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, &gForces); ft.Add<int32_t>(_loadedTrackDesign->max_negative_vertical_g * 32);
DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
// Maximum lateral Gs // Maximum lateral Gs
gForces = _loadedTrackDesign->max_lateral_g * 32; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, &gForces); ft.Add<int32_t>(_loadedTrackDesign->max_lateral_g * 32);
DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
if (_loadedTrackDesign->total_air_time != 0) if (_loadedTrackDesign->total_air_time != 0)
{ {
// Total air time // Total air time
int32_t airTime = _loadedTrackDesign->total_air_time * 25; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, &airTime); ft.Add<int32_t>(_loadedTrackDesign->total_air_time * 25);
DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
} }
} }
@ -665,13 +675,15 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS))
{ {
// Drops // Drops
uint16_t drops = _loadedTrackDesign->drops & 0x3F; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_DROPS, &drops); ft.Add<uint16_t>(_loadedTrackDesign->drops & 0x3F);
DrawTextBasic(dpi, screenPos, STR_DROPS, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
// Drop height is multiplied by 0.75 // Drop height is multiplied by 0.75
uint16_t highestDropHeight = (_loadedTrackDesign->highest_drop_height * 3) / 4; ft = Formatter();
DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, &highestDropHeight); ft.Add<uint16_t>((_loadedTrackDesign->highest_drop_height * 3) / 4);
DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
} }
@ -680,8 +692,10 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
uint16_t inversions = _loadedTrackDesign->inversions & 0x1F; uint16_t inversions = _loadedTrackDesign->inversions & 0x1F;
if (inversions != 0) if (inversions != 0)
{ {
ft = Formatter();
ft.Add<uint16_t>(inversions);
// Inversions // Inversions
DrawTextBasic(dpi, screenPos, STR_INVERSIONS, &inversions); DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft);
screenPos.y += LIST_ROW_HEIGHT; screenPos.y += LIST_ROW_HEIGHT;
} }
} }
@ -743,8 +757,9 @@ static void window_track_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
stringId = STR_BLACK_STRING; stringId = STR_BLACK_STRING;
} }
rct_string_id stringId2 = STR_BUILD_CUSTOM_DESIGN; auto ft = Formatter();
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, &stringId2); ft.Add<rct_string_id>(STR_BUILD_CUSTOM_DESIGN);
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft);
screenCoords.y += SCROLLABLE_ROW_HEIGHT; screenCoords.y += SCROLLABLE_ROW_HEIGHT;
listIndex++; listIndex++;
} }

View File

@ -386,27 +386,25 @@ static void window_view_clipping_paint(rct_window* w, rct_drawpixelinfo* dpi)
screenCoords = w->windowPos screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_CLIP_HEIGHT_VALUE].left + 1, w->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; + ScreenCoordsXY{ w->widgets[WIDX_CLIP_HEIGHT_VALUE].left + 1, w->widgets[WIDX_CLIP_HEIGHT_VALUE].top };
fixed16_1dp clipHeightValueInUnits;
fixed32_2dp clipHeightValueInMeters;
fixed16_1dp clipHeightValueInFeet;
int32_t clipHeightRawValue = static_cast<int32_t>(gClipHeight);
switch (gClipHeightDisplayType) switch (gClipHeightDisplayType)
{ {
case DISPLAY_TYPE::DISPLAY_RAW: case DISPLAY_TYPE::DISPLAY_RAW:
default: default:
DrawTextBasic( {
dpi, screenCoords, STR_FORMAT_INTEGER, &clipHeightRawValue, { w->colours[0] }); // Printing the raw value. auto ft = Formatter();
ft.Add<int32_t>(static_cast<int32_t>(gClipHeight));
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { w->colours[0] }); // Printing the raw value.
break; break;
}
case DISPLAY_TYPE::DISPLAY_UNITS: case DISPLAY_TYPE::DISPLAY_UNITS:
// Print the value in the configured height label type: // Print the value in the configured height label type:
if (gConfigGeneral.show_height_as_units == 1) if (gConfigGeneral.show_height_as_units == 1)
{ {
// Height label is Units. // Height label is Units.
clipHeightValueInUnits = static_cast<fixed16_1dp>(FIXED_1DP(gClipHeight, 0) / 2 - FIXED_1DP(7, 0)); auto ft = Formatter();
ft.Add<fixed16_1dp>(static_cast<fixed16_1dp>(FIXED_1DP(gClipHeight, 0) / 2 - FIXED_1DP(7, 0)));
DrawTextBasic( DrawTextBasic(
dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, &clipHeightValueInUnits, dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, ft, { w->colours[0] }); // Printing the value in Height Units.
{ w->colours[0] }); // Printing the value in Height Units.
} }
else else
{ {
@ -416,16 +414,19 @@ static void window_view_clipping_paint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
case MeasurementFormat::Metric: case MeasurementFormat::Metric:
case MeasurementFormat::SI: case MeasurementFormat::SI:
clipHeightValueInMeters = static_cast<fixed32_2dp>( {
FIXED_2DP(gClipHeight, 0) / 2 * 1.5f - FIXED_2DP(10, 50)); auto ft = Formatter();
DrawTextBasic( ft.Add<fixed32_2dp>(static_cast<fixed32_2dp>(FIXED_2DP(gClipHeight, 0) / 2 * 1.5f - FIXED_2DP(10, 50)));
dpi, screenCoords, STR_UNIT2DP_SUFFIX_METRES, &clipHeightValueInMeters, { w->colours[0] }); DrawTextBasic(dpi, screenCoords, STR_UNIT2DP_SUFFIX_METRES, ft, { w->colours[0] });
break; break;
}
case MeasurementFormat::Imperial: case MeasurementFormat::Imperial:
clipHeightValueInFeet = static_cast<fixed16_1dp>( {
FIXED_1DP(gClipHeight, 0) / 2.0f * 5 - FIXED_1DP(35, 0)); auto ft = Formatter();
DrawTextBasic(dpi, screenCoords, STR_UNIT1DP_SUFFIX_FEET, &clipHeightValueInFeet, { w->colours[0] }); ft.Add<fixed16_1dp>(static_cast<fixed16_1dp>(FIXED_1DP(gClipHeight, 0) / 2.0f * 5 - FIXED_1DP(35, 0)));
DrawTextBasic(dpi, screenCoords, STR_UNIT1DP_SUFFIX_FEET, ft, { w->colours[0] });
break; break;
}
} }
} }
} }

View File

@ -146,9 +146,9 @@ public:
// Draw number for tool sizes bigger than 7 // Draw number for tool sizes bigger than 7
if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE) if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE)
{ {
DrawTextBasic( auto ft = Formatter();
&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &gLandToolSize, ft.Add<uint16_t>(gLandToolSize);
{ TextAlignment::CENTRE }); DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
} }
if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) if (!(gParkFlags & PARK_FLAGS_NO_MONEY))

View File

@ -112,16 +112,10 @@ static void DrawText(
DrawText(dpi, coords, paint, buffer); DrawText(dpi, coords, paint, buffer);
} }
void DrawTextBasic(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const void* args, TextPaint textPaint)
{
DrawText(dpi, coords, textPaint, format, args);
}
void DrawTextBasic( void DrawTextBasic(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const Formatter& ft, TextPaint textPaint) rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const Formatter& ft, TextPaint textPaint)
{ {
DrawTextBasic(dpi, coords, format, ft.Data(), textPaint); DrawText(dpi, coords, textPaint, format, ft.Data());
} }
void DrawTextEllipsised( void DrawTextEllipsised(

View File

@ -147,8 +147,6 @@ public:
void DrawTextBasic( void DrawTextBasic(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const Formatter& ft = {}, rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const Formatter& ft = {},
TextPaint textPaint = {}); TextPaint textPaint = {});
void DrawTextBasic(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const void* args, TextPaint textPaint = {});
void DrawTextEllipsised( void DrawTextEllipsised(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft, rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft,
TextPaint textPaint = {}); TextPaint textPaint = {});