Skip to content

Commit

Permalink
implement HDD saving by default in GameView. update tooltips to descr…
Browse files Browse the repository at this point in the history
…ibe behaviour.
  • Loading branch information
boxmein committed May 1, 2015
1 parent 424d1d4 commit 7145cac
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/gui/game/GameView.cpp
Expand Up @@ -224,7 +224,7 @@ GameView::GameView():
scrollBar->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
AddComponent(scrollBar);

searchButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(17, 15), "", "Find & open a simulation"); //Open
searchButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(17, 15), "", "Find & open a simulation. Hold Ctrl to load offline saves."); //Open
searchButton->SetIcon(IconOpen);
currentX+=18;
searchButton->SetTogglable(false);
Expand Down Expand Up @@ -259,14 +259,14 @@ GameView::GameView():
SaveSimulationAction(GameView * _v) { v = _v; }
void ActionCallbackRight(ui::Button * sender)
{
if(v->CtrlBehaviour())
if(v->CtrlBehaviour() || !v->loggedIn)
v->c->OpenLocalSaveWindow(false);
else
v->c->OpenSaveWindow();
}
void ActionCallbackLeft(ui::Button * sender)
{
if(v->CtrlBehaviour())
if(v->CtrlBehaviour() || !v->loggedIn)
v->c->OpenLocalSaveWindow(true);
else
v->c->SaveAsCurrent();
Expand Down Expand Up @@ -877,7 +877,8 @@ void GameView::NotifyUserChanged(GameModel * sender)

loggedIn = true;
}
saveSimulationButtonEnabled = sender->GetUser().ID;
// saveSimulationButtonEnabled = sender->GetUser().ID;
saveSimulationButtonEnabled = true;
NotifySaveChanged(sender);
}

Expand Down Expand Up @@ -1951,7 +1952,7 @@ void GameView::enableCtrlBehaviour(bool isHighlighted)
searchButton->Appearance.TextInactive = searchButton->Appearance.TextHover = ui::Colour(0, 0, 0);
}

searchButton->SetToolTip("Open a simulation from your hard drive");
searchButton->SetToolTip("Open a simulation from your hard drive.");
if (currentSaveType == 2)
((SplitButton*)saveSimulationButton)->SetShowSplit(true);
if(isMouseDown || (toolBrush && drawMode == DrawPoints))
Expand Down Expand Up @@ -1979,7 +1980,7 @@ void GameView::disableCtrlBehaviour()
searchButton->Appearance.BackgroundInactive = ui::Colour(0, 0, 0);
searchButton->Appearance.BackgroundHover = ui::Colour(20, 20, 20);
searchButton->Appearance.TextInactive = searchButton->Appearance.TextHover = ui::Colour(255, 255, 255);
searchButton->SetToolTip("Find & open a simulation");
searchButton->SetToolTip("Find & open a simulation. Hold Ctrl to load offline saves.");
if (currentSaveType == 2)
((SplitButton*)saveSimulationButton)->SetShowSplit(false);
if(!shiftBehaviour)
Expand All @@ -1991,8 +1992,8 @@ void GameView::disableCtrlBehaviour()

void GameView::SetSaveButtonTooltips()
{
if (ctrlBehaviour)
((SplitButton*)saveSimulationButton)->SetToolTips("Save the simulation to your hard drive", "Save the simulation to your hard drive");
if (ctrlBehaviour || !loggedIn)
((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 (((SplitButton*)saveSimulationButton)->GetShowSplit())
((SplitButton*)saveSimulationButton)->SetToolTips("Reupload the current simulation", "Modify simulation properties");
else
Expand Down

0 comments on commit 7145cac

Please sign in to comment.