OpenTTD Source  20240919-master-gdf0233f4c2
settings_type.h File Reference
#include "timer/timer_game_calendar.h"
#include "economy_type.h"
#include "town_type.h"
#include "transport_type.h"
#include "network/network_type.h"
#include "company_type.h"
#include "cargotype.h"
#include "linkgraph/linkgraph_type.h"
#include "zoom_type.h"
#include "openttd.h"
#include "rail_gui.h"
#include "signal_type.h"
#include "timetable.h"

Go to the source code of this file.

Data Structures

struct  DifficultySettings
 Settings related to the difficulty of the game. More...
 
struct  GUISettings
 Settings related to the GUI and other stuff that is not saved in the savegame. More...
 
struct  SoundSettings
 Settings related to sound effects. More...
 
struct  MusicSettings
 Settings related to music. More...
 
struct  LocaleSettings
 Settings related to currency/unit systems. More...
 
struct  NewsSettings
 Settings related to news. More...
 
struct  NetworkSettings
 All settings related to the network. More...
 
struct  GameCreationSettings
 Settings related to the creation of games. More...
 
struct  ConstructionSettings
 Settings related to construction in-game. More...
 
struct  AISettings
 Settings related to the AI. More...
 
struct  ScriptSettings
 Settings related to scripts. More...
 
struct  YAPFSettings
 Settings related to the yet another pathfinder. More...
 
struct  PathfinderSettings
 Settings related to all pathfinders. More...
 
struct  OrderSettings
 Settings related to orders. More...
 
struct  VehicleSettings
 Settings related to vehicles. More...
 
struct  EconomySettings
 Settings related to the economy. More...
 
struct  LinkGraphSettings
 
struct  StationSettings
 Settings related to stations. More...
 
struct  VehicleDefaultSettings
 Default settings for vehicles. More...
 
struct  CompanySettings
 Settings that can be set per company. More...
 
struct  GameSettings
 All settings together for the game. More...
 
struct  ClientSettings
 All settings that are only important for the local client. More...
 

Enumerations

enum  SettingsProfile {
  SP_BEGIN = 0, SP_EASY = SP_BEGIN, SP_MEDIUM, SP_HARD,
  SP_END, SP_CUSTOM = SP_END, SP_SAVED_HIGHSCORE_END, SP_MULTIPLAYER = SP_SAVED_HIGHSCORE_END,
  SP_HIGHSCORE_END
}
 Settings profiles and highscore tables. More...
 
enum  IndustryDensity {
  ID_FUND_ONLY, ID_MINIMAL, ID_VERY_LOW, ID_LOW,
  ID_NORMAL, ID_HIGH, ID_CUSTOM, ID_END
}
 Available industry map generation densities. More...
 
enum  TimekeepingUnits : uint8_t { TKU_CALENDAR = 0, TKU_WALLCLOCK }
 Possible values for the "timekeeping_units" setting.
 
enum  UseRelayService : uint8_t { URS_NEVER = 0, URS_ASK, URS_ALLOW }
 Possible values for "use_relay_service" setting.
 
enum  ParticipateSurvey : uint8_t { PS_ASK = 0, PS_NO, PS_YES }
 Possible values for "participate_survey" setting.
 
enum  RightClickClose : uint8_t { RCC_NO = 0, RCC_YES, RCC_YES_EXCEPT_STICKY }
 Right-click to close window actions.
 
enum  ViewportScrollMode {
  VSM_VIEWPORT_RMB_FIXED, VSM_MAP_RMB_FIXED, VSM_MAP_RMB, VSM_MAP_LMB,
  VSM_END
}
 Settings relating to viewport/smallmap scrolling. More...
 
enum  ScrollWheelScrollingSetting { SWS_ZOOM_MAP = 0, SWS_SCROLL_MAP = 1, SWS_OFF = 2 }
 Settings related to scroll wheel behavior. More...
 

Functions

GameSettingsGetGameSettings ()
 Get the settings-object applicable for the current situation: the newgame settings when we're in the main menu and otherwise the settings of the current game.
 

Variables

const size_t MAX_SLE_UINT8 = UINT8_MAX
 
const size_t MAX_SLE_UINT16 = UINT16_MAX
 
const size_t MAX_SLE_UINT32 = UINT32_MAX
 
const size_t MAX_SLE_UINT = UINT_MAX
 
const size_t MAX_SLE_INT8 = INT8_MAX
 
const size_t MAX_SLE_INT16 = INT16_MAX
 
const size_t MAX_SLE_INT32 = INT32_MAX
 
const size_t MAX_SLE_INT = INT_MAX
 
ClientSettings _settings_client
 The current settings for this game.
 
GameSettings _settings_game
 The current settings for this game. More...
 
GameSettings _settings_newgame
 The settings values that are used for new games and/or modified in config file. More...
 
VehicleDefaultSettings _old_vds
 Old vehicle settings, which were game settings before, and are company settings now. More...
 

Detailed Description

Types related to global configuration settings.

Definition in file settings_type.h.

Enumeration Type Documentation

◆ IndustryDensity

Available industry map generation densities.

Enumerator
ID_FUND_ONLY 

The game does not build industries.

ID_MINIMAL 

Start with just the industries that must be present.

ID_VERY_LOW 

Very few industries at game start.

ID_LOW 

Few industries at game start.

ID_NORMAL 

Normal amount of industries at game start.

ID_HIGH 

Many industries at game start.

ID_CUSTOM 

Custom number of industries.

ID_END 

Number of industry density settings.

Definition at line 54 of file settings_type.h.

◆ ScrollWheelScrollingSetting

Settings related to scroll wheel behavior.

Enumerator
SWS_ZOOM_MAP 

Scroll wheel zooms the map.

SWS_SCROLL_MAP 

Scroll wheel scrolls the map.

SWS_OFF 

Scroll wheel has no effect.

Definition at line 130 of file settings_type.h.

◆ SettingsProfile

Settings profiles and highscore tables.

Enumerator
SP_EASY 

Easy difficulty.

SP_MEDIUM 

Medium difficulty.

SP_HARD 

Hard difficulty.

SP_END 

End of setting profiles.

SP_CUSTOM 

No profile, special "custom" highscore.

SP_SAVED_HIGHSCORE_END 

End of saved highscore tables.

SP_MULTIPLAYER 

Special "multiplayer" highscore. Not saved, always specific to the current game.

SP_HIGHSCORE_END 

End of highscore tables.

Definition at line 38 of file settings_type.h.

◆ ViewportScrollMode

Settings relating to viewport/smallmap scrolling.

Enumerator
VSM_VIEWPORT_RMB_FIXED 

Viewport moves with mouse movement on holding right mouse button, cursor position is fixed.

VSM_MAP_RMB_FIXED 

Map moves with mouse movement on holding right mouse button, cursor position is fixed.

VSM_MAP_RMB 

Map moves with mouse movement on holding right mouse button, cursor moves.

VSM_MAP_LMB 

Map moves with mouse movement on holding left mouse button, cursor moves.

VSM_END 

Number of scroll mode settings.

Definition at line 121 of file settings_type.h.

Variable Documentation

◆ _old_vds

Old vehicle settings, which were game settings before, and are company settings now.

(Needed for savegame conversion)

Old vehicle settings, which were game settings before, and are company settings now.

Definition at line 59 of file settings.cpp.

◆ _settings_game

GameSettings _settings_game

The current settings for this game.

The current settings for this game.

Definition at line 57 of file settings.cpp.

Referenced by _GenerateWorld(), AffectSpeedByZChange(), AfterNewGRFScan::AfterNewGRFScan(), AutoslopeEnabled(), Subsidy::AwardTo(), BuildLandLegend(), CalcEngineReliability(), CalculateDesertLine(), CalculateSnowLine(), CanBuildVehicleInfrastructure(), CanRoadContinueIntoNextTile(), AI::CanStartNew(), CheckBridgeAvailability(), CheckBuildableTile(), CheckCompanyHasMoney(), CheckforTownRating(), CheckIfAuthorityAllowsNewStation(), CheckIfCanLevelIndustryPlatform(), CheckIfTrainNeedsService(), CheckIndustryCloseDownProtection(), CheckNewIndustry_Farm(), CheckNewIndustry_Forest(), CheckNewTrain(), CheckNextTrainTile(), CheckRailSlope(), CheckRoadSlope(), CheckTakeoverVehicleLimit(), CheckTrainAttachment(), CheckTrainStayInDepot(), ClickChangeMaxHlCheat(), CmdBuildRoadDepot(), CmdBuildTrainDepot(), CmdConvertRail(), CmdFoundTown(), CmdGiveMoney(), CmdLevelLand(), CmdTerraformLand(), CompaniesGenStatistics(), CompanyCheckBankrupt(), CreateRivers(), DeleteStaleLinks(), DisplayVehicleSortDropDown(), DistanceFromEdgeDir(), LinkGraphOverlay::DrawContent(), DrawRoadAsSnowDesert(), IndustryBuildData::EconomyMonthlyLoop(), ExtendTrainReservation(), FindSpring(), FindTownForIndustry(), FlatEmptyWorld(), FollowTrainReservation(), ForAllStationsAroundTiles(), FreightWagonMult(), AI::GameLoop(), ScriptInstance::GameLoop(), GenerateLandscape(), GenerateTerrainPerlin(), GenerateTownName(), GenerateTrees(), GetAcceptanceAroundTiles(), GetAirportNoiseLevelForDistance(), GetAmplitude(), GetAvailableMoney(), Station::GetCatchmentRadius(), GetCompanyRailTypes(), GetCompanyRoadTypes(), Train::GetCurrentMaxSpeed(), RoadVehicle::GetCurrentMaxSpeed(), TownAuthorityWindow::GetEnabledActions(), GetFreeUnitNumber(), GetGlobalVariable(), Engine::GetLifeLengthInDays(), GetLoadAmount(), GetMaskOfTownActions(), GetOtherAqueductEnd(), GetRailTypes(), GetRandomTreeType(), GetRoadTypes(), GetScaledIndustryGenerationProbability(), RoadVehicle::GetSlopeSteepness(), Train::GetSlopeSteepness(), GetSnowLine(), GetTerrainType(), GetTileCatchmentRadius(), TownScopeResolver::GetVariable(), GetVelocityUnits(), GfxLoadSprites(), GrayscaleToMapHeights(), GUIPlaceProcDragXY(), HasRailCatenaryDrawn(), HeightMapCoastLines(), HeightMapNormalize(), HeightMapSineTransform(), HighestSnowLine(), IndustryCargoesWindow::HousesCanAccept(), InitializeGRFSpecial(), AirportSpec::IsAvailable(), Engine::IsEnabled(), ObjectSpec::IsEverAvailable(), IsRoadAllowedHere(), IsVehicleTypeDisabled(), PATSChunkHandler::Load(), LoadNewGRF(), LoadSpriteTables(), LoadTownData(), LowestSnowLine(), MakeLake(), Vehicle::NeedsServicing(), LandInfoWindow::OnInit(), BuildVehicleWindow::OnInvalidateData(), BuildAirportWindow::OnPaint(), BuildDocksStationWindow::OnPaint(), BuildRoadStationWindow::OnPaint(), CompanyWindow::OnPaint(), ScenarioEditorToolbarWindow::OnPaint(), OnTick_LinkGraph(), ScriptInstance::Pause(), PopulateStationsNearby(), SmallMapWindow::RebuildColourIndexIfNecessary(), Station::RecomputeCatchment(), RemoveAirport(), AI::ResetConfig(), RoadVehAccelerationModelChanged(), PATSChunkHandler::Save(), ServerNetworkAdminSocketHandler::SendWelcome(), HousePickerCallbacks::SetClimateMask(), SetStartingYear(), SetYearEngineAgingStops(), StationViewWindow::ShowCargo(), Vehicle::ShowVisualEffect(), StartupOneEngine(), StateGameLoop_LinkGraphPauseControl(), StationJoinerNeeded(), TerraformTileHeight(), TestAutoslopeOnRailTile(), TGPGetMaxHeight(), ToolbarScenDatePanel(), TownActionBuyRights(), TownActionFundBuildings(), TownActionRoadRebuild(), TownAllowedToBuildRoads(), TryBuildTownHouse(), Game::Uninitialize(), AI::Uninitialize(), UpdateAircraftSpeed(), UpdateLoadUnloadTicks(), Train::UpdateSpeed(), RoadVehicle::UpdateSpeed(), UpdateTownGrowth(), IndustrySpec::UsesOriginalEconomy(), VehicleServiceInDepot(), YapfRoadVehicleChooseTrack(), YapfTrainCheckReverse(), YapfTrainChooseTrack(), YapfTrainFindNearestDepot(), and YapfTrainFindNearestSafeTile().

◆ _settings_newgame

GameSettings _settings_newgame

The settings values that are used for new games and/or modified in config file.

The settings values that are used for new games and/or modified in config file.

Definition at line 58 of file settings.cpp.

Referenced by ChangeTimekeepingUnits(), GetMapHeightLimit(), NetworkRestartMap(), SelectGameWindow::OnInvalidateData(), GenerateLandscapeWindow::OnInvalidateData(), CreateScenarioWindow::OnPaint(), AI::ResetConfig(), SetNewLandscapeType(), StartNewGameWithoutGUI(), Game::Uninitialize(), AI::Uninitialize(), TimerGameEconomy::UsingWallclockUnits(), and ValidateSettings().