diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index ad08c9baa5..6b151c2b26 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -929,6 +929,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 85a50d7e2a..97a7c650cc 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1370,6 +1370,9 @@ STR_CONFIG_SETTING_OPEN_VEHICLE_GUI_CLONE_SHARE_HELPTEXT :When enabled, o STR_CONFIG_SETTING_ADV_SIG_BRIDGE_TUN_MODES :Enable signals on bridges/tunnels advanced modes: {STRING2} STR_CONFIG_SETTING_ADV_SIG_BRIDGE_TUN_MODES_HELPTEXT :Enables use of advanced modes of signal simulation on bridges and tunnels. When disabled, bridges/tunnels which are not already in an advanced mode cannot be changed to an advanced mode, however other players may choose to enable this setting and use an advanced mode. +STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Show the NewGRF's name in the build vehicle window +STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :When enabled the name of the NewGRF which the selected vehicle comes from displayed at the bottom of the build vehicle window + 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 STR_CONFIG_SETTING_LAND_GENERATOR :Land generator: {STRING2} diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 1e7a9fcd9a..608f71f843 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1709,6 +1709,7 @@ static SettingsContainer &GetSettingsTree() interface->Add(new SettingEntry("gui.adv_sig_bridge_tun_modes")); interface->Add(new SettingEntry("gui.show_depot_sell_gui")); interface->Add(new SettingEntry("gui.open_vehicle_gui_clone_share")); + 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 6bf545b4c0..4d70b2d613 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -194,6 +194,7 @@ struct GUISettings { bool adv_sig_bridge_tun_modes; ///< Enable advanced modes for signals on bridges/tunnels. bool show_depot_sell_gui; ///< Show go to depot and sell in UI bool open_vehicle_gui_clone_share; ///< Open vehicle GUI when share-cloning vehicle from depot GUI + 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 3f0cb9d25a..38a9bba30f 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -4534,6 +4534,15 @@ str = STR_CONFIG_SETTING_OPEN_VEHICLE_GUI_CLONE_SHARE strhelp = STR_CONFIG_SETTING_OPEN_VEHICLE_GUI_CLONE_SHARE_HELPTEXT cat = SC_EXPERT +[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