config

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WindowWidth  = 1200
	WindowHeight = 850
)
View Source
const (
	StreamingAssetsDir = "StreamingAssets"
)

Variables

View Source
var (
	PWD string
)

Functions

func GameIDs added in v0.6.0

func GameIDs() []string

func Initialize added in v0.6.0

func Initialize(dirs []string) (err error)

Types

type BaseDir added in v0.6.0

type BaseDir string

type CfGameID added in v0.6.0

type CfGameID int

type CfPath added in v0.6.0

type CfPath string

type Configs

type Configs struct {
	FirstTime                  bool                `json:"firstTime"`
	WindowX                    int                 `json:"width"`
	WindowY                    int                 `json:"height"`
	ModsDir                    string              `json:"modDir"`
	ImgCacheDir                string              `json:"imgCacheDir"`
	DownloadDir                string              `json:"downloadDir"`
	BackupDir                  string              `json:"backupDir"`
	Theme                      ThemeColor          `json:"theme"`
	DefaultGame                string              `json:"openTo"`
	GameDirs                   map[string]*GameDir `json:"gameDirs"`
	DeleteDownloadAfterInstall bool                `json:"deleteDownloadAfterInstall"`
}

func Get

func Get() *Configs

func (*Configs) AddDir added in v0.5.2

func (c *Configs) AddDir(game GameDef, dirKind DirKind, from string) (string, error)

func (*Configs) GetBackupFullPath

func (c *Configs) GetBackupFullPath(game GameDef) string

func (*Configs) GetDir added in v0.5.2

func (c *Configs) GetDir(game GameDef, dirKind DirKind) (dir string, err error)

func (*Configs) GetDownloadFullPathForGame

func (c *Configs) GetDownloadFullPathForGame(game GameDef) string

func (*Configs) GetDownloadFullPathForUtility

func (c *Configs) GetDownloadFullPathForUtility() string

func (*Configs) GetModsFullPath

func (c *Configs) GetModsFullPath(game GameDef) string

func (*Configs) Initialize

func (c *Configs) Initialize() (err error)

func (*Configs) InitializeGames added in v0.6.1

func (c *Configs) InitializeGames(games []GameDef)

func (*Configs) RemoveDir added in v0.5.4

func (c *Configs) RemoveDir(game GameDef, dirKind DirKind, from string) (string, error)

func (*Configs) RemoveGameDir added in v0.5.0

func (c *Configs) RemoveGameDir(game GameDef, to string) (string, error)

func (*Configs) Save

func (c *Configs) Save() (err error)

func (*Configs) Size

func (c *Configs) Size() fyne.Size

type CurseForge added in v0.6.0

type CurseForge struct {
	ID   CfGameID `json:"id"`
	Path CfPath   `json:"path"`
}

type DirKind added in v0.5.2

type DirKind byte
const (
	ModsDirKind DirKind = iota
	DownloadDirKind
	BackupDirKind
	GameDirKind
)

type GameDef added in v0.6.0

type GameDef interface {
	ID() GameID
	Name() GameName
	SteamID() SteamID
	Versions() []Version
	BaseDir() BaseDir
	Remote() Remote
	DefaultInstallType() InstallType
	LogoPath() string
	SetLogoPath(path string)
	SteamDirFromRegistry() string
}

func GameDefFromCfID added in v0.6.0

func GameDefFromCfID(id CfGameID) (GameDef, error)

func GameDefFromCfPath added in v0.6.0

func GameDefFromCfPath(path CfPath) (GameDef, error)

func GameDefFromID added in v0.6.0

func GameDefFromID(id GameID) (GameDef, error)

func GameDefFromName added in v0.6.0

func GameDefFromName(name GameName) (GameDef, error)

func GameDefFromNexusID added in v0.6.0

func GameDefFromNexusID(id NexusGameID) (GameDef, error)

func GameDefFromNexusPath added in v0.6.0

func GameDefFromNexusPath(path NexusPath) (GameDef, error)

func GameDefs added in v0.6.0

func GameDefs() []GameDef

type GameDir added in v0.6.0

type GameDir struct {
	Dir string `json:"dir"`
}

type GameID added in v0.6.0

type GameID string

type GameName

type GameName string

type InstallType added in v0.6.0

type InstallType string
const (
	BlankInstallType    InstallType = ""
	MoveToArchive       InstallType = "MoveToArchive"
	Move                InstallType = "Move"
	ImmediateDecompress InstallType = "ImmediateDecompress"
)

func (*InstallType) Is added in v0.6.2

func (t *InstallType) Is(i InstallType) bool

type Nexus added in v0.6.0

type Nexus struct {
	ID   NexusGameID `json:"id"`
	Path NexusPath   `json:"path"`
}

type NexusGameID added in v0.6.0

type NexusGameID int

type NexusPath added in v0.6.0

type NexusPath string

type Remote added in v0.6.0

type Remote struct {
	Nexus      Nexus      `json:"nexus"`
	CurseForge CurseForge `json:"curseforge"`
}

type Secret

type Secret struct {
	NexusApiKey string `json:"nexusApiKey"`
	CfApiKey    string `json:"cfApiKey"`
}

func GetSecrets

func GetSecrets() *Secret

func (*Secret) Initialize

func (s *Secret) Initialize()

func (*Secret) Save

func (s *Secret) Save() error

type SteamID added in v0.6.0

type SteamID string

type SteamVersion added in v0.6.0

type SteamVersion struct {
	Build    uint   `json:"build"`
	Manifest uint64 `json:"manifest"`
}

type ThemeColor

type ThemeColor byte
const (
	DarkThemeColor ThemeColor = iota
	LightThemeColor
)

type Version added in v0.6.0

type Version struct {
	Version VersionID     `json:"version"`
	Steam   *SteamVersion `json:"steam,omitempty"`
}

type VersionID added in v0.6.0

type VersionID string

Jump to

Keyboard shortcuts

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