mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 05:20:00 -08:00
Replace legacy WUBRG visual deck filter with all fifteen Essence symbols
This commit is contained in:
parent
ba7da5ef8f
commit
a950a1cf7f
1 changed files with 10 additions and 6 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
#include "../cards/additional_info/mana_symbol_widget.h"
|
#include "../cards/additional_info/mana_symbol_widget.h"
|
||||||
#include "filter_tree_model.h"
|
#include "filter_tree_model.h"
|
||||||
#include "libcockatrice/filters/filter_card.h"
|
#include "libcockatrice/filters/filter_card.h"
|
||||||
|
#include <libcockatrice/card/essence_types.h>
|
||||||
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
|
|
@ -26,13 +27,16 @@ VisualDatabaseDisplayColorFilterWidget::VisualDatabaseDisplayColorFilterWidget(Q
|
||||||
: QWidget(parent), filterModel(_filterModel), layout(new QHBoxLayout(this))
|
: QWidget(parent), filterModel(_filterModel), layout(new QHBoxLayout(this))
|
||||||
{
|
{
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
layout->setSpacing(5);
|
layout->setSpacing(3);
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
QString fullColorIdentity = "WUBRG";
|
// All fifteen Continuum Universes Essence types are filterable.
|
||||||
for (const QChar &color : fullColorIdentity) {
|
// Never fall back to MTG's five-color WUBRG control. N is colorless.
|
||||||
auto *manaSymbol = new ManaSymbolWidget(this, color, false, true);
|
for (const QChar essence : Essence::symbols()) {
|
||||||
manaSymbol->setFixedWidth(25);
|
auto *manaSymbol = new ManaSymbolWidget(this, QString(essence), false, true);
|
||||||
|
manaSymbol->setFixedSize(22, 22);
|
||||||
|
manaSymbol->setToolTip(essence == QChar('N') ? tr("N — Colorless Essence")
|
||||||
|
: tr("Essence %1").arg(essence));
|
||||||
|
|
||||||
layout->addWidget(manaSymbol);
|
layout->addWidget(manaSymbol);
|
||||||
|
|
||||||
|
|
@ -63,7 +67,7 @@ void VisualDatabaseDisplayColorFilterWidget::retranslateUi()
|
||||||
modeComboBox->addItem(tr("Includes"), QVariant::fromValue(FilterMode::Includes));
|
modeComboBox->addItem(tr("Includes"), QVariant::fromValue(FilterMode::Includes));
|
||||||
modeComboBox->addItem(tr("Include / Exclude"), QVariant::fromValue(FilterMode::IncludeExclude));
|
modeComboBox->addItem(tr("Include / Exclude"), QVariant::fromValue(FilterMode::IncludeExclude));
|
||||||
|
|
||||||
modeComboBox->setToolTip(tr("How selected and unselected colors are combined in the filter"));
|
modeComboBox->setToolTip(tr("How selected and unselected Essence types are combined in the filter"));
|
||||||
|
|
||||||
// Restore current mode
|
// Restore current mode
|
||||||
const int index = modeComboBox->findData(QVariant::fromValue(currentMode));
|
const int index = modeComboBox->findData(QVariant::fromValue(currentMode));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue