Mark puzzles as done in the user file

This commit is contained in:
Tim Young 2017-07-29 18:42:27 -05:00
parent 364858d07c
commit 1ab8e0e0fb
3 changed files with 24 additions and 5 deletions

View File

@ -107,6 +107,21 @@ namespace EduNetworkBuilder
}
}
public void MarkAsDone(string PuzzleName)
{
PersonClass PC = NB.GetUser();
if(PC != null)
{
PC.MarkAsDone(PuzzleName); //Mark it on the user's personal settings.
}
//we just mark it in the settings class
if (!ScoreList.Contains(PuzzleName))
{
ScoreList.Add(PuzzleName);
Save();
}
}
public static string GetFilename()
{
string BaseDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

View File

@ -881,11 +881,7 @@ namespace EduNetworkBuilder
if (PuzzleName != "" && PuzzleName != null)
{
NBSettings oursettings = NB.GetSettings();
if (!oursettings.ScoreList.Contains(PuzzleName))
{
oursettings.ScoreList.Add(PuzzleName);
oursettings.Save();
}
oursettings.MarkAsDone(PuzzleName);
}
}
//kill all extra windows that no longer need to be open.

View File

@ -178,5 +178,13 @@ namespace EduNetworkBuilder
writer.WriteEndElement();
}
#endregion
public void MarkAsDone(string PuzzleName)
{
if (!EverCompletedPuzzles.Contains(PuzzleName))
{
EverCompletedPuzzles.Add(PuzzleName);
}
}
}
}