mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 11:02:00 -08:00
* Fixed a problem that a tooltip window was shown of cards from panels in the back.
This commit is contained in:
parent
3c57115c1e
commit
753e039d02
2 changed files with 13 additions and 1 deletions
|
|
@ -613,7 +613,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static MagePane getTopMost(MagePane exclude) {
|
public static MagePane getTopMost(MagePane exclude) {
|
||||||
MagePane topmost = null;
|
MagePane topmost = null;
|
||||||
int best = Integer.MAX_VALUE;
|
int best = Integer.MAX_VALUE;
|
||||||
for (Component frame : desktopPane.getComponentsInLayer(JLayeredPane.DEFAULT_LAYER)) {
|
for (Component frame : desktopPane.getComponentsInLayer(JLayeredPane.DEFAULT_LAYER)) {
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,12 @@ import mage.cards.MageCard;
|
||||||
import mage.cards.action.ActionCallback;
|
import mage.cards.action.ActionCallback;
|
||||||
import mage.cards.action.TransferData;
|
import mage.cards.action.TransferData;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
|
import mage.client.MagePane;
|
||||||
import mage.client.SessionHandler;
|
import mage.client.SessionHandler;
|
||||||
import mage.client.cards.BigCard;
|
import mage.client.cards.BigCard;
|
||||||
import mage.client.components.MageComponents;
|
import mage.client.components.MageComponents;
|
||||||
import mage.client.dialog.PreferencesDialog;
|
import mage.client.dialog.PreferencesDialog;
|
||||||
|
import mage.client.game.GamePane;
|
||||||
import mage.client.plugins.impl.Plugins;
|
import mage.client.plugins.impl.Plugins;
|
||||||
import mage.client.util.DefaultActionCallback;
|
import mage.client.util.DefaultActionCallback;
|
||||||
import mage.client.util.gui.ArrowBuilder;
|
import mage.client.util.gui.ArrowBuilder;
|
||||||
|
|
@ -367,6 +369,16 @@ public class MageActionCallback implements ActionCallback {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleOverNewView(TransferData data) {
|
private void handleOverNewView(TransferData data) {
|
||||||
|
// Prevent to show tooltips from panes not in front
|
||||||
|
MagePane topPane = MageFrame.getTopMost(null);
|
||||||
|
if (topPane instanceof GamePane) {
|
||||||
|
if (!((GamePane) topPane).getGameId().equals(data.gameId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (data.gameId != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
hideTooltipPopup();
|
hideTooltipPopup();
|
||||||
cancelTimeout();
|
cancelTimeout();
|
||||||
Component parentComponent = SwingUtilities.getRoot(data.component);
|
Component parentComponent = SwingUtilities.getRoot(data.component);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue