summaryrefslogtreecommitdiff
path: root/src/build_vehicle_gui.cpp
diff options
context:
space:
mode:
authorstormcone <48624099+stormcone@users.noreply.github.com>2019-04-04 23:06:38 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2020-01-04 18:42:35 +0100
commitb524f1ae21487caf8ed460d8e20a51c3dd7e11a6 (patch)
tree421c770d1ec2d9947200b0d43e404d9a604acc6f /src/build_vehicle_gui.cpp
parente04ca904a9455afc63aa87db775fe4463ab899b7 (diff)
downloadopenttd-b524f1ae21487caf8ed460d8e20a51c3dd7e11a6.tar.xz
Feature: Show the name of the NewGRF in the build vehicle window.
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r--src/build_vehicle_gui.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index c457b0f19..c3252f7b9 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -928,6 +928,14 @@ int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number,
/* Additional text from NewGRF */
y = ShowAdditionalText(left, right, y, engine_number);
+ /* The NewGRF's name which the vehicle comes from */
+ const GRFConfig *config = GetGRFConfig(e->GetGRFID());
+ if (_settings_client.gui.show_newgrf_name && config != nullptr)
+ {
+ DrawString(left, right, y, config->GetName(), TC_BLACK);
+ y += FONT_HEIGHT_NORMAL;
+ }
+
return y;
}