diff --git a/src/lang/english.txt b/src/lang/english.txt index 13966af044..9366f6add4 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -6668,6 +6668,9 @@ STR_TMPL_TEMPLATE_INFO :{BLACK}Template STR_TMPL_RPL_START :{BLACK}Start replacing STR_TMPL_RPL_STOP :{BLACK}Stop replacing STR_TMPL_TEMPLATE_OVR_VALUE :{BLACK}Buying Cost: {GOLD}{CURRENCY_LONG} +STR_TMPL_TEMPLATE_OVR_VALUE_LTBLUE :{BLACK}Buying Cost: {LTBLUE}{CURRENCY_LONG} +STR_TMPL_TEMPLATE_OVR_RUNNING_COST :{BLACK}Estimated Running Cost: {LTBLUE}{CURRENCY_LONG} +STR_TMPL_TEMPLATE_OVR_MULTIPLE :{BLACK}{STRING1}{BLACK} {STRING1} STR_TMPL_WARNING_FREE_WAGON :{RED}Free Chain: not runnable! STR_TMPL_WARNING_VEH_UNAVAILABLE :{RED}Train not buildable: vehicle unavailable! STR_TMPL_GROUP_USES_TEMPLATE :{BLACK}Template in use: {NUM} diff --git a/src/lang/german.txt b/src/lang/german.txt index 4dd22d95b1..226fd2645e 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -6438,6 +6438,7 @@ STR_TMPL_TEMPLATE_INFO :{BLACK}Vorlagen STR_TMPL_RPL_START :{BLACK}Fahrzeugersetzung an STR_TMPL_RPL_STOP :{BLACK}Fahrzeugersetzung aus STR_TMPL_TEMPLATE_OVR_VALUE :{BLACK}Anschaffungskosten: {GOLD}{CURRENCY_LONG} +STR_TMPL_TEMPLATE_OVR_VALUE_LTBLUE :{BLACK}Anschaffungskosten: {LTBLUE}{CURRENCY_LONG} STR_TMPL_WARNING_FREE_WAGON :{RED}Unvollständiger Antriebsstrang: Zug kann nicht bewegt werden! STR_TMPL_WARNING_VEH_UNAVAILABLE :{RED}Zug nicht erstellbar: Fahrzeug nicht verfügbar! STR_TMPL_GROUP_USES_TEMPLATE :{BLACK}Vorlage in Benutzung: {NUM} diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 197f5be01e..37ff5db8dc 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -6665,6 +6665,7 @@ STR_TMPL_TEMPLATE_INFO :{BLACK}템플 STR_TMPL_RPL_START :{BLACK}교체 시작 STR_TMPL_RPL_STOP :{BLACK}교체 중지 STR_TMPL_TEMPLATE_OVR_VALUE :{BLACK}구입 가격: {GOLD}{CURRENCY_LONG} +STR_TMPL_TEMPLATE_OVR_VALUE_LTBLUE :{BLACK}구입 가격: {LTBLUE}{CURRENCY_LONG} STR_TMPL_WARNING_FREE_WAGON :{RED}객차/화차만 있음: 운행할 수 없습니다! STR_TMPL_WARNING_VEH_UNAVAILABLE :{RED}열차 구성 불가: 차량을 사용할 수 없습니다! STR_TMPL_GROUP_USES_TEMPLATE :{BLACK}{NUM}번 템플릿 사용 중 diff --git a/src/tbtr_template_gui_create.cpp b/src/tbtr_template_gui_create.cpp index 7893e5eaa8..8875a52fd0 100644 --- a/src/tbtr_template_gui_create.cpp +++ b/src/tbtr_template_gui_create.cpp @@ -307,13 +307,23 @@ public: int y = 4 - this->vscroll->GetPosition(); bool buildable = true; + Money buy_cost = 0; for (Train *train = this->virtual_train; train != nullptr; train = train->GetNextUnit()) { if (!IsEngineBuildable(train->engine_type, VEH_TRAIN, train->owner)) buildable = false; + buy_cost += Engine::Get(train->engine_type)->GetCost(); } if (!buildable) { DrawString(8, r.right, y, STR_TMPL_WARNING_VEH_UNAVAILABLE); y += FONT_HEIGHT_NORMAL; } + + SetDParam(0, STR_TMPL_TEMPLATE_OVR_VALUE_LTBLUE); + SetDParam(1, buy_cost); + SetDParam(2, STR_TMPL_TEMPLATE_OVR_RUNNING_COST); + SetDParam(3, this->virtual_train->GetDisplayRunningCost()); + DrawString(8, r.right, y, STR_TMPL_TEMPLATE_OVR_MULTIPLE); + y += FONT_HEIGHT_NORMAL; + /* Draw vehicle performance info */ const bool original_acceleration = (_settings_game.vehicle.train_acceleration_model == AM_ORIGINAL || GetRailTypeInfo(this->virtual_train->railtype)->acceleration_type == 2); diff --git a/src/tbtr_template_gui_main.cpp b/src/tbtr_template_gui_main.cpp index 061aff6f15..043ea53060 100644 --- a/src/tbtr_template_gui_main.cpp +++ b/src/tbtr_template_gui_main.cpp @@ -742,6 +742,10 @@ public: short top = ScaleGUITrad(4) - this->vscroll[2]->GetPosition(); short left = ScaleGUITrad(8); + SetDParam(0, CalculateOverallTemplateDisplayRunningCost(tmp)); + DrawString(left, r.right, top, STR_TMPL_TEMPLATE_OVR_RUNNING_COST); + top += FONT_HEIGHT_NORMAL; + /* Draw vehicle performance info */ const bool original_acceleration = (_settings_game.vehicle.train_acceleration_model == AM_ORIGINAL || GetRailTypeInfo(tmp->railtype)->acceleration_type == 2); diff --git a/src/tbtr_template_vehicle_func.cpp b/src/tbtr_template_vehicle_func.cpp index d90d00410a..e7dc2dae74 100644 --- a/src/tbtr_template_vehicle_func.cpp +++ b/src/tbtr_template_vehicle_func.cpp @@ -110,6 +110,16 @@ Money CalculateOverallTemplateCost(const TemplateVehicle *tv) return val; } +Money CalculateOverallTemplateDisplayRunningCost(const TemplateVehicle *tv) +{ + Money val = 0; + + for (; tv; tv = tv->GetNextUnit()) { + val += (Engine::Get(tv->engine_type))->GetDisplayRunningCost(); + } + return val; +} + void DrawTemplate(const TemplateVehicle *tv, int left, int right, int y) { if (!tv) return; diff --git a/src/tbtr_template_vehicle_func.h b/src/tbtr_template_vehicle_func.h index 9959613d6b..a66adab152 100644 --- a/src/tbtr_template_vehicle_func.h +++ b/src/tbtr_template_vehicle_func.h @@ -20,6 +20,7 @@ Train* VirtualTrainFromTemplateVehicle(const TemplateVehicle* tv, StringID &err, void BuildTemplateGuiList(GUITemplateList*, Scrollbar*, Owner, RailType); Money CalculateOverallTemplateCost(const TemplateVehicle*); +Money CalculateOverallTemplateDisplayRunningCost(const TemplateVehicle*); void DrawTemplate(const TemplateVehicle*, int, int, int);