small bug fix + resetting armor powder slider now resets label text

This commit is contained in:
ferricles 2022-05-13 22:35:31 -07:00
parent 2c8bc4785e
commit e465d5e5a3
3 changed files with 14 additions and 2 deletions

View file

@ -693,7 +693,7 @@ function updateArmorPowderSpecials(elem_id, recalc_stats) {
}
if (recalc_stats) {
if (recalc_stats && player_build) {
//calc build stats and display powder special
calculateBuildStats();
// displaysq2PowderSpecials(document.getElementById("powder-special-stats"), powderSpecials, player_build, true);
@ -706,7 +706,7 @@ function resetArmorPowderSpecials() {
document.getElementById(skp + "_boost_armor").value = 0;
document.getElementById(skp + "_boost_armor_prev").value = 0;
document.getElementById(skp + "_boost_armor").style.background = `linear-gradient(to right, #AAAAAA, #AAAAAA 0%, #AAAAAA 100%)`;
document.getElementById(skp + "_boost_armor_label").textContent = `% ${capitalizeFirst(elem_names[skpnames.indexOf(skp)])} Damage Boost: 0`
}
}

View file

@ -30,6 +30,14 @@ let elem_chars = [
'a'
]
let elem_names = [
'earth',
'thunder',
'water',
'fire',
'air'
]
let elem_colors = [
"#00AA00",
"#FFFF55",

View file

@ -409,3 +409,7 @@ async function hardReload() {
location.reload(true);
}
function capitalizeFirst(str) {
return str.charAt(0).toUpperCase + str.slice(1);
}