diff --git a/controller/InGameState.ts b/controller/InGameState.ts index fff96f1..7998d73 100644 --- a/controller/InGameState.ts +++ b/controller/InGameState.ts @@ -30,6 +30,7 @@ export class InGameState { gameTime: 0, currentPlayer: '', showLeaderBoard: false, + scoreboard: true, targetFrameCover: false, towers: { 100: { @@ -235,12 +236,22 @@ export class InGameState { } }) } + } - return + if (replayData.interfaceScoreboard !== this.gameState.scoreboard) { + this.gameState.scoreboard = replayData.interfaceScoreboard + this.ctx.LPTE.emit({ + meta: { + namespace: this.namespace, + type: 'player-cams-lol', + version: 1 + }, + visibilty: replayData.interfaceScoreboard + }) } setTimeout(() => { - if (replayData.selectionName === this.gameState.currentPlayer) { + if (replayData.selectionName === this.gameState.currentPlayer && this.gameState.currentPlayer !== '') { if (this.config.autoTargetFrameCover && this.gameState.targetFrameCover) { this.gameState.targetFrameCover = false diff --git a/frontend/gfx/ingame.js b/frontend/gfx/ingame.js index 9f200f6..4ea4787 100644 --- a/frontend/gfx/ingame.js +++ b/frontend/gfx/ingame.js @@ -1051,10 +1051,12 @@ LPTE.onready(async () => { platingDiv.classList.add('hide') }) LPTE.on('module-league-in-game', 'show-target-frame-cover', () => { + if (!targetFrameCover.classList.contains('hide')) return targetFrameCover.classList.remove('hide') targetFrameCoolDown = Date.now() + (1000 * 5) }) LPTE.on('module-league-in-game', 'hide-target-frame-cover', () => { + if (targetFrameCover.classList.contains('hide')) return const cd = targetFrameCoolDown - Date.now() setTimeout(() => { diff --git a/types/InGameState.ts b/types/InGameState.ts index 24ffb18..d9d0c74 100644 --- a/types/InGameState.ts +++ b/types/InGameState.ts @@ -4,6 +4,7 @@ export interface InGameState { gameTime: number currentPlayer: string showLeaderBoard: 'xp' | 'gold' | false + scoreboard: boolean targetFrameCover: boolean towers: { 100: TowerState