mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
[App] First-run tutorial
Took 3 seconds Took 10 minutes Took 1 minute Took 4 minutes Took 23 minutes
This commit is contained in:
parent
ffc55aff10
commit
60e293dc2d
18 changed files with 1380 additions and 12 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "../../interface/pixel_map_generator.h"
|
||||
#include "../../interface/widgets/cards/card_info_frame_widget.h"
|
||||
#include "../../interface/widgets/deck_analytics/deck_analytics_widget.h"
|
||||
#include "../../interface/widgets/general/tutorial/tutorial_controller.h"
|
||||
#include "../../interface/widgets/visual_deck_editor/visual_deck_editor_widget.h"
|
||||
#include "../tab_deck_editor.h"
|
||||
#include "../tab_supervisor.h"
|
||||
|
|
@ -51,6 +52,44 @@ TabDeckEditorVisual::TabDeckEditorVisual(TabSupervisor *_tabSupervisor) : Abstra
|
|||
|
||||
loadLayout();
|
||||
cardDatabaseDockWidget->setHidden(true);
|
||||
tutorialController = new TutorialController(this);
|
||||
|
||||
auto sequence = TutorialSequence();
|
||||
|
||||
sequence.addStep({tabContainer->tabBar(),
|
||||
"The Visual Deck Editor has multiple different functionalities.\n\nYou can cycle "
|
||||
"through them by using these tabs.\n\nLet's start with the Visual Deck View."});
|
||||
sequence.addStep({tabContainer->visualDeckView,
|
||||
"The cards in your deck will be displayed here, allowing for an easy overview.\n\nLet's try "
|
||||
"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();
|
||||
vdeSequence.addStep({tabContainer->tabBar(), "Let's look at the database tab now."});
|
||||
tutorialController->addSequence(vdeSequence);
|
||||
|
||||
auto vddSequence = tabContainer->visualDatabaseDisplay->addTutorialSteps();
|
||||
vddSequence.steps.prepend(
|
||||
{tabContainer->visualDatabaseDisplay,
|
||||
"You can view the database here, either as card images or in the old table display "
|
||||
"style.\n\nAdditionally, there are many powerful and easy to use filters available.\n\nLet's dive in!",
|
||||
[this]() { tabContainer->setCurrentWidget(tabContainer->visualDatabaseDisplay); }});
|
||||
|
||||
tutorialController->addSequence(vddSequence);
|
||||
}
|
||||
|
||||
void TabDeckEditorVisual::showEvent(QShowEvent *ev)
|
||||
{
|
||||
QWidget::showEvent(ev);
|
||||
if (!tutorialStarted) {
|
||||
tutorialStarted = true;
|
||||
// Start on next event loop iteration so everything is fully painted
|
||||
QTimer::singleShot(0, tutorialController, [this] { tutorialController->start(); });
|
||||
}
|
||||
}
|
||||
|
||||
/** @brief Creates the central frame containing the tab container. */
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "../tab.h"
|
||||
#include "tab_deck_editor_visual_tab_widget.h"
|
||||
|
||||
class TutorialController;
|
||||
/**
|
||||
* @class TabDeckEditorVisual
|
||||
* @ingroup DeckEditorTabs
|
||||
|
|
@ -55,7 +56,12 @@ class TabDeckEditorVisual : public AbstractTabDeckEditor
|
|||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
TutorialController *tutorialController = nullptr;
|
||||
bool tutorialStarted = false;
|
||||
|
||||
protected slots:
|
||||
void showEvent(QShowEvent *ev) override;
|
||||
/**
|
||||
* @brief Load the editor layout from settings.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue