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) LoadUISettings() (UISettings, 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) SaveUISettings(settings UISettings) (string, error)
- func (cfg Config) SaveUserSettings(settings UserSettings) (string, error)
- func (cfg Config) SaveVisualSettings(fogEnabled, simpleAura, noEffects bool) (string, error)
- type FogConfig
- type GameplayConfig
- type LoginConfig
- type NetworkConfig
- type PacketConfig
- type RenderConfig
- type ScriptConfig
- type UISettings
- type UserSettings
- type WindowConfig
- type WindowPosition
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
// AIStateDir holds writable AI overrides when a platform uses read-only assets.
// Empty keeps the desktop behavior of writing inside DataDir.
AIStateDir string
Window WindowConfig
Packet PacketConfig
Login LoginConfig
Audio AudioConfig
Render RenderConfig
Network NetworkConfig
Fog FogConfig
Gameplay GameplayConfig
Script ScriptConfig
Log glog.LogConfig
ChatShortcuts ChatShortcuts
UI UISettings
}
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) LoadUISettings ¶ added in v0.23.0
func (cfg Config) LoadUISettings() (UISettings, error)
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) SaveUISettings ¶ added in v0.23.0
func (cfg Config) SaveUISettings(settings UISettings) (string, error)
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 UISettings ¶ added in v0.23.0
type UISettings struct {
InventoryOpen bool
EquipmentOpen bool
StatsOpen bool
SkillsOpen bool
QuestsOpen bool
FriendsOpen bool
GuildOpen bool
CartOpen bool
WorldMapOpen bool
EmotesOpen bool
ChatShortcutsOpen bool
SettingsOpen bool
PetOpen bool
HomunculusOpen bool
HomunculusSkillsOpen bool
MercenaryOpen bool
MercenarySkillsOpen bool
MinimapHidden bool
BasicInfoCompact bool
BasicMenuCollapsed bool
SkillTree bool
ShortcutRows int
ShortcutPosition WindowPosition
ConsolePosition WindowPosition
StatsPosition WindowPosition
InventoryPosition WindowPosition
EquipmentPosition WindowPosition
SkillsPosition WindowPosition
QuestsPosition WindowPosition
FriendsPosition WindowPosition
GuildPosition WindowPosition
CartPosition WindowPosition
WorldMapPosition WindowPosition
EmotesPosition WindowPosition
ChatShortcutsPosition WindowPosition
SettingsPosition WindowPosition
PetPosition WindowPosition
HomunculusPosition WindowPosition
HomunculusSkillsPosition WindowPosition
MercenaryPosition WindowPosition
MercenarySkillsPosition WindowPosition
BasicInfoPosition WindowPosition
MinimapPosition WindowPosition
CameraZoom float64
}
UISettings stores window choices, positions, and camera zoom.
type UserSettings ¶
type WindowPosition ¶ added in v0.23.0
An unset position keeps the window's automatic placement.