OpenTTD Source
20241121-master-g67a0fccfad
|
The tables of all the settings as well as the implementation of most of their callbacks. More...
#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 "pathfinder/aystar.h"
#include "linkgraph/linkgraphschedule.h"
#include "genworld.h"
#include "train.h"
#include "news_func.h"
#include "window_func.h"
#include "company_func.h"
#include "timer/timer_game_calendar.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 "roadveh_cmd.h"
#include "vehicle_func.h"
#include "viewport_func.h"
#include "void_map.h"
#include "station_func.h"
#include "station_base.h"
#include "table/strings.h"
#include "table/settings.h"
#include "safeguards.h"
Go to the source code of this file.
Functions | |
static StringID | SettingTitleWallclock (const IntSettingDesc &sd) |
Switch setting title depending on wallclock setting. | |
static StringID | SettingHelpWallclock (const IntSettingDesc &sd) |
Switch setting help depending on wallclock setting. | |
static void | SettingsValueVelocityUnit (const IntSettingDesc &, uint first_param, int32_t value) |
Setting values for velocity unit localisation. | |
static void | SettingsValueAbsolute (const IntSettingDesc &sd, uint first_param, int32_t value) |
A negative value has another string (the one after "strval"). | |
static void | ServiceIntervalSettingsValueText (const IntSettingDesc &sd, uint first_param, int32_t value) |
Service Interval Settings Default Value displays the correct units or as a percentage. | |
static void | v_PositionMainToolbar (int32_t) |
Reposition the main toolbar as the setting changed. | |
static void | v_PositionStatusbar (int32_t) |
Reposition the statusbar as the setting changed. | |
static void | RedrawSmallmap (int32_t) |
Redraw the smallmap after a colour scheme change. | |
static void | UpdateLinkgraphColours (int32_t) |
Redraw linkgraph links after a colour scheme change. | |
static void | StationSpreadChanged (int32_t) |
static void | UpdateConsists (int32_t) |
static void | UpdateAllServiceInterval (int32_t new_value) |
Check and update if needed all vehicle service intervals. More... | |
static bool | CanUpdateServiceInterval (VehicleType, int32_t &new_value) |
static void | UpdateServiceInterval (VehicleType type, int32_t new_value) |
static int32_t | GetDefaultServiceInterval (VehicleType type) |
Checks if the service intervals in the settings are specified as percentages and corrects the default value accordingly. More... | |
static void | TrainAccelerationModelChanged (int32_t) |
static void | TrainSlopeSteepnessChanged (int32_t) |
This function updates the train acceleration cache after a steepness change. | |
static void | RoadVehAccelerationModelChanged (int32_t) |
This function updates realistic acceleration caches when the setting "Road vehicle acceleration model" is set. | |
static void | RoadVehSlopeSteepnessChanged (int32_t) |
This function updates the road vehicle acceleration cache after a steepness change. | |
static void | TownFoundingChanged (int32_t) |
static void | ZoomMinMaxChanged (int32_t) |
static void | SpriteZoomMinChanged (int32_t) |
static void | InvalidateNewGRFChangeWindows (int32_t) |
Update any possible saveload window and delete any newgrf dialogue as its widget parts might change. More... | |
static void | InvalidateCompanyLiveryWindow (int32_t) |
static void | DifficultyNoiseChange (int32_t) |
static void | MaxNoAIsChange (int32_t) |
static bool | CheckRoadSide (int32_t &) |
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_t &new_value) |
static void | UpdateFreeformEdges (int32_t new_value) |
static bool | CheckDynamicEngines (int32_t &) |
Changing the setting "allow multiple NewGRF sets" is not allowed if there are vehicles. | |
static bool | CheckMaxHeightLevel (int32_t &new_value) |
static void | StationCatchmentChanged (int32_t) |
static void | MaxVehiclesChanged (int32_t) |
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. | |
static void | ChangeTimekeepingUnits (int32_t) |
Callback for when the player changes the timekeeping units. More... | |
static void | ChangeMinutesPerYear (int32_t new_value) |
Callback after the player changes the minutes per year. More... | |
static bool | CanChangeTimetableMode (int32_t &) |
Pre-callback check when trying to change the timetable mode. More... | |
The tables of all the settings as well as the implementation of most of their callbacks.
Definition in file settings_table.cpp.
|
static |
Pre-callback check when trying to change the timetable mode.
This is locked to Seconds when using wallclock units.
Unused. |
Definition at line 663 of file settings_table.cpp.
References TimerGameEconomy::UsingWallclockUnits().
|
static |
Callback after the player changes the minutes per year.
new_value | The intended new value of the setting, used for clamping. |
Definition at line 628 of file settings_table.cpp.
|
static |
Callback for when the player changes the timekeeping units.
Unused. |
Definition at line 586 of file settings_table.cpp.
References _settings_client, _settings_newgame, ClientSettings::company, GameSettings::economy, InvalidateWindowClassesData(), EconomySettings::minutes_per_calendar_year, VehicleDefaultSettings::servint_ispercent, UpdateAllServiceInterval(), TimerGameEconomy::UsingWallclockUnits(), CompanySettings::vehicle, and WC_GAME_OPTIONS.
|
static |
Check whether the road side may be changed.
Definition at line 426 of file settings_table.cpp.
|
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.
value | that was read from config file |
Definition at line 438 of file settings_table.cpp.
References OneOfManySettingDesc::ParseSingleValue().
|
static |
Checks if the service intervals in the settings are specified as percentages and corrects the default value accordingly.
new_value | Contains the service interval's default value in days, or 50 (default in percentage). |
Definition at line 270 of file settings_table.cpp.
|
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.
Definition at line 388 of file settings_table.cpp.
References CloseWindowByClass(), InvalidateWindowClassesData(), ReInitAllWindows(), WC_GAME_OPTIONS, and WC_SAVELOAD.
|
static |
Replace a passwords that are a literal asterisk with an empty string.
newval | The new string value for this password field. |
Definition at line 564 of file settings_table.cpp.
|
static |
Check and update if needed all vehicle service intervals.
new_value | Contains 0 if service intervals are in time (days or real-world minutes), otherwise intervals use percents. |
Definition at line 194 of file settings_table.cpp.
Referenced by ChangeTimekeepingUnits().