Added Color to the Renderer and Avatar update

This commit is contained in:
duckietm
2024-04-04 09:26:05 +02:00
parent 187622429f
commit 95bc0045ec
11 changed files with 92 additions and 51 deletions
@@ -4,9 +4,9 @@ export class RoomUnitChatComposer implements IMessageComposer<ConstructorParamet
{
private _data: ConstructorParameters<typeof RoomUnitChatComposer>;
constructor(message: string, styleId: number = 0)
constructor(message: string, styleId: number = 0, chatColour: string = '')
{
this._data = [message, styleId];
this._data = [message, styleId, chatColour];
}
public getMessageArray()
@@ -4,9 +4,9 @@ export class RoomUnitChatShoutComposer implements IMessageComposer<ConstructorPa
{
private _data: ConstructorParameters<typeof RoomUnitChatShoutComposer>;
constructor(message: string, styleId: number)
constructor(message: string, styleId: number, chatColour: string)
{
this._data = [message, styleId];
this._data = [message, styleId, chatColour];
}
public getMessageArray()
@@ -7,6 +7,7 @@ export class RoomUnitChatParser implements IMessageParser
private _gesture: number;
private _bubble: number;
private _urls: string[];
private _chatColours: string;
private _messageLength: number;
public flush(): boolean
@@ -16,6 +17,7 @@ export class RoomUnitChatParser implements IMessageParser
this._gesture = 0;
this._bubble = 0;
this._urls = [];
this._chatColours = null;
this._messageLength = 0;
return true;
@@ -31,7 +33,8 @@ export class RoomUnitChatParser implements IMessageParser
this._bubble = wrapper.readInt();
this.parseUrls(wrapper);
this._chatColours = wrapper.readString();
this._messageLength = wrapper.readInt();
return true;
@@ -79,6 +82,11 @@ export class RoomUnitChatParser implements IMessageParser
{
return this._urls;
}
public get chatColours(): string
{
return this._chatColours;
}
public get messageLength(): number
{