[UI] Exile dialog

This commit is contained in:
magenoxx 2014-08-07 15:30:44 +04:00
parent 10840840ac
commit 53453243dc
5 changed files with 161 additions and 61 deletions

View file

@ -97,6 +97,16 @@ public class DialogContainer extends JPanel {
dlg.setLocation(X_OFFSET + 10, Y_OFFSET + 10);
dlg.updateSize(params.rect.width - 80, params.rect.height - 80);
} else if (dialogType == DialogManager.MTGDialogs.ExileDialog) {
backgroundColor = new Color(250, 250, 250, 50);
alpha = 0;
ChoiceDialog dlg = new ChoiceDialog(params, "Exile");
add(dlg);
dlg.setLocation(X_OFFSET + 10, Y_OFFSET + 10);
dlg.updateSize(params.rect.width - 80, params.rect.height - 80);
} else if (dialogType == DialogManager.MTGDialogs.EmblemsDialog) {
backgroundColor = new Color(0, 0, 50, 110);

View file

@ -1,7 +1,11 @@
package mage.client.components.ext.dlg;
import java.awt.Component;
import java.awt.Rectangle;
import mage.client.cards.BigCard;
import mage.client.game.FeedbackPanel;
import mage.view.CardsView;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
@ -9,10 +13,6 @@ import java.awt.event.MouseWheelEvent;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import javax.swing.JComponent;
import mage.client.cards.BigCard;
import mage.client.game.FeedbackPanel;
import mage.view.CardsView;
/**
* @author mw, noxx
@ -40,7 +40,7 @@ public class DialogManager extends JComponent implements MouseListener,
public enum MTGDialogs {
none, AboutDialog, MessageDialog, StackDialog, AssignDamageDialog, ManaChoiceDialog, ChoiceDialog, EmblemsDialog, GraveDialog, DialogContainer, CombatDialog,
ChooseDeckDialog, ChooseCommonDialog, RevealDialog
ChooseDeckDialog, ChooseCommonDialog, RevealDialog, ExileDialog
}
/**
@ -176,6 +176,35 @@ public class DialogManager extends JComponent implements MouseListener,
setVisible(true);
}
public void showExileDialog(CardsView cards, BigCard bigCard, UUID gameId) {
int w = 720;
int h = 550;
int height = getHeight();
int width = getWidth();
int x = ((width - w) / 2);
int y = ((height - h) / 2);
DlgParams params = new DlgParams();
params.rect = new Rectangle(x, y, w, h);
params.bigCard = bigCard;
params.gameId = gameId;
params.setCards(cards);
dialogContainer = new DialogContainer(MTGDialogs.ExileDialog, params);
dialogContainer.setVisible(true);
add(dialogContainer);
this.currentDialog = MTGDialogs.DialogContainer;
setDlgBounds(new Rectangle(x, y, w, h));
dialogContainer.showDialog(true);
setVisible(true);
}
public void showEmblemsDialog(CardsView cards, BigCard bigCard, UUID gameId) {
int w = 720;