Various fixes

Took 14 minutes
This commit is contained in:
Lukas Brübach 2026-08-09 03:16:22 +02:00
parent 4fca8e2a3a
commit 0909d356e0
15 changed files with 90 additions and 78 deletions

View file

@ -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(); });