store solved puzzles in the user profile. Load them from the user profile too.
This commit is contained in:
parent
1ab8e0e0fb
commit
ea5f038157
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user