Class that handles all game settings related functions. More...
#include <script_gamesettings.hpp>
Static Public Member Functions | |
static bool | IsValid (const char *setting) |
Is the given game setting a valid setting for this instance of OpenTTD? | |
static int32 | GetValue (const char *setting) |
Gets the value of the game setting. | |
static bool | SetValue (const char *setting, int value) |
Sets the value of the game setting. | |
static bool | IsDisabledVehicleType (ScriptVehicle::VehicleType vehicle_type) |
Checks whether the given vehicle-type is disabled for AIs. |
Class that handles all game settings related functions.
ai game
Definition at line 38 of file script_gamesettings.hpp.
int32 ScriptGameSettings::GetValue | ( | const char * | setting | ) | [static] |
Gets the value of the game setting.
setting | The setting to get the value of. |
Definition at line 24 of file script_gamesettings.cpp.
References _settings_game, SettingDescBase::cmd, SaveLoad::conv, SettingDesc::desc, GetSettingFromName(), GetVariableAddress(), IsValid(), ReadValue(), SettingDesc::save, and SDT_BOOLX.
bool ScriptGameSettings::IsDisabledVehicleType | ( | ScriptVehicle::VehicleType | vehicle_type | ) | [static] |
Checks whether the given vehicle-type is disabled for AIs.
vehicle_type | The vehicle-type to check. |
Definition at line 50 of file script_gamesettings.cpp.
References _settings_game, GameSettings::ai, AISettings::ai_disable_veh_aircraft, AISettings::ai_disable_veh_roadveh, AISettings::ai_disable_veh_ship, AISettings::ai_disable_veh_train, ScriptVehicle::VT_AIR, ScriptVehicle::VT_RAIL, ScriptVehicle::VT_ROAD, and ScriptVehicle::VT_WATER.
Referenced by ScriptVehicle::BuildVehicle().
bool ScriptGameSettings::IsValid | ( | const char * | setting | ) | [static] |
Is the given game setting a valid setting for this instance of OpenTTD?
setting | The setting to check for existence. |
Definition at line 17 of file script_gamesettings.cpp.
References SettingDescBase::cmd, SettingDesc::desc, and GetSettingFromName().
Referenced by GetValue(), and SetValue().
bool ScriptGameSettings::SetValue | ( | const char * | setting, | |
int | value | |||
) | [static] |
Sets the value of the game setting.
setting | The setting to set the value of. | |
value | The value to set the setting to. |
Definition at line 37 of file script_gamesettings.cpp.
References SettingDescBase::cmd, CMD_CHANGE_SETTING, SaveLoad::conv, SettingDesc::desc, ScriptObject::DoCommand(), GetSettingFromName(), IsValid(), SettingDesc::save, SDT_BOOLX, SDT_NUMX, and SLF_NO_NETWORK_SYNC.