mods

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InstallTypes = []string{string(Compressed)}
View Source
var ModCompatOrders = []string{string(None), string(Before), string(After)}
View Source
var SelectTypes = []string{string(Auto), string(Select), string(Radio)}

Functions

func UniqueModID added in v0.4.3

func UniqueModID(game config.Game, modID ModID) string

Types

type Category

type Category string
const (
	BattleScene        Category = "Battle Scene"
	EnemySprite        Category = "Enemy Sprite"
	GameOverhauls      Category = "Game Overhauls"
	Gameplay           Category = "Gameplay"
	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 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"`

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

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 {
	Name     config.GameName `json:"Name" xml:"Name"`
	Versions []string        `json:"Version,omitempty" xml:"GameVersions,omitempty"`
}

type HostedDownloadable

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

type InstallBaseDir

type InstallBaseDir string
const (
	InstallDir_I   InstallBaseDir = "FINAL FANTASY_Data"
	InstallDir_II  InstallBaseDir = "FINAL FANTASY II_Data"
	InstallDir_III InstallBaseDir = "FINAL FANTASY III_Data"
	InstallDir_IV  InstallBaseDir = "FINAL FANTASY IV_Data"
	InstallDir_V   InstallBaseDir = "FINAL FANTASY V_Data"
	InstallDir_VI  InstallBaseDir = "FINAL FANTASY VI_Data"

	StreamingAssetsDir = "StreamingAssets"
)

func GameToInstallBaseDir

func GameToInstallBaseDir(game config.Game) InstallBaseDir

type InstallType

type InstallType string
const (
	//Bundles  InstallType = "Bundles"
	//Memoria  InstallType = "Memoria"
	//Magicite InstallType = "Magicite"
	//BepInEx  InstallType = "BepInEx"
	// DLL Patcher https://discord.com/channels/371784427162042368/518331294858608650/863930606446182420
	//DllPatch   InstallType = "DllPatch"
	Compressed InstallType = "Compressed"
)

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

type Mod

type Mod struct {
	ID                  ModID             `json:"ID" xml:"ID"`
	Name                string            `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"`
	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"`
	IsManuallyCreated   bool              `json:"IsManuallyCreated" xml:"IsManuallyCreated"`
}

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

func (m *Mod) DirectoryName() string

func (*Mod) Merge

func (m *Mod) Merge(from Mod)

func (*Mod) ModIdAsNumber

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

func (*Mod) Supports

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

func (*Mod) UniqueModID

func (m *Mod) UniqueModID(game config.Game) string

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"`
	Order    *ModCompatOrder  `json:"Order,omitempty" xml:"Order,omitempty"`
	// contains filtered or unexported fields
}

func (*ModCompat) ModID

func (c *ModCompat) ModID() ModID

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 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.Game
	TrackedMod   *TrackedMod
	ToInstall    []*ToInstall
	OnConflict   OnConflict
	ShowWorking  func()
	DoneCallback DoneCallback
}

func NewModEnabler

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

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

type ModKind

type ModKind struct {
	Kind Kind `json:"Kind" xml:"Kind"`
}

type NexusDownloadable

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

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 Result

type Result byte
const (
	Ok Result
	Cancel
	Error
)

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.Game, tm *TrackedMod) (string, error)

type TrackedMod

type TrackedMod struct {
	Enabled       bool   `json:"Enabled"`
	MoogleModFile string `json:"MoogleModFile"`
	//Installed     []*InstalledDownload `json:"Installed"`
	Mod         *Mod   `json:"-"`
	UpdatedMod  *Mod   `json:"-"`
	DisplayName string `json:"-"`
}

func NewTrackerMod

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

func (*TrackedMod) GetDirSuffix

func (m *TrackedMod) GetDirSuffix() string

func (*TrackedMod) GetMod

func (m *TrackedMod) GetMod() *Mod

func (*TrackedMod) GetModID

func (m *TrackedMod) GetModID() ModID

func (*TrackedMod) IsEnabled

func (m *TrackedMod) IsEnabled() bool

func (*TrackedMod) Save

func (m *TrackedMod) Save() error

func (*TrackedMod) SetIsEnabled

func (m *TrackedMod) SetIsEnabled(isEnabled bool)

func (*TrackedMod) Toggle

func (m *TrackedMod) Toggle() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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