Codechange: Remove TKM string codes by duplicating strings.

This commit is contained in:
frosch 2024-01-26 21:05:09 +01:00 committed by frosch
parent bd3d687bf9
commit 68c64d2511
13 changed files with 126 additions and 69 deletions

View File

@ -437,7 +437,7 @@ public:
if (_settings_game.economy.infrastructure_maintenance) {
Money monthly = _price[PR_INFRASTRUCTURE_AIRPORT] * as->maintenance_cost >> 3;
SetDParam(0, monthly * 12);
DrawString(r.left, r.right, top, STR_STATION_BUILD_INFRASTRUCTURE_COST);
DrawString(r.left, r.right, top, TimerGameEconomy::UsingWallclockUnits() ? STR_STATION_BUILD_INFRASTRUCTURE_COST_PERIOD : STR_STATION_BUILD_INFRASTRUCTURE_COST_YEAR);
top += GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_normal;
}

View File

@ -620,7 +620,7 @@ static int DrawRailWagonPurchaseInfo(int left, int right, int y, EngineID engine
/* Running cost */
if (rvi->running_cost_class != INVALID_PRICE) {
SetDParam(0, e->GetRunningCost());
DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
DrawString(left, right, y, TimerGameEconomy::UsingWallclockUnits() ? STR_PURCHASE_INFO_RUNNINGCOST_PERIOD : STR_PURCHASE_INFO_RUNNINGCOST_YEAR);
y += GetCharacterHeight(FS_NORMAL);
}
@ -661,7 +661,7 @@ static int DrawRailEnginePurchaseInfo(int left, int right, int y, EngineID engin
/* Running cost */
if (rvi->running_cost_class != INVALID_PRICE) {
SetDParam(0, e->GetRunningCost());
DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
DrawString(left, right, y, TimerGameEconomy::UsingWallclockUnits() ? STR_PURCHASE_INFO_RUNNINGCOST_PERIOD : STR_PURCHASE_INFO_RUNNINGCOST_YEAR);
y += GetCharacterHeight(FS_NORMAL);
}
@ -727,7 +727,7 @@ static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_n
/* Running cost */
SetDParam(0, e->GetRunningCost());
DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
DrawString(left, right, y, TimerGameEconomy::UsingWallclockUnits() ? STR_PURCHASE_INFO_RUNNINGCOST_PERIOD : STR_PURCHASE_INFO_RUNNINGCOST_YEAR);
y += GetCharacterHeight(FS_NORMAL);
return y;
@ -784,7 +784,7 @@ static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_numb
/* Running cost */
SetDParam(0, e->GetRunningCost());
DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
DrawString(left, right, y, TimerGameEconomy::UsingWallclockUnits() ? STR_PURCHASE_INFO_RUNNINGCOST_PERIOD : STR_PURCHASE_INFO_RUNNINGCOST_YEAR);
y += GetCharacterHeight(FS_NORMAL);
return y;
@ -835,7 +835,7 @@ static int DrawAircraftPurchaseInfo(int left, int right, int y, EngineID engine_
/* Running cost */
SetDParam(0, e->GetRunningCost());
DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
DrawString(left, right, y, TimerGameEconomy::UsingWallclockUnits() ? STR_PURCHASE_INFO_RUNNINGCOST_PERIOD : STR_PURCHASE_INFO_RUNNINGCOST_YEAR);
y += GetCharacterHeight(FS_NORMAL);
/* Aircraft type */

View File

@ -138,7 +138,7 @@ static uint GetTotalCategoriesHeight()
*/
static uint GetMaxCategoriesWidth()
{
uint max_width = GetStringBoundingBox(STR_FINANCES_YEAR_CAPTION).width;
uint max_width = GetStringBoundingBox(TimerGameEconomy::UsingWallclockUnits() ? STR_FINANCES_PERIOD_CAPTION : STR_FINANCES_YEAR_CAPTION).width;
/* Loop through categories to check max widths. */
for (const ExpensesList &list : _expenses_list_types) {
@ -175,7 +175,7 @@ static void DrawCategories(const Rect &r)
{
int y = r.top;
/* Draw description of 12-minute economic period. */
DrawString(r.left, r.right, y, (STR_FINANCES_YEAR_CAPTION), TC_FROMSTRING, SA_LEFT, true);
DrawString(r.left, r.right, y, (TimerGameEconomy::UsingWallclockUnits() ? STR_FINANCES_PERIOD_CAPTION : STR_FINANCES_YEAR_CAPTION), TC_FROMSTRING, SA_LEFT, true);
y += GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_wide;
for (const ExpensesList &list : _expenses_list_types) {
@ -1982,12 +1982,13 @@ struct CompanyInfrastructureWindow : Window
uint count_width = GetStringBoundingBox(STR_JUST_COMMA).width + WidgetDimensions::scaled.hsep_indent; // Reserve some wiggle room
if (_settings_game.economy.infrastructure_maintenance) {
StringID str_total = TimerGameEconomy::UsingWallclockUnits() ? STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL_PERIOD : STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL_YEAR;
SetDParamMaxValue(0, this->GetTotalMaintenanceCost() * 12); // Convert to per year
this->total_width = GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL).width + WidgetDimensions::scaled.hsep_indent * 2;
this->total_width = GetStringBoundingBox(str_total).width + WidgetDimensions::scaled.hsep_indent * 2;
size->width = std::max(size->width, this->total_width);
SetDParamMaxValue(0, max_cost * 12); // Convert to per year
count_width += std::max(this->total_width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL).width);
count_width += std::max(this->total_width, GetStringBoundingBox(str_total).width);
}
size->width = std::max(size->width, count_width);
@ -2016,7 +2017,9 @@ struct CompanyInfrastructureWindow : Window
if (_settings_game.economy.infrastructure_maintenance) {
SetDParam(0, monthly_cost * 12); // Convert to per year
Rect tr = r.WithWidth(this->total_width, _current_text_dir == TD_RTL);
DrawString(tr.left, tr.right, y, STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL, TC_FROMSTRING, SA_RIGHT);
DrawString(tr.left, tr.right, y,
TimerGameEconomy::UsingWallclockUnits() ? STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL_PERIOD : STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL_YEAR,
TC_FROMSTRING, SA_RIGHT);
}
}
@ -2100,7 +2103,9 @@ struct CompanyInfrastructureWindow : Window
GfxFillRect(tr.left, y, tr.right, y + WidgetDimensions::scaled.bevel.top - 1, PC_WHITE);
y += WidgetDimensions::scaled.vsep_normal;
SetDParam(0, this->GetTotalMaintenanceCost() * 12); // Convert to per year
DrawString(tr.left, tr.right, y, STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL, TC_FROMSTRING, SA_RIGHT);
DrawString(tr.left, tr.right, y,
TimerGameEconomy::UsingWallclockUnits() ? STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL_PERIOD : STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL_YEAR,
TC_FROMSTRING, SA_RIGHT);
}
break;

View File

@ -492,7 +492,14 @@ protected:
/* Initialise the dataset */
this->UpdateStatistics(true);
this->InitNested(number);
this->CreateNestedTree();
auto *wid = this->GetWidget<NWidgetCore>(WID_GRAPH_FOOTER);
if (wid != nullptr && TimerGameEconomy::UsingWallclockUnits()) {
wid->SetDataTip(STR_GRAPH_LAST_72_MINUTES_TIME_LABEL, STR_NULL);
}
this->FinishInitNested(number);
}
public:
@ -657,7 +664,7 @@ static constexpr NWidgetPart _nested_operating_profit_widgets[] = {
NWidget(WWT_EMPTY, COLOUR_BROWN, WID_GRAPH_GRAPH), SetMinimalSize(576, 160), SetFill(1, 1), SetResize(1, 1),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_SPACER), SetMinimalSize(12, 0), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_GRAPH_LAST_72_MINUTES_TIME_LABEL, STR_NULL),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_EMPTY, STR_NULL),
NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN, WID_GRAPH_RESIZE), SetDataTip(RWV_HIDE_BEVEL, STR_TOOLTIP_RESIZE),
EndContainer(),
@ -716,7 +723,7 @@ static constexpr NWidgetPart _nested_income_graph_widgets[] = {
NWidget(WWT_EMPTY, COLOUR_BROWN, WID_GRAPH_GRAPH), SetMinimalSize(576, 128), SetFill(1, 1), SetResize(1, 1),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_SPACER), SetMinimalSize(12, 0), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_GRAPH_LAST_72_MINUTES_TIME_LABEL, STR_NULL),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_EMPTY, STR_NULL),
NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN, WID_GRAPH_RESIZE), SetDataTip(RWV_HIDE_BEVEL, STR_TOOLTIP_RESIZE),
EndContainer(),
@ -773,7 +780,7 @@ static constexpr NWidgetPart _nested_delivered_cargo_graph_widgets[] = {
NWidget(WWT_EMPTY, COLOUR_BROWN, WID_GRAPH_GRAPH), SetMinimalSize(576, 128), SetFill(1, 1), SetResize(1, 1),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_SPACER), SetMinimalSize(12, 0), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_GRAPH_LAST_72_MINUTES_TIME_LABEL, STR_NULL),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_EMPTY, STR_NULL),
NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN, WID_GRAPH_RESIZE), SetDataTip(RWV_HIDE_BEVEL, STR_TOOLTIP_RESIZE),
EndContainer(),
@ -837,7 +844,7 @@ static constexpr NWidgetPart _nested_performance_history_widgets[] = {
NWidget(WWT_EMPTY, COLOUR_BROWN, WID_GRAPH_GRAPH), SetMinimalSize(576, 224), SetFill(1, 1), SetResize(1, 1),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_SPACER), SetMinimalSize(12, 0), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_GRAPH_LAST_72_MINUTES_TIME_LABEL, STR_NULL),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_EMPTY, STR_NULL),
NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN, WID_GRAPH_RESIZE), SetDataTip(RWV_HIDE_BEVEL, STR_TOOLTIP_RESIZE),
EndContainer(),
@ -894,7 +901,7 @@ static constexpr NWidgetPart _nested_company_value_graph_widgets[] = {
NWidget(WWT_EMPTY, COLOUR_BROWN, WID_GRAPH_GRAPH), SetMinimalSize(576, 224), SetFill(1, 1), SetResize(1, 1),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_SPACER), SetMinimalSize(12, 0), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_GRAPH_LAST_72_MINUTES_TIME_LABEL, STR_NULL),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_EMPTY, STR_NULL),
NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN, WID_GRAPH_RESIZE), SetDataTip(RWV_HIDE_BEVEL, STR_TOOLTIP_RESIZE),
EndContainer(),
@ -937,6 +944,9 @@ struct PaymentRatesGraphWindow : BaseGraphWindow {
this->vscroll = this->GetScrollbar(WID_CPR_MATRIX_SCROLLBAR);
this->vscroll->SetCount(_sorted_standard_cargo_specs.size());
auto *wid = this->GetWidget<NWidgetCore>(WID_GRAPH_FOOTER);
wid->SetDataTip(TimerGameEconomy::UsingWallclockUnits() ? STR_GRAPH_CARGO_PAYMENT_RATES_SECONDS: STR_GRAPH_CARGO_PAYMENT_RATES_DAYS, STR_NULL);
/* Initialise the dataset */
this->UpdatePaymentRates();
@ -1132,7 +1142,7 @@ static constexpr NWidgetPart _nested_cargo_payment_rates_widgets[] = {
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_SPACER), SetMinimalSize(12, 0), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_GRAPH_CARGO_PAYMENT_RATES_TIME_LABEL, STR_NULL),
NWidget(WWT_TEXT, COLOUR_BROWN, WID_GRAPH_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_NULL, STR_NULL),
NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN, WID_GRAPH_RESIZE), SetDataTip(RWV_HIDE_BEVEL, STR_TOOLTIP_RESIZE),
EndContainer(),
@ -1387,10 +1397,11 @@ CompanyID PerformanceRatingDetailWindow::company = INVALID_COMPANY;
*/
static std::unique_ptr<NWidgetBase> MakePerformanceDetailPanels()
{
auto realtime = TimerGameEconomy::UsingWallclockUnits();
const StringID performance_tips[] = {
STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP,
realtime ? STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP_PERIODS : STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP_YEARS,
STR_PERFORMANCE_DETAIL_STATIONS_TOOLTIP,
STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP,
realtime ? STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP_PERIODS : STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP_YEARS,
STR_PERFORMANCE_DETAIL_MIN_INCOME_TOOLTIP,
STR_PERFORMANCE_DETAIL_MAX_INCOME_TOOLTIP,
STR_PERFORMANCE_DETAIL_DELIVERED_TOOLTIP,

View File

@ -580,12 +580,12 @@ public:
Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
DrawString(tr, STR_GROUP_PROFIT_THIS_YEAR, TC_BLACK);
DrawString(tr, TimerGameEconomy::UsingWallclockUnits() ? STR_GROUP_PROFIT_THIS_PERIOD : STR_GROUP_PROFIT_THIS_YEAR, TC_BLACK);
SetDParam(0, this_year);
DrawString(tr, STR_JUST_CURRENCY_LONG, TC_BLACK, SA_RIGHT);
tr.top += GetCharacterHeight(FS_NORMAL);
DrawString(tr, STR_GROUP_PROFIT_LAST_YEAR, TC_BLACK);
DrawString(tr, TimerGameEconomy::UsingWallclockUnits() ? STR_GROUP_PROFIT_LAST_PERIOD : STR_GROUP_PROFIT_LAST_YEAR, TC_BLACK);
SetDParam(0, last_year);
DrawString(tr, STR_JUST_CURRENCY_LONG, TC_BLACK, SA_RIGHT);

View File

@ -913,7 +913,7 @@ public:
if (!IsValidCargoID(p.cargo)) continue;
if (first) {
if (has_accept) ir.top += WidgetDimensions::scaled.vsep_wide;
DrawString(ir, STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE);
DrawString(ir, TimerGameEconomy::UsingWallclockUnits() ? STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE : STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE);
ir.top += GetCharacterHeight(FS_NORMAL);
if (this->editable == EA_RATE) this->production_offset_y = ir.top;
first = false;

View File

@ -630,10 +630,11 @@ STR_GRAPH_CARGO_DELIVERED_CAPTION :{WHITE}Units of
STR_GRAPH_COMPANY_PERFORMANCE_RATINGS_CAPTION :{WHITE}Company performance ratings (maximum rating=1000)
STR_GRAPH_COMPANY_VALUES_CAPTION :{WHITE}Company Value Graph
STR_GRAPH_LAST_72_MINUTES_TIME_LABEL :{TINY_FONT}{BLACK}{TKM "" "Last 72 minutes"}
STR_GRAPH_LAST_72_MINUTES_TIME_LABEL :{TINY_FONT}{BLACK}Last 72 minutes
STR_GRAPH_CARGO_PAYMENT_RATES_CAPTION :{WHITE}Cargo Payment Rates
STR_GRAPH_CARGO_PAYMENT_RATES_TIME_LABEL :{TINY_FONT}{BLACK}{TKM Days Seconds} in transit
STR_GRAPH_CARGO_PAYMENT_RATES_DAYS :{TINY_FONT}{BLACK}Days in transit
STR_GRAPH_CARGO_PAYMENT_RATES_SECONDS :{TINY_FONT}{BLACK}Seconds in transit
STR_GRAPH_CARGO_PAYMENT_RATES_TITLE :{TINY_FONT}{BLACK}Payment for delivering 10 units (or 10,000 litres) of cargo a distance of 20 squares
STR_GRAPH_CARGO_ENABLE_ALL :{TINY_FONT}{BLACK}Enable all
STR_GRAPH_CARGO_DISABLE_ALL :{TINY_FONT}{BLACK}Disable all
@ -680,11 +681,13 @@ STR_PERFORMANCE_DETAIL_CARGO :{BLACK}Cargo:
STR_PERFORMANCE_DETAIL_MONEY :{BLACK}Money:
STR_PERFORMANCE_DETAIL_LOAN :{BLACK}Loan:
STR_PERFORMANCE_DETAIL_TOTAL :{BLACK}Total:
###next-name-looks-similar
###length 10
STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP :{BLACK}Number of vehicles that turned a profit last {TKM year period}. This includes road vehicles, trains, ships and aircraft
STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP_YEARS :{BLACK}Number of vehicles that turned a profit last year. This includes road vehicles, trains, ships and aircraft
STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP_PERIODS :{BLACK}Number of vehicles that turned a profit last period. This includes road vehicles, trains, ships and aircraft
STR_PERFORMANCE_DETAIL_STATIONS_TOOLTIP :{BLACK}Number of recently-serviced stations. Train stations, bus stops, airports and so on are counted separately even if they belong to the same station
STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP :{BLACK}The profit of the vehicle with the lowest income (only vehicles older than two {TKM years periods} are considered)
STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP_YEARS :{BLACK}The profit of the vehicle with the lowest income (only vehicles older than two years are considered)
STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP_PERIODS :{BLACK}The profit of the vehicle with the lowest income (only vehicles older than two periods are considered)
STR_PERFORMANCE_DETAIL_MIN_INCOME_TOOLTIP :{BLACK}Amount of cash made in the quarter with the lowest profit of the last 12 quarters
STR_PERFORMANCE_DETAIL_MAX_INCOME_TOOLTIP :{BLACK}Amount of cash made in the quarter with the highest profit of the last 12 quarters
STR_PERFORMANCE_DETAIL_DELIVERED_TOOLTIP :{BLACK}Units of cargo delivered in the last four quarters
@ -916,7 +919,8 @@ STR_NEWS_VEHICLE_IS_GETTING_VERY_OLD :{WHITE}{VEHICLE
STR_NEWS_VEHICLE_IS_GETTING_VERY_OLD_AND :{WHITE}{VEHICLE} is getting very old and urgently needs replacing
STR_NEWS_TRAIN_IS_STUCK :{WHITE}{VEHICLE} can't find a path to continue
STR_NEWS_VEHICLE_IS_LOST :{WHITE}{VEHICLE} is lost
STR_NEWS_VEHICLE_IS_UNPROFITABLE :{WHITE}{VEHICLE}'s profit last {TKM year period} was {CURRENCY_LONG}
STR_NEWS_VEHICLE_UNPROFITABLE_YEAR :{WHITE}{VEHICLE}'s profit last year was {CURRENCY_LONG}
STR_NEWS_VEHICLE_UNPROFITABLE_PERIOD :{WHITE}{VEHICLE}'s profit last period was {CURRENCY_LONG}
STR_NEWS_AIRCRAFT_DEST_TOO_FAR :{WHITE}{VEHICLE} can't get to the next destination because it is out of range
STR_NEWS_ORDER_REFIT_FAILED :{WHITE}{VEHICLE} stopped because an ordered refit failed
@ -940,9 +944,11 @@ STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLAC
STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} from {STRING2} to {STRING2} will pay triple rates for the next {UNITS_YEARS_OR_MINUTES}!
STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} from {STRING2} to {STRING2} will pay quadruple rates for the next {UNITS_YEARS_OR_MINUTES}!
STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}Traffic chaos in {TOWN}!{}{}Road rebuilding programme funded by {RAW_STRING} brings 6 {TKM months minutes} of misery to motorists!
STR_NEWS_ROAD_REBUILDING_MONTHS :{BIG_FONT}{BLACK}Traffic chaos in {TOWN}!{}{}Road rebuilding programme funded by {RAW_STRING} brings 6 months of misery to motorists!
STR_NEWS_ROAD_REBUILDING_MINUTES :{BIG_FONT}{BLACK}Traffic chaos in {TOWN}!{}{}Road rebuilding programme funded by {RAW_STRING} brings 6 minutes of misery to motorists!
STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Transport monopoly!
STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION :{BIG_FONT}{BLACK}Local authority of {TOWN} signs contract with {RAW_STRING} for 12 {TKM months minutes} of exclusive transport rights!
STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION_MONTHS :{BIG_FONT}{BLACK}Local authority of {TOWN} signs contract with {RAW_STRING} for 12 months of exclusive transport rights!
STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION_MINUTES :{BIG_FONT}{BLACK}Local authority of {TOWN} signs contract with {RAW_STRING} for 12 minutes of exclusive transport rights!
# Extra view window
STR_EXTRA_VIEWPORT_TITLE :{WHITE}Viewport {COMMA}
@ -2742,7 +2748,8 @@ STR_LINKGRAPH_LEGEND_SATURATED :{TINY_FONT}{BLA
STR_LINKGRAPH_LEGEND_OVERLOADED :{TINY_FONT}{BLACK}overloaded
# Linkgraph tooltip
STR_LINKGRAPH_STATS_TOOLTIP :{BLACK}{CARGO_LONG} to be transported per {TKM month minute} from {STATION} to {STATION} ({COMMA}% of capacity){RAW_STRING}
STR_LINKGRAPH_STATS_TOOLTIP_MONTH :{BLACK}{CARGO_LONG} to be transported per month from {STATION} to {STATION} ({COMMA}% of capacity){RAW_STRING}
STR_LINKGRAPH_STATS_TOOLTIP_MINUTE :{BLACK}{CARGO_LONG} to be transported per minute from {STATION} to {STATION} ({COMMA}% of capacity){RAW_STRING}
STR_LINKGRAPH_STATS_TOOLTIP_RETURN_EXTENSION :{}{CARGO_LONG} to be transported back ({COMMA}% of capacity)
STR_LINKGRAPH_STATS_TOOLTIP_TIME_EXTENSION :{}Average travel time: {UNITS_DAYS_OR_SECONDS}
@ -2754,7 +2761,8 @@ STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP :{BLACK}Don't hi
STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP :{BLACK}Highlight coverage area of proposed site
STR_STATION_BUILD_ACCEPTS_CARGO :{BLACK}Accepts: {GOLD}{CARGO_LIST}
STR_STATION_BUILD_SUPPLIES_CARGO :{BLACK}Supplies: {GOLD}{CARGO_LIST}
STR_STATION_BUILD_INFRASTRUCTURE_COST :{BLACK}Maintenance cost: {GOLD}{CURRENCY_SHORT}/{TKM year period}
STR_STATION_BUILD_INFRASTRUCTURE_COST_YEAR :{BLACK}Maintenance cost: {GOLD}{CURRENCY_SHORT}/year
STR_STATION_BUILD_INFRASTRUCTURE_COST_PERIOD :{BLACK}Maintenance cost: {GOLD}{CURRENCY_SHORT}/period
# Join station window
STR_JOIN_STATION_CAPTION :{WHITE}Join station
@ -3601,7 +3609,8 @@ STR_TOWN_POPULATION :{BLACK}World po
STR_TOWN_VIEW_TOWN_CAPTION :{WHITE}{TOWN}
STR_TOWN_VIEW_CITY_CAPTION :{WHITE}{TOWN} (City)
STR_TOWN_VIEW_POPULATION_HOUSES :{BLACK}Population: {ORANGE}{COMMA}{BLACK} Houses: {ORANGE}{COMMA}
STR_TOWN_VIEW_CARGO_LAST_MONTH_MAX :{BLACK}{CARGO_LIST} last {TKM month minute}: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA}
STR_TOWN_VIEW_CARGO_LAST_MONTH_MAX :{BLACK}{CARGO_LIST} last month: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA}
STR_TOWN_VIEW_CARGO_LAST_MINUTE_MAX :{BLACK}{CARGO_LIST} last minute: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA}
STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH :{BLACK}Cargo needed for town growth:
STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED_GENERAL :{ORANGE}{STRING}{RED} required
STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED_WINTER :{ORANGE}{STRING}{BLACK} required in winter
@ -3747,7 +3756,8 @@ STR_STATION_VIEW_EXCLUSIVE_RIGHTS_COMPANY :{YELLOW}{COMPAN
STR_STATION_VIEW_RATINGS_BUTTON :{BLACK}Ratings
STR_STATION_VIEW_RATINGS_TOOLTIP :{BLACK}Show station ratings
STR_STATION_VIEW_SUPPLY_RATINGS_TITLE :{BLACK}Supply per {TKM month minute} and local rating:
STR_STATION_VIEW_SUPPLY_RATINGS_TITLE_MONTH :{BLACK}Supply per month and local rating:
STR_STATION_VIEW_SUPPLY_RATINGS_TITLE_MINUTE :{BLACK}Supply per minute and local rating:
STR_STATION_VIEW_CARGO_SUPPLY_RATING :{WHITE}{STRING}: {YELLOW}{COMMA} / {STRING} ({COMMA}%)
STR_STATION_VIEW_GROUP :{BLACK}Group by
@ -3808,7 +3818,8 @@ STR_EDIT_WAYPOINT_NAME :{WHITE}Edit way
# Finances window
STR_FINANCES_CAPTION :{WHITE}{COMPANY} Finances {BLACK}{COMPANY_NUM}
STR_FINANCES_YEAR :{WHITE}{NUM}
STR_FINANCES_YEAR_CAPTION :{WHITE}{TKM Year Period}
STR_FINANCES_YEAR_CAPTION :{WHITE}Year
STR_FINANCES_PERIOD_CAPTION :{WHITE}Period
###length 3
STR_FINANCES_REVENUE_TITLE :{WHITE}Revenue
@ -3910,7 +3921,8 @@ STR_COMPANY_INFRASTRUCTURE_VIEW_CANALS :{WHITE}Canals
STR_COMPANY_INFRASTRUCTURE_VIEW_STATION_SECT :{GOLD}Stations:
STR_COMPANY_INFRASTRUCTURE_VIEW_STATIONS :{WHITE}Station tiles
STR_COMPANY_INFRASTRUCTURE_VIEW_AIRPORTS :{WHITE}Airports
STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL :{WHITE}{CURRENCY_LONG}/{TKM year period}
STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL_YEAR :{WHITE}{CURRENCY_LONG}/year
STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL_PERIOD :{WHITE}{CURRENCY_LONG}/period
# Industry directory
STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}Industries
@ -3929,7 +3941,8 @@ STR_INDUSTRY_DIRECTORY_FILTER_NONE :None
# Industry view
STR_INDUSTRY_VIEW_CAPTION :{WHITE}{INDUSTRY}
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Production last {TKM month minute}:
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Production last month:
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Production last minute:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{RAW_STRING}{BLACK} ({COMMA}% transported)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centre the main view on industry location. Ctrl+Click to open a new viewport on industry location
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Production level: {YELLOW}{COMMA}%
@ -3970,7 +3983,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Send ins
STR_VEHICLE_LIST_REPLACE_VEHICLES :Replace vehicles
STR_VEHICLE_LIST_SEND_FOR_SERVICING :Send for servicing
STR_VEHICLE_LIST_CREATE_GROUP :Create group
STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit this {TKM year period}: {CURRENCY_LONG} (last {TKM year period}: {CURRENCY_LONG})
STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit this year: {CURRENCY_LONG} (last year: {CURRENCY_LONG})
STR_VEHICLE_LIST_PROFIT_THIS_PERIOD_LAST_PERIOD :{TINY_FONT}{BLACK}Profit this period: {CURRENCY_LONG} (last period: {CURRENCY_LONG})
STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}]
STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING1} {STRING1}
@ -4015,8 +4029,10 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Remove all vehi
STR_GROUP_RENAME_CAPTION :{BLACK}Rename a group
STR_GROUP_PROFIT_THIS_YEAR :Profit this {TKM year period}:
STR_GROUP_PROFIT_LAST_YEAR :Profit last {TKM year period}:
STR_GROUP_PROFIT_THIS_YEAR :Profit this year:
STR_GROUP_PROFIT_THIS_PERIOD :Profit this period:
STR_GROUP_PROFIT_LAST_YEAR :Profit last year:
STR_GROUP_PROFIT_LAST_PERIOD :Profit last period:
STR_GROUP_OCCUPANCY :Current usage:
STR_GROUP_OCCUPANCY_VALUE :{NUM}%
@ -4043,7 +4059,8 @@ STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Speed: {
STR_PURCHASE_INFO_SPEED :{BLACK}Speed: {GOLD}{VELOCITY}
STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Speed on ocean: {GOLD}{VELOCITY}
STR_PURCHASE_INFO_SPEED_CANAL :{BLACK}Speed on canal/river: {GOLD}{VELOCITY}
STR_PURCHASE_INFO_RUNNINGCOST :{BLACK}Running Cost: {GOLD}{CURRENCY_LONG}/{TKM year period}
STR_PURCHASE_INFO_RUNNINGCOST_YEAR :{BLACK}Running Cost: {GOLD}{CURRENCY_LONG}/year
STR_PURCHASE_INFO_RUNNINGCOST_PERIOD :{BLACK}Running Cost: {GOLD}{CURRENCY_LONG}/period
STR_PURCHASE_INFO_CAPACITY :{BLACK}Capacity: {GOLD}{CARGO_LONG} {STRING}
STR_PURCHASE_INFO_REFITTABLE :(refittable)
STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Designed: {GOLD}{NUM}{BLACK} Life: {GOLD}{COMMA} year{P "" s}
@ -4387,7 +4404,8 @@ STR_VEHICLE_DETAILS_AIRCRAFT_RENAME :{BLACK}Name air
STR_VEHICLE_INFO_AGE :{COMMA} year{P "" s} ({COMMA})
STR_VEHICLE_INFO_AGE_RED :{RED}{COMMA} year{P "" s} ({COMMA})
STR_VEHICLE_INFO_AGE_RUNNING_COST_YR :{BLACK}Age: {LTBLUE}{STRING2}{BLACK} Running Cost: {LTBLUE}{CURRENCY_LONG}/{TKM year period}
STR_VEHICLE_INFO_AGE_RUNNING_COST_YR :{BLACK}Age: {LTBLUE}{STRING2}{BLACK} Running Cost: {LTBLUE}{CURRENCY_LONG}/year
STR_VEHICLE_INFO_AGE_RUNNING_COST_PERIOD :{BLACK}Age: {LTBLUE}{STRING2}{BLACK} Running Cost: {LTBLUE}{CURRENCY_LONG}/period
STR_VEHICLE_INFO_MAX_SPEED :{BLACK}Max. speed: {LTBLUE}{VELOCITY}
STR_VEHICLE_INFO_MAX_SPEED_TYPE :{BLACK}Max. speed: {LTBLUE}{VELOCITY} {BLACK}Aircraft type: {LTBLUE}{STRING}
@ -4395,8 +4413,10 @@ STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}Max. spe
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Weight: {LTBLUE}{WEIGHT_SHORT} {BLACK}Power: {LTBLUE}{POWER}{BLACK} Max. speed: {LTBLUE}{VELOCITY}
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Weight: {LTBLUE}{WEIGHT_SHORT} {BLACK}Power: {LTBLUE}{POWER}{BLACK} Max. speed: {LTBLUE}{VELOCITY} {BLACK}Max. T.E.: {LTBLUE}{FORCE}
STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Profit this {TKM year period}: {LTBLUE}{CURRENCY_LONG} (last {TKM year period}: {CURRENCY_LONG})
STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Profit this {TKM year period}: {LTBLUE}{CURRENCY_LONG} (last {TKM year period}: {CURRENCY_LONG}) {BLACK}Min. performance: {LTBLUE}{POWER_TO_WEIGHT}
STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Profit this year: {LTBLUE}{CURRENCY_LONG} (last year: {CURRENCY_LONG})
STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Profit this year: {LTBLUE}{CURRENCY_LONG} (last year: {CURRENCY_LONG}) {BLACK}Min. performance: {LTBLUE}{POWER_TO_WEIGHT}
STR_VEHICLE_INFO_PROFIT_THIS_PERIOD_LAST_PERIOD :{BLACK}Profit this period: {LTBLUE}{CURRENCY_LONG} (last period: {CURRENCY_LONG})
STR_VEHICLE_INFO_PROFIT_THIS_PERIOD_LAST_PERIOD_MIN_PERFORMANCE :{BLACK}Profit this period: {LTBLUE}{CURRENCY_LONG} (last period: {CURRENCY_LONG}) {BLACK}Min. performance: {LTBLUE}{POWER_TO_WEIGHT}
STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Reliability: {LTBLUE}{COMMA}% {BLACK}Breakdowns since last service: {LTBLUE}{COMMA}
STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY_LONG}
@ -4421,7 +4441,8 @@ STR_VEHICLE_DETAILS_DECREASE_SERVICING_INTERVAL_TOOLTIP_PERCENT :{BLACK}Decrease
STR_SERVICE_INTERVAL_DROPDOWN_TOOLTIP :{BLACK}Change servicing interval type
STR_VEHICLE_DETAILS_DEFAULT :Default
STR_VEHICLE_DETAILS_TIME :{TKM Days Minutes}
STR_VEHICLE_DETAILS_DAYS :Days
STR_VEHICLE_DETAILS_MINUTES :Minutes
STR_VEHICLE_DETAILS_PERCENT :Percentage
###length VEHICLE_TYPES

View File

@ -407,7 +407,9 @@ bool LinkGraphOverlay::ShowTooltip(Point pt, TooltipCloseCondition close_cond)
SetDParam(3, j->first);
SetDParam(4, link.Usage() * 100 / (link.capacity + 1));
SetDParamStr(5, tooltip_extension);
GuiShowTooltips(this->window, STR_LINKGRAPH_STATS_TOOLTIP, close_cond, 7);
GuiShowTooltips(this->window,
TimerGameEconomy::UsingWallclockUnits() ? STR_LINKGRAPH_STATS_TOOLTIP_MINUTE : STR_LINKGRAPH_STATS_TOOLTIP_MONTH,
close_cond, 7);
return true;
}
}

View File

@ -1861,7 +1861,7 @@ struct StationViewWindow : public Window {
tr.top += WidgetDimensions::scaled.vsep_wide;
}
DrawString(tr, STR_STATION_VIEW_SUPPLY_RATINGS_TITLE);
DrawString(tr, TimerGameEconomy::UsingWallclockUnits() ? STR_STATION_VIEW_SUPPLY_RATINGS_TITLE_MINUTE : STR_STATION_VIEW_SUPPLY_RATINGS_TITLE_MONTH);
tr.top += GetCharacterHeight(FS_NORMAL);
for (const CargoSpec *cs : _sorted_standard_cargo_specs) {

View File

@ -3186,7 +3186,9 @@ static CommandCost TownActionRoadRebuild(Town *t, DoCommandFlag flags)
SetDParam(0, t->index);
SetDParamStr(1, company_name->string);
AddNewsItem(STR_NEWS_ROAD_REBUILDING, NT_GENERAL, NF_NORMAL, NR_TOWN, t->index, NR_NONE, UINT32_MAX, company_name);
AddNewsItem(
TimerGameEconomy::UsingWallclockUnits() ? STR_NEWS_ROAD_REBUILDING_MINUTES : STR_NEWS_ROAD_REBUILDING_MONTHS,
NT_GENERAL, NF_NORMAL, NR_TOWN, t->index, NR_NONE, UINT32_MAX, company_name);
AI::BroadcastNewEvent(new ScriptEventRoadReconstruction((ScriptCompany::CompanyID)(Owner)_current_company, t->index));
Game::NewEvent(new ScriptEventRoadReconstruction((ScriptCompany::CompanyID)(Owner)_current_company, t->index));
}
@ -3338,7 +3340,7 @@ static CommandCost TownActionBuyRights(Town *t, DoCommandFlag flags)
/* Spawn news message */
CompanyNewsInformation *cni = new CompanyNewsInformation(Company::Get(_current_company));
SetDParam(0, STR_NEWS_EXCLUSIVE_RIGHTS_TITLE);
SetDParam(1, STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION);
SetDParam(1, TimerGameEconomy::UsingWallclockUnits() ? STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION_MINUTES : STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION_MONTHS);
SetDParam(2, t->index);
SetDParamStr(3, cni->company_name);
AddNewsItem(STR_MESSAGE_NEWS_FORMAT, NT_GENERAL, NF_COMPANY, NR_TOWN, t->index, NR_NONE, UINT32_MAX, cni);

View File

@ -395,16 +395,17 @@ public:
DrawString(tr, STR_TOWN_VIEW_POPULATION_HOUSES);
tr.top += GetCharacterHeight(FS_NORMAL);
StringID str_last_period = TimerGameEconomy::UsingWallclockUnits() ? STR_TOWN_VIEW_CARGO_LAST_MINUTE_MAX : STR_TOWN_VIEW_CARGO_LAST_MONTH_MAX;
SetDParam(0, 1 << CT_PASSENGERS);
SetDParam(1, this->town->supplied[CT_PASSENGERS].old_act);
SetDParam(2, this->town->supplied[CT_PASSENGERS].old_max);
DrawString(tr, STR_TOWN_VIEW_CARGO_LAST_MONTH_MAX);
DrawString(tr, str_last_period);
tr.top += GetCharacterHeight(FS_NORMAL);
SetDParam(0, 1 << CT_MAIL);
SetDParam(1, this->town->supplied[CT_MAIL].old_act);
SetDParam(2, this->town->supplied[CT_MAIL].old_max);
DrawString(tr, STR_TOWN_VIEW_CARGO_LAST_MONTH_MAX);
DrawString(tr, str_last_period);
tr.top += GetCharacterHeight(FS_NORMAL);
bool first = true;

View File

@ -2852,7 +2852,9 @@ static IntervalTimer<TimerGameEconomy> _economy_vehicles_yearly({TimerGameEconom
if (_settings_client.gui.vehicle_income_warn && v->owner == _local_company) {
SetDParam(0, v->index);
SetDParam(1, profit);
AddVehicleAdviceNewsItem(STR_NEWS_VEHICLE_IS_UNPROFITABLE, v->index);
AddVehicleAdviceNewsItem(
TimerGameEconomy::UsingWallclockUnits() ? STR_NEWS_VEHICLE_UNPROFITABLE_PERIOD : STR_NEWS_VEHICLE_UNPROFITABLE_YEAR,
v->index);
}
AI::NewEvent(v->owner, new ScriptEventVehicleUnprofitable(v->index));
}

View File

@ -1711,7 +1711,8 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int
SetDParam(0, vehgroup.GetDisplayProfitThisYear());
SetDParam(1, vehgroup.GetDisplayProfitLastYear());
DrawString(tr.left, tr.right, ir.bottom - GetCharacterHeight(FS_SMALL) - WidgetDimensions::scaled.framerect.bottom, STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR);
DrawString(tr.left, tr.right, ir.bottom - GetCharacterHeight(FS_SMALL) - WidgetDimensions::scaled.framerect.bottom,
TimerGameEconomy::UsingWallclockUnits() ? STR_VEHICLE_LIST_PROFIT_THIS_PERIOD_LAST_PERIOD : STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR);
DrawVehicleProfitButton(vehgroup.GetOldestVehicleAge(), vehgroup.GetDisplayProfitLastYear(), vehgroup.NumVehicles(), vehicle_button_x, ir.top + GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_normal);
@ -2337,9 +2338,16 @@ extern void DrawRoadVehDetails(const Vehicle *v, const Rect &r);
extern void DrawShipDetails(const Vehicle *v, const Rect &r);
extern void DrawAircraftDetails(const Aircraft *v, const Rect &r);
static StringID _service_interval_dropdown[] = {
static StringID _service_interval_dropdown_calendar[] = {
STR_VEHICLE_DETAILS_DEFAULT,
STR_VEHICLE_DETAILS_TIME,
STR_VEHICLE_DETAILS_DAYS,
STR_VEHICLE_DETAILS_PERCENT,
INVALID_STRING_ID,
};
static StringID _service_interval_dropdown_wallclock[] = {
STR_VEHICLE_DETAILS_DEFAULT,
STR_VEHICLE_DETAILS_MINUTES,
STR_VEHICLE_DETAILS_PERCENT,
INVALID_STRING_ID,
};
@ -2419,14 +2427,15 @@ struct VehicleDetailsWindow : Window {
STR_VEHICLE_INFO_MAX_SPEED,
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED,
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE,
STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR,
STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE,
STR_VEHICLE_INFO_PROFIT_THIS_PERIOD_LAST_PERIOD_MIN_PERFORMANCE,
STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS
};
for (uint i = 0; i < lengthof(info_strings); i++) {
dim = maxdim(dim, GetStringBoundingBox(info_strings[i]));
}
SetDParam(0, STR_VEHICLE_INFO_AGE);
dim = maxdim(dim, GetStringBoundingBox(STR_VEHICLE_INFO_AGE_RUNNING_COST_YR));
dim = maxdim(dim, GetStringBoundingBox(TimerGameEconomy::UsingWallclockUnits() ? STR_VEHICLE_INFO_AGE_RUNNING_COST_PERIOD : STR_VEHICLE_INFO_AGE_RUNNING_COST_YR));
size->width = dim.width + padding.width;
break;
}
@ -2459,9 +2468,10 @@ struct VehicleDetailsWindow : Window {
case WID_VD_SERVICE_INTERVAL_DROPDOWN: {
Dimension d{0, 0};
StringID *strs = _service_interval_dropdown;
while (*strs != INVALID_STRING_ID) {
d = maxdim(d, GetStringBoundingBox(*strs++));
for (const StringID *strs : {_service_interval_dropdown_calendar, _service_interval_dropdown_wallclock}) {
while (*strs != INVALID_STRING_ID) {
d = maxdim(d, GetStringBoundingBox(*strs++));
}
}
d.width += padding.width;
d.height += padding.height;
@ -2542,7 +2552,7 @@ struct VehicleDetailsWindow : Window {
SetDParam(0, (v->age + CalendarTime::DAYS_IN_YEAR < v->max_age) ? STR_VEHICLE_INFO_AGE : STR_VEHICLE_INFO_AGE_RED);
SetDParam(2, TimerGameCalendar::DateToYear(v->max_age));
SetDParam(3, v->GetDisplayRunningCost());
DrawString(tr, STR_VEHICLE_INFO_AGE_RUNNING_COST_YR);
DrawString(tr, TimerGameEconomy::UsingWallclockUnits() ? STR_VEHICLE_INFO_AGE_RUNNING_COST_PERIOD : STR_VEHICLE_INFO_AGE_RUNNING_COST_YR);
tr.top += GetCharacterHeight(FS_NORMAL);
/* Draw max speed */
@ -2582,9 +2592,9 @@ struct VehicleDetailsWindow : Window {
SetDParam(1, v->GetDisplayProfitLastYear());
if (v->IsGroundVehicle()) {
SetDParam(2, v->GetDisplayMinPowerToWeight());
DrawString(tr, STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE);
DrawString(tr, TimerGameEconomy::UsingWallclockUnits() ? STR_VEHICLE_INFO_PROFIT_THIS_PERIOD_LAST_PERIOD_MIN_PERFORMANCE : STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE);
} else {
DrawString(tr, STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR);
DrawString(tr, TimerGameEconomy::UsingWallclockUnits() ? STR_VEHICLE_INFO_PROFIT_THIS_PERIOD_LAST_PERIOD : STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR);
}
tr.top += GetCharacterHeight(FS_NORMAL);
@ -2660,9 +2670,10 @@ struct VehicleDetailsWindow : Window {
WID_VD_INCREASE_SERVICING_INTERVAL,
WID_VD_DECREASE_SERVICING_INTERVAL);
StringID str = v->ServiceIntervalIsCustom() ?
(v->ServiceIntervalIsPercent() ? STR_VEHICLE_DETAILS_PERCENT : STR_VEHICLE_DETAILS_TIME) :
STR_VEHICLE_DETAILS_DEFAULT;
StringID str =
!v->ServiceIntervalIsCustom() ? STR_VEHICLE_DETAILS_DEFAULT :
v->ServiceIntervalIsPercent() ? STR_VEHICLE_DETAILS_PERCENT :
TimerGameEconomy::UsingWallclockUnits() ? STR_VEHICLE_DETAILS_MINUTES : STR_VEHICLE_DETAILS_DAYS;
this->GetWidget<NWidgetCore>(WID_VD_SERVICE_INTERVAL_DROPDOWN)->widget_data = str;
this->DrawWidgets();
@ -2691,7 +2702,9 @@ struct VehicleDetailsWindow : Window {
case WID_VD_SERVICE_INTERVAL_DROPDOWN: {
const Vehicle *v = Vehicle::Get(this->window_number);
ShowDropDownMenu(this, _service_interval_dropdown, v->ServiceIntervalIsCustom() ? (v->ServiceIntervalIsPercent() ? 2 : 1) : 0, widget, 0, 0);
ShowDropDownMenu(this,
TimerGameEconomy::UsingWallclockUnits() ? _service_interval_dropdown_wallclock : _service_interval_dropdown_calendar,
v->ServiceIntervalIsCustom() ? (v->ServiceIntervalIsPercent() ? 2 : 1) : 0, widget, 0, 0);
break;
}