middle

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const FakeError bool = false

FakeError should be enabled to prevent internet access by CCUpdaterUI.

View Source
const GameFinderVFSPathDefault = "computer://"

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

Variables

View Source
var InternetConnectionWarning bool = true

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

Functions

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 PackageIcon

func PackageIcon(pkg ccmodupdater.Package) design.IconID

PackageIcon returns the relevant icon ID for a package.

func WriteUpdaterConfig

func WriteUpdaterConfig(cfg UpdaterConfig)

WriteUpdaterConfig saves a configuration as the current configuration.

Types

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 lists potentially-virtual directories at each path.

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
)

Jump to

Keyboard shortcuts

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