From 0bde1d1cbe2a6770e4013ea68b171dc3f39c1f21 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Thu, 17 Oct 2019 21:18:29 +0300 Subject: [PATCH] Fixed tutorial --- src/tutorial_gui.cpp | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/src/tutorial_gui.cpp b/src/tutorial_gui.cpp index 575d63514e..bf746e606f 100644 --- a/src/tutorial_gui.cpp +++ b/src/tutorial_gui.cpp @@ -138,20 +138,17 @@ static WindowDesc _tutorial_desc( struct TutorialWindow : public Window { VideoLink_t *video; - int counter; TutorialWindow() : Window(&_tutorial_desc) { this->InitNested(WN_GAME_OPTIONS_ABOUT); this->video = NULL; - this->counter = 0; } virtual void OnClick(Point pt, int widget, int click_count) { showTutorialMainMenu = false; - this->counter = 5; - this->LowerWidget(widget); + this->video = NULL; this->SetDirty(); switch (widget) { case WID_STL_BUS: @@ -173,29 +170,9 @@ struct TutorialWindow : public Window { this->video = cargoTutorial; break; } - } - - virtual void OnTick() - { - // Open video with delay, to make visual feedback of button pressing, - // because youtube app freezes a screen for a second before launching. - if (this->counter > 0) { - this->counter--; - if (this->counter == 1) { - this->RaiseWidget(WID_STL_BUS); - this->RaiseWidget(WID_STL_TRUCK); - this->RaiseWidget(WID_STL_TRAIN); - this->RaiseWidget(WID_STL_SHIP); - //this->RaiseWidget(WID_STL_AIRPLANE); - this->RaiseWidget(WID_STL_FACILALL); - this->SetDirty(); - } - if (this->counter == 0) { - if (this->video) { - OpenExternTutorialVideo(this->video); - this->video = NULL; - } - } + if (this->video) { + OpenExternTutorialVideo(this->video); + this->video = NULL; } } };