Permalink
Browse files

Overwriting a local save now updates the reload button save, add mess…

…age to confirm that local save was successful, fixes #274
  • Loading branch information...
jacob1 committed Dec 16, 2015
1 parent 16e3532 commit 8d4e33398656aa40f4201811c8bdbddac390db14
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/gui/game/GameController.cpp
@@ -1100,8 +1100,9 @@ void GameController::OpenLocalSaveWindow(bool asCurrent)

std::string filename = "";
if (gameModel->GetSaveFile())
filename = gameModel->GetSaveFile()->GetDisplayName();
filename = gameModel->GetSaveFile()->GetName();
SaveFile tempSave(filename);
tempSave.SetDisplayName(gameModel->GetSaveFile()->GetDisplayName());
tempSave.SetGameSave(gameSave);

if (!asCurrent || !gameModel->GetSaveFile())
@@ -1122,9 +1123,12 @@ void GameController::OpenLocalSaveWindow(bool asCurrent)
}
else if (gameModel->GetSaveFile())
{
gameModel->SetSaveFile(&tempSave);
Client::Ref().MakeDirectory(LOCAL_SAVE_DIR);
if (Client::Ref().WriteFile(gameSave->Serialise(), gameModel->GetSaveFile()->GetName()))
new ErrorMessage("Error", "Unable to write save file.");
else
gameModel->SetInfoTip("Saved Successfully");
}
}
}

0 comments on commit 8d4e333

Please sign in to comment.