Documentation
¶
Overview ¶
Package usercfg has functions around the user's Game Settings.
Other places in the codebase to look for its related functionality:
- pkg/windows/settings.go: the Settings Window is the UI owner of this feature, it adjusts the usercfg.Current struct and Saves the changes to disk.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Current = Defaults()
Current loaded settings, good defaults by default.
Functions ¶
func Load ¶
func Load() error
Load the settings from disk. The loaded settings will be available at usercfg.Current.
func MakeEntropy ¶
MakeEntropy creates a random string one time that saves into the settings.json, used for checksum calculations for the user's savegame.
Types ¶
type Settings ¶
type Settings struct { // Initialized is set true the first time the settings are saved to // disk, so the game may decide some default settings for first-time // user experience, e.g. set horizontal toolbars for mobile. Initialized bool Entropy []byte `json:"entropy"` // Configurable settings (pkg/windows/settings.go) HorizontalToolbars bool `json:",omitempty"` EnableFeatures bool `json:",omitempty"` CrosshairSize int `json:",omitempty"` CrosshairColor render.Color HideTouchHints bool `json:",omitempty"` DisableAutosave bool `json:",omitempty"` ControllerStyle int // Secret boolprops from balance/boolprops.go ShowHiddenDoodads bool `json:",omitempty"` WriteLockOverride bool `json:",omitempty"` JSONIndent bool `json:",omitempty"` EnableCheatsMenu bool `json:",omitempty"` // Bookkeeping. UpdatedAt time.Time }
Settings are the available game settings.
Click to show internal directories.
Click to hide internal directories.