From fedfacf47296ef21f2d41017d2bdccc688d55edd Mon Sep 17 00:00:00 2001 From: Rubidium Date: Thu, 2 Jan 2025 16:11:57 +0100 Subject: [PATCH] Codechange: always do StringID + offset, instead of offset + StringID --- src/date_gui.cpp | 4 ++-- src/graph_gui.cpp | 4 ++-- src/order_gui.cpp | 2 +- src/strings.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/date_gui.cpp b/src/date_gui.cpp index 820fe761cc..1d091ef9c4 100644 --- a/src/date_gui.cpp +++ b/src/date_gui.cpp @@ -132,8 +132,8 @@ struct SetDateWindow : Window { void SetStringParameters(WidgetID widget) const override { switch (widget) { - case WID_SD_DAY: SetDParam(0, this->date.day - 1 + STR_DAY_NUMBER_1ST); break; - case WID_SD_MONTH: SetDParam(0, this->date.month + STR_MONTH_JAN); break; + case WID_SD_DAY: SetDParam(0, STR_DAY_NUMBER_1ST + this->date.day - 1); break; + case WID_SD_MONTH: SetDParam(0, STR_MONTH_JAN + this->date.month); break; case WID_SD_YEAR: SetDParam(0, this->date.year); break; } } diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index ee96100023..26a58591e4 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -427,7 +427,7 @@ protected: TimerGameEconomy::Month month = this->month; TimerGameEconomy::Year year = this->year; for (int i = 0; i < this->num_on_x_axis; i++) { - SetDParam(0, month + STR_MONTH_ABBREV_JAN); + SetDParam(0, STR_MONTH_ABBREV_JAN + month); SetDParam(1, year); DrawStringMultiLine(x, x + x_sep, y, this->height, month == 0 ? STR_GRAPH_X_LABEL_MONTH_YEAR : STR_GRAPH_X_LABEL_MONTH, GRAPH_AXIS_LABEL_COLOUR, SA_LEFT); @@ -566,7 +566,7 @@ public: TimerGameEconomy::Month month = this->month; TimerGameEconomy::Year year = this->year; for (int i = 0; i < this->num_on_x_axis; i++) { - SetDParam(0, month + STR_MONTH_ABBREV_JAN); + SetDParam(0, STR_MONTH_ABBREV_JAN + month); SetDParam(1, year); x_label_width = std::max(x_label_width, GetStringBoundingBox(month == 0 ? STR_GRAPH_X_LABEL_MONTH_YEAR : STR_GRAPH_X_LABEL_MONTH).width); diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 77b68d9479..ebde482a21 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -285,7 +285,7 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int if (v->type == VEH_TRAIN && (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) == 0) { /* Only show the stopping location if other than the default chosen by the player. */ if (order->GetStopLocation() != (OrderStopLocation)(_settings_client.gui.stop_location)) { - SetDParam(5, order->GetStopLocation() + STR_ORDER_STOP_LOCATION_NEAR_END); + SetDParam(5, STR_ORDER_STOP_LOCATION_NEAR_END + order->GetStopLocation()); } else { SetDParam(5, STR_EMPTY); } diff --git a/src/strings.cpp b/src/strings.cpp index a5c3e90005..4407d8f085 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -496,7 +496,7 @@ static void FormatYmdString(StringBuilder &builder, TimerGameCalendar::Date date { TimerGameCalendar::YearMonthDay ymd = TimerGameCalendar::ConvertDateToYMD(date); - auto tmp_params = MakeParameters(ymd.day + STR_DAY_NUMBER_1ST - 1, STR_MONTH_ABBREV_JAN + ymd.month, ymd.year); + auto tmp_params = MakeParameters(STR_DAY_NUMBER_1ST + ymd.day - 1, STR_MONTH_ABBREV_JAN + ymd.month, ymd.year); FormatString(builder, GetStringPtr(STR_FORMAT_DATE_LONG), tmp_params, case_index); }