Documentation
¶
Overview ¶
Package config loads configuration from defaults, the working-directory file, explicitly selected files, and command-line flags, and saves preferences to the selected file. It should not depend on game runtime state.
Index ¶
- func NextScreenshotPath(now time.Time) (string, error)
- func UserDataDir() (string, error)
- type AudioConfig
- type ChatShortcuts
- type Config
- func (cfg Config) LoadChatShortcuts() (ChatShortcuts, error)
- func (cfg Config) SaveChatShortcuts(commands ChatShortcuts) (string, error)
- func (cfg Config) SaveLoginID(username string, keep bool) (string, error)
- func (cfg Config) SaveScriptPath(path string) (string, error)
- func (cfg Config) SaveUserSettings(settings UserSettings) (string, error)
- type FogConfig
- type GameplayConfig
- type LoginConfig
- type NetworkConfig
- type PacketConfig
- type RenderConfig
- type ScriptConfig
- type UserSettings
- type WindowConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UserDataDir ¶
Types ¶
type AudioConfig ¶
type ChatShortcuts ¶ added in v0.13.0
type ChatShortcuts [10]string
ChatShortcuts are client-side Alt+1 through Alt+0 commands, independent of the server's item and skill hotkey slots.
type Config ¶
type Config struct {
// ConfigPath is the absolute file path selected by LoadConfig for saving settings.
ConfigPath string
Headless bool
DataDir string
Window WindowConfig
Packet PacketConfig
Login LoginConfig
Audio AudioConfig
Render RenderConfig
Network NetworkConfig
Fog FogConfig
Gameplay GameplayConfig
Script ScriptConfig
Log glog.LogConfig
ChatShortcuts ChatShortcuts
}
func LoadConfig ¶
func (Config) LoadChatShortcuts ¶ added in v0.14.0
func (cfg Config) LoadChatShortcuts() (ChatShortcuts, error)
LoadChatShortcuts refreshes saved bindings when entering the game again; the startup Config may predate edits made before character selection.
func (Config) SaveChatShortcuts ¶ added in v0.14.0
func (cfg Config) SaveChatShortcuts(commands ChatShortcuts) (string, error)
func (Config) SaveLoginID ¶ added in v0.14.0
SaveLoginID remembers only the ID, independently of explicit login credentials.
func (Config) SaveScriptPath ¶ added in v0.16.0
SaveScriptPath saves an explicit script choice independently of other settings.
func (Config) SaveUserSettings ¶ added in v0.14.0
func (cfg Config) SaveUserSettings(settings UserSettings) (string, error)
type GameplayConfig ¶
type LoginConfig ¶
type NetworkConfig ¶
type NetworkConfig struct {
Trace bool
}
type PacketConfig ¶
type RenderConfig ¶
type ScriptConfig ¶
type ScriptConfig struct {
Path string
}
type UserSettings ¶
Click to show internal directories.
Click to hide internal directories.