# settings_type.h

Go to the documentation of this file.

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