Changed color of frame of avatar for active player to green again. Checked that a player of a game can't also watch his own game. Added a match score to the start of the game log. Changed the color of the Turn [X] message. Tips and join messages during a game are displayed in the chat panel instead the game log panel. Display of the player name when hovering over the avatar is more vertical centered.

This commit is contained in:
LevelX2 2013-04-07 21:29:27 +02:00
parent 20a99ed894
commit f644ffe041
16 changed files with 100 additions and 22 deletions

View file

@ -24,6 +24,7 @@ public class HoverButton extends JPanel implements MouseListener {
private Rectangle buttonSize;
private String text;
private int textOffsetY = 0;
private int textOffsetButtonY = 2;
private int textOffsetX = -1;
private Dimension overlayImageSize;
@ -187,17 +188,21 @@ public class HoverButton extends JPanel implements MouseListener {
@Override
public void setBounds(Rectangle r) {
super.setBounds(r);
this.textOffsetY = r.height - 2;
this.textOffsetY = r.height - this.textOffsetButtonY;
this.buttonSize = r;
}
@Override
public void setBounds(int x, int y, int width, int height) {
super.setBounds(x, y, width, height);
this.textOffsetY = height - 2;
this.textOffsetY = height - this.textOffsetButtonY;
this.buttonSize = new Rectangle(x, y, width, height);
}
public void setTextOffsetButtonY(int textOffsetButtonY) {
this.textOffsetButtonY = textOffsetButtonY;
}
public boolean isSelected() {
return isSelected;
}

View file

@ -90,7 +90,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
private static final int PANEL_HEIGHT = 242;
private static final int PANEL_HEIGHT_SMALL = 190;
private static final Border greenBorder = new LineBorder(Color.red, 3);
private static final Border greenBorder = new LineBorder(Color.green, 3);
private static final Border redBorder = new LineBorder(Color.red, 2);
private static final Border emptyBorder = BorderFactory.createEmptyBorder(0,0,0,0);
@ -224,6 +224,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
avatar = new HoverButton("player", resized, resized, resized, r);
avatar.setTextOffsetButtonY(10);
avatar.setObserver(new Command() {
@Override
public void execute() {

View file

@ -100,8 +100,8 @@ public class CallbackClientImpl implements CallbackClient {
ChatMessage message = (ChatMessage) callback.getData();
ChatPanel panel = frame.getChat(callback.getObjectId());
if (panel != null) {
if (message.getMessage().equals(Constants.MSG_TIP_HOT_KEYS_CODE)) {
panel.receiveMessage("[Tips] ", "You may use hot keys to play faster: " + "" +
if (message.getMessage().equals(Constants.MSG_TIP_HOT_KEYS_CODE) && panel.getConnectedChat() != null) {
panel.getConnectedChat().receiveMessage("[Tips] ", "You may use hot keys to play faster: " + "" +
"\nF2 - Confirm \"Ok\", \"Yes\" or \"Done\" button" +
"\nF4 - Skip current turn but stop on declare attackers" +
"\nF9 - Skip everything until your next turn" +