mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Mana pool handling - Fixed bug where wrong playerId was used. Fixed that menu check state is the same for all GamePanles of client.
This commit is contained in:
parent
610c7d7462
commit
c13f7a2115
7 changed files with 32 additions and 14 deletions
|
|
@ -581,6 +581,16 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
this.repaint();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the same state for menu selections to all player areas.
|
||||
* @param manaPoolAutomatic
|
||||
*/
|
||||
public void setMenuStates(boolean manaPoolAutomatic) {
|
||||
for(PlayAreaPanel playAreaPanel: players.values()) {
|
||||
playAreaPanel.setMenuStates(manaPoolAutomatic);
|
||||
}
|
||||
}
|
||||
|
||||
private void displayStack(GameView game, BigCard bigCard, FeedbackPanel feedbackPanel, UUID gameId) {
|
||||
this.stack.loadCards(game.getStack(), bigCard, gameId, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
private boolean playingMode = true;
|
||||
private GamePanel gamePanel;
|
||||
|
||||
private JCheckBoxMenuItem manaPoolMenuItem;
|
||||
|
||||
public static final int PANEL_HEIGHT = 242;
|
||||
public static final int PANEL_HEIGHT_SMALL = 190;
|
||||
|
||||
|
|
@ -177,16 +179,18 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
|
||||
popupMenu.addSeparator();
|
||||
|
||||
menuItem = new JCheckBoxMenuItem("Use mana from pool automatically", true);
|
||||
menuItem.setMnemonic(KeyEvent.VK_M);
|
||||
menuItem.setToolTipText("If not active, you have to click the type of mana you want to pay in the player panel.");
|
||||
popupMenu.add(menuItem);
|
||||
manaPoolMenuItem = new JCheckBoxMenuItem("Use mana from pool automatically", true);
|
||||
manaPoolMenuItem.setMnemonic(KeyEvent.VK_M);
|
||||
manaPoolMenuItem.setToolTipText("If not active, you have to click the type of mana you want to pay in the player panel.");
|
||||
popupMenu.add(manaPoolMenuItem);
|
||||
|
||||
// Auto pay mana from mana pool
|
||||
menuItem.addActionListener(new ActionListener() {
|
||||
manaPoolMenuItem.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
gamePanel.getSession().setManaPoolMode(((JCheckBoxMenuItem)e.getSource()).getState(), gameId);
|
||||
boolean manaPoolAutomatic = ((JCheckBoxMenuItem)e.getSource()).getState();
|
||||
gamePanel.setMenuStates(manaPoolAutomatic);
|
||||
gamePanel.getSession().setManaPoolMode(manaPoolAutomatic, gameId);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -367,6 +371,10 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
this.playingMode = playingMode;
|
||||
}
|
||||
|
||||
public void setMenuStates(boolean manaPoolAutomatic) {
|
||||
manaPoolMenuItem.setSelected(manaPoolAutomatic);
|
||||
}
|
||||
|
||||
private mage.client.game.BattlefieldPanel battlefieldPanel;
|
||||
private javax.swing.JButton btnCheat;
|
||||
//private javax.swing.JScrollPane jScrollPane1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue