mods

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ModCompatOrders = []string{string(None), string(Before), string(After)}
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() string

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 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 {
	RemoteDownloadable
	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      *RemoteDownloadable     `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) 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 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 (
	Hosted     Kind = "Hosted"
	Nexus      Kind = "Nexus"
	CurseForge Kind = "CurseForge"
)

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) Kind added in v0.6.0

func (m *Mod) Kind() Kind

func (*Mod) Merge

func (m *Mod) Merge(from Mod)

func (*Mod) Mod added in v0.6.0

func (m *Mod) Mod() *Mod

func (*Mod) ModIdAsNumber

func (m *Mod) ModIdAsNumber() (uint64, error)

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 {
	Kind       Kind             `json:"ModKind" xml:"ModKind"`
	Versions   []string         `json:"Version,omitempty" xml:"Versions,omitempty"`
	Hosted     *ModCompatHosted `json:"Hosted,omitempty" xml:"Hosted,omitempty"`
	Nexus      *ModCompatNexus  `json:"Nexus,omitempty" xml:"Nexus,omitempty"`
	CurseForge *ModCompatCF     `json:"CurseForge,omitempty" xml:"CurseForge,omitempty"`
	Order      *ModCompatOrder  `json:"Order,omitempty" xml:"Order,omitempty"`
}

func (*ModCompat) ModID

func (c *ModCompat) ModID() ModID

type ModCompatCF added in v0.6.0

type ModCompatCF struct {
	ModID ModID `json:"CfModID" xml:"CfModID"`
}

type ModCompatHosted

type ModCompatHosted struct {
	ModID ModID `json:"ModID" xml:"ModID"`
}

type ModCompatNexus

type ModCompatNexus struct {
	ModID ModID `json:"NexusModID" xml:"NexusModID"`
}

type ModCompatOrder

type ModCompatOrder string
const (
	None   ModCompatOrder = ""
	Before ModCompatOrder = "Before"
	After  ModCompatOrder = "After"
)

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"`
	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"`
	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"`
	Archive   *string `json:"Archive,omitempty" xml:"Archive,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) Kind added in v0.6.0

func (e *ModEnabler) Kind() Kind

type ModFile

type ModFile struct {
	From    string  `json:"From" xml:"From"`
	To      string  `json:"To" xml:"To"`
	Archive *string `json:"Archive,omitempty" xml:"Archive,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 {
	Kind Kind `json:"Kind" xml:"Kind"`
}

type ModLookup added in v0.6.0

type ModLookup[T mod] interface {
	All() []T
	Get(m T) (found T, ok bool)
	GetByID(modID ModID) (found T, ok bool)
	Has(m T) bool
	Len() int
	Remove(m T)
	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]) 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]) 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 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

type RemoteDownloadable added in v0.6.0

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

type Result

type Result byte
const (
	Ok Result
	Cancel
	Error
	Working
)

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(kind Kind, download *Download, downloadFiles *DownloadFiles) *ToInstall

func NewToInstallForMod

func NewToInstallForMod(kind Kind, 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
	Kind() Kind
	Mod() *Mod
	SetMod(m *Mod)
	Enable()
	Enabled() bool
	Disable()
	Toggle() bool
	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) 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) Kind added in v0.6.0

func (m *TrackedModConc) Kind() Kind

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