# settings_type.h

Go to the documentation of this file.

    00001 /* $Id: settings_type.h 18994 2010-02-03 18:42:23Z rubidium $ */
    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_SERVER_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   bool   no_http_content_downloads;
    00151 #else /* ENABLE_NETWORK */
    00152 #endif
    00153 };
    00154
    00156 struct GameCreationSettings {
    00157   uint32 generation_seed;
    00158   Year   starting_year;
    00159   uint8  map_x;
    00160   uint8  map_y;
    00161   byte   land_generator;
    00162   byte   oil_refinery_limit;
    00163   byte   snow_line_height;
    00164   byte   tgen_smoothness;
    00165   byte   tree_placer;
    00166   byte   heightmap_rotation;
    00167   byte   se_flat_world_height;
    00168   byte   town_name;
    00169   byte   landscape;
    00170   byte   snow_line;
    00171   byte   water_borders;
    00172   uint16 custom_town_number;
    00173   byte   variety;
    00174 };
    00175
    00177 struct ConstructionSettings {
    00178   bool   build_on_slopes;
    00179   bool   autoslope;
    00180   bool   longbridges;
    00181   bool   signal_side;
    00182   bool   extra_dynamite;
    00183   bool   road_stop_on_town_road;
    00184   bool   road_stop_on_competitor_road;
    00185   uint8  raw_industry_construction;
    00186   bool   freeform_edges;
    00187   uint8  extra_tree_placement;
    00188 };
    00189
    00191 struct AISettings {
    00192   bool   ai_in_multiplayer;
    00193   bool   ai_disable_veh_train;
    00194   bool   ai_disable_veh_roadveh;
    00195   bool   ai_disable_veh_aircraft;
    00196   bool   ai_disable_veh_ship;
    00197   uint32 ai_max_opcode_till_suspend;
    00198 };
    00199
    00201 struct OPFSettings {
    00202   uint16 pf_maxlength;
    00203   byte   pf_maxdepth;
    00204 };
    00205
    00207 struct NPFSettings {
    00213   uint32 npf_max_search_nodes;
    00214   uint32 maximum_go_to_depot_penalty;
    00215
    00216   uint32 npf_rail_firstred_penalty;
    00217   uint32 npf_rail_firstred_exit_penalty;
    00218   uint32 npf_rail_lastred_penalty;
    00219   uint32 npf_rail_station_penalty;
    00220   uint32 npf_rail_slope_penalty;
    00221   uint32 npf_rail_curve_penalty;
    00222   uint32 npf_rail_depot_reverse_penalty;
    00223   uint32 npf_rail_pbs_cross_penalty;
    00224   uint32 npf_rail_pbs_signal_back_penalty;
    00225   uint32 npf_buoy_penalty;
    00226   uint32 npf_water_curve_penalty;
    00227   uint32 npf_road_curve_penalty;
    00228   uint32 npf_crossing_penalty;
    00229   uint32 npf_road_drive_through_penalty;
    00230   uint32 npf_road_dt_occupied_penalty;
    00231   uint32 npf_road_bay_occupied_penalty;
    00232 };
    00233
    00235 struct YAPFSettings {
    00236   bool   disable_node_optimization;
    00237   uint32 max_search_nodes;
    00238   uint32 maximum_go_to_depot_penalty;
    00239   bool   ship_use_yapf;
    00240   bool   road_use_yapf;
    00241   bool   rail_use_yapf;
    00242   uint32 road_slope_penalty;
    00243   uint32 road_curve_penalty;
    00244   uint32 road_crossing_penalty;
    00245   uint32 road_stop_penalty;
    00246   uint32 road_stop_occupied_penalty;
    00247   uint32 road_stop_bay_occupied_penalty;
    00248   bool   rail_firstred_twoway_eol;
    00249   uint32 rail_firstred_penalty;
    00250   uint32 rail_firstred_exit_penalty;
    00251   uint32 rail_lastred_penalty;
    00252   uint32 rail_lastred_exit_penalty;
    00253   uint32 rail_station_penalty;
    00254   uint32 rail_slope_penalty;
    00255   uint32 rail_curve45_penalty;
    00256   uint32 rail_curve90_penalty;
    00257   uint32 rail_depot_reverse_penalty;
    00258   uint32 rail_crossing_penalty;
    00259   uint32 rail_look_ahead_max_signals;
    00260   int32  rail_look_ahead_signal_p0;
    00261   int32  rail_look_ahead_signal_p1;
    00262   int32  rail_look_ahead_signal_p2;
    00263   uint32 rail_pbs_cross_penalty;
    00264   uint32 rail_pbs_station_penalty;
    00265   uint32 rail_pbs_signal_back_penalty;
    00266   uint32 rail_doubleslip_penalty;
    00267
    00268   uint32 rail_longer_platform_penalty;
    00269   uint32 rail_longer_platform_per_tile_penalty;
    00270   uint32 rail_shorter_platform_penalty;
    00271   uint32 rail_shorter_platform_per_tile_penalty;
    00272 };
    00273
    00275 struct PathfinderSettings {
    00276   uint8  pathfinder_for_trains;
    00277   uint8  pathfinder_for_roadvehs;
    00278   uint8  pathfinder_for_ships;
    00279   bool   new_pathfinding_all;
    00280
    00281   bool   roadveh_queue;
    00282   bool   forbid_90_deg;
    00283
    00284   byte   wait_oneway_signal;
    00285   byte   wait_twoway_signal;
    00286
    00287   bool   reserve_paths;
    00288   byte   wait_for_pbs_path;
    00289   byte   path_backoff_interval;
    00290
    00291   OPFSettings  opf;
    00292   NPFSettings  npf;
    00293   YAPFSettings yapf;
    00294 };
    00295
    00297 struct OrderSettings {
    00298   bool   improved_load;
    00299   bool   gradual_loading;
    00300   bool   selectgoods;
    00301   bool   gotodepot;
    00302   bool   no_servicing_if_no_breakdowns;
    00303   bool   timetabling;
    00304   bool   serviceathelipad;
    00305 };
    00306
    00308 struct VehicleSettings {
    00309   bool   mammoth_trains;
    00310   uint8  train_acceleration_model;
    00311   uint8  train_slope_steepness;
    00312   bool   wagon_speed_limits;
    00313   bool   disable_elrails;
    00314   UnitID max_trains;
    00315   UnitID max_roadveh;
    00316   UnitID max_aircraft;
    00317   UnitID max_ships;
    00318   uint8  plane_speed;
    00319   uint8  freight_trains;
    00320   bool   dynamic_engines;
    00321   bool   never_expire_vehicles;
    00322   byte   extend_vehicle_life;
    00323   byte   road_side;
    00324   uint8  plane_crashes;
    00325 };
    00326
    00328 struct EconomySettings {
    00329   bool   inflation;
    00330   bool   bribe;
    00331   bool   smooth_economy;
    00332   bool   allow_shares;
    00333   uint8  feeder_payment_share;
    00334   byte   dist_local_authority;
    00335   bool   exclusive_rights;
    00336   bool   give_money;
    00337   bool   mod_road_rebuild;
    00338   bool   multiple_industry_per_town;
    00339   bool   same_industry_close;
    00340   uint8  town_growth_rate;
    00341   uint8  larger_towns;
    00342   uint8  initial_city_size;
    00343   TownLayoutByte town_layout;
    00344   bool   allow_town_roads;
    00345   TownFoundingByte found_town;
    00346   bool   station_noise_level;
    00347   uint16 town_noise_population[3];
    00348 };
    00349
    00351 struct StationSettings {
    00352   bool   modified_catchment;
    00353   bool   join_stations;
    00354   bool   nonuniform_stations;
    00355   bool   adjacent_stations;
    00356   bool   distant_join_stations;
    00357   bool   never_expire_airports;
    00358   byte   station_spread;
    00359 };
    00360
    00362 struct VehicleDefaultSettings {
    00363   bool   servint_ispercent;
    00364   uint16 servint_trains;
    00365   uint16 servint_roadveh;
    00366   uint16 servint_aircraft;
    00367   uint16 servint_ships;
    00368 };
    00369
    00371 struct CompanySettings {
    00372   bool engine_renew;
    00373   int16 engine_renew_months;
    00374   uint32 engine_renew_money;
    00375   bool renew_keep_length;
    00376   VehicleDefaultSettings vehicle;
    00377 };
    00378
    00380 struct GameSettings {
    00381   DifficultySettings   difficulty;
    00382   GameCreationSettings game_creation;
    00383   ConstructionSettings construction;
    00384   AISettings           ai;
    00385   class AIConfig      *ai_config[MAX_COMPANIES];
    00386   PathfinderSettings   pf;
    00387   OrderSettings        order;
    00388   VehicleSettings      vehicle;
    00389   EconomySettings      economy;
    00390   StationSettings      station;
    00391   LocaleSettings       locale;
    00392 };
    00393
    00395 struct ClientSettings {
    00396   GUISettings          gui;
    00397   NetworkSettings      network;
    00398   CompanySettings      company;
    00399 };
    00400
    00402 extern ClientSettings _settings_client;
    00403
    00405 extern GameSettings _settings_game;
    00406
    00408 extern GameSettings _settings_newgame;
    00409
    00410 #endif /* SETTINGS_TYPE_H */