mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- GuiChoose (desktop Forge): show the right card face in the card detail panel when choosing a card name.
This commit is contained in:
@@ -13,6 +13,7 @@ import javax.swing.WindowConstants;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
|
||||
import forge.card.CardStateName;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
@@ -165,7 +166,24 @@ public class GuiChoose {
|
||||
if (paper == null) {
|
||||
paper = FModel.getMagicDb().getVariantCards().getUniqueByName(face.getName());
|
||||
}
|
||||
|
||||
if (paper != null && !paper.getName().equals(face.getName())) {
|
||||
Card c = Card.getCardForUi(paper);
|
||||
boolean foundState = false;
|
||||
for (CardStateName cs : c.getStates()) {
|
||||
if (c.getState(cs).getName().equals(face.getName())) {
|
||||
foundState = true;
|
||||
c.setState(cs, true);
|
||||
matchUI.setCard(c.getView());
|
||||
}
|
||||
}
|
||||
if (!foundState) {
|
||||
matchUI.setCard(paper);
|
||||
}
|
||||
} else {
|
||||
matchUI.setCard(paper);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user