middle

package
v0.0.0-...-b5003a3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: MIT Imports: 18 Imported by: 5

Documentation

Index

Constants

View Source
const BrowserVFSPathDefault = "computer://"

BrowserVFSPathDefault is the path for the 'drives panel'. Should be virtual.

View Source
const FakeError bool = false

FakeError should be enabled to prevent internet access by CCUpdaterUI.

Variables

View Source
var InternetConnectionWarning bool = true

InternetConnectionWarning is true if the last GetRemotePackages() call actually resulted in error.

Functions

func BrowserVFSLocationReal

func BrowserVFSLocationReal(vfsPath string) bool

BrowserVFSLocationReal returns true if the path is a real file or directory that can be accessed using standard file IO.

func GetLatestOf

func GetLatestOf(local ccmodupdater.Package, remote ccmodupdater.Package) ccmodupdater.Package

GetLatestOf returns the latest of two possibly-nil packages (returning nil if both are nil)

func GetRemotePackages

func GetRemotePackages() map[string]ccmodupdater.RemotePackage

GetRemotePackages retrieves remote packages from the server. (The CCUpdaterCLI-level cache semantics still apply.)

func Launch

func Launch(base string) (*os.Process, error)

Launch launches the game given a gameinstance base directory.

func OpenURL

func OpenURL(url string) error

OpenURL opens a URL. It *MAY* be susceptible to bad URLs depending on OS.

func PackageIcon

func PackageIcon(pkg ccmodupdater.Package) design.IconID

PackageIcon returns the relevant icon ID for a package.

func PackagePVIcon

func PackagePVIcon(local ccmodupdater.Package, remote ccmodupdater.Package) design.IconID

PackagePVIcon returns the relevant icon ID for the Primary View given the state of the package locally and remotely.

func WriteUpdaterConfig

func WriteUpdaterConfig(cfg UpdaterConfig)

WriteUpdaterConfig saves a configuration as the current configuration.

Types

type BrowserLocation

type BrowserLocation struct {
	// Location is the actual path (should be passable to file IO functions if not virtual)
	Location string
	// Dir is true if this is a directory, false otherwise.
	Dir bool
	// If not empty, this is a drive, and has a special overridden name
	Drive string
}

BrowserLocation represents a location in the browser VFS.

func BrowserVFSAppendDownloads

func BrowserVFSAppendDownloads(existing []BrowserLocation) []BrowserLocation

Appends the Downloads directory

func BrowserVFSList

func BrowserVFSList(vfsPath string) []BrowserLocation

BrowserVFSList lists potentially-virtual directories at each path.

type GameLocation

type GameLocation struct {
	// True for CrossCode installs. This overrules everything else, including Drive.
	Valid    bool
	Location string
	Version  string
	// If not empty, this is a drive, and has a special overridden name
	Drive string
}

GameLocation represents a location a copy of CrossCode may be in.

func AutodetectGameLocations

func AutodetectGameLocations() []GameLocation

AutodetectGameLocations attempts to find game locations. This may take some time as it can spin the CD/DVD drive on Windows; run in a Goroutine!

func CheckGameLocation

func CheckGameLocation(dir string) GameLocation

CheckGameLocation converts a path into a GameLocation, making sure to set Valid & Version correctly in the process.

func GameFinderVFSList

func GameFinderVFSList(vfsPath string) []GameLocation

GameFinderVFSList performs BrowserVFSList and converts the results to GameLocations.

type PackedModLocation

type PackedModLocation struct {
	// True for packed mods. This overrules everything else, including Drive.
	Valid    bool
	Location string
	Metadata ccmodupdater.PackageMetadata
	// If not empty, this is a drive, and has a special overridden name
	Drive string
}

PackedModLocation

func CheckPackedModLocation

func CheckPackedModLocation(path string) PackedModLocation

CheckPackedModLocation converts a path into a PackedModLocation, making sure to set Valid, Location and Metadata correctly in the process.

func PackedModFinderVFSList

func PackedModFinderVFSList(vfsPath string) []PackedModLocation

PackedModLocationVFSList performs BrowserVFSList and converts the results to PackedModLocations.

type UpdaterConfig

type UpdaterConfig struct {
	GamePath string `json:"gamePath"`
	DevMode  bool   `json:"devMode"`
}

UpdaterConfig is the configuration structure for the application.

func ReadUpdaterConfig

func ReadUpdaterConfig() UpdaterConfig

ReadUpdaterConfig returns the current configuration for the application.

type Warning

type Warning struct {
	Text      string
	Action    WarningID
	Parameter string
}

Warning represents a warning to show the user on the primary view.

func FindWarnings

func FindWarnings(game *ccmodupdater.GameInstance) []Warning

FindWarnings detects issues with the installation to show on the primary view.

type WarningID

type WarningID int

WarningID represents a kind of warning action.

const (
	// NullActionWarningID cannot be automatically fixed.
	NullActionWarningID WarningID = iota
	// InstallOrUpdatePackageWarningID warnings can be solved by installing/updating the package Parameter.
	InstallOrUpdatePackageWarningID
	// URLAndCloseWarningID warnings can be solved manually by the user given navigation to a URL. The application closes.
	URLAndCloseWarningID
)

Jump to

Keyboard shortcuts

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