store solved puzzles in the user profile. Load them from the user profile too.

This commit is contained in:
Tim Young 2017-07-29 18:52:23 -05:00
parent 1ab8e0e0fb
commit ea5f038157
3 changed files with 31 additions and 1 deletions

View File

@ -236,7 +236,7 @@ namespace EduNetworkBuilder
{
pi = NB.GetPuzzleInfoFromName(str);
shown_name = pi.PuzzleName;
if (oursettings.ScoreList.Contains(str))
if (oursettings.CheckIfDone(str))
{
shown_name = "* " + shown_name;
wasfinished = true;

View File

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

View File

@ -121,6 +121,9 @@ namespace EduNetworkBuilder
case "password":
Passwords.Add(Individual.InnerText);
break;
case "scorelist":
EverCompletedPuzzles.Add(Individual.InnerText);
break;
case "project":
case "schoolwork":
SchoolworkClass SWC = new SchoolworkClass(Individual);
@ -168,6 +171,10 @@ namespace EduNetworkBuilder
writer.WriteElementString("PasswordHint", PasswordHint);
writer.WriteElementString("AltPassword", AltPassword);
writer.WriteElementString("IsAdmin", isAdmin.ToString());
foreach(string one in EverCompletedPuzzles)
{
writer.WriteElementString("ScoreList", one);
}
foreach(string One in Passwords)
writer.WriteElementString("Password", One);
//Save all the devices
@ -186,5 +193,13 @@ namespace EduNetworkBuilder
EverCompletedPuzzles.Add(PuzzleName);
}
}
public bool CheckIfDone(string PuzzleName)
{
if (EverCompletedPuzzles.Contains(PuzzleName))
return true;
else
return false;
}
}
}