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

This commit is contained in:
stormcone 2019-04-04 23:06:38 +02:00 committed by Niels Martin Hansen
parent e04ca904a9
commit b524f1ae21
5 changed files with 21 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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

View File

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