Documentation ¶
Index ¶
- Constants
- Variables
- func BrowserVFSLocationReal(vfsPath string) bool
- func GetLatestOf(local ccmodupdater.Package, remote ccmodupdater.Package) ccmodupdater.Package
- func GetRemotePackages() map[string]ccmodupdater.RemotePackage
- func Launch(base string) (*os.Process, error)
- func OpenURL(url string) error
- func PackageIcon(pkg ccmodupdater.Package) design.IconID
- func PackagePVIcon(local ccmodupdater.Package, remote ccmodupdater.Package) design.IconID
- func WriteUpdaterConfig(cfg UpdaterConfig)
- type BrowserLocation
- type GameLocation
- type PackedModLocation
- type UpdaterConfig
- type Warning
- type WarningID
Constants ¶
const BrowserVFSPathDefault = "computer://"
BrowserVFSPathDefault is the path for the 'drives panel'. Should be virtual.
const FakeError bool = false
FakeError should be enabled to prevent internet access by CCUpdaterUI.
Variables ¶
var InternetConnectionWarning bool = true
InternetConnectionWarning is true if the last GetRemotePackages() call actually resulted in error.
Functions ¶
func BrowserVFSLocationReal ¶
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 PackageIcon ¶
PackageIcon returns the relevant icon ID for a package.
func PackagePVIcon ¶
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 ¶
UpdaterConfig is the configuration structure for the application.
func ReadUpdaterConfig ¶
func ReadUpdaterConfig() UpdaterConfig
ReadUpdaterConfig returns the current configuration for the application.
type Warning ¶
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 )