mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +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.ListSelectionEvent;
|
||||||
import javax.swing.event.ListSelectionListener;
|
import javax.swing.event.ListSelectionListener;
|
||||||
|
|
||||||
|
import forge.card.CardStateName;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
@@ -165,7 +166,24 @@ public class GuiChoose {
|
|||||||
if (paper == null) {
|
if (paper == null) {
|
||||||
paper = FModel.getMagicDb().getVariantCards().getUniqueByName(face.getName());
|
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);
|
matchUI.setCard(paper);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
matchUI.setCard(paper);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user