config

package
v0.24.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 11 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextScreenshotPath

func NextScreenshotPath(now time.Time) (string, error)

func UserDataDir

func UserDataDir() (string, error)

Types

type AudioConfig

type AudioConfig struct {
	Disabled  bool
	BGM       bool
	BGMVolume float64
	SFXVolume float64
}

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 LoadConfig(args []string) (Config, error)

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

func (cfg Config) SaveLoginID(username string, keep bool) (string, error)

SaveLoginID remembers only the ID, independently of explicit login credentials.

func (Config) SaveScriptPath added in v0.16.0

func (cfg Config) SaveScriptPath(path string) (string, error)

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)

func (Config) SaveVisualSettings added in v0.23.0

func (cfg Config) SaveVisualSettings(fogEnabled, simpleAura, noEffects bool) (string, error)

type FogConfig

type FogConfig struct {
	Enabled bool
}

type GameplayConfig

type GameplayConfig struct {
	NoShift     bool
	NoCtrl      bool
	LessEffects bool
	NoEffects   bool
	SimpleAura  bool
	SnapTargets bool
	SnapItems   bool
	ForceUserAI bool
}

type LoginConfig

type LoginConfig struct {
	Username       string
	Password       string
	AutoLogin      bool
	ServerSlot     int
	CharServerSlot int
	CharSlot       int
	KeepID         bool
	SavedUsername  string
}

type NetworkConfig

type NetworkConfig struct {
	Trace bool
}

type PacketConfig

type PacketConfig struct {
	ClientDate int
	Profile    int
}

type RenderConfig

type RenderConfig struct {
	GraphicsAPI        string
	Anisotropy         int
	TextureUpscaling   bool
	SmoothSprites      bool
	MSAA               bool
	Bloom              bool
	SSAO               bool
	VSync              bool
	FPS                bool
	NoUI               bool
	AsyncUI            bool
	UIProfile          bool
	BenchSeconds       int
	BenchWarmupSeconds int
	CPUProfile         string
	Stats              bool
	WorldDebugStats    bool
}

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 UserSettings struct {
	Fullscreen       bool
	VSync            bool
	FPS              bool
	Anisotropy       int
	TextureUpscaling bool
	SmoothSprites    bool
	MSAA             bool
	Bloom            bool
	SSAO             bool
	BGMVolume        float64
	SFXVolume        float64
	NoShift          bool
	NoCtrl           bool
	LessEffects      bool
	SnapTargets      bool
	SnapItems        bool
}

type WindowConfig

type WindowConfig struct {
	Title      string
	Width      int
	Height     int
	Fullscreen bool
}

type WindowPosition added in v0.23.0

type WindowPosition struct {
	X, Y int
	Set  bool
}

An unset position keeps the window's automatic placement.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL