mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 16:13:54 -07:00
Merge branch 'master' into tooomm-qt5
This commit is contained in:
commit
9d4cf57c70
593 changed files with 12518 additions and 6581 deletions
|
|
@ -28,6 +28,7 @@ set(oracle_SOURCES
|
|||
../cockatrice/src/client/settings/card_counter_settings.cpp
|
||||
../cockatrice/src/client/settings/shortcuts_settings.cpp
|
||||
../cockatrice/src/client/network/update/client/release_channel.cpp
|
||||
../cockatrice/src/interface/theme_config.cpp
|
||||
../cockatrice/src/interface/theme_manager.cpp
|
||||
../cockatrice/src/interface/widgets/quick_settings/settings_button_widget.cpp
|
||||
../cockatrice/src/interface/widgets/quick_settings/settings_popup_widget.cpp
|
||||
|
|
|
|||
|
|
@ -124,10 +124,11 @@ static void sortAndReduceColors(QString &colors)
|
|||
// reduce
|
||||
QChar lastChar = '\0';
|
||||
for (int i = 0; i < colors.size(); ++i) {
|
||||
if (colors.at(i) == lastChar)
|
||||
if (colors.at(i) == lastChar) {
|
||||
colors.remove(i, 1);
|
||||
else
|
||||
} else {
|
||||
lastChar = colors.at(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -191,12 +192,13 @@ CardInfoPtr OracleImporter::addCard(QString name,
|
|||
// table row
|
||||
int tableRow = 1;
|
||||
QString mainCardType = properties.value("maintype").toString();
|
||||
if (mainCardType == "Land")
|
||||
if (mainCardType == "Land") {
|
||||
tableRow = 0;
|
||||
else if (mainCardType == "Sorcery" || mainCardType == "Instant")
|
||||
} else if (mainCardType == "Sorcery" || mainCardType == "Instant") {
|
||||
tableRow = 3;
|
||||
else if (mainCardType == "Creature")
|
||||
} else if (mainCardType == "Creature") {
|
||||
tableRow = 2;
|
||||
}
|
||||
|
||||
// card side
|
||||
QString side = properties.value("side").toString() == "b" ? "back" : "front";
|
||||
|
|
@ -282,8 +284,9 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
|||
QString mtgjsonProperty = i.key();
|
||||
QString xmlPropertyName = i.value();
|
||||
QString propertyValue = getStringPropertyFromMap(card, mtgjsonProperty);
|
||||
if (!propertyValue.isEmpty())
|
||||
if (!propertyValue.isEmpty()) {
|
||||
properties.insert(xmlPropertyName, propertyValue);
|
||||
}
|
||||
}
|
||||
|
||||
// per-set properties
|
||||
|
|
@ -292,8 +295,9 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
|||
QString mtgjsonProperty = i.key();
|
||||
QString xmlPropertyName = i.value();
|
||||
QString propertyValue = getStringPropertyFromMap(card, mtgjsonProperty);
|
||||
if (!propertyValue.isEmpty())
|
||||
if (!propertyValue.isEmpty()) {
|
||||
printingInfo.setProperty(xmlPropertyName, propertyValue);
|
||||
}
|
||||
}
|
||||
|
||||
// handle flavorNames specially due to double-faced cards
|
||||
|
|
@ -469,8 +473,8 @@ FormatRulesNameMap OracleImporter::createDefaultMagicFormats()
|
|||
// Predefined common exceptions
|
||||
CardCondition superTypeIsBasic;
|
||||
superTypeIsBasic.field = "type";
|
||||
superTypeIsBasic.matchType = "contains";
|
||||
superTypeIsBasic.value = "Basic Land";
|
||||
superTypeIsBasic.matchType = "regex";
|
||||
superTypeIsBasic.value = "\bBasic\b[^—]+\bLand\b";
|
||||
|
||||
ExceptionRule basicLands;
|
||||
basicLands.conditions.append(superTypeIsBasic);
|
||||
|
|
@ -544,8 +548,9 @@ int OracleImporter::startImport()
|
|||
CardSetPtr newSet = CardSet::newInstance(noOpController, curSetToParse.getShortName(),
|
||||
curSetToParse.getLongName(), curSetToParse.getSetType(),
|
||||
curSetToParse.getReleaseDate(), curSetToParse.getPriority());
|
||||
if (!sets.contains(newSet->getShortName()))
|
||||
if (!sets.contains(newSet->getShortName())) {
|
||||
sets.insert(newSet->getShortName(), newSet);
|
||||
}
|
||||
|
||||
int numCardsInSet = importCardsFromSet(newSet, curSetToParse.getCards());
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ protected:
|
|||
inline OracleWizard *wizard()
|
||||
{
|
||||
return (OracleWizard *)QWizardPage::wizard();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
class SimpleDownloadFilePage : public OracleWizardPage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue