add setter for webworker

This commit is contained in:
Dank074 2021-05-05 17:17:44 -05:00
parent ae030d088f
commit e3465a1d6f
2 changed files with 7 additions and 0 deletions

View File

@ -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;

View File

@ -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;