OpenTTD Source: src/settings_table.cpp File Reference

OpenTTD Source 13.1

Macros | Functions | Variables
settings_table.cpp File Reference
`#include "stdafx.h"`
`#include "settings_table.h"`
`#include "currency.h"`
`#include "screenshot.h"`
`#include "network/network.h"`
`#include "network/network_func.h"`
`#include "network/core/config.h"`
`#include "pathfinder/pathfinder_type.h"`
`#include "genworld.h"`
`#include "train.h"`
`#include "news_func.h"`
`#include "window_func.h"`
`#include "company_func.h"`
`#include "fontcache.h"`
`#include "textbuf_gui.h"`
`#include "rail_gui.h"`
`#include "elrail_func.h"`
`#include "error.h"`
`#include "town.h"`
`#include "video/video_driver.hpp"`
`#include "sound/sound_driver.hpp"`
`#include "music/music_driver.hpp"`
`#include "blitter/factory.hpp"`
`#include "base_media_base.h"`
`#include "ai/ai_config.hpp"`
`#include "ai/ai.hpp"`
`#include "game/game_config.hpp"`
`#include "ship.h"`
`#include "smallmap_gui.h"`
`#include "roadveh.h"`
`#include "vehicle_func.h"`
`#include "void_map.h"`
`#include "table/strings.h"`
`#include "table/settings.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Functions
static void | v_PositionMainToolbar (int32 new_value)
| Reposition the main toolbar as the setting changed.
static void | v_PositionStatusbar (int32 new_value)
| Reposition the statusbar as the setting changed.
static void | RedrawSmallmap (int32 new_value)
| Redraw the smallmap after a colour scheme change. More...
static void | UpdateLinkgraphColours (int32 new_value)
| Redraw linkgraph links after a colour scheme change.
static void | StationSpreadChanged (int32 p1)
static void | UpdateConsists (int32 new_value)
static void | UpdateAllServiceInterval (int32 new_value)
static bool | CanUpdateServiceInterval (VehicleType type, int32 &new_value)
static void | UpdateServiceInterval (VehicleType type, int32 new_value)
static void | TrainAccelerationModelChanged (int32 new_value)
static void | TrainSlopeSteepnessChanged (int32 new_value)
| This function updates the train acceleration cache after a steepness change. More...
static void | RoadVehAccelerationModelChanged (int32 new_value)
| This function updates realistic acceleration caches when the setting "Road vehicle acceleration model" is set. More...
static void | RoadVehSlopeSteepnessChanged (int32 new_value)
| This function updates the road vehicle acceleration cache after a steepness change. More...
static void | TownFoundingChanged (int32 new_value)
static void | ZoomMinMaxChanged (int32 new_value)
static void | SpriteZoomMinChanged (int32 new_value)
static void | InvalidateNewGRFChangeWindows (int32 new_value)
| Update any possible saveload window and delete any newgrf dialogue as its widget parts might change. More...
static void | InvalidateCompanyLiveryWindow (int32 new_value)
static void | DifficultyNoiseChange (int32 new_value)
static void | MaxNoAIsChange (int32 new_value)
static bool | CheckRoadSide (int32 &new_value)
| Check whether the road side may be changed. More...
static size_t | ConvertLandscape (const char *value)
| Conversion callback for _gameopt_settings_game.landscape It converts (or try) between old values and the new ones, without losing initial setting of the user. More...
static bool | CheckFreeformEdges (int32 &new_value)
static void | UpdateFreeformEdges (int32 new_value)
static bool | CheckDynamicEngines (int32 &new_value)
| Changing the setting "allow multiple NewGRF sets" is not allowed if there are vehicles.
static bool | CheckMaxHeightLevel (int32 &new_value)
static void | StationCatchmentChanged (int32 new_value)
static void | MaxVehiclesChanged (int32 new_value)
static void | InvalidateShipPathCache (int32 new_value)
static bool | ReplaceAsteriskWithEmptyPassword (std::string &newval)
| Replace a passwords that are a literal asterisk with an empty string. More...
static void | UpdateClientConfigValues ()
| Update the game info, and send it to the clients when we are running as a server.

## Variables
SettingTable | _company_settings { _company_settings_table }
SettingTable | _currency_settings { _currency_settings_table }
SettingTable | _difficulty_settings { _difficulty_settings_table }
SettingTable | _multimedia_settings { _multimedia_settings_table }
SettingTable | _economy_settings { _economy_settings_table }
SettingTable | _game_settings { _game_settings_table }
SettingTable | _gui_settings { _gui_settings_table }
SettingTable | _linkgraph_settings { _linkgraph_settings_table }
SettingTable | _locale_settings { _locale_settings_table }
SettingTable | _misc_settings { _misc_settings_table }
SettingTable | _network_private_settings { _network_private_settings_table }
SettingTable | _network_secrets_settings { _network_secrets_settings_table }
SettingTable | _network_settings { _network_settings_table }
SettingTable | _news_display_settings { _news_display_settings_table }
SettingTable | _old_gameopt_settings { _old_gameopt_settings_table }
SettingTable | _pathfinding_settings { _pathfinding_settings_table }
SettingTable | _script_settings { _script_settings_table }
SettingTable | _window_settings { _window_settings_table }
SettingTable | _world_settings { _world_settings_table }

## Detailed Description

The tables of all the settings as well as the implementation of most of their callbacks.

Definition in file settings_table.cpp.

## Function Documentation

## ◆ CheckRoadSide()

static bool CheckRoadSide | ( | int32 & | new_value | ) |
| static

Check whether the road side may be changed.

Parameters

  new_value | unused

Returns
  true if the road side may be changed.

Definition at line 324 of file settings_table.cpp.

References RoadVehiclesAreBuilt().

## ◆ ConvertLandscape()

static size_t ConvertLandscape | ( | const char * | value | ) |
| static

Conversion callback for _gameopt_settings_game.landscape It converts (or try) between old values and the new ones, without losing initial setting of the user.

Parameters

  value | that was read from config file

Returns
  the "hopefully" converted value

Definition at line 337 of file settings_table.cpp.

References OneOfManySettingDesc::ParseSingleValue().

## ◆ InvalidateNewGRFChangeWindows()

static void InvalidateNewGRFChangeWindows | ( | int32 | new_value | ) |
| static

Update any possible saveload window and delete any newgrf dialogue as its widget parts might change.

Reinit all windows as it allows access to the newgrf debug button.

Parameters

  new_value | unused.

Definition at line 285 of file settings_table.cpp.

References CloseWindowByClass(), InvalidateWindowClassesData(), ReInitAllWindows(), WC_GAME_OPTIONS, and WC_SAVELOAD.

## ◆ RedrawSmallmap()

static void RedrawSmallmap | ( | int32 | new_value | ) |
| static

Redraw the smallmap after a colour scheme change.

Parameters

  p1 | Callback parameter.

Definition at line 99 of file settings_table.cpp.

References BuildLandLegend(), BuildOwnerLegend(), SetWindowClassesDirty(), and WC_SMALLMAP.

## ◆ ReplaceAsteriskWithEmptyPassword()

static bool ReplaceAsteriskWithEmptyPassword | ( | std::string & | newval | ) |
| static

Replace a passwords that are a literal asterisk with an empty string.

Parameters

  newval | The new string value for this password field.

Returns
  Always true.

Definition at line 470 of file settings_table.cpp.

## ◆ RoadVehAccelerationModelChanged()

static void RoadVehAccelerationModelChanged | ( | int32 | new_value | ) |
| static

This function updates realistic acceleration caches when the setting "Road vehicle acceleration model" is set.

Parameters

  new_value | Unused new value of setting.

Definition at line 223 of file settings_table.cpp.

References _settings_game, VehicleSettings::roadveh_acceleration_model, and GameSettings::vehicle.

## ◆ RoadVehSlopeSteepnessChanged()

static void RoadVehSlopeSteepnessChanged | ( | int32 | new_value | ) |
| static

This function updates the road vehicle acceleration cache after a steepness change.

Parameters

  new_value | Unused new value of setting.

Definition at line 243 of file settings_table.cpp.

References SpecializedVehicle< RoadVehicle, Type >::Iterate().

## ◆ TrainSlopeSteepnessChanged()

static void TrainSlopeSteepnessChanged | ( | int32 | new_value | ) |
| static

This function updates the train acceleration cache after a steepness change.

Parameters

  new_value | Unused new value of setting.

Definition at line 212 of file settings_table.cpp.

References SpecializedVehicle< Train, Type >::Iterate().