FGameUserSettings
UE5's GameUserSettings, in the shape this engine already has: cvars for the renderer knobs, GlobalConfig for the audio buses, and a per-user MDF file under <project>/Saved/Config that keeps the player's choices out of the committed project tier.
- Module
- ArcUI
- Header
#include "ArcUI/Settings/FGameUserSettings.h"- Namespace
Mowo
Type aliases
| Alias | Description |
|---|---|
using FHostApplier = std::function<void(const FArcSettingRow& row, const std::string& value, bool persist)> | persist is false for the startup push, which is replaying values the store already holds — or, on a fresh machine, the table defaults. A host that writes its own file must honour it, or first launch overwrites a configuration some other path wrote and stamps it as the player's. |
using FDisplayOptionProvider = std::function<std::vector<FArcDisplayOption>(const std::string& key)> |
Public functions
| Returns | Name | Description |
|---|---|---|
FGameUserSettings& | Get | |
std::string | StorePath | <project>/Saved/Config/GameUserSettings.ini, or the per-user product dir when no project is open. |
void | BuildModel | Builds every row against the given device profile. |
bool | IsBuilt | |
bool | EnsureVendorRuntimesProbed | A model built without the vendor runtimes offers every choice the API allows. |
bool | IsVendorProbePending | |
uint64_t | ModelRevision | Bumps whenever the model is rebuilt with new device answers, so an open screen knows to rebuild its rows. |
const std::vector<FArcSettingRow>& | Rows | |
std::vector<const FArcSettingRow*> | RowsIn | |
const FArcSettingRow* | FindRow | |
bool | RegisterRow | Adds a row (and, through def.Page, a page) to the settings screen. |
bool | UnregisterRow | |
void | RefreshRequirements | Re-evaluates every registered Requirement, for a game whose availability changes at run time (a world loaded, a device plugged in). |
std::vector<std::string> | Pages | The game's own pages in registration order, and the rows on one. |
std::vector<const FArcSettingRow*> | RowsOnPage | |
std::string | TierValue | The value a tier-mapped row takes at tier (clamped), empty when the row has no mapping. |
std::vector<std::string> | AmbiguousChoiceRows | One entry per pair of choices in one row that carry the same value. |
bool | SetPending | Stages an edit. |
bool | IsDirty | |
bool | IsDirty | |
bool | Apply | Pushes every staged value at its backend and writes the store. |
void | Revert | Throws the staged edits away. |
void | ResetToDefaults | |
void | ResetToDefaults | |
void | ResetPageToDefaults | |
bool | IsAwaitingConfirmation | A mode change that leaves the display dark cannot be undone by a player who cannot see the screen, so Apply arms a countdown and reverts on its own unless the player confirms. |
float | ConfirmationSecondsRemaining | |
void | SetConfirmationSeconds | |
bool | TickConfirmation | Drive from the UI tick. |
void | KeepConfirmedChanges | |
void | RevertConfirmedChanges | |
bool | Load | |
bool | Load | |
bool | Save | |
bool | Save | |
void | ApplyToBackends | Pushes the applied values at their backends without touching the file — the startup path, run once the model is built and the store is read. |
void | SetHostApplier | The runtime host owns the window, so it owns everything the Display category actually changes. |
void | SetDisplayOptionProvider | |
void | SetAppliesArcPalette | Whether High Contrast UI also swaps Arc's Mowo palette (the colours the settings screen and other built-in menus paint with). |
bool | AppliesArcPalette | |
int32_t | ApplyArcPalette | Loads a Mowo palette file (the editor's theme JSON: a "colors" table of token name → "#RRGGBB" or "#RRGGBBAA") over the default colours, or resets to the defaults when the path is empty. |
void | RefreshDisplayOptions | Refills the choice lists of the Host rows from the provider. |
const char* | CategoryLabel |
Function details
Get
static FGameUserSettings& Get()StorePath
static std::string StorePath()<project>/Saved/Config/GameUserSettings.ini, or the per-user product dir when no project is open. Never the project's Config dir: that one is committed and belongs to the team, not to one player's machine.
BuildModel
void BuildModel(const FArcDeviceProfile& profile)Builds every row against the given device profile. Safe to call again — pending edits are dropped and the applied values re-read.
IsBuilt
bool IsBuilt() constEnsureVendorRuntimesProbed
bool EnsureVendorRuntimesProbed()A model built without the vendor runtimes offers every choice the API allows. The settings screen calls this before it shows anything: the model is rebuilt from a full probe and the store read again, so a choice this GPU cannot run is withdrawn. True when it rebuilt.
IsVendorProbePending
bool IsVendorProbePending() constModelRevision
uint64_t ModelRevision() constBumps whenever the model is rebuilt with new device answers, so an open screen knows to rebuild its rows.
Rows
const std::vector<FArcSettingRow>& Rows() constRowsIn
std::vector<const FArcSettingRow*> RowsIn(EArcSettingCategory category) constFindRow
const FArcSettingRow* FindRow(const std::string& key) constRegisterRow
bool RegisterRow(const FArcGameSettingDef& def)Adds a row (and, through def.Page, a page) to the settings screen. May be called before or after BuildModel: the definition is kept and re-applied on every rebuild, so a vendor-probe rebuild never drops it. Returns false — and logs why — for an empty or already-used id, a cvar-bound row whose cvar does not exist, a choice row with no choices or with two choices that share a value. Calling it again with the same id replaces the definition.
UnregisterRow
bool UnregisterRow(const std::string& id)RefreshRequirements
void RefreshRequirements()Re-evaluates every registered Requirement, for a game whose availability changes at run time (a world loaded, a device plugged in). Bumps the model revision when an answer changed, so an open screen redraws.
Pages
std::vector<std::string> Pages() constThe game's own pages in registration order, and the rows on one. The six built-in categories never list a registered page's rows.
RowsOnPage
std::vector<const FArcSettingRow*> RowsOnPage(const std::string& page) constTierValue
static std::string TierValue(const FArcSettingRow& row, int32_t tier)The value a tier-mapped row takes at tier (clamped), empty when the row has no mapping.
AmbiguousChoiceRows
std::vector<std::string> AmbiguousChoiceRows() constOne entry per pair of choices in one row that carry the same value. The combo box, the companion write and the saved file all resolve a choice BY value, so such a pair is unrepresentable: the player picks one option and a different one is applied. Must come back empty; BuildModel logs any entry as an error.
SetPending
bool SetPending(const std::string& key, const std::string& value)Stages an edit. Refused for a row the device cannot do, which is what keeps a greyed control from being driven by a stale saved file.
IsDirty
bool IsDirty() constIsDirty
bool IsDirty(EArcSettingCategory category) constApply
bool Apply()Pushes every staged value at its backend and writes the store. Returns false only when the store could not be written — the values are live either way, because refusing what the player just asked for is worse than a settings file that failed to save.
Revert
void Revert()Throws the staged edits away.
ResetToDefaults
void ResetToDefaults()ResetToDefaults
void ResetToDefaults(EArcSettingCategory category)ResetPageToDefaults
void ResetPageToDefaults(const std::string& page)IsAwaitingConfirmation
bool IsAwaitingConfirmation() constA mode change that leaves the display dark cannot be undone by a player who cannot see the screen, so Apply arms a countdown and reverts on its own unless the player confirms.
ConfirmationSecondsRemaining
float ConfirmationSecondsRemaining() constSetConfirmationSeconds
void SetConfirmationSeconds(float seconds)TickConfirmation
bool TickConfirmation(float deltaSeconds)Drive from the UI tick. True on the frame the countdown ran out and the previous display values were put back.
KeepConfirmedChanges
void KeepConfirmedChanges()RevertConfirmedChanges
void RevertConfirmedChanges()Load
bool Load()Load
bool Load(const std::string& filepath)Save
bool Save()Save
bool Save(const std::string& filepath)ApplyToBackends
void ApplyToBackends()Pushes the applied values at their backends without touching the file — the startup path, run once the model is built and the store is read.
SetHostApplier
void SetHostApplier(FHostApplier applier)The runtime host owns the window, so it owns everything the Display category actually changes. Without an applier those rows still record and persist; they simply do not take effect.
SetDisplayOptionProvider
void SetDisplayOptionProvider(FDisplayOptionProvider provider)SetAppliesArcPalette
void SetAppliesArcPalette(bool applies)Whether High Contrast UI also swaps Arc's Mowo palette (the colours the settings screen and other built-in menus paint with). Only the game host turns it on: the editor owns that palette through its Appearance preference, and a game setting must never repaint the editor.
AppliesArcPalette
bool AppliesArcPalette() constApplyArcPalette
static int32_t ApplyArcPalette(const std::string& vfsPath)Loads a Mowo palette file (the editor's theme JSON: a "colors" table of token name → "#RRGGBB" or "#RRGGBBAA") over the default colours, or resets to the defaults when the path is empty. Returns the number of colours applied.
RefreshDisplayOptions
void RefreshDisplayOptions()Refills the choice lists of the Host rows from the provider. Called by BuildModel, and again by the screen when a monitor is hot-plugged.
CategoryLabel
static const char* CategoryLabel(EArcSettingCategory category)