config

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 7 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)

func Set added in v0.8.5

func Set(c Configs)

Types

type BaseDir added in v0.6.0

type BaseDir string

type Category added in v0.8.8

type Category string
const (
	Utility Category = "Utility"
)

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"`
	DefaultGame                string              `json:"openTo"`
	CheckForM3UpdateOnStart    *bool               `json:"checkAppUpdate"`
	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
	AuthorHintDir() string
	DefaultInstallType() InstallType
	Categories() []Category
	CategoriesForSelect() []string
	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 = ""
	// MoveFile moves file to destination
	MoveFile InstallType = "MoveFile"
	// MoveToArchive extracts and move to destination archive
	MoveToArchive InstallType = "MoveToArchive"
	// Move extracts and move to destination
	Move InstallType = "Move"
)

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 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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