mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 09:33:57 -07:00
rename manaCost field
This commit is contained in:
parent
3e9d1e18a6
commit
2db9dd2937
2 changed files with 8 additions and 8 deletions
|
|
@ -9,8 +9,8 @@
|
|||
#include <QResizeEvent>
|
||||
#include <QSize>
|
||||
|
||||
ColorIdentityWidget::ColorIdentityWidget(QWidget *parent, const QString &_manaCost)
|
||||
: QWidget(parent), manaCost(_manaCost)
|
||||
ColorIdentityWidget::ColorIdentityWidget(QWidget *parent, const QString &_colorIdentity)
|
||||
: QWidget(parent), colorIdentity(_colorIdentity)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
layout->setSpacing(5); // Small spacing between icons
|
||||
|
|
@ -28,7 +28,7 @@ void ColorIdentityWidget::populateManaSymbolWidgets()
|
|||
{
|
||||
// Define the full WUBRG set (White, Blue, Black, Red, Green)
|
||||
QString fullColorIdentity = "WUBRG";
|
||||
QStringList symbols = parseColorIdentity(manaCost); // Parse mana cost string
|
||||
QStringList symbols = parseColorIdentity(colorIdentity); // Parse mana cost string
|
||||
|
||||
// clear old layout
|
||||
for (auto widgets : layout->findChildren<ManaSymbolWidget *>()) {
|
||||
|
|
@ -49,9 +49,9 @@ void ColorIdentityWidget::populateManaSymbolWidgets()
|
|||
}
|
||||
}
|
||||
|
||||
void ColorIdentityWidget::setColorIdentity(const QString &manaString)
|
||||
void ColorIdentityWidget::setColorIdentity(const QString &_colorIdentity)
|
||||
{
|
||||
manaCost = manaString;
|
||||
colorIdentity = _colorIdentity;
|
||||
populateManaSymbolWidgets();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,18 +15,18 @@ class ColorIdentityWidget : public QWidget
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ColorIdentityWidget(QWidget *parent, const QString &manaCost = "");
|
||||
explicit ColorIdentityWidget(QWidget *parent, const QString &_colorIdentity = "");
|
||||
void populateManaSymbolWidgets();
|
||||
|
||||
static QStringList parseColorIdentity(const QString &manaString);
|
||||
|
||||
public slots:
|
||||
void setColorIdentity(const QString &manaString);
|
||||
void setColorIdentity(const QString &_colorIdentity);
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void toggleUnusedVisibility();
|
||||
|
||||
private:
|
||||
QString manaCost;
|
||||
QString colorIdentity;
|
||||
QHBoxLayout *layout;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue