OpenTTD
settings_type.h
Go to the documentation of this file.
1 /* $Id: settings_type.h 27825 2017-03-24 18:55:16Z peter1138 $ */
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;
121  bool quick_goto;
122  bool auto_euro;
140 
143 
147 #ifdef ENABLE_NETWORK
151 #endif
152 
153  uint8 developer;
161 
167  {
168  return this->scenario_developer || this->newgrf_developer_tools;
169  }
170 };
171 
174  bool news_ticker;
175  bool news_full;
176  bool new_year;
177  bool confirm;
178  bool click_beep;
179  bool disaster;
180  bool vehicle;
181  bool ambient;
182 };
183 
186  byte playlist;
187  byte music_vol;
188  byte effect_vol;
189  byte custom_1[33];
190  byte custom_2[33];
191  bool playing;
192  bool shuffle;
193 };
194 
197  byte currency;
199  byte units_power;
202  byte units_force;
207 };
208 
210 struct NewsSettings {
213  uint8 accident;
214  uint8 company_info;
215  uint8 open;
216  uint8 close;
217  uint8 economy;
221  uint8 advice;
222  uint8 new_vehicles;
223  uint8 acceptance;
224  uint8 subsidies;
225  uint8 general;
226 };
227 
230 #ifdef ENABLE_NETWORK
231  uint16 sync_freq;
232  uint8 frame_freq;
237  uint16 max_init_time;
238  uint16 max_join_time;
241  uint16 max_lag_time;
243  uint16 server_port;
251  uint8 lan_internet;
261  uint8 max_clients;
265  uint8 server_lang;
266  bool reload_cfg;
268  uint16 last_port;
270 #else /* ENABLE_NETWORK */
271 #endif
272 };
273 
278  uint8 map_x;
279  uint8 map_y;
284  byte tree_placer;
287  byte town_name;
288  byte landscape;
291  byte variety;
296 };
297 
302  bool autoslope;
315 
322 };
323 
325 struct AISettings {
331 };
332 
337 };
338 
340 struct OPFSettings {
341  uint16 pf_maxlength;
342  byte pf_maxdepth;
343 };
344 
346 struct NPFSettings {
354 
371 };
372 
374 struct YAPFSettings {
406 
411 };
412 
419 
422 
426 
430 
434 };
435 
440  bool selectgoods;
443 };
444 
448  uint8 smoke_amount;
459  uint8 plane_speed;
464  byte road_side;
466 };
467 
470  bool inflation;
471  bool bribe;
478  bool fund_roads;
479  bool give_money;
483  uint8 larger_towns;
492 };
493 
495  uint16 recalc_time;
501  uint8 accuracy;
502  uint8 demand_size;
505 
506  inline DistributionType GetDistributionType(CargoID cargo) const {
507  if (IsCargoInClass(cargo, CC_PASSENGERS)) return this->distribution_pax;
508  if (IsCargoInClass(cargo, CC_MAIL)) return this->distribution_mail;
509  if (IsCargoInClass(cargo, CC_ARMOURED)) return this->distribution_armoured;
510  return this->distribution_default;
511  }
512 };
513 
521 };
522 
526  uint16 servint_trains;
529  uint16 servint_ships;
530 };
531 
539 };
540 
542 struct GameSettings {
557 };
558 
567 };
568 
571 
574 
577 
580 
586 {
587  return (_game_mode == GM_MENU) ? _settings_newgame : _settings_game;
588 }
589 
590 #endif /* SETTINGS_TYPE_H */