mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Fix so Card Detail updated when card script saved
This commit is contained in:
@@ -6,8 +6,10 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.event.DocumentEvent;
|
import javax.swing.event.DocumentEvent;
|
||||||
import javax.swing.event.DocumentListener;
|
import javax.swing.event.DocumentListener;
|
||||||
|
|
||||||
|
import forge.Card;
|
||||||
import forge.Command;
|
import forge.Command;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
|
import forge.card.CardDb;
|
||||||
import forge.card.CardRules;
|
import forge.card.CardRules;
|
||||||
import forge.gui.framework.FScreen;
|
import forge.gui.framework.FScreen;
|
||||||
import forge.gui.framework.ICDoc;
|
import forge.gui.framework.ICDoc;
|
||||||
@@ -120,9 +122,14 @@ public enum CCardScript implements ICDoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateDirtyFlag();
|
updateDirtyFlag();
|
||||||
|
|
||||||
CardRules newRules = CardRules.fromScript(Arrays.asList(text.split("\n")));
|
CardRules newRules = CardRules.fromScript(Arrays.asList(text.split("\n")));
|
||||||
newRules = Singletons.getMagicDb().getCommonCards().getEditor().putCard(newRules);
|
CardDb cardDb = newRules.isVariant() ? Singletons.getMagicDb().getVariantCards() :
|
||||||
this.currentCard = Singletons.getMagicDb().getCommonCards().getCard(newRules.getName());
|
Singletons.getMagicDb().getCommonCards();
|
||||||
|
|
||||||
|
newRules = cardDb.getEditor().putCard(newRules);
|
||||||
|
this.currentCard = cardDb.getCard(newRules.getName());
|
||||||
|
Card.updateCard(this.currentCard);
|
||||||
|
|
||||||
VWorkshopCatalog.SINGLETON_INSTANCE.getCardManager().repaint();
|
VWorkshopCatalog.SINGLETON_INSTANCE.getCardManager().repaint();
|
||||||
CDetail.SINGLETON_INSTANCE.showCard(this.currentCard);
|
CDetail.SINGLETON_INSTANCE.showCard(this.currentCard);
|
||||||
|
|||||||
Reference in New Issue
Block a user