mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Highlight current player's panel.
This commit is contained in:
parent
b6aa5ba5d5
commit
66a9e5140a
2 changed files with 30 additions and 6 deletions
|
@ -22,7 +22,8 @@ public class MageRoundPane extends JPanel {
|
||||||
private int X_OFFSET = 30;
|
private int X_OFFSET = 30;
|
||||||
private int Y_OFFSET = 30;
|
private int Y_OFFSET = 30;
|
||||||
private BufferedImage shadow = null;
|
private BufferedImage shadow = null;
|
||||||
private final Color backgroundColor = new Color(255, 255, 255, 200);
|
private final Color defaultBackgroundColor = new Color(255, 255, 255, 200);
|
||||||
|
private Color backgroundColor = defaultBackgroundColor;
|
||||||
private final int alpha = 0;
|
private final int alpha = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -99,6 +100,14 @@ public class MageRoundPane extends JPanel {
|
||||||
setVisible(bShow);
|
setVisible(bShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetBackgroundColor() {
|
||||||
|
this.backgroundColor = defaultBackgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackgroundColor(Color backgroundColor) {
|
||||||
|
this.backgroundColor = backgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default UID.
|
* Default UID.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -105,6 +105,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
||||||
private static final Border GREEN_BORDER = new LineBorder(Color.green, 3);
|
private static final Border GREEN_BORDER = new LineBorder(Color.green, 3);
|
||||||
private static final Border RED_BORDER = new LineBorder(Color.red, 2);
|
private static final Border RED_BORDER = new LineBorder(Color.red, 2);
|
||||||
private static final Border EMPTY_BORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);
|
private static final Border EMPTY_BORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);
|
||||||
|
private final Color greenBackgroundColor = new Color(180, 255, 180);
|
||||||
|
|
||||||
private int avatarId = -1;
|
private int avatarId = -1;
|
||||||
private String flagName;
|
private String flagName;
|
||||||
|
@ -268,17 +269,31 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
||||||
if (player.isActive()) {
|
if (player.isActive()) {
|
||||||
this.avatar.setBorder(GREEN_BORDER);
|
this.avatar.setBorder(GREEN_BORDER);
|
||||||
this.btnPlayer.setBorder(GREEN_BORDER);
|
this.btnPlayer.setBorder(GREEN_BORDER);
|
||||||
} else if (player.hasLeft()) {
|
setGreenBackgroundColor();
|
||||||
|
} else {
|
||||||
|
resetBackgroundColor();
|
||||||
|
if (player.hasLeft()) {
|
||||||
this.avatar.setBorder(RED_BORDER);
|
this.avatar.setBorder(RED_BORDER);
|
||||||
this.btnPlayer.setBorder(RED_BORDER);
|
this.btnPlayer.setBorder(RED_BORDER);
|
||||||
} else {
|
} else {
|
||||||
this.avatar.setBorder(EMPTY_BORDER);
|
this.avatar.setBorder(EMPTY_BORDER);
|
||||||
this.btnPlayer.setBorder(EMPTY_BORDER);
|
this.btnPlayer.setBorder(EMPTY_BORDER);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
update(player.getManaPool());
|
update(player.getManaPool());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetBackgroundColor() {
|
||||||
|
panelBackground.resetBackgroundColor();
|
||||||
|
zonesPanel.setBackground(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setGreenBackgroundColor() {
|
||||||
|
panelBackground.setBackgroundColor(greenBackgroundColor);
|
||||||
|
zonesPanel.setBackground(greenBackgroundColor);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the avatar image and tooltip text
|
* Updates the avatar image and tooltip text
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue