Merge pull request #19480 from Gymnasiast/refactor/dpi-string

Pass DPI by ref to string drawing
This commit is contained in:
Matthias Moninger authored and GitHub committed 2023-02-28 22:27:51 +02:00
commit 59875eb409
75 files changed
+635 -636

No files matched your search

+3 -3
View File
@@ -29,7 +29,7 @@ namespace Graph
auto ft = Formatter();
ft.Add<uint32_t>(DateGameShortMonthNames[DateGetMonth((yearOver32 / 4) + MONTH_COUNT)]);
DrawTextBasic(
dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft,
*dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft,
{ FontStyle::Small, TextAlignment::CENTRE });
// Draw month mark
@@ -166,7 +166,7 @@ namespace Graph
auto ft = Formatter();
ft.Add<StringId>(DateGameShortMonthNames[DateGetMonth((yearOver32 / 4) + MONTH_COUNT)]);
DrawTextBasic(
dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft,
*dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft,
{ FontStyle::Small, TextAlignment::CENTRE });
// Draw month mark
@@ -264,7 +264,7 @@ namespace Graph
auto ft = Formatter();
ft.Add<money64>(info.money);
DrawTextBasic(
dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, ft, { TextAlignment::CENTRE });
*dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, ft, { TextAlignment::CENTRE });
GfxFillRect(dpi, { { info.coords - ScreenCoordsXY{ 2, 2 } }, info.coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
GfxFillRect(
+2 -2
View File
@@ -314,7 +314,7 @@ void InGameConsole::Draw(DrawPixelInfo* dpi) const
{
const size_t index = i + _consoleScrollPos;
lineBuffer = _colourFormatStr + _consoleLines[index];
GfxDrawString(dpi, screenCoords, lineBuffer.c_str(), { textColour, InGameConsoleGetFontStyle() });
GfxDrawString(*dpi, screenCoords, lineBuffer.c_str(), { textColour, InGameConsoleGetFontStyle() });
screenCoords.y += lineHeight;
}
@@ -322,7 +322,7 @@ void InGameConsole::Draw(DrawPixelInfo* dpi) const
// Draw current line
lineBuffer = _colourFormatStr + _consoleCurrentLine;
DrawText(dpi, screenCoords, { TEXT_COLOUR_255, InGameConsoleGetFontStyle() }, lineBuffer.c_str(), true);
DrawText(*dpi, screenCoords, { TEXT_COLOUR_255, InGameConsoleGetFontStyle() }, lineBuffer.c_str(), true);
// Draw caret
if (_consoleCaretTicks < CONSOLE_CARET_FLASH_THRESHOLD)
+15 -15
View File
@@ -368,11 +368,11 @@ static void WidgetTextCentred(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wid
ScreenCoordsXY coords = { (topLeft.x + r + 1) / 2 - 1, topLeft.y };
if (widget.type == WindowWidgetType::LabelCentred)
{
DrawTextWrapped(dpi, coords, widget.width() - 2, stringId, ft, { colour, TextAlignment::CENTRE });
DrawTextWrapped(*dpi, coords, widget.width() - 2, stringId, ft, { colour, TextAlignment::CENTRE });
}
else
{
DrawTextEllipsised(dpi, coords, widget.width() - 2, stringId, ft, { colour, TextAlignment::CENTRE });
DrawTextEllipsised(*dpi, coords, widget.width() - 2, stringId, ft, { colour, TextAlignment::CENTRE });
}
}
@@ -417,11 +417,11 @@ static void WidgetText(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex widgetInde
ScreenCoordsXY coords = { l + 1, t };
if (widget.type == WindowWidgetType::LabelCentred)
{
DrawTextWrapped(dpi, coords, r - l, stringId, ft, { colour, TextAlignment::CENTRE });
DrawTextWrapped(*dpi, coords, r - l, stringId, ft, { colour, TextAlignment::CENTRE });
}
else
{
DrawTextEllipsised(dpi, coords, r - l, stringId, ft, colour);
DrawTextEllipsised(*dpi, coords, r - l, stringId, ft, colour);
}
}
@@ -491,7 +491,7 @@ static void WidgetGroupboxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wi
OpenRCT2::FormatStringLegacy(buffer, sizeof(buffer), stringId, formatArgs);
auto ft = Formatter();
ft.Add<utf8*>(buffer);
DrawTextBasic(dpi, { l, t }, STR_STRING, ft, { colour });
DrawTextBasic(*dpi, { l, t }, STR_STRING, ft, { colour });
textRight = l + GfxGetStringWidth(buffer, FontStyle::Medium) + 1;
}
@@ -571,7 +571,7 @@ static void WidgetCaptionDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wid
}
topLeft.x += width / 2;
DrawTextEllipsised(
dpi, topLeft, width, widget->text, Formatter::Common(),
*dpi, topLeft, width, widget->text, Formatter::Common(),
{ COLOUR_WHITE | static_cast<uint8_t>(COLOUR_FLAG_OUTLINE), TextAlignment::CENTRE });
}
@@ -609,7 +609,7 @@ static void WidgetCloseboxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wi
if (WidgetIsDisabled(w, widgetIndex))
colour |= COLOUR_FLAG_INSET;
DrawTextEllipsised(dpi, topLeft, widget.width() - 2, widget.text, Formatter::Common(), { colour, TextAlignment::CENTRE });
DrawTextEllipsised(*dpi, topLeft, widget.width() - 2, widget.text, Formatter::Common(), { colour, TextAlignment::CENTRE });
}
/**
@@ -641,7 +641,7 @@ static void WidgetCheckboxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wi
if (WidgetIsPressed(w, widgetIndex))
{
GfxDrawString(
dpi, { midLeft - ScreenCoordsXY{ 0, 5 } }, static_cast<const char*>(CheckBoxMarkString),
*dpi, { midLeft - ScreenCoordsXY{ 0, 5 } }, static_cast<const char*>(CheckBoxMarkString),
{ static_cast<colour_t>(NOT_TRANSLUCENT(colour)) });
}
@@ -650,7 +650,7 @@ static void WidgetCheckboxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wi
return;
auto [stringId, formatArgs] = WidgetGetStringidAndArgs(widget);
GfxDrawStringLeftCentred(dpi, stringId, formatArgs, colour, { midLeft + ScreenCoordsXY{ 14, 0 } });
GfxDrawStringLeftCentred(*dpi, stringId, formatArgs, colour, { midLeft + ScreenCoordsXY{ 14, 0 } });
}
/**
@@ -742,7 +742,7 @@ static void WidgetHScrollbarDraw(
uint8_t flags = (scroll.flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
GfxFillRectInset(dpi, { { l, t }, { l + (SCROLLBAR_WIDTH - 1), b } }, colour, flags);
GfxDrawString(dpi, { l + 1, t }, static_cast<const char*>(BlackLeftArrowString), {});
GfxDrawString(*dpi, { l + 1, t }, static_cast<const char*>(BlackLeftArrowString), {});
}
// Thumb
@@ -759,7 +759,7 @@ static void WidgetHScrollbarDraw(
uint8_t flags = (scroll.flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
GfxFillRectInset(dpi, { { r - (SCROLLBAR_WIDTH - 1), t }, { r, b } }, colour, flags);
GfxDrawString(dpi, { r - 6, t }, static_cast<const char*>(BlackRightArrowString), {});
GfxDrawString(*dpi, { r - 6, t }, static_cast<const char*>(BlackRightArrowString), {});
}
}
@@ -779,7 +779,7 @@ static void WidgetVScrollbarDraw(
GfxFillRectInset(
dpi, { { l, t }, { r, t + (SCROLLBAR_WIDTH - 1) } }, colour,
((scroll.flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
GfxDrawString(dpi, { l + 1, t - 1 }, static_cast<const char*>(BlackUpArrowString), {});
GfxDrawString(*dpi, { l + 1, t - 1 }, static_cast<const char*>(BlackUpArrowString), {});
// Thumb
GfxFillRectInset(
@@ -792,7 +792,7 @@ static void WidgetVScrollbarDraw(
GfxFillRectInset(
dpi, { { l, b - (SCROLLBAR_WIDTH - 1) }, { r, b } }, colour,
((scroll.flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
GfxDrawString(dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast<const char*>(BlackDownArrowString), {});
GfxDrawString(*dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast<const char*>(BlackDownArrowString), {});
}
/**
@@ -1148,7 +1148,7 @@ static void WidgetTextBoxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wid
{
u8string wrappedString;
GfxWrapString(widget.string, bottomRight.x - topLeft.x - 5, FontStyle::Medium, &wrappedString, nullptr);
DrawText(dpi, { topLeft.x + 2, topLeft.y }, { w.colours[1] }, wrappedString.c_str(), true);
DrawText(*dpi, { topLeft.x + 2, topLeft.y }, { w.colours[1] }, wrappedString.c_str(), true);
}
return;
}
@@ -1158,7 +1158,7 @@ static void WidgetTextBoxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wid
u8string wrappedString;
GfxWrapString(gTextBoxInput, bottomRight.x - topLeft.x - 5 - 6, FontStyle::Medium, &wrappedString, nullptr);
DrawText(dpi, { topLeft.x + 2, topLeft.y }, { w.colours[1] }, wrappedString.c_str(), true);
DrawText(*dpi, { topLeft.x + 2, topLeft.y }, { w.colours[1] }, wrappedString.c_str(), true);
// Make a trimmed view of the string for measuring the width.
int32_t curX = topLeft.x
+4 -4
View File
@@ -683,13 +683,13 @@ void CustomListView::PaintHeading(
{
auto ft = Formatter();
ft.Add<StringId>(STR_UP);
DrawTextBasic(dpi, pos + ScreenCoordsXY{ size.width - 1, 0 }, STR_BLACK_STRING, ft, { TextAlignment::RIGHT });
DrawTextBasic(*dpi, pos + ScreenCoordsXY{ size.width - 1, 0 }, STR_BLACK_STRING, ft, { TextAlignment::RIGHT });
}
else if (sortOrder == ColumnSortOrder::Descending)
{
auto ft = Formatter();
ft.Add<StringId>(STR_DOWN);
DrawTextBasic(dpi, pos + ScreenCoordsXY{ size.width - 1, 0 }, STR_BLACK_STRING, ft, { TextAlignment::RIGHT });
DrawTextBasic(*dpi, pos + ScreenCoordsXY{ size.width - 1, 0 }, STR_BLACK_STRING, ft, { TextAlignment::RIGHT });
}
}
@@ -712,7 +712,7 @@ void CustomListView::PaintSeperator(
// Draw string
Formatter ft;
ft.Add<const char*>(text);
DrawTextBasic(dpi, { centreX, pos.y }, STR_STRING, ft, { baseColour, TextAlignment::CENTRE });
DrawTextBasic(*dpi, { centreX, pos.y }, STR_STRING, ft, { baseColour, TextAlignment::CENTRE });
// Get string dimensions
FormatStringLegacy(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_STRING, ft.Data());
@@ -760,7 +760,7 @@ void CustomListView::PaintCell(
auto ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(text);
DrawTextEllipsised(dpi, pos, size.width, stringId, ft, {});
DrawTextEllipsised(*dpi, pos, size.width, stringId, ft, {});
}
std::optional<RowColumn> CustomListView::GetItemIndexAt(const ScreenCoordsXY& pos)
@@ -235,7 +235,7 @@ namespace OpenRCT2::Scripting
void text(const std::string& text, int32_t x, int32_t y)
{
GfxDrawString(&_dpi, { x, y }, text.c_str(), { _colour.value_or(0) });
GfxDrawString(_dpi, { x, y }, text.c_str(), { _colour.value_or(0) });
}
};
} // namespace OpenRCT2::Scripting
+12 -12
View File
@@ -149,13 +149,13 @@ public:
auto ft = Formatter();
ft.Add<StringId>(STR_TITLE_SEQUENCE_OPENRCT2);
DrawTextWrapped(
&dpi, aboutOpenRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE });
dpi, aboutOpenRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE });
}
{
auto ft = Formatter();
ft.Add<StringId>(STR_TITLE_SEQUENCE_RCT2);
DrawTextWrapped(
&dpi, aboutRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE });
dpi, aboutRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE });
}
if (page == WINDOW_ABOUT_PAGE_OPENRCT2)
@@ -214,7 +214,7 @@ private:
auto centreX = versionPlaceholder.left + versionPlaceHolderWidth / 2;
auto centreY = (versionPlaceholder.top + versionPlaceholder.bottom - FontGetLineHeight(FontStyle::Medium)) / 2;
auto centrePos = windowPos + ScreenCoordsXY(centreX, centreY);
DrawTextWrapped(&dpi, centrePos, versionPlaceHolderWidth, STR_STRING, ft, { colours[1], TextAlignment::CENTRE });
DrawTextWrapped(dpi, centrePos, versionPlaceHolderWidth, STR_STRING, ft, { colours[1], TextAlignment::CENTRE });
// Shows the update available button
if (OpenRCT2::GetContext()->HasNewVersionInfo())
@@ -236,23 +236,23 @@ private:
int32_t lineHeight = FontGetLineHeight(FontStyle::Medium);
// Credits
DrawTextBasic(&dpi, screenCoords, STR_COPYRIGHT_CS, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_COPYRIGHT_CS, {}, { TextAlignment::CENTRE });
screenCoords.y += lineHeight + 74;
DrawTextBasic(&dpi, screenCoords, STR_DESIGNED_AND_PROGRAMMED_BY_CS, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_DESIGNED_AND_PROGRAMMED_BY_CS, {}, { TextAlignment::CENTRE });
screenCoords.y += lineHeight;
DrawTextBasic(&dpi, screenCoords, STR_GRAPHICS_BY_SF, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_GRAPHICS_BY_SF, {}, { TextAlignment::CENTRE });
screenCoords.y += lineHeight;
DrawTextBasic(&dpi, screenCoords, STR_SOUND_AND_MUSIC_BY_AB, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_SOUND_AND_MUSIC_BY_AB, {}, { TextAlignment::CENTRE });
screenCoords.y += lineHeight;
DrawTextBasic(&dpi, screenCoords, STR_ADDITIONAL_SOUNDS_RECORDED_BY_DE, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_ADDITIONAL_SOUNDS_RECORDED_BY_DE, {}, { TextAlignment::CENTRE });
screenCoords.y += lineHeight + 3;
DrawTextBasic(&dpi, screenCoords, STR_REPRESENTATION_BY_JL, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_REPRESENTATION_BY_JL, {}, { TextAlignment::CENTRE });
screenCoords.y += 2 * lineHeight + 5;
DrawTextBasic(&dpi, screenCoords, STR_THANKS_TO, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_THANKS_TO, {}, { TextAlignment::CENTRE });
screenCoords.y += lineHeight;
DrawTextBasic(&dpi, screenCoords, STR_THANKS_TO_PEOPLE, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_THANKS_TO_PEOPLE, {}, { TextAlignment::CENTRE });
screenCoords.y += 2 * lineHeight + 5;
DrawTextBasic(&dpi, screenCoords, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, {}, { TextAlignment::CENTRE });
// Images
GfxDrawSprite(&dpi, ImageId(SPR_CREDITS_CHRIS_SAWYER_SMALL), { windowPos.x + 92, yPage + 24 });
+2 -2
View File
@@ -248,7 +248,7 @@ private:
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
}
DrawTextEllipsised(&dpi, { 16, y + 1 }, listWidth, stringId, ft);
DrawTextEllipsised(dpi, { 16, y + 1 }, listWidth, stringId, ft);
auto checkboxSize = ItemHeight - 3;
PaintCheckbox(dpi, { { 2, y + 1 }, { 2 + checkboxSize + 1, y + 1 + checkboxSize } }, isChecked);
@@ -262,7 +262,7 @@ private:
auto checkmark = Formatter();
checkmark.Add<StringId>(STR_STRING);
checkmark.Add<char*>(CheckBoxMarkString);
DrawTextBasic(&dpi, ScreenCoordsXY{ rect.GetLeft() + 1, rect.GetTop() }, STR_WINDOW_COLOUR_2_STRINGID, checkmark);
DrawTextBasic(dpi, ScreenCoordsXY{ rect.GetLeft() + 1, rect.GetTop() }, STR_WINDOW_COLOUR_2_STRINGID, checkmark);
}
}
+1 -1
View File
@@ -197,7 +197,7 @@ public:
if (screenCoords.y + lineHeight < dpi.y || screenCoords.y >= dpi.y + dpi.height)
continue;
GfxDrawString(&dpi, screenCoords, line.c_str(), { colours[0] });
GfxDrawString(dpi, screenCoords, line.c_str(), { colours[0] });
}
}
+18 -19
View File
@@ -532,28 +532,28 @@ public:
colour |= COLOUR_FLAG_INSET;
}
int32_t actual_month = _monthSpinnerValue - 1;
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_BOTTOM_TOOLBAR_CASH, ft, { colour });
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_YEAR);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_MONTH);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 240 }, STR_DAY);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_BOTTOM_TOOLBAR_CASH, ft, { colour });
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_YEAR);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_MONTH);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 240 }, STR_DAY);
ft = Formatter();
ft.Add<int32_t>(_yearSpinnerValue);
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ _xRcol, 198 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT });
dpi, windowPos + ScreenCoordsXY{ _xRcol, 198 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT });
ft = Formatter();
ft.Add<int32_t>(actual_month);
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ _xRcol, 219 }, STR_FORMAT_MONTH, ft, { colours[1], TextAlignment::RIGHT });
dpi, windowPos + ScreenCoordsXY{ _xRcol, 219 }, STR_FORMAT_MONTH, ft, { colours[1], TextAlignment::RIGHT });
ft = Formatter();
ft.Add<int32_t>(_daySpinnerValue);
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ _xRcol, 240 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT });
dpi, windowPos + ScreenCoordsXY{ _xRcol, 240 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT });
}
else if (page == WINDOW_CHEATS_PAGE_MISC)
{
{
auto& widget = widgets[WIDX_WEATHER];
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHANGE_WEATHER);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHANGE_WEATHER);
}
{
@@ -562,25 +562,24 @@ public:
auto& widget = widgets[WIDX_PARK_RATING_SPINNER];
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 2 }, STR_FORMAT_INTEGER, ft,
{ colours[1] });
dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 2 }, STR_FORMAT_INTEGER, ft, { colours[1] });
}
{
auto& widget = widgets[WIDX_STAFF_SPEED];
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHEAT_STAFF_SPEED);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHEAT_STAFF_SPEED);
}
}
else if (page == WINDOW_CHEATS_PAGE_GUESTS)
{
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 72 }, STR_CHEAT_GUEST_HAPPINESS);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_CHEAT_GUEST_ENERGY);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 114 }, STR_CHEAT_GUEST_HUNGER);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 135 }, STR_CHEAT_GUEST_THIRST);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 156 }, STR_CHEAT_GUEST_NAUSEA);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 177 }, STR_CHEAT_GUEST_NAUSEA_TOLERANCE);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_CHEAT_GUEST_TOILET);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_CHEAT_GUEST_PREFERRED_INTENSITY);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 72 }, STR_CHEAT_GUEST_HAPPINESS);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_CHEAT_GUEST_ENERGY);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 114 }, STR_CHEAT_GUEST_HUNGER);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 135 }, STR_CHEAT_GUEST_THIRST);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 156 }, STR_CHEAT_GUEST_NAUSEA);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 177 }, STR_CHEAT_GUEST_NAUSEA_TOLERANCE);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_CHEAT_GUEST_TOILET);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_CHEAT_GUEST_PREFERRED_INTENSITY);
}
}
+2 -2
View File
@@ -182,7 +182,7 @@ public:
{
auto ft = Formatter();
ft.Add<uint16_t>(gLandToolSize);
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
}
// Draw cost amount
@@ -192,7 +192,7 @@ public:
ft.Add<money64>(gClearSceneryCost);
screenCoords.x = window_clear_scenery_widgets[WIDX_PREVIEW].midX() + windowPos.x;
screenCoords.y = window_clear_scenery_widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 + 27;
DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
}
}
};
+5 -5
View File
@@ -193,22 +193,22 @@ public:
auto screenCoords = windowPos + ScreenCoordsXY{ 10, 30 };
DrawTextBasic(&dpi, screenCoords, STR_RATE, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_RATE, {}, { colours[1] });
int32_t baseExchange = CurrencyDescriptors[EnumValue(CurrencyType::Pounds)].rate;
ft = Formatter();
ft.Add<int32_t>(baseExchange);
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 200, 0 }, STR_CUSTOM_CURRENCY_EQUIVALENCY, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 200, 0 }, STR_CUSTOM_CURRENCY_EQUIVALENCY, ft, { colours[1] });
screenCoords.y += 20;
DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_SYMBOL_TEXT, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_SYMBOL_TEXT, {}, { colours[1] });
screenCoords = windowPos
+ ScreenCoordsXY{ window_custom_currency_widgets[WIDX_SYMBOL_TEXT].left + 1,
window_custom_currency_widgets[WIDX_SYMBOL_TEXT].top };
GfxDrawString(&dpi, screenCoords, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, { colours[1] });
GfxDrawString(dpi, screenCoords, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, { colours[1] });
auto drawPos = windowPos
+ ScreenCoordsXY{ window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1,
@@ -216,7 +216,7 @@ public:
StringId stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix)
? STR_PREFIX
: STR_SUFFIX;
DrawTextBasic(&dpi, drawPos, stringId, {}, { colours[1] });
DrawTextBasic(dpi, drawPos, stringId, {}, { colours[1] });
}
};
@@ -87,7 +87,7 @@ public:
ft.Add<money64>(_demolishRideCost);
ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3);
DrawTextWrapped(&dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE });
DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE });
}
}
};
+1 -1
View File
@@ -204,7 +204,7 @@ public:
// Draw item string
Formatter ft(reinterpret_cast<uint8_t*>(&gDropdownItems[i].Args));
DrawTextEllipsised(&dpi, screenCoords, width - 5, item, ft, { colour });
DrawTextEllipsised(dpi, screenCoords, width - 5, item, ft, { colour });
}
}
}
@@ -312,8 +312,8 @@ private:
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
stringId = STR_EDITOR_STEP_OBJECT_SELECTION;
DrawTextBasic(&dpi, { textX, textY }, STR_BACK_TO_PREVIOUS_STEP, {}, { textColour, TextAlignment::CENTRE });
DrawTextBasic(&dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE });
DrawTextBasic(dpi, { textX, textY }, STR_BACK_TO_PREVIOUS_STEP, {}, { textColour, TextAlignment::CENTRE });
DrawTextBasic(dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE });
}
void DrawRightButtonBack(DrawPixelInfo& dpi)
@@ -350,8 +350,8 @@ private:
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
stringId = STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER;
DrawTextBasic(&dpi, { textX, textY }, STR_FORWARD_TO_NEXT_STEP, {}, { textColour, TextAlignment::CENTRE });
DrawTextBasic(&dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE });
DrawTextBasic(dpi, { textX, textY }, STR_FORWARD_TO_NEXT_STEP, {}, { textColour, TextAlignment::CENTRE });
DrawTextBasic(dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE });
}
void DrawStepText(DrawPixelInfo& dpi)
@@ -359,7 +359,7 @@ private:
int16_t stateX = (widgets[WIDX_PREVIOUS_IMAGE].right + widgets[WIDX_NEXT_IMAGE].left) / 2 + windowPos.x;
int16_t stateY = height - 0x0C + windowPos.y;
DrawTextBasic(
&dpi, { stateX, stateY }, _editorStepNames[EnumValue(gEditorStep)], {},
dpi, { stateX, stateY }, _editorStepNames[EnumValue(gEditorStep)], {},
{ static_cast<colour_t>(NOT_TRANSLUCENT(colours[2]) | COLOUR_FLAG_OUTLINE), TextAlignment::CENTRE });
}
@@ -111,20 +111,20 @@ static void DrawResearchItem(
// Draw group name
auto ft = Formatter();
ft.Add<StringId>(rideTypeName);
DrawTextEllipsised(&dpi, screenCoords, columnSplitOffset - 11, format, ft, textPaint);
DrawTextEllipsised(dpi, screenCoords, columnSplitOffset - 11, format, ft, textPaint);
// Draw vehicle name
ft = Formatter();
ft.Add<StringId>(itemNameId);
DrawTextEllipsised(
&dpi, { screenCoords + ScreenCoordsXY{ columnSplitOffset, 0 } }, columnSplitOffset - 11, format, ft, textPaint);
dpi, { screenCoords + ScreenCoordsXY{ columnSplitOffset, 0 } }, columnSplitOffset - 11, format, ft, textPaint);
}
else
{
// Scenery group, flat ride or shopdis
auto ft = Formatter();
ft.Add<StringId>(itemNameId);
DrawTextEllipsised(&dpi, screenCoords, width, format, ft, textPaint);
DrawTextEllipsised(dpi, screenCoords, width, format, ft, textPaint);
}
}
@@ -357,12 +357,12 @@ public:
// Pre-researched items label
screenPos = windowPos
+ ScreenCoordsXY{ widgets[WIDX_PRE_RESEARCHED_SCROLL].left, widgets[WIDX_PRE_RESEARCHED_SCROLL].top - 11 };
DrawTextBasic(&dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_PREINVENTED_ITEMS);
DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_PREINVENTED_ITEMS);
// Research order label
screenPos = windowPos
+ ScreenCoordsXY{ widgets[WIDX_RESEARCH_ORDER_SCROLL].left, widgets[WIDX_RESEARCH_ORDER_SCROLL].top - 11 };
DrawTextBasic(&dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_TO_BE_INVENTED_ITEMS);
DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_TO_BE_INVENTED_ITEMS);
// Preview background
auto& bkWidget = widgets[WIDX_PREVIEW];
@@ -424,14 +424,14 @@ public:
ft.Add<StringId>(stringId);
}
DrawTextEllipsised(&dpi, screenPos, itemWidth, drawString, ft, { TextAlignment::CENTRE });
DrawTextEllipsised(dpi, screenPos, itemWidth, drawString, ft, { TextAlignment::CENTRE });
screenPos.y += 15;
// Item category
screenPos.x = windowPos.x + widgets[WIDX_RESEARCH_ORDER_SCROLL].right + 4;
ft = Formatter();
ft.Add<StringId>(researchItem->GetCategoryInventionString());
DrawTextBasic(&dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, ft);
DrawTextBasic(dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, ft);
}
void OnPrepareDraw() override
@@ -726,7 +726,7 @@ public:
colour2 |= COLOUR_FLAG_INSET;
GfxDrawString(
&dpi, screenCoords, static_cast<const char*>(CheckBoxMarkString),
dpi, screenCoords, static_cast<const char*>(CheckBoxMarkString),
{ static_cast<colour_t>(colour2), FontStyle::Medium, darkness });
}
@@ -754,7 +754,7 @@ public:
auto ft = Formatter();
ft.Add<const char*>(gCommonStringFormatBuffer);
DrawTextEllipsised(
&dpi, screenCoords, width_limit - 15, STR_STRING, ft, { colour, FontStyle::Medium, darkness });
dpi, screenCoords, width_limit - 15, STR_STRING, ft, { colour, FontStyle::Medium, darkness });
screenCoords.x = widgets[WIDX_LIST_SORT_RIDE].left - widgets[WIDX_LIST].left;
}
@@ -769,7 +769,7 @@ public:
}
auto ft = Formatter();
ft.Add<const char*>(gCommonStringFormatBuffer);
DrawTextEllipsised(&dpi, screenCoords, width_limit, STR_STRING, ft, { colour, FontStyle::Medium, darkness });
DrawTextEllipsised(dpi, screenCoords, width_limit, STR_STRING, ft, { colour, FontStyle::Medium, darkness });
}
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
}
@@ -1019,7 +1019,7 @@ public:
auto ft = Formatter();
ft.Add<uint16_t>(numSelected);
ft.Add<uint16_t>(totalSelectable);
DrawTextBasic(&dpi, screenPos, STR_OBJECT_SELECTION_SELECTION_SIZE, ft);
DrawTextBasic(dpi, screenPos, STR_OBJECT_SELECTION_SELECTION_SIZE, ft);
}
// Draw sort button text
@@ -1031,7 +1031,7 @@ public:
: STR_NONE;
ft.Add<StringId>(stringId);
auto screenPos = windowPos + ScreenCoordsXY{ listSortTypeWidget.left + 1, listSortTypeWidget.top + 1 };
DrawTextEllipsised(&dpi, screenPos, listSortTypeWidget.width(), STR_OBJECTS_SORT_TYPE, ft, { colours[1] });
DrawTextEllipsised(dpi, screenPos, listSortTypeWidget.width(), STR_OBJECTS_SORT_TYPE, ft, { colours[1] });
}
const auto& listSortRideWidget = widgets[WIDX_LIST_SORT_RIDE];
if (listSortRideWidget.type != WindowWidgetType::Empty)
@@ -1041,7 +1041,7 @@ public:
: STR_NONE;
ft.Add<StringId>(stringId);
auto screenPos = windowPos + ScreenCoordsXY{ listSortRideWidget.left + 1, listSortRideWidget.top + 1 };
DrawTextEllipsised(&dpi, screenPos, listSortRideWidget.width(), STR_OBJECTS_SORT_RIDE, ft, { colours[1] });
DrawTextEllipsised(dpi, screenPos, listSortRideWidget.width(), STR_OBJECTS_SORT_RIDE, ft, { colours[1] });
}
if (selected_list_item == -1 || _loadedObject == nullptr)
@@ -1068,7 +1068,7 @@ public:
auto ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(listItem->repositoryItem->Name.c_str());
DrawTextEllipsised(&dpi, screenPos, _width, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE });
DrawTextEllipsised(dpi, screenPos, _width, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE });
}
DrawDescriptions(&dpi);
@@ -1195,7 +1195,7 @@ private:
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(description.c_str());
screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_WINDOW_COLOUR_2_STRINGID, ft) + LIST_ROW_HEIGHT;
screenPos.y += DrawTextWrapped(*dpi, screenPos, _width2, STR_WINDOW_COLOUR_2_STRINGID, ft) + LIST_ROW_HEIGHT;
}
if (GetSelectedObjectType() == ObjectType::Ride)
{
@@ -1216,7 +1216,7 @@ private:
}
auto ft = Formatter();
ft.Add<const char*>(sells.c_str());
screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_RIDE_OBJECT_SHOP_SELLS, ft) + 2;
screenPos.y += DrawTextWrapped(*dpi, screenPos, _width2, STR_RIDE_OBJECT_SHOP_SELLS, ft) + 2;
}
}
else if (GetSelectedObjectType() == ObjectType::SceneryGroup)
@@ -1224,11 +1224,11 @@ private:
const auto* sceneryGroupObject = reinterpret_cast<SceneryGroupObject*>(_loadedObject.get());
auto ft = Formatter();
ft.Add<uint16_t>(sceneryGroupObject->GetNumIncludedObjects());
screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_INCLUDES_X_OBJECTS, ft) + 2;
screenPos.y += DrawTextWrapped(*dpi, screenPos, _width2, STR_INCLUDES_X_OBJECTS, ft) + 2;
}
else if (GetSelectedObjectType() == ObjectType::Music)
{
screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_MUSIC_OBJECT_TRACK_HEADER) + 2;
screenPos.y += DrawTextWrapped(*dpi, screenPos, _width2, STR_MUSIC_OBJECT_TRACK_HEADER) + 2;
const auto* musicObject = reinterpret_cast<MusicObject*>(_loadedObject.get());
for (size_t i = 0; i < musicObject->GetTrackCount(); i++)
{
@@ -1241,7 +1241,7 @@ private:
auto ft = Formatter();
ft.Add<const char*>(track->Name.c_str());
ft.Add<const char*>(track->Composer.c_str());
screenPos.y += DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 10, 0 }, _width2, stringId, ft);
screenPos.y += DrawTextWrapped(*dpi, screenPos + ScreenCoordsXY{ 10, 0 }, _width2, stringId, ft);
}
}
}
@@ -1254,7 +1254,7 @@ private:
// Draw fallback image warning
if (_loadedObject && _loadedObject->UsesFallbackImages())
{
DrawTextBasic(dpi, screenPos, STR_OBJECT_USES_FALLBACK_IMAGES, {}, { COLOUR_WHITE, TextAlignment::RIGHT });
DrawTextBasic(*dpi, screenPos, STR_OBJECT_USES_FALLBACK_IMAGES, {}, { COLOUR_WHITE, TextAlignment::RIGHT });
}
screenPos.y += LIST_ROW_HEIGHT;
@@ -1262,14 +1262,14 @@ private:
if (GetSelectedObjectType() == ObjectType::Ride)
{
auto stringId = GetRideTypeStringId(listItem->repositoryItem);
DrawTextBasic(dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT });
DrawTextBasic(*dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT });
}
screenPos.y += LIST_ROW_HEIGHT;
// Draw object source
auto stringId = ObjectManagerGetSourceGameString(listItem->repositoryItem->GetFirstSourceGame());
DrawTextBasic(dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT });
DrawTextBasic(*dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT });
screenPos.y += LIST_ROW_HEIGHT;
// Draw object filename
@@ -1279,7 +1279,7 @@ private:
ft.Add<StringId>(STR_STRING);
ft.Add<const utf8*>(path.c_str());
DrawTextBasic(
dpi, { windowPos.x + this->width - 5, screenPos.y }, STR_WINDOW_COLOUR_2_STRINGID, ft,
*dpi, { windowPos.x + this->width - 5, screenPos.y }, STR_WINDOW_COLOUR_2_STRINGID, ft,
{ COLOUR_BLACK, TextAlignment::RIGHT });
screenPos.y += LIST_ROW_HEIGHT;
}
@@ -1299,7 +1299,7 @@ private:
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(authorsString.c_str());
DrawTextEllipsised(
dpi, { windowPos.x + width - 5, screenPos.y }, width - widgets[WIDX_LIST].right - 4,
*dpi, { windowPos.x + width - 5, screenPos.y }, width - widgets[WIDX_LIST].right - 4,
STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::RIGHT });
}
}
@@ -773,13 +773,13 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo*
// Objective label
auto screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_OBJECTIVE].top };
DrawTextBasic(dpi, screenCoords, STR_OBJECTIVE_WINDOW);
DrawTextBasic(*dpi, screenCoords, STR_OBJECTIVE_WINDOW);
// Objective value
screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE].left + 1, w->widgets[WIDX_OBJECTIVE].top };
auto ft = Formatter();
ft.Add<StringId>(ObjectiveDropdownOptionNames[gScenarioObjective.Type]);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
if (w->widgets[WIDX_OBJECTIVE_ARG_1].type != WindowWidgetType::Empty)
{
@@ -808,7 +808,7 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo*
stringId = STR_WINDOW_OBJECTIVE_EXCITEMENT_RATING;
break;
}
DrawTextBasic(dpi, screenCoords, stringId);
DrawTextBasic(*dpi, screenCoords, stringId);
// Objective argument 1 value
screenCoords = w->windowPos
@@ -841,21 +841,21 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo*
ft.Add<money64>(gScenarioObjective.Currency);
break;
}
DrawTextBasic(dpi, screenCoords, stringId, ft, COLOUR_BLACK);
DrawTextBasic(*dpi, screenCoords, stringId, ft, COLOUR_BLACK);
}
if (w->widgets[WIDX_OBJECTIVE_ARG_2].type != WindowWidgetType::Empty)
{
// Objective argument 2 label
screenCoords = w->windowPos + ScreenCoordsXY{ 28, w->widgets[WIDX_OBJECTIVE_ARG_2].top };
DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_DATE);
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_OBJECTIVE_DATE);
// Objective argument 2 value
screenCoords = w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE_ARG_2].left + 1, w->widgets[WIDX_OBJECTIVE_ARG_2].top };
ft = Formatter();
ft.Add<uint16_t>((gScenarioObjective.Year * MONTH_COUNT) - 1);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, ft);
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, ft);
}
// Park name
@@ -869,7 +869,7 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo*
ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(parkName);
DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_PARK_NAME, ft);
DrawTextEllipsised(*dpi, screenCoords, width, STR_WINDOW_PARK_NAME, ft);
}
// Scenario name
@@ -879,11 +879,11 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo*
ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(gScenarioName.c_str());
DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft);
DrawTextEllipsised(*dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft);
// Scenario details label
screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_DETAILS].top };
DrawTextBasic(dpi, screenCoords, STR_WINDOW_PARK_DETAILS);
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_PARK_DETAILS);
// Scenario details value
screenCoords = w->windowPos + ScreenCoordsXY{ 16, w->widgets[WIDX_DETAILS].top + 10 };
@@ -892,17 +892,17 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo*
ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(gScenarioDetails.c_str());
DrawTextWrapped(dpi, screenCoords, width, STR_BLACK_STRING, ft);
DrawTextWrapped(*dpi, screenCoords, width, STR_BLACK_STRING, ft);
// Scenario category label
screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_CATEGORY].top };
DrawTextBasic(dpi, screenCoords, STR_WINDOW_SCENARIO_GROUP);
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_SCENARIO_GROUP);
// Scenario category value
screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CATEGORY].left + 1, w->widgets[WIDX_CATEGORY].top };
ft = Formatter();
ft.Add<StringId>(ScenarioCategoryStringIds[gScenarioCategory]);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
}
/**
@@ -1044,7 +1044,7 @@ static void WindowEditorObjectiveOptionsRidesPaint(WindowBase* w, DrawPixelInfo*
WindowEditorObjectiveOptionsDrawTabImages(w, dpi);
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PAGE_BACKGROUND].top + 3 }, STR_WINDOW_PRESERVATION_ORDER);
*dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PAGE_BACKGROUND].top + 3 }, STR_WINDOW_PRESERVATION_ORDER);
}
/**
@@ -1083,7 +1083,7 @@ static void WindowEditorObjectiveOptionsRidesScrollpaint(WindowBase* w, DrawPixe
{
auto darkness = stringId == STR_WINDOW_COLOUR_2_STRINGID ? TextDarkness::ExtraDark : TextDarkness::Dark;
GfxDrawString(
dpi, { 2, y }, static_cast<const char*>(CheckBoxMarkString),
*dpi, { 2, y }, static_cast<const char*>(CheckBoxMarkString),
{ static_cast<colour_t>(w->colours[1] & 0x7F), FontStyle::Medium, darkness });
}
@@ -1091,7 +1091,7 @@ static void WindowEditorObjectiveOptionsRidesScrollpaint(WindowBase* w, DrawPixe
Formatter ft;
ride->FormatNameTo(ft);
DrawTextBasic(dpi, { 15, y }, stringId, ft);
DrawTextBasic(*dpi, { 15, y }, stringId, ft);
}
}
}
@@ -620,49 +620,49 @@ private:
if (initialCashWidget.type != WindowWidgetType::Empty)
{
screenCoords = windowPos + ScreenCoordsXY{ 8, initialCashWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_INIT_CASH_LABEL);
DrawTextBasic(dpi, screenCoords, STR_INIT_CASH_LABEL);
screenCoords = windowPos + ScreenCoordsXY{ initialCashWidget.left + 1, initialCashWidget.top };
auto ft = Formatter();
ft.Add<money64>(gInitialCash);
DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
const auto& initialLoanWidget = widgets[WIDX_INITIAL_LOAN];
if (initialLoanWidget.type != WindowWidgetType::Empty)
{
screenCoords = windowPos + ScreenCoordsXY{ 8, initialLoanWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_INIT_LOAN_LABEL);
DrawTextBasic(dpi, screenCoords, STR_INIT_LOAN_LABEL);
screenCoords = windowPos + ScreenCoordsXY{ initialLoanWidget.left + 1, initialLoanWidget.top };
auto ft = Formatter();
ft.Add<money64>(gBankLoan);
DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
const auto& maximumLoanWidget = widgets[WIDX_MAXIMUM_LOAN];
if (maximumLoanWidget.type != WindowWidgetType::Empty)
{
screenCoords = windowPos + ScreenCoordsXY{ 8, maximumLoanWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_MAX_LOAN_LABEL);
DrawTextBasic(dpi, screenCoords, STR_MAX_LOAN_LABEL);
screenCoords = windowPos + ScreenCoordsXY{ maximumLoanWidget.left + 1, maximumLoanWidget.top };
auto ft = Formatter();
ft.Add<money64>(gMaxBankLoan);
DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
const auto& interestRateWidget = widgets[WIDX_INTEREST_RATE];
if (interestRateWidget.type != WindowWidgetType::Empty)
{
screenCoords = windowPos + ScreenCoordsXY{ 8, interestRateWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_INTEREST_RATE_LABEL);
DrawTextBasic(dpi, screenCoords, STR_INTEREST_RATE_LABEL);
screenCoords = windowPos + ScreenCoordsXY{ interestRateWidget.left + 1, interestRateWidget.top };
auto ft = Formatter();
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);
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
}
}
@@ -869,47 +869,47 @@ private:
{
// Cash per guest label
screenCoords = windowPos + ScreenCoordsXY{ 8, cashPerGuestWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_CASH_PER_GUEST_LABEL);
DrawTextBasic(dpi, screenCoords, STR_CASH_PER_GUEST_LABEL);
// Cash per guest value
screenCoords = windowPos + ScreenCoordsXY{ cashPerGuestWidget.left + 1, cashPerGuestWidget.top };
auto ft = Formatter();
ft.Add<money64>(gGuestInitialCash);
DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
// Guest initial happiness label
const auto& initialHappinessWidget = widgets[WIDX_GUEST_INITIAL_HAPPINESS];
screenCoords = windowPos + ScreenCoordsXY{ 8, initialHappinessWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_GUEST_INIT_HAPPINESS);
DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_HAPPINESS);
// Guest initial happiness value
screenCoords = windowPos + ScreenCoordsXY{ initialHappinessWidget.left + 1, initialHappinessWidget.top };
auto ft = Formatter();
ft.Add<uint16_t>((gGuestInitialHappiness * 100) / 255);
DrawTextBasic(&dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
// Guest initial hunger label
const auto& initialHungerWidget = widgets[WIDX_GUEST_INITIAL_HUNGER];
screenCoords = windowPos + ScreenCoordsXY{ 8, initialHungerWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_GUEST_INIT_HUNGER);
DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_HUNGER);
// Guest initial hunger value
screenCoords = windowPos + ScreenCoordsXY{ initialHungerWidget.left + 1, initialHungerWidget.top };
ft = Formatter();
ft.Add<uint16_t>(((255 - gGuestInitialHunger) * 100) / 255);
DrawTextBasic(&dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
// Guest initial thirst label
const auto& initialThirstWidget = widgets[WIDX_GUEST_INITIAL_THIRST];
screenCoords = windowPos + ScreenCoordsXY{ 8, initialThirstWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_GUEST_INIT_THIRST);
DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_THIRST);
// Guest initial thirst value
screenCoords = windowPos + ScreenCoordsXY{ initialThirstWidget.left + 1, initialThirstWidget.top };
ft = Formatter();
ft.Add<uint16_t>(((255 - gGuestInitialThirst) * 100) / 255);
DrawTextBasic(&dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft);
}
#pragma endregion
@@ -1188,13 +1188,13 @@ private:
{
// Cost to buy land label
screenCoords = windowPos + ScreenCoordsXY{ 8, landCostWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_LAND_COST_LABEL);
DrawTextBasic(dpi, screenCoords, STR_LAND_COST_LABEL);
// Cost to buy land value
screenCoords = windowPos + ScreenCoordsXY{ landCostWidget.left + 1, landCostWidget.top };
auto ft = Formatter();
ft.Add<money64>(gLandPrice);
DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
const auto& constructionRightsCostWidget = widgets[WIDX_CONSTRUCTION_RIGHTS_COST];
@@ -1202,14 +1202,14 @@ private:
{
// Cost to buy construction rights label
screenCoords = windowPos + ScreenCoordsXY{ 8, constructionRightsCostWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_RIGHTS_COST_LABEL);
DrawTextBasic(dpi, screenCoords, STR_RIGHTS_COST_LABEL);
// Cost to buy construction rights value
screenCoords = windowPos
+ ScreenCoordsXY{ constructionRightsCostWidget.left + 1, constructionRightsCostWidget.top };
auto ft = Formatter();
ft.Add<money64>(gConstructionRightsPrice);
DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
const auto& payForParkOrRidesWidget = widgets[WIDX_PAY_FOR_PARK_OR_RIDES];
@@ -1227,7 +1227,7 @@ private:
else
ft.Add<StringId>(STR_PAY_PARK_ENTER);
DrawTextBasic(&dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
}
const auto& entryPriceWidget = widgets[WIDX_ENTRY_PRICE];
@@ -1235,25 +1235,25 @@ private:
{
// Entry price label
screenCoords = windowPos + ScreenCoordsXY{ payForParkOrRidesWidget.right + 8, entryPriceWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_ENTRY_PRICE_LABEL);
DrawTextBasic(dpi, screenCoords, STR_ENTRY_PRICE_LABEL);
// Entry price value
screenCoords = windowPos + ScreenCoordsXY{ entryPriceWidget.left + 1, entryPriceWidget.top };
auto ft = Formatter();
ft.Add<money64>(gParkEntranceFee);
DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft);
}
// Climate label
const auto& climateWidget = widgets[WIDX_CLIMATE];
screenCoords = windowPos + ScreenCoordsXY{ 8, climateWidget.top };
DrawTextBasic(&dpi, screenCoords, STR_CLIMATE_LABEL);
DrawTextBasic(dpi, screenCoords, STR_CLIMATE_LABEL);
// Climate value
screenCoords = windowPos + ScreenCoordsXY{ climateWidget.left + 1, climateWidget.top };
auto ft = Formatter();
ft.Add<StringId>(ClimateNames[static_cast<uint8_t>(gClimate)]);
DrawTextBasic(&dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
}
#pragma endregion
+1 -1
View File
@@ -94,7 +94,7 @@ public:
FilterPaletteID::PaletteDarken3);
DrawStringCentredRaw(
&dpi, { leftTop + ScreenCoordsXY{ (width + 1) / 2 - 1, 1 } }, _numLines, _text.data(), FontStyle::Medium);
dpi, { leftTop + ScreenCoordsXY{ (width + 1) / 2 - 1, 1 } }, _numLines, _text.data(), FontStyle::Medium);
}
void OnUnknown5() override
+22 -23
View File
@@ -393,7 +393,7 @@ public:
ft.Add<StringId>(STR_FINANCES_SUMMARY_MONTH_HEADING);
ft.Add<uint16_t>(monthyear);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 },
dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 },
monthyear == currentMonthYear ? STR_WINDOW_COLOUR_2_STRINGID : STR_BLACK_STRING, ft,
{ TextUnderline::On, TextAlignment::RIGHT });
screenCoords.y += 14;
@@ -411,7 +411,7 @@ public:
ft = Formatter();
ft.Add<money64>(expenditure);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft,
dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft,
{ TextAlignment::RIGHT });
}
screenCoords.y += TABLE_CELL_HEIGHT;
@@ -423,7 +423,7 @@ public:
ft = Formatter();
ft.Add<money64>(profit);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT });
dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT });
GfxFillRect(
&dpi,
@@ -532,7 +532,7 @@ public:
// Expenditure / Income heading
DrawTextBasic(
&dpi, screenCoords, STR_FINANCES_SUMMARY_EXPENDITURE_INCOME, {},
dpi, screenCoords, STR_FINANCES_SUMMARY_EXPENDITURE_INCOME, {},
{ COLOUR_BLACK, TextUnderline::On, TextAlignment::LEFT });
screenCoords.y += 14;
@@ -546,7 +546,7 @@ public:
{ screenCoords - ScreenCoordsXY{ 0, 1 }, screenCoords + ScreenCoordsXY{ 121, (TABLE_CELL_HEIGHT - 2) } },
ColourMapA[colours[1]].lighter | 0x1000000);
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, _windowFinancesSummaryRowLabels[i]);
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, _windowFinancesSummaryRowLabels[i]);
screenCoords.y += TABLE_CELL_HEIGHT;
}
@@ -556,19 +556,19 @@ public:
INSET_RECT_FLAG_BORDER_INSET);
// Loan and interest rate
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 8, 279 }, STR_FINANCES_SUMMARY_LOAN);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, 279 }, STR_FINANCES_SUMMARY_LOAN);
if (!(gParkFlags & PARK_FLAGS_RCT1_INTEREST))
{
auto ft = Formatter();
ft.Add<uint16_t>(gBankLoanInterestRate);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 167, 279 }, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, ft);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 167, 279 }, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, ft);
}
// Current cash
auto ft = Formatter();
ft.Add<money64>(gCash);
StringId stringId = gCash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL;
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 8, 294 }, stringId, ft);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, 294 }, stringId, ft);
// Objective related financial information
if (gScenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME)
@@ -577,18 +577,17 @@ public:
ft = Formatter();
ft.Add<money64>(lastMonthProfit);
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_LAST_MONTH_PROFIT_FROM_FOOD_DRINK_MERCHANDISE_SALES_LABEL,
ft);
dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_LAST_MONTH_PROFIT_FROM_FOOD_DRINK_MERCHANDISE_SALES_LABEL, ft);
}
else
{
// Park value and company value
ft = Formatter();
ft.Add<money64>(gParkValue);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_PARK_VALUE_LABEL, ft);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_PARK_VALUE_LABEL, ft);
ft = Formatter();
ft.Add<money64>(gCompanyValue);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 280, 294 }, STR_COMPANY_VALUE_LABEL, ft);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 280, 294 }, STR_COMPANY_VALUE_LABEL, ft);
}
}
@@ -613,7 +612,7 @@ public:
ft.Add<money64>(cashLessLoan);
DrawTextBasic(
&dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 },
dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 },
cashLessLoan >= 0 ? STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_POSITIVE
: STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_NEGATIVE,
ft);
@@ -647,7 +646,7 @@ public:
ft = Formatter();
ft.Add<money64>(axisValue);
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,
{ FontStyle::Small, TextAlignment::RIGHT });
GfxFillRectInset(
&dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2],
@@ -673,7 +672,7 @@ public:
// Park value
auto ft = Formatter();
ft.Add<money64>(gParkValue);
DrawTextBasic(&dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft);
DrawTextBasic(dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft);
// Graph
GfxFillRectInset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
@@ -704,7 +703,7 @@ public:
ft = Formatter();
ft.Add<money64>(axisValue);
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,
{ FontStyle::Small, TextAlignment::RIGHT });
GfxFillRectInset(
&dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2],
@@ -731,7 +730,7 @@ public:
auto ft = Formatter();
ft.Add<money64>(gCurrentProfit);
DrawTextBasic(
&dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 },
dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 },
gCurrentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, ft);
// Graph
@@ -763,7 +762,7 @@ public:
ft = Formatter();
ft.Add<money64>(axisValue);
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,
{ FontStyle::Small, TextAlignment::RIGHT });
GfxFillRectInset(
&dpi, { screenPos + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, screenPos.y + 5 } }, colours[2],
@@ -860,14 +859,14 @@ public:
}
}
// Advertisement
DrawTextEllipsised(&dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, 296, MarketingCampaignNames[i][1], ft);
DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, 296, MarketingCampaignNames[i][1], ft);
// Duration
uint16_t weeksRemaining = marketingCampaign->WeeksLeft;
ft = Formatter();
ft.Add<uint16_t>(weeksRemaining);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 304, 0 },
dpi, screenCoords + ScreenCoordsXY{ 304, 0 },
weeksRemaining == 1 ? STR_1_WEEK_REMAINING : STR_X_WEEKS_REMAINING, ft);
screenCoords.y += LIST_ROW_HEIGHT;
@@ -875,7 +874,7 @@ public:
if (noCampaignsActive)
{
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, STR_MARKETING_CAMPAIGNS_NONE);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, STR_MARKETING_CAMPAIGNS_NONE);
screenCoords.y += LIST_ROW_HEIGHT;
}
screenCoords.y += 34;
@@ -887,10 +886,10 @@ public:
if (campaignButton->type != WindowWidgetType::Empty)
{
// Draw button text
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, MarketingCampaignNames[i][0]);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, MarketingCampaignNames[i][0]);
auto ft = Formatter();
ft.Add<money64>(AdvertisingCampaignPricePerWeek[i]);
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, ft);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, ft);
screenCoords.y += BUTTON_FACE_HEIGHT + 2;
}
+2 -2
View File
@@ -489,7 +489,7 @@ public:
screenCoords = this->windowPos
+ ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(),
window_footpath_widgets[WIDX_CONSTRUCT].bottom - 23 };
DrawTextBasic(&dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE });
}
// Draw cost
@@ -502,7 +502,7 @@ public:
{
auto ft = Formatter();
ft.Add<money64>(_windowFootpathCost);
DrawTextBasic(&dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
}
}
}
@@ -412,7 +412,7 @@ static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo* dpi, WindowBase*
StringId stringId = gCash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH;
auto ft = Formatter();
ft.Add<money64>(gCash);
DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
DrawTextBasic(*dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
}
static constexpr const StringId _guestCountFormats[] = {
@@ -440,7 +440,7 @@ static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo* dpi, WindowBase*
: NOT_TRANSLUCENT(w->colours[0]));
auto ft = Formatter();
ft.Add<uint32_t>(gNumGuestsInPark);
DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
DrawTextBasic(*dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
}
// Draw park rating
@@ -509,7 +509,7 @@ static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo* dpi, WindowBase
ft.Add<StringId>(DateDayNames[day]);
ft.Add<int16_t>(month);
ft.Add<int16_t>(year);
DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
DrawTextBasic(*dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
// Figure out how much line height we have to work with.
uint32_t line_height = FontGetLineHeight(FontStyle::Medium);
@@ -527,7 +527,7 @@ static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo* dpi, WindowBase
}
ft = Formatter();
ft.Add<int16_t>(temperature);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 0, 6 }, format, ft);
DrawTextBasic(*dpi, screenCoords + ScreenCoordsXY{ 0, 6 }, format, ft);
screenCoords.x += 30;
// Current weather
@@ -570,7 +570,7 @@ static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo* dpi, WindowBase*
auto screenCoords = w->windowPos + ScreenCoordsXY{ middleOutsetWidget->midX(), middleOutsetWidget->top + 11 };
width = middleOutsetWidget->width() - 62;
DrawNewsTicker(
dpi, screenCoords, width, COLOUR_BRIGHT_GREEN, STR_BOTTOM_TOOLBAR_NEWS_TEXT, newsItem->Text, newsItem->Ticks);
*dpi, screenCoords, width, COLOUR_BRIGHT_GREEN, STR_BOTTOM_TOOLBAR_NEWS_TEXT, newsItem->Text, newsItem->Ticks);
screenCoords = w->windowPos
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].left,
@@ -675,12 +675,12 @@ static void WindowGameBottomToolbarDrawMiddlePanel(DrawPixelInfo* dpi, WindowBas
if (stringId == STR_NONE)
{
DrawTextWrapped(
dpi, middleWidgetCoords, width, STR_TITLE_SEQUENCE_OPENRCT2, ft, { w->colours[0], TextAlignment::CENTRE });
*dpi, middleWidgetCoords, width, STR_TITLE_SEQUENCE_OPENRCT2, ft, { w->colours[0], TextAlignment::CENTRE });
}
else
{
// Show tooltip in bottom toolbar
DrawTextWrapped(dpi, middleWidgetCoords, width, STR_STRINGID, ft, { w->colours[0], TextAlignment::CENTRE });
DrawTextWrapped(*dpi, middleWidgetCoords, width, STR_STRINGID, ft, { w->colours[0], TextAlignment::CENTRE });
}
}
+38 -38
View File
@@ -773,7 +773,7 @@ private:
auto ft = Formatter();
peep->FormatActionTo(ft);
int32_t textWidth = actionLabelWidget.width();
DrawTextEllipsised(&dpi, screenPos, textWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE });
DrawTextEllipsised(dpi, screenPos, textWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE });
}
// Draw the marquee thought
@@ -811,7 +811,7 @@ private:
{
auto ft = Formatter();
PeepThoughtSetFormatArgs(&peep->Thoughts[i], ft);
DrawTextBasic(&dpiMarquee, { screenPos.x, 0 }, STR_WINDOW_COLOUR_2_STRINGID, ft, { FontStyle::Small });
DrawTextBasic(dpiMarquee, { screenPos.x, 0 }, STR_WINDOW_COLOUR_2_STRINGID, ft, { FontStyle::Small });
}
}
@@ -1090,7 +1090,7 @@ private:
+ ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 };
// Happiness
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_HAPPINESS_LABEL);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_HAPPINESS_LABEL);
int32_t happiness = NormalizeGuestStatValue(peep->Happiness, PEEP_MAX_HAPPINESS, 10);
int32_t barColour = COLOUR_BRIGHT_GREEN;
@@ -1099,7 +1099,7 @@ private:
// Energy
screenCoords.y += LIST_ROW_HEIGHT;
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_ENERGY_LABEL);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_ENERGY_LABEL);
int32_t energy = NormalizeGuestStatValue(peep->Energy - PEEP_MIN_ENERGY, PEEP_MAX_ENERGY - PEEP_MIN_ENERGY, 10);
barColour = COLOUR_BRIGHT_GREEN;
@@ -1108,7 +1108,7 @@ private:
// Hunger
screenCoords.y += LIST_ROW_HEIGHT;
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_HUNGER_LABEL);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_HUNGER_LABEL);
int32_t hunger = NormalizeGuestStatValue(peep->Hunger - 32, 158, 0);
hunger = 255 - hunger; // the bar should be longer when peep->Hunger is low
@@ -1118,7 +1118,7 @@ private:
// Thirst
screenCoords.y += LIST_ROW_HEIGHT;
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_THIRST_LABEL);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_THIRST_LABEL);
int32_t thirst = NormalizeGuestStatValue(peep->Thirst - 32, 158, 0);
thirst = 255 - thirst; // the bar should be longer when peep->Thirst is low
@@ -1128,7 +1128,7 @@ private:
// Nausea
screenCoords.y += LIST_ROW_HEIGHT;
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_NAUSEA_LABEL);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_NAUSEA_LABEL);
int32_t nausea = NormalizeGuestStatValue(peep->Nausea - 32, 223, 0);
barColour = COLOUR_BRIGHT_RED;
@@ -1137,7 +1137,7 @@ private:
// Toilet
screenCoords.y += LIST_ROW_HEIGHT;
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_TOILET_LABEL);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TOILET_LABEL);
int32_t toilet = NormalizeGuestStatValue(peep->Toilet - 64, 178, 0);
barColour = COLOUR_BRIGHT_RED;
@@ -1152,7 +1152,7 @@ private:
int32_t timeInPark = (gCurrentTicks - guestEntryTime) >> 11;
auto ft = Formatter();
ft.Add<uint16_t>(timeInPark & 0xFFFF);
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_TIME_IN_PARK, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TIME_IN_PARK, ft);
}
screenCoords.y += LIST_ROW_HEIGHT + 9;
@@ -1161,7 +1161,7 @@ private:
INSET_RECT_FLAG_BORDER_INSET);
// Preferred Ride
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_PREFERRED_RIDE);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_PREFERRED_RIDE);
screenCoords.y += LIST_ROW_HEIGHT;
// Intensity
@@ -1182,7 +1182,7 @@ private:
ft.Add<uint16_t>(maxIntensity);
}
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, string_id, ft);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, string_id, ft);
}
// Nausea tolerance
@@ -1197,7 +1197,7 @@ private:
auto nausea_tolerance = EnumValue(peep->NauseaTolerance) & 0x3;
auto ft = Formatter();
ft.Add<StringId>(_nauseaTolerances[nausea_tolerance]);
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_NAUSEA_TOLERANCE, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_NAUSEA_TOLERANCE, ft);
}
}
@@ -1333,7 +1333,7 @@ private:
auto screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 2, widgets[WIDX_PAGE_BACKGROUND].top + 2 };
DrawTextBasic(&dpi, screenCoords, STR_GUEST_LABEL_RIDES_BEEN_ON);
DrawTextBasic(dpi, screenCoords, STR_GUEST_LABEL_RIDES_BEEN_ON);
screenCoords.y = windowPos.y + widgets[WIDX_PAGE_BACKGROUND].bottom - 12;
@@ -1348,7 +1348,7 @@ private:
ft.Add<StringId>(STR_PEEP_FAVOURITE_RIDE_NOT_AVAILABLE);
}
DrawTextEllipsised(&dpi, screenCoords, width - 14, STR_FAVOURITE_RIDE, ft);
DrawTextEllipsised(dpi, screenCoords, width - 14, STR_FAVOURITE_RIDE, ft);
}
void OnScrollDrawRides(int32_t scrollIndex, DrawPixelInfo& dpi)
@@ -1372,7 +1372,7 @@ private:
{
auto ft = Formatter();
r->FormatNameTo(ft);
DrawTextBasic(&dpi, { 0, y - 1 }, stringId, ft);
DrawTextBasic(dpi, { 0, y - 1 }, stringId, ft);
}
}
}
@@ -1430,7 +1430,7 @@ private:
{
auto ft = Formatter();
ft.Add<money64>(peep->CashInPocket);
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_CASH_IN_POCKET, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_IN_POCKET, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -1438,7 +1438,7 @@ private:
{
auto ft = Formatter();
ft.Add<money64>(peep->CashSpent);
DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_CASH_SPENT, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_SPENT, ft);
screenCoords.y += LIST_ROW_HEIGHT * 2;
}
@@ -1450,7 +1450,7 @@ private:
{
auto ft = Formatter();
ft.Add<money64>(peep->PaidToEnter);
DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_ENTRANCE_FEE, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_ENTRANCE_FEE, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
// Paid on rides
@@ -1460,11 +1460,11 @@ private:
ft.Add<uint16_t>(peep->GuestNumRides);
if (peep->GuestNumRides != 1)
{
DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_RIDE_PLURAL, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_RIDE_PLURAL, ft);
}
else
{
DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_RIDE, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_RIDE, ft);
}
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -1475,11 +1475,11 @@ private:
ft.Add<uint16_t>(peep->AmountOfFood);
if (peep->AmountOfFood != 1)
{
DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_FOOD_PLURAL, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_FOOD_PLURAL, ft);
}
else
{
DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_FOOD, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_FOOD, ft);
}
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -1491,11 +1491,11 @@ private:
ft.Add<uint16_t>(peep->AmountOfDrinks);
if (peep->AmountOfDrinks != 1)
{
DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_DRINK_PLURAL, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_DRINK_PLURAL, ft);
}
else
{
DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_DRINK, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_DRINK, ft);
}
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -1506,11 +1506,11 @@ private:
ft.Add<uint16_t>(peep->AmountOfSouvenirs);
if (peep->AmountOfSouvenirs != 1)
{
DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR_PLURAL, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR_PLURAL, ft);
}
else
{
DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR, ft);
DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR, ft);
}
}
}
@@ -1575,7 +1575,7 @@ private:
auto screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 };
DrawTextBasic(&dpi, screenCoords, STR_GUEST_RECENT_THOUGHTS_LABEL);
DrawTextBasic(dpi, screenCoords, STR_GUEST_RECENT_THOUGHTS_LABEL);
screenCoords.y += 10;
for (const auto& thought : peep->Thoughts)
@@ -1589,7 +1589,7 @@ private:
auto ft = Formatter();
PeepThoughtSetFormatArgs(&thought, ft);
screenCoords.y += DrawTextWrapped(&dpi, screenCoords, widgWidth, STR_BLACK_STRING, ft, { FontStyle::Small });
screenCoords.y += DrawTextWrapped(dpi, screenCoords, widgWidth, STR_BLACK_STRING, ft, { FontStyle::Small });
// If this is the last visible line end drawing.
if (screenCoords.y > windowPos.y + widgets[WIDX_PAGE_BACKGROUND].bottom - 32)
@@ -1765,7 +1765,7 @@ private:
int32_t maxY = windowPos.y + height - 22;
int32_t numItems = 0;
DrawTextBasic(&dpi, screenCoords, STR_CARRYING);
DrawTextBasic(dpi, screenCoords, STR_CARRYING);
screenCoords.y += 10;
for (ShopItem item = ShopItem::Balloon; item < ShopItem::Count; item++)
@@ -1776,13 +1776,13 @@ private:
continue;
auto [stringId, ft] = InventoryFormatItem(*guest, item);
screenCoords.y += DrawTextWrapped(&dpi, screenCoords, itemNameWidth, stringId, ft);
screenCoords.y += DrawTextWrapped(dpi, screenCoords, itemNameWidth, stringId, ft);
numItems++;
}
if (numItems == 0)
{
DrawTextBasic(&dpi, screenCoords, STR_NOTHING);
DrawTextBasic(dpi, screenCoords, STR_NOTHING);
}
}
#pragma endregion
@@ -1835,7 +1835,7 @@ private:
{
auto ft = Formatter();
ft.Add<uint32_t>(peep->Id);
DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_SPRITE_INDEX, ft);
DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_SPRITE_INDEX, ft);
}
screenCoords.y += LIST_ROW_HEIGHT;
{
@@ -1843,7 +1843,7 @@ private:
ft.Add<int32_t>(peep->x);
ft.Add<int32_t>(peep->y);
ft.Add<int32_t>(peep->z);
DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_POSITION, ft);
DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_POSITION, ft);
}
screenCoords.y += LIST_ROW_HEIGHT;
{
@@ -1864,7 +1864,7 @@ private:
OpenRCT2::FormatStringLegacy(buffer2, sizeof(buffer2), STR_PEEP_DEBUG_NEXT_SLOPE, ft2.Data());
SafeStrCat(buffer, buffer2, sizeof(buffer));
}
GfxDrawString(&dpi, screenCoords, buffer, {});
GfxDrawString(dpi, screenCoords, buffer, {});
}
screenCoords.y += LIST_ROW_HEIGHT;
{
@@ -1872,7 +1872,7 @@ private:
ft.Add<int32_t>(peep->DestinationX);
ft.Add<int32_t>(peep->DestinationY);
ft.Add<int32_t>(peep->DestinationTolerance);
DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_DEST, ft);
DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_DEST, ft);
}
screenCoords.y += LIST_ROW_HEIGHT;
{
@@ -1881,10 +1881,10 @@ private:
ft.Add<int32_t>(peep->PathfindGoal.y);
ft.Add<int32_t>(peep->PathfindGoal.z);
ft.Add<int32_t>(peep->PathfindGoal.direction);
DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_GOAL, ft);
DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_GOAL, ft);
}
screenCoords.y += LIST_ROW_HEIGHT;
DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY);
DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY);
screenCoords.y += LIST_ROW_HEIGHT;
screenCoords.x += 10;
@@ -1895,7 +1895,7 @@ private:
ft.Add<int32_t>(point.y);
ft.Add<int32_t>(point.z);
ft.Add<int32_t>(point.direction);
DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY_ITEM, ft);
DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY_ITEM, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
screenCoords.x -= 10;
+8 -8
View File
@@ -473,7 +473,7 @@ public:
{
Formatter ft(_filterArguments.args);
DrawTextEllipsised(&dpi, screenCoords, 310, format, ft);
DrawTextEllipsised(dpi, screenCoords, 310, format, ft);
}
// Number of guests (list items)
@@ -483,7 +483,7 @@ public:
auto ft = Formatter();
ft.Add<int32_t>(static_cast<int32_t>(_guestList.size()));
DrawTextBasic(
&dpi, screenCoords, (_guestList.size() == 1 ? STR_FORMAT_NUM_GUESTS_SINGULAR : STR_FORMAT_NUM_GUESTS_PLURAL),
dpi, screenCoords, (_guestList.size() == 1 ? STR_FORMAT_NUM_GUESTS_SINGULAR : STR_FORMAT_NUM_GUESTS_PLURAL),
ft);
}
}
@@ -681,7 +681,7 @@ private:
}
auto ft = Formatter();
peep->FormatNameTo(ft);
DrawTextEllipsised(&dpi, { 0, y }, 113, format, ft);
DrawTextEllipsised(dpi, { 0, y }, 113, format, ft);
switch (_selectedView)
{
@@ -696,7 +696,7 @@ private:
// Action
ft = Formatter();
peep->FormatActionTo(ft);
DrawTextEllipsised(&dpi, { 133, y }, 314, format, ft);
DrawTextEllipsised(dpi, { 133, y }, 314, format, ft);
break;
case GuestViewType::Thoughts:
// For each thought
@@ -711,7 +711,7 @@ private:
ft = Formatter();
PeepThoughtSetFormatArgs(&thought, ft);
DrawTextEllipsised(&dpi, { 118, y }, 329, format, ft, { FontStyle::Small });
DrawTextEllipsised(dpi, { 118, y }, 329, format, ft, { FontStyle::Small });
break;
}
break;
@@ -756,18 +756,18 @@ private:
// Draw small font if displaying guests
if (_selectedView == GuestViewType::Thoughts)
{
DrawTextEllipsised(&dpi, { 0, y }, 414, format, ft, { FontStyle::Small });
DrawTextEllipsised(dpi, { 0, y }, 414, format, ft, { FontStyle::Small });
}
else
{
DrawTextEllipsised(&dpi, { 0, y }, 414, format, ft);
DrawTextEllipsised(dpi, { 0, y }, 414, format, ft);
}
// Draw guest count
ft = Formatter();
ft.Add<StringId>(STR_GUESTS_COUNT_COMMA_SEP);
ft.Add<uint32_t>(group.NumGuests);
DrawTextBasic(&dpi, { 326, y }, format, ft, { TextAlignment::RIGHT });
DrawTextBasic(dpi, { 326, y }, format, ft, { TextAlignment::RIGHT });
}
y += SUMMARISED_GUEST_ROW_HEIGHT;
index++;
+19 -19
View File
@@ -175,7 +175,7 @@ public:
{
// Scenery not available
DrawTextEllipsised(
&dpi, screenPos, 308, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE });
dpi, screenPos, 308, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE });
screenPos.y -= LIST_ROW_HEIGHT;
}
}
@@ -189,7 +189,7 @@ public:
auto trackName = _trackName.c_str();
auto ft = Formatter();
ft.Add<const char*>(trackName);
DrawTextBasic(&dpi, screenPos - ScreenCoordsXY{ 1, 0 }, STR_TRACK_DESIGN_NAME, ft);
DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 1, 0 }, STR_TRACK_DESIGN_NAME, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
@@ -210,7 +210,7 @@ public:
ft.Add<StringId>(GetRideTypeDescriptor(td6->type).Naming.Name);
}
DrawTextBasic(&dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft);
screenPos.y += LIST_ROW_HEIGHT + 4;
}
@@ -219,21 +219,21 @@ public:
fixed32_2dp rating = td6->excitement * 10;
auto ft = Formatter();
ft.Add<int32_t>(rating);
DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
{
fixed32_2dp rating = td6->intensity * 10;
auto ft = Formatter();
ft.Add<int32_t>(rating);
DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
{
fixed32_2dp rating = td6->nausea * 10;
auto ft = Formatter();
ft.Add<int32_t>(rating);
DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft);
screenPos.y += LIST_ROW_HEIGHT + 4;
}
@@ -246,7 +246,7 @@ public:
uint16_t holes = td6->holes & 0x1F;
auto ft = Formatter();
ft.Add<uint16_t>(holes);
DrawTextBasic(&dpi, screenPos, STR_HOLES, ft);
DrawTextBasic(dpi, screenPos, STR_HOLES, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
else
@@ -256,7 +256,7 @@ public:
uint16_t speed = ((td6->max_speed << 16) * 9) >> 18;
auto ft = Formatter();
ft.Add<uint16_t>(speed);
DrawTextBasic(&dpi, screenPos, STR_MAX_SPEED, ft);
DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
// Average speed
@@ -264,7 +264,7 @@ public:
uint16_t speed = ((td6->average_speed << 16) * 9) >> 18;
auto ft = Formatter();
ft.Add<uint16_t>(speed);
DrawTextBasic(&dpi, screenPos, STR_AVERAGE_SPEED, ft);
DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
}
@@ -273,7 +273,7 @@ public:
auto ft = Formatter();
ft.Add<StringId>(STR_RIDE_LENGTH_ENTRY);
ft.Add<uint16_t>(td6->ride_length);
DrawTextEllipsised(&dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft);
DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
@@ -284,7 +284,7 @@ public:
int32_t gForces = td6->max_positive_vertical_g * 32;
auto ft = Formatter();
ft.Add<int32_t>(gForces);
DrawTextBasic(&dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft);
DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
// Maximum negative vertical Gs
@@ -292,7 +292,7 @@ public:
int32_t gForces = td6->max_negative_vertical_g * 32;
auto ft = Formatter();
ft.Add<int32_t>(gForces);
DrawTextBasic(&dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft);
DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
// Maximum lateral Gs
@@ -300,7 +300,7 @@ public:
int32_t gForces = td6->max_lateral_g * 32;
auto ft = Formatter();
ft.Add<int32_t>(gForces);
DrawTextBasic(&dpi, screenPos, STR_MAX_LATERAL_G, ft);
DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
if (td6->total_air_time != 0)
@@ -309,7 +309,7 @@ public:
int32_t airTime = td6->total_air_time * 25;
auto ft = Formatter();
ft.Add<int32_t>(airTime);
DrawTextBasic(&dpi, screenPos, STR_TOTAL_AIR_TIME, ft);
DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
}
@@ -320,11 +320,11 @@ public:
uint16_t drops = td6->drops & 0x3F;
auto ft = Formatter();
ft.Add<uint16_t>(drops);
DrawTextBasic(&dpi, screenPos, STR_DROPS, ft);
DrawTextBasic(dpi, screenPos, STR_DROPS, ft);
screenPos.y += LIST_ROW_HEIGHT;
// Drop height is multiplied by 0.75
DrawTextBasic(&dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft);
DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
@@ -336,7 +336,7 @@ public:
// Inversions
auto ft = Formatter();
ft.Add<uint16_t>(inversions);
DrawTextBasic(&dpi, screenPos, STR_INVERSIONS, ft);
DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
}
@@ -348,7 +348,7 @@ public:
auto ft = Formatter();
ft.Add<uint16_t>(td6->space_required_x);
ft.Add<uint16_t>(td6->space_required_y);
DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
@@ -356,7 +356,7 @@ public:
{
auto ft = Formatter();
ft.Add<money64>(td6->cost);
DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft);
}
}
+4 -4
View File
@@ -246,7 +246,7 @@ public:
auto ft = Formatter();
ft.Add<uint16_t>(gLandToolSize);
screenCoords = { windowPos.x + previewWidget->midX(), windowPos.y + previewWidget->midY() };
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
}
else if (gLandMountainMode)
{
@@ -266,7 +266,7 @@ public:
{
auto ft = Formatter();
ft.Add<money64>(gLandToolRaiseCost);
DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE });
}
screenCoords.y += 10;
@@ -275,7 +275,7 @@ public:
{
auto ft = Formatter();
ft.Add<money64>(gLandToolLowerCost);
DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE });
}
screenCoords.y += 50;
@@ -300,7 +300,7 @@ public:
{
auto ft = Formatter();
ft.Add<money64>(price);
DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
}
}
}
+2 -2
View File
@@ -221,7 +221,7 @@ public:
{
auto ft = Formatter();
ft.Add<uint16_t>(gLandToolSize);
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
}
// Draw cost amount
@@ -231,7 +231,7 @@ public:
ft.Add<money64>(_landRightsCost);
screenCoords = { window_land_rights_widgets[WIDX_PREVIEW].midX() + windowPos.x,
window_land_rights_widgets[WIDX_PREVIEW].bottom + windowPos.y + 32 };
DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
}
}
+8 -8
View File
@@ -756,7 +756,7 @@ public:
const auto* normalisedPathC = normalisedPath.c_str();
auto ft = Formatter();
ft.Add<const char*>(normalisedPathC);
DrawTextEllipsised(&dpi, windowPos + ScreenCoordsXY{ 4, 20 }, width - 8, STR_STRING, ft);
DrawTextEllipsised(dpi, windowPos + ScreenCoordsXY{ 4, 20 }, width - 8, STR_STRING, ft);
// Name button text
StringId id = STR_NONE;
@@ -770,7 +770,7 @@ public:
ft = Formatter();
ft.Add<StringId>(id);
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, ft,
dpi, windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, ft,
{ COLOUR_GREY });
// Date button text
@@ -785,7 +785,7 @@ public:
ft = Formatter();
ft.Add<StringId>(id);
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, ft,
dpi, windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, ft,
{ COLOUR_GREY });
}
@@ -1002,7 +1002,7 @@ public:
{
auto ft = Formatter();
ft.Add<StringId>(STR_RIGHTGUILLEMET);
DrawTextBasic(&dpi, { 0, y }, stringId, ft);
DrawTextBasic(dpi, { 0, y }, stringId, ft);
}
// Print filename
@@ -1010,7 +1010,7 @@ public:
ft.Add<StringId>(STR_STRING);
ft.Add<char*>(_listItems[i].name.c_str());
int32_t max_file_width = widgets[WIDX_SORT_NAME].width() - 10;
DrawTextEllipsised(&dpi, { 10, y }, max_file_width, stringId, ft);
DrawTextEllipsised(dpi, { 10, y }, max_file_width, stringId, ft);
// Print formatted modified date, if this is a file
if (_listItems[i].type == TYPE_FILE)
@@ -1019,12 +1019,12 @@ public:
ft.Add<StringId>(STR_STRING);
ft.Add<char*>(_listItems[i].date_formatted.c_str());
DrawTextEllipsised(
&dpi, { dateAnchor - DATE_TIME_GAP, y }, maxDateWidth, stringId, ft, { TextAlignment::RIGHT });
dpi, { dateAnchor - DATE_TIME_GAP, y }, maxDateWidth, stringId, ft, { TextAlignment::RIGHT });
ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<char*>(_listItems[i].time_formatted.c_str());
DrawTextEllipsised(&dpi, { dateAnchor + DATE_TIME_GAP, y }, maxTimeWidth, stringId, ft);
DrawTextEllipsised(dpi, { dateAnchor + DATE_TIME_GAP, y }, maxTimeWidth, stringId, ft);
}
}
}
@@ -1179,7 +1179,7 @@ static void WindowOverwritePromptPaint(WindowBase* w, DrawPixelInfo* dpi)
ft.Add<char*>(_window_overwrite_prompt_name);
ScreenCoordsXY stringCoords(w->windowPos.x + w->width / 2, w->windowPos.y + (w->height / 2) - 3);
DrawTextWrapped(dpi, stringCoords, w->width - 4, STR_FILEBROWSER_OVERWRITE_PROMPT, ft, { TextAlignment::CENTRE });
DrawTextWrapped(*dpi, stringCoords, w->width - 4, STR_FILEBROWSER_OVERWRITE_PROMPT, ft, { TextAlignment::CENTRE });
}
#pragma endregion
+3 -3
View File
@@ -865,7 +865,7 @@ public:
{
auto ft = Formatter();
ft.Add<uint16_t>(_landRightsToolSize);
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
}
screenCoords.y = windowPos.y + window_map_widgets[WIDX_LAND_TOOL].bottom + 5;
@@ -896,7 +896,7 @@ public:
GfxFillRect(
&dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } },
RideKeyColours[i]);
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, _mapLabels[i], {});
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, _mapLabels[i], {});
screenCoords.y += LIST_ROW_HEIGHT;
if (i == 3)
{
@@ -908,7 +908,7 @@ public:
else if (!WidgetIsActiveTool(*this, WIDX_SET_LAND_RIGHTS))
{
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP_SIZE_SPINNER_Y].top + 1 }, STR_MAP_SIZE, {},
dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP_SIZE_SPINNER_Y].top + 1 }, STR_MAP_SIZE, {},
{ colours[1] });
}
}
+31 -28
View File
@@ -740,26 +740,27 @@ static void WindowMapgenBasePaint(WindowBase* w, DrawPixelInfo* dpi)
const auto textColour = w->colours[1];
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, { textColour });
*dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, { textColour });
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_BASE_HEIGHT].top + 1 }, STR_BASE_HEIGHT_LABEL, {},
*dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_BASE_HEIGHT].top + 1 }, STR_BASE_HEIGHT_LABEL, {},
{ textColour });
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {},
*dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {},
{ textColour });
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_FLOOR_TEXTURE].top + 1 }, STR_TERRAIN_LABEL, {}, { textColour });
*dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_FLOOR_TEXTURE].top + 1 }, STR_TERRAIN_LABEL, {},
{ textColour });
auto ft = Formatter();
ft.Add<uint16_t>((_baseHeight - 12) / 2);
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, ft, { w->colours[1] });
ft = Formatter();
ft.Add<uint16_t>((_waterLevel - 12) / 2);
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, ft, { w->colours[1] });
}
@@ -1054,57 +1055,58 @@ static void WindowMapgenSimplexPaint(WindowBase* w, DrawPixelInfo* dpi)
const uint8_t textColour = w->colours[1];
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {},
*dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {},
{ textColour });
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {},
*dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {},
{ textColour });
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 },
*dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 },
STR_MAPGEN_SIMPLEX_NOISE_BASE_FREQUENCY, {}, { textColour });
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_OCTAVES, {},
*dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_OCTAVES,
{}, { textColour });
DrawTextBasic(
*dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {},
{ textColour });
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, { textColour });
DrawTextBasic(
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 });
auto ft = Formatter();
ft.Add<uint16_t>(_simplex_low);
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, ft, { textColour });
ft = Formatter();
ft.Add<uint16_t>(_simplex_high);
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, ft, { textColour });
ft = Formatter();
ft.Add<uint16_t>(_simplex_base_freq);
DrawTextBasic(
dpi,
*dpi,
w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_BASE_FREQ].left + 1, w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 },
STR_WINDOW_COLOUR_2_COMMA2DP32, ft, { textColour });
ft = Formatter();
ft.Add<uint16_t>(_simplex_octaves);
DrawTextBasic(
dpi,
*dpi,
w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_OCTAVES].left + 1, w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1 },
STR_COMMA16, ft, { textColour });
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 });
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_PLACE_TREES_CHECKBOX].top + 1 },
*dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_PLACE_TREES_CHECKBOX].top + 1 },
STR_MAPGEN_OPTION_PLACE_TREES, {}, { textColour });
ft = Formatter();
ft.Add<uint16_t>((_waterLevel - 12) / 2);
DrawTextBasic(
dpi,
*dpi,
w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_WATER_LEVEL].left + 1, w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 },
STR_COMMA16, ft, { textColour });
@@ -1261,13 +1263,13 @@ static void WindowMapgenHeightmapPaint(WindowBase* w, DrawPixelInfo* dpi)
// Smooth strength label and value
const colour_t strengthColour = _heightmapSmoothMap ? enabledColour : disabledColour;
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 });
auto ft = Formatter();
ft.Add<uint16_t>(_heightmapSmoothStrength);
DrawTextBasic(
dpi,
*dpi,
w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_STRENGTH].left + 1, w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 },
STR_COMMA16, ft, { strengthColour });
@@ -1275,35 +1277,36 @@ static void WindowMapgenHeightmapPaint(WindowBase* w, DrawPixelInfo* dpi)
// Low label and value
const colour_t labelColour = _heightmapLoaded ? enabledColour : disabledColour;
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 });
ft = Formatter();
ft.Add<uint16_t>(_heightmapLow);
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, ft, { labelColour });
// High label and value
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 });
ft = Formatter();
ft.Add<uint16_t>(_heightmapHigh);
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, ft, { labelColour });
// Water level label and value
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 });
ft = Formatter();
ft.Add<uint16_t>(_waterLevel);
DrawTextBasic(
dpi,
*dpi,
w->windowPos
+ ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].left + 1, w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 },
STR_COMMA16, ft, { labelColour });
+1 -1
View File
@@ -147,5 +147,5 @@ static void WindowMapTooltipPaint(WindowBase* w, DrawPixelInfo* dpi)
}
ScreenCoordsXY stringCoords(w->windowPos.x + (w->width / 2), w->windowPos.y + (w->height / 2));
DrawTextWrapped(dpi, stringCoords, w->width, STR_MAP_TOOLTIP_STRINGID, _mapTooltipArgs, { TextAlignment::CENTRE });
DrawTextWrapped(*dpi, stringCoords, w->width, STR_MAP_TOOLTIP_STRINGID, _mapTooltipArgs, { TextAlignment::CENTRE });
}
+15 -15
View File
@@ -412,7 +412,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
{
auto ft = Formatter();
ft.Add<const char*>(name.c_str());
screenCoords.y += DrawTextWrapped(dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] });
screenCoords.y += DrawTextWrapped(*dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] });
screenCoords.y += LIST_ROW_HEIGHT / 2;
}
@@ -421,7 +421,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
{
auto ft = Formatter();
ft.Add<const char*>(description.c_str());
screenCoords.y += DrawTextWrapped(dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] });
screenCoords.y += DrawTextWrapped(*dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] });
screenCoords.y += LIST_ROW_HEIGHT / 2;
}
@@ -430,7 +430,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
{
auto ft = Formatter();
ft.Add<const char*>(providerName.c_str());
DrawTextBasic(dpi, screenCoords, STR_PROVIDER_NAME, ft);
DrawTextBasic(*dpi, screenCoords, STR_PROVIDER_NAME, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -439,7 +439,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
{
auto ft = Formatter();
ft.Add<const char*>(providerEmail.c_str());
DrawTextBasic(dpi, screenCoords, STR_PROVIDER_EMAIL, ft);
DrawTextBasic(*dpi, screenCoords, STR_PROVIDER_EMAIL, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -448,7 +448,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
{
auto ft = Formatter();
ft.Add<const char*>(providerWebsite.c_str());
DrawTextBasic(dpi, screenCoords, STR_PROVIDER_WEBSITE, ft);
DrawTextBasic(*dpi, screenCoords, STR_PROVIDER_WEBSITE, ft);
}
}
}
@@ -569,7 +569,7 @@ static void WindowMultiplayerPlayersPaint(WindowBase* w, DrawPixelInfo* dpi)
auto screenCoords = w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 };
auto ft = Formatter();
ft.Add<uint16_t>(w->no_list_items);
DrawTextBasic(dpi, screenCoords, stringId, ft, { w->colours[2] });
DrawTextBasic(*dpi, screenCoords, stringId, ft, { w->colours[2] });
}
static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex)
@@ -617,7 +617,7 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp
}
screenCoords.x = 0;
GfxClipString(_buffer.data(), 230, FontStyle::Medium);
GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour });
GfxDrawString(*dpi, screenCoords, _buffer.c_str(), { colour });
// Draw group name
_buffer.resize(0);
@@ -628,7 +628,7 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp
screenCoords.x = 173;
_buffer += NetworkGetGroupName(group);
GfxClipString(_buffer.data(), 80, FontStyle::Medium);
GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour });
GfxDrawString(*dpi, screenCoords, _buffer.c_str(), { colour });
}
// Draw last action
@@ -642,7 +642,7 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp
{
ft.Add<StringId>(STR_ACTION_NA);
}
DrawTextEllipsised(dpi, { 256, screenCoords.y }, 100, STR_BLACK_STRING, ft);
DrawTextEllipsised(*dpi, { 256, screenCoords.y }, 100, STR_BLACK_STRING, ft);
// Draw ping
_buffer.resize(0);
@@ -665,7 +665,7 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp
_buffer += pingBuffer;
screenCoords.x = 356;
GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour });
GfxDrawString(*dpi, screenCoords, _buffer.c_str(), { colour });
}
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
listPosition++;
@@ -858,7 +858,7 @@ static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo* dpi)
auto ft = Formatter();
ft.Add<const char*>(_buffer.c_str());
DrawTextEllipsised(
dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
*dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
{ TextAlignment::CENTRE });
}
@@ -866,7 +866,7 @@ static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo* dpi)
+ ScreenCoordsXY{ window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].left + 4,
window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].top + 4 };
DrawTextBasic(dpi, screenPos, STR_DEFAULT_GROUP, {}, { w->colours[2] });
DrawTextBasic(*dpi, screenPos, STR_DEFAULT_GROUP, {}, { w->colours[2] });
screenPos.y += 20;
@@ -883,7 +883,7 @@ static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo* dpi)
auto ft = Formatter();
ft.Add<const char*>(_buffer.c_str());
DrawTextEllipsised(
dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
*dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
{ TextAlignment::CENTRE });
}
}
@@ -916,14 +916,14 @@ static void WindowMultiplayerGroupsScrollpaint(WindowBase* w, DrawPixelInfo* dpi
if (NetworkCanPerformAction(groupindex, static_cast<NetworkPermission>(i)))
{
screenCoords.x = 0;
GfxDrawString(dpi, screenCoords, u8"{WINDOW_COLOUR_2}✓", {});
GfxDrawString(*dpi, screenCoords, u8"{WINDOW_COLOUR_2}✓", {});
}
}
// Draw action name
auto ft = Formatter();
ft.Add<uint16_t>(NetworkGetActionNameStringID(i));
DrawTextBasic(dpi, { 10, screenCoords.y }, STR_WINDOW_COLOUR_2_STRINGID, ft);
DrawTextBasic(*dpi, { 10, screenCoords.y }, STR_WINDOW_COLOUR_2_STRINGID, ft);
}
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
}
+1 -1
View File
@@ -106,7 +106,7 @@ public:
GfxClipString(_buffer.data(), widgets[WIDX_BACKGROUND].right - 50, FontStyle::Medium);
ScreenCoordsXY screenCoords(windowPos.x + (width / 2), windowPos.y + (height / 2));
screenCoords.x -= GfxGetStringWidth(_buffer, FontStyle::Medium) / 2;
GfxDrawString(&dpi, screenCoords, _buffer.c_str());
GfxDrawString(dpi, screenCoords, _buffer.c_str());
}
void SetCloseCallBack(close_callback onClose)
+3 -3
View File
@@ -353,7 +353,7 @@ public:
auto ft = Formatter();
ft.Add<int16_t>(campaign.no_weeks);
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, ft, { colours[0] });
screenCoords = windowPos + ScreenCoordsXY{ 14, 60 };
@@ -361,13 +361,13 @@ public:
// Price per week
ft = Formatter();
ft.Add<money64>(AdvertisingCampaignPricePerWeek[campaign.campaign_type]);
DrawTextBasic(&dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, ft);
DrawTextBasic(dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, ft);
screenCoords.y += 13;
// Total price
ft = Formatter();
ft.Add<money64>(AdvertisingCampaignPricePerWeek[campaign.campaign_type] * campaign.no_weeks);
DrawTextBasic(&dpi, screenCoords, STR_MARKETING_TOTAL_COST, ft);
DrawTextBasic(dpi, screenCoords, STR_MARKETING_TOTAL_COST, ft);
}
};
+5 -5
View File
@@ -928,7 +928,7 @@ private:
// Ride name and description
ft.Add<StringId>(rideNaming.Name);
ft.Add<StringId>(rideNaming.Description);
DrawTextWrapped(&dpi, screenPos, textWidth, STR_NEW_RIDE_NAME_AND_DESCRIPTION, ft);
DrawTextWrapped(dpi, screenPos, textWidth, STR_NEW_RIDE_NAME_AND_DESCRIPTION, ft);
if (!_vehicleAvailability.empty())
{
@@ -936,13 +936,13 @@ private:
{
ft = Formatter();
ft.Add<StringId>(rideEntry->naming.Name);
DrawTextEllipsised(&dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_NEW_RIDE_VEHICLE_NAME, ft);
DrawTextEllipsised(dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_NEW_RIDE_VEHICLE_NAME, ft);
}
else
{
ft = Formatter();
ft.Add<const utf8*>(_vehicleAvailability.c_str());
DrawTextEllipsised(&dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_AVAILABLE_VEHICLES, ft);
DrawTextEllipsised(dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_AVAILABLE_VEHICLES, ft);
}
}
@@ -950,7 +950,7 @@ private:
auto designCountStringId = GetDesignsAvailableStringId(count);
ft = Formatter();
ft.Add<int32_t>(count);
DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ 0, 51 }, designCountStringId, ft);
DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ 0, 51 }, designCountStringId, ft);
// Price
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
@@ -969,7 +969,7 @@ private:
ft = Formatter();
ft.Add<money64>(price);
DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ textWidth, 51 }, stringId, ft, { TextAlignment::RIGHT });
DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ textWidth, 51 }, stringId, ft, { TextAlignment::RIGHT });
}
}
+2 -2
View File
@@ -199,13 +199,13 @@ public:
auto ft = Formatter();
ft.Add<StringId>(DateDayNames[newsItem.Day - 1]);
ft.Add<StringId>(DateGameMonthNames[DateGetMonth(newsItem.MonthYear)]);
DrawTextBasic(&dpi, { 2, y }, STR_NEWS_DATE_FORMAT, ft, { COLOUR_WHITE, FontStyle::Small });
DrawTextBasic(dpi, { 2, y }, STR_NEWS_DATE_FORMAT, ft, { COLOUR_WHITE, FontStyle::Small });
}
// Item text
{
auto ft = Formatter();
ft.Add<const char*>(newsItem.Text.c_str());
DrawTextWrapped(&dpi, { 2, y + lineHeight }, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, ft, { FontStyle::Small });
DrawTextWrapped(dpi, { 2, y + lineHeight }, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, ft, { FontStyle::Small });
}
// Subject button
if ((newsItem.TypeHasSubject()) && !(newsItem.HasButton()))
+5 -5
View File
@@ -492,13 +492,13 @@ public:
// Draw explanatory message
auto ft = Formatter();
ft.Add<StringId>(STR_OBJECT_ERROR_WINDOW_EXPLANATION);
DrawTextWrapped(&dpi, windowPos + ScreenCoordsXY{ 5, 18 }, WW - 10, STR_BLACK_STRING, ft);
DrawTextWrapped(dpi, windowPos + ScreenCoordsXY{ 5, 18 }, WW - 10, STR_BLACK_STRING, ft);
// Draw file name
ft = Formatter();
ft.Add<StringId>(STR_OBJECT_ERROR_WINDOW_FILE);
ft.Add<utf8*>(_filePath.c_str());
DrawTextEllipsised(&dpi, { windowPos.x + 5, windowPos.y + 43 }, WW - 5, STR_BLACK_STRING, ft);
DrawTextEllipsised(dpi, { windowPos.x + 5, windowPos.y + 43 }, WW - 5, STR_BLACK_STRING, ft);
}
void OnScrollDraw(const int32_t scrollIndex, DrawPixelInfo& dpi) override
@@ -536,18 +536,18 @@ public:
auto name = entry.GetName();
char buffer[256];
String::Set(buffer, sizeof(buffer), name.data(), name.size());
GfxDrawString(&dpi, screenCoords, buffer, { COLOUR_DARK_GREEN });
GfxDrawString(dpi, screenCoords, buffer, { COLOUR_DARK_GREEN });
if (entry.Generation == ObjectGeneration::DAT)
{
// ... source game ...
const auto sourceStringId = ObjectManagerGetSourceGameString(entry.Entry.GetSourceGame());
DrawTextBasic(&dpi, { SOURCE_COL_LEFT - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN });
DrawTextBasic(dpi, { SOURCE_COL_LEFT - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN });
}
// ... and type
const auto type = GetStringFromObjectType(entry.GetType());
DrawTextBasic(&dpi, { TYPE_COL_LEFT - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN });
DrawTextBasic(dpi, { TYPE_COL_LEFT - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN });
}
}
+3 -3
View File
@@ -914,7 +914,7 @@ private:
auto ft = Formatter();
ft.Add<int32_t>(static_cast<int32_t>(gConfigGeneral.WindowScale * 100));
DrawTextBasic(
dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SCALE].left + 1, widgets[WIDX_SCALE].top + 1 },
*dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SCALE].left + 1, widgets[WIDX_SCALE].top + 1 },
STR_WINDOW_COLOUR_2_COMMA2DP32, ft, { colours[1] });
}
#pragma endregion
@@ -2002,7 +2002,7 @@ private:
auto ft = Formatter();
ft.Add<int32_t>(static_cast<int32_t>(gConfigGeneral.AutosaveAmount));
DrawTextBasic(
dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 },
*dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 },
STR_WINDOW_COLOUR_2_COMMA16, ft, { colours[1] });
const auto normalisedPath = Platform::StrDecompToPrecomp(gConfigGeneral.RCT1Path);
@@ -2017,7 +2017,7 @@ private:
uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0;
ScreenCoordsXY screenCoords = { windowPos.x + pathWidget.left + 1,
windowPos.y + pathWidget.top + static_cast<int32_t>(padding) };
DrawTextEllipsised(dpi, screenCoords, 277, STR_STRING, ft, { colours[1] });
DrawTextEllipsised(*dpi, screenCoords, 277, STR_STRING, ft, { colours[1] });
}
OpenRCT2String AdvancedTooltip(WidgetIndex widgetIndex, StringId fallback)
+19 -21
View File
@@ -604,7 +604,7 @@ private:
auto* labelWidget = &widgets[WIDX_STATUS];
DrawTextEllipsised(
&dpi, windowPos + ScreenCoordsXY{ labelWidget->midX(), labelWidget->top }, labelWidget->width(), STR_BLACK_STRING,
dpi, windowPos + ScreenCoordsXY{ labelWidget->midX(), labelWidget->top }, labelWidget->width(), STR_BLACK_STRING,
ft, { TextAlignment::CENTRE });
}
@@ -696,7 +696,7 @@ private:
// Current value
auto ft = Formatter();
ft.Add<uint16_t>(gParkRating);
DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft);
DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft);
// Graph border
GfxFillRectInset(
@@ -713,8 +713,7 @@ private:
ft = Formatter();
ft.Add<uint32_t>(axisValue);
DrawTextBasic(
&dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft,
{ FontStyle::Small, TextAlignment::RIGHT });
dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, { FontStyle::Small, TextAlignment::RIGHT });
GfxFillRectInset(
&dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2],
INSET_RECT_FLAG_BORDER_INSET);
@@ -769,7 +768,7 @@ private:
// Current value
auto ft = Formatter();
ft.Add<uint32_t>(gNumGuestsInPark);
DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft);
DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft);
// Graph border
GfxFillRectInset(
@@ -786,8 +785,7 @@ private:
ft = Formatter();
ft.Add<uint32_t>(axisValue);
DrawTextBasic(
&dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft,
{ FontStyle::Small, TextAlignment::RIGHT });
dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, { FontStyle::Small, TextAlignment::RIGHT });
GfxFillRectInset(
&dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2],
INSET_RECT_FLAG_BORDER_INSET);
@@ -897,14 +895,14 @@ private:
+ ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 30 };
auto ft = Formatter();
ft.Add<money64>(gTotalIncomeFromAdmissions);
DrawTextBasic(&dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft);
DrawTextBasic(dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft);
money64 parkEntranceFee = ParkGetEntranceFee();
auto stringId = parkEntranceFee == 0 ? STR_FREE : STR_BOTTOM_TOOLBAR_CASH;
screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PRICE].left + 1, widgets[WIDX_PRICE].top + 1 };
ft = Formatter();
ft.Add<money64>(parkEntranceFee);
DrawTextBasic(&dpi, screenCoords, stringId, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, stringId, ft, { colours[1] });
}
#pragma endregion
@@ -970,7 +968,7 @@ private:
}
auto ft = Formatter();
ft.Add<uint32_t>(parkSize);
DrawTextBasic(&dpi, screenCoords, stringIndex, ft);
DrawTextBasic(dpi, screenCoords, stringIndex, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Draw number of rides / attractions
@@ -978,7 +976,7 @@ private:
{
ft = Formatter();
ft.Add<uint32_t>(_numberOfRides);
DrawTextBasic(&dpi, screenCoords, STR_NUMBER_OF_RIDES_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_NUMBER_OF_RIDES_LABEL, ft);
}
screenCoords.y += LIST_ROW_HEIGHT;
@@ -987,19 +985,19 @@ private:
{
ft = Formatter();
ft.Add<uint32_t>(_numberOfStaff);
DrawTextBasic(&dpi, screenCoords, STR_STAFF_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_STAFF_LABEL, ft);
}
screenCoords.y += LIST_ROW_HEIGHT;
// Draw number of guests in park
ft = Formatter();
ft.Add<uint32_t>(gNumGuestsInPark);
DrawTextBasic(&dpi, screenCoords, STR_GUESTS_IN_PARK_LABEL, ft);
DrawTextBasic(dpi, screenCoords, STR_GUESTS_IN_PARK_LABEL, ft);
screenCoords.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<uint32_t>(gTotalAdmissions);
DrawTextBasic(&dpi, screenCoords, STR_TOTAL_ADMISSIONS, ft);
DrawTextBasic(dpi, screenCoords, STR_TOTAL_ADMISSIONS, ft);
}
#pragma endregion
@@ -1072,11 +1070,11 @@ private:
auto ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(gScenarioDetails.c_str());
screenCoords.y += DrawTextWrapped(&dpi, screenCoords, 222, STR_BLACK_STRING, ft);
screenCoords.y += DrawTextWrapped(dpi, screenCoords, 222, STR_BLACK_STRING, ft);
screenCoords.y += 5;
// Your objective:
DrawTextBasic(&dpi, screenCoords, STR_OBJECTIVE_LABEL);
DrawTextBasic(dpi, screenCoords, STR_OBJECTIVE_LABEL);
screenCoords.y += LIST_ROW_HEIGHT;
// Objective
@@ -1101,7 +1099,7 @@ private:
ft.Add<money64>(gScenarioObjective.Currency);
}
screenCoords.y += DrawTextWrapped(&dpi, screenCoords, 221, ObjectiveNames[gScenarioObjective.Type], ft);
screenCoords.y += DrawTextWrapped(dpi, screenCoords, 221, ObjectiveNames[gScenarioObjective.Type], ft);
screenCoords.y += 5;
// Objective outcome
@@ -1110,14 +1108,14 @@ private:
if (gScenarioCompletedCompanyValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE)
{
// Objective failed
DrawTextWrapped(&dpi, screenCoords, 222, STR_OBJECTIVE_FAILED);
DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_FAILED);
}
else
{
// Objective completed
ft = Formatter();
ft.Add<money64>(gScenarioCompletedCompanyValue);
DrawTextWrapped(&dpi, screenCoords, 222, STR_OBJECTIVE_ACHIEVED, ft);
DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_ACHIEVED, ft);
}
}
}
@@ -1162,13 +1160,13 @@ private:
for (const auto& award : GetAwards())
{
GfxDrawSprite(&dpi, ImageId(_parkAwards[EnumValue(award.Type)].sprite), screenCoords);
DrawTextWrapped(&dpi, screenCoords + ScreenCoordsXY{ 34, 6 }, 180, _parkAwards[EnumValue(award.Type)].text);
DrawTextWrapped(dpi, screenCoords + ScreenCoordsXY{ 34, 6 }, 180, _parkAwards[EnumValue(award.Type)].text);
screenCoords.y += 32;
}
if (GetAwards().empty())
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 6, 6 }, STR_NO_RECENT_AWARDS);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 6, 6 }, STR_NO_RECENT_AWARDS);
}
#pragma endregion
+1 -1
View File
@@ -142,7 +142,7 @@ public:
windowPos.y + PatrolAreaWidgets[WIDX_PREVIEW].midY() };
auto ft = Formatter();
ft.Add<uint16_t>(gLandToolSize);
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
}
}
+6 -6
View File
@@ -324,7 +324,7 @@ void WindowPlayerOverviewPaint(WindowBase* w, DrawPixelInfo* dpi)
ft.Add<const char*>(_buffer.c_str());
DrawTextEllipsised(
dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
*dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
{ TextAlignment::CENTRE });
}
@@ -333,10 +333,10 @@ void WindowPlayerOverviewPaint(WindowBase* w, DrawPixelInfo* dpi)
auto ft = Formatter();
ft.Add<StringId>(STR_PING);
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
char ping[64];
snprintf(ping, 64, "%d ms", NetworkGetPlayerPing(player));
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(30, 0), ping, { w->colours[2] });
GfxDrawString(*dpi, screenCoords + ScreenCoordsXY(30, 0), ping, { w->colours[2] });
// Draw last action
screenCoords = w->windowPos + ScreenCoordsXY{ w->width / 2, w->height - 13 };
@@ -351,7 +351,7 @@ void WindowPlayerOverviewPaint(WindowBase* w, DrawPixelInfo* dpi)
{
ft.Add<StringId>(STR_ACTION_NA);
}
DrawTextEllipsised(dpi, screenCoords, width, STR_LAST_ACTION_RAN, ft, { TextAlignment::CENTRE });
DrawTextEllipsised(*dpi, screenCoords, width, STR_LAST_ACTION_RAN, ft, { TextAlignment::CENTRE });
if (w->viewport != nullptr && w->var_492 != -1)
{
@@ -488,13 +488,13 @@ void WindowPlayerStatisticsPaint(WindowBase* w, DrawPixelInfo* dpi)
auto ft = Formatter();
ft.Add<uint32_t>(NetworkGetPlayerCommandsRan(player));
DrawTextBasic(dpi, screenCoords, STR_COMMANDS_RAN, ft);
DrawTextBasic(*dpi, screenCoords, STR_COMMANDS_RAN, ft);
screenCoords.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<uint32_t>(NetworkGetPlayerMoneySpent(player));
DrawTextBasic(dpi, screenCoords, STR_MONEY_SPENT, ft);
DrawTextBasic(*dpi, screenCoords, STR_MONEY_SPENT, ft);
}
static void WindowPlayerSetPage(WindowBase* w, int32_t page)
@@ -86,7 +86,7 @@ public:
ft.Add<money64>(_demolishRideCost / 2);
ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3);
DrawTextWrapped(&dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE });
DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE });
}
}
};
+8 -8
View File
@@ -273,19 +273,19 @@ void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, Widge
// Research type
auto ft = Formatter();
ft.Add<StringId>(STR_RESEARCH_UNKNOWN);
DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft);
DrawTextWrapped(*dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft);
screenCoords.y += 25;
// Progress
ft = Formatter();
ft.Add<StringId>(STR_RESEARCH_COMPLETED_AL);
DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft);
DrawTextWrapped(*dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft);
screenCoords.y += 15;
// Expected
ft = Formatter();
ft.Add<StringId>(STR_RESEARCH_STAGE_UNKNOWN);
DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft);
DrawTextBasic(*dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft);
}
else
{
@@ -322,13 +322,13 @@ void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, Widge
{
ft.Add<StringId>(gResearchNextItem->GetName());
}
DrawTextWrapped(dpi, screenCoords, 296, label, ft);
DrawTextWrapped(*dpi, screenCoords, 296, label, ft);
screenCoords.y += 25;
// Progress
ft = Formatter();
ft.Add<StringId>(ResearchStageNames[gResearchProgressStage]);
DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft);
DrawTextWrapped(*dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft);
screenCoords.y += 15;
// Expected
@@ -344,7 +344,7 @@ void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, Widge
{
ft.Add<StringId>(STR_RESEARCH_STAGE_UNKNOWN);
}
DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft);
DrawTextBasic(*dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft);
}
// Last development
@@ -379,7 +379,7 @@ void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, Widge
}
}
DrawTextWrapped(dpi, screenCoords, 266, lastDevelopmentFormat, ft);
DrawTextWrapped(*dpi, screenCoords, 266, lastDevelopmentFormat, ft);
}
}
@@ -544,7 +544,7 @@ void WindowResearchFundingPagePaint(WindowBase* w, DrawPixelInfo* dpi, WidgetInd
int32_t currentResearchLevel = gResearchFundingLevel;
auto ft = Formatter();
ft.Add<money64>(research_cost_table[currentResearchLevel]);
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, ft);
DrawTextBasic(*dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, ft);
}
#pragma endregion
+52 -52
View File
@@ -2621,7 +2621,7 @@ static void WindowRideMainPaint(WindowBase* w, DrawPixelInfo* dpi)
widget = &window_ride_main_widgets[WIDX_VIEW];
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, { TextAlignment::CENTRE });
// Status
@@ -2629,7 +2629,7 @@ static void WindowRideMainPaint(WindowBase* w, DrawPixelInfo* dpi)
widget = &window_ride_main_widgets[WIDX_STATUS];
StringId rideStatus = WindowRideGetStatus(w, ft);
DrawTextEllipsised(
dpi, w->windowPos + ScreenCoordsXY{ (widget->left + widget->right) / 2, widget->top }, widget->width(), rideStatus, ft,
*dpi, w->windowPos + ScreenCoordsXY{ (widget->left + widget->right) / 2, widget->top }, widget->width(), rideStatus, ft,
{ TextAlignment::CENTRE });
}
@@ -2903,13 +2903,13 @@ static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi)
// Description
auto ft = Formatter();
ft.Add<StringId>(rideEntry->naming.Description);
screenCoords.y += DrawTextWrapped(dpi, screenCoords, 300, STR_BLACK_STRING, ft, { TextAlignment::LEFT });
screenCoords.y += DrawTextWrapped(*dpi, screenCoords, 300, STR_BLACK_STRING, ft, { TextAlignment::LEFT });
screenCoords.y += 2;
// Capacity
ft = Formatter();
ft.Add<StringId>(rideEntry->capacity);
DrawTextBasic(dpi, screenCoords, STR_CAPACITY, ft);
DrawTextBasic(*dpi, screenCoords, STR_CAPACITY, ft);
// Excitement Factor
if (rideEntry->excitement_multiplier != 0)
@@ -2919,7 +2919,7 @@ static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi)
ft = Formatter();
ft.Add<int16_t>(abs(rideEntry->excitement_multiplier));
StringId stringId = rideEntry->excitement_multiplier > 0 ? STR_EXCITEMENT_FACTOR : STR_EXCITEMENT_FACTOR_NEGATIVE;
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
}
// Intensity Factor
@@ -2934,7 +2934,7 @@ static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi)
ft = Formatter();
ft.Add<int16_t>(abs(rideEntry->intensity_multiplier));
StringId stringId = rideEntry->intensity_multiplier > 0 ? STR_INTENSITY_FACTOR : STR_INTENSITY_FACTOR_NEGATIVE;
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
if (lineHeight != 10)
screenCoords.x -= 150;
@@ -2948,7 +2948,7 @@ static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi)
ft = Formatter();
ft.Add<int16_t>(abs(rideEntry->nausea_multiplier));
StringId stringId = rideEntry->nausea_multiplier > 0 ? STR_NAUSEA_FACTOR : STR_NAUSEA_FACTOR_NEGATIVE;
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
}
}
@@ -3743,7 +3743,7 @@ static void WindowRideOperatingPaint(WindowBase* w, DrawPixelInfo* dpi)
auto ft = Formatter();
ft.Add<uint16_t>(ride->num_block_brakes + ride->num_stations);
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, ft, COLOUR_BLACK);
}
}
@@ -4135,7 +4135,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi)
// Inspection label
widget = &window_ride_maintenance_widgets[WIDX_INSPECTION_INTERVAL];
screenCoords = w->windowPos + ScreenCoordsXY{ 4, widget->top + 1 };
DrawTextBasic(dpi, screenCoords, STR_INSPECTION);
DrawTextBasic(*dpi, screenCoords, STR_INSPECTION);
// Reliability
widget = &window_ride_maintenance_widgets[WIDX_PAGE_BACKGROUND];
@@ -4144,7 +4144,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi)
uint16_t reliability = ride->reliability_percentage;
auto ft = Formatter();
ft.Add<uint16_t>(reliability);
DrawTextBasic(dpi, screenCoords, STR_RELIABILITY_LABEL_1757, ft);
DrawTextBasic(*dpi, screenCoords, STR_RELIABILITY_LABEL_1757, ft);
WindowRideMaintenanceDrawBar(
w, dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, std::max<int32_t>(10, reliability), COLOUR_BRIGHT_GREEN);
screenCoords.y += 11;
@@ -4152,7 +4152,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi)
uint16_t downTime = ride->downtime;
ft = Formatter();
ft.Add<uint16_t>(downTime);
DrawTextBasic(dpi, screenCoords, STR_DOWN_TIME_LABEL_1889, ft);
DrawTextBasic(*dpi, screenCoords, STR_DOWN_TIME_LABEL_1889, ft);
WindowRideMaintenanceDrawBar(w, dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, downTime, COLOUR_BRIGHT_RED);
screenCoords.y += 26;
@@ -4167,7 +4167,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi)
ft = Formatter();
ft.Add<uint16_t>(ride->last_inspection);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += 12;
// Last / current breakdown
@@ -4177,7 +4177,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi)
stringId = (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) ? STR_CURRENT_BREAKDOWN : STR_LAST_BREAKDOWN;
ft = Formatter();
ft.Add<StringId>(RideBreakdownReasonNames[ride->breakdown_reason]);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += 12;
// Mechanic status
@@ -4215,7 +4215,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi)
{
if (stringId == STR_CALLING_MECHANIC || stringId == STR_NO_MECHANICS_ARE_HIRED_MESSAGE)
{
DrawTextWrapped(dpi, screenCoords, 280, stringId, {}, { TextAlignment::LEFT });
DrawTextWrapped(*dpi, screenCoords, 280, stringId, {}, { TextAlignment::LEFT });
}
else
{
@@ -4224,7 +4224,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi)
{
ft = Formatter();
staff->FormatNameTo(ft);
DrawTextWrapped(dpi, screenCoords, 280, stringId, ft, { TextAlignment::LEFT });
DrawTextWrapped(*dpi, screenCoords, 280, stringId, ft, { TextAlignment::LEFT });
}
}
}
@@ -4988,7 +4988,7 @@ static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo* dpi)
}
}
DrawTextEllipsised(dpi, { w->windowPos.x + 3, w->windowPos.y + 103 }, 97, STR_STATION_STYLE, {});
DrawTextEllipsised(*dpi, { w->windowPos.x + 3, w->windowPos.y + 103 }, 97, STR_STATION_STYLE, {});
}
}
@@ -5649,7 +5649,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
Widget* widget = &window_ride_measurements_widgets[WIDX_PAGE_BACKGROUND];
ScreenCoordsXY widgetCoords(w->windowPos.x + widget->width() / 2, w->windowPos.y + widget->top + 40);
DrawTextWrapped(dpi, widgetCoords, w->width - 8, STR_CLICK_ITEMS_OF_SCENERY_TO_SELECT, {}, { TextAlignment::CENTRE });
DrawTextWrapped(*dpi, widgetCoords, w->width - 8, STR_CLICK_ITEMS_OF_SCENERY_TO_SELECT, {}, { TextAlignment::CENTRE });
widgetCoords.x = w->windowPos.x + 4;
widgetCoords.y = w->windowPos.y + window_ride_measurements_widgets[WIDX_SELECT_NEARBY_SCENERY].bottom + 17;
@@ -5674,7 +5674,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
ft.Add<uint32_t>(ride->excitement);
ft.Add<StringId>(ratingName);
StringId stringId = !RideHasRatings(*ride) ? STR_EXCITEMENT_RATING_NOT_YET_AVAILABLE : STR_EXCITEMENT_RATING;
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Intensity
@@ -5689,7 +5689,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
else if (ride->intensity >= RIDE_RATING(10, 00))
stringId = STR_INTENSITY_RATING_RED;
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Nausea
@@ -5698,7 +5698,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
ft.Add<uint32_t>(ride->nausea);
ft.Add<StringId>(ratingName);
stringId = !RideHasRatings(*ride) ? STR_NAUSEA_RATING_NOT_YET_AVAILABLE : STR_NAUSEA_RATING;
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += 2 * LIST_ROW_HEIGHT;
// Horizontal rule
@@ -5713,7 +5713,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
// Holes
ft = Formatter();
ft.Add<uint16_t>(ride->holes);
DrawTextBasic(dpi, screenCoords, STR_HOLES, ft);
DrawTextBasic(*dpi, screenCoords, STR_HOLES, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
else
@@ -5721,13 +5721,13 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
// Max speed
ft = Formatter();
ft.Add<int32_t>((ride->max_speed * 9) >> 18);
DrawTextBasic(dpi, screenCoords, STR_MAX_SPEED, ft);
DrawTextBasic(*dpi, screenCoords, STR_MAX_SPEED, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Average speed
ft = Formatter();
ft.Add<int32_t>((ride->average_speed * 9) >> 18);
DrawTextBasic(dpi, screenCoords, STR_AVERAGE_SPEED, ft);
DrawTextBasic(*dpi, screenCoords, STR_AVERAGE_SPEED, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Ride time
@@ -5764,7 +5764,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
ft.Add<uint16_t>(0);
ft.Add<uint16_t>(0);
ft.Add<uint16_t>(0);
DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_TIME, ft);
DrawTextEllipsised(*dpi, screenCoords, 308, STR_RIDE_TIME, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -5803,7 +5803,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
ft.Add<uint16_t>(0);
ft.Add<uint16_t>(0);
ft.Add<uint16_t>(0);
DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_LENGTH, ft);
DrawTextEllipsised(*dpi, screenCoords, 308, STR_RIDE_LENGTH, ft);
screenCoords.y += LIST_ROW_HEIGHT;
@@ -5814,7 +5814,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
ft = Formatter();
ft.Add<fixed16_2dp>(ride->max_positive_vertical_g);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Max. negative vertical G's
@@ -5822,20 +5822,20 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
: STR_MAX_NEGATIVE_VERTICAL_G;
ft = Formatter();
ft.Add<int32_t>(ride->max_negative_vertical_g);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Max lateral G's
stringId = ride->max_lateral_g > RIDE_G_FORCES_RED_LATERAL ? STR_MAX_LATERAL_G_RED : STR_MAX_LATERAL_G;
ft = Formatter();
ft.Add<fixed16_2dp>(ride->max_lateral_g);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Total 'air' time
ft = Formatter();
ft.Add<fixed32_2dp>(ride->total_air_time * 3);
DrawTextBasic(dpi, screenCoords, STR_TOTAL_AIR_TIME, ft);
DrawTextBasic(*dpi, screenCoords, STR_TOTAL_AIR_TIME, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -5845,14 +5845,14 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
auto drops = ride->drops & 0x3F;
ft = Formatter();
ft.Add<uint16_t>(drops);
DrawTextBasic(dpi, screenCoords, STR_DROPS, ft);
DrawTextBasic(*dpi, screenCoords, STR_DROPS, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Highest drop height
auto highestDropHeight = (ride->highest_drop_height * 3) / 4;
ft = Formatter();
ft.Add<int32_t>(highestDropHeight);
DrawTextBasic(dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, ft);
DrawTextBasic(*dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -5863,7 +5863,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
{
ft = Formatter();
ft.Add<uint16_t>(ride->inversions);
DrawTextBasic(dpi, screenCoords, STR_INVERSIONS, ft);
DrawTextBasic(*dpi, screenCoords, STR_INVERSIONS, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
}
@@ -5871,7 +5871,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
}
else
{
DrawTextBasic(dpi, screenCoords, STR_NO_TEST_RESULTS_YET);
DrawTextBasic(*dpi, screenCoords, STR_NO_TEST_RESULTS_YET);
}
}
}
@@ -6154,7 +6154,7 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
// No measurement message
ScreenCoordsXY stringCoords(widget->width() / 2, widget->height() / 2 - 5);
int32_t width = widget->width() - 2;
DrawTextWrapped(dpi, stringCoords, width, message.str, message.args, { TextAlignment::CENTRE });
DrawTextWrapped(*dpi, stringCoords, width, message.str, message.args, { TextAlignment::CENTRE });
return;
}
@@ -6205,7 +6205,7 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
auto ft = Formatter();
ft.Add<int16_t>(scaled_yUnit);
DrawTextBasic(dpi, { w->scrolls[0].h_left + 1, y - 4 }, stringID, ft, { FontStyle::Small });
DrawTextBasic(*dpi, { w->scrolls[0].h_left + 1, y - 4 }, stringID, ft, { FontStyle::Small });
}
// Time marks
@@ -6215,7 +6215,7 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
auto ft = Formatter();
ft.Add<int32_t>(time);
if (x + 80 >= dpi->x)
DrawTextBasic(dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontStyle::Small });
DrawTextBasic(*dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontStyle::Small });
time += 5;
}
@@ -6781,7 +6781,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
auto ft = Formatter();
ft.Add<money64>(profit);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
}
screenCoords.y += 44;
@@ -6805,7 +6805,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
auto ft = Formatter();
ft.Add<money64>(profit);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
}
screenCoords.y += 18;
@@ -6815,7 +6815,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
auto ft = Formatter();
ft.Add<money64>(ride->income_per_hour);
DrawTextBasic(dpi, screenCoords, STR_INCOME_PER_HOUR, ft);
DrawTextBasic(*dpi, screenCoords, STR_INCOME_PER_HOUR, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -6824,7 +6824,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
stringId = ride->upkeep_cost == MONEY16_UNDEFINED ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR;
auto ft = Formatter();
ft.Add<money64>(costPerHour);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Profit per hour
@@ -6832,7 +6832,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
{
ft = Formatter();
ft.Add<money64>(ride->profit);
DrawTextBasic(dpi, screenCoords, STR_PROFIT_PER_HOUR, ft);
DrawTextBasic(*dpi, screenCoords, STR_PROFIT_PER_HOUR, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
screenCoords.y += 5;
@@ -6840,7 +6840,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
// Total profit
ft = Formatter();
ft.Add<money64>(ride->total_profit);
DrawTextBasic(dpi, screenCoords, STR_TOTAL_PROFIT, ft);
DrawTextBasic(*dpi, screenCoords, STR_TOTAL_PROFIT, ft);
}
#pragma endregion
@@ -6992,14 +6992,14 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
{
auto ft = Formatter();
ft.Add<int16_t>(ride->num_riders);
DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, ft);
DrawTextBasic(*dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
// Customers per hour
auto ft = Formatter();
ft.Add<int32_t>(RideCustomersPerHour(*ride));
DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft);
DrawTextBasic(*dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Popularity
@@ -7015,7 +7015,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
}
ft = Formatter();
ft.Add<int16_t>(popularity);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Satisfaction
@@ -7031,7 +7031,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
}
ft = Formatter();
ft.Add<int16_t>(satisfaction);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Queue time
@@ -7041,7 +7041,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
stringId = queueTime == 1 ? STR_QUEUE_TIME_MINUTE : STR_QUEUE_TIME_MINUTES;
ft = Formatter();
ft.Add<int32_t>(queueTime);
screenCoords.y += DrawTextWrapped(dpi, screenCoords, 308, stringId, ft, { TextAlignment::LEFT });
screenCoords.y += DrawTextWrapped(*dpi, screenCoords, 308, stringId, ft, { TextAlignment::LEFT });
screenCoords.y += 5;
}
@@ -7052,7 +7052,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
ft = Formatter();
ft.Add<StringId>(GetShopItemDescriptor(shopItem).Naming.Plural);
ft.Add<uint32_t>(ride->no_primary_items_sold);
DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft);
DrawTextBasic(*dpi, screenCoords, STR_ITEMS_SOLD, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
@@ -7064,14 +7064,14 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
ft = Formatter();
ft.Add<StringId>(GetShopItemDescriptor(shopItem).Naming.Plural);
ft.Add<uint32_t>(ride->no_secondary_items_sold);
DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft);
DrawTextBasic(*dpi, screenCoords, STR_ITEMS_SOLD, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
// Total customers
ft = Formatter();
ft.Add<uint32_t>(ride->total_customers);
DrawTextBasic(dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft);
DrawTextBasic(*dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft);
screenCoords.y += LIST_ROW_HEIGHT;
// Guests favourite
@@ -7080,7 +7080,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
ft = Formatter();
ft.Add<uint16_t>(ride->guests_favourite);
stringId = ride->guests_favourite == 1 ? STR_FAVOURITE_RIDE_OF_GUEST : STR_FAVOURITE_RIDE_OF_GUESTS;
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
screenCoords.y += 2;
@@ -7091,7 +7091,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ? STR_BUILT_LAST_YEAR : STR_BUILT_YEARS_AGO;
ft = Formatter();
ft.Add<int16_t>(age);
DrawTextBasic(dpi, screenCoords, stringId, ft);
DrawTextBasic(*dpi, screenCoords, stringId, ft);
}
#pragma endregion
+2 -2
View File
@@ -1520,14 +1520,14 @@ public:
// Draw cost
screenCoords = { windowPos.x + widget->midX(), windowPos.y + widget->bottom - 23 };
if (_rideConstructionState != RideConstructionState::Place)
DrawTextBasic(&dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE });
screenCoords.y += 11;
if (_currentTrackPrice != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY))
{
auto ft = Formatter();
ft.Add<money64>(_currentTrackPrice);
DrawTextBasic(&dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
}
}
+3 -3
View File
@@ -516,7 +516,7 @@ public:
auto ft = Formatter();
ft.Add<uint16_t>(static_cast<uint16_t>(_rideList.size()));
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[page], ft);
dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[page], ft);
}
/**
@@ -547,7 +547,7 @@ public:
// Ride name
auto ft = Formatter();
ridePtr->FormatNameTo(ft);
DrawTextEllipsised(&dpi, { 0, y - 1 }, 159, format, ft);
DrawTextEllipsised(dpi, { 0, y - 1 }, 159, format, ft);
// Ride information
ft = Formatter();
@@ -724,7 +724,7 @@ public:
ft.Rewind();
ft.Add<StringId>(formatSecondary);
}
DrawTextEllipsised(&dpi, { 160, y - 1 }, 157, format, ft);
DrawTextEllipsised(dpi, { 160, y - 1 }, 157, format, ft);
y += SCROLLABLE_ROW_HEIGHT;
}
}
+12 -12
View File
@@ -451,7 +451,7 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi)
}
ScreenCoordsXY stringCoords(widget->midX() + w->windowPos.x, widget->midY() + w->windowPos.y - 3);
DrawTextWrapped(dpi, stringCoords, 87, format, ft, { COLOUR_AQUAMARINE, fontStyle, TextAlignment::CENTRE });
DrawTextWrapped(*dpi, stringCoords, 87, format, ft, { COLOUR_AQUAMARINE, fontStyle, TextAlignment::CENTRE });
}
// Return if no scenario highlighted
@@ -465,8 +465,8 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi)
+ ScreenCoordsXY{ window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4,
window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5 };
DrawTextEllipsised(
dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_SCENARIO_LOCKED, {}, { TextAlignment::CENTRE });
DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_LOCKED_DESC);
*dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_SCENARIO_LOCKED, {}, { TextAlignment::CENTRE });
DrawTextWrapped(*dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_LOCKED_DESC);
}
else
{
@@ -475,7 +475,7 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi)
+ ScreenCoordsXY{ window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4,
window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5 };
DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_HOVER_HINT);
DrawTextWrapped(*dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_HOVER_HINT);
}
return;
}
@@ -491,7 +491,7 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi)
auto ft = Formatter();
ft.Add<const char*>(pathPtr);
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ TabWidth + 3, w->height - 3 - 11 }, STR_STRING, ft, { w->colours[1] });
*dpi, w->windowPos + ScreenCoordsXY{ TabWidth + 3, w->height - 3 - 11 }, STR_STRING, ft, { w->colours[1] });
}
// Scenario name
@@ -502,14 +502,14 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi)
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(scenario->Name);
DrawTextEllipsised(
dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE });
*dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE });
screenPos.y += 15;
// Scenario details
ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(scenario->Details);
screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_BLACK_STRING, ft) + 5;
screenPos.y += DrawTextWrapped(*dpi, screenPos, 170, STR_BLACK_STRING, ft) + 5;
// Scenario objective
ft = Formatter();
@@ -533,7 +533,7 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi)
else
ft.Add<money64>(scenario->ObjectiveArg2);
}
screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_OBJECTIVE, ft) + 5;
screenPos.y += DrawTextWrapped(*dpi, screenPos, 170, STR_OBJECTIVE, ft) + 5;
// Scenario score
if (scenario->Highscore != nullptr)
@@ -548,7 +548,7 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi)
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(completedByName);
ft.Add<money64>(scenario->Highscore->company_value);
screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, ft);
screenPos.y += DrawTextWrapped(*dpi, screenPos, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, ft);
}
}
@@ -612,7 +612,7 @@ static void WindowScenarioselectScrollpaint(WindowBase* w, DrawPixelInfo* dpi, i
const auto scrollCentre = window_scenarioselect_widgets[WIDX_SCENARIOLIST].width() / 2;
DrawTextBasic(
dpi, { scrollCentre, y + 1 }, format, ft, { colour, FontStyle::Medium, TextAlignment::CENTRE, darkness });
*dpi, { scrollCentre, y + 1 }, format, ft, { colour, FontStyle::Medium, TextAlignment::CENTRE, darkness });
// Check if scenario is completed
if (isCompleted)
@@ -634,7 +634,7 @@ static void WindowScenarioselectScrollpaint(WindowBase* w, DrawPixelInfo* dpi, i
ft.Add<StringId>(STR_STRING);
ft.Add<char*>(buffer);
DrawTextBasic(
dpi, { scrollCentre, y + scenarioTitleHeight + 1 }, format, ft,
*dpi, { scrollCentre, y + scenarioTitleHeight + 1 }, format, ft,
{ FontStyle::Small, TextAlignment::CENTRE });
}
@@ -653,7 +653,7 @@ static void DrawCategoryHeading(WindowBase* w, DrawPixelInfo* dpi, int32_t left,
// Draw string
int32_t centreX = (left + right) / 2;
DrawTextBasic(dpi, { centreX, y }, stringId, {}, { baseColour, TextAlignment::CENTRE });
DrawTextBasic(*dpi, { centreX, y }, stringId, {}, { baseColour, TextAlignment::CENTRE });
// Get string dimensions
utf8 buffer[CommonTextBufferSize];
+2 -2
View File
@@ -783,12 +783,12 @@ public:
// -14
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ width - 0x1A, height - 13 }, STR_COST_LABEL, ft, { TextAlignment::RIGHT });
dpi, windowPos + ScreenCoordsXY{ width - 0x1A, height - 13 }, STR_COST_LABEL, ft, { TextAlignment::RIGHT });
}
auto ft = Formatter();
ft.Add<StringId>(name);
DrawTextEllipsised(&dpi, { windowPos.x + 3, windowPos.y + height - 13 }, width - 19, STR_BLACK_STRING, ft);
DrawTextEllipsised(dpi, { windowPos.x + 3, windowPos.y + height - 13 }, width - 19, STR_BLACK_STRING, ft);
}
void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override
+1 -1
View File
@@ -187,7 +187,7 @@ public:
const auto screenCoords = ScreenCoordsXY{ windowPos.x + preview.midX(), windowPos.y + preview.midY() };
auto ft = Formatter();
ft.Add<uint16_t>(gWindowSceneryScatterSize);
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
}
}
};
+6 -5
View File
@@ -376,19 +376,20 @@ static void WindowServerListPaint(WindowBase* w, DrawPixelInfo* dpi)
WindowDrawWidgets(*w, dpi);
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PLAYER_NAME_INPUT].top }, STR_PLAYER_NAME, {}, { COLOUR_WHITE });
*dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PLAYER_NAME_INPUT].top }, STR_PLAYER_NAME, {},
{ COLOUR_WHITE });
// Draw version number
std::string version = NetworkGetVersion();
auto ft = Formatter();
ft.Add<const char*>(version.c_str());
DrawTextBasic(
dpi, w->windowPos + ScreenCoordsXY{ 324, w->widgets[WIDX_START_SERVER].top + 1 }, STR_NETWORK_VERSION, ft,
*dpi, w->windowPos + ScreenCoordsXY{ 324, w->widgets[WIDX_START_SERVER].top + 1 }, STR_NETWORK_VERSION, ft,
{ COLOUR_WHITE });
ft = Formatter();
ft.Add<uint32_t>(_numPlayersOnline);
DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 8, w->height - 15 }, _statusText, ft, { COLOUR_WHITE });
DrawTextBasic(*dpi, w->windowPos + ScreenCoordsXY{ 8, w->height - 15 }, _statusText, ft, { COLOUR_WHITE });
}
static void WindowServerListScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex)
@@ -449,7 +450,7 @@ static void WindowServerListScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
// Finally, draw the server information.
auto ft = Formatter();
ft.Add<const char*>(serverInfoToShow);
DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, spaceAvailableForInfo, STR_STRING, ft, { colour });
DrawTextEllipsised(*dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, spaceAvailableForInfo, STR_STRING, ft, { colour });
int32_t right = width - 7 - SCROLLBAR_WIDTH;
@@ -480,7 +481,7 @@ static void WindowServerListScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
// Draw number of players
screenCoords.x = right - numPlayersStringWidth;
GfxDrawString(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, players, { w->colours[1] });
GfxDrawString(*dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, players, { w->colours[1] });
screenCoords.y += ITEM_HEIGHT;
}
+6 -7
View File
@@ -237,16 +237,15 @@ public:
void OnDraw(DrawPixelInfo& dpi) override
{
DrawWidgets(dpi);
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PORT_INPUT].top }, STR_PORT, {}, { colours[1] });
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_NAME_INPUT].top }, STR_SERVER_NAME, {}, { colours[1] });
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PORT_INPUT].top }, STR_PORT, {}, { colours[1] });
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_NAME_INPUT].top }, STR_SERVER_NAME, {}, { colours[1] });
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_DESCRIPTION_INPUT].top }, STR_SERVER_DESCRIPTION, {},
dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_DESCRIPTION_INPUT].top }, STR_SERVER_DESCRIPTION, {},
{ colours[1] });
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_GREETING_INPUT].top }, STR_SERVER_GREETING, {}, { colours[1] });
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PASSWORD_INPUT].top }, STR_PASSWORD, {}, { colours[1] });
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_MAXPLAYERS].top }, STR_MAX_PLAYERS, {}, { colours[1] });
dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_GREETING_INPUT].top }, STR_SERVER_GREETING, {}, { colours[1] });
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PASSWORD_INPUT].top }, STR_PASSWORD, {}, { colours[1] });
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_MAXPLAYERS].top }, STR_MAX_PLAYERS, {}, { colours[1] });
}
private:
+3 -3
View File
@@ -135,7 +135,7 @@ public:
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(_shortcutCustomName.c_str());
}
DrawTextWrapped(&dpi, stringCoords, 242, STR_SHORTCUT_CHANGE_PROMPT, ft, { TextAlignment::CENTRE });
DrawTextWrapped(dpi, stringCoords, 242, STR_SHORTCUT_CHANGE_PROMPT, ft, { TextAlignment::CENTRE });
}
private:
@@ -523,14 +523,14 @@ private:
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(shortcut.CustomString.c_str());
}
DrawTextEllipsised(&dpi, { 0, y - 1 }, bindingOffset, format, ft);
DrawTextEllipsised(dpi, { 0, y - 1 }, bindingOffset, format, ft);
if (!shortcut.Binding.empty())
{
ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<const char*>(shortcut.Binding.c_str());
DrawTextEllipsised(&dpi, { bindingOffset, y - 1 }, 150, format, ft);
DrawTextEllipsised(dpi, { bindingOffset, y - 1 }, 150, format, ft);
}
}
};
+10 -10
View File
@@ -537,7 +537,7 @@ private:
const auto& widget = widgets[WIDX_BTM_LABEL];
auto screenPos = windowPos + ScreenCoordsXY{ widget.midX(), widget.top };
int32_t widgetWidth = widget.width();
DrawTextEllipsised(dpi, screenPos, widgetWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE });
DrawTextEllipsised(*dpi, screenPos, widgetWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE });
}
void DrawOverviewTabImage(DrawPixelInfo* dpi)
@@ -928,13 +928,13 @@ private:
{
auto ft = Formatter();
ft.Add<money64>(GetStaffWage(staff->AssignedStaffType));
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_WAGES, ft);
DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_WAGES, ft);
screenCoords.y += LIST_ROW_HEIGHT;
}
auto ft = Formatter();
ft.Add<int32_t>(staff->GetHireDate());
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_EMPLOYED_FOR, ft);
DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_EMPLOYED_FOR, ft);
screenCoords.y += LIST_ROW_HEIGHT;
switch (staff->AssignedStaffType)
@@ -942,37 +942,37 @@ private:
case StaffType::Handyman:
ft = Formatter();
ft.Add<uint32_t>(staff->StaffLawnsMown);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LAWNS_MOWN, ft);
DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_LAWNS_MOWN, ft);
screenCoords.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<uint32_t>(staff->StaffGardensWatered);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_GARDENS_WATERED, ft);
DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_GARDENS_WATERED, ft);
screenCoords.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<uint32_t>(staff->StaffLitterSwept);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LITTER_SWEPT, ft);
DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_LITTER_SWEPT, ft);
screenCoords.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<uint32_t>(staff->StaffBinsEmptied);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_BINS_EMPTIED, ft);
DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_BINS_EMPTIED, ft);
break;
case StaffType::Mechanic:
ft = Formatter();
ft.Add<uint32_t>(staff->StaffRidesInspected);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_INSPECTED, ft);
DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_RIDES_INSPECTED, ft);
screenCoords.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<uint32_t>(staff->StaffRidesFixed);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_FIXED, ft);
DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_RIDES_FIXED, ft);
break;
case StaffType::Security:
ft = Formatter();
ft.Add<uint32_t>(staff->StaffVandalsStopped);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_VANDALS_STOPPED, ft);
DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_VANDALS_STOPPED, ft);
break;
case StaffType::Entertainer:
case StaffType::Count:
+1 -1
View File
@@ -81,7 +81,7 @@ public:
peep->FormatNameTo(ft);
ScreenCoordsXY textCoords(windowPos + ScreenCoordsXY{ WW / 2, (WH / 2) - 3 });
DrawTextWrapped(&dpi, textCoords, WW - 4, STR_FIRE_STAFF_ID, ft, { TextAlignment::CENTRE });
DrawTextWrapped(dpi, textCoords, WW - 4, STR_FIRE_STAFF_ID, ft, { TextAlignment::CENTRE });
}
};
+5 -5
View File
@@ -285,13 +285,13 @@ public:
{
auto ft = Formatter();
ft.Add<money64>(GetStaffWage(GetSelectedStaffType()));
DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ width - 155, 32 }, STR_COST_PER_MONTH, ft);
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ width - 155, 32 }, STR_COST_PER_MONTH, ft);
}
if (GetSelectedStaffType() != StaffType::Entertainer)
{
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].top + 1 },
dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].top + 1 },
STR_UNIFORM_COLOUR);
}
@@ -303,7 +303,7 @@ public:
ft.Add<StringId>(staffTypeStringId);
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_STAFF_LIST_LIST].bottom + 2 }, STR_STAFF_LIST_COUNTER, ft);
dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_STAFF_LIST_LIST].bottom + 2 }, STR_STAFF_LIST_COUNTER, ft);
}
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
@@ -405,11 +405,11 @@ public:
auto ft = Formatter();
peep->FormatNameTo(ft);
DrawTextEllipsised(&dpi, { 0, y }, nameColumnSize, format, ft);
DrawTextEllipsised(dpi, { 0, y }, nameColumnSize, format, ft);
ft = Formatter();
peep->FormatActionTo(ft);
DrawTextEllipsised(&dpi, { actionOffset, y }, actionColumnSize, format, ft);
DrawTextEllipsised(dpi, { actionOffset, y }, actionColumnSize, format, ft);
// True if a patrol path is set for the worker
if (peep->HasPatrolArea())
+4 -4
View File
@@ -210,12 +210,12 @@ public:
auto ft = Formatter();
ft.Add<const char*>(_description.c_str());
DrawTextWrapped(
&dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, STR_STRING, ft, { colours[1], TextAlignment::CENTRE });
dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, STR_STRING, ft, { colours[1], TextAlignment::CENTRE });
}
else
{
DrawTextWrapped(
&dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, _descriptionArgs,
dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, _descriptionArgs,
{ colours[1], TextAlignment::CENTRE });
}
@@ -242,7 +242,7 @@ public:
for (int32_t line = 0; line <= no_lines; line++)
{
screenCoords.x = windowPos.x + 12;
DrawText(&dpi, screenCoords, { colours[1], FontStyle::Medium, TextAlignment::LEFT }, wrapPointer, true);
DrawText(dpi, screenCoords, { colours[1], FontStyle::Medium, TextAlignment::LEFT }, wrapPointer, true);
size_t string_length = GetStringSize(wrapPointer) - 1;
@@ -325,7 +325,7 @@ private:
&dpi, { screenCoords - ScreenCoordsXY{ 1, 1 }, screenCoords + ScreenCoordsXY{ width + 1, height + 1 } },
PALETTE_INDEX_12);
GfxFillRect(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ width, height } }, PALETTE_INDEX_0);
GfxDrawString(&dpi, screenCoords, static_cast<const char*>(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN });
GfxDrawString(dpi, screenCoords, static_cast<const char*>(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN });
}
void ExecuteCallback(bool hasValue)
+4 -4
View File
@@ -453,7 +453,7 @@ public:
if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS)
{
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ 10, window_themes_widgets[WIDX_THEMES_PRESETS].top + 1 },
dpi, windowPos + ScreenCoordsXY{ 10, window_themes_widgets[WIDX_THEMES_PRESETS].top + 1 },
STR_THEMES_LABEL_CURRENT_THEME, {}, { colours[1] });
size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex();
@@ -467,7 +467,7 @@ public:
auto newWidth = windowPos.x + window_themes_widgets[WIDX_THEMES_PRESETS_DROPDOWN].left
- window_themes_widgets[WIDX_THEMES_PRESETS].left - 4;
DrawTextEllipsised(&dpi, screenPos, newWidth, STR_STRING, ft, { colours[1] });
DrawTextEllipsised(dpi, screenPos, newWidth, STR_STRING, ft, { colours[1] });
}
}
@@ -808,7 +808,7 @@ public:
int32_t numColours = ThemeDescGetNumColours(wc);
for (uint8_t j = 0; j < numColours; j++)
{
DrawTextBasic(&dpi, { 2, screenCoords.y + 4 }, ThemeDescGetName(wc), {}, { colours[1] });
DrawTextBasic(dpi, { 2, screenCoords.y + 4 }, ThemeDescGetName(wc), {}, { colours[1] });
uint8_t colour = ThemeGetColour(wc, j);
const bool isPressed = (i == _colour_index_1 && j == _colour_index_2);
@@ -822,7 +822,7 @@ public:
if (colour & COLOUR_FLAG_TRANSLUCENT)
{
GfxDrawString(
&dpi, topLeft, static_cast<const char*>(CheckBoxMarkString),
dpi, topLeft, static_cast<const char*>(CheckBoxMarkString),
{ static_cast<colour_t>(colours[1] & 0x7F), FontStyle::Medium, TextDarkness::Dark });
}
}
+73 -74
View File
@@ -1009,24 +1009,24 @@ public:
ScreenCoordsXY screenCoords(windowPos.x, windowPos.y);
// Draw coordinates
GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(5, 24), "X:", { colours[1] });
GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(74, 24), "Y:", { colours[1] });
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 24), "X:", { colours[1] });
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(74, 24), "Y:", { colours[1] });
if (_tileSelected)
{
auto tileCoords = TileCoordsXY{ _toolMap };
auto ft = Formatter();
ft.Add<int32_t>(tileCoords.x);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 43, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT });
dpi, screenCoords + ScreenCoordsXY{ 43, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT });
ft = Formatter();
ft.Add<int32_t>(tileCoords.y);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 113, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT });
dpi, screenCoords + ScreenCoordsXY{ 113, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT });
}
else
{
GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(43 - 7, 24), "-", { colours[1] });
GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(113 - 7, 24), "-", { colours[1] });
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(43 - 7, 24), "-", { colours[1] });
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(113 - 7, 24), "-", { colours[1] });
}
if (windowTileInspectorSelectedIndex != -1)
@@ -1052,7 +1052,7 @@ public:
terrainNameId = surfaceStyle->NameStringId;
auto ft = Formatter();
ft.Add<StringId>(terrainNameId);
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { colours[1] });
// Edge texture name
StringId terrainEdgeNameId = STR_EMPTY;
@@ -1062,7 +1062,7 @@ public:
ft = Formatter();
ft.Add<StringId>(terrainEdgeNameId);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, ft, { colours[1] });
// Land ownership
StringId landOwnership;
@@ -1080,31 +1080,31 @@ public:
ft = Formatter();
ft.Add<StringId>(landOwnership);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, ft, { colours[1] });
// Water level
ft = Formatter();
ft.Add<uint32_t>(tileElement->AsSurface()->GetWaterHeight());
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, ft,
dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, ft,
{ colours[1] });
// Properties
// Raise / lower label
screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_SURFACE_SPINNER_HEIGHT].top };
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
// Current base height
screenCoords.x = windowPos.x + widgets[WIDX_SURFACE_SPINNER_HEIGHT].left + 3;
ft = Formatter();
ft.Add<int32_t>(tileElement->BaseHeight);
DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
// Raised corners
screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_SURFACE_CHECK_CORNER_E].top };
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_CORNERS, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_CORNERS, {}, { colours[1] });
break;
}
case TileElementType::Path:
@@ -1120,7 +1120,7 @@ public:
{
auto ft = Formatter();
ft.Add<StringId>(surfaceObj->NameStringId);
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_FOOTPATH_SURFACE_NAME, ft, { COLOUR_WHITE });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_FOOTPATH_SURFACE_NAME, ft, { COLOUR_WHITE });
}
// Railings name
@@ -1130,7 +1130,7 @@ public:
auto ft = Formatter();
ft.Add<StringId>(railingsObj->NameStringId);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_FOOTPATH_RAILINGS_NAME, ft,
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_FOOTPATH_RAILINGS_NAME, ft,
{ COLOUR_WHITE });
}
}
@@ -1140,7 +1140,7 @@ public:
auto footpathEntry = reinterpret_cast<const FootpathEntry*>(footpathObj->GetLegacyData());
auto ft = Formatter();
ft.Add<StringId>(footpathEntry->string_idx);
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE });
}
// Path addition
@@ -1152,13 +1152,13 @@ public:
auto ft = Formatter();
ft.Add<StringId>(additionNameId);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, ft,
dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, ft,
{ COLOUR_WHITE });
}
else
{
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS_NONE, {},
dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS_NONE, {},
{ COLOUR_WHITE });
}
@@ -1166,18 +1166,18 @@ public:
// Raise / lower label
screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_PATH_SPINNER_HEIGHT].top };
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
// Current base height
screenCoords.x = windowPos.x + widgets[WIDX_PATH_SPINNER_HEIGHT].left + 3;
auto ft = Formatter();
ft.Add<int32_t>(tileElement->BaseHeight);
DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
// Path connections
screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_PATH_CHECK_EDGE_W].top };
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_PATH_CONNECTED_EDGES, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_CONNECTED_EDGES, {}, { colours[1] });
break;
}
@@ -1190,7 +1190,7 @@ public:
// Ride ID
auto ft = Formatter();
ft.Add<int16_t>(id);
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { colours[1] });
// Ride name
if (rideTile != nullptr)
@@ -1198,7 +1198,7 @@ public:
ft = Formatter();
rideTile->FormatNameTo(ft);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft,
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft,
{ colours[1] });
}
@@ -1207,18 +1207,18 @@ public:
ft = Formatter();
ft.Add<StringId>(rtd.Naming.Name);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, { colours[1] });
// Track
ft = Formatter();
ft.Add<track_type_t>(trackElement->GetTrackType());
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_TRACK_PIECE_ID, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_TRACK_PIECE_ID, ft, { colours[1] });
ft = Formatter();
ft.Add<track_type_t>(trackElement->GetSequenceIndex());
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 44 }, STR_TILE_INSPECTOR_TRACK_SEQUENCE, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 44 }, STR_TILE_INSPECTOR_TRACK_SEQUENCE, ft, { colours[1] });
if (trackElement->IsStation())
{
auto stationIndex = trackElement->GetStationIndex();
@@ -1226,7 +1226,7 @@ public:
ft.Add<StringId>(STR_COMMA16);
ft.Add<int16_t>(stationIndex.ToUnderlying());
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] });
}
else
{
@@ -1235,24 +1235,24 @@ public:
ft.Add<StringId>(STR_STRING);
ft.Add<char*>(stationNone);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] });
}
ft = Formatter();
ft.Add<StringId>(ColourSchemeNames[trackElement->GetColourScheme()]);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, ft, { colours[1] });
// Properties
// Raise / lower label
screenCoords.y = windowPos.y + widgets[WIDX_TRACK_SPINNER_HEIGHT].top;
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
// Current base height
screenCoords.x = windowPos.x + widgets[WIDX_TRACK_SPINNER_HEIGHT].left + 3;
ft = Formatter();
ft.Add<int32_t>(tileElement->BaseHeight);
DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
break;
}
@@ -1262,7 +1262,7 @@ public:
// Age
auto ft = Formatter();
ft.Add<int16_t>(tileElement->AsSmallScenery()->GetAge());
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_AGE, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_AGE, ft, { colours[1] });
// Quadrant value
const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry();
@@ -1278,7 +1278,7 @@ public:
ft = Formatter();
ft.Add<StringId>(_quadrantStringIdx[quadrant]);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, ft,
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, ft,
{ colours[1] });
}
@@ -1286,27 +1286,27 @@ public:
ft = Formatter();
ft.Add<ObjectEntryIndex>(tileElement->AsSmallScenery()->GetEntryIndex());
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, ft, { colours[1] });
// Properties
// Raise / Lower
screenCoords.y = windowPos.y + widgets[WIDX_SCENERY_SPINNER_HEIGHT].top;
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
// Current base height
screenCoords.x = windowPos.x + widgets[WIDX_SCENERY_SPINNER_HEIGHT].left + 3;
ft = Formatter();
ft.Add<int32_t>(tileElement->BaseHeight);
DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
// Quarter tile
screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_SCENERY_CHECK_QUARTER_E].top };
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_QUADRANT_LABEL, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_QUADRANT_LABEL, {}, { colours[1] });
// Collision
screenCoords.y = windowPos.y + widgets[WIDX_SCENERY_CHECK_COLLISION_E].top;
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_COLLISSION, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_COLLISSION, {}, { colours[1] });
break;
}
@@ -1316,7 +1316,7 @@ public:
// Entrance type
auto ft = Formatter();
ft.Add<StringId>(EntranceTypeStringIds[tileElement->AsEntrance()->GetEntranceType()]);
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, ft, { colours[1] });
if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE)
{
@@ -1324,7 +1324,7 @@ public:
ft = Formatter();
ft.Add<StringId>(ParkEntranceGetIndex({ _toolMap, tileElement->GetBaseZ() }));
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft,
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft,
{ colours[1] });
}
else
@@ -1335,14 +1335,14 @@ public:
{
// Ride entrance ID
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft,
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft,
{ colours[1] });
}
else
{
// Ride exit ID
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, ft,
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, ft,
{ colours[1] });
}
}
@@ -1353,7 +1353,7 @@ public:
ft = Formatter();
ft.Add<StringId>(ParkEntrancePartStringIds[tileElement->AsEntrance()->GetSequenceIndex()]);
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, ft, { colours[1] });
}
else
{
@@ -1361,7 +1361,7 @@ public:
ft = Formatter();
ft.Add<RideId>(tileElement->AsEntrance()->GetRideIndex());
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft,
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft,
{ colours[1] });
// Station index
auto stationIndex = tileElement->AsEntrance()->GetStationIndex();
@@ -1369,19 +1369,19 @@ public:
ft.Add<StringId>(STR_COMMA16);
ft.Add<int16_t>(stationIndex.ToUnderlying());
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] });
dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] });
}
// Properties
// Raise / Lower
screenCoords.y = windowPos.y + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].top;
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
// Current base height
screenCoords.x = windowPos.x + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].left + 3;
ft = Formatter();
ft.Add<int32_t>(tileElement->BaseHeight);
DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
break;
}
@@ -1391,7 +1391,7 @@ public:
// Type
auto ft = Formatter();
ft.Add<ObjectEntryIndex>(tileElement->AsWall()->GetEntryIndex());
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_WALL_TYPE, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_TYPE, ft, { colours[1] });
// Banner info
auto banner = tileElement->AsWall()->GetBanner();
@@ -1400,35 +1400,35 @@ public:
ft = Formatter();
banner->FormatTextTo(ft);
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,
{ colours[1] });
}
else
{
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {},
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {},
{ colours[1] });
}
// Properties
// Raise / lower label
screenCoords.y = windowPos.y + widgets[WIDX_WALL_SPINNER_HEIGHT].top;
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
// Current base height
screenCoords.x = windowPos.x + widgets[WIDX_WALL_SPINNER_HEIGHT].left + 3;
ft = Formatter();
ft.Add<int32_t>(tileElement->BaseHeight);
DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
// Slope label
screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_WALL_DROPDOWN_SLOPE].top };
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_WALL_SLOPE, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_SLOPE, {}, { colours[1] });
// Animation frame label
screenCoords.y = windowPos.y + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].top;
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME, {}, { colours[1] });
// Current animation frame
colour_t colour = colours[1];
@@ -1439,7 +1439,7 @@ public:
screenCoords.x = windowPos.x + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].left + 3;
ft = Formatter();
ft.Add<int32_t>(tileElement->AsWall()->GetAnimationFrame());
DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colour });
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colour });
break;
}
@@ -1451,13 +1451,13 @@ public:
ObjectEntryIndex largeSceneryType = sceneryElement->GetEntryIndex();
auto ft = Formatter();
ft.Add<ObjectEntryIndex>(largeSceneryType);
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, ft, { colours[1] });
// Part ID
ft = Formatter();
ft.Add<int16_t>(sceneryElement->GetSequenceIndex());
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, ft,
dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, ft,
{ colours[1] });
// Banner info
@@ -1470,27 +1470,27 @@ public:
ft = Formatter();
banner->FormatTextTo(ft);
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,
{ colours[1] });
}
}
else
{
DrawTextBasic(
&dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {},
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {},
{ colours[1] });
}
// Properties
// Raise / lower label
screenCoords.y = windowPos.y + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].top;
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
// Current base height
screenCoords.x = windowPos.x + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].left + 3;
ft = Formatter();
ft.Add<int32_t>(tileElement->BaseHeight);
DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
break;
}
@@ -1503,24 +1503,24 @@ public:
{
Formatter ft;
banner->FormatTextTo(ft);
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, { colours[1] });
}
// Properties
// Raise / lower label
screenCoords.y = windowPos.y + widgets[WIDX_BANNER_SPINNER_HEIGHT].top;
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] });
// Current base height
screenCoords.x = windowPos.x + widgets[WIDX_BANNER_SPINNER_HEIGHT].left + 3;
auto ft = Formatter();
ft.Add<int32_t>(tileElement->BaseHeight);
DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] });
// Blocked paths
screenCoords.y += 28;
screenCoords.x = windowPos.x + widgets[WIDX_GROUPBOX_DETAILS].left + 7;
DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BANNER_BLOCKED_PATHS, {}, { colours[1] });
DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BANNER_BLOCKED_PATHS, {}, { colours[1] });
break;
}
@@ -1544,7 +1544,7 @@ public:
(listWidget.height() - FontGetLineHeight(FontStyle::Medium)) / 2 };
auto ft = Formatter{};
auto textPaint = TextPaint{ colours[1], TextAlignment::CENTRE };
DrawTextWrapped(&dpi, centrePos, listWidth, STR_TILE_INSPECTOR_SELECT_TILE_HINT, ft, textPaint);
DrawTextWrapped(dpi, centrePos, listWidth, STR_TILE_INSPECTOR_SELECT_TILE_HINT, ft, textPaint);
return;
}
@@ -1586,7 +1586,7 @@ public:
auto eyeFormatter = Formatter();
eyeFormatter.Add<StringId>(STR_STRING);
eyeFormatter.Add<char*>(EyeString);
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 2, 1 }, stringFormat, eyeFormatter);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 2, 1 }, stringFormat, eyeFormatter);
}
const auto type = tileElement->GetType();
@@ -1653,32 +1653,31 @@ public:
auto ft = Formatter();
ft.Add<StringId>(STR_STRING);
ft.Add<char*>(typeName);
DrawTextEllipsised(
&dpi, screenCoords + ScreenCoordsXY{ TypeColumnXY.x, 0 }, TypeColumnSize.width, stringFormat, ft);
DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ TypeColumnXY.x, 0 }, TypeColumnSize.width, stringFormat, ft);
// Base height
ft = Formatter();
ft.Add<StringId>(STR_FORMAT_INTEGER);
ft.Add<int32_t>(tileElement->BaseHeight);
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ BaseHeightColumnXY.x, 0 }, stringFormat, ft);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ BaseHeightColumnXY.x, 0 }, stringFormat, ft);
// Clearance height
ft = Formatter();
ft.Add<StringId>(STR_FORMAT_INTEGER);
ft.Add<int32_t>(clearanceHeight);
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ ClearanceHeightColumnXY.x, 0 }, stringFormat, ft);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ ClearanceHeightColumnXY.x, 0 }, stringFormat, ft);
// Direction
ft = Formatter();
ft.Add<StringId>(STR_FORMAT_INTEGER);
ft.Add<int32_t>(tileElement->GetDirection());
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ DirectionColumnXY.x, 0 }, stringFormat, ft);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ DirectionColumnXY.x, 0 }, stringFormat, ft);
// Checkmarks for ghost and last for tile
if (ghost)
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ GhostFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ GhostFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter);
if (last)
DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ LastFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter);
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LastFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter);
screenCoords.y -= SCROLLABLE_ROW_HEIGHT;
i++;
+1 -1
View File
@@ -100,7 +100,7 @@ public:
// Text
left = windowPos.x + ((width + 1) / 2) - 1;
top = windowPos.y + 1;
DrawStringCentredRaw(&dpi, { left, top }, _tooltipNumLines, _tooltipText.data(), FontStyle::Small);
DrawStringCentredRaw(dpi, { left, top }, _tooltipNumLines, _tooltipText.data(), FontStyle::Small);
}
private:
+2 -2
View File
@@ -3223,7 +3223,7 @@ public:
if (gCheatsDisableClearanceChecks)
{
DrawTextBasic(
&dpi, screenPos + ScreenCoordsXY{ 26, 2 }, STR_OVERLAY_CLEARANCE_CHECKS_DISABLED, {},
dpi, screenPos + ScreenCoordsXY{ 26, 2 }, STR_OVERLAY_CLEARANCE_CHECKS_DISABLED, {},
{ COLOUR_DARK_ORANGE | COLOUR_FLAG_OUTLINE, TextAlignment::RIGHT });
}
}
@@ -3288,7 +3288,7 @@ public:
auto ft = Formatter();
ft.Add<int32_t>(NetworkGetNumVisiblePlayers());
DrawTextBasic(
&dpi, screenPos + ScreenCoordsXY{ 23, 1 }, STR_COMMA16, ft,
dpi, screenPos + ScreenCoordsXY{ 23, 1 }, STR_COMMA16, ft,
{ COLOUR_WHITE | COLOUR_FLAG_OUTLINE, TextAlignment::RIGHT });
}
}
@@ -230,7 +230,7 @@ void TrackDeletePromptWindow::OnDraw(DrawPixelInfo& dpi)
auto ft = Formatter();
ft.Add<const utf8*>(_trackDesignFileReference->name.c_str());
DrawTextWrapped(
&dpi, { windowPos.x + (WW_DELETE_PROMPT / 2), windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4),
dpi, { windowPos.x + (WW_DELETE_PROMPT / 2), windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4),
STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, ft, { TextAlignment::CENTRE });
}
+1 -1
View File
@@ -308,7 +308,7 @@ public:
{
ft = Formatter();
ft.Add<money64>(_placementCost);
DrawTextBasic(&dpi, this->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, this->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
}
}
+23 -23
View File
@@ -468,7 +468,7 @@ public:
auto ft = Formatter();
ft.Add<utf8*>(pathPtr);
DrawTextBasic(
&dpi, windowPos + ScreenCoordsXY{ 0, height - DEBUG_PATH_HEIGHT - 3 }, STR_STRING, ft,
dpi, windowPos + ScreenCoordsXY{ 0, height - DEBUG_PATH_HEIGHT - 3 }, STR_STRING, ft,
{ colours[1] }); // TODO Check dpi
}
@@ -511,7 +511,7 @@ public:
&& !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER))
{
// Vehicle design not available
DrawTextEllipsised(&dpi, screenPos, 368, STR_VEHICLE_DESIGN_UNAVAILABLE, {}, { TextAlignment::CENTRE });
DrawTextEllipsised(dpi, screenPos, 368, STR_VEHICLE_DESIGN_UNAVAILABLE, {}, { TextAlignment::CENTRE });
screenPos.y -= SCROLLABLE_ROW_HEIGHT;
}
@@ -521,7 +521,7 @@ public:
{
// Scenery not available
DrawTextEllipsised(
&dpi, screenPos, 368, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE });
dpi, screenPos, 368, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE });
screenPos.y -= SCROLLABLE_ROW_HEIGHT;
}
}
@@ -529,7 +529,7 @@ public:
// Track design name
auto ft = Formatter();
ft.Add<const utf8*>(_trackDesigns[trackIndex].name.c_str());
DrawTextEllipsised(&dpi, screenPos, 368, STR_TRACK_PREVIEW_NAME_FORMAT, ft, { TextAlignment::CENTRE });
DrawTextEllipsised(dpi, screenPos, 368, STR_TRACK_PREVIEW_NAME_FORMAT, ft, { TextAlignment::CENTRE });
// Information
screenPos = windowPos + ScreenCoordsXY{ tdWidget.left + 1, tdWidget.bottom + 2 };
@@ -537,17 +537,17 @@ public:
// Stats
ft = Formatter();
ft.Add<fixed32_2dp>(_loadedTrackDesign->excitement * 10);
DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft);
screenPos.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<fixed32_2dp>(_loadedTrackDesign->intensity * 10);
DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft);
screenPos.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<fixed32_2dp>(_loadedTrackDesign->nausea * 10);
DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft);
screenPos.y += LIST_ROW_HEIGHT + 4;
// Information for tracked rides.
@@ -561,7 +561,7 @@ public:
// Holes
ft = Formatter();
ft.Add<uint16_t>(_loadedTrackDesign->holes & 0x1F);
DrawTextBasic(&dpi, screenPos, STR_HOLES, ft);
DrawTextBasic(dpi, screenPos, STR_HOLES, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
else
@@ -569,13 +569,13 @@ public:
// Maximum speed
ft = Formatter();
ft.Add<uint16_t>(((_loadedTrackDesign->max_speed << 16) * 9) >> 18);
DrawTextBasic(&dpi, screenPos, STR_MAX_SPEED, ft);
DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft);
screenPos.y += LIST_ROW_HEIGHT;
// Average speed
ft = Formatter();
ft.Add<uint16_t>(((_loadedTrackDesign->average_speed << 16) * 9) >> 18);
DrawTextBasic(&dpi, screenPos, STR_AVERAGE_SPEED, ft);
DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
@@ -583,7 +583,7 @@ public:
ft = Formatter();
ft.Add<StringId>(STR_RIDE_LENGTH_ENTRY);
ft.Add<uint16_t>(_loadedTrackDesign->ride_length);
DrawTextEllipsised(&dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft);
DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
@@ -592,19 +592,19 @@ public:
// Maximum positive vertical Gs
ft = Formatter();
ft.Add<int32_t>(_loadedTrackDesign->max_positive_vertical_g * 32);
DrawTextBasic(&dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft);
DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft);
screenPos.y += LIST_ROW_HEIGHT;
// Maximum negative vertical Gs
ft = Formatter();
ft.Add<int32_t>(_loadedTrackDesign->max_negative_vertical_g * 32);
DrawTextBasic(&dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft);
DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft);
screenPos.y += LIST_ROW_HEIGHT;
// Maximum lateral Gs
ft = Formatter();
ft.Add<int32_t>(_loadedTrackDesign->max_lateral_g * 32);
DrawTextBasic(&dpi, screenPos, STR_MAX_LATERAL_G, ft);
DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft);
screenPos.y += LIST_ROW_HEIGHT;
if (_loadedTrackDesign->total_air_time != 0)
@@ -612,7 +612,7 @@ public:
// Total air time
ft = Formatter();
ft.Add<int32_t>(_loadedTrackDesign->total_air_time * 25);
DrawTextBasic(&dpi, screenPos, STR_TOTAL_AIR_TIME, ft);
DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
}
@@ -622,13 +622,13 @@ public:
// Drops
ft = Formatter();
ft.Add<uint16_t>(_loadedTrackDesign->drops & 0x3F);
DrawTextBasic(&dpi, screenPos, STR_DROPS, ft);
DrawTextBasic(dpi, screenPos, STR_DROPS, ft);
screenPos.y += LIST_ROW_HEIGHT;
// Drop height is multiplied by 0.75
ft = Formatter();
ft.Add<uint16_t>((_loadedTrackDesign->highest_drop_height * 3) / 4);
DrawTextBasic(&dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft);
DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
@@ -640,7 +640,7 @@ public:
ft = Formatter();
ft.Add<uint16_t>(inversions);
// Inversions
DrawTextBasic(&dpi, screenPos, STR_INVERSIONS, ft);
DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
}
@@ -653,7 +653,7 @@ public:
ft = Formatter();
ft.Add<uint16_t>(_loadedTrackDesign->space_required_x);
ft.Add<uint16_t>(_loadedTrackDesign->space_required_y);
DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft);
screenPos.y += LIST_ROW_HEIGHT;
}
@@ -661,7 +661,7 @@ public:
{
ft = Formatter();
ft.Add<uint32_t>(_loadedTrackDesign->cost);
DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft);
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft);
}
}
@@ -677,7 +677,7 @@ public:
if (_trackDesigns.empty())
{
// No track designs
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, STR_NO_TRACK_DESIGNS_OF_THIS_TYPE);
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, STR_NO_TRACK_DESIGNS_OF_THIS_TYPE);
return;
}
}
@@ -700,7 +700,7 @@ public:
auto ft = Formatter();
ft.Add<StringId>(STR_BUILD_CUSTOM_DESIGN);
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft);
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft);
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
listIndex++;
}
@@ -727,7 +727,7 @@ public:
auto ft = Formatter();
ft.Add<StringId>(STR_TRACK_LIST_NAME_FORMAT);
ft.Add<const utf8*>(_trackDesigns[i].name.c_str());
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft);
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft);
}
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
+5 -5
View File
@@ -278,7 +278,7 @@ public:
// Clip height value
auto screenCoords = this->windowPos + ScreenCoordsXY{ 8, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top };
DrawTextBasic(&dpi, screenCoords, STR_VIEW_CLIPPING_HEIGHT_VALUE, {}, { this->colours[0] });
DrawTextBasic(dpi, screenCoords, STR_VIEW_CLIPPING_HEIGHT_VALUE, {}, { this->colours[0] });
screenCoords = this->windowPos
+ ScreenCoordsXY{ this->widgets[WIDX_CLIP_HEIGHT_VALUE].left + 1, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top };
@@ -292,7 +292,7 @@ public:
ft.Add<int32_t>(static_cast<int32_t>(gClipHeight));
// Printing the raw value.
DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] });
DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] });
break;
}
case DisplayType::DisplayUnits:
@@ -304,7 +304,7 @@ public:
auto ft = Formatter();
ft.Add<fixed16_1dp>(static_cast<fixed16_1dp>(FIXED_1DP(gClipHeight, 0) / 2 - FIXED_1DP(7, 0)));
DrawTextBasic(
&dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, ft,
dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, ft,
{ this->colours[0] }); // Printing the value in Height Units.
}
else
@@ -319,7 +319,7 @@ public:
auto ft = Formatter();
ft.Add<fixed32_2dp>(
static_cast<fixed32_2dp>(FIXED_2DP(gClipHeight, 0) / 2 * 1.5f - FIXED_2DP(10, 50)));
DrawTextBasic(&dpi, screenCoords, STR_UNIT2DP_SUFFIX_METRES, ft, { this->colours[0] });
DrawTextBasic(dpi, screenCoords, STR_UNIT2DP_SUFFIX_METRES, ft, { this->colours[0] });
break;
}
case MeasurementFormat::Imperial:
@@ -327,7 +327,7 @@ public:
auto ft = Formatter();
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, { this->colours[0] });
DrawTextBasic(dpi, screenCoords, STR_UNIT1DP_SUFFIX_FEET, ft, { this->colours[0] });
break;
}
}
+3 -3
View File
@@ -149,7 +149,7 @@ public:
{
auto ft = Formatter();
ft.Add<uint16_t>(gLandToolSize);
DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE });
}
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
@@ -161,7 +161,7 @@ public:
{
auto ft = Formatter();
ft.Add<money64>(gWaterToolRaiseCost);
DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE });
}
screenCoords.y += 10;
@@ -170,7 +170,7 @@ public:
{
auto ft = Formatter();
ft.Add<money64>(gWaterToolLowerCost);
DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE });
DrawTextBasic(dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE });
}
}
}
+31 -30
View File
@@ -273,7 +273,7 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8
/**
* Draws text that is left aligned and vertically centred.
*/
void GfxDrawStringLeftCentred(DrawPixelInfo* dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords)
void GfxDrawStringLeftCentred(DrawPixelInfo& dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords)
{
char buffer[CommonTextBufferSize];
auto bufferPtr = buffer;
@@ -338,9 +338,9 @@ static void ColourCharacterWindow(uint8_t colour, const uint16_t* current_font_f
* dpi : edi
*/
void DrawStringCentredRaw(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle)
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle)
{
ScreenCoordsXY screenCoords(dpi->x, dpi->y);
ScreenCoordsXY screenCoords(dpi.x, dpi.y);
GfxDrawString(dpi, screenCoords, "", { COLOUR_BLACK, fontStyle });
screenCoords = coords;
@@ -433,11 +433,11 @@ int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle)
* ticks : ebp >> 16
*/
void DrawNewsTicker(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, u8string_view args,
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, u8string_view args,
int32_t ticks)
{
int32_t numLines, lineHeight, lineY;
ScreenCoordsXY screenCoords(dpi->x, dpi->y);
ScreenCoordsXY screenCoords(dpi.x, dpi.y);
GfxDrawString(dpi, screenCoords, "", { colour });
@@ -504,7 +504,7 @@ struct TextDrawInfo
const int8_t* y_offset;
};
static void TTFDrawCharacterSprite(DrawPixelInfo* dpi, int32_t codepoint, TextDrawInfo* info)
static void TTFDrawCharacterSprite(DrawPixelInfo& dpi, int32_t codepoint, TextDrawInfo* info)
{
int32_t characterWidth = FontSpriteGetCodepointWidth(info->FontStyle, codepoint);
auto sprite = FontSpriteGetCodepointSprite(info->FontStyle, codepoint);
@@ -518,13 +518,13 @@ static void TTFDrawCharacterSprite(DrawPixelInfo* dpi, int32_t codepoint, TextDr
}
PaletteMap paletteMap(info->palette);
GfxDrawGlyph(dpi, sprite, screenCoords, paletteMap);
GfxDrawGlyph(&dpi, sprite, screenCoords, paletteMap);
}
info->x += characterWidth;
}
static void TTFDrawStringRawSprite(DrawPixelInfo* dpi, std::string_view text, TextDrawInfo* info)
static void TTFDrawStringRawSprite(DrawPixelInfo& dpi, std::string_view text, TextDrawInfo* info)
{
CodepointView codepoints(text);
for (auto codepoint : codepoints)
@@ -536,7 +536,7 @@ static void TTFDrawStringRawSprite(DrawPixelInfo* dpi, std::string_view text, Te
#ifndef NO_TTF
static int _ttfGlId = 0;
static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextDrawInfo* info)
static void TTFDrawStringRawTTF(DrawPixelInfo& dpi, std::string_view text, TextDrawInfo* info)
{
if (!TTFInitialise())
return;
@@ -582,10 +582,10 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD
auto baseId = uint32_t(0x7FFFF) - 1024;
auto imageId = baseId + _ttfGlId;
auto drawingEngine = dpi->DrawingEngine;
auto drawingEngine = dpi.DrawingEngine;
auto drawingContext = drawingEngine->GetDrawingContext();
drawingEngine->InvalidateImage(imageId);
drawingContext->DrawBitmap(dpi, imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY);
drawingContext->DrawBitmap(&dpi, imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY);
_ttfGlId++;
if (_ttfGlId >= 1023)
@@ -595,18 +595,18 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD
return;
}
int32_t overflowX = (dpi->x + dpi->width) - (drawX + width);
int32_t overflowY = (dpi->y + dpi->height) - (drawY + height);
int32_t overflowX = (dpi.x + dpi.width) - (drawX + width);
int32_t overflowY = (dpi.y + dpi.height) - (drawY + height);
if (overflowX < 0)
width += overflowX;
if (overflowY < 0)
height += overflowY;
int32_t skipX = drawX - dpi->x;
int32_t skipY = drawY - dpi->y;
int32_t skipX = drawX - dpi.x;
int32_t skipY = drawY - dpi.y;
info->x += width;
auto src = static_cast<const uint8_t*>(surface->pixels);
uint8_t* dst = dpi->bits;
uint8_t* dst = dpi.bits;
if (skipX < 0)
{
@@ -622,10 +622,10 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD
}
dst += skipX;
dst += skipY * (dpi->width + dpi->pitch);
dst += skipY * (dpi.width + dpi.pitch);
int32_t srcScanSkip = surface->pitch - width;
int32_t dstScanSkip = dpi->width + dpi->pitch - width;
int32_t dstScanSkip = dpi.width + dpi.pitch - width;
uint8_t* dst_orig = dst;
const uint8_t* src_orig = src;
@@ -639,7 +639,7 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD
if (*src != 0)
{
// right
if (xx + skipX < dpi->width + dpi->pitch - 1)
if (xx + skipX < dpi.width + dpi.pitch - 1)
{
*(dst + 1) = info->palette[3];
}
@@ -654,7 +654,7 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD
*(dst - width - dstScanSkip) = info->palette[3];
}
// bottom
if (yy + skipY < dpi->height - 1)
if (yy + skipY < dpi.height - 1)
{
*(dst + width + dstScanSkip) = info->palette[3];
}
@@ -712,7 +712,7 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD
#endif // NO_TTF
static void TTFProcessFormatCode(DrawPixelInfo* dpi, const FmtString::Token& token, TextDrawInfo* info)
static void TTFProcessFormatCode(DrawPixelInfo& dpi, const FmtString::Token& token, TextDrawInfo* info)
{
switch (token.kind)
{
@@ -768,7 +768,7 @@ static void TTFProcessFormatCode(DrawPixelInfo* dpi, const FmtString::Token& tok
{
if (!(info->flags & TEXT_DRAW_FLAG_NO_DRAW))
{
GfxDrawSprite(dpi, imageId, { info->x, info->y });
GfxDrawSprite(&dpi, imageId, { info->x, info->y });
}
info->x += g1->width;
}
@@ -816,7 +816,7 @@ static bool ShouldUseSpriteForCodepoint(char32_t codepoint)
}
#endif // NO_TTF
static void TTFProcessStringLiteral(DrawPixelInfo* dpi, std::string_view text, TextDrawInfo* info)
static void TTFProcessStringLiteral(DrawPixelInfo& dpi, std::string_view text, TextDrawInfo* info)
{
#ifndef NO_TTF
bool isTTF = info->flags & TEXT_DRAW_FLAG_TTF;
@@ -878,14 +878,14 @@ static void TTFProcessStringLiteral(DrawPixelInfo* dpi, std::string_view text, T
#endif // NO_TTF
}
static void TTFProcessStringCodepoint(DrawPixelInfo* dpi, codepoint_t codepoint, TextDrawInfo* info)
static void TTFProcessStringCodepoint(DrawPixelInfo& dpi, codepoint_t codepoint, TextDrawInfo* info)
{
char buffer[8]{};
UTF8WriteCodepoint(buffer, codepoint);
TTFProcessStringLiteral(dpi, buffer, info);
}
static void TTFProcessString(DrawPixelInfo* dpi, std::string_view text, TextDrawInfo* info)
static void TTFProcessString(DrawPixelInfo& dpi, std::string_view text, TextDrawInfo* info)
{
if (info->flags & TEXT_DRAW_FLAG_NO_FORMATTING)
{
@@ -973,7 +973,7 @@ static void TTFProcessInitialColour(int32_t colour, TextDrawInfo* info)
}
void TTFDrawString(
DrawPixelInfo* dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting,
DrawPixelInfo& dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting,
FontStyle fontStyle, TextDarkness darkness)
{
if (text == nullptr)
@@ -1011,7 +1011,7 @@ void TTFDrawString(
TTFProcessString(dpi, text, &info);
std::memcpy(gTextPalette, info.palette, sizeof(info.palette));
dpi->lastStringPos = { info.x, info.y };
dpi.lastStringPos = { info.x, info.y };
}
static int32_t TTFGetStringWidth(std::string_view text, FontStyle fontStyle, bool noFormatting)
@@ -1037,7 +1037,8 @@ static int32_t TTFGetStringWidth(std::string_view text, FontStyle fontStyle, boo
info.flags |= TEXT_DRAW_FLAG_NO_FORMATTING;
}
TTFProcessString(nullptr, text, &info);
DrawPixelInfo dummy{};
TTFProcessString(dummy, text, &info);
return info.maxX;
}
@@ -1047,7 +1048,7 @@ static int32_t TTFGetStringWidth(std::string_view text, FontStyle fontStyle, boo
* rct2: 0x00682F28
*/
void GfxDrawStringWithYOffsets(
DrawPixelInfo* dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets,
DrawPixelInfo& dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets,
bool forceSpriteFont, FontStyle fontStyle)
{
TextDrawInfo info;
@@ -1071,7 +1072,7 @@ void GfxDrawStringWithYOffsets(
TTFProcessString(dpi, text, &info);
std::memcpy(gTextPalette, info.palette, sizeof(info.palette));
dpi->lastStringPos = { info.x, info.y };
dpi.lastStringPos = { info.x, info.y };
}
void ShortenPath(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle)
+6 -6
View File
@@ -520,16 +520,16 @@ void FASTCALL GfxDrawSpriteRawMaskedSoftware(
DrawPixelInfo* dpi, const ScreenCoordsXY& scrCoords, const ImageId maskImage, const ImageId colourImage);
// string
void GfxDrawString(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint = {});
void GfxDrawString(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint = {});
void GfxDrawStringLeftCentred(DrawPixelInfo* dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords);
void GfxDrawStringLeftCentred(DrawPixelInfo& dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords);
void DrawStringCentredRaw(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle);
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle);
void DrawNewsTicker(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, u8string_view args,
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, u8string_view args,
int32_t ticks);
void GfxDrawStringWithYOffsets(
DrawPixelInfo* dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets,
DrawPixelInfo& dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets,
bool forceSpriteFont, FontStyle fontStyle);
int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8string* outWrappedText, int32_t* outNumLines);
@@ -540,7 +540,7 @@ int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle);
int32_t GfxClipString(char* buffer, int32_t width, FontStyle fontStyle);
void ShortenPath(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle);
void TTFDrawString(
DrawPixelInfo* dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting,
DrawPixelInfo& dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting,
FontStyle fontStyle, TextDarkness darkness);
// scrolling text
+11 -11
View File
@@ -32,7 +32,7 @@ public:
LineHeight = FontGetLineHeight(paint.FontStyle);
}
void Draw(DrawPixelInfo* dpi, const ScreenCoordsXY& coords)
void Draw(DrawPixelInfo& dpi, const ScreenCoordsXY& coords)
{
TextPaint tempPaint = Paint;
@@ -75,7 +75,7 @@ public:
};
void DrawText(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting)
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting)
{
int32_t width = noFormatting ? GfxGetStringWidthNoFormatting(text, paint.FontStyle)
: GfxGetStringWidth(text, paint.FontStyle);
@@ -98,32 +98,32 @@ void DrawText(
if (paint.UnderlineText == TextUnderline::On)
{
GfxFillRect(
dpi, { { alignedCoords + ScreenCoordsXY{ 0, 11 } }, { alignedCoords + ScreenCoordsXY{ width, 11 } } },
&dpi, { { alignedCoords + ScreenCoordsXY{ 0, 11 } }, { alignedCoords + ScreenCoordsXY{ width, 11 } } },
gTextPalette[1]);
if (gTextPalette[2] != 0)
{
GfxFillRect(
dpi, { { alignedCoords + ScreenCoordsXY{ 1, 12 } }, { alignedCoords + ScreenCoordsXY{ width + 1, 12 } } },
&dpi, { { alignedCoords + ScreenCoordsXY{ 1, 12 } }, { alignedCoords + ScreenCoordsXY{ width + 1, 12 } } },
gTextPalette[2]);
}
}
}
void DrawTextBasic(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, StringId format)
void DrawTextBasic(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, StringId format)
{
Formatter ft{};
TextPaint textPaint{};
DrawTextBasic(dpi, coords, format, ft, textPaint);
}
void DrawTextBasic(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, StringId format, const Formatter& ft, TextPaint textPaint)
void DrawTextBasic(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, StringId format, const Formatter& ft, TextPaint textPaint)
{
utf8 buffer[512];
OpenRCT2::FormatStringLegacy(buffer, sizeof(buffer), format, ft.Data());
DrawText(dpi, coords, textPaint, buffer);
}
void DrawTextEllipsised(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format)
void DrawTextEllipsised(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format)
{
Formatter ft{};
TextPaint textPaint{};
@@ -131,7 +131,7 @@ void DrawTextEllipsised(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_
}
void DrawTextEllipsised(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint)
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint)
{
utf8 buffer[512];
OpenRCT2::FormatStringLegacy(buffer, sizeof(buffer), format, ft.Data());
@@ -140,12 +140,12 @@ void DrawTextEllipsised(
DrawText(dpi, coords, textPaint, buffer);
}
void GfxDrawString(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint)
void GfxDrawString(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint)
{
DrawText(dpi, coords, textPaint, buffer);
}
int32_t DrawTextWrapped(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format)
int32_t DrawTextWrapped(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format)
{
Formatter ft{};
TextPaint textPaint{};
@@ -153,7 +153,7 @@ int32_t DrawTextWrapped(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_
}
int32_t DrawTextWrapped(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint)
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint)
{
const void* args = ft.Data();
+7 -7
View File
@@ -142,17 +142,17 @@ struct TextPaint
}
};
void DrawTextBasic(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, StringId format);
void DrawTextEllipsised(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format);
int32_t DrawTextWrapped(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format);
void DrawTextBasic(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, StringId format);
void DrawTextEllipsised(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format);
int32_t DrawTextWrapped(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format);
void DrawText(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting = false);
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting = false);
void DrawTextBasic(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, StringId format, const Formatter& ft, TextPaint textPaint = {});
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, StringId format, const Formatter& ft, TextPaint textPaint = {});
void DrawTextEllipsised(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft,
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft,
TextPaint textPaint = {});
int32_t DrawTextWrapped(
DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft,
DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft,
TextPaint textPaint = {});
+2 -2
View File
@@ -193,7 +193,7 @@ void ChatDraw(DrawPixelInfo* dpi, uint8_t chatBackgroundColor)
auto ft = Formatter();
ft.Add<const char*>(lineCh);
inputLineHeight = DrawTextWrapped(
dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, ft, { TEXT_COLOUR_255 });
*dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, ft, { TEXT_COLOUR_255 });
GfxSetDirtyBlocks({ screenCoords, { screenCoords + ScreenCoordsXY{ _chatWidth, inputLineHeight + 15 } } });
// TODO: Show caret if the input text has multiple lines
@@ -289,7 +289,7 @@ static int32_t ChatHistoryDrawString(DrawPixelInfo* dpi, const char* text, const
int32_t lineY = screenCoords.y;
for (int32_t line = 0; line <= numLines; ++line)
{
GfxDrawString(dpi, { screenCoords.x, lineY - (numLines * lineHeight) }, bufferPtr, { TEXT_COLOUR_254 });
GfxDrawString(*dpi, { screenCoords.x, lineY - (numLines * lineHeight) }, bufferPtr, { TEXT_COLOUR_254 });
bufferPtr = GetStringEnd(bufferPtr) + 1;
lineY += lineHeight;
}
+1 -1
View File
@@ -95,7 +95,7 @@ void MusicObject::DrawPreview(DrawPixelInfo* dpi, int32_t width, int32_t height)
if (_hasPreview)
GfxDrawSprite(dpi, ImageId(_previewImageId), { 0, 0 });
else
DrawTextBasic(dpi, { x, y }, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE });
DrawTextBasic(*dpi, { x, y }, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE });
}
void MusicObject::ReadJson(IReadObjectContext* context, json_t& root)
+1 -1
View File
@@ -58,7 +58,7 @@ void WaterObject::DrawPreview(DrawPixelInfo* dpi, int32_t width, int32_t height)
{
// Write (no image)
auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 };
DrawTextBasic(dpi, screenCoords, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE });
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE });
}
void WaterObject::ReadJson([[maybe_unused]] IReadObjectContext* context, json_t& root)
+1 -1
View File
@@ -893,7 +893,7 @@ void PaintDrawMoneyStructs(DrawPixelInfo* dpi, PaintStringStruct* ps)
}
GfxDrawStringWithYOffsets(
dpi, buffer, COLOUR_BLACK, { ps->x, ps->y }, reinterpret_cast<int8_t*>(ps->y_offsets), forceSpriteFont,
*dpi, buffer, COLOUR_BLACK, { ps->x, ps->y }, reinterpret_cast<int8_t*>(ps->y_offsets), forceSpriteFont,
FontStyle::Medium);
} while ((ps = ps->next) != nullptr);
}
+2 -2
View File
@@ -94,7 +94,7 @@ void Painter::PaintReplayNotice(DrawPixelInfo* dpi, const char* text)
screenCoords.x = screenCoords.x - stringWidth;
if (((gCurrentTicks >> 1) & 0xF) > 4)
GfxDrawString(dpi, screenCoords, buffer, { COLOUR_SATURATED_RED });
GfxDrawString(*dpi, screenCoords, buffer, { COLOUR_SATURATED_RED });
// Make area dirty so the text doesn't get drawn over the last
GfxSetDirtyBlocks({ screenCoords, screenCoords + ScreenCoordsXY{ stringWidth, 16 } });
@@ -112,7 +112,7 @@ void Painter::PaintFPS(DrawPixelInfo* dpi)
// Draw Text
int32_t stringWidth = GfxGetStringWidth(buffer, FontStyle::Medium);
screenCoords.x = screenCoords.x - (stringWidth / 2);
GfxDrawString(dpi, screenCoords, buffer);
GfxDrawString(*dpi, screenCoords, buffer);
// Make area dirty so the text doesn't get drawn over the last
GfxSetDirtyBlocks({ { screenCoords - ScreenCoordsXY{ 16, 4 } }, { dpi->lastStringPos.x + 16, 16 } });
+2 -2
View File
@@ -448,7 +448,7 @@ void DrawOpenRCT2(DrawPixelInfo* dpi, const ScreenCoordsXY& screenCoords)
// Write name and version information
buffer += gVersionInfoFull;
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 5 - 13), buffer.c_str(), { COLOUR_BLACK });
GfxDrawString(*dpi, screenCoords + ScreenCoordsXY(5, 5 - 13), buffer.c_str(), { COLOUR_BLACK });
// Invalidate screen area
int16_t width = static_cast<int16_t>(GfxGetStringWidth(buffer, FontStyle::Medium));
@@ -461,5 +461,5 @@ void DrawOpenRCT2(DrawPixelInfo* dpi, const ScreenCoordsXY& screenCoords)
buffer.append(" (");
buffer.append(OPENRCT2_ARCHITECTURE);
buffer.append(")");
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 5), buffer.c_str(), { COLOUR_BLACK });
GfxDrawString(*dpi, screenCoords + ScreenCoordsXY(5, 5), buffer.c_str(), { COLOUR_BLACK });
}