mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00: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;
|
||||
int best = Integer.MAX_VALUE;
|
||||
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.TransferData;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.MagePane;
|
||||
import mage.client.SessionHandler;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.components.MageComponents;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.client.game.GamePane;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.DefaultActionCallback;
|
||||
import mage.client.util.gui.ArrowBuilder;
|
||||
|
@ -367,6 +369,16 @@ public class MageActionCallback implements ActionCallback {
|
|||
}
|
||||
|
||||
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();
|
||||
cancelTimeout();
|
||||
Component parentComponent = SwingUtilities.getRoot(data.component);
|
||||
|
|
Loading…
Reference in a new issue