mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 02:53:56 -07:00
Re-add old names for mana value property to oracle (#5711)
This commit is contained in:
parent
a407c8b956
commit
b58b85dc0f
1 changed files with 10 additions and 3 deletions
|
|
@ -206,8 +206,9 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
||||||
{
|
{
|
||||||
// mtgjson name => xml name
|
// mtgjson name => xml name
|
||||||
static const QMap<QString, QString> cardProperties{
|
static const QMap<QString, QString> cardProperties{
|
||||||
{"manaCost", "manacost"}, {"manaValue", "cmc"}, {"type", "type"},
|
{"manaCost", "manacost"}, {"manaValue", "cmc"}, {"type", "type"},
|
||||||
{"loyalty", "loyalty"}, {"layout", "layout"}, {"side", "side"},
|
{"loyalty", "loyalty"}, {"layout", "layout"}, {"side", "side"},
|
||||||
|
{"convertedManaCost", "cmc"}, // old name for manaValue, for backwards compatibility
|
||||||
};
|
};
|
||||||
|
|
||||||
// mtgjson name => xml name
|
// mtgjson name => xml name
|
||||||
|
|
@ -349,7 +350,13 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
||||||
|
|
||||||
// add other face for split cards as card relation
|
// add other face for split cards as card relation
|
||||||
if (!getStringPropertyFromMap(card, "side").isEmpty()) {
|
if (!getStringPropertyFromMap(card, "side").isEmpty()) {
|
||||||
properties["cmc"] = getStringPropertyFromMap(card, "faceManaValue");
|
auto faceManaValue = getStringPropertyFromMap(card, "faceManaValue");
|
||||||
|
if (faceManaValue.isEmpty()) {
|
||||||
|
// check the old name for the property, for backwards compatibility purposes
|
||||||
|
faceManaValue = getStringPropertyFromMap(card, "faceConvertedManaCost");
|
||||||
|
}
|
||||||
|
properties["cmc"] = faceManaValue;
|
||||||
|
|
||||||
if (layout == "meld") { // meld cards don't work
|
if (layout == "meld") { // meld cards don't work
|
||||||
static const QRegularExpression meldNameRegex{"then meld them into ([^\\.]*)"};
|
static const QRegularExpression meldNameRegex{"then meld them into ([^\\.]*)"};
|
||||||
QString additionalName = meldNameRegex.match(text).captured(1);
|
QString additionalName = meldNameRegex.match(text).captured(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue