Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/mod/gui/modmod/modmod.js
Show First 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | function isDependencyMet(dependency) | ||||
let operator = dependency.match(g_RegExpComparisonOperator); | let operator = dependency.match(g_RegExpComparisonOperator); | ||||
let [name, version] = operator ? dependency.split(operator[0]) : [dependency, undefined]; | let [name, version] = operator ? dependency.split(operator[0]) : [dependency, undefined]; | ||||
return g_ModsEnabled.some(folder => | return g_ModsEnabled.some(folder => | ||||
g_Mods[folder].name == name && | g_Mods[folder].name == name && | ||||
(!operator || versionSatisfied(g_Mods[folder].version, operator[0], version))); | (!operator || versionSatisfied(g_Mods[folder].version, operator[0], version))); | ||||
} | } | ||||
function modIo() | |||||
{ | |||||
messageBox(500, 250, | |||||
translate("You are about to connect to the mod.io online service. This provides easy access to community-made mods, but is not under the control of Wildfire Games.\n\nWhile we have taken care to make this secure, we cannot guarantee with absolute certainty that this is not a security risk.\n\nDo you really want to connect?"), | |||||
translate("Connect to mod.io?"), | |||||
[translate("Cancel"), translateWithContext("mod.io connection message box", "Connect")], | |||||
[ | |||||
null, | |||||
() => { | |||||
Engine.PushGuiPage("page_modio.xml", { | |||||
"callback": "initMods" | |||||
}); | |||||
} | |||||
] | |||||
); | |||||
} | |||||
/** | /** | ||||
* Compares the given versions using the given operator. | * Compares the given versions using the given operator. | ||||
* '-' or '_' is ignored. Only numbers are supported. | * '-' or '_' is ignored. Only numbers are supported. | ||||
* @note "5.3" < "5.3.0" | * @note "5.3" < "5.3.0" | ||||
*/ | */ | ||||
function versionSatisfied(version1, operator, version2) | function versionSatisfied(version1, operator, version2) | ||||
{ | { | ||||
let versionList1 = version1.split(/[-_]/)[0].split(/\./g); | let versionList1 = version1.split(/[-_]/)[0].split(/\./g); | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator