From 6e2106edd8b99a3ec3eaa4f2ee78fa6fdf8509f6 Mon Sep 17 00:00:00 2001 From: elexis Date: Sun, 12 Jun 2016 13:54:00 +0000 Subject: [PATCH] Fix whitespace, refs #3000. This was SVN commit r18365. --- binaries/data/mods/public/gui/session/session.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/binaries/data/mods/public/gui/session/session.js b/binaries/data/mods/public/gui/session/session.js index 585800b601..9fd4637024 100644 --- a/binaries/data/mods/public/gui/session/session.js +++ b/binaries/data/mods/public/gui/session/session.js @@ -327,8 +327,7 @@ function initGUIHeroes(slot) { let button = Engine.GetGUIObjectByName("unitHeroButton[" + slot + "]"); - button.onPress = function() - { + button.onPress = function() { let hero = g_Heroes.find(hero => hero.slot !== undefined && hero.slot == slot); if (!hero) return; @@ -835,7 +834,7 @@ function updateHeroes() let playerState = GetSimState().players[g_ViewedPlayer]; let heroes = playerState ? playerState.heroes : []; - g_Heroes = g_Heroes.filter(hero => heroes.find(ent => ent == hero.ent)); + g_Heroes = g_Heroes.filter(hero => heroes.find(ent => ent == hero.ent)); for (let ent of heroes) { @@ -888,14 +887,13 @@ function displayHeroes() { let buttons = Engine.GetGUIObjectByName("unitHeroPanel").children; - buttons.forEach((button, slot) => - { + buttons.forEach((button, slot) => { + if (button.hidden || g_Heroes.some(hero => hero.slot !== undefined && hero.slot == slot)) return; button.hidden = true; stopColorFade("heroHitOverlay[" + slot + "]"); - }); // The slot identifies the button, displayIndex determines its position.