silent indicator when on jitsi zone
This commit is contained in:
@@ -7,14 +7,11 @@ export class PlayerStatusDot extends Phaser.GameObjects.Container {
|
||||
|
||||
private status: AvailabilityStatus;
|
||||
|
||||
private readonly COLORS = {
|
||||
online: 0x8cc43f,
|
||||
onlineOutline: 0x427a25,
|
||||
away: 0xf5931e,
|
||||
awayOutline: 0x875d13,
|
||||
silenced: 0xe74c3c,
|
||||
silencedOutline: 0xc0392b,
|
||||
never: 0xff00ff,
|
||||
private readonly COLORS: Record<AvailabilityStatus, { filling: number; outline: number }> = {
|
||||
[AvailabilityStatus.AWAY]: { filling: 0xf5931e, outline: 0x875d13 },
|
||||
[AvailabilityStatus.ONLINE]: { filling: 0x8cc43f, outline: 0x427a25 },
|
||||
[AvailabilityStatus.SILENT]: { filling: 0xe74c3c, outline: 0xc0392b },
|
||||
[AvailabilityStatus.UNRECOGNIZED]: { filling: 0xffffff, outline: 0xffffff },
|
||||
};
|
||||
|
||||
constructor(scene: Phaser.Scene, x: number, y: number) {
|
||||
@@ -62,21 +59,8 @@ export class PlayerStatusDot extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
private redraw(): void {
|
||||
const colors = this.getColors();
|
||||
const colors = this.COLORS[this.status];
|
||||
this.statusImage.setTintFill(colors.filling);
|
||||
this.statusImageOutline.setTintFill(colors.outline);
|
||||
}
|
||||
|
||||
private getColors(): { filling: number; outline: number } {
|
||||
switch (this.status) {
|
||||
case AvailabilityStatus.ONLINE:
|
||||
return { filling: this.COLORS.online, outline: this.COLORS.onlineOutline };
|
||||
case AvailabilityStatus.AWAY:
|
||||
return { filling: this.COLORS.away, outline: this.COLORS.awayOutline };
|
||||
case AvailabilityStatus.SILENT:
|
||||
return { filling: this.COLORS.silenced, outline: this.COLORS.silencedOutline };
|
||||
default:
|
||||
return { filling: this.COLORS.never, outline: this.COLORS.never };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user