Workshop: support DFC (#2150)

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.59>
This commit is contained in:
tool4ever
2022-12-22 10:18:21 +01:00
committed by GitHub
parent 53595926d1
commit 40524426e2
2 changed files with 2 additions and 2 deletions

View File

@@ -94,7 +94,7 @@ public enum CCardScript implements ICDoc {
}
currentCard = card;
currentScriptInfo = card != null ? CardScriptInfo.getScriptFor(currentCard.getRules().getName()) : null;
currentScriptInfo = card != null ? CardScriptInfo.getScriptFor(currentCard.getRules().getNormalizedName()) : null;
refresh();
}

View File

@@ -69,7 +69,7 @@ public final class CardScriptInfo {
public static CardScriptInfo getScriptFor(final String name) {
CardScriptInfo script = allScripts.get(name);
if (script == null) { //attempt to load script if not previously loaded
final String filename = name.toLowerCase().replaceAll("[^-a-z0-9\\s]","").replaceAll("[-\\s]","_").replaceAll("__","_") + ".txt";
final String filename = name.toLowerCase().replaceAll("[^-a-z0-9_\\s]","").replaceAll("[-\\s]","_").replaceAll("__","_") + ".txt";
String[] folders = {
ForgeConstants.CARD_DATA_DIR + File.separator + String.valueOf(filename.charAt(0)),
ForgeConstants.CARD_DATA_DIR + File.separator + "upcoming",