UI: improved card render test dialog (added render mode and size choose);

This commit is contained in:
Oleg Agafonov 2019-05-06 23:16:58 +04:00
parent 998044068d
commit c45f64bdec
18 changed files with 1710 additions and 1547 deletions

View file

@ -8,6 +8,7 @@ import mage.client.components.ext.dlg.DialogContainer;
import mage.client.components.ext.dlg.DialogManager;
import mage.client.components.ext.dlg.DlgParams;
import mage.client.components.ext.dlg.IDialogPanel;
import mage.client.dialog.PreferencesDialog;
import mage.client.plugins.impl.Plugins;
import mage.client.util.Command;
import mage.client.util.SettingsManager;
@ -162,7 +163,7 @@ public class ChoiceDialog extends IDialogPanel {
}
CardView card = cardList.get(i);
MageCard cardImg = Plugins.instance.getMageCard(card, bigCard, getCardDimension(), gameId, true, true);
MageCard cardImg = Plugins.instance.getMageCard(card, bigCard, getCardDimension(), gameId, true, true, PreferencesDialog.getRenderMode());
cardImg.setLocation(dx, dy + j * (height + 30));
add(cardImg);

View file

@ -7,6 +7,7 @@ import mage.client.components.ext.dlg.DialogContainer;
import mage.client.components.ext.dlg.DialogManager;
import mage.client.components.ext.dlg.DlgParams;
import mage.client.components.ext.dlg.IDialogPanel;
import mage.client.dialog.PreferencesDialog;
import mage.client.game.FeedbackPanel;
import mage.client.plugins.impl.Plugins;
import mage.client.util.Command;
@ -33,14 +34,14 @@ public class StackDialog extends IDialogPanel {
private JLayeredPane jLayeredPane;
private final FeedbackPanel feedbackPanel;
private final UUID gameId;
private static class CustomLabel extends JLabel {
@Override
public void paintComponent(Graphics g) {
Graphics2D g2D = (Graphics2D)g;
Graphics2D g2D = (Graphics2D) g;
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
@ -66,7 +67,7 @@ public class StackDialog extends IDialogPanel {
/**
* This method initializes this
*
*
* @return void
*/
private void initialize() {
@ -111,7 +112,7 @@ public class StackDialog extends IDialogPanel {
for (CardView card : cards.values()) {
if (card instanceof StackAbilityView) {
CardView tmp = ((StackAbilityView)card).getSourceCard();
CardView tmp = ((StackAbilityView) card).getSourceCard();
tmp.overrideRules(card.getRules());
tmp.setIsAbility(true);
tmp.overrideTargets(card.getTargets());
@ -119,7 +120,7 @@ public class StackDialog extends IDialogPanel {
card = tmp;
}
MageCard cardImg = Plugins.instance.getMageCard(card, bigCard, getCardDimension(), gameId, true, true);
MageCard cardImg = Plugins.instance.getMageCard(card, bigCard, getCardDimension(), gameId, true, true, PreferencesDialog.getRenderMode());
//cardImg.setBorder(BorderFactory.createLineBorder(Color.red));
cardImg.setLocation(dx, dy);
@ -143,10 +144,11 @@ public class StackDialog extends IDialogPanel {
jButtonAccept.setObserver(new Command() {
@Override
public void execute() {
DialogManager.getManager(gameId).fadeOut((DialogContainer)getParent());
DialogManager.getManager(gameId).fadeOut((DialogContainer) getParent());
//GameManager.getInputControl().getInput().selectButtonOK();
StackDialog.this.feedbackPanel.doClick();
}
private static final long serialVersionUID = 1L;
});
}
@ -166,11 +168,12 @@ public class StackDialog extends IDialogPanel {
jButtonResponse.setObserver(new Command() {
@Override
public void execute() {
DialogManager.getManager(gameId).fadeOut((DialogContainer)getParent());
DialogManager.getManager(gameId).fadeOut((DialogContainer) getParent());
}
private static final long serialVersionUID = 1L;
});
}
return jButtonResponse;
}
}
}