d2config

package
v0.0.0-...-7f92c57 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package d2config contains configuration management for OpenDiablo2

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath returns the absolute path for the default config file location

func LocalConfigPath

func LocalConfigPath() string

LocalConfigPath 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 defines the configuration for the engine, loaded from config.json

func DefaultConfig

func DefaultConfig() *Configuration

DefaultConfig creates and returns a default 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 config 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 config 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