remove loggedIn variable, small change to tooltips

This commit is contained in:
jacob1 2015-05-11 10:53:05 -04:00
parent 16b7f7d7bf
commit fef767335f
2 changed files with 5 additions and 11 deletions

View File

@ -157,7 +157,6 @@ GameView::GameView():
drawSnap(false), drawSnap(false),
shiftBehaviour(false), shiftBehaviour(false),
ctrlBehaviour(false), ctrlBehaviour(false),
loggedIn(false),
altBehaviour(false), altBehaviour(false),
showHud(true), showHud(true),
showDebug(false), showDebug(false),
@ -259,14 +258,14 @@ GameView::GameView():
SaveSimulationAction(GameView * _v) { v = _v; } SaveSimulationAction(GameView * _v) { v = _v; }
void ActionCallbackRight(ui::Button * sender) void ActionCallbackRight(ui::Button * sender)
{ {
if(v->CtrlBehaviour() || !v->loggedIn) if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().ID)
v->c->OpenLocalSaveWindow(false); v->c->OpenLocalSaveWindow(false);
else else
v->c->OpenSaveWindow(); v->c->OpenSaveWindow();
} }
void ActionCallbackLeft(ui::Button * sender) void ActionCallbackLeft(ui::Button * sender)
{ {
if(v->CtrlBehaviour() || !v->loggedIn) if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().ID)
v->c->OpenLocalSaveWindow(true); v->c->OpenLocalSaveWindow(true);
else else
v->c->SaveAsCurrent(); v->c->SaveAsCurrent();
@ -866,16 +865,12 @@ void GameView::NotifyUserChanged(GameModel * sender)
loginButton->SetText("[sign in]"); loginButton->SetText("[sign in]");
((SplitButton*)loginButton)->SetShowSplit(false); ((SplitButton*)loginButton)->SetShowSplit(false);
((SplitButton*)loginButton)->SetRightToolTip("Sign in to simulation server"); ((SplitButton*)loginButton)->SetRightToolTip("Sign in to simulation server");
loggedIn = false;
} }
else else
{ {
loginButton->SetText(sender->GetUser().Username); loginButton->SetText(sender->GetUser().Username);
((SplitButton*)loginButton)->SetShowSplit(true); ((SplitButton*)loginButton)->SetShowSplit(true);
((SplitButton*)loginButton)->SetRightToolTip("Edit profile"); ((SplitButton*)loginButton)->SetRightToolTip("Edit profile");
loggedIn = true;
} }
// saveSimulationButtonEnabled = sender->GetUser().ID; // saveSimulationButtonEnabled = sender->GetUser().ID;
saveSimulationButtonEnabled = true; saveSimulationButtonEnabled = true;
@ -926,13 +921,11 @@ void GameView::NotifySaveChanged(GameModel * sender)
if (sender->GetUser().ID) if (sender->GetUser().ID)
{ {
loggedIn = true;
upVoteButton->Appearance.BorderDisabled = upVoteButton->Appearance.BorderInactive; upVoteButton->Appearance.BorderDisabled = upVoteButton->Appearance.BorderInactive;
downVoteButton->Appearance.BorderDisabled = downVoteButton->Appearance.BorderInactive; downVoteButton->Appearance.BorderDisabled = downVoteButton->Appearance.BorderInactive;
} }
else else
{ {
loggedIn = false;
upVoteButton->Appearance.BorderDisabled = ui::Colour(100, 100, 100); upVoteButton->Appearance.BorderDisabled = ui::Colour(100, 100, 100);
downVoteButton->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() 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."); ((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()) else if (((SplitButton*)saveSimulationButton)->GetShowSplit())
((SplitButton*)saveSimulationButton)->SetToolTips("Reupload the current simulation", "Modify simulation properties"); ((SplitButton*)saveSimulationButton)->SetToolTips("Reupload the current simulation", "Modify simulation properties");
else else

View File

@ -40,7 +40,6 @@ private:
bool drawSnap; bool drawSnap;
bool shiftBehaviour; bool shiftBehaviour;
bool ctrlBehaviour; bool ctrlBehaviour;
bool loggedIn;
bool altBehaviour; bool altBehaviour;
bool showHud; bool showHud;
bool showDebug; bool showDebug;