forked from External/mage
Fixed local server time in client's chat messages
This commit is contained in:
parent
bc3274b144
commit
ccd121277a
5 changed files with 23 additions and 17 deletions
|
|
@ -37,6 +37,8 @@ import java.awt.Color;
|
|||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
|
@ -55,6 +57,11 @@ import org.mage.card.arcane.ManaSymbols;
|
|||
*/
|
||||
public class ChatPanelBasic extends javax.swing.JPanel {
|
||||
|
||||
/**
|
||||
* Time formatter
|
||||
*/
|
||||
protected final DateFormat timeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT);
|
||||
|
||||
protected UUID chatId;
|
||||
/**
|
||||
* Chat message color for opponents.
|
||||
|
|
@ -238,10 +245,10 @@ public class ChatPanelBasic extends javax.swing.JPanel {
|
|||
*/
|
||||
Pattern cardNamePattern = Pattern.compile(".*<font bgcolor=orange.*?</font>.*");
|
||||
|
||||
public void receiveMessage(String username, String message, String time, MessageType messageType, MessageColor color) {
|
||||
public void receiveMessage(String username, String message, Date time, MessageType messageType, MessageColor color) {
|
||||
StringBuilder text = new StringBuilder();
|
||||
if (time != null) {
|
||||
text.append(getColoredText(TIMESTAMP_COLOR, time + ": "));
|
||||
text.append(getColoredText(TIMESTAMP_COLOR, timeFormatter.format(time) + ": "));
|
||||
//this.txtConversation.append(TIMESTAMP_COLOR, time + " ");
|
||||
}
|
||||
String userColor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue