mirror of https://github.com/OpenTTD/OpenTTD.git
Feature: Add config option to set default company secondary colour for new games
This does duplicate translation strings for the colours
This commit is contained in:
parent
5653a94490
commit
a9c65a69d0
|
@ -190,6 +190,26 @@ STR_COLOUR_GREY :Grey
|
|||
STR_COLOUR_WHITE :White
|
||||
STR_COLOUR_RANDOM :Random
|
||||
|
||||
###length 17
|
||||
STR_COLOUR_SECONDARY_DARK_BLUE :Dark Blue
|
||||
STR_COLOUR_SECONDARY_PALE_GREEN :Pale Green
|
||||
STR_COLOUR_SECONDARY_SECONDARY_PINK :Pink
|
||||
STR_COLOUR_SECONDARY_YELLOW :Yellow
|
||||
STR_COLOUR_SECONDARY_RED :Red
|
||||
STR_COLOUR_SECONDARY_LIGHT_BLUE :Light Blue
|
||||
STR_COLOUR_SECONDARY_GREEN :Green
|
||||
STR_COLOUR_SECONDARY_DARK_GREEN :Dark Green
|
||||
STR_COLOUR_SECONDARY_BLUE :Blue
|
||||
STR_COLOUR_SECONDARY_CREAM :Cream
|
||||
STR_COLOUR_SECONDARY_MAUVE :Mauve
|
||||
STR_COLOUR_SECONDARY_PURPLE :Purple
|
||||
STR_COLOUR_SECONDARY_ORANGE :Orange
|
||||
STR_COLOUR_SECONDARY_BROWN :Brown
|
||||
STR_COLOUR_SECONDARY_GREY :Grey
|
||||
STR_COLOUR_SECONDARY_WHITE :White
|
||||
STR_COLOUR_SECONDARY_SAME_AS_PRIMARY :Same As Primary
|
||||
|
||||
|
||||
# Units used in OpenTTD
|
||||
STR_UNITS_VELOCITY_IMPERIAL :{DECIMAL}{NBSP}mph
|
||||
STR_UNITS_VELOCITY_METRIC :{DECIMAL}{NBSP}km/h
|
||||
|
@ -1418,6 +1438,9 @@ STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :When enabled, i
|
|||
STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Starting company colour: {STRING2}
|
||||
STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Choose starting colour for the company
|
||||
|
||||
STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_SECONDARY :Starting company secondary colour: {STRING2}
|
||||
STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_SECONDARY_HELPTEXT :Choose starting secondary colour for the company, if using a NewGRF that enables it.
|
||||
|
||||
STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Airports never expire: {STRING2}
|
||||
STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Enabling this setting makes each airport type stay available forever after its introduction
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "base_media_base.h"
|
||||
#include "saveload/saveload.h"
|
||||
#include "company_cmd.h"
|
||||
#include "company_func.h"
|
||||
#include "command_func.h"
|
||||
#include "news_func.h"
|
||||
|
@ -861,12 +862,17 @@ static void MakeNewGameDone()
|
|||
|
||||
/* Overwrite color from settings if needed
|
||||
* COLOUR_END corresponds to Random colour */
|
||||
|
||||
if (_settings_client.gui.starting_colour != COLOUR_END) {
|
||||
c->colour = _settings_client.gui.starting_colour;
|
||||
ResetCompanyLivery(c);
|
||||
_company_colours[c->index] = (Colours)c->colour;
|
||||
}
|
||||
|
||||
if (_settings_client.gui.starting_colour_secondary != COLOUR_END && HasBit(_loaded_newgrf_features.used_liveries, LS_DEFAULT)) {
|
||||
Command<CMD_SET_COMPANY_COLOUR>::Post(LS_DEFAULT, false, (Colours)_settings_client.gui.starting_colour_secondary);
|
||||
}
|
||||
|
||||
OnStartGame(false);
|
||||
|
||||
InitializeRailGUI();
|
||||
|
|
|
@ -1860,6 +1860,7 @@ static SettingsContainer &GetSettingsTree()
|
|||
company->Add(new SettingEntry("gui.new_nonstop"));
|
||||
company->Add(new SettingEntry("gui.stop_location"));
|
||||
company->Add(new SettingEntry("gui.starting_colour"));
|
||||
company->Add(new SettingEntry("gui.starting_colour_secondary"));
|
||||
company->Add(new SettingEntry("company.engine_renew"));
|
||||
company->Add(new SettingEntry("company.engine_renew_months"));
|
||||
company->Add(new SettingEntry("company.engine_renew_money"));
|
||||
|
|
|
@ -186,6 +186,7 @@ struct GUISettings {
|
|||
uint8_t graph_line_thickness; ///< the thickness of the lines in the various graph guis
|
||||
uint8_t osk_activation; ///< Mouse gesture to trigger the OSK.
|
||||
byte starting_colour; ///< default color scheme for the company to start a new game with
|
||||
byte starting_colour_secondary; ///< default secondary 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
|
||||
bool show_cargo_in_vehicle_lists; ///< Show the cargoes the vehicles can carry in the list windows
|
||||
bool auto_remove_signals; ///< automatically remove signals when in the way during rail construction
|
||||
|
|
|
@ -352,6 +352,17 @@ str = STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR
|
|||
strhelp = STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT
|
||||
strval = STR_COLOUR_DARK_BLUE
|
||||
|
||||
[SDTC_VAR]
|
||||
var = gui.starting_colour_secondary
|
||||
type = SLE_UINT8
|
||||
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
|
||||
def = COLOUR_END
|
||||
min = 0
|
||||
max = COLOUR_END
|
||||
str = STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_SECONDARY
|
||||
strhelp = STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_SECONDARY_HELPTEXT
|
||||
strval = STR_COLOUR_SECONDARY_DARK_BLUE
|
||||
|
||||
[SDTC_BOOL]
|
||||
var = gui.auto_remove_signals
|
||||
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
|
||||
|
|
Loading…
Reference in New Issue