QcGameSettings Struct
Player settings of the graphical game, stored as an INI file in the data directory. More...
| Header: | #include <clientcore/settings/QcGameSettings.h> |
Public Types
| struct | AudioVolumes |
Public Functions
| QcStatus | save(const QString &path) const |
Public Variables
| QcAppearance | appearance |
| QcGameSettings::AudioVolumes | audio |
| QcCameraMode | cameraMode |
| bool | cameraShake |
| QList<QcCharacterPreset> | characterPresets |
| QcDebugOptions | debug |
| double | fieldOfView |
| double | fovEffects |
| QcGamepadSettings | gamepad |
| bool | invertMouse |
| QcKeyBindings | keys |
| QString | language |
| double | mouseSensitivity |
| bool | pauseOnFocusLoss |
| bool | photoHidesHand |
| QcRenderOptions | render |
| bool | showLabels |
| int | textureFiltering |
| QStringList | texturePacks |
| QcUiScale::Step | uiScale |
| int | viewDistance |
Static Public Members
| double | clampFieldOfView(double degrees) |
| double | clampFovEffects(double share) |
| double | clampMouseSensitivity(double sensitivity) |
| int | clampViewDistance(int chunks) |
| double | clampVolume(double volume, double fallback) |
| QString | cleanLanguage(const QString &language) |
| QStringList | cleanTexturePacks(const QStringList &ids) |
| const double | defaultAmbientVolume |
| const double | defaultEffectsVolume |
| const double | defaultFieldOfView |
| const double | defaultFovEffects |
| const double | defaultMasterVolume |
| const double | defaultMouseSensitivity |
| const double | defaultMusicVolume |
| const int | defaultTextureFiltering |
| const int | defaultViewDistance |
| bool | isTextureFiltering(int samples) |
| QcGameSettings | load(const QString &path) |
| const double | maxFieldOfView |
| const double | maxMouseSensitivity |
| const int | maxTexturePacks |
| const int | maxViewDistance |
| const double | minFieldOfView |
| const double | minMouseSensitivity |
| const int | minViewDistance |
Detailed Description
Values read from the file are clamped to their ranges; anything unusable falls back to the default.
Member Function Documentation
[static] double QcGameSettings::clampFieldOfView(double degrees)
Returns degrees clamped to minFieldOfView..maxFieldOfView; non-finite values give the default.
[static] double QcGameSettings::clampFovEffects(double share)
Returns share clamped to 0..1; NaN and infinities give the default (full effects), like the other clamps.
[static] double QcGameSettings::clampMouseSensitivity(double sensitivity)
Returns sensitivity clamped to minMouseSensitivity..maxMouseSensitivity; non-finite values give the default.
[static] int QcGameSettings::clampViewDistance(int chunks)
Returns chunks clamped to minViewDistance..maxViewDistance.
[static] double QcGameSettings::clampVolume(double volume, double fallback)
Returns volume clamped to 0..1; non-finite values give fallback.
[static] QString QcGameSettings::cleanLanguage(const QString &language)
Returns language when it is a two-letter lowercase code, else "" (the system language).
[static] QStringList QcGameSettings::cleanTexturePacks(const QStringList &ids)
Returns ids without empty and repeated ids and keeps at most maxTexturePacks.
[static] bool QcGameSettings::isTextureFiltering(int samples)
Returns whether samples is one of the texture filtering choices (1, 2, 4 or 8).
[static] QcGameSettings QcGameSettings::load(const QString &path)
Returns the settings stored at path; a missing or unreadable file gives the defaults.
QcStatus QcGameSettings::save(const QString &path) const
Writes the settings to path. Returns the error when the file cannot be written.
Member Variable Documentation
QcAppearance QcGameSettings::appearance
The player's look; names are checked against the content by the server.
QcGameSettings::AudioVolumes QcGameSettings::audio
The volumes of the sound.
QcCameraMode QcGameSettings::cameraMode
The view mode the game starts in.
bool QcGameSettings::cameraShake
Explosions near the player shake the camera (decision E-879).
QList<QcCharacterPreset> QcGameSettings::characterPresets
Looks the player saved under a name (at most QcCharacterProfile::maxPresets).
QcDebugOptions QcGameSettings::debug
Debug display level and visualisations (decision E-225).
const double QcGameSettings::defaultFieldOfView
Vertical field of view of a new setting, in degrees.
const double QcGameSettings::defaultFovEffects
Share of the field-of-view widening while sprinting (QcFovEffect, decision E-280), 0..1.
const double QcGameSettings::defaultMouseSensitivity
Mouse sensitivity of a new setting, in degrees per point of mouse motion.
const int QcGameSettings::defaultTextureFiltering
Most samples the block shader takes along a slanted footprint (decision E-721): 1 (off), 2, 4 or 8.
const int QcGameSettings::defaultViewDistance
View distance of a new setting, in chunks.
double QcGameSettings::fieldOfView
Vertical field of view in degrees (minFieldOfView..maxFieldOfView).
double QcGameSettings::fovEffects
Share of the field-of-view widening while sprinting, 0..1.
QcGamepadSettings QcGameSettings::gamepad
Dead zones, curve and look speed of the gamepad (decision E-541), stored as gamepad/<key>.
bool QcGameSettings::invertMouse
Whether moving the mouse up looks down.
QcKeyBindings QcGameSettings::keys
Stored as "keys/<action>" (primary) and "keys/<action>.2" (secondary) with portable key names, "" for no key. A missing or unknown name gives that slot's default; keys an earlier action already uses are dropped. The pause key (Esc) is fixed.
QString QcGameSettings::language
"" follows the system language, otherwise a two-letter language code such as "de".
const double QcGameSettings::maxFieldOfView
Widest field of view that can be set, in degrees.
const double QcGameSettings::maxMouseSensitivity
Highest mouse sensitivity that can be set.
const int QcGameSettings::maxTexturePacks
Most active texture packs.
const int QcGameSettings::maxViewDistance
Longest view distance that can be set, in chunks.
const double QcGameSettings::minFieldOfView
Narrowest field of view that can be set, in degrees.
const double QcGameSettings::minMouseSensitivity
Lowest mouse sensitivity that can be set.
const int QcGameSettings::minViewDistance
Shortest view distance that can be set, in chunks.
double QcGameSettings::mouseSensitivity
Degrees the camera turns per point of mouse motion.
bool QcGameSettings::pauseOnFocusLoss
A world hosted in the game opens its pause menu, and so pauses, when the window loses the focus (decision E-877).
bool QcGameSettings::photoHidesHand
Photo mode (decision E-692): hiding the HUD hides the hand as well.
QcRenderOptions QcGameSettings::render
Classic or realistic render mode with its quality and exposure (decision E-899), stored as render/<key>.
bool QcGameSettings::showLabels
Labels floating in the world (showcase names, decision E-222).
int QcGameSettings::textureFiltering
Texture filtering of surfaces seen at a flat angle, stored as "textureFiltering" (1, 2, 4 or 8 samples); another value gives the default.
QStringList QcGameSettings::texturePacks
Active texture packs by id, the highest priority first (decision E-297); empty: the game's own textures. Stored as the INI array "texturePacks/<n>/id"; at most maxTexturePacks, duplicates dropped.
QcUiScale::Step QcGameSettings::uiScale
Size of the HUD and the screens (decision E-725), stored as "uiScale" ("auto", "75" … "200"); an unknown value gives the default.
int QcGameSettings::viewDistance
Chunks to stream around the player (minViewDistance..maxViewDistance).