spjspj - Modifications to shrink size of players who have left.

This commit is contained in:
spjspj 2016-06-24 19:20:46 +10:00
parent 48ae863459
commit 157d94360c
2 changed files with 81 additions and 6 deletions

View file

@ -112,6 +112,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
private static final Border RED_BORDER = new LineBorder(Color.red, 2);
private static final Border EMPTY_BORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);
private final Color greenBackgroundColor = new Color(180, 255, 180, 200);
private final Color deadBackgroundColor = new Color(200, 180, 180, 200);
private int avatarId = -1;
private String flagName;
@ -222,7 +223,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
}
graveLabel.setText(Integer.toString(graveCards));
graveLabel.setToolTipText("Card Types: " + qtyCardTypes(player.getGraveyard()));
int exileCards = player.getExile().size();
if (exileCards > 99) {
if (!changedFontExile) {
@ -282,6 +283,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
if (player.hasLeft()) {
this.avatar.setBorder(RED_BORDER);
this.btnPlayer.setBorder(RED_BORDER);
setDeadBackgroundColor();
} else {
this.avatar.setBorder(EMPTY_BORDER);
this.btnPlayer.setBorder(EMPTY_BORDER);
@ -299,6 +301,10 @@ public class PlayerPanelExt extends javax.swing.JPanel {
panelBackground.setBackgroundColor(greenBackgroundColor);
}
private void setDeadBackgroundColor() {
panelBackground.setBackgroundColor(deadBackgroundColor);
}
/**
* Updates the avatar image and tooltip text
*/
@ -878,7 +884,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
if (cardTypesPresent.isEmpty()) return 0;
else return cardTypesPresent.size();
}
private HoverButton avatar;
private JLabel avatarFlag;
private JButton btnPlayer;