forked from External/mage
* Added display of live on player avatar image,
This commit is contained in:
parent
9c0d0a0153
commit
af296cbe79
4 changed files with 122 additions and 46 deletions
|
|
@ -77,7 +77,6 @@ import mage.constants.ManaType;
|
|||
import mage.counters.Counter;
|
||||
import mage.counters.CounterType;
|
||||
import mage.designations.DesignationType;
|
||||
import mage.remote.Session;
|
||||
import mage.utils.timer.PriorityTimer;
|
||||
import mage.view.CardView;
|
||||
import mage.view.ManaPoolView;
|
||||
|
|
@ -93,13 +92,10 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
|
||||
private UUID playerId;
|
||||
private UUID gameId;
|
||||
private Session session;
|
||||
private PlayerView player;
|
||||
|
||||
private BigCard bigCard;
|
||||
|
||||
private static final int AVATAR_COUNT = 77;
|
||||
|
||||
private static final String DEFAULT_AVATAR_PATH = "/avatars/" + DEFAULT_AVATAR_ID + ".jpg";
|
||||
|
||||
private static final int PANEL_WIDTH = 94;
|
||||
|
|
@ -179,8 +175,11 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
|
||||
public void update(PlayerView player) {
|
||||
this.player = player;
|
||||
updateAvatar();
|
||||
int playerLife = player.getLife();
|
||||
avatar.setCenterText("true".equals(MageFrame.getPreferences().get(PreferencesDialog.KEY_DISPLAY_LIVE_ON_AVATAR, "true"))
|
||||
? String.valueOf(playerLife) : null);
|
||||
updateAvatar();
|
||||
|
||||
if (playerLife > 99) {
|
||||
Font font = lifeLabel.getFont();
|
||||
font = font.deriveFont(9f);
|
||||
|
|
@ -701,8 +700,6 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
.addComponent(btnPlayer, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(timerLabel, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(avatar, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))
|
||||
// .addGroup(gl_panelBackground.createSequentialGroup()
|
||||
// .addComponent(avatarFlag, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(8))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(6)
|
||||
|
|
@ -824,16 +821,12 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
protected void sizePlayerPanel(boolean smallMode) {
|
||||
if (smallMode) {
|
||||
avatar.setVisible(false);
|
||||
// avatarFlag.setVisible(false);
|
||||
// monarchIcon.setVisible(false);
|
||||
btnPlayer.setVisible(true);
|
||||
timerLabel.setVisible(true);
|
||||
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT_SMALL));
|
||||
panelBackground.setBounds(0, 0, PANEL_WIDTH - 2, PANEL_HEIGHT_SMALL);
|
||||
} else {
|
||||
avatar.setVisible(true);
|
||||
// avatarFlag.setVisible(true);
|
||||
// monarchIcon.setVisible(true);
|
||||
btnPlayer.setVisible(false);
|
||||
timerLabel.setVisible(false);
|
||||
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT));
|
||||
|
|
@ -887,8 +880,6 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
private HoverButton avatar;
|
||||
// private JLabel avatarFlag;
|
||||
// private JLabel monarchIcon;
|
||||
private JButton btnPlayer;
|
||||
private ImagePanel life;
|
||||
private ImagePanel poison;
|
||||
|
|
@ -918,7 +909,6 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
private JPanel energyExperiencePanel;
|
||||
private HoverButton exileZone;
|
||||
private HoverButton commandZone;
|
||||
private HoverButton enchantPlayerViewZone;
|
||||
|
||||
private final Map<String, JLabel> manaLabels = new HashMap<>();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue