modhandler

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForUpdates

func CheckForUpdates(install bool) bool

CheckForUpdates compares the installed version with the newest available and optionally downloads it

func GetDownloadedModVersions

func GetDownloadedModVersions(modID string) ([]string, error)

GetDownloadedModVersions Returns the downloaded versions of the mod

func GetLatestDownloadedVersion

func GetLatestDownloadedVersion(modID string) (string, error)

GetLatestDownloadedVersion Returns the latest downloaded version of the mod

func Install

func Install(modID string, modVersion string, smlPath string) bool

Install the mod to the SML path

func Remove

func Remove(modID string, modVersion string) bool

Remove Removes the mod file from the downloaded mods

func Uninstall

func Uninstall(modID string, modVersion string, smlPath string) bool

Uninstall the mod from the SML path

func Update

func Update(modID string) bool

Update Tries to update the mod. Returns true if the mod was updated, false if the local file is already up to date

Types

type DataJSON

type DataJSON struct {
	ModID       string    `json:"mod_id"`
	Name        string    `json:"name"`
	Version     string    `json:"version"`
	Description string    `json:"description"`
	Authors     []string  `json:"authors"`
	Objects     []ModFile `json:"objects"`
}

DataJSON contains the data.json information

func GetDataFromZip

func GetDataFromZip(zipFileName string) DataJSON

GetDataFromZip returns the data.json file in the zip

func GetDownloadedMods

func GetDownloadedMods() []DataJSON

GetDownloadedMods returns all mods found in the smlauncher mods dir

func GetInstalledMods

func GetInstalledMods(smlPath string) []DataJSON

GetInstalledMods returns all mods found in the sml mods dir

type ModFile

type ModFile struct {
	Path string `json:"path"`
	Type string `json:"type"`
}

ModFile contains the data.json objects information

Jump to

Keyboard shortcuts

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