Update to 15.0-beta1

This commit is contained in:
dP
2024-12-25 20:34:06 +05:00
parent 46dc456049
commit a86fd7c621
963 changed files with 38070 additions and 33798 deletions

View File

@@ -51,19 +51,20 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r)
}
std::string capacity = GetString(STR_VEHICLE_DETAILS_TRAIN_ARTICULATED_RV_CAPACITY);
std::string_view list_separator = GetListSeparator();
bool first = true;
for (const CargoSpec *cs : _sorted_cargo_specs) {
CargoID cid = cs->Index();
if (max_cargo[cid] > 0) {
if (!first) capacity += ", ";
if (!first) capacity += list_separator;
SetDParam(0, cid);
SetDParam(1, max_cargo[cid]);
capacity += GetString(STR_JUST_CARGO);
AppendStringInPlace(capacity, STR_JUST_CARGO);
if (subtype_text[cid] != STR_NULL) {
capacity += GetString(subtype_text[cid]);
AppendStringInPlace(capacity, subtype_text[cid]);
}
first = false;
@@ -132,6 +133,10 @@ void DrawRoadVehImage(const Vehicle *v, const Rect &r, VehicleID selection, Engi
AutoRestoreBackup dpi_backup(_cur_dpi, &tmp_dpi);
bool do_overlays = ShowCargoIconOverlay();
/* List of overlays, only used if cargo icon overlays are enabled. */
static std::vector<CargoIconOverlay> overlays;
int px = rtl ? max_width + skip : -skip;
int y = r.Height() / 2;
for (; u != nullptr && (rtl ? px > 0 : px < max_width); u = u->Next())
@@ -146,9 +151,15 @@ void DrawRoadVehImage(const Vehicle *v, const Rect &r, VehicleID selection, Engi
seq.Draw(px + (rtl ? -offset.x : offset.x), y + offset.y, pal, (u->vehstatus & VS_CRASHED) != 0);
}
if (do_overlays) AddCargoIconOverlay(overlays, px, width, u);
px += rtl ? -width : width;
}
if (do_overlays) {
DrawCargoIconOverlays(overlays, y);
overlays.clear();
}
if (v->index == selection) {
int height = ScaleSpriteTrad(12);
Rect hr = {(rtl ? px : 0), 0, (rtl ? max_width : px) - 1, height - 1};