00001 /* $Id: settings_type.h 15601 2009-03-02 22:57:47Z rubidium $ */ 00002 00005 #ifndef SETTINGS_TYPE_H 00006 #define SETTINGS_TYPE_H 00007 00008 #include "date_type.h" 00009 #include "town_type.h" 00010 #include "transport_type.h" 00011 #include "network/core/config.h" 00012 #include "company_type.h" 00013 00015 struct DifficultySettings { 00016 byte max_no_competitors; 00017 byte number_towns; 00018 byte number_industries; 00019 uint32 max_loan; 00020 byte initial_interest; 00021 byte vehicle_costs; 00022 byte competitor_speed; 00023 byte vehicle_breakdowns; 00024 byte subsidy_multiplier; 00025 byte construction_cost; 00026 byte terrain_type; 00027 byte quantity_sea_lakes; 00028 byte economy; 00029 byte line_reverse_mode; 00030 byte disasters; 00031 byte town_council_tolerance; 00032 byte diff_level; 00033 }; 00034 00036 struct GUISettings { 00037 bool vehicle_speed; 00038 bool sg_full_load_any; 00039 bool lost_train_warn; 00040 uint8 order_review_system; 00041 bool vehicle_income_warn; 00042 bool status_long_date; 00043 bool show_finances; 00044 bool sg_new_nonstop; 00045 bool new_nonstop; 00046 bool autoscroll; 00047 byte errmsg_duration; 00048 bool link_terraform_toolbar; 00049 bool reverse_scroll; 00050 bool smooth_scroll; 00051 bool measure_tooltip; 00052 byte liveries; 00053 bool prefer_teamchat; 00054 uint8 advanced_vehicle_list; 00055 uint8 loading_indicators; 00056 uint8 default_rail_type; 00057 uint8 toolbar_pos; 00058 uint8 window_snap_radius; 00059 uint8 window_soft_limit; 00060 bool always_build_infrastructure; 00061 byte autosave; 00062 bool keep_all_autosave; 00063 bool autosave_on_exit; 00064 uint8 date_format_in_default_names; 00065 byte max_num_autosaves; 00066 bool population_in_label; 00067 uint8 right_mouse_btn_emulation; 00068 uint8 scrollwheel_scrolling; 00069 uint8 scrollwheel_multiplier; 00070 bool left_mouse_btn_scrolling; 00071 bool pause_on_newgame; 00072 bool enable_signal_gui; 00073 Year coloured_news_year; 00074 bool timetable_in_ticks; 00075 bool quick_goto; 00076 bool bridge_pillars; 00077 bool auto_euro; 00078 byte drag_signals_density; 00079 Year semaphore_build_before; 00080 bool autorenew; 00081 int16 autorenew_months; 00082 int32 autorenew_money; 00083 byte news_message_timeout; 00084 bool show_track_reservation; 00085 uint8 default_signal_type; 00086 uint8 cycle_signal_types; 00087 byte station_numtracks; 00088 byte station_platlength; 00089 bool station_dragdrop; 00090 bool station_show_coverage; 00091 bool persistent_buildingtools; 00092 uint8 expenses_layout; 00093 00094 uint16 console_backlog_timeout; 00095 uint16 console_backlog_length; 00096 #ifdef ENABLE_NETWORK 00097 uint16 network_chat_box_width; 00098 uint8 network_chat_box_height; 00099 #endif 00100 }; 00101 00103 struct LocaleSettings { 00104 byte currency; 00105 byte units; 00106 }; 00107 00109 struct NetworkSettings { 00110 #ifdef ENABLE_NETWORK 00111 uint16 sync_freq; 00112 uint8 frame_freq; 00113 uint16 max_join_time; 00114 bool pause_on_join; 00115 char server_bind_ip[NETWORK_HOSTNAME_LENGTH]; 00116 uint16 server_port; 00117 char server_name[NETWORK_NAME_LENGTH]; 00118 char server_password[NETWORK_PASSWORD_LENGTH]; 00119 char rcon_password[NETWORK_PASSWORD_LENGTH]; 00120 bool server_advertise; 00121 uint8 lan_internet; 00122 char client_name[NETWORK_NAME_LENGTH]; 00123 char default_company_pass[NETWORK_PASSWORD_LENGTH]; 00124 char connect_to_ip[NETWORK_HOSTNAME_LENGTH]; 00125 char network_id[NETWORK_UNIQUE_ID_LENGTH]; 00126 bool autoclean_companies; 00127 uint8 autoclean_unprotected; 00128 uint8 autoclean_protected; 00129 uint8 max_companies; 00130 uint8 max_clients; 00131 uint8 max_spectators; 00132 Year restart_game_year; 00133 uint8 min_active_clients; 00134 uint8 server_lang; 00135 bool reload_cfg; 00136 char last_host[NETWORK_HOSTNAME_LENGTH]; 00137 uint16 last_port; 00138 #else /* ENABLE_NETWORK */ 00139 #endif 00140 }; 00141 00143 struct GameCreationSettings { 00144 uint32 generation_seed; 00145 Year starting_year; 00146 uint8 map_x; 00147 uint8 map_y; 00148 byte land_generator; 00149 byte oil_refinery_limit; 00150 byte snow_line_height; 00151 byte tgen_smoothness; 00152 byte tree_placer; 00153 byte heightmap_rotation; 00154 byte se_flat_world_height; 00155 byte town_name; 00156 byte landscape; 00157 byte snow_line; 00158 byte water_borders; 00159 }; 00160 00162 struct ConstructionSettings { 00163 bool build_on_slopes; 00164 bool autoslope; 00165 bool longbridges; 00166 bool signal_side; 00167 bool extra_dynamite; 00168 bool road_stop_on_town_road; 00169 bool road_stop_on_competitor_road; 00170 uint8 raw_industry_construction; 00171 bool freeform_edges; 00172 }; 00173 00175 struct AISettings { 00176 bool ai_in_multiplayer; 00177 bool ai_disable_veh_train; 00178 bool ai_disable_veh_roadveh; 00179 bool ai_disable_veh_aircraft; 00180 bool ai_disable_veh_ship; 00181 uint32 ai_max_opcode_till_suspend; 00182 }; 00183 00185 struct OPFSettings { 00186 uint16 pf_maxlength; 00187 byte pf_maxdepth; 00188 }; 00189 00191 struct NPFSettings { 00197 uint32 npf_max_search_nodes; 00198 00199 uint32 npf_rail_firstred_penalty; 00200 uint32 npf_rail_firstred_exit_penalty; 00201 uint32 npf_rail_lastred_penalty; 00202 uint32 npf_rail_station_penalty; 00203 uint32 npf_rail_slope_penalty; 00204 uint32 npf_rail_curve_penalty; 00205 uint32 npf_rail_depot_reverse_penalty; 00206 uint32 npf_rail_pbs_cross_penalty; 00207 uint32 npf_rail_pbs_signal_back_penalty; 00208 uint32 npf_buoy_penalty; 00209 uint32 npf_water_curve_penalty; 00210 uint32 npf_road_curve_penalty; 00211 uint32 npf_crossing_penalty; 00212 uint32 npf_road_drive_through_penalty; 00213 }; 00214 00216 struct YAPFSettings { 00217 bool disable_node_optimization; 00218 uint32 max_search_nodes; 00219 bool ship_use_yapf; 00220 bool road_use_yapf; 00221 bool rail_use_yapf; 00222 uint32 road_slope_penalty; 00223 uint32 road_curve_penalty; 00224 uint32 road_crossing_penalty; 00225 uint32 road_stop_penalty; 00226 bool rail_firstred_twoway_eol; 00227 uint32 rail_firstred_penalty; 00228 uint32 rail_firstred_exit_penalty; 00229 uint32 rail_lastred_penalty; 00230 uint32 rail_lastred_exit_penalty; 00231 uint32 rail_station_penalty; 00232 uint32 rail_slope_penalty; 00233 uint32 rail_curve45_penalty; 00234 uint32 rail_curve90_penalty; 00235 uint32 rail_depot_reverse_penalty; 00236 uint32 rail_crossing_penalty; 00237 uint32 rail_look_ahead_max_signals; 00238 int32 rail_look_ahead_signal_p0; 00239 int32 rail_look_ahead_signal_p1; 00240 int32 rail_look_ahead_signal_p2; 00241 uint32 rail_pbs_cross_penalty; 00242 uint32 rail_pbs_station_penalty; 00243 uint32 rail_pbs_signal_back_penalty; 00244 uint32 rail_doubleslip_penalty; 00245 00246 uint32 rail_longer_platform_penalty; 00247 uint32 rail_longer_platform_per_tile_penalty; 00248 uint32 rail_shorter_platform_penalty; 00249 uint32 rail_shorter_platform_per_tile_penalty; 00250 }; 00251 00253 struct PathfinderSettings { 00254 uint8 pathfinder_for_trains; 00255 uint8 pathfinder_for_roadvehs; 00256 uint8 pathfinder_for_ships; 00257 bool new_pathfinding_all; 00258 00259 bool roadveh_queue; 00260 bool forbid_90_deg; 00261 00262 byte wait_oneway_signal; 00263 byte wait_twoway_signal; 00264 00265 bool reserve_paths; 00266 byte wait_for_pbs_path; 00267 byte path_backoff_interval; 00268 00269 OPFSettings opf; 00270 NPFSettings npf; 00271 YAPFSettings yapf; 00272 }; 00273 00275 struct OrderSettings { 00276 bool improved_load; 00277 bool gradual_loading; 00278 bool selectgoods; 00279 bool gotodepot; 00280 bool no_servicing_if_no_breakdowns; 00281 bool timetabling; 00282 bool serviceathelipad; 00283 }; 00284 00286 struct VehicleSettings { 00287 bool mammoth_trains; 00288 uint8 train_acceleration_model; 00289 bool wagon_speed_limits; 00290 bool disable_elrails; 00291 UnitID max_trains; 00292 UnitID max_roadveh; 00293 UnitID max_aircraft; 00294 UnitID max_ships; 00295 bool servint_ispercent; 00296 uint16 servint_trains; 00297 uint16 servint_roadveh; 00298 uint16 servint_aircraft; 00299 uint16 servint_ships; 00300 uint8 plane_speed; 00301 uint8 freight_trains; 00302 bool dynamic_engines; 00303 bool never_expire_vehicles; 00304 byte extend_vehicle_life; 00305 byte road_side; 00306 }; 00307 00309 struct EconomySettings { 00310 bool inflation; 00311 bool bribe; 00312 bool smooth_economy; 00313 bool allow_shares; 00314 byte dist_local_authority; 00315 bool exclusive_rights; 00316 bool give_money; 00317 bool mod_road_rebuild; 00318 bool multiple_industry_per_town; 00319 bool same_industry_close; 00320 uint8 town_growth_rate; 00321 uint8 larger_towns; 00322 uint8 initial_city_size; 00323 TownLayoutByte town_layout; 00324 bool allow_town_roads; 00325 bool station_noise_level; 00326 uint16 town_noise_population[3]; 00327 }; 00328 00330 struct StationSettings { 00331 bool modified_catchment; 00332 bool join_stations; 00333 bool nonuniform_stations; 00334 bool adjacent_stations; 00335 bool distant_join_stations; 00336 bool always_small_airport; 00337 byte station_spread; 00338 }; 00339 00341 struct GameSettings { 00342 DifficultySettings difficulty; 00343 GameCreationSettings game_creation; 00344 ConstructionSettings construction; 00345 AISettings ai; 00346 class AIConfig *ai_config[MAX_COMPANIES]; 00347 PathfinderSettings pf; 00348 OrderSettings order; 00349 VehicleSettings vehicle; 00350 EconomySettings economy; 00351 StationSettings station; 00352 LocaleSettings locale; 00353 }; 00354 00356 struct ClientSettings { 00357 GUISettings gui; 00358 NetworkSettings network; 00359 }; 00360 00362 extern ClientSettings _settings_client; 00363 00365 extern GameSettings _settings_game; 00366 00368 extern GameSettings _settings_newgame; 00369 00370 #endif /* SETTINGS_TYPE_H */