mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-29 18:50:51 +01:00
Merge branch 'oobjectt-notifications-simple-alert'
This commit is contained in:
commit
c80403354e
File diff suppressed because one or more lines are too long
@ -122,6 +122,7 @@ export class IncomingHeader
|
||||
public static CONVERTED_ROOM_ID = 1331;
|
||||
public static GUEST_ROOM_SEARCH_RESULT = 52;
|
||||
public static NOTIFICATION_LIST = 1992;
|
||||
public static NOTIFICATION_SIMPLE_ALERT = 5100;
|
||||
public static PET_FIGURE_UPDATE = 1924;
|
||||
public static PET_INFO = 2901;
|
||||
public static PET_TRAINING_PANEL = 1164;
|
||||
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../api';
|
||||
import { MessageEvent } from '../../../../../events';
|
||||
import { SimpleAlertMessageParser } from '../../parser';
|
||||
|
||||
export class SimpleAlertMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, SimpleAlertMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): SimpleAlertMessageParser
|
||||
{
|
||||
return this.parser as SimpleAlertMessageParser;
|
||||
}
|
||||
}
|
@ -10,4 +10,5 @@ export * from './MOTDNotificationEvent';
|
||||
export * from './NotificationDialogMessageEvent';
|
||||
export * from './PetLevelNotificationEvent';
|
||||
export * from './PetPlacingErrorEvent';
|
||||
export * from './SimpleAlertMessageEvent';
|
||||
export * from './UnseenItemsEvent';
|
||||
|
@ -0,0 +1,37 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
|
||||
|
||||
export class SimpleAlertMessageParser implements IMessageParser
|
||||
{
|
||||
private _alertMessage: string;
|
||||
private _titleMessage: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._alertMessage = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._alertMessage = wrapper.readString();
|
||||
|
||||
if(wrapper.bytesAvailable)
|
||||
{
|
||||
this._titleMessage = wrapper.readString();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get alertMessage(): string
|
||||
{
|
||||
return this._alertMessage;
|
||||
}
|
||||
|
||||
public get titleMessage(): string
|
||||
{
|
||||
return this._titleMessage;
|
||||
}
|
||||
}
|
@ -11,4 +11,5 @@ export * from './MOTDNotificationParser';
|
||||
export * from './NotificationDialogMessageParser';
|
||||
export * from './PetLevelNotificationParser';
|
||||
export * from './PetPlacingErrorEventParser';
|
||||
export * from './SimpleAlertMessageParser';
|
||||
export * from './UnseenItemsParser';
|
||||
|
Loading…
Reference in New Issue
Block a user