Skip to content

Commit

Permalink
add scoreboard hide action
Browse files Browse the repository at this point in the history
  • Loading branch information
Himyu committed Nov 19, 2024
1 parent d9e946c commit 3f1c752
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
15 changes: 13 additions & 2 deletions controller/InGameState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class InGameState {
gameTime: 0,
currentPlayer: '',
showLeaderBoard: false,
scoreboard: true,
targetFrameCover: false,
towers: {
100: {
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions frontend/gfx/ingame.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
1 change: 1 addition & 0 deletions types/InGameState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface InGameState {
gameTime: number
currentPlayer: string
showLeaderBoard: 'xp' | 'gold' | false
scoreboard: boolean
targetFrameCover: boolean
towers: {
100: TowerState
Expand Down

0 comments on commit 3f1c752

Please sign in to comment.