From e3465a1d6fc8126ad11a86e76a6497e9dab46122 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 5 May 2021 17:17:44 -0500 Subject: [PATCH] add setter for webworker --- src/nitro/INitro.ts | 1 + src/nitro/Nitro.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/nitro/INitro.ts b/src/nitro/INitro.ts index 5f1009c1..6f61b6fe 100644 --- a/src/nitro/INitro.ts +++ b/src/nitro/INitro.ts @@ -27,6 +27,7 @@ export interface INitro extends Application addLinkEventTracker(tracker: ILinkEventTracker): void; removeLinkEventTracker(tracker: ILinkEventTracker): void; createLinkEvent(link: string): void; + setWorker(val: Worker): void; nitroTimer: NitroTimer; core: INitroCore; events: IEventDispatcher; diff --git a/src/nitro/Nitro.ts b/src/nitro/Nitro.ts index 84611413..4f8fa875 100644 --- a/src/nitro/Nitro.ts +++ b/src/nitro/Nitro.ts @@ -335,6 +335,12 @@ export class Nitro extends Application implements INitro HabboWebTools.sendHeartBeat(); } + public setWorker(val: Worker): void + { + this._worker = val; + this._worker.onmessage = this.createWorkerEvent.bind(this); + } + public get nitroTimer(): NitroTimer { return this._nitroTimer;