forked from External/mage
Added user info text that user can set. Addd chat whisper command. Some minor changes to chat. Impoved display of user list.
This commit is contained in:
parent
e9dd478848
commit
c0323c168c
19 changed files with 522 additions and 356 deletions
|
|
@ -42,13 +42,18 @@ public class ChatMessage implements Serializable {
|
|||
private String message;
|
||||
private MessageColor color;
|
||||
private SoundToPlay soundToPlay;
|
||||
private MessageType messageType;
|
||||
|
||||
public enum MessageColor {
|
||||
BLACK, RED, GREEN, BLUE, ORANGE;
|
||||
BLACK, RED, GREEN, BLUE, ORANGE, YELLOW;
|
||||
}
|
||||
|
||||
public enum MessageType {
|
||||
USER_INFO, STATUS, GAME, TALK, WHISPER;
|
||||
}
|
||||
|
||||
public enum SoundToPlay {
|
||||
PlayerLeft, PlayerSubmittedDeck;
|
||||
PlayerLeft, PlayerSubmittedDeck, PlayerWhispered;
|
||||
}
|
||||
|
||||
public ChatMessage(String username, String message, String time, MessageColor color) {
|
||||
|
|
@ -56,10 +61,15 @@ public class ChatMessage implements Serializable {
|
|||
}
|
||||
|
||||
public ChatMessage(String username, String message, String time, MessageColor color, SoundToPlay soundToPlay) {
|
||||
this(username, message, time, color, MessageType.TALK, soundToPlay);
|
||||
}
|
||||
|
||||
public ChatMessage(String username, String message, String time, MessageColor color, MessageType messageType, SoundToPlay soundToPlay) {
|
||||
this.username = username;
|
||||
this.message = message;
|
||||
this.time = time;
|
||||
this.color = color;
|
||||
this.messageType = messageType;
|
||||
this.soundToPlay = soundToPlay;
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +82,7 @@ public class ChatMessage implements Serializable {
|
|||
}
|
||||
|
||||
public boolean isUserMessage() {
|
||||
return color != null && color.equals(MessageColor.BLUE);
|
||||
return color != null && (color.equals(MessageColor.BLUE) || color.equals(MessageColor.YELLOW));
|
||||
}
|
||||
|
||||
public boolean isStatusMessage() {
|
||||
|
|
@ -91,4 +101,8 @@ public class ChatMessage implements Serializable {
|
|||
return soundToPlay;
|
||||
}
|
||||
|
||||
public MessageType getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue