diff options
-rw-r--r-- | src/build_vehicle_gui.cpp | 8 | ||||
-rw-r--r-- | src/lang/english.txt | 2 | ||||
-rw-r--r-- | src/settings_gui.cpp | 1 | ||||
-rw-r--r-- | src/settings_type.h | 1 | ||||
-rw-r--r-- | src/table/settings.ini | 9 |
5 files changed, 21 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; } diff --git a/src/lang/english.txt b/src/lang/english.txt index 36d0199ea..d0fa352bd 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1312,6 +1312,8 @@ STR_CONFIG_SETTING_POPULATION_IN_LABEL :Show town popul STR_CONFIG_SETTING_POPULATION_IN_LABEL_HELPTEXT :Display the population of towns in their label on the map STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Thickness of lines in graphs: {STRING2} STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Width of the line in the graphs. A thin line is more precisely readable, a thicker line is easier to see and colours are easier to distinguish +STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Show the NewGRF's name in the build vehicle window +STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Add a line to the build vehicle window, showing which NewGRF the selected vehicle comes from. STR_CONFIG_SETTING_LANDSCAPE :Landscape: {STRING2} STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Landscapes define basic gameplay scenarios with different cargos and town growth requirements. NewGRF and Game Scripts allow finer control though diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 187ea2892..fbccc1d43 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1566,6 +1566,7 @@ static SettingsContainer &GetSettingsTree() interface->Add(new SettingEntry("gui.timetable_in_ticks")); interface->Add(new SettingEntry("gui.timetable_arrival_departure")); interface->Add(new SettingEntry("gui.expenses_layout")); + interface->Add(new SettingEntry("gui.show_newgrf_name")); } SettingsPage *advisors = main->Add(new SettingsPage(STR_CONFIG_SETTING_ADVISORS)); diff --git a/src/settings_type.h b/src/settings_type.h index 0bc5a1a68..fdb2b0f86 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -145,6 +145,7 @@ struct GUISettings { uint8 graph_line_thickness; ///< the thickness of the lines in the various graph guis uint8 osk_activation; ///< Mouse gesture to trigger the OSK. byte starting_colour; ///< default color scheme for the company to start a new game with + bool show_newgrf_name; ///< Show the name of the NewGRF in the build vehicle window uint16 console_backlog_timeout; ///< the minimum amount of time items should be in the console backlog before they will be removed in ~3 seconds granularity. uint16 console_backlog_length; ///< the minimum amount of items in the console backlog before items will be removed. diff --git a/src/table/settings.ini b/src/table/settings.ini index 3e07fcc59..43bd3aec3 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -3240,6 +3240,15 @@ strhelp = STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT strval = STR_JUST_COMMA proc = RedrawScreen +[SDTC_BOOL] +var = gui.show_newgrf_name +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = false +str = STR_CONFIG_SETTING_SHOW_NEWGRF_NAME +strhelp = STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT +proc = RedrawScreen +cat = SC_ADVANCED + ; For the dedicated build we'll enable dates in logs by default. [SDTC_BOOL] ifdef = DEDICATED |