* Fixed card type displaying order (fixes #6055).

This commit is contained in:
LevelX2 2020-06-15 21:11:54 +02:00
parent 4006e9e909
commit 2788eab082
24 changed files with 106 additions and 141 deletions

View file

@ -1,5 +1,14 @@
package mage.client.dialog;
import java.awt.*;
import java.beans.PropertyVetoException;
import java.util.EnumSet;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import javax.swing.*;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import mage.client.cards.BigCard;
import mage.client.util.GUISizeHelper;
import mage.client.util.ImageHelper;
@ -13,15 +22,6 @@ import mage.view.SimpleCardsView;
import org.apache.log4j.Logger;
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
import javax.swing.*;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import java.awt.*;
import java.beans.PropertyVetoException;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
/**
* @author BetaSteward_at_googlemail.com, JayDi85
*/
@ -77,7 +77,7 @@ public class CardInfoWindowDialog extends MageDialog {
this.setClosable(false);
break;
default:
// no icon yet
// no icon yet
}
this.setTitelBarToolTip(name);
setGUISize();
@ -174,13 +174,17 @@ public class CardInfoWindowDialog extends MageDialog {
Set<String> cardTypesPresent = new LinkedHashSet<String>() {
};
for (CardView card : cardsView.values()) {
Set<CardType> cardTypes = card.getCardTypes();
Set<CardType> cardTypes = EnumSet.noneOf(CardType.class);
cardTypes.addAll(card.getCardTypes());
for (CardType cardType : cardTypes) {
cardTypesPresent.add(cardType.toString());
}
}
if (cardTypesPresent.isEmpty()) return 0;
else return cardTypesPresent.size();
if (cardTypesPresent.isEmpty()) {
return 0;
} else {
return cardTypesPresent.size();
}
}
/**

View file

@ -1,5 +1,13 @@
package mage.client.game;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.*;
import javax.swing.*;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import mage.cards.decks.importer.DckDeckImporter;
import mage.client.MageFrame;
import mage.client.SessionHandler;
@ -15,6 +23,7 @@ import mage.client.util.gui.countryBox.CountryUtil;
import mage.components.ImagePanel;
import mage.components.ImagePanelStyle;
import mage.constants.CardType;
import static mage.constants.Constants.*;
import mage.constants.ManaType;
import mage.counters.Counter;
import mage.counters.CounterType;
@ -23,17 +32,6 @@ import mage.utils.timer.PriorityTimer;
import mage.view.*;
import org.mage.card.arcane.ManaSymbols;
import javax.swing.*;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.*;
import static mage.constants.Constants.*;
/**
* Enhanced player pane.
*
@ -42,7 +40,6 @@ import static mage.constants.Constants.*;
public class PlayerPanelExt extends javax.swing.JPanel {
// TODO: *.form file was lost, panel must be reworks in designer
private UUID playerId;
private UUID gameId;
private PlayerView player;
@ -612,7 +609,6 @@ public class PlayerPanelExt extends javax.swing.JPanel {
manaCountLabelW.addMouseListener(manaMouseAdapter);
manaLabels.put(manaCountLabelW, ManaType.WHITE);l
//*/
///*
JLabel manaCountLabelW = new JLabel();
manaCountLabelW.setToolTipText("White mana");
@ -944,7 +940,8 @@ public class PlayerPanelExt extends javax.swing.JPanel {
Set<String> cardTypesPresent = new LinkedHashSet<String>() {
};
for (CardView card : cardsView.values()) {
Set<CardType> cardTypes = card.getCardTypes();
Set<CardType> cardTypes = EnumSet.noneOf(CardType.class);
cardTypes.addAll(card.getCardTypes());
for (CardType cardType : cardTypes) {
cardTypesPresent.add(cardType.toString());
}