always show unimplemented card data, remove option and AllCardNames.txt
parent
4673cac98f
commit
bb2e06ce8e
13
Makefile
13
Makefile
|
@ -524,7 +524,6 @@ checks: \
|
||||||
check_requires_groovy_code \
|
check_requires_groovy_code \
|
||||||
check_script_name \
|
check_script_name \
|
||||||
check_tokens \
|
check_tokens \
|
||||||
check_all_cards \
|
|
||||||
check_unique_property \
|
check_unique_property \
|
||||||
check_required_property \
|
check_required_property \
|
||||||
check_spells \
|
check_spells \
|
||||||
|
@ -634,11 +633,6 @@ check_unused_choice:
|
||||||
diff declared-choices used-choices | ${NO_OUTPUT}
|
diff declared-choices used-choices | ${NO_OUTPUT}
|
||||||
rm declared-choices used-choices
|
rm declared-choices used-choices
|
||||||
|
|
||||||
check_all_cards:
|
|
||||||
diff \
|
|
||||||
<(grep "name=" `grep "token=\|^overlay" -Lr release/Magarena/scripts release/Magarena/scripts_missing` -h | sed 's/name=//' | sort | uniq) \
|
|
||||||
<(sort resources/magic/data/AllCardNames.txt)
|
|
||||||
|
|
||||||
check_mana_or_combat:
|
check_mana_or_combat:
|
||||||
diff \
|
diff \
|
||||||
<(grep mana_or_combat -lr release/Magarena/scripts) \
|
<(grep mana_or_combat -lr release/Magarena/scripts) \
|
||||||
|
@ -654,8 +648,8 @@ check_tap_tap:
|
||||||
grep "{T}, Tap" -ir release/Magarena/scripts | grep -v oracle | grep -iv "{T}, Tap another" | ${NO_OUTPUT}
|
grep "{T}, Tap" -ir release/Magarena/scripts | grep -v oracle | grep -iv "{T}, Tap another" | ${NO_OUTPUT}
|
||||||
|
|
||||||
check_no_extra_space:
|
check_no_extra_space:
|
||||||
grep "^[[:space:]]" resources/magic/data/AllCardNames.txt -r resources/magic/data/sets | ${NO_OUTPUT}
|
grep "^[[:space:]]" -r resources/magic/data/sets | ${NO_OUTPUT}
|
||||||
grep "[[:space:]]$$" resources/magic/data/AllCardNames.txt -r resources/magic/data/sets | ${NO_OUTPUT}
|
grep "[[:space:]]$$" -r resources/magic/data/sets | ${NO_OUTPUT}
|
||||||
|
|
||||||
crash.txt: $(wildcard *.log)
|
crash.txt: $(wildcard *.log)
|
||||||
for i in `grep "^Excep" -l $^`; do \
|
for i in `grep "^Excep" -l $^`; do \
|
||||||
|
@ -821,9 +815,6 @@ common_costs:
|
||||||
push: clean normalize_files checks debug
|
push: clean normalize_files checks debug
|
||||||
git push origin master
|
git push origin master
|
||||||
|
|
||||||
resources/magic/data/AllCardNames.txt:
|
|
||||||
grep "<name>" -r cards/cards.xml | sed 's/<[^>]*>//g;s/^ *//' | unaccent utf-8 | recode html..ascii | sort > $@
|
|
||||||
|
|
||||||
resources/magic/data/sets/%.txt:
|
resources/magic/data/sets/%.txt:
|
||||||
curl https://mtgjson.com/json/$*.json | jq -r .cards[].name | LC_ALL=C sort | uniq > $@
|
curl https://mtgjson.com/json/$*.json | jq -r .cards[].name | LC_ALL=C sort | uniq > $@
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -356,55 +356,15 @@ public class CardDefinitions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private static void loadMissingCards() {
|
||||||
* Returns a list of card names which have yet to be implemented.
|
|
||||||
* <p>
|
|
||||||
* {@code cardsMap} contains a list of current playable cards.
|
|
||||||
* {@code AllCardsNames.txt} contains the name of every possible playable card.
|
|
||||||
* The difference is a list of unimplemented cards.
|
|
||||||
*/
|
|
||||||
public static List<String> getMissingCardNames() throws IOException {
|
|
||||||
final List<String> missingCardNames = new ArrayList<>();
|
|
||||||
final InputStream stream = MagicResources.getAllCardNames();
|
|
||||||
try (final Scanner sc = new Scanner(stream, FileIO.UTF8.name())) {
|
|
||||||
while (sc.hasNextLine()) {
|
|
||||||
final String cardName = sc.nextLine();
|
|
||||||
if (!allPlayableCardDefs.containsKey(getASCII(cardName))) {
|
|
||||||
missingCardNames.add(cardName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return missingCardNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void loadMissingCards(final List<String> missingCardNames) {
|
|
||||||
|
|
||||||
final HashMap<String, MagicCardDefinition> missingScripts = new HashMap<>();
|
|
||||||
|
|
||||||
if (GeneralConfig.getInstance().showMissingCardData()) {
|
|
||||||
final File[] scriptFiles = getSortedMissingScriptFiles();
|
|
||||||
if (scriptFiles != null) {
|
|
||||||
for (final File file : scriptFiles) {
|
|
||||||
MagicCardDefinition cdef = prop2carddef(file, true);
|
|
||||||
missingScripts.put(cdef.getAsciiName(), cdef);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
missingCards = new HashMap<>();
|
missingCards = new HashMap<>();
|
||||||
for (String cardName : missingCardNames) {
|
final File[] scriptFiles = getSortedMissingScriptFiles();
|
||||||
final String cardKey = getASCII(cardName);
|
if (scriptFiles != null) {
|
||||||
if (missingScripts.containsKey(cardKey)) {
|
for (final File file : scriptFiles) {
|
||||||
missingCards.put(cardKey, missingScripts.get(cardKey));
|
MagicCardDefinition cdef = prop2carddef(file, true);
|
||||||
} else {
|
missingCards.put(cdef.getAsciiName(), cdef);
|
||||||
final MagicCardDefinition card = new MagicCardDefinition();
|
|
||||||
card.setName(cardName);
|
|
||||||
card.setDistinctName(cardName);
|
|
||||||
card.setInvalid();
|
|
||||||
missingCards.put(cardKey, card);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -463,15 +423,20 @@ public class CardDefinitions {
|
||||||
|
|
||||||
public static synchronized Collection<MagicCardDefinition> getMissingCards() {
|
public static synchronized Collection<MagicCardDefinition> getMissingCards() {
|
||||||
if (missingCards == null) {
|
if (missingCards == null) {
|
||||||
try {
|
loadMissingCards();
|
||||||
loadMissingCards(getMissingCardNames());
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return missingCards.values();
|
return missingCards.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<String> getMissingCardNames() {
|
||||||
|
List<String> names = new ArrayList<String>(missingCards.size());
|
||||||
|
for (final MagicCardDefinition cdef : getMissingCards()) {
|
||||||
|
names.add(cdef.getName());
|
||||||
|
}
|
||||||
|
return names;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void saveCardsSnapshotFile() {
|
private static void saveCardsSnapshotFile() {
|
||||||
MagicFileSystem.serializeStringList(getPlayableNonTokenCardNames(), CARDS_SNAPSHOT_FILE);
|
MagicFileSystem.serializeStringList(getPlayableNonTokenCardNames(), CARDS_SNAPSHOT_FILE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,9 +96,6 @@ public class GeneralConfig {
|
||||||
private static final String CUSTOM_BACKGROUND = "customBackground";
|
private static final String CUSTOM_BACKGROUND = "customBackground";
|
||||||
private boolean isCustomBackground = false;
|
private boolean isCustomBackground = false;
|
||||||
|
|
||||||
private static final String SHOW_MISSING_CARD_DATA = "showMissingCardData";
|
|
||||||
private boolean showMissingCardData = true;
|
|
||||||
|
|
||||||
private static final String CARD_IMAGES_PATH = "cardImagesPath";
|
private static final String CARD_IMAGES_PATH = "cardImagesPath";
|
||||||
private String cardImagesPath = "";
|
private String cardImagesPath = "";
|
||||||
|
|
||||||
|
@ -402,14 +399,6 @@ public class GeneralConfig {
|
||||||
isMulliganScreenActive = b;
|
isMulliganScreenActive = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean showMissingCardData() {
|
|
||||||
return showMissingCardData;
|
|
||||||
}
|
|
||||||
public void setShowMissingCardData(final boolean b) {
|
|
||||||
showMissingCardData = b;
|
|
||||||
CardDefinitions.resetMissingCardData();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getNewTurnAlertDuration() {
|
public int getNewTurnAlertDuration() {
|
||||||
return newTurnAlertDuration;
|
return newTurnAlertDuration;
|
||||||
}
|
}
|
||||||
|
@ -563,7 +552,6 @@ public class GeneralConfig {
|
||||||
isMulliganScreenActive = Boolean.parseBoolean(properties.getProperty(MULLIGAN_SCREEN, "" + isMulliganScreenActive));
|
isMulliganScreenActive = Boolean.parseBoolean(properties.getProperty(MULLIGAN_SCREEN, "" + isMulliganScreenActive));
|
||||||
mostRecentDeckFilename = properties.getProperty(RECENT_DECK, mostRecentDeckFilename).trim();
|
mostRecentDeckFilename = properties.getProperty(RECENT_DECK, mostRecentDeckFilename).trim();
|
||||||
isCustomBackground = Boolean.parseBoolean(properties.getProperty(CUSTOM_BACKGROUND, "" + isCustomBackground));
|
isCustomBackground = Boolean.parseBoolean(properties.getProperty(CUSTOM_BACKGROUND, "" + isCustomBackground));
|
||||||
showMissingCardData = Boolean.parseBoolean(properties.getProperty(SHOW_MISSING_CARD_DATA, "" + showMissingCardData));
|
|
||||||
cardImagesPath = properties.getProperty(CARD_IMAGES_PATH, cardImagesPath);
|
cardImagesPath = properties.getProperty(CARD_IMAGES_PATH, cardImagesPath);
|
||||||
animateGameplay = Boolean.parseBoolean(properties.getProperty(ANIMATE_GAMEPLAY, "" + animateGameplay));
|
animateGameplay = Boolean.parseBoolean(properties.getProperty(ANIMATE_GAMEPLAY, "" + animateGameplay));
|
||||||
deckFileMaxLines = Integer.parseInt(properties.getProperty(DECK_FILE_MAX_LINES, ""+ deckFileMaxLines));
|
deckFileMaxLines = Integer.parseInt(properties.getProperty(DECK_FILE_MAX_LINES, ""+ deckFileMaxLines));
|
||||||
|
@ -619,7 +607,6 @@ public class GeneralConfig {
|
||||||
properties.setProperty(MULLIGAN_SCREEN, String.valueOf(isMulliganScreenActive));
|
properties.setProperty(MULLIGAN_SCREEN, String.valueOf(isMulliganScreenActive));
|
||||||
properties.setProperty(RECENT_DECK, mostRecentDeckFilename);
|
properties.setProperty(RECENT_DECK, mostRecentDeckFilename);
|
||||||
properties.setProperty(CUSTOM_BACKGROUND, String.valueOf(isCustomBackground));
|
properties.setProperty(CUSTOM_BACKGROUND, String.valueOf(isCustomBackground));
|
||||||
properties.setProperty(SHOW_MISSING_CARD_DATA, String.valueOf(showMissingCardData));
|
|
||||||
properties.setProperty(CARD_IMAGES_PATH, cardImagesPath);
|
properties.setProperty(CARD_IMAGES_PATH, cardImagesPath);
|
||||||
properties.setProperty(ANIMATE_GAMEPLAY, String.valueOf(animateGameplay));
|
properties.setProperty(ANIMATE_GAMEPLAY, String.valueOf(animateGameplay));
|
||||||
properties.setProperty(PROXY_SETTINGS, proxySettings);
|
properties.setProperty(PROXY_SETTINGS, proxySettings);
|
||||||
|
|
|
@ -32,7 +32,6 @@ class GeneralPanel extends JPanel {
|
||||||
private final TranslationPanel langPanel;
|
private final TranslationPanel langPanel;
|
||||||
private final MCheckBox splitViewDeckEditorCheckBox;
|
private final MCheckBox splitViewDeckEditorCheckBox;
|
||||||
private final MCheckBox previewCardOnSelectCheckBox;
|
private final MCheckBox previewCardOnSelectCheckBox;
|
||||||
private final MCheckBox missingCardDataCheckbox;
|
|
||||||
private final PreferredSizePanel preferredSizePanel;
|
private final PreferredSizePanel preferredSizePanel;
|
||||||
private final DirectoryChooser imagesFolderChooser;
|
private final DirectoryChooser imagesFolderChooser;
|
||||||
private final MCheckBox imagesOnDemandCheckbox;
|
private final MCheckBox imagesOnDemandCheckbox;
|
||||||
|
@ -66,11 +65,6 @@ class GeneralPanel extends JPanel {
|
||||||
previewCardOnSelectCheckBox.setFocusable(false);
|
previewCardOnSelectCheckBox.setFocusable(false);
|
||||||
previewCardOnSelectCheckBox.addMouseListener(aListener);
|
previewCardOnSelectCheckBox.addMouseListener(aListener);
|
||||||
|
|
||||||
missingCardDataCheckbox = new MCheckBox(MText.get(_S61), config.showMissingCardData());
|
|
||||||
missingCardDataCheckbox.setToolTipText(MText.get(_S62));
|
|
||||||
missingCardDataCheckbox.setFocusable(false);
|
|
||||||
missingCardDataCheckbox.addMouseListener(aListener);
|
|
||||||
|
|
||||||
setLayout(new MigLayout("flowy, gapy 4, insets 16"));
|
setLayout(new MigLayout("flowy, gapy 4, insets 16"));
|
||||||
|
|
||||||
// lang
|
// lang
|
||||||
|
@ -85,7 +79,6 @@ class GeneralPanel extends JPanel {
|
||||||
add(getCaptionLabel(MText.get(_S64)), "gaptop 10");
|
add(getCaptionLabel(MText.get(_S64)), "gaptop 10");
|
||||||
add(splitViewDeckEditorCheckBox.component());
|
add(splitViewDeckEditorCheckBox.component());
|
||||||
add(previewCardOnSelectCheckBox.component());
|
add(previewCardOnSelectCheckBox.component());
|
||||||
add(missingCardDataCheckbox.component());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void saveSettings() {
|
void saveSettings() {
|
||||||
|
@ -94,7 +87,6 @@ class GeneralPanel extends JPanel {
|
||||||
config.setTranslation(langPanel.getSelectedLanguage());
|
config.setTranslation(langPanel.getSelectedLanguage());
|
||||||
config.setIsSplitViewDeckEditor(splitViewDeckEditorCheckBox.isSelected());
|
config.setIsSplitViewDeckEditor(splitViewDeckEditorCheckBox.isSelected());
|
||||||
config.setPreviewCardOnSelect(previewCardOnSelectCheckBox.isSelected());
|
config.setPreviewCardOnSelect(previewCardOnSelectCheckBox.isSelected());
|
||||||
config.setShowMissingCardData(missingCardDataCheckbox.isSelected());
|
|
||||||
config.setImagesOnDemand(imagesOnDemandCheckbox.isSelected());
|
config.setImagesOnDemand(imagesOnDemandCheckbox.isSelected());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,9 +122,7 @@ public class CardFilterPanel extends TexturedPanel
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean showUnsupportedFilter() {
|
private boolean showUnsupportedFilter() {
|
||||||
return isNotDeckEditor()
|
return isNotDeckEditor() && MText.isEnglish();
|
||||||
&& GeneralConfig.getInstance().showMissingCardData()
|
|
||||||
&& MText.isEnglish();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isCardfiltered(final MagicCardDefinition aCard) {
|
private boolean isCardfiltered(final MagicCardDefinition aCard) {
|
||||||
|
|
Loading…
Reference in New Issue