mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-18 23:57:37 +01:00
23 lines
620 B
TypeScript
23 lines
620 B
TypeScript
export default class TextInterceptor {
|
|
private scene;
|
|
public logs = [];
|
|
constructor(scene) {
|
|
this.scene = scene;
|
|
scene.messageWrapper = this;
|
|
}
|
|
|
|
showText(text: string, delay?: integer, callback?: Function, callbackDelay?: integer, prompt?: boolean, promptDelay?: integer): void {
|
|
console.log(text);
|
|
this.logs.push(text);
|
|
}
|
|
|
|
showDialogue(text: string, name: string, delay?: integer, callback?: Function, callbackDelay?: integer, promptDelay?: integer): void {
|
|
console.log(name, text);
|
|
this.logs.push(name, text);
|
|
}
|
|
|
|
getLatestMessage(): string {
|
|
return this.logs.pop();
|
|
}
|
|
}
|