OpenTTD
settings_type.h
Go to the documentation of this file.
1 /* $Id: settings_type.h 27144 2015-02-12 20:00:23Z frosch $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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/>.
8  */
9 
12 #ifndef SETTINGS_TYPE_H
13 #define SETTINGS_TYPE_H
14 
15 #include "date_type.h"
16 #include "town_type.h"
17 #include "transport_type.h"
18 #include "network/core/config.h"
19 #include "company_type.h"
20 #include "cargotype.h"
22 #include "zoom_type.h"
23 #include "openttd.h"
24 
25 
28  SP_BEGIN = 0,
29  SP_EASY = SP_BEGIN,
32 
34 
37 
40 };
41 
50 
52 };
53 
57  byte number_towns;
59  uint32 max_loan;
66  byte terrain_type;
68  bool economy;
70  bool disasters;
72 };
73 
75 struct GUISettings {
82  bool new_nonstop;
83  uint8 stop_location;
86  uint16 hover_delay_ms;
92  byte liveries;
97  uint8 toolbar_pos;
98  uint8 statusbar_pos;
104  byte autosave;
120  bool quick_goto;
121  bool auto_euro;
139 
142 
146 #ifdef ENABLE_NETWORK
150 #endif
151 
152  uint8 developer;
160 
166  {
167  return this->scenario_developer || this->newgrf_developer_tools;
168  }
169 };
170 
173  bool news_ticker;
174  bool news_full;
175  bool new_year;
176  bool confirm;
177  bool click_beep;
178  bool disaster;
179  bool vehicle;
180  bool ambient;
181 };
182 
185  byte playlist;
186  byte music_vol;
187  byte effect_vol;
188  byte custom_1[33];
189  byte custom_2[33];
190  bool playing;
191  bool shuffle;
192 };
193 
196  byte currency;
198  byte units_power;
201  byte units_force;
206 };
207 
209 struct NewsSettings {
212  uint8 accident;
213  uint8 company_info;
214  uint8 open;
215  uint8 close;
216  uint8 economy;
220  uint8 advice;
221  uint8 new_vehicles;
222  uint8 acceptance;
223  uint8 subsidies;
224  uint8 general;
225 };
226 
229 #ifdef ENABLE_NETWORK
230  uint16 sync_freq;
231  uint8 frame_freq;
236  uint16 max_init_time;
237  uint16 max_join_time;
240  uint16 max_lag_time;
242  uint16 server_port;
250  uint8 lan_internet;
260  uint8 max_clients;
264  uint8 server_lang;
265  bool reload_cfg;
267  uint16 last_port;
269 #else /* ENABLE_NETWORK */
270 #endif
271 };
272 
277  uint8 map_x;
278  uint8 map_y;
283  byte tree_placer;
286  byte town_name;
287  byte landscape;
290  byte variety;
295 };
296 
301  bool autoslope;
314 
321 };
322 
324 struct AISettings {
330 };
331 
336 };
337 
339 struct OPFSettings {
340  uint16 pf_maxlength;
341  byte pf_maxdepth;
342 };
343 
345 struct NPFSettings {
353 
370 };
371 
373 struct YAPFSettings {
405 
410 };
411 
418 
421 
425 
429 
433 };
434 
439  bool selectgoods;
442 };
443 
447  uint8 smoke_amount;
458  uint8 plane_speed;
463  byte road_side;
465 };
466 
469  bool inflation;
470  bool bribe;
477  bool fund_roads;
478  bool give_money;
482  uint8 larger_towns;
491 };
492 
494  uint16 recalc_time;
500  uint8 accuracy;
501  uint8 demand_size;
504 
505  inline DistributionType GetDistributionType(CargoID cargo) const {
506  if (IsCargoInClass(cargo, CC_PASSENGERS)) return this->distribution_pax;
507  if (IsCargoInClass(cargo, CC_MAIL)) return this->distribution_mail;
508  if (IsCargoInClass(cargo, CC_ARMOURED)) return this->distribution_armoured;
509  return this->distribution_default;
510  }
511 };
512 
520 };
521 
525  uint16 servint_trains;
528  uint16 servint_ships;
529 };
530 
538 };
539 
541 struct GameSettings {
556 };
557 
566 };
567 
570 
573 
576 
579 
585 {
586  return (_game_mode == GM_MENU) ? _settings_newgame : _settings_game;
587 }
588 
589 #endif /* SETTINGS_TYPE_H */