update token dlg

This commit is contained in:
RickyRister 2025-04-06 03:19:08 -07:00
parent 069662123d
commit 91e5b0483f
2 changed files with 8 additions and 1 deletions

View file

@ -63,6 +63,9 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
destroyCheckBox = new QCheckBox(tr("&Destroy token when it leaves the table")); destroyCheckBox = new QCheckBox(tr("&Destroy token when it leaves the table"));
destroyCheckBox->setChecked(true); destroyCheckBox->setChecked(true);
faceDownCheckBox = new QCheckBox(tr("Create face-down token"));
faceDownCheckBox->setChecked(false);
QGridLayout *grid = new QGridLayout; QGridLayout *grid = new QGridLayout;
grid->addWidget(nameLabel, 0, 0); grid->addWidget(nameLabel, 0, 0);
grid->addWidget(nameEdit, 0, 1); grid->addWidget(nameEdit, 0, 1);
@ -73,6 +76,7 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
grid->addWidget(annotationLabel, 3, 0); grid->addWidget(annotationLabel, 3, 0);
grid->addWidget(annotationEdit, 3, 1); grid->addWidget(annotationEdit, 3, 1);
grid->addWidget(destroyCheckBox, 4, 0, 1, 2); grid->addWidget(destroyCheckBox, 4, 0, 1, 2);
grid->addWidget(faceDownCheckBox, 5, 0, 1, 2);
QGroupBox *tokenDataGroupBox = new QGroupBox(tr("Token data")); QGroupBox *tokenDataGroupBox = new QGroupBox(tr("Token data"));
tokenDataGroupBox->setLayout(grid); tokenDataGroupBox->setLayout(grid);
@ -230,5 +234,6 @@ TokenInfo DlgCreateToken::getTokenInfo() const
.color = colorEdit->itemData(colorEdit->currentIndex()).toString(), .color = colorEdit->itemData(colorEdit->currentIndex()).toString(),
.pt = ptEdit->text(), .pt = ptEdit->text(),
.annotation = annotationEdit->text(), .annotation = annotationEdit->text(),
.destroy = destroyCheckBox->isChecked()}; .destroy = destroyCheckBox->isChecked(),
.faceDown = faceDownCheckBox->isChecked()};
} }

View file

@ -24,6 +24,7 @@ struct TokenInfo
QString pt; QString pt;
QString annotation; QString annotation;
bool destroy = true; bool destroy = true;
bool faceDown = false;
}; };
class DlgCreateToken : public QDialog class DlgCreateToken : public QDialog
@ -51,6 +52,7 @@ private:
QComboBox *colorEdit; QComboBox *colorEdit;
QLineEdit *nameEdit, *ptEdit, *annotationEdit; QLineEdit *nameEdit, *ptEdit, *annotationEdit;
QCheckBox *destroyCheckBox; QCheckBox *destroyCheckBox;
QCheckBox *faceDownCheckBox;
QRadioButton *chooseTokenFromAllRadioButton, *chooseTokenFromDeckRadioButton; QRadioButton *chooseTokenFromAllRadioButton, *chooseTokenFromDeckRadioButton;
CardInfoPictureWidget *pic; CardInfoPictureWidget *pic;
QTreeView *chooseTokenView; QTreeView *chooseTokenView;