Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Downloads

nickelc edited this page Oct 25, 2019 · 29 revisions

downloadMod

void Instance::downloadMod(u32 mod_id)

Adds the corresponding mod to download queue to be downloaded locally. Once downloaded it will trigger the download listener that can be set by calling the setDownloadListener function, mods will be installed automatically on startup when calling modio_instance.init() or by manually calling installDownloadedMods.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.

Example

modio_instance.downloadMod(mod_id);

installDownloadedMods

void Instance::installDownloadedMods()

Extracts and installs all mods downloaded either by automatic installs or by calling downloadMod.

Example

modio_instance.installDownloadedMods();

uninstallMod

void Instance::uninstallMod(u32 mod_id)

Removes the corresponding mod from the local storage.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.

Example

modio_instance.uninstallMod(mod_id);

pauseDownloads

void Instance::pauseDownloads()

Pauses the current downloads. The state of the download queue is stored to it can be continued even after the mod.io SDK is shutdown.

Example

modio_instance.pauseDownloads();

resumeDownloads

void Instance::resumeDownloads()

Resumes the downloads after a pause.

Example

modio_instance.resumeDownloads();

prioritizeModDownload

void Instance::prioritizeModDownload(u32 mod_id)

Puts the corresponding mod download to the front of the download queue.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.

Example

modio_instance.prioritizeModDownload(mod_id);

setDownloadListener

void Instance::setDownloadListener(const std::function<void(u32 response_code, u32 mod_id)> &callback);

Registers a function to be called every time a mod finished downloading.

Function parameters

Name Type Description
callback const std::function<void(u32 response_code, u32 mod_id)>& Function to be called every time a mod finished downloading.

Callback parameters

Name Type Description
response_code u32 Response code from mod.io backend. See Response Codes.
mod_id u32 Id of the mod that was just downloaded.

Example

modio_instance.setDownloadListener([&](u32 response_code, u32 mod_id) {
  if (response_code == 200)
  {
    //Mod successfully downloaded
  }
});

getModDownloadQueue

std::list<QueuedModDownload*> Instance::getModDownloadQueue();

Returns a std::list of modio::QueuedModDownload objects which represents the mods that are currently queued to be downloaded.

Example

std::list<modio::QueuedModDownload *> mod_download_queue = modio_instance.getModDownloadQueue();

getInstalledMod

modio::InstalledMod Instance::getInstalledMod(u32 mod_id);

Returns a modio::InstalledMod object which represents a mod installed locally.

Example

modio::InstalledMod installed_mod = modio_instance.getInstalledMod(mod_id);

getAllInstalledMods

std::vector<modio::InstalledMod> Instance::getAllInstalledMods();

Returns a std::vector of modio::InstalledMod objects which represents the mods that are locally installed.

Example

std::vector<modio::InstalledMod> installed_mods = modio_instance.getAllInstalledMods();

getAllDownloadedMods

std::vector<u32> Instance::getAllDownloadedMods();

Returns a std::vector of ids of mods that are downloaded locally but are still not extracted and installed. To install them use the installDownloadedMods.

Example

std::vector<int> downloaded_mods = modio_instance.getAllDownloadedMods();

getModState

u32 Instance::getModState(u32 mod_id);

Returns the state of the corresponding mod, see Mod states.

Example

u32 mod_state = modio_instance.getModState(mod_id);

Contents

Clone this wiki locally