emoji icons show above players (just fire emoji for now)

This commit is contained in:
evanpelle
2024-10-04 13:46:07 -07:00
parent e795b22220
commit f4a074a3fb
4 changed files with 38 additions and 21 deletions
+4 -2
View File
@@ -219,10 +219,12 @@ export class PlayerImpl implements MutablePlayer {
}
outgoingEmojis(): EmojiMessage[] {
return null
return this.outgoingEmojis_
.filter(e => this.gs.ticks() - e.createdAt < this.gs.config().emojiMessageDuration())
.sort((a, b) => b.createdAt - a.createdAt)
}
canSendEmoji(recipient: Player | null): boolean {
canSendEmoji(recipient: Player | typeof AllPlayers): boolean {
const prevMsgs = this.outgoingEmojis_.filter(msg => msg.recipient == recipient)
for (const msg of prevMsgs) {
if (this.gs.ticks() - msg.createdAt < this.gs.config().emojiMessageCooldown()) {