mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Fixed phase flakiness and mulligan bug.
This commit is contained in:
@@ -19,8 +19,6 @@ package forge.control.match;
|
|||||||
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.awt.event.KeyAdapter;
|
|
||||||
import java.awt.event.KeyEvent;
|
|
||||||
|
|
||||||
import forge.AllZone;
|
import forge.AllZone;
|
||||||
import forge.GuiInput;
|
import forge.GuiInput;
|
||||||
@@ -35,6 +33,8 @@ public class ControlInput {
|
|||||||
|
|
||||||
private final GuiInput inputControl;
|
private final GuiInput inputControl;
|
||||||
|
|
||||||
|
private ActionListener alCancel = null, alOK = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Child controller - handles operations related to input panel.
|
* Child controller - handles operations related to input panel.
|
||||||
*
|
*
|
||||||
@@ -44,19 +44,8 @@ public class ControlInput {
|
|||||||
public ControlInput(final ViewInput v) {
|
public ControlInput(final ViewInput v) {
|
||||||
this.view = v;
|
this.view = v;
|
||||||
this.inputControl = new GuiInput();
|
this.inputControl = new GuiInput();
|
||||||
}
|
|
||||||
|
|
||||||
/** Adds listeners to input area. */
|
this.alOK = new ActionListener() {
|
||||||
public void addListeners() {
|
|
||||||
this.view.getBtnCancel().addActionListener(new ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(final ActionEvent evt) {
|
|
||||||
ControlInput.this.btnCancelActionPerformed(evt);
|
|
||||||
ControlInput.this.view.getBtnOK().requestFocusInWindow();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//
|
|
||||||
this.view.getBtnOK().addActionListener(new ActionListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(final ActionEvent evt) {
|
public void actionPerformed(final ActionEvent evt) {
|
||||||
ControlInput.this.btnOKActionPerformed(evt);
|
ControlInput.this.btnOKActionPerformed(evt);
|
||||||
@@ -68,18 +57,24 @@ public class ControlInput {
|
|||||||
}
|
}
|
||||||
ControlInput.this.view.getBtnOK().requestFocusInWindow();
|
ControlInput.this.view.getBtnOK().requestFocusInWindow();
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
//
|
|
||||||
this.view.getBtnOK().addKeyListener(new KeyAdapter() {
|
this.alCancel = new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void keyPressed(final KeyEvent arg0) {
|
public void actionPerformed(final ActionEvent evt) {
|
||||||
// TODO make triggers on escape
|
ControlInput.this.btnCancelActionPerformed(evt);
|
||||||
final int code = arg0.getKeyCode();
|
ControlInput.this.view.getBtnOK().requestFocusInWindow();
|
||||||
if (code == KeyEvent.VK_ESCAPE) {
|
|
||||||
ControlInput.this.view.getBtnOK().doClick();
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
/** Adds listeners to input area. */
|
||||||
|
public void addListeners() {
|
||||||
|
this.view.getBtnCancel().removeActionListener(alCancel);
|
||||||
|
this.view.getBtnCancel().addActionListener(alCancel);
|
||||||
|
|
||||||
|
this.view.getBtnOK().removeActionListener(alOK);
|
||||||
|
this.view.getBtnOK().addActionListener(alOK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user