mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-11 04:43:56 -07:00
add new setting
This commit is contained in:
parent
9dabc3a02f
commit
9090bde6fd
5 changed files with 28 additions and 5 deletions
|
|
@ -261,6 +261,7 @@ SettingsCache::SettingsCache()
|
||||||
doubleClickToPlay = settings->value("interface/doubleclicktoplay", true).toBool();
|
doubleClickToPlay = settings->value("interface/doubleclicktoplay", true).toBool();
|
||||||
clickPlaysAllSelected = settings->value("interface/clickPlaysAllSelected", true).toBool();
|
clickPlaysAllSelected = settings->value("interface/clickPlaysAllSelected", true).toBool();
|
||||||
playToStack = settings->value("interface/playtostack", true).toBool();
|
playToStack = settings->value("interface/playtostack", true).toBool();
|
||||||
|
doNotDeleteArrowsInSubPhases = settings->value("interface/doNotDeleteArrowsInSubPhases", true).toBool();
|
||||||
startingHandSize = settings->value("interface/startinghandsize", 7).toInt();
|
startingHandSize = settings->value("interface/startinghandsize", 7).toInt();
|
||||||
annotateTokens = settings->value("interface/annotatetokens", false).toBool();
|
annotateTokens = settings->value("interface/annotatetokens", false).toBool();
|
||||||
tabGameSplitterSizes = settings->value("interface/tabgame_splittersizes").toByteArray();
|
tabGameSplitterSizes = settings->value("interface/tabgame_splittersizes").toByteArray();
|
||||||
|
|
@ -664,6 +665,12 @@ void SettingsCache::setPlayToStack(QT_STATE_CHANGED_T _playToStack)
|
||||||
settings->setValue("interface/playtostack", playToStack);
|
settings->setValue("interface/playtostack", playToStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingsCache::setDoNotDeleteArrowsInSubPhases(QT_STATE_CHANGED_T _doNotDeleteArrowsInSubPhases)
|
||||||
|
{
|
||||||
|
doNotDeleteArrowsInSubPhases = static_cast<bool>(_doNotDeleteArrowsInSubPhases);
|
||||||
|
settings->setValue("interface/doNotDeleteArrowsInSubPhases", doNotDeleteArrowsInSubPhases);
|
||||||
|
}
|
||||||
|
|
||||||
void SettingsCache::setStartingHandSize(int _startingHandSize)
|
void SettingsCache::setStartingHandSize(int _startingHandSize)
|
||||||
{
|
{
|
||||||
startingHandSize = _startingHandSize;
|
startingHandSize = _startingHandSize;
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,7 @@ private:
|
||||||
bool doubleClickToPlay;
|
bool doubleClickToPlay;
|
||||||
bool clickPlaysAllSelected;
|
bool clickPlaysAllSelected;
|
||||||
bool playToStack;
|
bool playToStack;
|
||||||
|
bool doNotDeleteArrowsInSubPhases;
|
||||||
int startingHandSize;
|
int startingHandSize;
|
||||||
bool annotateTokens;
|
bool annotateTokens;
|
||||||
QByteArray tabGameSplitterSizes;
|
QByteArray tabGameSplitterSizes;
|
||||||
|
|
@ -525,6 +526,10 @@ public:
|
||||||
{
|
{
|
||||||
return playToStack;
|
return playToStack;
|
||||||
}
|
}
|
||||||
|
bool getDoNotDeleteArrowsInSubPhases() const
|
||||||
|
{
|
||||||
|
return doNotDeleteArrowsInSubPhases;
|
||||||
|
}
|
||||||
int getStartingHandSize() const
|
int getStartingHandSize() const
|
||||||
{
|
{
|
||||||
return startingHandSize;
|
return startingHandSize;
|
||||||
|
|
@ -984,6 +989,7 @@ public slots:
|
||||||
void setDoubleClickToPlay(QT_STATE_CHANGED_T _doubleClickToPlay);
|
void setDoubleClickToPlay(QT_STATE_CHANGED_T _doubleClickToPlay);
|
||||||
void setClickPlaysAllSelected(QT_STATE_CHANGED_T _clickPlaysAllSelected);
|
void setClickPlaysAllSelected(QT_STATE_CHANGED_T _clickPlaysAllSelected);
|
||||||
void setPlayToStack(QT_STATE_CHANGED_T _playToStack);
|
void setPlayToStack(QT_STATE_CHANGED_T _playToStack);
|
||||||
|
void setDoNotDeleteArrowsInSubPhases(QT_STATE_CHANGED_T _doNotDeleteArrowsInSubPhases);
|
||||||
void setStartingHandSize(int _startingHandSize);
|
void setStartingHandSize(int _startingHandSize);
|
||||||
void setAnnotateTokens(QT_STATE_CHANGED_T _annotateTokens);
|
void setAnnotateTokens(QT_STATE_CHANGED_T _annotateTokens);
|
||||||
void setTabGameSplitterSizes(const QByteArray &_tabGameSplitterSizes);
|
void setTabGameSplitterSizes(const QByteArray &_tabGameSplitterSizes);
|
||||||
|
|
|
||||||
|
|
@ -801,6 +801,10 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
connect(&playToStackCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
connect(&playToStackCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
&SettingsCache::setPlayToStack);
|
&SettingsCache::setPlayToStack);
|
||||||
|
|
||||||
|
doNotDeleteArrowsInSubPhasesCheckBox.setChecked(SettingsCache::instance().getDoNotDeleteArrowsInSubPhases());
|
||||||
|
connect(&doNotDeleteArrowsInSubPhasesCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
|
&SettingsCache::setDoNotDeleteArrowsInSubPhases);
|
||||||
|
|
||||||
closeEmptyCardViewCheckBox.setChecked(SettingsCache::instance().getCloseEmptyCardView());
|
closeEmptyCardViewCheckBox.setChecked(SettingsCache::instance().getCloseEmptyCardView());
|
||||||
connect(&closeEmptyCardViewCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
connect(&closeEmptyCardViewCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||||
&SettingsCache::setCloseEmptyCardView);
|
&SettingsCache::setCloseEmptyCardView);
|
||||||
|
|
@ -821,10 +825,11 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
generalGrid->addWidget(&doubleClickToPlayCheckBox, 0, 0);
|
generalGrid->addWidget(&doubleClickToPlayCheckBox, 0, 0);
|
||||||
generalGrid->addWidget(&clickPlaysAllSelectedCheckBox, 1, 0);
|
generalGrid->addWidget(&clickPlaysAllSelectedCheckBox, 1, 0);
|
||||||
generalGrid->addWidget(&playToStackCheckBox, 2, 0);
|
generalGrid->addWidget(&playToStackCheckBox, 2, 0);
|
||||||
generalGrid->addWidget(&closeEmptyCardViewCheckBox, 3, 0);
|
generalGrid->addWidget(&doNotDeleteArrowsInSubPhasesCheckBox, 3, 0);
|
||||||
generalGrid->addWidget(&focusCardViewSearchBarCheckBox, 4, 0);
|
generalGrid->addWidget(&closeEmptyCardViewCheckBox, 4, 0);
|
||||||
generalGrid->addWidget(&annotateTokensCheckBox, 5, 0);
|
generalGrid->addWidget(&focusCardViewSearchBarCheckBox, 5, 0);
|
||||||
generalGrid->addWidget(&useTearOffMenusCheckBox, 6, 0);
|
generalGrid->addWidget(&annotateTokensCheckBox, 6, 0);
|
||||||
|
generalGrid->addWidget(&useTearOffMenusCheckBox, 7, 0);
|
||||||
|
|
||||||
generalGroupBox = new QGroupBox;
|
generalGroupBox = new QGroupBox;
|
||||||
generalGroupBox->setLayout(generalGrid);
|
generalGroupBox->setLayout(generalGrid);
|
||||||
|
|
@ -942,6 +947,7 @@ void UserInterfaceSettingsPage::retranslateUi()
|
||||||
doubleClickToPlayCheckBox.setText(tr("&Double-click cards to play them (instead of single-click)"));
|
doubleClickToPlayCheckBox.setText(tr("&Double-click cards to play them (instead of single-click)"));
|
||||||
clickPlaysAllSelectedCheckBox.setText(tr("&Clicking plays all selected cards (instead of just the clicked card)"));
|
clickPlaysAllSelectedCheckBox.setText(tr("&Clicking plays all selected cards (instead of just the clicked card)"));
|
||||||
playToStackCheckBox.setText(tr("&Play all nonlands onto the stack (not the battlefield) by default"));
|
playToStackCheckBox.setText(tr("&Play all nonlands onto the stack (not the battlefield) by default"));
|
||||||
|
doNotDeleteArrowsInSubPhasesCheckBox.setText(tr("Do not delete &arrows inside of subphases"));
|
||||||
closeEmptyCardViewCheckBox.setText(tr("Close card view window when last card is removed"));
|
closeEmptyCardViewCheckBox.setText(tr("Close card view window when last card is removed"));
|
||||||
focusCardViewSearchBarCheckBox.setText(tr("Auto focus search bar when card view window is opened"));
|
focusCardViewSearchBarCheckBox.setText(tr("Auto focus search bar when card view window is opened"));
|
||||||
annotateTokensCheckBox.setText(tr("Annotate card text on tokens"));
|
annotateTokensCheckBox.setText(tr("Annotate card text on tokens"));
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,7 @@ private:
|
||||||
QCheckBox doubleClickToPlayCheckBox;
|
QCheckBox doubleClickToPlayCheckBox;
|
||||||
QCheckBox clickPlaysAllSelectedCheckBox;
|
QCheckBox clickPlaysAllSelectedCheckBox;
|
||||||
QCheckBox playToStackCheckBox;
|
QCheckBox playToStackCheckBox;
|
||||||
|
QCheckBox doNotDeleteArrowsInSubPhasesCheckBox;
|
||||||
QCheckBox closeEmptyCardViewCheckBox;
|
QCheckBox closeEmptyCardViewCheckBox;
|
||||||
QCheckBox focusCardViewSearchBarCheckBox;
|
QCheckBox focusCardViewSearchBarCheckBox;
|
||||||
QCheckBox annotateTokensCheckBox;
|
QCheckBox annotateTokensCheckBox;
|
||||||
|
|
|
||||||
|
|
@ -182,6 +182,9 @@ void SettingsCache::setClickPlaysAllSelected(QT_STATE_CHANGED_T /* _clickPlaysAl
|
||||||
void SettingsCache::setPlayToStack(QT_STATE_CHANGED_T /* _playToStack */)
|
void SettingsCache::setPlayToStack(QT_STATE_CHANGED_T /* _playToStack */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void SettingsCache::setDoNotDeleteArrowsInSubPhases(QT_STATE_CHANGED_T /* _doNotDeleteArrowsInSubPhases */)
|
||||||
|
{
|
||||||
|
}
|
||||||
void SettingsCache::setStartingHandSize(int /* _startingHandSize */)
|
void SettingsCache::setStartingHandSize(int /* _startingHandSize */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -445,4 +448,4 @@ void SettingsCache::setRoundCardCorners(bool /* _roundCardCorners */)
|
||||||
|
|
||||||
void CardPictureLoader::clearPixmapCache(CardInfoPtr /* card */)
|
void CardPictureLoader::clearPixmapCache(CardInfoPtr /* card */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue