mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Linux - Fixed that the battlefield popup menu also works when running on a linux system.
This commit is contained in:
parent
3cf7fd33ed
commit
595fd1a700
1 changed files with 20 additions and 0 deletions
|
@ -203,9 +203,20 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
battlefieldPanel.getMainPanel().addMouseListener(new MouseAdapter() {
|
battlefieldPanel.getMainPanel().addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseReleased(MouseEvent Me) {
|
public void mouseReleased(MouseEvent Me) {
|
||||||
|
this.checkMenu(Me);
|
||||||
|
}
|
||||||
|
|
||||||
|
// neccessary for linux and mac systems
|
||||||
|
@Override
|
||||||
|
public void mousePressed(MouseEvent Me) {
|
||||||
|
this.checkMenu(Me);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkMenu(MouseEvent Me){
|
||||||
if (Me.isPopupTrigger() && playingMode) {
|
if (Me.isPopupTrigger() && playingMode) {
|
||||||
popupMenu.show(Me.getComponent(), Me.getX(), Me.getY());
|
popupMenu.show(Me.getComponent(), Me.getX(), Me.getY());
|
||||||
}
|
}
|
||||||
|
@ -233,6 +244,15 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
||||||
battlefieldPanel.getMainPanel().addMouseListener(new MouseAdapter() {
|
battlefieldPanel.getMainPanel().addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseReleased(MouseEvent Me) {
|
public void mouseReleased(MouseEvent Me) {
|
||||||
|
this.checkMenu(Me);
|
||||||
|
}
|
||||||
|
// neccessary for linux and mac systems
|
||||||
|
@Override
|
||||||
|
public void mousePressed(MouseEvent Me) {
|
||||||
|
this.checkMenu(Me);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkMenu(MouseEvent Me){
|
||||||
if (Me.isPopupTrigger() && playingMode) {
|
if (Me.isPopupTrigger() && playingMode) {
|
||||||
popupMenu.show(Me.getComponent(), Me.getX(), Me.getY());
|
popupMenu.show(Me.getComponent(), Me.getX(), Me.getY());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue