00001 /* $Id: settings_type.h 21656 2010-12-29 13:32:35Z planetmaker $ */ 00002 00003 /* 00004 * This file is part of OpenTTD. 00005 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. 00006 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00007 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. 00008 */ 00009 00012 #ifndef SETTINGS_TYPE_H 00013 #define SETTINGS_TYPE_H 00014 00015 #include "date_type.h" 00016 #include "town_type.h" 00017 #include "transport_type.h" 00018 #include "network/core/config.h" 00019 #include "company_type.h" 00020 00022 struct DifficultySettings { 00023 byte max_no_competitors; 00024 byte number_towns; 00025 byte number_industries; 00026 uint32 max_loan; 00027 byte initial_interest; 00028 byte vehicle_costs; 00029 byte competitor_speed; 00030 byte vehicle_breakdowns; 00031 byte subsidy_multiplier; 00032 byte construction_cost; 00033 byte terrain_type; 00034 byte quantity_sea_lakes; 00035 byte economy; 00036 byte line_reverse_mode; 00037 byte disasters; 00038 byte town_council_tolerance; 00039 byte diff_level; 00040 }; 00041 00043 struct GUISettings { 00044 bool vehicle_speed; 00045 bool sg_full_load_any; 00046 bool lost_vehicle_warn; 00047 uint8 order_review_system; 00048 bool vehicle_income_warn; 00049 bool status_long_date; 00050 bool show_finances; 00051 bool sg_new_nonstop; 00052 bool new_nonstop; 00053 uint8 stop_location; 00054 bool autoscroll; 00055 byte errmsg_duration; 00056 byte hover_delay; 00057 bool link_terraform_toolbar; 00058 uint8 smallmap_land_colour; 00059 bool reverse_scroll; 00060 bool smooth_scroll; 00061 bool measure_tooltip; 00062 byte liveries; 00063 bool prefer_teamchat; 00064 uint8 advanced_vehicle_list; 00065 uint8 loading_indicators; 00066 uint8 default_rail_type; 00067 uint8 toolbar_pos; 00068 uint8 statusbar_pos; 00069 uint8 window_snap_radius; 00070 uint8 window_soft_limit; 00071 bool always_build_infrastructure; 00072 byte autosave; 00073 bool threaded_saves; 00074 bool keep_all_autosave; 00075 bool autosave_on_exit; 00076 uint8 date_format_in_default_names; 00077 byte max_num_autosaves; 00078 bool population_in_label; 00079 uint8 right_mouse_btn_emulation; 00080 uint8 scrollwheel_scrolling; 00081 uint8 scrollwheel_multiplier; 00082 bool timetable_arrival_departure; 00083 bool left_mouse_btn_scrolling; 00084 bool pause_on_newgame; 00085 bool enable_signal_gui; 00086 Year coloured_news_year; 00087 bool timetable_in_ticks; 00088 bool quick_goto; 00089 bool bridge_pillars; 00090 bool auto_euro; 00091 byte drag_signals_density; 00092 Year semaphore_build_before; 00093 byte news_message_timeout; 00094 bool show_track_reservation; 00095 uint8 default_signal_type; 00096 uint8 cycle_signal_types; 00097 byte station_numtracks; 00098 byte station_platlength; 00099 bool station_dragdrop; 00100 bool station_show_coverage; 00101 bool persistent_buildingtools; 00102 bool expenses_layout; 00103 00104 uint16 console_backlog_timeout; 00105 uint16 console_backlog_length; 00106 #ifdef ENABLE_NETWORK 00107 uint16 network_chat_box_width; 00108 uint8 network_chat_box_height; 00109 uint16 network_chat_timeout; 00110 #endif 00111 00112 uint8 developer; 00113 bool show_date_in_logs; 00114 bool newgrf_developer_tools; 00115 bool ai_developer_tools; 00116 bool scenario_developer; 00117 bool newgrf_show_old_versions; 00118 00123 bool UserIsAllowedToChangeNewGRFs() const 00124 { 00125 return this->scenario_developer || this->newgrf_developer_tools; 00126 } 00127 }; 00128 00130 struct LocaleSettings { 00131 byte currency; 00132 byte units; 00133 char *digit_group_separator; 00134 char *digit_group_separator_currency; 00135 char *digit_decimal_separator; 00136 }; 00137 00139 struct NetworkSettings { 00140 #ifdef ENABLE_NETWORK 00141 uint16 sync_freq; 00142 uint8 frame_freq; 00143 uint16 commands_per_frame; 00144 uint16 max_commands_in_queue; 00145 uint16 bytes_per_frame; 00146 uint16 bytes_per_frame_burst; 00147 uint16 max_join_time; 00148 bool pause_on_join; 00149 uint16 server_port; 00150 uint16 server_admin_port; 00151 bool server_admin_chat; 00152 char server_name[NETWORK_NAME_LENGTH]; 00153 char server_password[NETWORK_PASSWORD_LENGTH]; 00154 char rcon_password[NETWORK_PASSWORD_LENGTH]; 00155 char admin_password[NETWORK_PASSWORD_LENGTH]; 00156 bool server_advertise; 00157 uint8 lan_internet; 00158 char client_name[NETWORK_CLIENT_NAME_LENGTH]; 00159 char default_company_pass[NETWORK_PASSWORD_LENGTH]; 00160 char connect_to_ip[NETWORK_HOSTNAME_LENGTH]; 00161 char network_id[NETWORK_SERVER_ID_LENGTH]; 00162 bool autoclean_companies; 00163 uint8 autoclean_unprotected; 00164 uint8 autoclean_protected; 00165 uint8 autoclean_novehicles; 00166 uint8 max_companies; 00167 uint8 max_clients; 00168 uint8 max_spectators; 00169 Year restart_game_year; 00170 uint8 min_active_clients; 00171 uint8 server_lang; 00172 bool reload_cfg; 00173 char last_host[NETWORK_HOSTNAME_LENGTH]; 00174 uint16 last_port; 00175 bool no_http_content_downloads; 00176 #else /* ENABLE_NETWORK */ 00177 #endif 00178 }; 00179 00181 struct GameCreationSettings { 00182 uint32 generation_seed; 00183 Year starting_year; 00184 uint8 map_x; 00185 uint8 map_y; 00186 byte land_generator; 00187 byte oil_refinery_limit; 00188 byte snow_line_height; 00189 byte tgen_smoothness; 00190 byte tree_placer; 00191 byte heightmap_rotation; 00192 byte se_flat_world_height; 00193 byte town_name; 00194 byte landscape; 00195 byte snow_line; 00196 byte water_borders; 00197 uint16 custom_town_number; 00198 byte variety; 00199 byte custom_sea_level; 00200 }; 00201 00203 struct ConstructionSettings { 00204 bool build_on_slopes; 00205 bool autoslope; 00206 bool longbridges; 00207 bool signal_side; 00208 bool extra_dynamite; 00209 bool road_stop_on_town_road; 00210 bool road_stop_on_competitor_road; 00211 uint8 raw_industry_construction; 00212 uint8 industry_platform; 00213 bool freeform_edges; 00214 uint8 extra_tree_placement; 00215 uint8 command_pause_level; 00216 }; 00217 00219 struct AISettings { 00220 bool ai_in_multiplayer; 00221 bool ai_disable_veh_train; 00222 bool ai_disable_veh_roadveh; 00223 bool ai_disable_veh_aircraft; 00224 bool ai_disable_veh_ship; 00225 uint32 ai_max_opcode_till_suspend; 00226 }; 00227 00229 struct OPFSettings { 00230 uint16 pf_maxlength; 00231 byte pf_maxdepth; 00232 }; 00233 00235 struct NPFSettings { 00241 uint32 npf_max_search_nodes; 00242 uint32 maximum_go_to_depot_penalty; 00243 00244 uint32 npf_rail_firstred_penalty; 00245 uint32 npf_rail_firstred_exit_penalty; 00246 uint32 npf_rail_lastred_penalty; 00247 uint32 npf_rail_station_penalty; 00248 uint32 npf_rail_slope_penalty; 00249 uint32 npf_rail_curve_penalty; 00250 uint32 npf_rail_depot_reverse_penalty; 00251 uint32 npf_rail_pbs_cross_penalty; 00252 uint32 npf_rail_pbs_signal_back_penalty; 00253 uint32 npf_buoy_penalty; 00254 uint32 npf_water_curve_penalty; 00255 uint32 npf_road_curve_penalty; 00256 uint32 npf_crossing_penalty; 00257 uint32 npf_road_drive_through_penalty; 00258 uint32 npf_road_dt_occupied_penalty; 00259 uint32 npf_road_bay_occupied_penalty; 00260 }; 00261 00263 struct YAPFSettings { 00264 bool disable_node_optimization; 00265 uint32 max_search_nodes; 00266 uint32 maximum_go_to_depot_penalty; 00267 bool ship_use_yapf; 00268 bool road_use_yapf; 00269 bool rail_use_yapf; 00270 uint32 road_slope_penalty; 00271 uint32 road_curve_penalty; 00272 uint32 road_crossing_penalty; 00273 uint32 road_stop_penalty; 00274 uint32 road_stop_occupied_penalty; 00275 uint32 road_stop_bay_occupied_penalty; 00276 bool rail_firstred_twoway_eol; 00277 uint32 rail_firstred_penalty; 00278 uint32 rail_firstred_exit_penalty; 00279 uint32 rail_lastred_penalty; 00280 uint32 rail_lastred_exit_penalty; 00281 uint32 rail_station_penalty; 00282 uint32 rail_slope_penalty; 00283 uint32 rail_curve45_penalty; 00284 uint32 rail_curve90_penalty; 00285 uint32 rail_depot_reverse_penalty; 00286 uint32 rail_crossing_penalty; 00287 uint32 rail_look_ahead_max_signals; 00288 int32 rail_look_ahead_signal_p0; 00289 int32 rail_look_ahead_signal_p1; 00290 int32 rail_look_ahead_signal_p2; 00291 uint32 rail_pbs_cross_penalty; 00292 uint32 rail_pbs_station_penalty; 00293 uint32 rail_pbs_signal_back_penalty; 00294 uint32 rail_doubleslip_penalty; 00295 00296 uint32 rail_longer_platform_penalty; 00297 uint32 rail_longer_platform_per_tile_penalty; 00298 uint32 rail_shorter_platform_penalty; 00299 uint32 rail_shorter_platform_per_tile_penalty; 00300 }; 00301 00303 struct PathfinderSettings { 00304 uint8 pathfinder_for_trains; 00305 uint8 pathfinder_for_roadvehs; 00306 uint8 pathfinder_for_ships; 00307 bool new_pathfinding_all; 00308 00309 bool roadveh_queue; 00310 bool forbid_90_deg; 00311 00312 byte wait_oneway_signal; 00313 byte wait_twoway_signal; 00314 00315 bool reserve_paths; 00316 byte wait_for_pbs_path; 00317 byte path_backoff_interval; 00318 00319 OPFSettings opf; 00320 NPFSettings npf; 00321 YAPFSettings yapf; 00322 }; 00323 00325 struct OrderSettings { 00326 bool improved_load; 00327 bool gradual_loading; 00328 bool selectgoods; 00329 bool gotodepot; 00330 bool no_servicing_if_no_breakdowns; 00331 bool timetabling; 00332 bool serviceathelipad; 00333 }; 00334 00336 struct VehicleSettings { 00337 bool mammoth_trains; 00338 uint8 smoke_amount; 00339 uint8 train_acceleration_model; 00340 uint8 roadveh_acceleration_model; 00341 uint8 train_slope_steepness; 00342 uint8 roadveh_slope_steepness; 00343 bool wagon_speed_limits; 00344 bool disable_elrails; 00345 UnitID max_trains; 00346 UnitID max_roadveh; 00347 UnitID max_aircraft; 00348 UnitID max_ships; 00349 uint8 plane_speed; 00350 uint8 freight_trains; 00351 bool dynamic_engines; 00352 bool never_expire_vehicles; 00353 byte extend_vehicle_life; 00354 byte road_side; 00355 uint8 plane_crashes; 00356 }; 00357 00359 struct EconomySettings { 00360 bool inflation; 00361 bool bribe; 00362 bool smooth_economy; 00363 bool allow_shares; 00364 uint8 feeder_payment_share; 00365 byte dist_local_authority; 00366 bool exclusive_rights; 00367 bool give_money; 00368 bool mod_road_rebuild; 00369 bool multiple_industry_per_town; 00370 uint8 town_growth_rate; 00371 uint8 larger_towns; 00372 uint8 initial_city_size; 00373 TownLayoutByte town_layout; 00374 bool allow_town_roads; 00375 TownFoundingByte found_town; 00376 bool station_noise_level; 00377 uint16 town_noise_population[3]; 00378 bool allow_town_level_crossings; 00379 }; 00380 00382 struct StationSettings { 00383 bool modified_catchment; 00384 bool join_stations; 00385 bool nonuniform_stations; 00386 bool adjacent_stations; 00387 bool distant_join_stations; 00388 bool never_expire_airports; 00389 byte station_spread; 00390 }; 00391 00393 struct VehicleDefaultSettings { 00394 bool servint_ispercent; 00395 uint16 servint_trains; 00396 uint16 servint_roadveh; 00397 uint16 servint_aircraft; 00398 uint16 servint_ships; 00399 }; 00400 00402 struct CompanySettings { 00403 bool engine_renew; 00404 int16 engine_renew_months; 00405 uint32 engine_renew_money; 00406 bool renew_keep_length; 00407 VehicleDefaultSettings vehicle; 00408 }; 00409 00411 struct GameSettings { 00412 DifficultySettings difficulty; 00413 GameCreationSettings game_creation; 00414 ConstructionSettings construction; 00415 AISettings ai; 00416 class AIConfig *ai_config[MAX_COMPANIES]; 00417 PathfinderSettings pf; 00418 OrderSettings order; 00419 VehicleSettings vehicle; 00420 EconomySettings economy; 00421 StationSettings station; 00422 LocaleSettings locale; 00423 }; 00424 00426 struct ClientSettings { 00427 GUISettings gui; 00428 NetworkSettings network; 00429 CompanySettings company; 00430 }; 00431 00433 extern ClientSettings _settings_client; 00434 00436 extern GameSettings _settings_game; 00437 00439 extern GameSettings _settings_newgame; 00440 00441 #endif /* SETTINGS_TYPE_H */