Merge upstream PR #7852 into jgrpp

Feature: Show the name of the NewGRF in the build vehicle window

Author: stormcone

# Conflicts:
#	src/lang/english.txt
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/table/settings.ini
This commit is contained in:
Jonathan G Rennison
2019-12-13 17:28:48 +00:00
5 changed files with 22 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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}

View File

@@ -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));

View File

@@ -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.

View File

@@ -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