mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-23 10:05:10 -07:00
Compare commits
4 commits
21871ffbae
...
fb397bbb9b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb397bbb9b | ||
|
|
3c03d740f3 | ||
|
|
03de1af678 | ||
|
|
3dc9dba67a |
21 changed files with 342 additions and 162 deletions
|
|
@ -154,6 +154,48 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
||||||
homeTabGroupBox = new QGroupBox;
|
homeTabGroupBox = new QGroupBox;
|
||||||
homeTabGroupBox->setLayout(homeTabGrid);
|
homeTabGroupBox->setLayout(homeTabGrid);
|
||||||
|
|
||||||
|
// Playmat settings
|
||||||
|
playmatVisibilityCombo.addItem(tr("Show all playmats"), PlaymatVisibilityAll);
|
||||||
|
playmatVisibilityCombo.addItem(tr("Show own playmat only"), PlaymatVisibilityOwnOnly);
|
||||||
|
playmatVisibilityCombo.addItem(tr("Don't use playmats"), PlaymatVisibilityNone);
|
||||||
|
int visIdx = playmatVisibilityCombo.findData(settings.userInterface().getPlaymatVisibility());
|
||||||
|
if (visIdx >= 0) {
|
||||||
|
playmatVisibilityCombo.setCurrentIndex(visIdx);
|
||||||
|
}
|
||||||
|
connect(&playmatVisibilityCombo, qOverload<int>(&QComboBox::currentIndexChanged), this, [this](int index) {
|
||||||
|
SettingsCache::instance().userInterface().setPlaymatVisibility(playmatVisibilityCombo.itemData(index).toInt());
|
||||||
|
});
|
||||||
|
playmatVisibilityLabel.setBuddy(&playmatVisibilityCombo);
|
||||||
|
|
||||||
|
// Playmat mode: Override / Fallback / Deck-only
|
||||||
|
playmatModeCombo.addItem(tr("Override deck playmat"), PlaymatModeOverrideDeck);
|
||||||
|
playmatModeCombo.addItem(tr("Fallback if deck has none"), PlaymatModeFallback);
|
||||||
|
playmatModeCombo.addItem(tr("Deck only, ignore collection"), PlaymatModeDeckOnly);
|
||||||
|
int modeIdx = playmatModeCombo.findData(settings.userInterface().getPlaymatMode());
|
||||||
|
if (modeIdx >= 0) {
|
||||||
|
playmatModeCombo.setCurrentIndex(modeIdx);
|
||||||
|
}
|
||||||
|
connect(&playmatModeCombo, qOverload<int>(&QComboBox::currentIndexChanged), this, [this](int index) {
|
||||||
|
SettingsCache::instance().userInterface().setPlaymatMode(playmatModeCombo.itemData(index).toInt());
|
||||||
|
});
|
||||||
|
playmatModeLabel.setBuddy(&playmatModeCombo);
|
||||||
|
|
||||||
|
// User-level playmat settings: fallback collection.
|
||||||
|
connect(&playmatDefaultEditButton, &QPushButton::clicked, this,
|
||||||
|
&AppearanceSettingsPage::openPlaymatCollectionDialog);
|
||||||
|
|
||||||
|
auto *playmatGrid = new QGridLayout;
|
||||||
|
playmatGrid->addWidget(&playmatVisibilityLabel, 0, 0, 1, 1);
|
||||||
|
playmatGrid->addWidget(&playmatVisibilityCombo, 0, 1, 1, 1);
|
||||||
|
playmatGrid->addWidget(&playmatModeLabel, 1, 0, 1, 1);
|
||||||
|
playmatGrid->addWidget(&playmatModeCombo, 1, 1, 1, 1);
|
||||||
|
playmatGrid->addWidget(&playmatDefaultLabel, 2, 0, 1, 1);
|
||||||
|
playmatGrid->addWidget(&playmatDefaultEditButton, 2, 1, 1, 1);
|
||||||
|
|
||||||
|
playmatGroupBox = new QGroupBox;
|
||||||
|
playmatGroupBox->setLayout(playmatGrid);
|
||||||
|
|
||||||
|
// Styling settings
|
||||||
styleUserListCheckBox.setChecked(settings.appearance().getStyleUserList());
|
styleUserListCheckBox.setChecked(settings.appearance().getStyleUserList());
|
||||||
connect(&styleUserListCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.appearance(),
|
connect(&styleUserListCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.appearance(),
|
||||||
&AppearanceSettings::setStyleUserList);
|
&AppearanceSettings::setStyleUserList);
|
||||||
|
|
@ -259,7 +301,6 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
||||||
cardLayoutGroupBox->setLayout(cardLayoutGrid);
|
cardLayoutGroupBox->setLayout(cardLayoutGrid);
|
||||||
|
|
||||||
// Card counter colors
|
// Card counter colors
|
||||||
|
|
||||||
auto *cardCounterColorsLayout = new QGridLayout;
|
auto *cardCounterColorsLayout = new QGridLayout;
|
||||||
cardCounterColorsLayout->setColumnStretch(1, 1);
|
cardCounterColorsLayout->setColumnStretch(1, 1);
|
||||||
cardCounterColorsLayout->setColumnStretch(3, 1);
|
cardCounterColorsLayout->setColumnStretch(3, 1);
|
||||||
|
|
@ -339,47 +380,6 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
||||||
tableGroupBox = new QGroupBox;
|
tableGroupBox = new QGroupBox;
|
||||||
tableGroupBox->setLayout(tableGrid);
|
tableGroupBox->setLayout(tableGrid);
|
||||||
|
|
||||||
// Playmat settings
|
|
||||||
playmatVisibilityCombo.addItem(tr("Show all playmats"), PlaymatVisibilityAll);
|
|
||||||
playmatVisibilityCombo.addItem(tr("Show own playmat only"), PlaymatVisibilityOwnOnly);
|
|
||||||
playmatVisibilityCombo.addItem(tr("Don't use playmats"), PlaymatVisibilityNone);
|
|
||||||
int visIdx = playmatVisibilityCombo.findData(settings.userInterface().getPlaymatVisibility());
|
|
||||||
if (visIdx >= 0) {
|
|
||||||
playmatVisibilityCombo.setCurrentIndex(visIdx);
|
|
||||||
}
|
|
||||||
connect(&playmatVisibilityCombo, qOverload<int>(&QComboBox::currentIndexChanged), this, [this](int index) {
|
|
||||||
SettingsCache::instance().userInterface().setPlaymatVisibility(playmatVisibilityCombo.itemData(index).toInt());
|
|
||||||
});
|
|
||||||
playmatVisibilityLabel.setBuddy(&playmatVisibilityCombo);
|
|
||||||
|
|
||||||
// Playmat mode: Override / Fallback / Deck-only
|
|
||||||
playmatModeCombo.addItem(tr("Override deck playmat"), PlaymatModeOverrideDeck);
|
|
||||||
playmatModeCombo.addItem(tr("Fallback if deck has none"), PlaymatModeFallback);
|
|
||||||
playmatModeCombo.addItem(tr("Deck only, ignore collection"), PlaymatModeDeckOnly);
|
|
||||||
int modeIdx = playmatModeCombo.findData(settings.userInterface().getPlaymatMode());
|
|
||||||
if (modeIdx >= 0) {
|
|
||||||
playmatModeCombo.setCurrentIndex(modeIdx);
|
|
||||||
}
|
|
||||||
connect(&playmatModeCombo, qOverload<int>(&QComboBox::currentIndexChanged), this, [this](int index) {
|
|
||||||
SettingsCache::instance().userInterface().setPlaymatMode(playmatModeCombo.itemData(index).toInt());
|
|
||||||
});
|
|
||||||
playmatModeLabel.setBuddy(&playmatModeCombo);
|
|
||||||
|
|
||||||
// User-level playmat settings: fallback collection.
|
|
||||||
connect(&playmatDefaultEditButton, &QPushButton::clicked, this,
|
|
||||||
&AppearanceSettingsPage::openPlaymatCollectionDialog);
|
|
||||||
|
|
||||||
auto *playmatGrid = new QGridLayout;
|
|
||||||
playmatGrid->addWidget(&playmatVisibilityLabel, 0, 0, 1, 1);
|
|
||||||
playmatGrid->addWidget(&playmatVisibilityCombo, 0, 1, 1, 1);
|
|
||||||
playmatGrid->addWidget(&playmatModeLabel, 1, 0, 1, 1);
|
|
||||||
playmatGrid->addWidget(&playmatModeCombo, 1, 1, 1, 1);
|
|
||||||
playmatGrid->addWidget(&playmatDefaultLabel, 2, 0, 1, 1);
|
|
||||||
playmatGrid->addWidget(&playmatDefaultEditButton, 2, 1, 1, 1);
|
|
||||||
|
|
||||||
playmatGroupBox = new QGroupBox;
|
|
||||||
playmatGroupBox->setLayout(playmatGrid);
|
|
||||||
|
|
||||||
// putting it all together
|
// putting it all together
|
||||||
auto *mainLayout = new QVBoxLayout;
|
auto *mainLayout = new QVBoxLayout;
|
||||||
mainLayout->addWidget(themeGroupBox);
|
mainLayout->addWidget(themeGroupBox);
|
||||||
|
|
@ -512,6 +512,12 @@ void AppearanceSettingsPage::retranslateUi()
|
||||||
homeTabButtonColorSourceBox.setToolTip(
|
homeTabButtonColorSourceBox.setToolTip(
|
||||||
tr("Automatic: extract from background if present, otherwise use theme default"));
|
tr("Automatic: extract from background if present, otherwise use theme default"));
|
||||||
|
|
||||||
|
playmatGroupBox->setTitle(tr("Playmat settings"));
|
||||||
|
playmatVisibilityLabel.setText(tr("Playmat visibility:"));
|
||||||
|
playmatModeLabel.setText(tr("Default collection behavior:"));
|
||||||
|
playmatDefaultLabel.setText(tr("Default playmat collection:"));
|
||||||
|
playmatDefaultEditButton.setText(tr("Edit..."));
|
||||||
|
|
||||||
stylingGroupBox->setTitle(tr("Styling settings"));
|
stylingGroupBox->setTitle(tr("Styling settings"));
|
||||||
styleUserListCheckBox.setText(tr("Style user list"));
|
styleUserListCheckBox.setText(tr("Style user list"));
|
||||||
|
|
||||||
|
|
@ -554,9 +560,4 @@ void AppearanceSettingsPage::retranslateUi()
|
||||||
tableGroupBox->setTitle(tr("Table grid layout"));
|
tableGroupBox->setTitle(tr("Table grid layout"));
|
||||||
invertVerticalCoordinateCheckBox.setText(tr("Invert vertical coordinate"));
|
invertVerticalCoordinateCheckBox.setText(tr("Invert vertical coordinate"));
|
||||||
minPlayersForMultiColumnLayoutLabel.setText(tr("Minimum player count for multi-column layout:"));
|
minPlayersForMultiColumnLayoutLabel.setText(tr("Minimum player count for multi-column layout:"));
|
||||||
playmatGroupBox->setTitle(tr("Playmat settings"));
|
|
||||||
playmatVisibilityLabel.setText(tr("Playmat visibility:"));
|
|
||||||
playmatModeLabel.setText(tr("Default collection behavior:"));
|
|
||||||
playmatDefaultLabel.setText(tr("Default playmat collection:"));
|
|
||||||
playmatDefaultEditButton.setText(tr("Edit..."));
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,46 +44,55 @@ private:
|
||||||
QLabel homeTabButtonColorSourceLabel;
|
QLabel homeTabButtonColorSourceLabel;
|
||||||
QComboBox homeTabButtonColorSourceBox;
|
QComboBox homeTabButtonColorSourceBox;
|
||||||
|
|
||||||
QCheckBox styleUserListCheckBox;
|
|
||||||
QCheckBox showShortcutsCheckBox;
|
|
||||||
QCheckBox showGameSelectorFilterToolbarCheckBox;
|
|
||||||
QLabel minPlayersForMultiColumnLayoutLabel;
|
|
||||||
QLabel maxFontSizeForCardsLabel;
|
|
||||||
QCheckBox overrideAllCardArtWithPersonalPreferenceCheckBox;
|
|
||||||
QCheckBox bumpSetsWithCardsInDeckToTopCheckBox;
|
|
||||||
QCheckBox displayCardNamesCheckBox;
|
|
||||||
QCheckBox autoRotateSidewaysLayoutCardsCheckBox;
|
|
||||||
QCheckBox cardScalingCheckBox;
|
|
||||||
QCheckBox roundCardCornersCheckBox;
|
|
||||||
QLabel verticalCardOverlapPercentLabel;
|
|
||||||
QSpinBox verticalCardOverlapPercentBox;
|
|
||||||
QLabel cardViewInitialRowsMaxLabel;
|
|
||||||
QSpinBox cardViewInitialRowsMaxBox;
|
|
||||||
QLabel cardViewExpandedRowsMaxLabel;
|
|
||||||
QSpinBox cardViewExpandedRowsMaxBox;
|
|
||||||
QCheckBox horizontalHandCheckBox;
|
|
||||||
QCheckBox leftJustifiedHandCheckBox;
|
|
||||||
QCheckBox invertVerticalCoordinateCheckBox;
|
|
||||||
QLabel playmatVisibilityLabel;
|
QLabel playmatVisibilityLabel;
|
||||||
QComboBox playmatVisibilityCombo;
|
QComboBox playmatVisibilityCombo;
|
||||||
QLabel playmatModeLabel;
|
QLabel playmatModeLabel;
|
||||||
QComboBox playmatModeCombo;
|
QComboBox playmatModeCombo;
|
||||||
QLabel playmatDefaultLabel;
|
QLabel playmatDefaultLabel;
|
||||||
QPushButton playmatDefaultEditButton;
|
QPushButton playmatDefaultEditButton;
|
||||||
|
|
||||||
|
QCheckBox styleUserListCheckBox;
|
||||||
|
|
||||||
|
QCheckBox showShortcutsCheckBox;
|
||||||
|
QCheckBox showGameSelectorFilterToolbarCheckBox;
|
||||||
|
|
||||||
|
QCheckBox overrideAllCardArtWithPersonalPreferenceCheckBox;
|
||||||
|
QCheckBox bumpSetsWithCardsInDeckToTopCheckBox;
|
||||||
|
|
||||||
|
QCheckBox displayCardNamesCheckBox;
|
||||||
|
QCheckBox autoRotateSidewaysLayoutCardsCheckBox;
|
||||||
|
QCheckBox cardScalingCheckBox;
|
||||||
|
QCheckBox roundCardCornersCheckBox;
|
||||||
|
QLabel maxFontSizeForCardsLabel;
|
||||||
|
QSpinBox maxFontSizeForCardsEdit;
|
||||||
|
|
||||||
|
QLabel verticalCardOverlapPercentLabel;
|
||||||
|
QSpinBox verticalCardOverlapPercentBox;
|
||||||
|
QLabel cardViewInitialRowsMaxLabel;
|
||||||
|
QSpinBox cardViewInitialRowsMaxBox;
|
||||||
|
QLabel cardViewExpandedRowsMaxLabel;
|
||||||
|
QSpinBox cardViewExpandedRowsMaxBox;
|
||||||
|
|
||||||
|
QList<QLabel *> cardCounterNames;
|
||||||
|
|
||||||
|
QCheckBox horizontalHandCheckBox;
|
||||||
|
QCheckBox leftJustifiedHandCheckBox;
|
||||||
|
|
||||||
|
QCheckBox invertVerticalCoordinateCheckBox;
|
||||||
|
QLabel minPlayersForMultiColumnLayoutLabel;
|
||||||
|
QSpinBox minPlayersForMultiColumnLayoutEdit;
|
||||||
|
|
||||||
QGroupBox *themeGroupBox;
|
QGroupBox *themeGroupBox;
|
||||||
QGroupBox *homeTabGroupBox;
|
QGroupBox *homeTabGroupBox;
|
||||||
|
QGroupBox *playmatGroupBox;
|
||||||
QGroupBox *stylingGroupBox;
|
QGroupBox *stylingGroupBox;
|
||||||
QGroupBox *menuGroupBox;
|
QGroupBox *menuGroupBox;
|
||||||
QGroupBox *printingsGroupBox;
|
QGroupBox *printingsGroupBox;
|
||||||
QGroupBox *cardsGroupBox;
|
QGroupBox *cardsGroupBox;
|
||||||
QGroupBox *cardLayoutGroupBox;
|
QGroupBox *cardLayoutGroupBox;
|
||||||
QGroupBox *handGroupBox;
|
|
||||||
QGroupBox *playmatGroupBox;
|
|
||||||
QGroupBox *tableGroupBox;
|
|
||||||
QGroupBox *cardCountersGroupBox;
|
QGroupBox *cardCountersGroupBox;
|
||||||
QList<QLabel *> cardCounterNames;
|
QGroupBox *handGroupBox;
|
||||||
QSpinBox minPlayersForMultiColumnLayoutEdit;
|
QGroupBox *tableGroupBox;
|
||||||
QSpinBox maxFontSizeForCardsEdit;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AppearanceSettingsPage();
|
AppearanceSettingsPage();
|
||||||
|
|
|
||||||
|
|
@ -425,29 +425,28 @@ void GeneralSettingsPage::updateStartupServerControlsVisibility()
|
||||||
|
|
||||||
void GeneralSettingsPage::retranslateUi()
|
void GeneralSettingsPage::retranslateUi()
|
||||||
{
|
{
|
||||||
|
const auto &settings = SettingsCache::instance();
|
||||||
|
|
||||||
languageGroupBox->setTitle(tr("Language settings"));
|
languageGroupBox->setTitle(tr("Language settings"));
|
||||||
languageLabel.setText(tr("Language:"));
|
languageLabel.setText(tr("Language:"));
|
||||||
|
|
||||||
versionGroupBox->setTitle(tr("Version settings"));
|
|
||||||
cardDatabaseGroupBox->setTitle(tr("Card database"));
|
|
||||||
startupGroupBox->setTitle(tr("Startup settings"));
|
|
||||||
|
|
||||||
if (SettingsCache::instance().getIsPortableBuild()) {
|
|
||||||
pathsGroupBox->setTitle(tr("Paths (editing disabled in portable mode)"));
|
|
||||||
} else {
|
|
||||||
pathsGroupBox->setTitle(tr("Paths"));
|
|
||||||
}
|
|
||||||
advertiseTranslationPageLabel.setText(
|
advertiseTranslationPageLabel.setText(
|
||||||
QString("<a href='%1'>%2</a>").arg(WIKI_TRANSLATION_FAQ).arg(tr("How to help with translations")));
|
QString("<a href='%1'>%2</a>").arg(WIKI_TRANSLATION_FAQ).arg(tr("How to help with translations")));
|
||||||
deckPathLabel.setText(tr("Decks directory:"));
|
|
||||||
filtersPathLabel.setText(tr("Filters directory:"));
|
versionGroupBox->setTitle(tr("Version settings"));
|
||||||
replaysPathLabel.setText(tr("Replays directory:"));
|
|
||||||
picsPathLabel.setText(tr("Pictures directory:"));
|
|
||||||
cardDatabasePathLabel.setText(tr("Card database:"));
|
|
||||||
customCardDatabasePathLabel.setText(tr("Custom database directory:"));
|
|
||||||
tokenDatabasePathLabel.setText(tr("Token database:"));
|
|
||||||
updateReleaseChannelLabel.setText(tr("Update channel"));
|
updateReleaseChannelLabel.setText(tr("Update channel"));
|
||||||
startupUpdateCheckCheckBox.setText(tr("Check for client updates on startup"));
|
startupUpdateCheckCheckBox.setText(tr("Check for client updates on startup"));
|
||||||
|
updateNotificationCheckBox.setText(tr("Notify if a feature supported by the server is missing in my client"));
|
||||||
|
newVersionOracleCheckBox.setText(tr("Automatically run Oracle when running a new version of Cockatrice"));
|
||||||
|
|
||||||
|
// We can't change the strings after they're put into the QComboBox, so this is our workaround
|
||||||
|
int oldIndex = updateReleaseChannelBox.currentIndex();
|
||||||
|
updateReleaseChannelBox.clear();
|
||||||
|
for (ReleaseChannel *chan : settings.getUpdateReleaseChannels()) {
|
||||||
|
updateReleaseChannelBox.addItem(tr(chan->getName().toUtf8()));
|
||||||
|
}
|
||||||
|
updateReleaseChannelBox.setCurrentIndex(oldIndex);
|
||||||
|
|
||||||
|
cardDatabaseGroupBox->setTitle(tr("Card database"));
|
||||||
startupCardUpdateCheckBehaviorLabel.setText(tr("Check for card database updates on startup"));
|
startupCardUpdateCheckBehaviorLabel.setText(tr("Check for card database updates on startup"));
|
||||||
startupCardUpdateCheckBehaviorSelector.setItemText(startupCardUpdateCheckBehaviorIndexNone, tr("Don't check"));
|
startupCardUpdateCheckBehaviorSelector.setItemText(startupCardUpdateCheckBehaviorIndexNone, tr("Don't check"));
|
||||||
startupCardUpdateCheckBehaviorSelector.setItemText(startupCardUpdateCheckBehaviorIndexPrompt,
|
startupCardUpdateCheckBehaviorSelector.setItemText(startupCardUpdateCheckBehaviorIndexPrompt,
|
||||||
|
|
@ -456,8 +455,13 @@ void GeneralSettingsPage::retranslateUi()
|
||||||
tr("Always update in the background"));
|
tr("Always update in the background"));
|
||||||
cardUpdateCheckIntervalLabel.setText(tr("Check for card database updates every"));
|
cardUpdateCheckIntervalLabel.setText(tr("Check for card database updates every"));
|
||||||
cardUpdateCheckIntervalSpinBox.setSuffix(tr(" days"));
|
cardUpdateCheckIntervalSpinBox.setSuffix(tr(" days"));
|
||||||
updateNotificationCheckBox.setText(tr("Notify if a feature supported by the server is missing in my client"));
|
|
||||||
newVersionOracleCheckBox.setText(tr("Automatically run Oracle when running a new version of Cockatrice"));
|
QDate lastCheckDate = settings.updates().getLastCardUpdateCheck();
|
||||||
|
int daysAgo = lastCheckDate.daysTo(QDate::currentDate());
|
||||||
|
lastCardUpdateCheckDateLabel.setText(
|
||||||
|
tr("Last update check on %1 (%2 days ago)").arg(lastCheckDate.toString()).arg(daysAgo));
|
||||||
|
|
||||||
|
startupGroupBox->setTitle(tr("Startup settings"));
|
||||||
showTipsOnStartup.setText(tr("Show tips on startup"));
|
showTipsOnStartup.setText(tr("Show tips on startup"));
|
||||||
startupTabLabel.setText(tr("Startup tab:"));
|
startupTabLabel.setText(tr("Startup tab:"));
|
||||||
startupTabSelector.setItemText(StartupTab::StartupTabHome, tr("Home"));
|
startupTabSelector.setItemText(StartupTab::StartupTabHome, tr("Home"));
|
||||||
|
|
@ -473,21 +477,18 @@ void GeneralSettingsPage::retranslateUi()
|
||||||
startupServerLabel.setText(tr("Server:"));
|
startupServerLabel.setText(tr("Server:"));
|
||||||
startupRoomLabel.setText(tr("Room:"));
|
startupRoomLabel.setText(tr("Room:"));
|
||||||
startupRoomNameEdit->setPlaceholderText(tr("Room name"));
|
startupRoomNameEdit->setPlaceholderText(tr("Room name"));
|
||||||
resetAllPathsButton->setText(tr("Reset all paths"));
|
|
||||||
|
|
||||||
const auto &settings = SettingsCache::instance();
|
if (settings.getIsPortableBuild()) {
|
||||||
|
pathsGroupBox->setTitle(tr("Paths (editing disabled in portable mode)"));
|
||||||
QDate lastCheckDate = settings.updates().getLastCardUpdateCheck();
|
} else {
|
||||||
int daysAgo = lastCheckDate.daysTo(QDate::currentDate());
|
pathsGroupBox->setTitle(tr("Paths"));
|
||||||
|
|
||||||
lastCardUpdateCheckDateLabel.setText(
|
|
||||||
tr("Last update check on %1 (%2 days ago)").arg(lastCheckDate.toString()).arg(daysAgo));
|
|
||||||
|
|
||||||
// We can't change the strings after they're put into the QComboBox, so this is our workaround
|
|
||||||
int oldIndex = updateReleaseChannelBox.currentIndex();
|
|
||||||
updateReleaseChannelBox.clear();
|
|
||||||
for (ReleaseChannel *chan : settings.getUpdateReleaseChannels()) {
|
|
||||||
updateReleaseChannelBox.addItem(tr(chan->getName().toUtf8()));
|
|
||||||
}
|
}
|
||||||
updateReleaseChannelBox.setCurrentIndex(oldIndex);
|
deckPathLabel.setText(tr("Decks directory:"));
|
||||||
|
filtersPathLabel.setText(tr("Filters directory:"));
|
||||||
|
replaysPathLabel.setText(tr("Replays directory:"));
|
||||||
|
picsPathLabel.setText(tr("Pictures directory:"));
|
||||||
|
cardDatabasePathLabel.setText(tr("Card database:"));
|
||||||
|
customCardDatabasePathLabel.setText(tr("Custom database directory:"));
|
||||||
|
tokenDatabasePathLabel.setText(tr("Token database:"));
|
||||||
|
resetAllPathsButton->setText(tr("Reset all paths"));
|
||||||
}
|
}
|
||||||
|
|
@ -42,6 +42,37 @@ private:
|
||||||
QGroupBox *startupGroupBox;
|
QGroupBox *startupGroupBox;
|
||||||
QGroupBox *pathsGroupBox;
|
QGroupBox *pathsGroupBox;
|
||||||
|
|
||||||
|
QLabel languageLabel;
|
||||||
|
QComboBox languageBox;
|
||||||
|
QLabel advertiseTranslationPageLabel;
|
||||||
|
|
||||||
|
QLabel updateReleaseChannelLabel;
|
||||||
|
QComboBox updateReleaseChannelBox;
|
||||||
|
QCheckBox startupUpdateCheckCheckBox;
|
||||||
|
QCheckBox updateNotificationCheckBox;
|
||||||
|
QCheckBox newVersionOracleCheckBox;
|
||||||
|
|
||||||
|
QLabel startupCardUpdateCheckBehaviorLabel;
|
||||||
|
QComboBox startupCardUpdateCheckBehaviorSelector;
|
||||||
|
QLabel cardUpdateCheckIntervalLabel;
|
||||||
|
QSpinBox cardUpdateCheckIntervalSpinBox;
|
||||||
|
QLabel lastCardUpdateCheckDateLabel;
|
||||||
|
|
||||||
|
QCheckBox showTipsOnStartup;
|
||||||
|
QLabel startupTabLabel;
|
||||||
|
QComboBox startupTabSelector;
|
||||||
|
QLabel startupServerLabel;
|
||||||
|
QComboBox startupServerSelector;
|
||||||
|
QLabel startupRoomLabel;
|
||||||
|
QLineEdit *startupRoomNameEdit;
|
||||||
|
|
||||||
|
QLabel deckPathLabel;
|
||||||
|
QLabel filtersPathLabel;
|
||||||
|
QLabel replaysPathLabel;
|
||||||
|
QLabel picsPathLabel;
|
||||||
|
QLabel cardDatabasePathLabel;
|
||||||
|
QLabel customCardDatabasePathLabel;
|
||||||
|
QLabel tokenDatabasePathLabel;
|
||||||
QLineEdit *deckPathEdit;
|
QLineEdit *deckPathEdit;
|
||||||
QLineEdit *filtersPathEdit;
|
QLineEdit *filtersPathEdit;
|
||||||
QLineEdit *replaysPathEdit;
|
QLineEdit *replaysPathEdit;
|
||||||
|
|
@ -51,33 +82,6 @@ private:
|
||||||
QLineEdit *tokenDatabasePathEdit;
|
QLineEdit *tokenDatabasePathEdit;
|
||||||
QPushButton *resetAllPathsButton;
|
QPushButton *resetAllPathsButton;
|
||||||
QLabel *allPathsResetLabel;
|
QLabel *allPathsResetLabel;
|
||||||
QComboBox languageBox;
|
|
||||||
QCheckBox startupUpdateCheckCheckBox;
|
|
||||||
QLabel startupCardUpdateCheckBehaviorLabel;
|
|
||||||
QComboBox startupCardUpdateCheckBehaviorSelector;
|
|
||||||
QLabel cardUpdateCheckIntervalLabel;
|
|
||||||
QSpinBox cardUpdateCheckIntervalSpinBox;
|
|
||||||
QLabel lastCardUpdateCheckDateLabel;
|
|
||||||
QCheckBox updateNotificationCheckBox;
|
|
||||||
QCheckBox newVersionOracleCheckBox;
|
|
||||||
QComboBox updateReleaseChannelBox;
|
|
||||||
QLabel languageLabel;
|
|
||||||
QLabel deckPathLabel;
|
|
||||||
QLabel filtersPathLabel;
|
|
||||||
QLabel replaysPathLabel;
|
|
||||||
QLabel picsPathLabel;
|
|
||||||
QLabel cardDatabasePathLabel;
|
|
||||||
QLabel customCardDatabasePathLabel;
|
|
||||||
QLabel tokenDatabasePathLabel;
|
|
||||||
QLabel updateReleaseChannelLabel;
|
|
||||||
QLabel advertiseTranslationPageLabel;
|
|
||||||
QCheckBox showTipsOnStartup;
|
|
||||||
QLabel startupTabLabel;
|
|
||||||
QComboBox startupTabSelector;
|
|
||||||
QLabel startupServerLabel;
|
|
||||||
QComboBox startupServerSelector;
|
|
||||||
QLabel startupRoomLabel;
|
|
||||||
QLineEdit *startupRoomNameEdit;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COCKATRICE_GENERAL_SETTINGS_PAGE_H
|
#endif // COCKATRICE_GENERAL_SETTINGS_PAGE_H
|
||||||
|
|
|
||||||
|
|
@ -20,26 +20,7 @@ enum visualDeckStoragePromptForConversionIndex
|
||||||
|
|
||||||
UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
{
|
{
|
||||||
// general settings and notification settings
|
// general settings
|
||||||
notificationsEnabledCheckBox.setChecked(SettingsCache::instance().userInterface().getNotificationsEnabled());
|
|
||||||
connect(¬ificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
|
||||||
&InterfaceSettings::setNotificationsEnabled);
|
|
||||||
connect(¬ificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
|
||||||
&UserInterfaceSettingsPage::setNotificationEnabled);
|
|
||||||
|
|
||||||
specNotificationsEnabledCheckBox.setChecked(
|
|
||||||
SettingsCache::instance().userInterface().getSpectatorNotificationsEnabled());
|
|
||||||
specNotificationsEnabledCheckBox.setEnabled(SettingsCache::instance().userInterface().getNotificationsEnabled());
|
|
||||||
connect(&specNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
|
||||||
&InterfaceSettings::setSpectatorNotificationsEnabled);
|
|
||||||
|
|
||||||
buddyConnectNotificationsEnabledCheckBox.setChecked(
|
|
||||||
SettingsCache::instance().userInterface().getBuddyConnectNotificationsEnabled());
|
|
||||||
buddyConnectNotificationsEnabledCheckBox.setEnabled(
|
|
||||||
SettingsCache::instance().userInterface().getNotificationsEnabled());
|
|
||||||
connect(&buddyConnectNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED,
|
|
||||||
&SettingsCache::instance().userInterface(), &InterfaceSettings::setBuddyConnectNotificationsEnabled);
|
|
||||||
|
|
||||||
doubleClickToPlayCheckBox.setChecked(SettingsCache::instance().userInterface().getDoubleClickToPlay());
|
doubleClickToPlayCheckBox.setChecked(SettingsCache::instance().userInterface().getDoubleClickToPlay());
|
||||||
connect(&doubleClickToPlayCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
connect(&doubleClickToPlayCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||||
&InterfaceSettings::setDoubleClickToPlay);
|
&InterfaceSettings::setDoubleClickToPlay);
|
||||||
|
|
@ -103,6 +84,26 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
generalGroupBox = new QGroupBox;
|
generalGroupBox = new QGroupBox;
|
||||||
generalGroupBox->setLayout(generalGrid);
|
generalGroupBox->setLayout(generalGrid);
|
||||||
|
|
||||||
|
// notification settings
|
||||||
|
notificationsEnabledCheckBox.setChecked(SettingsCache::instance().userInterface().getNotificationsEnabled());
|
||||||
|
connect(¬ificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||||
|
&InterfaceSettings::setNotificationsEnabled);
|
||||||
|
connect(¬ificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
||||||
|
&UserInterfaceSettingsPage::setNotificationEnabled);
|
||||||
|
|
||||||
|
specNotificationsEnabledCheckBox.setChecked(
|
||||||
|
SettingsCache::instance().userInterface().getSpectatorNotificationsEnabled());
|
||||||
|
specNotificationsEnabledCheckBox.setEnabled(SettingsCache::instance().userInterface().getNotificationsEnabled());
|
||||||
|
connect(&specNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||||
|
&InterfaceSettings::setSpectatorNotificationsEnabled);
|
||||||
|
|
||||||
|
buddyConnectNotificationsEnabledCheckBox.setChecked(
|
||||||
|
SettingsCache::instance().userInterface().getBuddyConnectNotificationsEnabled());
|
||||||
|
buddyConnectNotificationsEnabledCheckBox.setEnabled(
|
||||||
|
SettingsCache::instance().userInterface().getNotificationsEnabled());
|
||||||
|
connect(&buddyConnectNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED,
|
||||||
|
&SettingsCache::instance().userInterface(), &InterfaceSettings::setBuddyConnectNotificationsEnabled);
|
||||||
|
|
||||||
auto *notificationsGrid = new QGridLayout;
|
auto *notificationsGrid = new QGridLayout;
|
||||||
notificationsGrid->addWidget(¬ificationsEnabledCheckBox, 0, 0);
|
notificationsGrid->addWidget(¬ificationsEnabledCheckBox, 0, 0);
|
||||||
notificationsGrid->addWidget(&specNotificationsEnabledCheckBox, 1, 0);
|
notificationsGrid->addWidget(&specNotificationsEnabledCheckBox, 1, 0);
|
||||||
|
|
@ -355,6 +356,7 @@ void UserInterfaceSettingsPage::retranslateUi()
|
||||||
notificationsEnabledCheckBox.setText(tr("Enable notifications in taskbar"));
|
notificationsEnabledCheckBox.setText(tr("Enable notifications in taskbar"));
|
||||||
specNotificationsEnabledCheckBox.setText(tr("Notify in the taskbar for game events while you are spectating"));
|
specNotificationsEnabledCheckBox.setText(tr("Notify in the taskbar for game events while you are spectating"));
|
||||||
buddyConnectNotificationsEnabledCheckBox.setText(tr("Notify in the taskbar when users in your buddy list connect"));
|
buddyConnectNotificationsEnabledCheckBox.setText(tr("Notify in the taskbar when users in your buddy list connect"));
|
||||||
|
|
||||||
animationGroupBox->setTitle(tr("Animation settings"));
|
animationGroupBox->setTitle(tr("Animation settings"));
|
||||||
enableAllAnimationsButton.setText(tr("&Enable all animations"));
|
enableAllAnimationsButton.setText(tr("&Enable all animations"));
|
||||||
disableAllAnimationsButton.setText(tr("&Disable all animations"));
|
disableAllAnimationsButton.setText(tr("&Disable all animations"));
|
||||||
|
|
@ -362,6 +364,7 @@ void UserInterfaceSettingsPage::retranslateUi()
|
||||||
arrowDrawAnimationCheckBox.setText(tr("&Arrow draw animation"));
|
arrowDrawAnimationCheckBox.setText(tr("&Arrow draw animation"));
|
||||||
lifeCounterAnimationsCheckBox.setText(tr("Life counter flash"));
|
lifeCounterAnimationsCheckBox.setText(tr("Life counter flash"));
|
||||||
battlefieldFlashCheckBox.setText(tr("Battlefield flash on damage"));
|
battlefieldFlashCheckBox.setText(tr("Battlefield flash on damage"));
|
||||||
|
|
||||||
deckEditorGroupBox->setTitle(tr("Deck editor/storage settings"));
|
deckEditorGroupBox->setTitle(tr("Deck editor/storage settings"));
|
||||||
openDeckInNewTabCheckBox.setText(tr("Open deck in new tab by default"));
|
openDeckInNewTabCheckBox.setText(tr("Open deck in new tab by default"));
|
||||||
visualDeckStorageInGameCheckBox.setText(tr("Use visual deck storage in game lobby"));
|
visualDeckStorageInGameCheckBox.setText(tr("Use visual deck storage in game lobby"));
|
||||||
|
|
@ -397,8 +400,8 @@ void UserInterfaceSettingsPage::retranslateUi()
|
||||||
0, CommanderBracketNames::CommanderSpellbookBracketNames);
|
0, CommanderBracketNames::CommanderSpellbookBracketNames);
|
||||||
commanderSpellbookIntegrationBracketNamingSelector.setItemText(
|
commanderSpellbookIntegrationBracketNamingSelector.setItemText(
|
||||||
1, CommanderBracketNames::OfficialCommanderBracketNames);
|
1, CommanderBracketNames::OfficialCommanderBracketNames);
|
||||||
|
|
||||||
commanderSpellbookIntegrationUseOfficialBracketNamesExplainer.setToolTip(CommanderBracketNames::Explainer);
|
commanderSpellbookIntegrationUseOfficialBracketNamesExplainer.setToolTip(CommanderBracketNames::Explainer);
|
||||||
|
|
||||||
replayGroupBox->setTitle(tr("Replay settings"));
|
replayGroupBox->setTitle(tr("Replay settings"));
|
||||||
rewindBufferingMsLabel.setText(tr("Buffer time for backwards skip via shortcut:"));
|
rewindBufferingMsLabel.setText(tr("Buffer time for backwards skip via shortcut:"));
|
||||||
rewindBufferingMsBox.setSuffix(" ms");
|
rewindBufferingMsBox.setSuffix(" ms");
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,6 @@ private slots:
|
||||||
void updateCommanderSpellbookUiState();
|
void updateCommanderSpellbookUiState();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QCheckBox notificationsEnabledCheckBox;
|
|
||||||
QCheckBox specNotificationsEnabledCheckBox;
|
|
||||||
QCheckBox buddyConnectNotificationsEnabledCheckBox;
|
|
||||||
QCheckBox doubleClickToPlayCheckBox;
|
QCheckBox doubleClickToPlayCheckBox;
|
||||||
QCheckBox clickPlaysAllSelectedCheckBox;
|
QCheckBox clickPlaysAllSelectedCheckBox;
|
||||||
QCheckBox playToStackCheckBox;
|
QCheckBox playToStackCheckBox;
|
||||||
|
|
@ -37,12 +34,18 @@ private:
|
||||||
QCheckBox showTotalSelectionCountCheckBox;
|
QCheckBox showTotalSelectionCountCheckBox;
|
||||||
QCheckBox useTearOffMenusCheckBox;
|
QCheckBox useTearOffMenusCheckBox;
|
||||||
QCheckBox keepGameChatFocusCheckBox;
|
QCheckBox keepGameChatFocusCheckBox;
|
||||||
|
|
||||||
|
QCheckBox notificationsEnabledCheckBox;
|
||||||
|
QCheckBox specNotificationsEnabledCheckBox;
|
||||||
|
QCheckBox buddyConnectNotificationsEnabledCheckBox;
|
||||||
|
|
||||||
QPushButton enableAllAnimationsButton;
|
QPushButton enableAllAnimationsButton;
|
||||||
QPushButton disableAllAnimationsButton;
|
QPushButton disableAllAnimationsButton;
|
||||||
QCheckBox tapAnimationCheckBox;
|
QCheckBox tapAnimationCheckBox;
|
||||||
QCheckBox arrowDrawAnimationCheckBox;
|
QCheckBox arrowDrawAnimationCheckBox;
|
||||||
QCheckBox lifeCounterAnimationsCheckBox;
|
QCheckBox lifeCounterAnimationsCheckBox;
|
||||||
QCheckBox battlefieldFlashCheckBox;
|
QCheckBox battlefieldFlashCheckBox;
|
||||||
|
|
||||||
QCheckBox openDeckInNewTabCheckBox;
|
QCheckBox openDeckInNewTabCheckBox;
|
||||||
QLabel visualDeckStoragePromptForConversionLabel;
|
QLabel visualDeckStoragePromptForConversionLabel;
|
||||||
QComboBox visualDeckStoragePromptForConversionSelector;
|
QComboBox visualDeckStoragePromptForConversionSelector;
|
||||||
|
|
@ -57,8 +60,10 @@ private:
|
||||||
QLabel commanderSpellbookIntegrationUseOfficialBracketNamesLabel;
|
QLabel commanderSpellbookIntegrationUseOfficialBracketNamesLabel;
|
||||||
QToolButton commanderSpellbookIntegrationUseOfficialBracketNamesExplainer;
|
QToolButton commanderSpellbookIntegrationUseOfficialBracketNamesExplainer;
|
||||||
QComboBox commanderSpellbookIntegrationBracketNamingSelector;
|
QComboBox commanderSpellbookIntegrationBracketNamingSelector;
|
||||||
|
|
||||||
QLabel rewindBufferingMsLabel;
|
QLabel rewindBufferingMsLabel;
|
||||||
QSpinBox rewindBufferingMsBox;
|
QSpinBox rewindBufferingMsBox;
|
||||||
|
|
||||||
QGroupBox *generalGroupBox;
|
QGroupBox *generalGroupBox;
|
||||||
QGroupBox *notificationsGroupBox;
|
QGroupBox *notificationsGroupBox;
|
||||||
QGroupBox *animationGroupBox;
|
QGroupBox *animationGroupBox;
|
||||||
|
|
|
||||||
|
|
@ -125,9 +125,7 @@ void VisualDeckStorageFolderDisplayWidget::continueDeckPass()
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool matches = index.data(VisualDeckStorageRoles::FilterMatchRole).toBool();
|
const bool matches = index.data(VisualDeckStorageRoles::FilterMatchRole).toBool();
|
||||||
if (matches == deckPreviewWidget->isHidden()) {
|
deckPreviewWidget->setVisible(matches);
|
||||||
deckPreviewWidget->setVisible(matches);
|
|
||||||
}
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
++visibleDeckCount;
|
++visibleDeckCount;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@
|
||||||
#include <libcockatrice/protocol/pb/command_set_sideboard_lock.pb.h>
|
#include <libcockatrice/protocol/pb/command_set_sideboard_lock.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/command_set_sideboard_plan.pb.h>
|
#include <libcockatrice/protocol/pb/command_set_sideboard_plan.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/command_shuffle.pb.h>
|
#include <libcockatrice/protocol/pb/command_shuffle.pb.h>
|
||||||
|
#include <libcockatrice/protocol/pb/command_tournament.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/command_undo_draw.pb.h>
|
#include <libcockatrice/protocol/pb/command_undo_draw.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/context_connection_state_changed.pb.h>
|
#include <libcockatrice/protocol/pb/context_connection_state_changed.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/event_game_say.pb.h>
|
#include <libcockatrice/protocol/pb/event_game_say.pb.h>
|
||||||
|
|
@ -536,6 +537,15 @@ Server_AbstractParticipant::processGameCommand(const GameCommand &command, Respo
|
||||||
case GameCommand::SET_PLAYMAT:
|
case GameCommand::SET_PLAYMAT:
|
||||||
return cmdSetPlaymat(command.GetExtension(Command_SetPlaymat::ext), rc, ges);
|
return cmdSetPlaymat(command.GetExtension(Command_SetPlaymat::ext), rc, ges);
|
||||||
break;
|
break;
|
||||||
|
case GameCommand::REPORT_MATCH_RESULT:
|
||||||
|
return cmdReportMatchResult(command.GetExtension(Command_ReportMatchResult::ext), rc, ges);
|
||||||
|
break;
|
||||||
|
case GameCommand::ADVANCE_TOURNAMENT:
|
||||||
|
return cmdAdvanceTournament(command.GetExtension(Command_AdvanceTournament::ext), rc, ges);
|
||||||
|
break;
|
||||||
|
case GameCommand::TOURNAMENT_SETTINGS_SELECT:
|
||||||
|
return cmdTournamentSettingsSelect(command.GetExtension(Command_TournamentSettingsSelect::ext), rc, ges);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return Response::RespInvalidCommand;
|
return Response::RespInvalidCommand;
|
||||||
}
|
}
|
||||||
|
|
@ -584,3 +594,25 @@ void Server_AbstractParticipant::getInfo(ServerInfo_Player *info,
|
||||||
{
|
{
|
||||||
getProperties(*info->mutable_properties(), withUserInfo);
|
getProperties(*info->mutable_properties(), withUserInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Response::ResponseCode Server_AbstractParticipant::cmdReportMatchResult(const Command_ReportMatchResult & /*cmd*/,
|
||||||
|
ResponseContainer & /*rc*/,
|
||||||
|
GameEventStorage & /*ges*/)
|
||||||
|
{
|
||||||
|
return Response::RespContextError;
|
||||||
|
}
|
||||||
|
|
||||||
|
Response::ResponseCode Server_AbstractParticipant::cmdAdvanceTournament(const Command_AdvanceTournament & /*cmd*/,
|
||||||
|
ResponseContainer & /*rc*/,
|
||||||
|
GameEventStorage & /*ges*/)
|
||||||
|
{
|
||||||
|
return Response::RespContextError;
|
||||||
|
}
|
||||||
|
|
||||||
|
Response::ResponseCode
|
||||||
|
Server_AbstractParticipant::cmdTournamentSettingsSelect(const Command_TournamentSettingsSelect & /*cmd*/,
|
||||||
|
ResponseContainer & /*rc*/,
|
||||||
|
GameEventStorage & /*ges*/)
|
||||||
|
{
|
||||||
|
return Response::RespContextError;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,9 @@ class Command_DeckSelect;
|
||||||
class Command_SetSideboardLock;
|
class Command_SetSideboardLock;
|
||||||
class Command_ChangeZoneProperties;
|
class Command_ChangeZoneProperties;
|
||||||
class Command_SetPlaymat;
|
class Command_SetPlaymat;
|
||||||
|
class Command_ReportMatchResult;
|
||||||
|
class Command_AdvanceTournament;
|
||||||
|
class Command_TournamentSettingsSelect;
|
||||||
|
|
||||||
class Server_AbstractParticipant : public Server_ArrowTarget, public ServerInfo_User_Container
|
class Server_AbstractParticipant : public Server_ArrowTarget, public ServerInfo_User_Container
|
||||||
{
|
{
|
||||||
|
|
@ -175,6 +178,13 @@ public:
|
||||||
cmdReverseTurn(const Command_ReverseTurn & /*cmd*/, ResponseContainer & /*rc*/, GameEventStorage &ges);
|
cmdReverseTurn(const Command_ReverseTurn & /*cmd*/, ResponseContainer & /*rc*/, GameEventStorage &ges);
|
||||||
virtual Response::ResponseCode
|
virtual Response::ResponseCode
|
||||||
cmdChangeZoneProperties(const Command_ChangeZoneProperties &cmd, ResponseContainer &rc, GameEventStorage &ges);
|
cmdChangeZoneProperties(const Command_ChangeZoneProperties &cmd, ResponseContainer &rc, GameEventStorage &ges);
|
||||||
|
virtual Response::ResponseCode
|
||||||
|
cmdReportMatchResult(const Command_ReportMatchResult &cmd, ResponseContainer &rc, GameEventStorage &ges);
|
||||||
|
virtual Response::ResponseCode
|
||||||
|
cmdAdvanceTournament(const Command_AdvanceTournament &cmd, ResponseContainer &rc, GameEventStorage &ges);
|
||||||
|
virtual Response::ResponseCode cmdTournamentSettingsSelect(const Command_TournamentSettingsSelect &cmd,
|
||||||
|
ResponseContainer &rc,
|
||||||
|
GameEventStorage &ges);
|
||||||
|
|
||||||
Response::ResponseCode processGameCommand(const GameCommand &command, ResponseContainer &rc, GameEventStorage &ges);
|
Response::ResponseCode processGameCommand(const GameCommand &command, ResponseContainer &rc, GameEventStorage &ges);
|
||||||
void sendGameEvent(const GameEventContainer &event);
|
void sendGameEvent(const GameEventContainer &event);
|
||||||
|
|
|
||||||
|
|
@ -1663,3 +1663,9 @@ void Server_AbstractPlayer::getPlayerProperties(ServerInfo_PlayerProperties &res
|
||||||
playmatParams->set_zoom(playmat.params.zoom);
|
playmatParams->set_zoom(playmat.params.zoom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Server_AbstractPlayer::setDeck(DeckList *_deck)
|
||||||
|
{
|
||||||
|
delete deck;
|
||||||
|
deck = _deck;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ public:
|
||||||
{
|
{
|
||||||
return deck;
|
return deck;
|
||||||
}
|
}
|
||||||
|
void setDeck(DeckList *_deck);
|
||||||
bool getReadyStart() const
|
bool getReadyStart() const
|
||||||
{
|
{
|
||||||
return readyStart;
|
return readyStart;
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,18 @@ void Server_Room::broadcastGameListUpdate(const ServerInfo_Game &gameInfo, bool
|
||||||
sendRoomEvent(prepareRoomEvent(event), sendToIsl);
|
sendRoomEvent(prepareRoomEvent(event), sendToIsl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Server_AbstractUserInterface *Server_Room::getUserInterfaceByName(const QString &name) const
|
||||||
|
{
|
||||||
|
usersLock.lockForRead();
|
||||||
|
auto it = users.constFind(name);
|
||||||
|
Server_AbstractUserInterface *result = nullptr;
|
||||||
|
if (it != users.constEnd()) {
|
||||||
|
result = it.value();
|
||||||
|
}
|
||||||
|
usersLock.unlock();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void Server_Room::addGame(Server_Game *game)
|
void Server_Room::addGame(Server_Game *game)
|
||||||
{
|
{
|
||||||
ServerInfo_Room roomInfo;
|
ServerInfo_Room roomInfo;
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,8 @@ public:
|
||||||
void addGame(Server_Game *game);
|
void addGame(Server_Game *game);
|
||||||
void removeGame(Server_Game *game);
|
void removeGame(Server_Game *game);
|
||||||
|
|
||||||
|
Server_AbstractUserInterface *getUserInterfaceByName(const QString &name) const;
|
||||||
|
|
||||||
void sendRoomEvent(RoomEvent *event, bool sendToIsl = true);
|
void sendRoomEvent(RoomEvent *event, bool sendToIsl = true);
|
||||||
RoomEvent *prepareRoomEvent(const ::google::protobuf::Message &roomEvent);
|
RoomEvent *prepareRoomEvent(const ::google::protobuf::Message &roomEvent);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ set(PROTO_FILES
|
||||||
command_set_sideboard_lock.proto
|
command_set_sideboard_lock.proto
|
||||||
command_set_sideboard_plan.proto
|
command_set_sideboard_plan.proto
|
||||||
command_shuffle.proto
|
command_shuffle.proto
|
||||||
|
command_tournament.proto
|
||||||
command_undo_draw.proto
|
command_undo_draw.proto
|
||||||
commands.proto
|
commands.proto
|
||||||
context_concede.proto
|
context_concede.proto
|
||||||
|
|
@ -118,6 +119,7 @@ set(PROTO_FILES
|
||||||
event_set_card_counter.proto
|
event_set_card_counter.proto
|
||||||
event_set_counter.proto
|
event_set_counter.proto
|
||||||
event_shuffle.proto
|
event_shuffle.proto
|
||||||
|
event_tournament_state.proto
|
||||||
event_user_joined.proto
|
event_user_joined.proto
|
||||||
event_user_left.proto
|
event_user_left.proto
|
||||||
event_user_message.proto
|
event_user_message.proto
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
syntax = "proto2";
|
||||||
|
import "game_commands.proto";
|
||||||
|
import "event_tournament_state.proto";
|
||||||
|
|
||||||
|
message Command_ReportMatchResult {
|
||||||
|
extend GameCommand {
|
||||||
|
optional Command_ReportMatchResult ext = 1037;
|
||||||
|
}
|
||||||
|
|
||||||
|
optional sint32 game_id = 1 [default = -1];
|
||||||
|
optional sint32 winner_id = 2 [default = -1];
|
||||||
|
}
|
||||||
|
|
||||||
|
message Command_AdvanceTournament {
|
||||||
|
extend GameCommand {
|
||||||
|
optional Command_AdvanceTournament ext = 1038;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message Command_TournamentSettingsSelect {
|
||||||
|
extend GameCommand {
|
||||||
|
optional Command_TournamentSettingsSelect ext = 1039;
|
||||||
|
}
|
||||||
|
|
||||||
|
optional TournamentSettings settings = 1;
|
||||||
|
}
|
||||||
|
|
@ -24,4 +24,10 @@ message Event_GameStateChanged {
|
||||||
|
|
||||||
// the amount of seconds since the game started
|
// the amount of seconds since the game started
|
||||||
optional uint32 seconds_elapsed = 5;
|
optional uint32 seconds_elapsed = 5;
|
||||||
|
|
||||||
|
// whether this game is a tournament game
|
||||||
|
optional bool is_tournament = 9;
|
||||||
|
|
||||||
|
// for tournament sub-games: the ID of the parent tournament game (-1 if not a sub-game)
|
||||||
|
optional sint32 parent_game_id = 10 [default = -1];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
syntax = "proto2";
|
||||||
|
import "game_event.proto";
|
||||||
|
|
||||||
|
message TournamentPlayer {
|
||||||
|
optional sint32 player_id = 1;
|
||||||
|
optional string player_name = 2;
|
||||||
|
optional uint32 wins = 3;
|
||||||
|
optional uint32 losses = 4;
|
||||||
|
optional uint32 draws = 5;
|
||||||
|
optional bool deck_submitted = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
message TournamentPairing {
|
||||||
|
optional sint32 player1_id = 1;
|
||||||
|
optional sint32 player2_id = 2 [default = -1];
|
||||||
|
optional sint32 game_id = 3;
|
||||||
|
optional sint32 winner_id = 4 [default = -1];
|
||||||
|
optional sint32 player1_match_wins = 5 [default = 0];
|
||||||
|
optional sint32 player2_match_wins = 6 [default = 0];
|
||||||
|
}
|
||||||
|
|
||||||
|
message TournamentSettings {
|
||||||
|
optional uint32 games_per_match = 1 [default = 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
message Event_TournamentState {
|
||||||
|
extend GameEvent {
|
||||||
|
optional Event_TournamentState ext = 2027;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum TournamentPhase {
|
||||||
|
PHASE_DECK_BUILDING = 0;
|
||||||
|
PHASE_PLAYING = 1;
|
||||||
|
PHASE_FINISHED = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
optional TournamentPhase phase = 1;
|
||||||
|
optional uint32 current_round = 2;
|
||||||
|
optional uint32 total_rounds = 3;
|
||||||
|
repeated TournamentPlayer players = 4;
|
||||||
|
repeated TournamentPairing pairings = 5;
|
||||||
|
optional TournamentSettings settings = 6;
|
||||||
|
}
|
||||||
|
|
@ -180,6 +180,15 @@ message GameCommand {
|
||||||
/// Server: Server_Player::cmdSetPlaymat
|
/// Server: Server_Player::cmdSetPlaymat
|
||||||
/// Client: reflected via player properties changed event
|
/// Client: reflected via player properties changed event
|
||||||
SET_PLAYMAT = 1035;
|
SET_PLAYMAT = 1035;
|
||||||
|
|
||||||
|
/// Report the result of a tournament match sub-game.
|
||||||
|
REPORT_MATCH_RESULT = 1037;
|
||||||
|
|
||||||
|
/// Advance the tournament to the next round.
|
||||||
|
ADVANCE_TOURNAMENT = 1038;
|
||||||
|
|
||||||
|
/// Select tournament settings.
|
||||||
|
TOURNAMENT_SETTINGS_SELECT = 1039;
|
||||||
}
|
}
|
||||||
|
|
||||||
extensions 100 to max;
|
extensions 100 to max;
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ message GameEvent {
|
||||||
CHANGE_ZONE_PROPERTIES = 2020;
|
CHANGE_ZONE_PROPERTIES = 2020;
|
||||||
REVERSE_TURN = 2021;
|
REVERSE_TURN = 2021;
|
||||||
GAME_LOG_NOTICE = 2022;
|
GAME_LOG_NOTICE = 2022;
|
||||||
|
TOURNAMENT_STATE = 2027;
|
||||||
}
|
}
|
||||||
optional sint32 player_id = 1 [default = -1];
|
optional sint32 player_id = 1 [default = -1];
|
||||||
extensions 100 to max;
|
extensions 100 to max;
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,12 @@ message Command_CreateGame {
|
||||||
|
|
||||||
// share decklists with all players when selected
|
// share decklists with all players when selected
|
||||||
optional bool share_decklists_on_load = 14;
|
optional bool share_decklists_on_load = 14;
|
||||||
|
|
||||||
|
// number of games per match in tournament mode (e.g. 3 for best of 3)
|
||||||
|
optional uint32 games_per_match = 15 [default = 1];
|
||||||
|
|
||||||
|
// whether this is a tournament game
|
||||||
|
optional bool is_tournament = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Command_JoinGame {
|
message Command_JoinGame {
|
||||||
|
|
|
||||||
|
|
@ -65,4 +65,7 @@ message ServerInfo_Game {
|
||||||
|
|
||||||
// the current host of the game, which may differ from the creator after a host transfer
|
// the current host of the game, which may differ from the creator after a host transfer
|
||||||
optional ServerInfo_User host_info = 53;
|
optional ServerInfo_User host_info = 53;
|
||||||
|
|
||||||
|
// whether this game is a tournament game
|
||||||
|
optional bool is_tournament = 54;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue