Hide kart color slider button if not GLSL

This commit is contained in:
Benau 2018-10-31 01:24:05 +08:00
parent cc580cec8b
commit 9e2084b63c
2 changed files with 13 additions and 1 deletions

View File

@ -22,6 +22,7 @@
#include "challenges/unlock_manager.hpp"
#include "config/player_manager.hpp"
#include "config/user_config.hpp"
#include "graphics/central_settings.hpp"
#include "guiengine/screen_keyboard.hpp"
#include "guiengine/widgets/check_box_widget.hpp"
#include "guiengine/widgets/dynamic_ribbon_widget.hpp"
@ -96,6 +97,13 @@ void BaseUserScreen::setNewAccountData(bool online, bool auto_login,
m_password_tb->setText(password);
} // setOnline
// ----------------------------------------------------------------------------
void BaseUserScreen::beforeAddingWidget()
{
getWidget<IconButtonWidget>("default_kart_color")
->setVisible(CVS->isGLSL());
} // beforeAddingWidget
// ----------------------------------------------------------------------------
/** Initialises the user screen. Searches for all players to fill the
* list of users with their icons, and initialises all widgets for the
@ -156,7 +164,8 @@ void BaseUserScreen::init()
getWidget<IconButtonWidget>("new_user")->setActive(!in_game);
getWidget<IconButtonWidget>("rename")->setActive(!in_game);
getWidget<IconButtonWidget>("delete")->setActive(!in_game);
getWidget<IconButtonWidget>("default_kart_color")->setActive(!in_game);
if (getWidget<IconButtonWidget>("default_kart_color")->isVisible())
getWidget<IconButtonWidget>("default_kart_color")->setActive(!in_game);
m_new_registered_data = false;
if (m_auto_login)

View File

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