tron@2186: /* $Id$ */ tron@2186: rubidium@8704: /** @file settings_type.h Types related to global configuration settings. */ belugas@6919: rubidium@8704: #ifndef SETTINGS_TYPE_H rubidium@8704: #define SETTINGS_TYPE_H truelight@0: KUDr@3900: #include "yapf/yapf_settings.h" rubidium@8636: #include "date_type.h" rubidium@8709: #include "town_type.h" KUDr@3900: rubidium@8764: #define GAME_DIFFICULTY_NUM 18 rubidium@8764: rubidium@8764: /** Specific type for Game Difficulty to ease changing the type */ rubidium@8764: typedef uint16 GDType; rubidium@8764: struct GameDifficulty { rubidium@8764: GDType max_no_competitors; rubidium@8764: GDType competitor_start_time; rubidium@8764: GDType number_towns; rubidium@8764: GDType number_industries; rubidium@8764: GDType max_loan; rubidium@8764: GDType initial_interest; rubidium@8764: GDType vehicle_costs; rubidium@8764: GDType competitor_speed; belugas@8960: GDType competitor_intelligence; ///< no longer in use rubidium@8764: GDType vehicle_breakdowns; rubidium@8764: GDType subsidy_multiplier; rubidium@8764: GDType construction_cost; rubidium@8764: GDType terrain_type; rubidium@8764: GDType quantity_sea_lakes; rubidium@8764: GDType economy; rubidium@8764: GDType line_reverse_mode; rubidium@8764: GDType disasters; belugas@8960: GDType town_council_tolerance; ///< minimum required town ratings to be allowed to demolish stuff rubidium@8764: }; rubidium@8764: rubidium@6574: struct GameOptions { truelight@0: GameDifficulty diff; truelight@0: byte diff_level; truelight@0: byte currency; peter1138@3342: byte units; truelight@0: byte town_name; truelight@0: byte landscape; truelight@0: byte snow_line; truelight@0: byte autosave; truelight@0: byte road_side; rubidium@6574: }; truelight@0: Darkvater@1500: /* These are the options for the current game Darkvater@1500: * either ingame, or loaded. Also used for networking games */ rubidium@8704: extern GameOptions _opt; truelight@0: Darkvater@1500: /* These are the default options for a new game */ rubidium@8704: extern GameOptions _opt_newgame; Darkvater@1500: belugas@6919: /* Pointer to one of the two _opt OR _opt_newgame structs */ rubidium@8704: extern GameOptions *_opt_ptr; truelight@0: rubidium@6574: struct Patches { belugas@8960: bool modified_catchment; ///< different-size catchment areas belugas@8960: bool vehicle_speed; ///< show vehicle speed belugas@8960: bool build_on_slopes; ///< allow building on slopes belugas@8960: bool mammoth_trains; ///< allow very long trains belugas@8960: bool join_stations; ///< allow joining of train stations belugas@8960: bool full_load_any; ///< new full load calculation, any cargo must be full belugas@8960: bool improved_load; ///< improved loading algorithm belugas@8960: bool gradual_loading; ///< load vehicles gradually belugas@8960: byte station_spread; ///< amount a station may spread belugas@8960: bool inflation; ///< disable inflation belugas@8960: bool selectgoods; ///< only send the goods to station if a train has been there belugas@8960: bool longbridges; ///< allow 100 tile long bridges belugas@8960: bool gotodepot; ///< allow goto depot in orders rubidium@7673: uint8 raw_industry_construction; ///< Type of (raw) industry construction (none, "normal", prospecting) belugas@8960: bool multiple_industry_per_town; ///< allow many industries of the same type per town belugas@8960: bool same_industry_close; ///< allow same type industries to be built close to each other belugas@8960: bool lost_train_warn; ///< if a train can't find its destination, show a warning dominik@55: uint8 order_review_system; belugas@8960: bool train_income_warn; ///< if train is generating little income, show a warning belugas@8960: bool status_long_date; ///< always show long date in status bar belugas@8960: bool signal_side; ///< show signals on right side belugas@8960: bool show_finances; ///< show finances at end of year belugas@8960: bool new_nonstop; ///< ttdpatch compatible nonstop handling belugas@8960: bool roadveh_queue; ///< buggy road vehicle queueing belugas@8960: bool autoscroll; ///< scroll when moving mouse to the edge. belugas@8960: byte errmsg_duration; ///< duration of error message belugas@8960: byte land_generator; ///< the landscape generator belugas@8960: byte oil_refinery_limit; ///< distance oil refineries allowed from map edge belugas@8960: byte snow_line_height; ///< a number 0-15 that configured snow line height belugas@8960: byte tgen_smoothness; ///< how rough is the terrain from 0-3 belugas@8960: uint32 generation_seed; ///< noise seed for world generation belugas@8960: byte tree_placer; ///< the tree placer algorithm belugas@8960: byte heightmap_rotation; ///< rotation director for the heightmap belugas@8960: byte se_flat_world_height; ///< land height a flat world gets in SE belugas@8960: bool bribe; ///< enable bribing the local authority belugas@8960: bool nonuniform_stations; ///< allow nonuniform train stations belugas@8960: bool adjacent_stations; ///< allow stations to be built directly adjacent to other stations belugas@8960: bool always_small_airport; ///< always allow small airports belugas@8960: bool realistic_acceleration; ///< realistic acceleration for trains belugas@8960: bool wagon_speed_limits; ///< enable wagon speed limits belugas@8960: bool forbid_90_deg; ///< forbid trains to make 90 deg turns belugas@8960: bool invisible_trees; ///< don't show trees when buildings are transparent belugas@8960: bool no_servicing_if_no_breakdowns; ///< dont send vehicles to depot when breakdowns are disabled belugas@8960: bool link_terraform_toolbar; ///< display terraform toolbar when displaying rail, road, water and airport toolbars belugas@8960: bool reverse_scroll; ///< Right-Click-Scrolling scrolls in the opposite direction peter1138@7226: bool smooth_scroll; ///< Smooth scroll viewports belugas@8960: bool disable_elrails; ///< when true, the elrails are disabled belugas@8960: bool measure_tooltip; ///< Show a permanent tooltip when dragging tools belugas@8960: byte liveries; ///< Options for displaying company liveries, 0=none, 1=self, 2=all belugas@8960: bool prefer_teamchat; ///< Choose the chat message target with , true=all players, false=your team belugas@8960: uint8 advanced_vehicle_list; ///< Use the "advanced" vehicle list belugas@8960: uint8 loading_indicators; ///< Show loading indicators rubidium@7560: uint8 default_rail_type; ///< The default rail type for the rail GUI truelight@0: belugas@8960: uint8 toolbar_pos; ///< position of toolbars, 0=left, 1=center, 2=right belugas@8960: uint8 window_snap_radius; ///< Windows snap at each other if closer than this truelight@0: rubidium@7582: bool always_build_infrastructure; ///< Always allow building of infrastructure, even when you do not have the vehicles for it belugas@8960: UnitID max_trains; ///< max trains in game per player (these are 16bit because the unitnumber field can't hold more) belugas@8960: UnitID max_roadveh; ///< max trucks in game per player belugas@8960: UnitID max_aircraft; ///< max planes in game per player belugas@8960: UnitID max_ships; ///< max ships in game per player rubidium@4344: belugas@8960: bool servint_ispercent; ///< service intervals are in percents belugas@8960: uint16 servint_trains; ///< service interval for trains belugas@8960: uint16 servint_roadveh; ///< service interval for road vehicles belugas@8960: uint16 servint_aircraft; ///< service interval for aircraft belugas@8960: uint16 servint_ships; ///< service interval for ships truelight@0: smatz@9047: uint8 pathfinder_for_trains; ///< the pathfinder to use for trains smatz@9047: uint8 pathfinder_for_roadvehs; ///< the pathfinder to use for roadvehicles smatz@9047: uint8 pathfinder_for_ships; ///< the pathfinder to use for ships smatz@9047: peter1138@9144: uint8 plane_speed; ///< divisor for speed of aircraft peter1138@9144: truelight@0: bool autorenew; truelight@26: int16 autorenew_months; truelight@26: int32 autorenew_money; truelight@0: belugas@8960: byte pf_maxdepth; ///< maximum recursion depth when searching for a train route for new pathfinder belugas@8960: uint16 pf_maxlength; ///< maximum length when searching for a train route for new pathfinder truelight@0: belugas@8960: bool bridge_pillars; ///< show bridge pillars for high bridges truelight@0: belugas@8960: bool ai_disable_veh_train; ///< disable types for AI belugas@8960: bool ai_disable_veh_roadveh; ///< disable types for AI belugas@8960: bool ai_disable_veh_aircraft; ///< disable types for AI belugas@8960: bool ai_disable_veh_ship; ///< disable types for AI belugas@8960: Year starting_year; ///< starting date belugas@8960: Year ending_year; ///< end of the game (just show highscore) belugas@8960: Year colored_news_year; ///< when does newspaper become colored? rubidium@4344: belugas@8960: bool keep_all_autosave; ///< name the autosave in a different way. belugas@8960: bool autosave_on_exit; ///< save an autosave when you quit the game, but do not ask "Do you really want to quit?" belugas@8960: byte max_num_autosaves; ///< controls how many autosavegames are made before the game starts to overwrite (names them 0 to max_num_autosaves - 1) belugas@8960: bool extra_dynamite; ///< extra dynamite belugas@8960: bool road_stop_on_town_road; ///< allow building of drive-through road stops on town owned roads rubidium@4344: belugas@8960: bool never_expire_vehicles; ///< never expire vehicles belugas@8960: byte extend_vehicle_life; ///< extend vehicle life by this many years belugas@8960: belugas@8960: bool auto_euro; ///< automatically switch to euro in 2002 belugas@8960: bool serviceathelipad; ///< service helicopters at helipads automatically (no need to send to depot) belugas@8960: bool smooth_economy; ///< smooth economy belugas@8960: bool allow_shares; ///< allow the buying/selling of shares belugas@8960: byte dist_local_authority; ///< distance for town local authority, default 20 belugas@8960: belugas@8960: byte wait_oneway_signal; ///< waitingtime in days before a oneway signal belugas@8960: byte wait_twoway_signal; ///< waitingtime in days before a twoway signal belugas@8960: belugas@8960: uint8 map_x; ///< Size of map bjarni@3126: uint8 map_y; tron@1218: belugas@8960: byte drag_signals_density; ///< many signals density belugas@8960: Year semaphore_build_before; ///< Build semaphore signals automatically before this year belugas@8960: bool ainew_active; ///< Is the new AI active? belugas@8960: bool ai_in_multiplayer; ///< Do we allow AIs in multiplayer truelight@835: matthijs@1700: /* rubidium@4549: * New Path Finding rubidium@4549: */ belugas@8960: bool new_pathfinding_all; ///< Use the newest pathfinding algorithm for all matthijs@1247: matthijs@1700: /** rubidium@4549: * The maximum amount of search nodes a single NPF run should take. This rubidium@4549: * limit should make sure performance stays at acceptable levels at the cost rubidium@4549: * of not being perfect anymore. This will probably be fixed in a more rubidium@4549: * sophisticated way sometime soon rubidium@4549: */ matthijs@1700: uint32 npf_max_search_nodes; matthijs@1700: belugas@8960: uint32 npf_rail_firstred_penalty; ///< The penalty for when the first signal is red (and it is not an exit or combo signal) belugas@8960: uint32 npf_rail_firstred_exit_penalty; ///< The penalty for when the first signal is red (and it is an exit or combo signal) belugas@8960: uint32 npf_rail_lastred_penalty; ///< The penalty for when the last signal is red belugas@8960: uint32 npf_rail_station_penalty; ///< The penalty for station tiles belugas@8960: uint32 npf_rail_slope_penalty; ///< The penalty for sloping upwards belugas@8960: uint32 npf_rail_curve_penalty; ///< The penalty for curves belugas@8960: uint32 npf_rail_depot_reverse_penalty; ///< The penalty for reversing in depots belugas@8960: uint32 npf_buoy_penalty; ///< The penalty for going over (through) a buoy belugas@8960: uint32 npf_water_curve_penalty; ///< The penalty for curves belugas@8960: uint32 npf_road_curve_penalty; ///< The penalty for curves belugas@8960: uint32 npf_crossing_penalty; ///< The penalty for level crossings belugas@8960: uint32 npf_road_drive_through_penalty; ///< The penalty for going through a drive-through road stop matthijs@1247: belugas@8960: bool population_in_label; ///< Show the population of a town in his label? KUDr@3900: belugas@8960: uint8 freight_trains; ///< Value to multiply the weight of cargo by peter1138@5163: KUDr@3900: /** YAPF settings */ KUDr@3900: YapfSettings yapf; KUDr@3900: bjarni@7981: uint8 right_mouse_btn_emulation; bjarni@7981: bjarni@6615: uint8 scrollwheel_scrolling; bjarni@6615: uint8 scrollwheel_multiplier; maedhros@6950: belugas@8960: uint8 town_growth_rate; ///< Town growth rate belugas@8960: uint8 larger_towns; ///< The number of cities to build. These start off larger and grow twice as fast belugas@8960: uint8 initial_city_size; ///< Multiplier for the initial size of the cities compared to towns maedhros@7039: belugas@8960: bool pause_on_newgame; ///< Whether to start new games paused or not. belugas@7067: glx@7073: TownLayoutByte town_layout; ///< Select town layout maedhros@7476: belugas@8960: bool timetabling; ///< Whether to allow timetabling. belugas@8960: bool timetable_in_ticks; ///< Whether to show the timetable in ticks rather than days. rubidium@8137: belugas@8960: bool autoslope; ///< Allow terraforming under things. rubidium@8153: belugas@8960: bool mod_road_rebuild; ///< Roadworks remove unneccesary RoadBits rubidium@8487: belugas@8960: bool exclusive_rights; ///< allow buying exclusive rights belugas@8960: bool give_money; ///< allow giving other players money belugas@8960: belugas@8960: bool enable_signal_gui; ///< Show the signal GUI when the signal button is pressed rubidium@6574: }; truelight@0: rubidium@8704: extern Patches _patches; truelight@0: rubidium@8704: /** The patch values that are used for new games and/or modified in config file */ rubidium@8704: extern Patches _patches_newgame; truelight@0: rubidium@8704: #endif /* SETTINGS_TYPE_H */