config

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package config loads user configuration from defaults, goro.ini, environment, and command-line flags. 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 SaveUserSettings

func SaveUserSettings(settings UserSettings) (string, error)

func UserConfigPath

func UserConfigPath() (string, error)

func UserDataDir

func UserDataDir() (string, error)

Types

type AudioConfig

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

type Config

type Config struct {
	DataDir  string
	Window   WindowConfig
	Packet   PacketConfig
	Login    LoginConfig
	Audio    AudioConfig
	Render   RenderConfig
	Network  NetworkConfig
	Fog      FogConfig
	Gameplay GameplayConfig
	Script   ScriptConfig
	Log      LogConfig
}

func LoadConfig

func LoadConfig(args []string) (Config, error)

type FogConfig

type FogConfig struct {
	Enabled bool
}

type GameplayConfig

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

type LogConfig

type LogConfig struct {
	Level string
	File  string
}

type LoginConfig

type LoginConfig struct {
	Username  string
	Password  string
	AutoLogin bool
	CharSlot  int
}

type NetworkConfig

type NetworkConfig struct {
	Trace bool
}

type PacketConfig

type PacketConfig struct {
	ClientDate int
	Profile    int
}

type RenderConfig

type RenderConfig struct {
	GraphicsAPI        string
	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 UserSettings

type UserSettings struct {
	Fullscreen  bool
	VSync       bool
	FPS         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
}

Jump to

Keyboard shortcuts

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