config

package
v0.0.0-...-165de30 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package config provides the Hellspawner application config file implementation.

Index

Constants

View Source
const (
	// DefaultBGColor is the default background color of the main window
	DefaultBGColor = 0x0a0a0aff
)

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns default config path

Types

type Config

type Config struct {
	Path                    string                    `json:"-"`
	RecentProjects          []string                  `json:"recentProjects"`
	AbyssEnginePath         string                    `json:"abyssEnginePath"`
	AuxiliaryMpqPath        string                    `json:"auxiliaryMpqPath"`
	ExternalListFile        string                    `json:"externalListFile"`
	OpenMostRecentOnStartup bool                      `json:"openMostRecentOnStartup"`
	ProjectStates           map[string]state.AppState `json:"projectStates"`
	LoggingToFile           bool                      `json:"loggingToFile"`
	LogFilePath             string                    `json:"logFile"`
	Locale                  enum.Locale               `json:"locale"`
	BGColor                 color.RGBA                `json:"bgColor"`
	ViewMode                ViewMode
	StaticLayout            StaticLayout
}

Config represents HellSpawner's config

func Load

func Load(optionalPath string) *Config

Load loads config

func (*Config) AddToRecentProjects

func (c *Config) AddToRecentProjects(filePath string)

AddToRecentProjects adds a path to recent opened projects

func (*Config) GetAuxMPQs

func (c *Config) GetAuxMPQs() []string

GetAuxMPQs returns paths to auxiliary mpq's

func (*Config) Save

func (c *Config) Save() error

Save saves a new config

type StaticLayout

type StaticLayout struct {
	ProjectSplit float32
	MPQSplit     float32
	ConsoleSplit float32
}

type ViewMode

type ViewMode int
const (
	ViewModeLegacy ViewMode = iota
	ViewModeStatic
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳