Jazz2::PreferencesCache class

Provides access to a user preferences.

Public static variables

static std::int32_t UnlimitedFps constexpr
Value of MaxFps that specifies unlimited frame rate.
static std::int32_t UseVsync constexpr
Value of MaxFps that specifies the frame rate of the monitor being used.
static bool FirstRun
Whether the application is running for the first time.
static bool IsStandalone
Whether the application is running as progressive web app (PWA)
static UnlockableEpisodes UnlockedEpisodes
Currently unlocked episodes if compiled with SHAREWARE_DEMO_ONLY
static RescaleMode ActiveRescaleMode
Active rescale mode.
static bool EnableFullscreen
Whether the application is running in fullscreen.
static std::int32_t MaxFps
Maximum frace rate.
static bool ShowPerformanceMetrics
Whether performance metrics (FPS counter) are visible.
static bool KeepAspectRatioInCinematics
Whether cinematics should keep original aspect ratio.
static bool ShowPlayerTrails
Whether player trails are visible.
static bool LowWaterQuality
Whether low quality water effects are enabled.
static bool UnalignedViewport
Whether viewport should be unaligned.
static bool PreferVerticalSplitscreen
Whether vertical splitscreen is preferred.
static bool PreferZoomOut
Whether viewport zoom out is preferred.
static bool BackgroundDithering
Whether background dithering should be used.
static bool EnableReforgedGameplay
Whether reforged gameplay is enabled.
static bool EnableReforgedHUD
Whether reforged HUD is enabled.
static bool EnableReforgedMainMenu
Whether reforged main menu is enabled.
static bool EnableLedgeClimb
Whether ledge climbing is enabled.
static WeaponWheelStyle WeaponWheel
Current weapon wheel style.
static bool EnableRgbLights
Whether RGB light effects are enabled.
static bool AllowUnsignedScripts
Whether unsigned scripts can be loaded.
static bool EnableDiscordIntegration
Whether Discord integration is enabled.
static bool TutorialCompleted
Whether tutorial is completed.
static bool ResumeOnStart
Whether the last state should be resumed on start.
static bool AllowCheats
Whether cheats are enabled by user.
static bool AllowCheatsLives
Whether unlimited lives are enabled.
static bool AllowCheatsUnlock
Whether all episodes are unlocked.
static EpisodeEndOverwriteMode OverwriteEpisodeEnd
Whether the last progress is overwritten on the end of episode.
static char Language
Current language.
static bool BypassCache
Whether the cache should be bypassed.
static float MasterVolume
Master sound volume.
static float SfxVolume
SFX volume.
static float MusicVolume
Music volume.
static bool ToggleRunAction
Whether toggle Run action is enabled.
static GamepadType GamepadButtonLabels
Active gamepad button labels.
static std::uint8_t GamepadRumble
Gamepad rumble intensity.
static bool PlayStationExtendedSupport
Whether PlayStation controller extended support is enabled.
static bool UseNativeBackButton
Whether native Back button should be used.
static Vector2f TouchLeftPadding
Touch controls left padding.
static Vector2f TouchRightPadding
Touch controls right padding.

Public static functions

static void Initialize(const AppConfiguration& config)
Initializes preferences cache from a given application configuration.
static void Save()
Serializes current preferences to file.
static auto GetDirectory() -> StringView
Returns directory path of the preferences file.
static auto GetEpisodeEnd(StringView episodeName, bool createIfNotFound = false) -> EpisodeContinuationState*
Returns information about episode completion.
static auto GetEpisodeContinue(StringView episodeName, bool createIfNotFound = false) -> EpisodeContinuationStateWithLevel*
Returns information about episode continuation.
static void RemoveEpisodeContinue(StringView episodeName)
Removes information about episode continuation (resets progress)

Variable documentation

static bool Jazz2::PreferencesCache::IsStandalone

Whether the application is running as progressive web app (PWA)

static bool Jazz2::PreferencesCache::UseNativeBackButton

Whether native Back button should be used.