Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/Mod.h
Show All 16 Lines | |||||
#ifndef INCLUDED_MOD | #ifndef INCLUDED_MOD | ||||
#define INCLUDED_MOD | #define INCLUDED_MOD | ||||
#include "ps/CStr.h" | #include "ps/CStr.h" | ||||
#include "ps/GameSetup/CmdLineArgs.h" | #include "ps/GameSetup/CmdLineArgs.h" | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
class ScriptRuntime; | |||||
extern std::vector<CStr> g_modsLoaded; | extern std::vector<CStr> g_modsLoaded; | ||||
extern CmdLineArgs g_args; | extern CmdLineArgs g_args; | ||||
namespace Mod | namespace Mod | ||||
{ | { | ||||
JS::Value GetAvailableMods(const ScriptInterface& scriptInterface); | JS::Value GetAvailableMods(const ScriptInterface& scriptInterface); | ||||
/** | /** | ||||
* This reads the version numbers from the launched mods. | |||||
* It caches the result, since the reading of zip files is slow and | |||||
* JS pages can request the version numbers too often easily. | |||||
* Make sure this is called after each MountMods call. | |||||
*/ | |||||
void CacheEnabledModVersions(const shared_ptr<ScriptRuntime>& scriptRuntime); | |||||
/** | |||||
* Get the loaded mods and their version. | * Get the loaded mods and their version. | ||||
* "user" mod and "mod" mod are ignored as they are irrelevant for compatibility checks. | * "user" mod and "mod" mod are ignored as they are irrelevant for compatibility checks. | ||||
* | * | ||||
* @param scriptInterface the ScriptInterface in which to create the return data. | * @param scriptInterface the ScriptInterface in which to create the return data. | ||||
* @return list of loaded mods with the format [[modA, versionA], [modB, versionB], ...] | * @return list of loaded mods with the format [[modA, versionA], [modB, versionB], ...] | ||||
*/ | */ | ||||
JS::Value GetLoadedModsWithVersions(const ScriptInterface& scriptInterface); | JS::Value GetLoadedModsWithVersions(const ScriptInterface& scriptInterface); | ||||
Show All 9 Lines |
Wildfire Games · Phabricator