summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lang/english.txt4
-rw-r--r--src/station_gui.cpp11
2 files changed, 9 insertions, 6 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index df7272860..655af91e0 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -2971,8 +2971,8 @@ STR_STATIOV_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_CARGO_RATINGS_TITLE :{BLACK}Local rating of transport service:
-STR_STATION_VIEW_CARGO_RATING :{WHITE}{STRING}: {YELLOW}{STRING} ({COMMA}%)
+STR_STATION_VIEW_SUPPLY_RATINGS_TITLE :{BLACK}Monthly supply and local rating:
+STR_STATION_VIEW_CARGO_SUPPLY_RATING :{WHITE}{STRING}: {YELLOW}{COMMA} / {STRING} ({COMMA}%)
############ range for rating starts
STR_CARGO_RATING_APPALLING :Appalling
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index 1071ca429..5623edb32 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -30,6 +30,7 @@
#include "core/geometry_func.hpp"
#include "vehiclelist.h"
#include "town.h"
+#include "linkgraph/linkgraph.h"
#include "widgets/station_widget.h"
@@ -1075,7 +1076,7 @@ struct StationViewWindow : public Window {
y += WD_PAR_VSEP_WIDE;
}
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_STATION_VIEW_CARGO_RATINGS_TITLE);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_STATION_VIEW_SUPPLY_RATINGS_TITLE);
y += FONT_HEIGHT_NORMAL;
const CargoSpec *cs;
@@ -1083,10 +1084,12 @@ struct StationViewWindow : public Window {
const GoodsEntry *ge = &st->goods[cs->Index()];
if (!ge->HasRating()) continue;
+ const LinkGraph *lg = LinkGraph::GetIfValid(ge->link_graph);
SetDParam(0, cs->name);
- SetDParam(2, ToPercent8(ge->rating));
- SetDParam(1, STR_CARGO_RATING_APPALLING + (ge->rating >> 5));
- DrawString(r.left + WD_FRAMERECT_LEFT + 6, r.right - WD_FRAMERECT_RIGHT - 6, y, STR_STATION_VIEW_CARGO_RATING);
+ SetDParam(1, lg != NULL ? lg->Monthly((*lg)[ge->node].Supply()) : 0);
+ SetDParam(2, STR_CARGO_RATING_APPALLING + (ge->rating >> 5));
+ SetDParam(3, ToPercent8(ge->rating));
+ DrawString(r.left + WD_FRAMERECT_LEFT + 6, r.right - WD_FRAMERECT_RIGHT - 6, y, STR_STATION_VIEW_CARGO_SUPPLY_RATING);
y += FONT_HEIGHT_NORMAL;
}
return CeilDiv(y - r.top - WD_FRAMERECT_TOP, FONT_HEIGHT_NORMAL);