config

package
v0.0.0-...-16767da Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VideoPlayer []string          `toml:"video_player"`
	Engines     map[string]Engine `toml:"engines"`

	DefaultEngineName string `toml:"default_engine"`

	// FIXME: options may well end up being per-engine too
	Defaults *Options `toml:"-"`
	Options  `toml:"options"`
	// contains filtered or unexported fields
}

func Load

func Load(filename string, overrideDefaultEngine string) (*Config, error)

func (*Config) DataFile

func (c *Config) DataFile(engine string, path string) string

TODO: case-insensitive lookup

func (*Config) DefaultEngine

func (c *Config) DefaultEngine() *Engine

func (*Config) Engine

func (c *Config) Engine(name string) *Engine

func (*Config) HasUnsetOptions

func (c *Config) HasUnsetOptions() bool

func (*Config) ResetDefaults

func (c *Config) ResetDefaults() error

func (*Config) Save

func (c *Config) Save() error

type Engine

type Engine struct {
	DataDir string `toml:"data_dir"`
	Palette string `toml:"palette"`
}

type Options

type Options struct {
	PlayMovies   bool `toml:"play_movies"`
	Animations   bool `toml:"animations"`
	PlayMusic    bool `toml:"play_music"`
	CombatVoices bool `toml:"combat_voices"`
	ShowGrid     bool `toml:"show_grid"`
	ShowPaths    bool `toml:"show_paths"`
	PointSaving  bool `toml:"point_saving"`
	AutoCutLevel bool `toml:"auto_cut_level"`

	XRes int `toml:"x_resolution"`
	YRes int `toml:"y_resolution"`

	MusicVolume int `toml:"music_volume"`
	SFXVolume   int `toml:"sfx_volume"`

	UnitSpeed int `toml:"unit_speed"`
	AnimSpeed int `toml:"animation_speed"`
}

Things set in the options hash TODO: load defaults from Data/GenericData.dat if they're not set

func (*Options) ResolutionIndex

func (o *Options) ResolutionIndex() int

func (*Options) SetResolutionIndex

func (o *Options) SetResolutionIndex(value int)

Jump to

Keyboard shortcuts

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