1
0
Fork 0

Codechange: always do StringID + offset, instead of offset + StringID

pull/13237/head
Rubidium 2025-01-02 16:11:57 +01:00 committed by rubidium42
parent 4edde7d6de
commit fedfacf472
4 changed files with 6 additions and 6 deletions

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}