summaryrefslogtreecommitdiff
path: root/src/game/GameView.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2012-10-19 23:17:15 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-10-26 14:15:38 (GMT)
commit3a29fc0268dbda68e80f7de586c6692ba7a11565 (patch)
treefa2ae1ded7149c2b56c4dcecac032e991b30d00e /src/game/GameView.cpp
parente2622657f076ef943d051593d0969306daf15f32 (diff)
downloadpowder-3a29fc0268dbda68e80f7de586c6692ba7a11565.zip
powder-3a29fc0268dbda68e80f7de586c6692ba7a11565.tar.gz
Save local saves as current name option (overwrites them automatically). Fix filename not showing when first saving a local save
Diffstat (limited to 'src/game/GameView.cpp')
-rw-r--r--src/game/GameView.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index 9a2f772..73b3833 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -181,7 +181,8 @@ GameView::GameView():
recording(false),
screenshotIndex(0),
recordingIndex(0),
- toolTipPresence(0)
+ toolTipPresence(0),
+ currentSaveType(0)
{
int currentX = 1;
@@ -238,14 +239,14 @@ GameView::GameView():
void ActionCallbackRight(ui::Button * sender)
{
if(v->CtrlBehaviour())
- v->c->OpenLocalSaveWindow();
+ v->c->OpenLocalSaveWindow(false);
else
v->c->OpenSaveWindow();
}
void ActionCallbackLeft(ui::Button * sender)
{
if(v->CtrlBehaviour())
- v->c->OpenLocalSaveWindow();
+ v->c->OpenLocalSaveWindow(true);
else
v->c->SaveAsCurrent();
}
@@ -846,11 +847,15 @@ void GameView::NotifySaveChanged(GameModel * sender)
{
tagSimulationButton->SetText("[no tags set]");
}
+ currentSaveType = 1;
}
- else if (sender->GetFile())
+ else if (sender->GetSaveFile())
{
- ((SplitButton*)saveSimulationButton)->SetShowSplit(false);
- saveSimulationButton->SetText(sender->GetFile()->GetDisplayName());
+ if (ctrlBehaviour)
+ ((SplitButton*)saveSimulationButton)->SetShowSplit(true);
+ else
+ ((SplitButton*)saveSimulationButton)->SetShowSplit(false);
+ saveSimulationButton->SetText(sender->GetSaveFile()->GetDisplayName());
reloadButton->Enabled = true;
upVoteButton->Enabled = false;
upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0));
@@ -858,6 +863,7 @@ void GameView::NotifySaveChanged(GameModel * sender)
upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0));
tagSimulationButton->Enabled = false;
tagSimulationButton->SetText("[no tags set]");
+ currentSaveType = 2;
}
else
{
@@ -870,6 +876,7 @@ void GameView::NotifySaveChanged(GameModel * sender)
upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0));
tagSimulationButton->Enabled = false;
tagSimulationButton->SetText("[no tags set]");
+ currentSaveType = 0;
}
}
@@ -1685,6 +1692,8 @@ void GameView::enableCtrlBehaviour()
saveSimulationButton->Appearance.TextInactive = saveSimulationButton->Appearance.TextHover = ui::Colour(0, 0, 0);
searchButton->Appearance.BackgroundInactive = searchButton->Appearance.BackgroundHover = ui::Colour(255, 255, 255);
searchButton->Appearance.TextInactive = searchButton->Appearance.TextHover = ui::Colour(0, 0, 0);
+ if (currentSaveType == 2)
+ ((SplitButton*)saveSimulationButton)->SetShowSplit(true);
if(isMouseDown)
{
if(!shiftBehaviour)
@@ -1708,6 +1717,8 @@ 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);
+ if (currentSaveType == 2)
+ ((SplitButton*)saveSimulationButton)->SetShowSplit(false);
if(!shiftBehaviour)
c->SetToolStrength(1.0f);
else