From a5d5aa28ee9b13df89b8b794df2110c01410f36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Gerrit=20G=C3=B6bel?= Date: Mon, 9 Sep 2024 10:02:27 +0200 Subject: [PATCH] Disable input during 3 second wait time --- src/app/terminals/bashbrawl/bashbrawlterminal.component.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/terminals/bashbrawl/bashbrawlterminal.component.ts b/src/app/terminals/bashbrawl/bashbrawlterminal.component.ts index 82d3790..440163a 100644 --- a/src/app/terminals/bashbrawl/bashbrawlterminal.component.ts +++ b/src/app/terminals/bashbrawl/bashbrawlterminal.component.ts @@ -65,7 +65,7 @@ export class BashbrawlterminalComponent implements OnInit, AfterViewInit { public mutationObserver: MutationObserver; private command = ''; - private commandFn: (command: string, params: string) => void = + private commandFn: (command: string, params: string) => Promise = this.menuCommandsFn; private inputFn: (command: string) => void = this.handleCommandWithNewline; private cursorPosition = 0; @@ -262,7 +262,7 @@ export class BashbrawlterminalComponent implements OnInit, AfterViewInit { async confirmBeginGameFn() { this.input_blocked = true; - this.beginGame(); + await this.beginGame(); } async beginGame() { @@ -377,7 +377,6 @@ export class BashbrawlterminalComponent implements OnInit, AfterViewInit { await this.writeDelayed('Enter your name:', true); this.terminalSymbol = 'Name:'; - this.term.write(` ${this.terminalSymbol} `); this.commandFn = this.enterNameForLeaderboard; this.input_blocked = false; @@ -750,7 +749,7 @@ export class BashbrawlterminalComponent implements OnInit, AfterViewInit { this.input_blocked = true; this.interrupted = false; - this.commandFn(command, params); + await this.commandFn(command, params); this.term.write(` ${this.terminalSymbol} `); this.interrupted = false;