Colorless for color filter (#2737)
* Colorless for color filter Add 'colorless' as an option for color filter in deck editor / card list. * Remove empty quote check Empty quote does not work here. Add 'none' as optional string instead. * Add C to colorless filters
This commit is contained in:
parent
f75caa7245
commit
c5ac61c797
1 changed files with 7 additions and 0 deletions
|
@ -177,9 +177,16 @@ bool FilterItem::acceptColor(const CardInfo *info) const
|
||||||
converted_term.replace(QString("white"), QString("w"), Qt::CaseInsensitive);
|
converted_term.replace(QString("white"), QString("w"), Qt::CaseInsensitive);
|
||||||
converted_term.replace(QString("wht"), QString("w"), Qt::CaseInsensitive);
|
converted_term.replace(QString("wht"), QString("w"), Qt::CaseInsensitive);
|
||||||
converted_term.replace(QString(" "), QString(""), Qt::CaseInsensitive);
|
converted_term.replace(QString(" "), QString(""), Qt::CaseInsensitive);
|
||||||
|
|
||||||
|
if (converted_term.toLower() == "none" || converted_term.toLower() == "colorless" || converted_term.toLower() == "c") {
|
||||||
|
if (info->getColors().length() < 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* This is a tricky part, if the filter has multiple colors in it, like UGW,
|
/* This is a tricky part, if the filter has multiple colors in it, like UGW,
|
||||||
then we should match all of them to the card's colors */
|
then we should match all of them to the card's colors */
|
||||||
|
|
||||||
match_count = 0;
|
match_count = 0;
|
||||||
for (it = converted_term.begin(); it != converted_term.end(); it++) {
|
for (it = converted_term.begin(); it != converted_term.end(); it++) {
|
||||||
for (i = info->getColors().constBegin(); i != info->getColors().constEnd(); i++)
|
for (i = info->getColors().constBegin(); i != info->getColors().constEnd(); i++)
|
||||||
|
|
Loading…
Reference in a new issue