Skip to content

Commit

Permalink
remove loggedIn variable, small change to tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed May 11, 2015
1 parent 16b7f7d commit fef7673
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
15 changes: 5 additions & 10 deletions src/gui/game/GameView.cpp
Expand Up @@ -157,7 +157,6 @@ GameView::GameView():
drawSnap(false),
shiftBehaviour(false),
ctrlBehaviour(false),
loggedIn(false),
altBehaviour(false),
showHud(true),
showDebug(false),
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/gui/game/GameView.h
Expand Up @@ -40,7 +40,6 @@ class GameView: public ui::Window
bool drawSnap;
bool shiftBehaviour;
bool ctrlBehaviour;
bool loggedIn;
bool altBehaviour;
bool showHud;
bool showDebug;
Expand Down

0 comments on commit fef7673

Please sign in to comment.