00001 /* $Id$ */ 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_train_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 bool link_terraform_toolbar; 00057 bool reverse_scroll; 00058 bool smooth_scroll; 00059 bool measure_tooltip; 00060 byte liveries; 00061 bool prefer_teamchat; 00062 uint8 advanced_vehicle_list; 00063 uint8 loading_indicators; 00064 uint8 default_rail_type; 00065 uint8 toolbar_pos; 00066 uint8 window_snap_radius; 00067 uint8 window_soft_limit; 00068 bool always_build_infrastructure; 00069 byte autosave; 00070 bool threaded_saves; 00071 bool keep_all_autosave; 00072 bool autosave_on_exit; 00073 uint8 date_format_in_default_names; 00074 byte max_num_autosaves; 00075 bool population_in_label; 00076 uint8 right_mouse_btn_emulation; 00077 uint8 scrollwheel_scrolling; 00078 uint8 scrollwheel_multiplier; 00079 bool timetable_arrival_departure; 00080 bool left_mouse_btn_scrolling; 00081 bool pause_on_newgame; 00082 bool enable_signal_gui; 00083 Year coloured_news_year; 00084 bool timetable_in_ticks; 00085 bool quick_goto; 00086 bool bridge_pillars; 00087 bool auto_euro; 00088 byte drag_signals_density; 00089 Year semaphore_build_before; 00090 byte news_message_timeout; 00091 bool show_track_reservation; 00092 uint8 default_signal_type; 00093 uint8 cycle_signal_types; 00094 byte station_numtracks; 00095 byte station_platlength; 00096 bool station_dragdrop; 00097 bool station_show_coverage; 00098 bool persistent_buildingtools; 00099 uint8 expenses_layout; 00100 00101 uint16 console_backlog_timeout; 00102 uint16 console_backlog_length; 00103 #ifdef ENABLE_NETWORK 00104 uint16 network_chat_box_width; 00105 uint8 network_chat_box_height; 00106 #endif 00107 00108 bool show_date_in_logs; 00109 }; 00110 00112 struct LocaleSettings { 00113 byte currency; 00114 byte units; 00115 char *digit_group_separator; 00116 char *digit_group_separator_currency; 00117 char *digit_decimal_separator; 00118 }; 00119 00121 struct NetworkSettings { 00122 #ifdef ENABLE_NETWORK 00123 uint16 sync_freq; 00124 uint8 frame_freq; 00125 uint16 max_join_time; 00126 bool pause_on_join; 00127 uint16 server_port; 00128 char server_name[NETWORK_NAME_LENGTH]; 00129 char server_password[NETWORK_PASSWORD_LENGTH]; 00130 char rcon_password[NETWORK_PASSWORD_LENGTH]; 00131 bool server_advertise; 00132 uint8 lan_internet; 00133 char client_name[NETWORK_CLIENT_NAME_LENGTH]; 00134 char default_company_pass[NETWORK_PASSWORD_LENGTH]; 00135 char connect_to_ip[NETWORK_HOSTNAME_LENGTH]; 00136 char network_id[NETWORK_UNIQUE_ID_LENGTH]; 00137 bool autoclean_companies; 00138 uint8 autoclean_unprotected; 00139 uint8 autoclean_protected; 00140 uint8 autoclean_novehicles; 00141 uint8 max_companies; 00142 uint8 max_clients; 00143 uint8 max_spectators; 00144 Year restart_game_year; 00145 uint8 min_active_clients; 00146 uint8 server_lang; 00147 bool reload_cfg; 00148 char last_host[NETWORK_HOSTNAME_LENGTH]; 00149 uint16 last_port; 00150 #else /* ENABLE_NETWORK */ 00151 #endif 00152 }; 00153 00155 struct GameCreationSettings { 00156 uint32 generation_seed; 00157 Year starting_year; 00158 uint8 map_x; 00159 uint8 map_y; 00160 byte land_generator; 00161 byte oil_refinery_limit; 00162 byte snow_line_height; 00163 byte tgen_smoothness; 00164 byte tree_placer; 00165 byte heightmap_rotation; 00166 byte se_flat_world_height; 00167 byte town_name; 00168 byte landscape; 00169 byte snow_line; 00170 byte water_borders; 00171 uint16 custom_town_number; 00172 byte variety; 00173 }; 00174 00176 struct ConstructionSettings { 00177 bool build_on_slopes; 00178 bool autoslope; 00179 bool longbridges; 00180 bool signal_side; 00181 bool extra_dynamite; 00182 bool road_stop_on_town_road; 00183 bool road_stop_on_competitor_road; 00184 uint8 raw_industry_construction; 00185 bool freeform_edges; 00186 uint8 extra_tree_placement; 00187 }; 00188 00190 struct AISettings { 00191 bool ai_in_multiplayer; 00192 bool ai_disable_veh_train; 00193 bool ai_disable_veh_roadveh; 00194 bool ai_disable_veh_aircraft; 00195 bool ai_disable_veh_ship; 00196 uint32 ai_max_opcode_till_suspend; 00197 }; 00198 00200 struct OPFSettings { 00201 uint16 pf_maxlength; 00202 byte pf_maxdepth; 00203 }; 00204 00206 struct NPFSettings { 00212 uint32 npf_max_search_nodes; 00213 uint32 maximum_go_to_depot_penalty; 00214 00215 uint32 npf_rail_firstred_penalty; 00216 uint32 npf_rail_firstred_exit_penalty; 00217 uint32 npf_rail_lastred_penalty; 00218 uint32 npf_rail_station_penalty; 00219 uint32 npf_rail_slope_penalty; 00220 uint32 npf_rail_curve_penalty; 00221 uint32 npf_rail_depot_reverse_penalty; 00222 uint32 npf_rail_pbs_cross_penalty; 00223 uint32 npf_rail_pbs_signal_back_penalty; 00224 uint32 npf_buoy_penalty; 00225 uint32 npf_water_curve_penalty; 00226 uint32 npf_road_curve_penalty; 00227 uint32 npf_crossing_penalty; 00228 uint32 npf_road_drive_through_penalty; 00229 uint32 npf_road_dt_occupied_penalty; 00230 uint32 npf_road_bay_occupied_penalty; 00231 }; 00232 00234 struct YAPFSettings { 00235 bool disable_node_optimization; 00236 uint32 max_search_nodes; 00237 uint32 maximum_go_to_depot_penalty; 00238 bool ship_use_yapf; 00239 bool road_use_yapf; 00240 bool rail_use_yapf; 00241 uint32 road_slope_penalty; 00242 uint32 road_curve_penalty; 00243 uint32 road_crossing_penalty; 00244 uint32 road_stop_penalty; 00245 uint32 road_stop_occupied_penalty; 00246 uint32 road_stop_bay_occupied_penalty; 00247 bool rail_firstred_twoway_eol; 00248 uint32 rail_firstred_penalty; 00249 uint32 rail_firstred_exit_penalty; 00250 uint32 rail_lastred_penalty; 00251 uint32 rail_lastred_exit_penalty; 00252 uint32 rail_station_penalty; 00253 uint32 rail_slope_penalty; 00254 uint32 rail_curve45_penalty; 00255 uint32 rail_curve90_penalty; 00256 uint32 rail_depot_reverse_penalty; 00257 uint32 rail_crossing_penalty; 00258 uint32 rail_look_ahead_max_signals; 00259 int32 rail_look_ahead_signal_p0; 00260 int32 rail_look_ahead_signal_p1; 00261 int32 rail_look_ahead_signal_p2; 00262 uint32 rail_pbs_cross_penalty; 00263 uint32 rail_pbs_station_penalty; 00264 uint32 rail_pbs_signal_back_penalty; 00265 uint32 rail_doubleslip_penalty; 00266 00267 uint32 rail_longer_platform_penalty; 00268 uint32 rail_longer_platform_per_tile_penalty; 00269 uint32 rail_shorter_platform_penalty; 00270 uint32 rail_shorter_platform_per_tile_penalty; 00271 }; 00272 00274 struct PathfinderSettings { 00275 uint8 pathfinder_for_trains; 00276 uint8 pathfinder_for_roadvehs; 00277 uint8 pathfinder_for_ships; 00278 bool new_pathfinding_all; 00279 00280 bool roadveh_queue; 00281 bool forbid_90_deg; 00282 00283 byte wait_oneway_signal; 00284 byte wait_twoway_signal; 00285 00286 bool reserve_paths; 00287 byte wait_for_pbs_path; 00288 byte path_backoff_interval; 00289 00290 OPFSettings opf; 00291 NPFSettings npf; 00292 YAPFSettings yapf; 00293 }; 00294 00296 struct OrderSettings { 00297 bool improved_load; 00298 bool gradual_loading; 00299 bool selectgoods; 00300 bool gotodepot; 00301 bool no_servicing_if_no_breakdowns; 00302 bool timetabling; 00303 bool serviceathelipad; 00304 }; 00305 00307 struct VehicleSettings { 00308 bool mammoth_trains; 00309 uint8 train_acceleration_model; 00310 bool wagon_speed_limits; 00311 bool disable_elrails; 00312 UnitID max_trains; 00313 UnitID max_roadveh; 00314 UnitID max_aircraft; 00315 UnitID max_ships; 00316 uint8 plane_speed; 00317 uint8 freight_trains; 00318 bool dynamic_engines; 00319 bool never_expire_vehicles; 00320 byte extend_vehicle_life; 00321 byte road_side; 00322 }; 00323 00325 struct EconomySettings { 00326 bool inflation; 00327 bool bribe; 00328 bool smooth_economy; 00329 bool allow_shares; 00330 byte dist_local_authority; 00331 bool exclusive_rights; 00332 bool give_money; 00333 bool mod_road_rebuild; 00334 bool multiple_industry_per_town; 00335 bool same_industry_close; 00336 uint8 town_growth_rate; 00337 uint8 larger_towns; 00338 uint8 initial_city_size; 00339 TownLayoutByte town_layout; 00340 bool allow_town_roads; 00341 TownFoundingByte found_town; 00342 bool station_noise_level; 00343 uint16 town_noise_population[3]; 00344 }; 00345 00347 struct StationSettings { 00348 bool modified_catchment; 00349 bool join_stations; 00350 bool nonuniform_stations; 00351 bool adjacent_stations; 00352 bool distant_join_stations; 00353 bool never_expire_airports; 00354 byte station_spread; 00355 }; 00356 00358 struct SharingSettings { 00359 bool sharing_rail; 00360 bool sharing_road; 00361 bool sharing_water; 00362 bool sharing_air; 00363 uint fee_rail; 00364 uint fee_road; 00365 uint fee_water; 00366 uint fee_air; 00367 bool payment_in_debt; 00368 }; 00369 00371 struct VehicleDefaultSettings { 00372 bool servint_ispercent; 00373 uint16 servint_trains; 00374 uint16 servint_roadveh; 00375 uint16 servint_aircraft; 00376 uint16 servint_ships; 00377 }; 00378 00380 struct CompanySettings { 00381 bool engine_renew; 00382 int16 engine_renew_months; 00383 uint32 engine_renew_money; 00384 bool renew_keep_length; 00385 VehicleDefaultSettings vehicle; 00386 }; 00387 00389 struct GameSettings { 00390 DifficultySettings difficulty; 00391 GameCreationSettings game_creation; 00392 ConstructionSettings construction; 00393 AISettings ai; 00394 class AIConfig *ai_config[MAX_COMPANIES]; 00395 PathfinderSettings pf; 00396 OrderSettings order; 00397 VehicleSettings vehicle; 00398 EconomySettings economy; 00399 StationSettings station; 00400 LocaleSettings locale; 00401 SharingSettings sharing; 00402 }; 00403 00405 struct ClientSettings { 00406 GUISettings gui; 00407 NetworkSettings network; 00408 CompanySettings company; 00409 }; 00410 00412 extern ClientSettings _settings_client; 00413 00415 extern GameSettings _settings_game; 00416 00418 extern GameSettings _settings_newgame; 00419 00420 #endif /* SETTINGS_TYPE_H */