Disabled online menu by default (use --online to get access to it).
This commit is contained in:
parent
5918f43ce6
commit
0d51477f5b
@ -191,6 +191,7 @@
|
||||
#include "replay/replay_play.hpp"
|
||||
#include "replay/replay_recorder.hpp"
|
||||
#include "states_screens/story_mode_lobby.hpp"
|
||||
#include "states_screens/main_menu_screen.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "states_screens/dialogs/message_dialog.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
@ -484,6 +485,8 @@ int handleCmdLinePreliminary()
|
||||
UserConfigParams::m_log_errors_to_console=true;
|
||||
if(CommandLine::has("--no-console"))
|
||||
UserConfigParams::m_log_errors_to_console=false;
|
||||
if(CommandLine::has("--online"))
|
||||
MainMenuScreen::m_enable_online=true;
|
||||
if(CommandLine::has("--log=nocolor"))
|
||||
{
|
||||
Log::disableColor();
|
||||
|
@ -64,6 +64,8 @@ using namespace Online;
|
||||
|
||||
DEFINE_SCREEN_SINGLETON( MainMenuScreen );
|
||||
|
||||
bool MainMenuScreen::m_enable_online = false;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
MainMenuScreen::MainMenuScreen() : Screen("main.stkgui")
|
||||
@ -111,11 +113,10 @@ void MainMenuScreen::init()
|
||||
w->setBadge(LOADING_BADGE);
|
||||
}
|
||||
|
||||
IconButtonWidget* online = getWidget<IconButtonWidget>("online");
|
||||
if(CurrentUser::get()->getID())
|
||||
online->setLabel(_("Online"));
|
||||
else
|
||||
online->setLabel(_("Login"));
|
||||
m_online = getWidget<IconButtonWidget>("online");
|
||||
|
||||
if(!m_enable_online)
|
||||
m_online->setDeactivated();
|
||||
|
||||
LabelWidget* w = getWidget<LabelWidget>("info_addons");
|
||||
const core::stringw &news_text = NewsManager::get()->getNextNewsMessage();
|
||||
@ -141,7 +142,10 @@ void MainMenuScreen::init()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void MainMenuScreen::onUpdate(float delta)
|
||||
|
||||
{
|
||||
m_online->setLabel(CurrentUser::get()->getID() ? _("Online")
|
||||
: _("Login" ) );
|
||||
IconButtonWidget* addons_icon = getWidget<IconButtonWidget>("addons");
|
||||
if (addons_icon != NULL)
|
||||
{
|
||||
|
@ -20,7 +20,8 @@
|
||||
|
||||
#include "guiengine/screen.hpp"
|
||||
|
||||
namespace GUIEngine { class Widget; class ListWidget; }
|
||||
namespace GUIEngine { class Widget; class ListWidget;
|
||||
class IconButtonWidget; }
|
||||
|
||||
/**
|
||||
* \brief Handles the main menu
|
||||
@ -31,9 +32,14 @@ class MainMenuScreen : public GUIEngine::Screen, public GUIEngine::ScreenSinglet
|
||||
private:
|
||||
friend class GUIEngine::ScreenSingleton<MainMenuScreen>;
|
||||
|
||||
/** Keep the widget to avoid looking it up every frame. */
|
||||
GUIEngine::IconButtonWidget* m_online;
|
||||
|
||||
MainMenuScreen();
|
||||
|
||||
public:
|
||||
/** Temporary disable the online menu while it is being worked at. */
|
||||
static bool m_enable_online;
|
||||
|
||||
virtual void onUpdate(float delta) OVERRIDE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user