Update ipas plugin to pass shield info

This commit is contained in:
Peter Dietrich 2013-04-20 00:28:15 +02:00
parent f56f802d2c
commit d9f968a4bb

View File

@ -36,10 +36,28 @@ window.plugin.ipasLink.getHash = function(d) {
if (reso) { if (reso) {
hashParts.push(reso.level + "," + reso.distanceToPortal + "," + reso.energyTotal); hashParts.push(reso.level + "," + reso.distanceToPortal + "," + reso.energyTotal);
} else { } else {
hashParts.push(1 + "," + 35 + "," + 0); // Dummy values, the only important one is energy=0 hashParts.push("1,20,0");
} }
}); });
return hashParts.join(";")+"|" + "0,0,0,0"; //shields not implemented yet var resos = hashParts.join(";");
hashParts = [];
$.each(d.portalV2.linkedModArray, function (ind, mod) {
//shields only, so far...
var s = "0";
if (mod) {
if (mod.type === "RES_SHIELD") {
s = mod.rarity.charAt(0).toLowerCase();
}
}
hashParts.push(s);
});
var shields = hashParts.join(",");
return resos + "|" + shields;
}
var setup = function () {
window.plugin.ipasLink.setupCallback();
} }
var setup = function() { var setup = function() {