Navigation Menu

Skip to content

Commit

Permalink
when you're not logged in, displys a not-highlighted HDD save button
Browse files Browse the repository at this point in the history
  • Loading branch information
boxmein committed May 1, 2015
1 parent bf001df commit 424d1d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/gui/game/GameView.cpp
Expand Up @@ -157,6 +157,7 @@ GameView::GameView():
drawSnap(false),
shiftBehaviour(false),
ctrlBehaviour(false),
loggedIn(false),
altBehaviour(false),
showHud(true),
showDebug(false),
Expand Down Expand Up @@ -865,13 +866,16 @@ void GameView::NotifyUserChanged(GameModel * sender)
loginButton->SetText("[sign in]");
((SplitButton*)loginButton)->SetShowSplit(false);
((SplitButton*)loginButton)->SetRightToolTip("Sign in to simulation server");
enableCtrlBehaviour();

loggedIn = false;
}
else
{
loginButton->SetText(sender->GetUser().Username);
((SplitButton*)loginButton)->SetShowSplit(true);
((SplitButton*)loginButton)->SetRightToolTip("Edit profile");

loggedIn = true;
}
saveSimulationButtonEnabled = sender->GetUser().ID;
NotifySaveChanged(sender);
Expand Down Expand Up @@ -921,11 +925,13 @@ 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 @@ -1990,7 +1996,7 @@ void GameView::SetSaveButtonTooltips()
else if (((SplitButton*)saveSimulationButton)->GetShowSplit())
((SplitButton*)saveSimulationButton)->SetToolTips("Reupload the current simulation", "Modify simulation properties");
else
((SplitButton*)saveSimulationButton)->SetToolTips("Reupload the current simulation", "Upload a new simulation");
((SplitButton*)saveSimulationButton)->SetToolTips("Reupload the current simulation", "Upload a new simulation. Hold Ctrl to save offline.");
}

void GameView::OnDraw()
Expand Down
1 change: 1 addition & 0 deletions src/gui/game/GameView.h
Expand Up @@ -40,6 +40,7 @@ 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 424d1d4

Please sign in to comment.