configuration

package
v0.0.0-...-c7db75a Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package configuration contains structures and functions related to the engine's configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

DefaultPath returns the absolute path for the default config file location

func LocalConfigPath

func LocalConfigPath() string

LocalPath returns the absolute path to the directory of the OpenDiablo2 executable

Types

type Configuration

type Configuration struct {
	MpqLoadOrder    []string
	MpqPath         string
	TicksPerSecond  int
	FpsCap          int
	SfxVolume       float64
	BgmVolume       float64
	FullScreen      bool
	RunInBackground bool
	VsyncEnabled    bool
	Backend         string
	// contains filtered or unexported fields
}

Configuration represents the engine's configuration file.

func DefaultConfig

func DefaultConfig() *Configuration

DefaultConfig creates and returns a default configuration

func Load

func Load() (*Configuration, error)

Load loads the configuration file

func New

func New() *Configuration

func (*Configuration) Base

func (c *Configuration) Base() string

Base returns the base component of the path

func (*Configuration) Dir

func (c *Configuration) Dir() string

Dir returns the directory component of the path

func (*Configuration) Path

func (c *Configuration) Path() string

Path returns the configuration file path

func (*Configuration) Save

func (c *Configuration) Save() error

Save saves the configuration object to disk

func (*Configuration) SetPath

func (c *Configuration) SetPath(p string)

SetPath sets where the configuration file is saved to (a full path)

Jump to

Keyboard shortcuts

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