X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fboard.js;h=e786e899fda24261165f68c67c2c1f1289cf522b;hp=4cadb0bd9ba75d68e8d2950aa302c3763564e301;hb=8d7e2786f5a67a1b9a77c742d7951e0efbe8747d;hpb=7192f4711467ae73a0f813189f8a4d8cca252bf1 diff --git a/public/javascripts/components/board.js b/public/javascripts/components/board.js index 4cadb0bd..e786e899 100644 --- a/public/javascripts/components/board.js +++ b/public/javascripts/components/board.js @@ -57,7 +57,7 @@ ); // Create board element (+ reserves if needed by variant or mode) const lm = this.vr.lastMove; - const showLight = this.hints && variant!="Dark" && + const showLight = this.hints && variant.name!="Dark" && (this.mode != "idle" || (this.vr.moves.length > 0 && this.cursor==this.vr.moves.length)); const gameDiv = h('div', @@ -80,7 +80,7 @@ _.range(sizeY).map(j => { let cj = (this.mycolor=='w' ? j : sizeY-j-1); let elems = []; - if (this.vr.board[ci][cj] != VariantRules.EMPTY && (variant!="Dark" + if (this.vr.board[ci][cj] != VariantRules.EMPTY && (variant.name!="Dark" || this.score!="*" || this.vr.enlightened[this.mycolor][ci][cj])) { elems.push( @@ -125,7 +125,7 @@ 'light-square': (i+j)%2==0, 'dark-square': (i+j)%2==1, [this.bcolor]: true, - 'in-shadow': variant=="Dark" && this.score=="*" + 'in-shadow': variant.name=="Dark" && this.score=="*" && !this.vr.enlightened[this.mycolor][ci][cj], 'highlight': showLight && !!lm && _.isMatch(lm.end, {x:ci,y:cj}), 'incheck': showLight && incheckSq[ci][cj],