Handling edge cases: Early champs described their abilities by name not key.

master
Cristiano Pires 1 year ago
parent 58009675a7
commit 3165832504

@ -12,4 +12,6 @@ exports.getC = (io)=>
{
res.render('champion');
}
}
}

@ -49,6 +49,7 @@ window.onload = ()=>
.catch(error=>{return error})
.then(champ=>
{
console.log(champ)
champCache = champ;
elements.name.textContent = champ.name;
elements.title.textContent = champ.title;
@ -119,6 +120,7 @@ function ability()
var element = this;
document.getElementsByClassName('active')[0].classList.remove('active');
element.classList.add('active');
console.log(element)
if(element.id=='P')
{
console.log(champCache.passive)
@ -134,6 +136,25 @@ function ability()
elements.description.textContent =getClearDescriptionText(spell.description);
}
}
let count = 0;
for(spell of champCache.spells)
{
if(spell.id.indexOf(champName)==-1) count ++;
}
if(count>=0)
{
var aux = element.style.backgroundImage.split('.')
var aux2 = aux[aux.length-2].split('/');
var skillImageName = aux2[aux2.length-1]
for(var spell of champCache.spells)
{
if(spell.id==skillImageName)
{
elements.spellName.textContent = spell.name;
elements.description.textContent = getClearDescriptionText(spell.description);
}
}
}
}

Loading…
Cancel
Save