mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
add rarity information to card details panel set code label tooltip
This commit is contained in:
@@ -183,27 +183,19 @@ public class CardDetailPanel extends FPanel implements CardContainer {
|
|||||||
this.nameCostLabel.setText(card.getName() + " - " + card.getManaCost());
|
this.nameCostLabel.setText(card.getName() + " - " + card.getManaCost());
|
||||||
}
|
}
|
||||||
this.typeLabel.setText(GuiDisplayUtil.formatCardType(card));
|
this.typeLabel.setText(GuiDisplayUtil.formatCardType(card));
|
||||||
|
|
||||||
String set = card.getCurSetCode();
|
String set = card.getCurSetCode();
|
||||||
this.setInfoLabel.setText(set);
|
this.setInfoLabel.setText(set);
|
||||||
if (null != set && !set.isEmpty()) {
|
if (null != set && !set.isEmpty()) {
|
||||||
CardEdition edition = Singletons.getModel().getEditions().get(set);
|
CardEdition edition = Singletons.getModel().getEditions().get(set);
|
||||||
if (null != edition) {
|
if (null == edition) {
|
||||||
this.setInfoLabel.setToolTipText(edition.getName());
|
setInfoLabel.setToolTipText(card.getRarity().name());
|
||||||
|
} else {
|
||||||
|
setInfoLabel.setToolTipText(String.format("%s (%s)", edition.getName(), card.getRarity().name()));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
this.setInfoLabel.setOpaque(true);
|
||||||
this.nameCostLabel.setText("Morph");
|
switch(card.getRarity()) {
|
||||||
this.typeLabel.setText("Creature");
|
|
||||||
}
|
|
||||||
if (card.isCreature()) {
|
|
||||||
this.powerToughnessLabel.setText(card.getNetAttack() + " / " + card.getNetDefense());
|
|
||||||
}
|
|
||||||
|
|
||||||
this.idLabel.setText("Card ID " + card.getUniqueNumber());
|
|
||||||
|
|
||||||
if (!this.setInfoLabel.getText().equals("")) {
|
|
||||||
this.setInfoLabel.setOpaque(true);
|
|
||||||
switch( card.getRarity() ) {
|
|
||||||
case Uncommon:
|
case Uncommon:
|
||||||
this.setInfoLabel.setBackground(Color.LIGHT_GRAY);
|
this.setInfoLabel.setBackground(Color.LIGHT_GRAY);
|
||||||
this.setInfoLabel.setForeground(Color.BLACK);
|
this.setInfoLabel.setForeground(Color.BLACK);
|
||||||
@@ -234,12 +226,20 @@ public class CardDetailPanel extends FPanel implements CardContainer {
|
|||||||
this.setInfoLabel.setForeground(Color.WHITE);
|
this.setInfoLabel.setForeground(Color.WHITE);
|
||||||
this.setInfoLabel.setBorder(BorderFactory.createLineBorder(Color.WHITE));
|
this.setInfoLabel.setBorder(BorderFactory.createLineBorder(Color.WHITE));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// cdLabel7.setText(card.getCurSetCode());
|
} else {
|
||||||
|
this.nameCostLabel.setText("Morph");
|
||||||
|
this.typeLabel.setText("Creature");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (card.isCreature()) {
|
||||||
|
this.powerToughnessLabel.setText(card.getNetAttack() + " / " + card.getNetDefense());
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill the card text
|
this.idLabel.setText("Card ID " + card.getUniqueNumber());
|
||||||
|
|
||||||
|
// fill the card text
|
||||||
this.cdArea.setText(composeCardText(card, canShowThis));
|
this.cdArea.setText(composeCardText(card, canShowThis));
|
||||||
|
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
|||||||
Reference in New Issue
Block a user