Merge branch 'master' into infrastructure_sharing

Conflicts:
	src/aircraft_cmd.cpp
	src/economy.cpp
	src/lang/english.txt
	src/order_gui.cpp
	src/roadveh_cmd.cpp
	src/saveload/saveload.cpp
	src/settings.cpp
	src/settings_gui.cpp
	src/train_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2015-08-06 22:55:09 +01:00
1106 changed files with 149811 additions and 81548 deletions

View File

@@ -17,9 +17,28 @@
#include "transport_type.h"
#include "network/core/config.h"
#include "company_type.h"
#include "cargotype.h"
#include "linkgraph/linkgraph_type.h"
#include "zoom_type.h"
#include "openttd.h"
/** Settings profiles and highscore tables. */
enum SettingsProfile {
SP_BEGIN = 0,
SP_EASY = SP_BEGIN, ///< Easy difficulty.
SP_MEDIUM, ///< Medium difficulty.
SP_HARD, ///< Hard difficulty.
SP_END, ///< End of setting profiles.
SP_CUSTOM = SP_END, ///< No profile, special "custom" highscore.
SP_SAVED_HIGHSCORE_END, ///< End of saved highscore tables.
SP_MULTIPLAYER = SP_SAVED_HIGHSCORE_END, ///< Special "multiplayer" highscore. Not saved, always specific to the current game.
SP_HIGHSCORE_END, ///< End of highscore tables.
};
/** Available industry map generation densities. */
enum IndustryDensity {
ID_FUND_ONLY, ///< The game does not build industries.
@@ -46,11 +65,10 @@ struct DifficultySettings {
byte construction_cost; ///< how expensive is building
byte terrain_type; ///< the mountainousness of the landscape
byte quantity_sea_lakes; ///< the amount of seas/lakes
byte economy; ///< how volatile is the economy
byte line_reverse_mode; ///< reversing at stations or not
byte disasters; ///< are disasters enabled
bool economy; ///< how volatile is the economy
bool line_reverse_mode; ///< reversing at stations or not
bool disasters; ///< are disasters enabled
byte town_council_tolerance; ///< minimum required town ratings to be allowed to demolish stuff
byte diff_level; ///< the difficulty level
};
/** Settings related to the GUI and other stuff that is not saved in the savegame. */
@@ -63,9 +81,9 @@ struct GUISettings {
bool sg_new_nonstop; ///< ttdpatch compatible nonstop handling read from pre v93 savegames
bool new_nonstop; ///< ttdpatch compatible nonstop handling
uint8 stop_location; ///< what is the default stop location of trains?
bool autoscroll; ///< scroll when moving mouse to the edge
uint8 auto_scrolling; ///< scroll when moving mouse to the edge (see #ViewportAutoscrolling)
byte errmsg_duration; ///< duration of error message
byte hover_delay; ///< time required to activate a hover event, in seconds
uint16 hover_delay_ms; ///< time required to activate a hover event, in milliseconds
bool link_terraform_toolbar; ///< display terraform toolbar when displaying rail, road, water and airport toolbars
uint8 smallmap_land_colour; ///< colour used for land and heightmap at the smallmap
bool reverse_scroll; ///< right-Click-Scrolling scrolls in the opposite direction
@@ -102,6 +120,7 @@ struct GUISettings {
bool quick_goto; ///< Allow quick access to 'goto button' in vehicle orders window
bool auto_euro; ///< automatically switch to euro in 2002
byte drag_signals_density; ///< many signals density
bool drag_signals_fixed_distance; ///< keep fixed distance between signals when dragging
Year semaphore_build_before; ///< build semaphore signals automatically before this year
byte news_message_timeout; ///< how much longer than the news message "age" should we keep the message in the history
bool show_track_reservation; ///< highlight reserved tracks.
@@ -116,11 +135,16 @@ struct GUISettings {
uint32 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 graph_line_thickness; ///< the thickness of the lines in the various graph guis
uint8 osk_activation; ///< Mouse gesture to trigger the OSK.
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.
uint8 station_gui_group_order; ///< the order of grouping cargo entries in the station gui
uint8 station_gui_sort_by; ///< sort cargo entries in the station gui by station name or amount
uint8 station_gui_sort_order; ///< the sort order of entries in the station gui - ascending or descending
#ifdef ENABLE_NETWORK
uint16 network_chat_box_width; ///< width of the chat box in pixels
uint16 network_chat_box_width_pct; ///< width of the chat box in percent
uint8 network_chat_box_height; ///< height of the chat box in lines
uint16 network_chat_timeout; ///< timeout of chat messages in seconds
#endif
@@ -130,6 +154,7 @@ struct GUISettings {
bool newgrf_developer_tools; ///< activate NewGRF developer tools and allow modifying NewGRFs in an existing game
bool ai_developer_tools; ///< activate AI developer tools
bool scenario_developer; ///< activate scenario developer: allow modifying NewGRFs in an existing game
uint8 settings_restriction_mode; ///< selected restriction mode in adv. settings GUI. @see RestrictionMode
bool newgrf_show_old_versions; ///< whether to show old versions in the NewGRF list
uint8 newgrf_default_palette; ///< default palette to use for NewGRFs without action 14 palette information
@@ -143,6 +168,18 @@ struct GUISettings {
}
};
/** Settings related to sound effects. */
struct SoundSettings {
bool news_ticker; ///< Play a ticker sound when a news item is published.
bool news_full; ///< Play sound effects associated to certain news types.
bool new_year; ///< Play sound on new year, summarising the performance during the last year.
bool confirm; ///< Play sound effect on succesful constructions or other actions.
bool click_beep; ///< Beep on a random selection of buttons.
bool disaster; ///< Play disaster and accident sounds.
bool vehicle; ///< Play vehicle sound effects.
bool ambient; ///< Play ambient, industry and town sounds.
};
/** Settings related to music. */
struct MusicSettings {
byte playlist; ///< The playlist (number) to play
@@ -157,12 +194,36 @@ struct MusicSettings {
/** Settings related to currency/unit systems. */
struct LocaleSettings {
byte currency; ///< currency we currently use
byte units; ///< unit system we show everything
byte units_velocity; ///< unit system for velocity
byte units_power; ///< unit system for power
byte units_weight; ///< unit system for weight
byte units_volume; ///< unit system for volume
byte units_force; ///< unit system for force
byte units_height; ///< unit system for height
char *digit_group_separator; ///< thousand separator for non-currencies
char *digit_group_separator_currency; ///< thousand separator for currencies
char *digit_decimal_separator; ///< decimal separator
};
/** Settings related to news */
struct NewsSettings {
uint8 arrival_player; ///< NewsDisplay of vehicles arriving at new stations of current player
uint8 arrival_other; ///< NewsDisplay of vehicles arriving at new stations of other players
uint8 accident; ///< NewsDisplay of accidents that occur
uint8 company_info; ///< NewsDisplay of general company information
uint8 open; ///< NewsDisplay on new industry constructions
uint8 close; ///< NewsDisplay about closing industries
uint8 economy; ///< NewsDisplay on economical changes
uint8 production_player; ///< NewsDisplay of production changes of industries affecting current player
uint8 production_other; ///< NewsDisplay of production changes of industries affecting competitors
uint8 production_nobody; ///< NewsDisplay of production changes of industries affecting no one
uint8 advice; ///< NewsDisplay on advice affecting the player's vehicles
uint8 new_vehicles; ///< NewsDisplay of new vehicles becoming available
uint8 acceptance; ///< NewsDisplay on changes affecting the acceptance of cargo at stations
uint8 subsidies; ///< NewsDisplay of changes on subsidies
uint8 general; ///< NewsDisplay of other topics
};
/** All settings related to the network. */
struct NetworkSettings {
#ifdef ENABLE_NETWORK
@@ -217,7 +278,7 @@ struct GameCreationSettings {
uint8 map_y; ///< Y size of map
byte land_generator; ///< the landscape generator
byte oil_refinery_limit; ///< distance oil refineries allowed from map edge
byte snow_line_height; ///< a number 0-15 that configured snow line height
byte snow_line_height; ///< the configured snow line height
byte tgen_smoothness; ///< how rough is the terrain from 0-3
byte tree_placer; ///< the tree placer algorithm
byte heightmap_rotation; ///< rotation director for the heightmap
@@ -235,11 +296,13 @@ struct GameCreationSettings {
/** Settings related to construction in-game */
struct ConstructionSettings {
uint8 max_heightlevel; ///< maximum allowed heightlevel
bool build_on_slopes; ///< allow building on slopes
bool autoslope; ///< allow terraforming under things
uint16 max_bridge_length; ///< maximum length of bridges
byte max_bridge_height; ///< maximum height of bridges
uint16 max_tunnel_length; ///< maximum length of tunnels
bool signal_side; ///< show signals on right side
byte train_signal_side; ///< show signals on left / driving / right side
bool extra_dynamite; ///< extra dynamite
bool road_stop_on_town_road; ///< allow building of drive-through road stops on town owned roads
bool road_stop_on_competitor_road; ///< allow building of drive-through road stops on roads owned by competitors
@@ -253,6 +316,8 @@ struct ConstructionSettings {
uint16 terraform_frame_burst; ///< how many tile heights may, over a short period, be terraformed?
uint32 clear_per_64k_frames; ///< how many tiles may, over a long period, be cleared per 65536 frames?
uint16 clear_frame_burst; ///< how many tiles may, over a short period, be cleared?
uint32 tree_per_64k_frames; ///< how many trees may, over a long period, be planted per 65536 frames?
uint16 tree_frame_burst; ///< how many trees may, over a short period, be planted?
};
/** Settings related to the AI. */
@@ -266,6 +331,7 @@ struct AISettings {
/** Settings related to scripts. */
struct ScriptSettings {
uint8 settings_profile; ///< difficulty profile to set initial settings of scripts, esp. random AIs
uint32 script_max_opcode_till_suspend; ///< max opcode calls till scripts will suspend
};
@@ -371,7 +437,7 @@ struct OrderSettings {
bool improved_load; ///< improved loading algorithm
bool gradual_loading; ///< load vehicles gradually
bool selectgoods; ///< only send the goods to station if a train has been there
bool no_servicing_if_no_breakdowns; ///< dont send vehicles to depot when breakdowns are disabled
bool no_servicing_if_no_breakdowns; ///< don't send vehicles to depot when breakdowns are disabled
bool serviceathelipad; ///< service helicopters at helipads automatically (no need to send to depot)
};
@@ -410,7 +476,7 @@ struct EconomySettings {
bool fund_buildings; ///< allow funding new buildings
bool fund_roads; ///< allow funding local road reconstruction
bool give_money; ///< allow giving other companies money
bool mod_road_rebuild; ///< roadworks remove unneccesary RoadBits
bool mod_road_rebuild; ///< roadworks remove unnecessary RoadBits
bool multiple_industry_per_town; ///< allow many industries of the same type per town
uint8 town_growth_rate; ///< town growth rate
uint8 larger_towns; ///< the number of cities to build. These start off larger and grow twice as fast
@@ -427,6 +493,26 @@ struct EconomySettings {
bool infrastructure_maintenance; ///< enable monthly maintenance fee for owner infrastructure
};
struct LinkGraphSettings {
uint16 recalc_time; ///< time (in days) for recalculating each link graph component.
uint16 recalc_interval; ///< time (in days) between subsequent checks for link graphs to be calculated.
DistributionTypeByte distribution_pax; ///< distribution type for passengers
DistributionTypeByte distribution_mail; ///< distribution type for mail
DistributionTypeByte distribution_armoured; ///< distribution type for armoured cargo class
DistributionTypeByte distribution_default; ///< distribution type for all other goods
uint8 accuracy; ///< accuracy when calculating things on the link graph. low accuracy => low running time
uint8 demand_size; ///< influence of supply ("station size") on the demand function
uint8 demand_distance; ///< influence of distance between stations on the demand function
uint8 short_path_saturation; ///< percentage up to which short paths are saturated before saturating most capacious paths
inline DistributionType GetDistributionType(CargoID cargo) const {
if (IsCargoInClass(cargo, CC_PASSENGERS)) return this->distribution_pax;
if (IsCargoInClass(cargo, CC_MAIL)) return this->distribution_mail;
if (IsCargoInClass(cargo, CC_ARMOURED)) return this->distribution_armoured;
return this->distribution_default;
}
};
/** Settings related to stations. */
struct StationSettings {
bool modified_catchment; ///< different-size catchment areas
@@ -467,6 +553,7 @@ struct GameSettings {
OrderSettings order; ///< settings related to orders
VehicleSettings vehicle; ///< options for vehicles
EconomySettings economy; ///< settings to change the economy
LinkGraphSettings linkgraph; ///< settings for link graph calculations
StationSettings station; ///< settings related to station management
LocaleSettings locale; ///< settings related to used currency/unit system in the current game
};
@@ -476,7 +563,9 @@ struct ClientSettings {
GUISettings gui; ///< settings related to the GUI
NetworkSettings network; ///< settings related to the network
CompanySettings company; ///< default values for per-company settings
SoundSettings sound; ///< sound effect settings
MusicSettings music; ///< settings related to music/sound
NewsSettings news_display; ///< news display settings.
};
/** The current settings for this game. */