mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[UI] Moved Concede button from helper component to bottom-left
This commit is contained in:
parent
0211b4f1af
commit
6d670fa3ff
3 changed files with 30 additions and 24 deletions
|
|
@ -134,7 +134,7 @@ public class FeedbackPanel extends javax.swing.JPanel {
|
|||
this.helper.setSpecial("Pay 2 life", true);
|
||||
}
|
||||
|
||||
boolean yourTurn = options != null && options.containsKey("your_turn");
|
||||
//boolean yourTurn = options != null && options.containsKey("your_turn");
|
||||
|
||||
requestFocusIfPossible();
|
||||
handleOptions(options);
|
||||
|
|
@ -142,7 +142,6 @@ public class FeedbackPanel extends javax.swing.JPanel {
|
|||
this.revalidate();
|
||||
this.repaint();
|
||||
this.helper.setLinks(btnLeft, btnRight, btnSpecial);
|
||||
this.helper.setYourTurn(yourTurn);
|
||||
|
||||
this.helper.setVisible(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,6 +227,7 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
this.feedbackPanel.clear();
|
||||
this.abilityPicker.init(session, gameId);
|
||||
this.btnConcede.setVisible(true);
|
||||
this.btnEndTurn.setVisible(true);
|
||||
this.btnSwitchHands.setVisible(false);
|
||||
this.pnlReplay.setVisible(false);
|
||||
this.btnStopWatching.setVisible(false);
|
||||
|
|
@ -244,6 +245,7 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
this.feedbackPanel.init(gameId);
|
||||
this.feedbackPanel.clear();
|
||||
this.btnConcede.setVisible(false);
|
||||
this.btnEndTurn.setVisible(false);
|
||||
this.btnSwitchHands.setVisible(false);
|
||||
this.btnStopWatching.setVisible(true);
|
||||
this.pnlReplay.setVisible(false);
|
||||
|
|
@ -261,6 +263,7 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
this.feedbackPanel.init(gameId);
|
||||
this.feedbackPanel.clear();
|
||||
this.btnConcede.setVisible(false);
|
||||
this.btnEndTurn.setVisible(false);
|
||||
this.btnSwitchHands.setVisible(false);
|
||||
this.btnStopWatching.setVisible(false);
|
||||
this.pnlReplay.setVisible(true);
|
||||
|
|
@ -641,6 +644,7 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
lblPriority = new javax.swing.JLabel();
|
||||
feedbackPanel = new mage.client.game.FeedbackPanel();
|
||||
btnConcede = new javax.swing.JButton();
|
||||
btnEndTurn = new javax.swing.JButton();
|
||||
btnSwitchHands = new javax.swing.JButton();
|
||||
btnStopWatching = new javax.swing.JButton();
|
||||
bigCard = new mage.client.cards.BigCard();
|
||||
|
|
@ -713,6 +717,8 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
bigCard.setBorder(new LineBorder(Color.black, 1, true));
|
||||
|
||||
btnConcede.setText("Concede");
|
||||
btnConcede.setToolTipText("Concede the current game");
|
||||
btnConcede.setFocusable(false);
|
||||
btnConcede.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
|
|
@ -720,6 +726,16 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
});
|
||||
|
||||
btnEndTurn.setText("End Turn (F4)");
|
||||
btnEndTurn.setToolTipText("End This Turn");
|
||||
btnEndTurn.setFocusable(false);
|
||||
btnEndTurn.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
btnEndTurnActionPerformed(null);
|
||||
}
|
||||
});
|
||||
|
||||
btnSwitchHands.setText("Switch Hands");
|
||||
btnSwitchHands.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
|
|
@ -805,6 +821,8 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
.addGap(10, 10, 10)
|
||||
.addComponent(btnConcede)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnEndTurn)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnSwitchHands)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnStopWatching)
|
||||
|
|
@ -829,6 +847,7 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(gl_pnlGameInfo.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(btnConcede)
|
||||
.addComponent(btnEndTurn)
|
||||
.addComponent(btnSwitchHands)
|
||||
.addComponent(btnStopWatching)))
|
||||
);
|
||||
|
|
@ -885,14 +904,6 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
pnlReplay.setOpaque(false);
|
||||
helper = new HelperPanel();
|
||||
helper.setPreferredSize(new Dimension(100, 90));
|
||||
helper.addEndTurnListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (feedbackPanel != null && FeedbackMode.SELECT.equals(feedbackPanel.getMode())) {
|
||||
session.sendPlayerInteger(gameId, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
feedbackPanel.setHelperPanel(helper);
|
||||
|
||||
jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
||||
|
|
@ -951,6 +962,12 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
}
|
||||
|
||||
private void btnEndTurnActionPerformed(java.awt.event.ActionEvent evt) {
|
||||
if (feedbackPanel != null && FeedbackMode.SELECT.equals(feedbackPanel.getMode())) {
|
||||
session.sendPlayerInteger(gameId, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnSwitchHandActionPerformed(java.awt.event.ActionEvent evt) {
|
||||
String[] choices = handCards.keySet().toArray(new String[0]);
|
||||
|
||||
|
|
@ -1018,6 +1035,7 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
private mage.client.components.ability.AbilityPicker abilityPicker;
|
||||
private mage.client.cards.BigCard bigCard;
|
||||
private javax.swing.JButton btnConcede;
|
||||
private javax.swing.JButton btnEndTurn;
|
||||
private javax.swing.JButton btnSwitchHands;
|
||||
private javax.swing.JButton btnNextPlay;
|
||||
private javax.swing.JButton btnPlay;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import mage.client.components.MageTextArea;
|
|||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseListener;
|
||||
|
||||
/**
|
||||
* Panel with buttons that copy the state of feedback panel.
|
||||
|
|
@ -44,7 +43,7 @@ public class HelperPanel extends JPanel {
|
|||
private javax.swing.JButton btnLeft;
|
||||
private javax.swing.JButton btnRight;
|
||||
private javax.swing.JButton btnSpecial;
|
||||
private javax.swing.JButton btnEndTurn;
|
||||
//private javax.swing.JButton btnEndTurn;
|
||||
//private javax.swing.JButton btnStopTimer;
|
||||
|
||||
private MageTextArea textArea;
|
||||
|
|
@ -101,11 +100,13 @@ public class HelperPanel extends JPanel {
|
|||
//btnStopTimer.setToolTipText("Stop auto phase skipping timer");
|
||||
//add(btnStopTimer);
|
||||
|
||||
/*
|
||||
btnEndTurn = new JButton("End Turn");
|
||||
btnEndTurn.setToolTipText("End The Turn");
|
||||
btnEndTurn.setFocusable(false);
|
||||
btnEndTurn.setVisible(false);
|
||||
container.add(btnEndTurn);
|
||||
*/
|
||||
|
||||
btnLeft.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
|
|
@ -166,10 +167,6 @@ public class HelperPanel extends JPanel {
|
|||
this.linkRight = right;
|
||||
this.linkSpecial = special;
|
||||
}
|
||||
|
||||
public void addEndTurnListener(MouseListener mouseListener) {
|
||||
this.btnEndTurn.addMouseListener(mouseListener);
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
if (message.contains("Use")) {
|
||||
|
|
@ -178,14 +175,6 @@ public class HelperPanel extends JPanel {
|
|||
textArea.setText(message);
|
||||
}
|
||||
}
|
||||
|
||||
public void setYourTurn(boolean yourTurn) {
|
||||
if (yourTurn) {
|
||||
btnEndTurn.setVisible(true);
|
||||
} else {
|
||||
btnEndTurn.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void requestFocus() {
|
||||
this.btnRight.requestFocus();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue