Plants vs. Zombies: Replanted - v1.0.3
    Preparing search index...

    Interface IGameStore

    interface for game store extensions

    IGameStore

    interface IGameStore {
        allGames: () => Bluebird<IGameStoreEntry[]>;
        findByAppId: (appId: string | string[]) => Bluebird<IGameStoreEntry>;
        findByName: (appName: string) => Bluebird<IGameStoreEntry>;
        getExecInfo?: (appId: any) => Bluebird<IExecInfo>;
        getGameStorePath: () => Bluebird<string>;
        getPosixPath?: (name: string) => Bluebird<string>;
        id: string;
        identifyGame?: (
            gamePath: string,
            fallback: (gamePath: string) => PromiseLike<boolean>,
        ) => Bluebird<boolean>;
        isGameInstalled?: (name: string) => Bluebird<boolean>;
        isGameStoreInstalled?: () => Bluebird<boolean>;
        launchGame: (appId: any, api?: IExtensionApi) => Bluebird<void>;
        launchGameStore?: (
            api: IExtensionApi,
            parameters?: string[],
        ) => Bluebird<void>;
        name?: string;
        priority?: number;
        reloadGames?: () => Bluebird<void>;
    }
    Index

    Properties

    allGames: () => Bluebird<IGameStoreEntry[]>

    Returns all recognized/installed games which are currently installed with this game store/launcher. Please note that the game entries should be cached to avoid running a potentially resource intensive operation for each game the user attempts to manage.

    findByAppId: (appId: string | string[]) => Bluebird<IGameStoreEntry>

    Attempt to find a game entry using its game store Id/Ids.

    Type Declaration

    findByName: (appName: string) => Bluebird<IGameStoreEntry>

    Attempt to find a game store entry using the game's name.

    Type Declaration

    getExecInfo?: (appId: any) => Bluebird<IExecInfo>

    Game store may support command line arguments when launching the game. Function will return the path to the game store's executable and any required arguments to launch the game.

    Type Declaration

    getGameStorePath: () => Bluebird<string>

    Returns the full path to the launcher's executable. As of 1.4, this function is no longer optional - gamestores such as the Xbox app which do not have a stat-able store path should return Promise.resolve(undefined) and define the "isGameStoreInstalled" function so that the game store helper is able to confirm that the gamestore is installed on the user's PC

    getPosixPath?: (name: string) => Bluebird<string>

    Some launchers may support Posix paths when attempting to launch a game, if set, the launcher will be expected to generate a valid posix path which Vortex can use to start the game.

    Please note that Vortex will not be able to tell if the game actually launched successfully when using Posix Paths; reason why this should only be used as a last resort.

    Type Declaration

      • (name: string): Bluebird<string>
      • Parameters

        • name: string

          of the game we want the posix path for.

        Returns Bluebird<string>

    id: string

    This store's id.

    identifyGame?: (
        gamePath: string,
        fallback: (gamePath: string) => PromiseLike<boolean>,
    ) => Bluebird<boolean>

    determine if the specified game is managed by/installed through this store. Stores don't have to implement this, as a fallback Vortex will go through allGames from this store and see if one matches the path. This function should only be implemented if there is a more reliable way to connect this store to the game, like every gog game contains a gog.ico file in the game root directory. The fallback function can be used to invoke the "default" behavior on top.

    isGameInstalled?: (name: string) => Bluebird<boolean>

    Determine whether the game has been installed by this game store launcher. returns true if the game store installed this game, false otherwise.

    Type Declaration

      • (name: string): Bluebird<boolean>
      • Parameters

        • name: string

          of the game we're looking for.

        Returns Bluebird<boolean>

    isGameStoreInstalled?: () => Bluebird<boolean>

    In most cases the game store helper is fully capable of determining whether a gamestore is installed by stat-ing the store's executable.

    However, gamestores such as the Xbox store which do not have a stat-able executable path MUST provide this function so that the game store helper can confirm that the store is installed correctly!

    launchGame: (appId: any, api?: IExtensionApi) => Bluebird<void>

    Launches the game using this game launcher.

    Type Declaration

    launchGameStore?: (api: IExtensionApi, parameters?: string[]) => Bluebird<void>

    Generally the game store helper should be able to launch games directly. This functor allows game stores to define their own custom start up logic if needed. e.g. gamestore-xbox

    name?: string

    This store's name. If unset, will use the id instead of the name when displaying to users

    priority?: number

    If a game is found on multiple stores, this controls which store is preferred (by default) (lower means preferred) This should be solely based on which store tends to be less problematic for modding (stuff like DRM and such), not a subjective preference of the store.

    Values <= 30 are for stores that have features benefiting modding (no DRM GOG) Values >= 70 are for stores that have features hindering modding (extra DRM Xbox) Values between should all be ok, we only assign different values so the order is deterministic and because some stores provide better meta information than others or have more robust information

    reloadGames?: () => Bluebird<void>

    Allows game stores to provide functionality to reload/refresh their game entries. This is potentially a resource intensive operation and should not be called unless it is vital to do so.

    The game store helper is configured to call this function for all known game stores when a discovery scan is initiated.