Show resonator status (level/energy) of selected portal in status bar on smartphones

This commit is contained in:
fkloft
2013-07-13 00:14:02 +02:00
parent 5bf8eb7333
commit 39ce9102e8
2 changed files with 47 additions and 0 deletions

View File

@ -83,6 +83,28 @@ window.smartphoneInfo = function(data) {
t += ' ' + percentage + ' ';
t += d.portalV2.descriptiveText.TITLE;
var l,v,max,perc;
for(var i=0;i<8;i++)
{
var reso = d.resonatorArray.resonators[i];
if(reso) {
l = parseInt(reso.level);
v = parseInt(reso.energyTotal);
max = RESO_NRG[l];
perc = v/max*100;
}
else {
l = 0;
v = 0;
max = 0;
perc = 0;
}
t += '<div class="resonator '+TEAM_TO_CSS[getTeam(d)]+'" style="border-top-color: '+COLORS_LVL[l]+';left: '+(100*i/8.0)+'%;">';
t += '<div class="filllevel" style="width:'+perc+'%;"></div>';
t += '</div>'
}
$('#mobileinfo').html(t);
}