Fix so PaperCard for card name doesn't change unless card renamed

This commit is contained in:
drdev
2013-11-23 04:19:05 +00:00
parent e95e251161
commit cc433b6708

View File

@@ -123,13 +123,19 @@ public enum CCardScript implements ICDoc {
updateDirtyFlag();
String oldName = this.currentCard.getName();
CardRules newRules = CardRules.fromScript(Arrays.asList(text.split("\n")));
CardDb cardDb = newRules.isVariant() ? Singletons.getMagicDb().getVariantCards() :
Singletons.getMagicDb().getCommonCards();
newRules = cardDb.getEditor().putCard(newRules);
this.currentCard = cardDb.getCard(newRules.getName());
Card.updateCard(this.currentCard);
if (newRules.getName().equals(oldName)) {
Card.updateCard(this.currentCard);
}
else {
this.currentCard = cardDb.getCard(newRules.getName());
}
VWorkshopCatalog.SINGLETON_INSTANCE.getCardManager().repaint();
CDetail.SINGLETON_INSTANCE.showCard(this.currentCard);