mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-23 08:00:51 +01:00
Make SetActivatedBadgesComposer dynamic
This commit is contained in:
parent
d3e7356b4b
commit
23d2822fa0
@ -7,22 +7,21 @@ export class SetActivatedBadgesComposer implements IMessageComposer<any[]>
|
|||||||
public getMessageArray()
|
public getMessageArray()
|
||||||
{
|
{
|
||||||
const data = [];
|
const data = [];
|
||||||
let local2 = 1;
|
|
||||||
while(local2 <= 5)
|
for(let i = 0; i < this._badges.length; i++)
|
||||||
{
|
{
|
||||||
if(local2 <= this._badges.length)
|
if(i <= this._badges.length)
|
||||||
{
|
{
|
||||||
data.push(local2);
|
data.push(i + 1);
|
||||||
data.push(this._badges[(local2 - 1)]);
|
data.push(this._badges[i]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data.push(local2);
|
data.push(i + 1);
|
||||||
data.push('');
|
data.push('');
|
||||||
}
|
}
|
||||||
|
|
||||||
local2++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,8 +32,6 @@ export class SetActivatedBadgesComposer implements IMessageComposer<any[]>
|
|||||||
|
|
||||||
public addActivatedBadge(badge: string): void
|
public addActivatedBadge(badge: string): void
|
||||||
{
|
{
|
||||||
if(this._badges.length >= 5) return;
|
|
||||||
|
|
||||||
this._badges.push(badge);
|
this._badges.push(badge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user