From fef767335f0058168f576eb2c3a4b36c58a9b129 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 11 May 2015 10:53:05 -0400 Subject: [PATCH] remove loggedIn variable, small change to tooltips --- src/gui/game/GameView.cpp | 15 +++++---------- src/gui/game/GameView.h | 1 - 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index b5ba18265..0fcf7752b 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -157,7 +157,6 @@ GameView::GameView(): drawSnap(false), shiftBehaviour(false), ctrlBehaviour(false), - loggedIn(false), altBehaviour(false), showHud(true), showDebug(false), @@ -259,14 +258,14 @@ GameView::GameView(): SaveSimulationAction(GameView * _v) { v = _v; } void ActionCallbackRight(ui::Button * sender) { - if(v->CtrlBehaviour() || !v->loggedIn) + if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().ID) v->c->OpenLocalSaveWindow(false); else v->c->OpenSaveWindow(); } void ActionCallbackLeft(ui::Button * sender) { - if(v->CtrlBehaviour() || !v->loggedIn) + if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().ID) v->c->OpenLocalSaveWindow(true); else v->c->SaveAsCurrent(); @@ -866,16 +865,12 @@ void GameView::NotifyUserChanged(GameModel * sender) loginButton->SetText("[sign in]"); ((SplitButton*)loginButton)->SetShowSplit(false); ((SplitButton*)loginButton)->SetRightToolTip("Sign in to simulation server"); - - loggedIn = false; } else { loginButton->SetText(sender->GetUser().Username); ((SplitButton*)loginButton)->SetShowSplit(true); ((SplitButton*)loginButton)->SetRightToolTip("Edit profile"); - - loggedIn = true; } // saveSimulationButtonEnabled = sender->GetUser().ID; saveSimulationButtonEnabled = true; @@ -926,13 +921,11 @@ void GameView::NotifySaveChanged(GameModel * sender) if (sender->GetUser().ID) { - loggedIn = true; upVoteButton->Appearance.BorderDisabled = upVoteButton->Appearance.BorderInactive; downVoteButton->Appearance.BorderDisabled = downVoteButton->Appearance.BorderInactive; } else { - loggedIn = false; upVoteButton->Appearance.BorderDisabled = ui::Colour(100, 100, 100); downVoteButton->Appearance.BorderDisabled = ui::Colour(100, 100, 100); } @@ -1992,8 +1985,10 @@ void GameView::disableCtrlBehaviour() void GameView::SetSaveButtonTooltips() { - if (ctrlBehaviour || !loggedIn) + if (!Client::Ref().GetAuthUser().ID) ((SplitButton*)saveSimulationButton)->SetToolTips("Save the simulation to your hard drive. Login to save online.", "Save the simulation to your hard drive. Login to save online."); + else if (ctrlBehaviour) + ((SplitButton*)saveSimulationButton)->SetToolTips("Save the simulation to your hard drive.", "Save the simulation to your hard drive."); else if (((SplitButton*)saveSimulationButton)->GetShowSplit()) ((SplitButton*)saveSimulationButton)->SetToolTips("Reupload the current simulation", "Modify simulation properties"); else diff --git a/src/gui/game/GameView.h b/src/gui/game/GameView.h index 7724df97e..63726a9c1 100644 --- a/src/gui/game/GameView.h +++ b/src/gui/game/GameView.h @@ -40,7 +40,6 @@ private: bool drawSnap; bool shiftBehaviour; bool ctrlBehaviour; - bool loggedIn; bool altBehaviour; bool showHud; bool showDebug;