Skip to content

Commit 721018c

Browse files
committed
Try disable tutorial on android TV to make google happy
1 parent d37558f commit 721018c

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed

src/modes/overworld.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
#include "tracks/track.hpp"
3939
#include "tracks/track_object_manager.hpp"
4040

41+
#ifdef ANDROID
42+
#include <SDL_system.h>
43+
#endif
44+
4145
//-----------------------------------------------------------------------------
4246
OverWorld::OverWorld() : World()
4347
{
@@ -242,6 +246,11 @@ void OverWorld::onFirePressed(Controller* who)
242246
{
243247
if (challenges[n].m_challenge_id == "tutorial")
244248
{
249+
#ifdef ANDROID
250+
if (SDL_IsAndroidTV())
251+
return;
252+
#endif
253+
245254
scheduleTutorial();
246255
return;
247256
}

src/states_screens/help/help_screen_1.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
#include "guiengine/widgets/button_widget.hpp"
2222
#include "modes/tutorial_utils.hpp"
2323

24+
#ifdef ANDROID
25+
#include <SDL_system.h>
26+
#endif
27+
2428
using namespace GUIEngine;
2529

2630
// -----------------------------------------------------------------------------
@@ -37,6 +41,22 @@ void HelpScreen1::loadedFromFile()
3741

3842
// -----------------------------------------------------------------------------
3943

44+
void HelpScreen1::beforeAddingWidget()
45+
{
46+
#ifdef ANDROID
47+
if (SDL_IsAndroidTV())
48+
{
49+
Widget* tutorial = getWidget("startTutorial");
50+
if (tutorial)
51+
tutorial->setVisible(false);
52+
53+
Widget* tutorial_icon = getWidget("tutorialIcon");
54+
if (tutorial_icon)
55+
tutorial_icon->setVisible(false);
56+
}
57+
#endif
58+
}
59+
4060
void HelpScreen1::eventCallback(Widget* widget, const std::string& name, const int playerID)
4161
{
4262
if (name == "startTutorial")

src/states_screens/help/help_screen_1.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class HelpScreen1 : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<
3535

3636
/** \brief implement callback from parent class GUIEngine::Screen */
3737
virtual void loadedFromFile() OVERRIDE;
38+
39+
/** \brief implement callback from parent class GUIEngine::Screen */
40+
virtual void beforeAddingWidget() OVERRIDE;
3841

3942
/** \brief implement callback from parent class GUIEngine::Screen */
4043
virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,

src/states_screens/main_menu_screen.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272

7373
#include <IrrlichtDevice.h>
7474

75+
#ifdef ANDROID
76+
#include <SDL_system.h>
77+
#endif
78+
7579
using namespace GUIEngine;
7680
using namespace Online;
7781

@@ -119,6 +123,15 @@ void MainMenuScreen::beforeAddingWidget()
119123
if (w)
120124
w->setVisible(false);
121125
#endif
126+
127+
#ifdef ANDROID
128+
if (SDL_IsAndroidTV())
129+
{
130+
Widget* tutorial = getWidget("startTutorial");
131+
if (tutorial)
132+
tutorial->setVisible(false);
133+
}
134+
#endif
122135
}
123136

124137
// ----------------------------------------------------------------------------
@@ -327,6 +340,12 @@ void MainMenuScreen::onUpdate(float delta)
327340
if (player->getUseFrequency() != 0)
328341
return;
329342

343+
#ifdef ANDROID
344+
// Don't show tutorial dialog on Android TV
345+
if (SDL_IsAndroidTV())
346+
return;
347+
#endif
348+
330349
player->incrementUseFrequency();
331350
class PlayTutorial :
332351
public MessageDialog::IConfirmDialogListener

src/states_screens/race_gui_overworld.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
#include <IrrlichtDevice.h>
5959
#include <ISceneCollisionManager.h>
6060
#include <ISceneManager.h>
61+
62+
#ifdef ANDROID
63+
#include <SDL_system.h>
64+
#endif
65+
6166
using namespace irr;
6267

6368
#include <algorithm>
@@ -526,6 +531,11 @@ void RaceGUIOverworld::drawGlobalMiniMap()
526531

527532
if (challenges[n].m_challenge_id == "tutorial")
528533
{
534+
#ifdef ANDROID
535+
if (SDL_IsAndroidTV())
536+
continue;
537+
#endif
538+
529539
gui::ScalableFont* font = GUIEngine::getTitleFont();
530540
font->draw(_("Tutorial"), pos, video::SColor(255,255,255,255),
531541
false, true /* vcenter */, NULL);

0 commit comments

Comments
 (0)