mods

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SelectTypes = []string{string(Auto), string(Select), string(Radio)}

Functions

This section is empty.

Types

type ArchiveLocation added in v0.6.2

type ArchiveLocation string

func (*ArchiveLocation) ExtractDir added in v0.6.2

func (l *ArchiveLocation) ExtractDir(fileName string) string

type BugKind added in v0.7.2

type BugKind string

type BugReport added in v0.7.2

type BugReport struct {
	Kind        BugKind `json:"Kind" xml:"Kind"`
	Description string  `json:"Description" xml:"Description"`
}

type Category

type Category string
const (
	BattleScene        Category = "Battle Scene"
	EnemySprite        Category = "Enemy Sprite"
	GameOverhauls      Category = "GameDef Overhauls"
	Gameplay           Category = "Gameplay"
	General            Category = "General"
	Fonts              Category = "Fonts"
	PlayerNpcSprites   Category = "Player/NPC Sprite"
	ScriptText         Category = "Script/Text"
	Soundtrack         Category = "Soundtrack"
	TileSet            Category = "Tile Set"
	TitleScreen        Category = "Title Screen"
	UIGeneral          Category = "UI: General"
	UiMenuPortraits    Category = "UI: Menu Portraits"
	UiTextBoxPortraits Category = "UI: Textbox Portraits"
	UiWindowFrames     Category = "UI: Window Frames"
	Utility            Category = "Utility"
)

type CfModID added in v0.8.1

type CfModID int

type Choice

type Choice struct {
	Name          string         `json:"Name" xml:"Name"`
	Description   string         `json:"Description" xml:"Description"`
	Preview       *Preview       `json:"Preview,omitempty" xml:"Preview,omitempty"`
	DownloadFiles *DownloadFiles `json:"DownloadFiles,omitempty" xml:"DownloadFiles,omitempty"`

	NextConfigurationName *string `json:"NextConfigurationName,omitempty" xml:"NextConfigurationName"`
}

type Configuration

type Configuration struct {
	Name        string    `json:"Name" xml:"Name"`
	Description string    `json:"Description" xml:"Description"`
	Preview     *Preview  `json:"Preview,omitempty" xml:"Preview,omitempty"`
	Root        bool      `json:"Root" xml:"Root"`
	Choices     []*Choice `json:"Choice" xml:"Choices"`

	NextConfigurationName *string `json:"NextConfigurationName,omitempty" xml:"NextConfigurationName"`
}

type ConflictChoiceCallback

type ConflictChoiceCallback func(result Result, choices []*FileConflict, err ...error)

type CurseForgeDownloadable added in v0.6.0

type CurseForgeDownloadable struct {
	FileID   int    `json:"FileID"`
	FileName string `json:"FileName"`
	Url      string `json:"Url"`
}
type DonationLink struct {
	Name string `json:"Name" xml:"Name"`
	Link string `json:"Link" xml:"Link"`
}

type DoneCallback

type DoneCallback func(result Result, err ...error)

type Download

type Download struct {
	Name    string `json:"Name" xml:"Name"`
	Version string `json:"Version" xml:"Version"`

	Hosted     *HostedDownloadable     `json:"Hosted,omitempty" xml:"Hosted,omitempty"`
	Nexus      *NexusDownloadable      `json:"Nexus,omitempty" xml:"Nexus,omitempty"`
	CurseForge *CurseForgeDownloadable `json:"CurseForge,omitempty" xml:"CurseForge,omitempty"`

	DownloadedArchiveLocation *ArchiveLocation `json:"DownloadedLoc,omitempty" xml:"DownloadedLoc,omitempty"`
}

func (Download) FileName added in v0.6.0

func (d Download) FileName() (string, error)

type DownloadFiles

type DownloadFiles struct {
	DownloadName string `json:"DownloadName" xml:"DownloadName"`
	// IsInstallAll is used by nexus mods when a mod.xml is not used
	Files []*ModFile `json:"File,omitempty" xml:"Files,omitempty"`
	Dirs  []*ModDir  `json:"Dir,omitempty" xml:"Dirs,omitempty"`
}

func (*DownloadFiles) HasArchive added in v0.7.4

func (f *DownloadFiles) HasArchive() []string

func (*DownloadFiles) IsEmpty

func (f *DownloadFiles) IsEmpty() bool

type FileConflict

type FileConflict struct {
	File         string
	CurrentModID ModID
	NewModID     ModID
	ChoiceName   string
}

func (*FileConflict) OnChange

func (c *FileConflict) OnChange(selected string)

type Game

type Game struct {
	ID       config.GameID    `json:"Name" xml:"Name"`
	Versions []config.Version `json:"Version,omitempty" xml:"GameVersions,omitempty"`
}

type GitHub added in v0.6.4

type GitHub struct {
	Owner   string `json:"Owner"`
	Repo    string `json:"Repo"`
	Version string `json:"Version"`
}

type HostedDownloadable

type HostedDownloadable struct {
	Sources []string `json:"Source" xml:"Sources"`
}

type InstalledDownload

type InstalledDownload struct {
	Name    string `json:"Name"`
	Version string `json:"Version"`
}

func NewInstalledDownload

func NewInstalledDownload(name, version string) *InstalledDownload

type Kind

type Kind string
const (
	BugKindCosmetic Kind = "Cosmetic"
	BugKindAnnoying Kind = "Annoying"
	BugKindCrash    Kind = "Critical"
)
const (
	Nexus        Kind = "Nexus"
	CurseForge   Kind = "CurseForge"
	HostedAt     Kind = "HostedAt"
	HostedGitHub Kind = "GitHub"
)

func (Kind) Is added in v0.6.4

func (k Kind) Is(kind Kind) bool

type Kinds added in v0.8.1

type Kinds []Kind

func (*Kinds) Add added in v0.8.1

func (k *Kinds) Add(kind Kind)

func (*Kinds) Is added in v0.8.1

func (k *Kinds) Is(kind Kind) bool

func (*Kinds) IsHosted added in v0.8.1

func (k *Kinds) IsHosted() bool

func (*Kinds) Remove added in v0.8.1

func (k *Kinds) Remove(kind Kind)

func (*Kinds) String added in v0.8.1

func (k *Kinds) String() string

type Mod

type Mod struct {
	*ModDef
}

func NewMod added in v0.6.0

func NewMod(def *ModDef) *Mod

func NewModForVersion added in v0.5.5

func NewModForVersion(manual *Mod, remote *Mod) *Mod

func Sort

func Sort(mods []*Mod) (sorted []*Mod)

func (*Mod) BranchName

func (m *Mod) BranchName() string

func (*Mod) ID

func (m *Mod) ID() ModID

func (*Mod) InstallType added in v0.6.2

func (m *Mod) InstallType(game config.GameDef) config.InstallType

func (*Mod) Kinds added in v0.8.1

func (m *Mod) Kinds() Kinds

func (*Mod) LoadFromFile added in v0.8.7

func (m *Mod) LoadFromFile(file string) (err error)

func (*Mod) Mod added in v0.6.0

func (m *Mod) Mod() *Mod

func (*Mod) Save added in v0.6.0

func (m *Mod) Save(to string) error

func (*Mod) Supports

func (m *Mod) Supports(game config.GameDef) error

func (*Mod) Validate

func (m *Mod) Validate() string

type ModCompat

type ModCompat struct {
	Versions []string `json:"Version,omitempty" xml:"Versions,omitempty"`
	ID       ModID    `json:"ModID,omitempty" xml:"ModID,omitempty"`
}

ModCompatOrder string

func (*ModCompat) ModID

func (c *ModCompat) ModID() ModID

type ModCompatibility

type ModCompatibility struct {
	Requires []*ModCompat `json:"Require" xml:"Requires"`
	Forbids  []*ModCompat `json:"Forbid" xml:"Forbids"`
}

func (*ModCompatibility) HasItems

func (c *ModCompatibility) HasItems() bool

type ModDef added in v0.6.0

type ModDef struct {
	ModID               ModID               `json:"ID" xml:"ID"`
	Name                ModName             `json:"Name" xml:"Name"`
	Author              string              `json:"Author" xml:"Author"`
	AuthorLink          string              `json:"AuthorLink" xml:"AuthorLink"`
	ReleaseDate         string              `json:"ReleaseDate" xml:"ReleaseDate"`
	Category            Category            `json:"Category" xml:"Category"`
	Description         string              `json:"Description" xml:"Description"`
	ReleaseNotes        string              `json:"ReleaseNotes" xml:"ReleaseNotes"`
	Link                string              `json:"Link" xml:"Link"`
	Version             string              `json:"Version" xml:"Version"`
	InstallType_        *config.InstallType `json:"InstallType,omitempty" xml:"InstallType,omitempty"`
	Preview             *Preview            `json:"Preview,omitempty" xml:"Preview,omitempty"`
	Previews            []*Preview          `json:"Previews,omitempty" xml:"Previews,omitempty"`
	ModKind             ModKind             `json:"ModKind" xml:"ModKind"`
	ModCompatibility    *ModCompatibility   `json:"Compatibility,omitempty" xml:"ModCompatibility,omitempty"`
	Downloadables       []*Download         `json:"Downloadable" xml:"Downloadables"`
	DonationLinks       []*DonationLink     `json:"DonationLink" xml:"DonationLinks"`
	Games               []*Game             `json:"Games" xml:"Games"`
	AlwaysDownload      []*DownloadFiles    `json:"AlwaysDownload,omitempty" xml:"AlwaysDownload,omitempty"`
	Configurations      []*Configuration    `json:"Configuration,omitempty" xml:"Configurations,omitempty"`
	ConfigSelectionType SelectType          `json:"ConfigSelectionType" xml:"ConfigSelectionType"`
	Hide                bool                `json:"Hide" xml:"Hide"`
	VerifiedAsWorking   bool                `json:"VerifiedAsWorking" xml:"VerifiedAsWorking"`
	Bugs                []BugReport         `json:"Bugs,omitempty" xml:"Bugs,omitempty"`
	IsManuallyCreated   bool                `json:"IsManuallyCreated" xml:"IsManuallyCreated"`
}

type ModDir

type ModDir struct {
	From      string  `json:"From" xml:"From"`
	To        string  `json:"To" xml:"To"`
	Recursive bool    `json:"Recursive" xml:"Recursive"`
	ToArchive *string `json:"ToArchive,omitempty" xml:"ToArchive,omitempty"`
}

type ModEnabler

type ModEnabler struct {
	Game         config.GameDef
	TrackedMod   TrackedMod
	ToInstall    []*ToInstall
	OnConflict   OnConflict
	ShowWorking  func()
	DoneCallback DoneCallback
}

func NewModEnabler

func NewModEnabler(game config.GameDef, tm TrackedMod, toInstall []*ToInstall, onConflict OnConflict, showWorking func(), doneCallback DoneCallback) *ModEnabler

func (*ModEnabler) Kinds added in v0.8.1

func (e *ModEnabler) Kinds() Kinds

type ModFile

type ModFile struct {
	From      string  `json:"From" xml:"From"`
	To        string  `json:"To" xml:"To"`
	ToArchive *string `json:"ToArchive,omitempty" xml:"ToArchive,omitempty"`
}

type ModID

type ModID string

func NewModID added in v0.4.3

func NewModID(k Kind, modID string) ModID

func (ModID) AsDir added in v0.6.0

func (id ModID) AsDir() string

type ModKind

type ModKind struct {
	Kinds        Kinds       `json:"Kinds" xml:"Kinds"`
	NexusID      *NexusModID `json:"NexusID,omitempty" xml:"NexusID,omitempty"`
	CurseForgeID *CfModID    `json:"CurseForgeID,omitempty" xml:"CurseForgeID,omitempty"`
	GitHub       *GitHub     `json:"Github,omitempty" xml:"Github,omitempty"`
}

type ModLookup added in v0.6.0

type ModLookup[T mod] interface {
	All() []T
	Clear()
	Get(m T) (found T, ok bool)
	GetByID(modID ModID) (found T, ok bool)
	Has(m T) bool
	Len() int
	Remove(m T)
	RemoveConditionally(f func(t T) bool)
	Set(m T)
}

func NewModLookup added in v0.6.0

func NewModLookup[T mod]() ModLookup[T]

type ModLookupConc added in v0.6.0

type ModLookupConc[T mod] struct {
	Lookup map[lookupID]T `json:"Lookup"`
}

ModLookupConc is a public for serialization purposes.

func (*ModLookupConc[T]) All added in v0.6.0

func (l *ModLookupConc[T]) All() []T

func (*ModLookupConc[T]) Clear added in v0.8.1

func (l *ModLookupConc[T]) Clear()

func (*ModLookupConc[T]) Get added in v0.6.0

func (l *ModLookupConc[T]) Get(m T) (found T, ok bool)

func (*ModLookupConc[T]) GetByID added in v0.6.0

func (l *ModLookupConc[T]) GetByID(modID ModID) (found T, ok bool)

func (*ModLookupConc[T]) Has added in v0.6.0

func (l *ModLookupConc[T]) Has(m T) bool

func (*ModLookupConc[T]) Len added in v0.6.0

func (l *ModLookupConc[T]) Len() int

func (*ModLookupConc[T]) Remove added in v0.6.0

func (l *ModLookupConc[T]) Remove(m T)

func (*ModLookupConc[T]) RemoveConditionally added in v0.7.0

func (l *ModLookupConc[T]) RemoveConditionally(f func(m T) bool)

func (*ModLookupConc[T]) Set added in v0.6.0

func (l *ModLookupConc[T]) Set(m T)

type ModName added in v0.6.2

type ModName string

func (ModName) Contains added in v0.6.2

func (n ModName) Contains(text string) bool

type NexusDownloadable

type NexusDownloadable struct {
	FileID   int    `json:"FileID"`
	FileName string `json:"FileName"`
}

type NexusModID added in v0.8.1

type NexusModID int

type OnConflict

type OnConflict func(conflicts []*FileConflict, choiceCallback ConflictChoiceCallback)

type Preview

type Preview struct {
	Url   *string `json:"Url,omitempty" xml:"Url,omitempty"`
	Local *string `json:"Local,omitempty" xml:"Local,omitempty"`
	// contains filtered or unexported fields
}

func (*Preview) Get

func (p *Preview) Get() *canvas.Image

func (*Preview) GetAsButton added in v0.8.7

func (p *Preview) GetAsButton(onClick func()) *fyne.Container

func (*Preview) GetAsEnlargeOnClick added in v0.8.7

func (p *Preview) GetAsEnlargeOnClick() *fyne.Container

func (*Preview) GetAsImageGallery added in v0.8.7

func (p *Preview) GetAsImageGallery(index int, previews []*Preview, enlarge bool) *fyne.Container

func (*Preview) GetUncachedImage added in v0.8.7

func (p *Preview) GetUncachedImage() (img *canvas.Image)

type Result

type Result byte
const (
	Ok Result
	Cancel
	Error
	Working
	Repeat
)

type SelectType

type SelectType string
const (
	Auto   SelectType = "Auto"
	Select SelectType = "Select"
	Radio  SelectType = "Radio"
)

type Size

type Size struct {
	X int `json:"X" xml:"X"`
	Y int `json:"Y" xml:"Y"`
}

type ToInstall

type ToInstall struct {
	Download      *Download
	DownloadFiles []*DownloadFiles
	// contains filtered or unexported fields
}

func NewToInstall

func NewToInstall(kinds Kinds, download *Download, downloadFiles *DownloadFiles) *ToInstall

func NewToInstallForMod

func NewToInstallForMod(mod *Mod, downloadFiles []*DownloadFiles) (result []*ToInstall, err error)

func (*ToInstall) GetDownloadLocation

func (ti *ToInstall) GetDownloadLocation(game config.GameDef, tm TrackedMod) (string, error)

type TrackedMod

type TrackedMod interface {
	ID() ModID
	Kinds() Kinds
	Mod() *Mod
	SetMod(m *Mod)
	Enable()
	Enabled() bool
	EnabledPtr() *bool
	Disable()
	Save() error
	DisplayName() string
	DisplayNamePtr() *string
	SetDisplayName(name string)
	UpdatedMod() *Mod
	SetUpdatedMod(m *Mod)
	MoogleModFile() string
	InstallType(game config.GameDef) config.InstallType
}

func NewTrackerMod

func NewTrackerMod(mod *Mod, game config.GameDef) TrackedMod

type TrackedModConc added in v0.6.0

type TrackedModConc struct {
	IsEnabled      bool   `json:"Enabled"`
	MoogleModFile_ string `json:"MoogleModFile"`
	//Installed     []*InstalledDownload `json:"Installed"`
	Mod_         *Mod   `json:"-"`
	UpdatedMod_  *Mod   `json:"-"`
	DisplayName_ string `json:"-"`
}

TrackedModConc is public for serialization purposes

func (*TrackedModConc) Disable added in v0.6.0

func (m *TrackedModConc) Disable()

func (*TrackedModConc) DisplayName added in v0.6.0

func (m *TrackedModConc) DisplayName() string

func (*TrackedModConc) DisplayNamePtr added in v0.6.0

func (m *TrackedModConc) DisplayNamePtr() *string

func (*TrackedModConc) Enable added in v0.6.0

func (m *TrackedModConc) Enable()

func (*TrackedModConc) Enabled added in v0.6.0

func (m *TrackedModConc) Enabled() bool

func (*TrackedModConc) EnabledPtr added in v0.6.4

func (m *TrackedModConc) EnabledPtr() *bool

func (*TrackedModConc) ID added in v0.6.0

func (m *TrackedModConc) ID() ModID

func (*TrackedModConc) InstallType added in v0.6.2

func (m *TrackedModConc) InstallType(game config.GameDef) config.InstallType

func (*TrackedModConc) Kinds added in v0.8.1

func (m *TrackedModConc) Kinds() Kinds

func (*TrackedModConc) Mod added in v0.6.0

func (m *TrackedModConc) Mod() *Mod

func (*TrackedModConc) MoogleModFile added in v0.6.0

func (m *TrackedModConc) MoogleModFile() string

func (*TrackedModConc) Save added in v0.6.0

func (m *TrackedModConc) Save() error

func (*TrackedModConc) SetDisplayName added in v0.6.0

func (m *TrackedModConc) SetDisplayName(name string)

func (*TrackedModConc) SetMod added in v0.6.0

func (m *TrackedModConc) SetMod(mod *Mod)

func (*TrackedModConc) SetUpdatedMod added in v0.6.0

func (m *TrackedModConc) SetUpdatedMod(updatedMod *Mod)

func (*TrackedModConc) Toggle added in v0.6.0

func (m *TrackedModConc) Toggle() bool

func (*TrackedModConc) UpdatedMod added in v0.6.0

func (m *TrackedModConc) UpdatedMod() *Mod

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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