Changeset - r27751:1abb293ce3a8
[Not reviewed]
master
0 5 0
Henry Wilson - 12 months ago 2023-06-24 20:50:04
henry@henryandlizzy.uk
Feature: Add config option to set default company secondary colour for new games

This does duplicate translation strings for the colours
5 files changed with 42 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -181,24 +181,44 @@ STR_COLOUR_LIGHT_BLUE                   
 
STR_COLOUR_GREEN                                                :Green
 
STR_COLOUR_DARK_GREEN                                           :Dark Green
 
STR_COLOUR_BLUE                                                 :Blue
 
STR_COLOUR_CREAM                                                :Cream
 
STR_COLOUR_MAUVE                                                :Mauve
 
STR_COLOUR_PURPLE                                               :Purple
 
STR_COLOUR_ORANGE                                               :Orange
 
STR_COLOUR_BROWN                                                :Brown
 
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
 
STR_UNITS_VELOCITY_SI                                           :{DECIMAL}{NBSP}m/s
 
STR_UNITS_VELOCITY_GAMEUNITS                                    :{DECIMAL}{NBSP}tiles/day
 
STR_UNITS_VELOCITY_KNOTS                                        :{DECIMAL}{NBSP}knots
 

	
 
STR_UNITS_POWER_IMPERIAL                                        :{DECIMAL}{NBSP}hp
 
STR_UNITS_POWER_METRIC                                          :{DECIMAL}{NBSP}hp
 
STR_UNITS_POWER_SI                                              :{DECIMAL}{NBSP}kW
 

	
 
STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL                     :{DECIMAL}{NBSP}hp/t
 
@@ -1409,24 +1429,27 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL 
 
STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD                            :Allow drive-through road stops on town owned roads: {STRING2}
 
STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT                   :Allow construction of drive-through road stops on town-owned roads
 
STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD                      :Allow drive-through road stops on roads owned by competitors: {STRING2}
 
STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT             :Allow construction of drive-through road stops on roads owned by other companies
 
STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES            :{WHITE}Changing this setting is not possible when there are vehicles
 

	
 
STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE                   :Infrastructure maintenance: {STRING2}
 
STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT          :When enabled, infrastructure causes maintenance costs. The cost grows over-proportional with the network size, thus affecting bigger companies more than smaller ones
 

	
 
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
 

	
 
STR_CONFIG_SETTING_WARN_LOST_VEHICLE                            :Warn if vehicle is lost: {STRING2}
 
STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT                   :Trigger messages about vehicles unable to find a path to their ordered destination
 

	
 
STR_CONFIG_SETTING_ORDER_REVIEW                                 :Review vehicles' orders: {STRING2}
 
STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT                        :When enabled, the orders of the vehicles are periodically checked, and some obvious issues are reported with a news message when detected
 
###length 3
 
STR_CONFIG_SETTING_ORDER_REVIEW_OFF                             :No
 
STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT                         :Yes, but exclude stopped vehicles
 
STR_CONFIG_SETTING_ORDER_REVIEW_ON                              :Of all vehicles
src/openttd.cpp
Show inline comments
 
@@ -13,24 +13,25 @@
 
#include "sound/sound_driver.hpp"
 
#include "music/music_driver.hpp"
 
#include "video/video_driver.hpp"
 
#include "mixer.h"
 

	
 
#include "fontcache.h"
 
#include "error.h"
 
#include "error_func.h"
 
#include "gui.h"
 

	
 
#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"
 
#include "fios.h"
 
#include "aircraft.h"
 
#include "roadveh.h"
 
#include "train.h"
 
#include "ship.h"
 
#include "console_func.h"
 
#include "screenshot.h"
 
#include "network/network.h"
 
#include "network/network_func.h"
 
@@ -852,30 +853,35 @@ static void MakeNewGameDone()
 
		if (_settings_client.gui.pause_on_newgame) Command<CMD_PAUSE>::Post(PM_PAUSED_NORMAL, true);
 
		return;
 
	}
 

	
 
	/* Create a single company */
 
	DoStartupNewCompany(false);
 

	
 
	Company *c = Company::Get(COMPANY_FIRST);
 
	c->settings = _settings_client.company;
 

	
 
	/* 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();
 
	InitializeRoadGUI();
 

	
 
	/* We are the server, we start a new company (not dedicated),
 
	 * so set the default password *if* needed. */
 
	if (_network_server && !_settings_client.network.default_company_pass.empty()) {
 
		NetworkChangeCompanyPassword(_local_company, _settings_client.network.default_company_pass);
 
	}
 

	
 
	if (_settings_client.gui.pause_on_newgame) Command<CMD_PAUSE>::Post(PM_PAUSED_NORMAL, true);
src/settings_gui.cpp
Show inline comments
 
@@ -1851,24 +1851,25 @@ static SettingsContainer &GetSettingsTre
 
		}
 

	
 
		SettingsPage *company = main->Add(new SettingsPage(STR_CONFIG_SETTING_COMPANY));
 
		{
 
			company->Add(new SettingEntry("gui.semaphore_build_before"));
 
			company->Add(new SettingEntry("gui.cycle_signal_types"));
 
			company->Add(new SettingEntry("gui.signal_gui_mode"));
 
			company->Add(new SettingEntry("gui.drag_signals_fixed_distance"));
 
			company->Add(new SettingEntry("gui.auto_remove_signals"));
 
			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"));
 
			company->Add(new SettingEntry("vehicle.servint_ispercent"));
 
			company->Add(new SettingEntry("vehicle.servint_trains"));
 
			company->Add(new SettingEntry("vehicle.servint_roadveh"));
 
			company->Add(new SettingEntry("vehicle.servint_ships"));
 
			company->Add(new SettingEntry("vehicle.servint_aircraft"));
 
		}
 

	
 
		SettingsPage *accounting = main->Add(new SettingsPage(STR_CONFIG_SETTING_ACCOUNTING));
 
		{
src/settings_type.h
Show inline comments
 
@@ -177,24 +177,25 @@ struct GUISettings {
 
	bool   show_track_reservation;           ///< highlight reserved tracks.
 
	byte   station_numtracks;                ///< the number of platforms to default on for rail stations
 
	byte   station_platlength;               ///< the platform length, in tiles, for rail stations
 
	bool   station_dragdrop;                 ///< whether drag and drop is enabled for stations
 
	bool   station_show_coverage;            ///< whether to highlight coverage area
 
	bool   persistent_buildingtools;         ///< keep the building tools active after usage
 
	bool   expenses_layout;                  ///< layout of expenses window
 
	uint32_t last_newgrf_count;                ///< the numbers of NewGRFs we found during the last scan
 
	byte   missing_strings_threshold;        ///< the number of missing strings before showing the warning
 
	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
 
	uint16_t refresh_rate;                     ///< How often we refresh the screen (time between draw-ticks).
 
	uint16_t fast_forward_speed_limit;         ///< Game speed to use when fast-forward is enabled.
 

	
 
	uint16_t 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_t console_backlog_length;           ///< the minimum amount of items in the console backlog before items will be removed.
 

	
 
	uint8_t  station_gui_group_order;          ///< the order of grouping cargo entries in the station gui
 
	uint8_t  station_gui_sort_by;              ///< sort cargo entries in the station gui by station name or amount
 
	uint8_t  station_gui_sort_order;           ///< the sort order of entries in the station gui - ascending or descending
src/table/settings/gui_settings.ini
Show inline comments
 
@@ -343,24 +343,35 @@ post_cb  = InvalidateCompanyLiveryWindow
 

	
 
[SDTC_VAR]
 
var      = gui.starting_colour
 
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
 
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
 
def      = false
 
str      = STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS
 
strhelp  = STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS_HELPTEXT
 
cat      = SC_ADVANCED
 

	
 
[SDTC_BOOL]
 
var      = gui.prefer_teamchat
 
flags    = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
 
def      = false
0 comments (0 inline, 0 general)