mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
Various fixes
Took 14 minutes
This commit is contained in:
parent
4fca8e2a3a
commit
0909d356e0
15 changed files with 90 additions and 78 deletions
|
|
@ -124,7 +124,6 @@ DeckViewContainer::DeckViewContainer(int _playerId, TabGame *parent)
|
|||
&DeckViewContainer::onPlaymatSettingsChanged);
|
||||
|
||||
switchToDeckSelectView();
|
||||
generateTutorialSequence();
|
||||
}
|
||||
|
||||
TutorialSequence DeckViewContainer::generateTutorialSequence()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
#ifndef TABBED_DECK_VIEW_CONTAINER_H
|
||||
#define TABBED_DECK_VIEW_CONTAINER_H
|
||||
#include "../../interface/widgets/general/tutorial/tutorial_controller.h"
|
||||
#include "deck_view_container.h"
|
||||
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
#include <QTabWidget>
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@
|
|||
#include <libcockatrice/deck_list/loaded_deck.h>
|
||||
#include <libcockatrice/network/client/remote/remote_client.h>
|
||||
#include <libcockatrice/settings/appearance_settings.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/paths_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <optional>
|
||||
#include <qlogging.h>
|
||||
#include <qnamespace.h>
|
||||
|
|
@ -98,13 +98,7 @@ HomeWidget::HomeWidget(QWidget *parent, TabSupervisor *_tabSupervisor)
|
|||
connect(&SettingsCache::instance().appearance(), &AppearanceSettings::homeTabBackgroundShuffleFrequencyChanged,
|
||||
this, &HomeWidget::onBackgroundShuffleFrequencyChanged);
|
||||
|
||||
auto mainWindow = QtUtils::findParentOfType<QMainWindow>(this);
|
||||
|
||||
if (mainWindow) {
|
||||
tutorialController = new TutorialController(mainWindow);
|
||||
} else {
|
||||
tutorialController = new TutorialController(this);
|
||||
}
|
||||
tutorialController = new TutorialController(this);
|
||||
auto sequence = TutorialSequence();
|
||||
sequence.addStep({connectButton, "Connect to a server to play here!"});
|
||||
auto vdeStep = TutorialStep{visualDeckEditorButton, "Create a new deck from cards in the database here!"};
|
||||
|
|
@ -175,7 +169,7 @@ void HomeWidget::retranslateUi()
|
|||
void HomeWidget::showEvent(QShowEvent *event)
|
||||
{
|
||||
QWidget::showEvent(event);
|
||||
if (!tutorialStarted) {
|
||||
if (!tutorialStarted && !SettingsCache::instance().userInterface().getTutorialCompleted()) {
|
||||
tutorialStarted = true;
|
||||
// Start on next event loop iteration so everything is fully painted
|
||||
QTimer::singleShot(3, tutorialController, [this] { tutorialController->start(); });
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class QTimer;
|
|||
class TabSupervisor;
|
||||
class TutorialController;
|
||||
|
||||
class TutorialController;
|
||||
|
||||
class HomeWidget : public QWidget
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
#include "tutorial_controller.h"
|
||||
|
||||
#include "../../../../client/settings/cache_settings.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDebug>
|
||||
#include <QLineEdit>
|
||||
#include <QMainWindow>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QTextEdit>
|
||||
#include <QTimer>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
|
||||
TutorialController::TutorialController(QWidget *_tutorializedWidget)
|
||||
: QObject(_tutorializedWidget), tutorializedWidget(_tutorializedWidget)
|
||||
|
|
@ -24,6 +26,18 @@ TutorialController::TutorialController(QWidget *_tutorializedWidget)
|
|||
connect(tutorialOverlay, &TutorialOverlay::targetClicked, this, &TutorialController::handleTargetClicked);
|
||||
}
|
||||
|
||||
TutorialController::~TutorialController()
|
||||
{
|
||||
// The overlay is parented to the top-level window, which outlives the widget
|
||||
// this controller is attached to (e.g. a closed tab), so it must be cleaned
|
||||
// up explicitly when the controller goes away without exitTutorial().
|
||||
if (tutorialOverlay) {
|
||||
tutorialOverlay->hide();
|
||||
tutorialOverlay->deleteLater();
|
||||
}
|
||||
tutorialOverlay = nullptr;
|
||||
}
|
||||
|
||||
void TutorialController::addSequence(const TutorialSequence &seq)
|
||||
{
|
||||
sequences.append(seq);
|
||||
|
|
@ -172,12 +186,15 @@ void TutorialController::prevSequence()
|
|||
void TutorialController::exitTutorial()
|
||||
{
|
||||
cleanupValidationMonitoring();
|
||||
tutorialOverlay->hide();
|
||||
// TODO Maybe not the best idea:
|
||||
tutorialOverlay->deleteLater();
|
||||
if (tutorialOverlay) {
|
||||
tutorialOverlay->hide();
|
||||
tutorialOverlay->deleteLater();
|
||||
}
|
||||
tutorialOverlay = nullptr;
|
||||
currentSequence = -1;
|
||||
currentStep = -1;
|
||||
tutorialCompleted = true;
|
||||
SettingsCache::instance().userInterface().setTutorialCompleted(true);
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
|
|
@ -237,6 +254,7 @@ void TutorialController::showStep()
|
|||
}
|
||||
|
||||
cleanupValidationMonitoring();
|
||||
advanceScheduled = false;
|
||||
|
||||
const auto &step = seq.steps[currentStep];
|
||||
|
||||
|
|
@ -278,13 +296,7 @@ void TutorialController::setupValidationMonitoring()
|
|||
// Handle OnSignal validation - connect to any custom signal
|
||||
if (step.validationTiming == ValidationTiming::OnSignal && step.validator) {
|
||||
if (step.signalSource && step.signalName) {
|
||||
qInfo() << "Setting up signal-based validation for signal:" << step.signalName;
|
||||
validationConnection = connect(step.signalSource, step.signalName, this, SLOT(checkValidation()));
|
||||
if (!validationConnection) {
|
||||
qInfo() << "Warning: Failed to connect to signal" << step.signalName;
|
||||
}
|
||||
} else {
|
||||
qInfo() << "Warning: OnSignal validation timing set but signalSource or signalName is null";
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -292,24 +304,17 @@ void TutorialController::setupValidationMonitoring()
|
|||
// Handle OnChange validation - widget-specific
|
||||
if (step.validationTiming == ValidationTiming::OnChange && step.validator) {
|
||||
if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(step.targetWidget)) {
|
||||
qInfo() << "Setting up validation monitoring for QLineEdit";
|
||||
validationConnection =
|
||||
connect(lineEdit, &QLineEdit::textChanged, this, &TutorialController::checkValidation);
|
||||
} else if (QTextEdit *textEdit = qobject_cast<QTextEdit *>(step.targetWidget)) {
|
||||
qInfo() << "Setting up validation monitoring for QTextEdit";
|
||||
validationConnection =
|
||||
connect(textEdit, &QTextEdit::textChanged, this, &TutorialController::checkValidation);
|
||||
} else if (QPlainTextEdit *plainText = qobject_cast<QPlainTextEdit *>(step.targetWidget)) {
|
||||
qInfo() << "Setting up validation monitoring for QPlainTextEdit";
|
||||
validationConnection =
|
||||
connect(plainText, &QPlainTextEdit::textChanged, this, &TutorialController::checkValidation);
|
||||
} else if (QComboBox *combo = qobject_cast<QComboBox *>(step.targetWidget)) {
|
||||
qInfo() << "Setting up validation monitoring for QComboBox";
|
||||
validationConnection = connect(combo, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||
&TutorialController::checkValidation);
|
||||
} else {
|
||||
qInfo() << "Warning: OnChange validation timing set but widget type not supported:"
|
||||
<< (step.targetWidget ? step.targetWidget->metaObject()->className() : "null");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -317,7 +322,6 @@ void TutorialController::setupValidationMonitoring()
|
|||
void TutorialController::cleanupValidationMonitoring()
|
||||
{
|
||||
if (validationConnection) {
|
||||
qInfo() << "Cleaning up validation connection";
|
||||
disconnect(validationConnection);
|
||||
validationConnection = QMetaObject::Connection();
|
||||
}
|
||||
|
|
@ -325,8 +329,6 @@ void TutorialController::cleanupValidationMonitoring()
|
|||
|
||||
void TutorialController::checkValidation()
|
||||
{
|
||||
qInfo() << "checkValidation() called";
|
||||
|
||||
if (currentSequence < 0 || currentSequence >= sequences.size()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -338,16 +340,18 @@ void TutorialController::checkValidation()
|
|||
|
||||
if (step.validator) {
|
||||
bool isValid = step.validator();
|
||||
qInfo() << "Validation result:" << isValid;
|
||||
|
||||
if (isValid) {
|
||||
// Clear any validation hints
|
||||
tutorialOverlay->showValidationHint("");
|
||||
|
||||
// Auto-advance if enabled
|
||||
if (step.autoAdvanceOnValid) {
|
||||
qInfo() << "Auto-advancing to next step";
|
||||
QTimer::singleShot(500, this, &TutorialController::nextStep);
|
||||
if (step.autoAdvanceOnValid && !advanceScheduled) {
|
||||
advanceScheduled = true;
|
||||
QTimer::singleShot(500, this, [this]() {
|
||||
advanceScheduled = false;
|
||||
nextStep();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ class TutorialController : public QObject
|
|||
|
||||
public:
|
||||
explicit TutorialController(QWidget *_tutorializedWidget);
|
||||
~TutorialController() override;
|
||||
|
||||
void addSequence(const TutorialSequence &seq);
|
||||
void start();
|
||||
|
|
@ -95,6 +96,10 @@ private:
|
|||
|
||||
// For OnChange validation monitoring
|
||||
QMetaObject::Connection validationConnection;
|
||||
|
||||
// True while an auto-advance timer is pending, so repeated signal emissions
|
||||
// can't queue more than one advance.
|
||||
bool advanceScheduled = false;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_TUTORIAL_CONTROLLER_H
|
||||
|
|
|
|||
|
|
@ -300,7 +300,9 @@ void TutorialOverlay::recomputeLayout()
|
|||
return;
|
||||
}
|
||||
|
||||
resize(parentWidget()->window()->geometry().size());
|
||||
// The overlay is parented to the top-level window; its client size (rect())
|
||||
// is the visible area, whereas window()->geometry() includes the frame.
|
||||
resize(parentWidget()->size());
|
||||
|
||||
bubble->adjustSize();
|
||||
|
||||
|
|
|
|||
|
|
@ -187,13 +187,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor,
|
|||
|
||||
QTimer::singleShot(0, this, &TabGame::loadLayout);
|
||||
|
||||
auto mainWindow = QtUtils::findParentOfType<QMainWindow>(this);
|
||||
|
||||
if (mainWindow) {
|
||||
tutorialController = new TutorialController(mainWindow);
|
||||
} else {
|
||||
tutorialController = new TutorialController(this);
|
||||
}
|
||||
tutorialController = new TutorialController(this);
|
||||
|
||||
TutorialSequence lobbySequence;
|
||||
|
||||
|
|
@ -206,7 +200,12 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor,
|
|||
void TabGame::showEvent(QShowEvent *event)
|
||||
{
|
||||
QWidget::showEvent(event);
|
||||
if (!tutorialStarted) {
|
||||
if (!tutorialController || tutorialStarted || SettingsCache::instance().userInterface().getTutorialCompleted()) {
|
||||
return;
|
||||
}
|
||||
// Only start once all sequences are registered so advancing can't run past the
|
||||
// end of an incomplete sequence list.
|
||||
if (tutorialInitialized) {
|
||||
tutorialStarted = true;
|
||||
// Start on next event loop iteration so everything is fully painted
|
||||
QTimer::singleShot(3, tutorialController, [this] { tutorialController->start(); });
|
||||
|
|
@ -236,7 +235,7 @@ void TabGame::finishTutorialInitialization()
|
|||
loadDeckStep.autoAdvanceOnValid = true;
|
||||
loadDeckStep.validationTiming = ValidationTiming::OnSignal;
|
||||
loadDeckStep.signalSource = game->getGameEventHandler();
|
||||
loadDeckStep.signalName = SIGNAL(logDeckSelect(Player *, QString, int));
|
||||
loadDeckStep.signalName = SIGNAL(logDeckSelect(PlayerLogic *, QString, int));
|
||||
loadDeckStep.validator = [] { return true; };
|
||||
|
||||
deckSelectSequence.addStep(loadDeckStep);
|
||||
|
|
@ -262,9 +261,6 @@ void TabGame::finishTutorialInitialization()
|
|||
gamePlaySequence.addStep(
|
||||
{gamePlayAreaWidget,
|
||||
tr("Welcome to your first game! It's just a singleplayer game for now to teach you the controls.")});
|
||||
gamePlaySequence.addStep(
|
||||
{gamePlayAreaWidget,
|
||||
tr("Welcome to your first game! It's just a singleplayer game for now to teach you the controls.")});
|
||||
gamePlaySequence.addStep(
|
||||
{gamePlayAreaWidget,
|
||||
tr("Unfortunately, due to the way the game tab works, we can't highlight any specific gameplay elements but "
|
||||
|
|
@ -311,7 +307,7 @@ void TabGame::finishTutorialInitialization()
|
|||
lifeCounterStep.signalSource = game->getPlayerManager()
|
||||
->getActiveLocalPlayer(game->getPlayerManager()->getLocalPlayerId())
|
||||
->getPlayerEventHandler();
|
||||
lifeCounterStep.signalName = SIGNAL(logSetCounter(Player *, QString, int, int));
|
||||
lifeCounterStep.signalName = SIGNAL(logSetCounter(PlayerLogic *, QString, int, int));
|
||||
lifeCounterStep.validator = [this] {
|
||||
auto counters =
|
||||
game->getPlayerManager()->getActiveLocalPlayer(game->getPlayerManager()->getLocalPlayerId())->getCounters();
|
||||
|
|
@ -338,7 +334,7 @@ void TabGame::finishTutorialInitialization()
|
|||
diceRollStep.signalSource = game->getPlayerManager()
|
||||
->getActiveLocalPlayer(game->getPlayerManager()->getLocalPlayerId())
|
||||
->getPlayerEventHandler();
|
||||
diceRollStep.signalName = SIGNAL(logRollDie(Player *, int, const QList<uint> &));
|
||||
diceRollStep.signalName = SIGNAL(logRollDie(PlayerLogic *, int, const QList<uint> &));
|
||||
diceRollStep.validator = [] { return true; };
|
||||
diceRollStep.validationHint = tr("Roll a dice using any of these methods.");
|
||||
|
||||
|
|
@ -357,7 +353,7 @@ void TabGame::finishTutorialInitialization()
|
|||
mulliganStep.signalSource = game->getPlayerManager()
|
||||
->getActiveLocalPlayer(game->getPlayerManager()->getLocalPlayerId())
|
||||
->getPlayerEventHandler();
|
||||
mulliganStep.signalName = SIGNAL(logDrawCards(Player *, int, bool));
|
||||
mulliganStep.signalName = SIGNAL(logDrawCards(PlayerLogic *, int, bool));
|
||||
mulliganStep.validator = [this] {
|
||||
return game->getPlayerManager()
|
||||
->getActiveLocalPlayer(game->getPlayerManager()->getLocalPlayerId())
|
||||
|
|
@ -369,11 +365,17 @@ void TabGame::finishTutorialInitialization()
|
|||
|
||||
gamePlaySequence.addStep(mulliganStep);
|
||||
|
||||
gamePlaySequence.addStep({gamePlayAreaWidget, tr("")});
|
||||
gamePlaySequence.addStep({gamePlayAreaWidget, tr("")});
|
||||
|
||||
gamePlaySequence.addStep({gamePlayAreaWidget, tr("")});
|
||||
tutorialController->addSequence(gamePlaySequence);
|
||||
|
||||
if (tutorialStarted || SettingsCache::instance().userInterface().getTutorialCompleted()) {
|
||||
return;
|
||||
}
|
||||
// The tab may have been shown before the local player joined; start now that
|
||||
// the full sequence list is registered.
|
||||
if (isVisible()) {
|
||||
tutorialStarted = true;
|
||||
QTimer::singleShot(3, tutorialController, [this] { tutorialController->start(); });
|
||||
}
|
||||
}
|
||||
|
||||
void TabGame::connectToGameState()
|
||||
|
|
@ -1066,8 +1068,6 @@ void TabGame::loadDeckForLocalPlayer(PlayerLogic *localPlayer, int playerId, Ser
|
|||
CardPictureLoader::cacheCardPixmaps(CardDatabaseManager::query()->getCards(deckList.getCardRefList()));
|
||||
deckViewContainer->playerDeckView->setDeck(deckList);
|
||||
localPlayer->setDeck(deckList);
|
||||
|
||||
emit localPlayerDeckSelected();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ inline Q_LOGGING_CATEGORY(TabGameLog, "tab_game");
|
|||
|
||||
class UserListProxy;
|
||||
class AbstractClient;
|
||||
class TutorialController;
|
||||
class GameView;
|
||||
class GameScene;
|
||||
class ReplayWidget;
|
||||
|
|
@ -68,7 +69,7 @@ class TabGame : public Tab
|
|||
Q_OBJECT
|
||||
private:
|
||||
AbstractGame *game;
|
||||
TutorialController *tutorialController;
|
||||
TutorialController *tutorialController = nullptr;
|
||||
bool tutorialStarted = false;
|
||||
bool tutorialInitialized = false;
|
||||
const UserListProxy *userListProxy;
|
||||
|
|
@ -144,7 +145,6 @@ private:
|
|||
void createReplayDock(GameReplay *replay);
|
||||
void updateInviteButtonState();
|
||||
signals:
|
||||
void localPlayerDeckSelected();
|
||||
void localPlayerReadyStateChanged(bool ready);
|
||||
void gameClosing(TabGame *tab);
|
||||
void containerProcessingStarted(const GameEventContext &context);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
#include <libcockatrice/deck_list/loaded_deck.h>
|
||||
#include <libcockatrice/models/deck_list/deck_list_model.h>
|
||||
#include <libcockatrice/settings/deck_editor_settings.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/layouts_settings.h>
|
||||
#include <qnamespace.h>
|
||||
#include <qobjectdefs.h>
|
||||
|
|
@ -91,8 +92,6 @@ TabDeckEditorVisual::TabDeckEditorVisual(TabSupervisor *_tabSupervisor) : Abstra
|
|||
"adding some now, so you can see it in action!",
|
||||
[this]() { tabContainer->setCurrentWidget(tabContainer->visualDeckView); }});
|
||||
|
||||
// sequence.addStep({printingSelectorDockWidget, "Change the printings in your deck here."});
|
||||
|
||||
tutorialController->addSequence(sequence);
|
||||
|
||||
auto vdeSequence = tabContainer->visualDeckView->addTutorialSteps();
|
||||
|
|
@ -147,7 +146,7 @@ TabDeckEditorVisual::TabDeckEditorVisual(TabSupervisor *_tabSupervisor) : Abstra
|
|||
void TabDeckEditorVisual::showEvent(QShowEvent *ev)
|
||||
{
|
||||
QWidget::showEvent(ev);
|
||||
if (!tutorialStarted) {
|
||||
if (!tutorialStarted && !SettingsCache::instance().userInterface().getTutorialCompleted()) {
|
||||
tutorialStarted = true;
|
||||
// Start on next event loop iteration so everything is fully painted
|
||||
QTimer::singleShot(0, tutorialController, [this] { tutorialController->start(); });
|
||||
|
|
|
|||
|
|
@ -214,15 +214,19 @@ TutorialSequence VisualDatabaseDisplayWidget::addTutorialSteps()
|
|||
|
||||
TutorialStep explorationStep;
|
||||
explorationStep.targetWidget = this;
|
||||
explorationStep.text = tr(
|
||||
"Try it out!\n\nWe've cleared the previous deck. Add 5 different new cards to the deck by clicking on them!");
|
||||
explorationStep.text = tr("Try it out!\n\nAdd 5 different new cards to the deck by clicking on them!");
|
||||
explorationStep.allowClickThrough = true;
|
||||
explorationStep.requiresInteraction = true;
|
||||
explorationStep.autoAdvanceOnValid = true;
|
||||
explorationStep.validationTiming = ValidationTiming::OnSignal;
|
||||
if (QtUtils::findParentOfType<TabDeckEditorVisual>(this)) {
|
||||
explorationStep.onEnter = [this] {
|
||||
QtUtils::findParentOfType<TabDeckEditorVisual>(this)->deckStateManager->clearDeck();
|
||||
auto deckEditor = QtUtils::findParentOfType<TabDeckEditorVisual>(this);
|
||||
// Only clear an empty starter deck; never destroy a deck the user may
|
||||
// have opened with existing cards.
|
||||
if (deckEditor->deckStateManager->getModel()->getDeckList()->getCardList().isEmpty()) {
|
||||
deckEditor->deckStateManager->clearDeck();
|
||||
}
|
||||
};
|
||||
explorationStep.signalSource =
|
||||
QtUtils::findParentOfType<TabDeckEditorVisual>(this)->deckStateManager->getModel();
|
||||
|
|
@ -254,19 +258,6 @@ TutorialSequence VisualDatabaseDisplayWidget::addTutorialSteps()
|
|||
|
||||
sequence.addStep(conclusionStep);
|
||||
|
||||
/*sequence.addStep(
|
||||
{quickFilterSaveLoadWidget, "This button will let you save and load all currently applied filters to files."});
|
||||
sequence.addStep({quickFilterNameWidget,
|
||||
"This button will let you apply name filters. Optionally, you can import every card in "
|
||||
"your deck as a name filter and then save this as a filter using the save/load button "
|
||||
"to make your own quick access collections!"});
|
||||
sequence.addStep({mainTypeFilterWidget, "Use these buttons to quickly filter by card types."});
|
||||
sequence.addStep({quickFilterSubTypeWidget, "This button will let you apply filters for card sub-types."});
|
||||
sequence.addStep(
|
||||
{quickFilterSetWidget,
|
||||
"This button will let you apply filters for card sets. You can also filter to the X most recent sets. "
|
||||
"Filtering to a set will display all printings of a card within that set."});*/
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef COCKATRICE_VISUAL_DECK_DISPLAY_OPTIONS_WIDGET_H
|
||||
#define COCKATRICE_VISUAL_DECK_DISPLAY_OPTIONS_WIDGET_H
|
||||
|
||||
#include "../general/tutorial/tutorial_controller.h"
|
||||
#include "visual_deck_editor_widget.h"
|
||||
|
||||
#include <QList>
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ TutorialSequence VisualDeckEditorWidget::addTutorialSteps()
|
|||
searchStep.allowClickThrough = true;
|
||||
searchStep.requiresInteraction = true;
|
||||
searchStep.autoAdvanceOnValid = true;
|
||||
searchStep.validationTiming = ValidationTiming::OnChange; // Make sure this is set!
|
||||
searchStep.validationTiming = ValidationTiming::OnChange;
|
||||
searchStep.validator = [this]() {
|
||||
return CardDatabaseManager::query()->getCard({searchBar->text()}) != ExactCard();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -246,6 +246,11 @@ QStringList InterfaceSettings::getUserListExpandedSections() const
|
|||
.toStringList();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getTutorialCompleted() const
|
||||
{
|
||||
return getValue("tutorialCompleted", QString(), QString(), false).toBool();
|
||||
}
|
||||
|
||||
void InterfaceSettings::setUseTearOffMenus(bool _useTearOffMenus)
|
||||
{
|
||||
setValue(_useTearOffMenus, "useTearOffMenus");
|
||||
|
|
@ -469,3 +474,8 @@ void InterfaceSettings::setUserListExpandedSections(const QStringList §ions)
|
|||
{
|
||||
setValue(sections, "userListExpandedSections");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setTutorialCompleted(bool value)
|
||||
{
|
||||
setValue(value, "tutorialCompleted");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public:
|
|||
[[nodiscard]] bool getLifeCounterAnimationsEnabled() const override;
|
||||
[[nodiscard]] bool getBattlefieldFlashEnabled() const override;
|
||||
[[nodiscard]] QStringList getUserListExpandedSections() const override;
|
||||
[[nodiscard]] bool getTutorialCompleted() const;
|
||||
|
||||
void setUseTearOffMenus(bool _useTearOffMenus);
|
||||
void setCardViewInitialRowsMax(int _cardViewInitialRowsMax);
|
||||
|
|
@ -96,6 +97,7 @@ public:
|
|||
void setLifeCounterAnimationsEnabled(bool _lifeCounterAnimationsEnabled);
|
||||
void setBattlefieldFlashEnabled(bool _battlefieldFlashEnabled);
|
||||
void setUserListExpandedSections(const QStringList §ions);
|
||||
void setTutorialCompleted(bool value);
|
||||
|
||||
signals:
|
||||
void useTearOffMenusChanged(bool state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue