mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-05-28 10:21:18 +00:00
Use more dynamic API version rules for checking mod versions.
This commit is contained in:
parent
e321861b9f
commit
f1c1e63375
|
@ -27,11 +27,18 @@ import polymod.Polymod;
|
|||
class PolymodHandler
|
||||
{
|
||||
/**
|
||||
* The API version that mods should comply with.
|
||||
* Indicates which mods are compatible with this version of the game.
|
||||
* The API version for the current version of the game. Since 0.5.0, we've just made this the game version!
|
||||
* Minor updates rarely impact mods but major versions often do.
|
||||
*/
|
||||
static final API_VERSION:String = "0.5.0"; // Constants.VERSION;
|
||||
// static final API_VERSION:String = Constants.VERSION;
|
||||
|
||||
/**
|
||||
* The Semantic Versioning rule
|
||||
* Indicates which mods are compatible with this version of the game.
|
||||
* Using more complex rules allows mods from older compatible versions to stay functioning,
|
||||
* while preventing mods made for future versions from being installed.
|
||||
*/
|
||||
static final API_VERSION_RULE:String = ">=0.5.0 <0.6.0";
|
||||
|
||||
/**
|
||||
* Where relative to the executable that mods are located.
|
||||
|
@ -131,7 +138,7 @@ class PolymodHandler
|
|||
// Framework being used to load assets.
|
||||
framework: OPENFL,
|
||||
// The current version of our API.
|
||||
apiVersionRule: API_VERSION,
|
||||
apiVersionRule: API_VERSION_RULE,
|
||||
// Call this function any time an error occurs.
|
||||
errorCallback: PolymodErrorHandler.onPolymodError,
|
||||
// Enforce semantic version patterns for each mod.
|
||||
|
@ -338,7 +345,7 @@ class PolymodHandler
|
|||
var modMetadata:Array<ModMetadata> = Polymod.scan(
|
||||
{
|
||||
modRoot: MOD_FOLDER,
|
||||
apiVersionRule: API_VERSION,
|
||||
apiVersionRule: API_VERSION_RULE,
|
||||
fileSystem: modFileSystem,
|
||||
errorCallback: PolymodErrorHandler.onPolymodError
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue