Show story mode icon only if overworld track exists.

It allows to decrease apk size a bit.
This commit is contained in:
Deve 2017-03-05 23:31:53 +01:00
parent eeb7c8f5de
commit d4cecd5a8b
2 changed files with 18 additions and 0 deletions

View File

@ -98,6 +98,21 @@ void MainMenuScreen::loadedFromFile()
#endif
} // loadedFromFile
// ----------------------------------------------------------------------------
void MainMenuScreen::beforeAddingWidget()
{
IconButtonWidget* w = getWidget<IconButtonWidget>("story");
assert(w != NULL);
if (track_manager->getTrack("overworld") == NULL ||
track_manager->getTrack("introcutscene") == NULL ||
track_manager->getTrack("introcutscene2") == NULL)
{
w->setVisible(false);
}
}
// ----------------------------------------------------------------------------
//
void MainMenuScreen::init()

View File

@ -52,6 +52,9 @@ public:
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void loadedFromFile() OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void beforeAddingWidget() OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,