mirror of https://github.com/OpenRCT2/OpenRCT2.git
Replace gfx_draw_string_clipped() calls with DrawTextEllipsised
This commit is contained in:
parent
9a30100a81
commit
b788a099b5
|
@ -364,8 +364,9 @@ static void widget_text_centred(rct_drawpixelinfo* dpi, rct_window* w, rct_widge
|
|||
stringId = STR_STRING;
|
||||
formatArgs = &widget->string;
|
||||
}
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi, stringId, formatArgs, colour, { (topLeft.x + r + 1) / 2 - 1, topLeft.y }, widget->width() - 2);
|
||||
DrawTextEllipsised(
|
||||
dpi, { (topLeft.x + r + 1) / 2 - 1, topLeft.y }, widget->width() - 2, stringId, formatArgs, colour,
|
||||
TextAlignment::CENTRE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -405,7 +406,7 @@ static void widget_text(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex w
|
|||
stringId = STR_STRING;
|
||||
formatArgs = &widget->string;
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, stringId, formatArgs, colour, { l + 1, t }, r - l);
|
||||
DrawTextEllipsised(dpi, { l + 1, t }, r - l, stringId, formatArgs, colour);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -556,7 +557,8 @@ static void widget_caption_draw(rct_drawpixelinfo* dpi, rct_window* w, rct_widge
|
|||
width -= 10;
|
||||
}
|
||||
topLeft.x += width / 2;
|
||||
gfx_draw_string_centred_clipped(dpi, widget->text, gCommonFormatArgs, COLOUR_WHITE | COLOUR_FLAG_OUTLINE, topLeft, width);
|
||||
DrawTextEllipsised(
|
||||
dpi, topLeft, width, widget->text, gCommonFormatArgs, COLOUR_WHITE | COLOUR_FLAG_OUTLINE, TextAlignment::CENTRE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -593,7 +595,7 @@ static void widget_closebox_draw(rct_drawpixelinfo* dpi, rct_window* w, rct_widg
|
|||
if (widget_is_disabled(w, widgetIndex))
|
||||
colour |= COLOUR_FLAG_INSET;
|
||||
|
||||
gfx_draw_string_centred_clipped(dpi, widget->text, gCommonFormatArgs, colour, topLeft, widget->width() - 2);
|
||||
DrawTextEllipsised(dpi, topLeft, widget->width() - 2, widget->text, gCommonFormatArgs, colour, TextAlignment::CENTRE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -670,7 +670,7 @@ void CustomListView::PaintCell(
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(text);
|
||||
gfx_draw_string_left_clipped(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, pos, size.width);
|
||||
DrawTextEllipsised(dpi, pos, size.width, stringId, gCommonFormatArgs, COLOUR_BLACK);
|
||||
}
|
||||
|
||||
std::optional<RowColumn> CustomListView::GetItemIndexAt(const ScreenCoordsXY& pos)
|
||||
|
|
|
@ -398,8 +398,7 @@ static void window_dropdown_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
// Draw item string
|
||||
ScreenCoordsXY screenCoords = { w->windowPos.x + 2 + (cell_x * _dropdown_item_width),
|
||||
w->windowPos.y + 2 + (cell_y * _dropdown_item_height) };
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, item, static_cast<void*>(&gDropdownItemsArgs[i]), colour, screenCoords, w->width - 5);
|
||||
DrawTextEllipsised(dpi, screenCoords, w->width - 5, item, static_cast<void*>(&gDropdownItemsArgs[i]), colour);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -611,7 +611,7 @@ static void window_editor_inventions_list_paint(rct_window* w, rct_drawpixelinfo
|
|||
width = w->width - w->widgets[WIDX_RESEARCH_ORDER_SCROLL].right - 6;
|
||||
|
||||
rct_string_id drawString = window_editor_inventions_list_prepare_name(researchItem, false);
|
||||
gfx_draw_string_centred_clipped(dpi, drawString, gCommonFormatArgs, COLOUR_BLACK, screenPos, width);
|
||||
DrawTextEllipsised(dpi, screenPos, width, drawString, gCommonFormatArgs, COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
screenPos.y += 15;
|
||||
|
||||
// Item category
|
||||
|
|
|
@ -1026,7 +1026,7 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf
|
|||
stringId = _listSortType == RIDE_SORT_TYPE ? static_cast<rct_string_id>(_listSortDescending ? STR_DOWN : STR_UP)
|
||||
: STR_NONE;
|
||||
auto screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 };
|
||||
gfx_draw_string_left_clipped(dpi, STR_OBJECTS_SORT_TYPE, &stringId, w->colours[1], screenPos, widget->width());
|
||||
DrawTextEllipsised(dpi, screenPos, widget->width(), STR_OBJECTS_SORT_TYPE, &stringId, w->colours[1]);
|
||||
}
|
||||
widget = &w->widgets[WIDX_LIST_SORT_RIDE];
|
||||
if (widget->type != WWT_EMPTY)
|
||||
|
@ -1034,7 +1034,7 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf
|
|||
stringId = _listSortType == RIDE_SORT_RIDE ? static_cast<rct_string_id>(_listSortDescending ? STR_DOWN : STR_UP)
|
||||
: STR_NONE;
|
||||
auto screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 };
|
||||
gfx_draw_string_left_clipped(dpi, STR_OBJECTS_SORT_RIDE, &stringId, w->colours[1], screenPos, widget->width());
|
||||
DrawTextEllipsised(dpi, screenPos, widget->width(), STR_OBJECTS_SORT_RIDE, &stringId, w->colours[1]);
|
||||
}
|
||||
|
||||
if (w->selected_list_item == -1 || _loadedObject == nullptr)
|
||||
|
@ -1062,7 +1062,7 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(listItem->repositoryItem->Name.c_str());
|
||||
gfx_draw_string_centred_clipped(dpi, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, COLOUR_BLACK, screenPos, width);
|
||||
DrawTextEllipsised(dpi, screenPos, width, STR_WINDOW_COLOUR_2_STRINGID, ft, COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
}
|
||||
|
||||
// Draw description of object
|
||||
|
@ -1121,9 +1121,9 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf
|
|||
}
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(authorsString.c_str());
|
||||
gfx_draw_string_right_clipped(
|
||||
dpi, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, COLOUR_BLACK, { w->windowPos.x + w->width - 5, screenPos.y },
|
||||
w->width - w->widgets[WIDX_LIST].right - 4);
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + w->width - 5, screenPos.y }, w->width - w->widgets[WIDX_LIST].right - 4,
|
||||
STR_WINDOW_COLOUR_2_STRINGID, ft, COLOUR_BLACK, TextAlignment::RIGHT);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -1194,7 +1194,7 @@ static void window_editor_object_selection_scrollpaint(rct_window* w, rct_drawpi
|
|||
// Draw ride type
|
||||
rct_string_id rideTypeStringId = get_ride_type_string_id(listItem.repositoryItem);
|
||||
safe_strcpy(buffer, language_get_string(rideTypeStringId), 256 - (buffer - bufferWithColour));
|
||||
gfx_draw_string_left_clipped(dpi, STR_STRING, &bufferWithColour, colour, screenCoords, width_limit - 15);
|
||||
DrawTextEllipsised(dpi, screenCoords, width_limit - 15, STR_STRING, &bufferWithColour, colour);
|
||||
screenCoords.x = w->widgets[WIDX_LIST_SORT_RIDE].left - w->widgets[WIDX_LIST].left;
|
||||
}
|
||||
|
||||
|
@ -1207,7 +1207,7 @@ static void window_editor_object_selection_scrollpaint(rct_window* w, rct_drawpi
|
|||
|
||||
*buffer = 0;
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, STR_STRING, &bufferWithColour, colour, screenCoords, width_limit);
|
||||
DrawTextEllipsised(dpi, screenCoords, width_limit, STR_STRING, &bufferWithColour, colour);
|
||||
}
|
||||
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
|
||||
}
|
||||
|
|
|
@ -923,7 +923,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(parkName);
|
||||
gfx_draw_string_left_clipped(dpi, STR_WINDOW_PARK_NAME, gCommonFormatArgs, COLOUR_BLACK, screenCoords, width);
|
||||
DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_PARK_NAME, ft, COLOUR_BLACK);
|
||||
}
|
||||
|
||||
// Scenario name
|
||||
|
@ -933,7 +933,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(gS6Info.name);
|
||||
gfx_draw_string_left_clipped(dpi, STR_WINDOW_SCENARIO_NAME, gCommonFormatArgs, COLOUR_BLACK, screenCoords, width);
|
||||
DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft, COLOUR_BLACK);
|
||||
|
||||
// Scenario details label
|
||||
screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_DETAILS].top };
|
||||
|
|
|
@ -1229,8 +1229,7 @@ static void window_finances_marketing_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
}
|
||||
|
||||
// Advertisement
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, MarketingCampaignNames[i][1], gCommonFormatArgs, COLOUR_BLACK, screenCoords + ScreenCoordsXY{ 4, 0 }, 296);
|
||||
DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, 296, MarketingCampaignNames[i][1], ft, COLOUR_BLACK);
|
||||
|
||||
// Duration
|
||||
uint16_t weeksRemaining = campaign->WeeksLeft;
|
||||
|
|
|
@ -1126,7 +1126,7 @@ void window_guest_overview_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
rct_widget* widget = &w->widgets[WIDX_ACTION_LBL];
|
||||
auto screenPos = w->windowPos + ScreenCoordsXY{ widget->midX(), widget->top - 1 };
|
||||
int32_t width = widget->width();
|
||||
gfx_draw_string_centred_clipped(dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, screenPos, width);
|
||||
DrawTextEllipsised(dpi, screenPos, width, STR_BLACK_STRING, ft, COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
|
||||
// Draw the marquee thought
|
||||
widget = &w->widgets[WIDX_MARQUEE];
|
||||
|
@ -1774,7 +1774,7 @@ void window_guest_rides_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
ride->FormatNameTo(ft);
|
||||
}
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, STR_FAVOURITE_RIDE, gCommonFormatArgs, COLOUR_BLACK, screenCoords, w->width - 14);
|
||||
DrawTextEllipsised(dpi, screenCoords, w->width - 14, STR_FAVOURITE_RIDE, ft, COLOUR_BLACK);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -724,7 +724,7 @@ static void window_guest_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
{
|
||||
format = STR_ALL_GUESTS_SUMMARISED;
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, format, _window_guest_list_filter_arguments.args, COLOUR_BLACK, screenCoords, 310);
|
||||
DrawTextEllipsised(dpi, screenCoords, 310, format, _window_guest_list_filter_arguments.args, COLOUR_BLACK);
|
||||
|
||||
// Number of guests (list items)
|
||||
if (_window_guest_list_selected_tab == PAGE_INDIVIDUAL)
|
||||
|
@ -782,7 +782,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
}
|
||||
auto ft = Formatter::Common();
|
||||
peep->FormatNameTo(ft);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 0, y }, 113);
|
||||
DrawTextEllipsised(dpi, { 0, y }, 113, format, ft, COLOUR_BLACK);
|
||||
|
||||
switch (_window_guest_list_selected_view)
|
||||
{
|
||||
|
@ -797,7 +797,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
// Action
|
||||
ft = Formatter::Common();
|
||||
peep->FormatActionTo(ft);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 133, y }, 314);
|
||||
DrawTextEllipsised(dpi, { 133, y }, 314, format, ft, COLOUR_BLACK);
|
||||
break;
|
||||
case VIEW_THOUGHTS:
|
||||
// For each thought
|
||||
|
@ -812,7 +812,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
break;
|
||||
|
||||
peep_thought_set_format_args(&peep->Thoughts[j]);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 118, y }, 329);
|
||||
DrawTextEllipsised(dpi, { 118, y }, 329, format, gCommonFormatArgs, COLOUR_BLACK);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -857,7 +857,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
std::memcpy(
|
||||
gCommonFormatArgs, _window_guest_list_groups_arguments[i].args,
|
||||
std::min(sizeof(gCommonFormatArgs), sizeof(_window_guest_list_groups_arguments[i].args)));
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 0, y }, 414);
|
||||
DrawTextEllipsised(dpi, { 0, y }, 414, format, gCommonFormatArgs, COLOUR_BLACK);
|
||||
|
||||
// Draw guest count
|
||||
auto ft = Formatter::Common();
|
||||
|
|
|
@ -241,8 +241,7 @@ static void window_install_track_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
if (!gTrackDesignSceneryToggle)
|
||||
{
|
||||
// Scenery not available
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, nullptr, COLOUR_BLACK, screenPos, 368);
|
||||
DrawTextEllipsised(dpi, screenPos, 308, STR_BLACK_STRING, {}, COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
screenPos.y -= LIST_ROW_HEIGHT;
|
||||
}
|
||||
}
|
||||
|
@ -314,7 +313,7 @@ static void window_install_track_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_RIDE_LENGTH_ENTRY);
|
||||
ft.Add<uint16_t>(td6->ride_length);
|
||||
gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, screenPos, 214);
|
||||
DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft, COLOUR_BLACK);
|
||||
screenPos.y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
|
|
|
@ -718,8 +718,7 @@ static void window_loadsave_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
// Draw path text
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<utf8*>(Platform::StrDecompToPrecomp(buffer));
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, COLOUR_BLACK, { w->windowPos.x + 4, w->windowPos.y + 20 }, w->width - 8);
|
||||
DrawTextEllipsised(dpi, { w->windowPos.x + 4, w->windowPos.y + 20 }, w->width - 8, STR_STRING, ft, COLOUR_BLACK);
|
||||
|
||||
// Name button text
|
||||
rct_string_id id = STR_NONE;
|
||||
|
@ -784,7 +783,7 @@ static void window_loadsave_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
|||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<char*>(_listItems[i].name.c_str());
|
||||
int32_t max_file_width = w->widgets[WIDX_SORT_NAME].width() - 10;
|
||||
gfx_draw_string_left_clipped(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, { 10, y }, max_file_width);
|
||||
DrawTextEllipsised(dpi, { 10, y }, max_file_width, stringId, ft, COLOUR_BLACK);
|
||||
|
||||
// Print formatted modified date, if this is a file
|
||||
if (_listItems[i].type == TYPE_FILE)
|
||||
|
@ -792,14 +791,12 @@ static void window_loadsave_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
|||
ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<char*>(_listItems[i].date_formatted.c_str());
|
||||
gfx_draw_string_right_clipped(
|
||||
dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, { dateAnchor - DATE_TIME_GAP, y }, maxDateWidth);
|
||||
DrawTextEllipsised(dpi, { dateAnchor - DATE_TIME_GAP, y }, maxDateWidth, stringId, ft, COLOUR_BLACK);
|
||||
|
||||
ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<char*>(_listItems[i].time_formatted.c_str());
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, { dateAnchor + DATE_TIME_GAP, y }, maxTimeWidth);
|
||||
DrawTextEllipsised(dpi, { dateAnchor + DATE_TIME_GAP, y }, maxTimeWidth, stringId, ft, COLOUR_BLACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -703,7 +703,7 @@ static void window_multiplayer_players_scrollpaint(rct_window* w, rct_drawpixeli
|
|||
{
|
||||
ft.Add<rct_string_id>(STR_ACTION_NA);
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, { 256, screenCoords.y }, 100);
|
||||
DrawTextEllipsised(dpi, { 256, screenCoords.y }, 100, STR_BLACK_STRING, ft, COLOUR_BLACK);
|
||||
|
||||
// Draw ping
|
||||
lineCh = buffer;
|
||||
|
@ -914,9 +914,9 @@ static void window_multiplayer_groups_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
safe_strcpy(lineCh, network_get_group_name(group), sizeof(buffer) - (lineCh - buffer));
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<const char*>(buffer);
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, COLOUR_BLACK, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top },
|
||||
widget->width() - 8);
|
||||
DrawTextEllipsised(
|
||||
dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
|
||||
COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
}
|
||||
|
||||
auto screenPos = w->windowPos
|
||||
|
@ -941,9 +941,9 @@ static void window_multiplayer_groups_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
safe_strcpy(lineCh, network_get_group_name(group), sizeof(buffer) - (lineCh - buffer));
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<const char*>(buffer);
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, COLOUR_BLACK, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top },
|
||||
widget->width() - 8);
|
||||
DrawTextEllipsised(
|
||||
dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
|
||||
COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -925,8 +925,7 @@ static void window_new_ride_paint_ride_information(
|
|||
if (availabilityString[0] != 0)
|
||||
{
|
||||
const char* drawString = availabilityString;
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_AVAILABLE_VEHICLES, &drawString, COLOUR_BLACK, screenPos + ScreenCoordsXY{ 0, 39 }, WW - 2);
|
||||
DrawTextEllipsised(dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WW - 2, STR_AVAILABLE_VEHICLES, &drawString, COLOUR_BLACK);
|
||||
}
|
||||
|
||||
if (item.Type != _lastTrackDesignCountRideType.Type || item.EntryIndex != _lastTrackDesignCountRideType.EntryIndex)
|
||||
|
|
|
@ -566,8 +566,7 @@ static void window_object_load_error_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_OBJECT_ERROR_WINDOW_FILE);
|
||||
ft.Add<utf8*>(file_path.c_str());
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, { w->windowPos.x + 5, w->windowPos.y + 43 }, WW - 5);
|
||||
DrawTextEllipsised(dpi, { w->windowPos.x + 5, w->windowPos.y + 43 }, WW - 5, STR_BLACK_STRING, ft, COLOUR_BLACK);
|
||||
}
|
||||
|
||||
static void window_object_load_error_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
||||
|
|
|
@ -2088,7 +2088,7 @@ static void window_options_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0;
|
||||
ScreenCoordsXY screenCoords = { w->windowPos.x + pathWidget.left + 1,
|
||||
w->windowPos.y + pathWidget.top + static_cast<int32_t>(padding) };
|
||||
gfx_draw_string_left_clipped(dpi, STR_STRING, gCommonFormatArgs, w->colours[1], screenCoords, 277);
|
||||
DrawTextEllipsised(dpi, screenCoords, 277, STR_STRING, ft, w->colours[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -875,9 +875,9 @@ static void window_park_entrance_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
ft.Add<rct_string_id>(park_is_open() ? STR_PARK_OPEN : STR_PARK_CLOSED);
|
||||
|
||||
labelWidget = &window_park_entrance_widgets[WIDX_STATUS];
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK,
|
||||
w->windowPos + ScreenCoordsXY{ labelWidget->midX(), labelWidget->top }, labelWidget->width());
|
||||
DrawTextEllipsised(
|
||||
dpi, w->windowPos + ScreenCoordsXY{ labelWidget->midX(), labelWidget->top }, labelWidget->width(), STR_BLACK_STRING, ft,
|
||||
COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -377,9 +377,9 @@ void window_player_overview_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<const char*>(buffer);
|
||||
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, COLOUR_BLACK, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top },
|
||||
widget->width() - 8);
|
||||
DrawTextEllipsised(
|
||||
dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
|
||||
COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
}
|
||||
|
||||
// Draw ping
|
||||
|
@ -405,7 +405,7 @@ void window_player_overview_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
{
|
||||
ft.Add<rct_string_id>(STR_ACTION_NA);
|
||||
}
|
||||
gfx_draw_string_centred_clipped(dpi, STR_LAST_ACTION_RAN, gCommonFormatArgs, COLOUR_BLACK, screenCoords, width);
|
||||
DrawTextEllipsised(dpi, screenCoords, width, STR_LAST_ACTION_RAN, ft, COLOUR_BLACK);
|
||||
|
||||
if (w->viewport != nullptr && w->var_492 != -1)
|
||||
{
|
||||
|
|
|
@ -2840,9 +2840,9 @@ static void window_ride_main_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
ft = Formatter::Common();
|
||||
widget = &window_ride_main_widgets[WIDX_STATUS];
|
||||
rct_string_id rideStatus = window_ride_get_status(w, ft);
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi, rideStatus, gCommonFormatArgs, COLOUR_BLACK,
|
||||
w->windowPos + ScreenCoordsXY{ (widget->left + widget->right) / 2, widget->top }, widget->width());
|
||||
DrawTextEllipsised(
|
||||
dpi, w->windowPos + ScreenCoordsXY{ (widget->left + widget->right) / 2, widget->top }, widget->width(), rideStatus, ft,
|
||||
COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
@ -5027,8 +5027,7 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
}
|
||||
}
|
||||
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STATION_STYLE, gCommonFormatArgs, COLOUR_BLACK, { w->windowPos.x + 3, w->windowPos.y + 103 }, 97);
|
||||
DrawTextEllipsised(dpi, { w->windowPos.x + 3, w->windowPos.y + 103 }, 97, STR_STATION_STYLE, {}, COLOUR_BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5765,7 +5764,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
ft.Add<uint16_t>(0);
|
||||
ft.Add<uint16_t>(0);
|
||||
ft.Add<uint16_t>(0);
|
||||
gfx_draw_string_left_clipped(dpi, STR_RIDE_TIME, gCommonFormatArgs, COLOUR_BLACK, screenCoords, 308);
|
||||
DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_TIME, ft, COLOUR_BLACK);
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
|
@ -5803,7 +5802,8 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
ft.Add<uint16_t>(0);
|
||||
ft.Add<uint16_t>(0);
|
||||
ft.Add<uint16_t>(0);
|
||||
gfx_draw_string_left_clipped(dpi, STR_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, screenCoords, 308);
|
||||
DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_LENGTH, ft, COLOUR_BLACK);
|
||||
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
|
|
|
@ -609,7 +609,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
// Ride name
|
||||
auto ft = Formatter::Common();
|
||||
ride->FormatNameTo(ft);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 0, y - 1 }, 159);
|
||||
DrawTextEllipsised(dpi, { 0, y - 1 }, 159, format, ft, COLOUR_BLACK);
|
||||
|
||||
// Ride information
|
||||
ft.Rewind();
|
||||
|
@ -751,7 +751,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
ft.Rewind();
|
||||
ft.Add<rct_string_id>(formatSecondary);
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 160, y - 1 }, 157);
|
||||
DrawTextEllipsised(dpi, { 160, y - 1 }, 157, format, ft, COLOUR_BLACK);
|
||||
y += SCROLLABLE_ROW_HEIGHT;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -476,8 +476,8 @@ static void window_scenarioselect_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
auto screenPos = w->windowPos
|
||||
+ ScreenCoordsXY{ window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4,
|
||||
window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5 };
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi, STR_SCENARIO_LOCKED, nullptr, COLOUR_BLACK, screenPos + ScreenCoordsXY{ 85, 0 }, 170);
|
||||
DrawTextEllipsised(
|
||||
dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_SCENARIO_LOCKED, {}, COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
gfx_draw_string_left_wrapped(
|
||||
dpi, nullptr, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_LOCKED_DESC, COLOUR_BLACK);
|
||||
}
|
||||
|
@ -505,8 +505,8 @@ static void window_scenarioselect_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(scenario->name);
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, COLOUR_BLACK, screenPos + ScreenCoordsXY{ 85, 0 }, 170);
|
||||
DrawTextEllipsised(
|
||||
dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_WINDOW_COLOUR_2_STRINGID, ft, COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
screenPos.y += 15;
|
||||
|
||||
// Scenario details
|
||||
|
|
|
@ -1188,9 +1188,8 @@ void window_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(sceneryEntry != nullptr ? sceneryEntry->name : static_cast<rct_string_id>(STR_UNKNOWN_OBJECT_TYPE));
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, { w->windowPos.x + 3, w->windowPos.y + w->height - 13 },
|
||||
w->width - 19);
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + 3, w->windowPos.y + w->height - 13 }, w->width - 19, STR_BLACK_STRING, ft, COLOUR_BLACK);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -481,8 +481,8 @@ static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
}
|
||||
|
||||
// Finally, draw the server information.
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, &serverInfoToShow, colour, screenCoords + ScreenCoordsXY{ 0, 3 }, spaceAvailableForInfo);
|
||||
DrawTextEllipsised(
|
||||
dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, spaceAvailableForInfo, STR_STRING, &serverInfoToShow, colour);
|
||||
|
||||
int32_t right = width - 7 - SCROLLBAR_WIDTH;
|
||||
|
||||
|
|
|
@ -373,7 +373,7 @@ static void window_shortcut_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_SHORTCUT_ENTRY_FORMAT);
|
||||
ft.Add<rct_string_id>(ShortcutList[i].StringId);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 0, y - 1 }, bindingOffset);
|
||||
DrawTextEllipsised(dpi, { 0, y - 1 }, bindingOffset, format, ft, COLOUR_BLACK);
|
||||
|
||||
char keybinding[128];
|
||||
keyboard_shortcuts_format_string(keybinding, 128, static_cast<int32_t>(ShortcutList[i].ShortcutId));
|
||||
|
@ -384,7 +384,7 @@ static void window_shortcut_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
|||
ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<char*>(keybinding);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { bindingOffset, y - 1 }, maxWidth);
|
||||
DrawTextEllipsised(dpi, { bindingOffset, y - 1 }, maxWidth, format, ft, COLOUR_BLACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1000,7 +1000,7 @@ void window_staff_overview_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
rct_widget* widget = &w->widgets[WIDX_BTM_LABEL];
|
||||
auto screenPos = w->windowPos + ScreenCoordsXY{ widget->midX(), widget->top };
|
||||
int32_t width = widget->width();
|
||||
gfx_draw_string_centred_clipped(dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, screenPos, width);
|
||||
DrawTextEllipsised(dpi, screenPos, width, STR_BLACK_STRING, ft, COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -715,11 +715,11 @@ void window_staff_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_
|
|||
|
||||
auto ft = Formatter::Common();
|
||||
peep->FormatNameTo(ft);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 0, y }, nameColumnSize);
|
||||
DrawTextEllipsised(dpi, { 0, y }, nameColumnSize, format, ft, COLOUR_BLACK);
|
||||
|
||||
ft = Formatter::Common();
|
||||
peep->FormatActionTo(ft);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { actionOffset, y }, actionColumnSize);
|
||||
DrawTextEllipsised(dpi, { actionOffset, y }, actionColumnSize, format, ft, COLOUR_BLACK);
|
||||
|
||||
// True if a patrol path is set for the worker
|
||||
if (gStaffModes[peep->StaffId] == StaffMode::Patrol)
|
||||
|
|
|
@ -833,19 +833,22 @@ void window_themes_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
|
||||
if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS)
|
||||
{
|
||||
size_t activeAvailableThemeIndex = theme_manager_get_active_available_theme_index();
|
||||
const utf8* activeThemeName = theme_manager_get_available_theme_name(activeAvailableThemeIndex);
|
||||
Formatter::Common().Add<const utf8*>(activeThemeName);
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_THEMES_LABEL_CURRENT_THEME, nullptr, w->colours[1],
|
||||
w->windowPos + ScreenCoordsXY{ 10, window_themes_widgets[WIDX_THEMES_PRESETS].top + 1 });
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1],
|
||||
w->windowPos
|
||||
+ ScreenCoordsXY{ window_themes_widgets[WIDX_THEMES_PRESETS].left + 1,
|
||||
window_themes_widgets[WIDX_THEMES_PRESETS].top },
|
||||
w->windowPos.x + window_themes_widgets[WIDX_THEMES_PRESETS_DROPDOWN].left
|
||||
- window_themes_widgets[WIDX_THEMES_PRESETS].left - 4);
|
||||
|
||||
size_t activeAvailableThemeIndex = theme_manager_get_active_available_theme_index();
|
||||
const utf8* activeThemeName = theme_manager_get_available_theme_name(activeAvailableThemeIndex);
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<const utf8*>(activeThemeName);
|
||||
|
||||
auto screenPos = w->windowPos
|
||||
+ ScreenCoordsXY{ window_themes_widgets[WIDX_THEMES_PRESETS].left + 1,
|
||||
window_themes_widgets[WIDX_THEMES_PRESETS].top };
|
||||
auto width = w->windowPos.x + window_themes_widgets[WIDX_THEMES_PRESETS_DROPDOWN].left
|
||||
- window_themes_widgets[WIDX_THEMES_PRESETS].left - 4;
|
||||
|
||||
DrawTextEllipsised(dpi, screenPos, width, STR_STRING, ft, w->colours[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1722,33 +1722,33 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
rct_widget* widget;
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_TYPE])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TILE_INSPECTOR_ELEMENT_TYPE, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->width());
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->width(),
|
||||
STR_TILE_INSPECTOR_ELEMENT_TYPE, gCommonFormatArgs, w->colours[1]);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_BASEHEIGHT])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->width());
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->width(),
|
||||
STR_TILE_INSPECTOR_BASE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1]);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_CLEARANCEHEIGHT])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TILE_INSPECTOR_CLEARANGE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->width());
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->width(),
|
||||
STR_TILE_INSPECTOR_CLEARANGE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1]);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_GHOSTFLAG])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TILE_INSPECTOR_FLAG_GHOST_SHORT, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->width());
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->width(),
|
||||
STR_TILE_INSPECTOR_FLAG_GHOST_SHORT, gCommonFormatArgs, w->colours[1]);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_LASTFLAG])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TILE_INSPECTOR_FLAG_LAST_SHORT, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->width());
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->width(),
|
||||
STR_TILE_INSPECTOR_FLAG_LAST_SHORT, gCommonFormatArgs, w->colours[1]);
|
||||
}
|
||||
|
||||
ScreenCoordsXY screenCoords(w->windowPos.x, w->windowPos.y);
|
||||
|
@ -2323,9 +2323,8 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo*
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<char*>(typeName);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, stringFormat, gCommonFormatArgs, COLOUR_BLACK, screenCoords + ScreenCoordsXY{ COL_X_TYPE + 3, 0 },
|
||||
COL_X_BH); // 3px padding
|
||||
DrawTextEllipsised(
|
||||
dpi, screenCoords + ScreenCoordsXY{ COL_X_TYPE + 3, 0 }, COL_X_BH, stringFormat, ft, COLOUR_BLACK); // 3px padding
|
||||
|
||||
// Base height
|
||||
ft = Formatter::Common();
|
||||
|
|
|
@ -739,29 +739,30 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
|||
dpi, STR_TITLE_COMMAND_EDITOR_COMMAND_LABEL, nullptr, w->colours[1], w->windowPos + ScreenCoordsXY{ WS, BY - 14 });
|
||||
|
||||
// Command dropdown name
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, command_info.nameStringId, nullptr, w->colours[1],
|
||||
{ w->windowPos.x + w->widgets[WIDX_COMMAND].left + 1, w->windowPos.y + w->widgets[WIDX_COMMAND].top },
|
||||
w->widgets[WIDX_COMMAND_DROPDOWN].left - w->widgets[WIDX_COMMAND].left - 4);
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + w->widgets[WIDX_COMMAND].left + 1, w->windowPos.y + w->widgets[WIDX_COMMAND].top },
|
||||
w->widgets[WIDX_COMMAND_DROPDOWN].left - w->widgets[WIDX_COMMAND].left - 4, command_info.nameStringId, {},
|
||||
w->colours[1]);
|
||||
|
||||
// Label (e.g. "Location:")
|
||||
gfx_draw_string_left(dpi, command_info.descStringId, nullptr, w->colours[1], w->windowPos + ScreenCoordsXY{ WS, BY2 - 14 });
|
||||
|
||||
if (command.Type == TITLE_SCRIPT_SPEED)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, SpeedNames[command.Speed - 1], nullptr, w->colours[1],
|
||||
{ w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4, SpeedNames[command.Speed - 1], {},
|
||||
w->colours[1]);
|
||||
}
|
||||
if (command.Type == TITLE_SCRIPT_FOLLOW)
|
||||
{
|
||||
uint8_t colour = COLOUR_BLACK;
|
||||
rct_string_id spriteString = STR_TITLE_COMMAND_EDITOR_FORMAT_SPRITE_NAME;
|
||||
auto ft = Formatter::Common();
|
||||
if (command.SpriteIndex != SPRITE_INDEX_NULL)
|
||||
{
|
||||
window_draw_viewport(dpi, w);
|
||||
Formatter::Common().Add<utf8*>(command.SpriteName);
|
||||
ft.Add<utf8*>(command.SpriteName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -772,37 +773,36 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
|||
gfx_set_dirty_blocks(
|
||||
{ { w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_VIEWPORT].left, w->widgets[WIDX_VIEWPORT].top } },
|
||||
{ w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_VIEWPORT].right, w->widgets[WIDX_VIEWPORT].bottom } } });
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, spriteString, gCommonFormatArgs, colour,
|
||||
{ w->windowPos.x + w->widgets[WIDX_VIEWPORT].left + 2, w->windowPos.y + w->widgets[WIDX_VIEWPORT].top + 1 },
|
||||
w->widgets[WIDX_VIEWPORT].width() - 2);
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + w->widgets[WIDX_VIEWPORT].left + 2, w->windowPos.y + w->widgets[WIDX_VIEWPORT].top + 1 },
|
||||
w->widgets[WIDX_VIEWPORT].width() - 2, spriteString, ft, colour);
|
||||
}
|
||||
else if (command.Type == TITLE_SCRIPT_LOAD)
|
||||
{
|
||||
if (command.SaveIndex == SAVE_INDEX_INVALID)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TITLE_COMMAND_EDITOR_NO_SAVE_SELECTED, nullptr, w->colours[1],
|
||||
{ w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4,
|
||||
STR_TITLE_COMMAND_EDITOR_NO_SAVE_SELECTED, {}, w->colours[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Formatter::Common().Add<utf8*>(_sequence->Saves[command.SaveIndex]);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<utf8*>(_sequence->Saves[command.SaveIndex]);
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4, STR_STRING, ft, w->colours[1]);
|
||||
}
|
||||
}
|
||||
else if (command.Type == TITLE_SCRIPT_LOADSC)
|
||||
{
|
||||
if (command.Scenario[0] == '\0')
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TITLE_COMMAND_EDITOR_NO_SCENARIO_SELECTED, nullptr, w->colours[1],
|
||||
{ w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4,
|
||||
STR_TITLE_COMMAND_EDITOR_NO_SCENARIO_SELECTED, {}, w->colours[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -817,11 +817,11 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
|||
{
|
||||
nameString = STR_TITLE_COMMAND_EDITOR_MISSING_SCENARIO;
|
||||
}
|
||||
Formatter::Common().Add<const char*>(name);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, nameString, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<const char*>(name);
|
||||
DrawTextEllipsised(
|
||||
dpi, { w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4, nameString, ft, w->colours[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -831,17 +831,19 @@ static void window_title_editor_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
{
|
||||
case WINDOW_TITLE_EDITOR_TAB_PRESETS:
|
||||
{
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<const char*>(_sequenceName);
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_TITLE_SEQUENCE, nullptr, w->colours[1],
|
||||
w->windowPos + ScreenCoordsXY{ 10, window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].top + 1 });
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].left + 1,
|
||||
w->windowPos.y + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].top },
|
||||
w->windowPos.x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS_DROPDOWN].left
|
||||
- window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].left - 4);
|
||||
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<const char*>(_sequenceName);
|
||||
|
||||
ScreenCoordsXY screenPos = { w->windowPos.x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].left + 1,
|
||||
w->windowPos.y + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].top };
|
||||
auto width = w->windowPos.x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS_DROPDOWN].left
|
||||
- window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].left - 4;
|
||||
|
||||
DrawTextEllipsised(dpi, screenPos, width, STR_STRING, ft, w->colours[1]);
|
||||
break;
|
||||
}
|
||||
case WINDOW_TITLE_EDITOR_TAB_SAVES:
|
||||
|
|
|
@ -558,7 +558,7 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
&& !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER))
|
||||
{
|
||||
// Vehicle design not available
|
||||
gfx_draw_string_centred_clipped(dpi, STR_VEHICLE_DESIGN_UNAVAILABLE, nullptr, COLOUR_BLACK, screenPos, 368);
|
||||
DrawTextEllipsised(dpi, screenPos, 368, STR_VEHICLE_DESIGN_UNAVAILABLE, {}, COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
screenPos.y -= SCROLLABLE_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
|
@ -567,15 +567,15 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
if (!gTrackDesignSceneryToggle)
|
||||
{
|
||||
// Scenery not available
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, nullptr, COLOUR_BLACK, screenPos, 368);
|
||||
DrawTextEllipsised(
|
||||
dpi, screenPos, 368, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
screenPos.y -= SCROLLABLE_ROW_HEIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
// Track design name
|
||||
utf8* trackName = _trackDesigns[trackIndex].name;
|
||||
gfx_draw_string_centred_clipped(dpi, STR_TRACK_PREVIEW_NAME_FORMAT, &trackName, COLOUR_BLACK, screenPos, 368);
|
||||
DrawTextEllipsised(dpi, screenPos, 368, STR_TRACK_PREVIEW_NAME_FORMAT, &trackName, COLOUR_BLACK, TextAlignment::CENTRE);
|
||||
|
||||
// Information
|
||||
screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->bottom + 2 };
|
||||
|
@ -622,7 +622,7 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_RIDE_LENGTH_ENTRY);
|
||||
ft.Add<uint16_t>(_loadedTrackDesign->ride_length);
|
||||
gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, screenPos, 214);
|
||||
DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft, COLOUR_BLACK);
|
||||
screenPos.y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
|
|
|
@ -744,16 +744,6 @@ void gfx_draw_string_centred(
|
|||
void gfx_draw_string_right(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, const ScreenCoordsXY& coords);
|
||||
|
||||
/** @deprecated */
|
||||
void gfx_draw_string_left_clipped(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, const ScreenCoordsXY& coords, int32_t width);
|
||||
/** @deprecated */
|
||||
void gfx_draw_string_centred_clipped(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, const ScreenCoordsXY& coords, int32_t width);
|
||||
/** @deprecated */
|
||||
void gfx_draw_string_right_clipped(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, const ScreenCoordsXY& coords, int32_t width);
|
||||
|
||||
int32_t gfx_draw_string_left_wrapped(
|
||||
rct_drawpixelinfo* dpi, void* args, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, uint8_t colour);
|
||||
int32_t gfx_draw_string_centred_wrapped(
|
||||
|
|
|
@ -177,25 +177,6 @@ void gfx_draw_string_right(
|
|||
DrawTextBasic(dpi, coords, format, args, colour, TextAlignment::RIGHT);
|
||||
}
|
||||
|
||||
// Ellipsised
|
||||
void gfx_draw_string_left_clipped(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, const ScreenCoordsXY& coords, int32_t width)
|
||||
{
|
||||
DrawTextEllipsised(dpi, coords, width, format, args, colour, TextAlignment::LEFT);
|
||||
}
|
||||
|
||||
void gfx_draw_string_centred_clipped(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, const ScreenCoordsXY& coords, int32_t width)
|
||||
{
|
||||
DrawTextEllipsised(dpi, coords, width, format, args, colour, TextAlignment::CENTRE);
|
||||
}
|
||||
|
||||
void gfx_draw_string_right_clipped(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, const ScreenCoordsXY& coords, int32_t width)
|
||||
{
|
||||
DrawTextEllipsised(dpi, coords, width, format, args, colour, TextAlignment::RIGHT);
|
||||
}
|
||||
|
||||
// Wrapping
|
||||
int32_t gfx_draw_string_left_wrapped(
|
||||
rct_drawpixelinfo* dpi, void* args, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, uint8_t colour)
|
||||
|
|
|
@ -52,13 +52,13 @@ public:
|
|||
|
||||
void DrawTextBasic(
|
||||
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const Formatter& ft, colour_t colour,
|
||||
TextAlignment alignment, bool underline = false);
|
||||
TextAlignment alignment = TextAlignment::LEFT, bool underline = false);
|
||||
void DrawTextBasic(
|
||||
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const void* args, colour_t colour,
|
||||
TextAlignment alignment, bool underline = false);
|
||||
TextAlignment alignment = TextAlignment::LEFT, bool underline = false);
|
||||
void DrawTextEllipsised(
|
||||
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft,
|
||||
colour_t colour, TextAlignment alignment, bool underline = false);
|
||||
colour_t colour, TextAlignment alignment = TextAlignment::LEFT, bool underline = false);
|
||||
void DrawTextEllipsised(
|
||||
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const void* args,
|
||||
colour_t colour, TextAlignment alignment, bool underline = false);
|
||||
colour_t colour, TextAlignment alignment = TextAlignment::LEFT, bool underline = false);
|
||||
|
|
Loading…
Reference in New Issue