Save the level we are working on

This commit is contained in:
2015-11-22 09:01:59 -05:00
parent 3f5100dcc0
commit 78bbfa8275
7 changed files with 86 additions and 4 deletions

View File

@ -151,14 +151,26 @@ namespace EduNetworkBuilder
if (Properties.Settings.Default.ScoreList == null)
Properties.Settings.Default.ScoreList = new System.Collections.Specialized.StringCollection();
PuzzleInfo PI;
string first = "";
string OriginalChoice = Properties.Settings.Default.ProcessingLevel;
if(OriginalChoice != null)
{
if (NB.PuzzleLevelHasUnsolved(OriginalChoice))
return OriginalChoice;
}
foreach (string str in NB.GetPuzzleNames())
{
if(!Properties.Settings.Default.ScoreList.Contains(str))
{
PI = NB.GetPuzzleInfoFromName(str);
return "Level_" + PI.Level;
first = "Level_" + PI.Level;
break;
}
}
if (first != "")
return first;
return NB.Translate("_All");
}
@ -308,6 +320,28 @@ namespace EduNetworkBuilder
{
processing = true;
DebugLevel toFind;
int mycount = 0;
string labelname = "";
if (MyMode == LBContents.puzzles)
{
foreach (Control mycontrol in panelCheckboxes.Controls)
{
//pull out the name
CheckBox cb = (CheckBox)mycontrol;
//make an enum. See if that is set. If so, mark it as checked
if (cb.Checked)
{
mycount++;
labelname = mycontrol.Text;
}
}
if (mycount == 1)
{
//We only have one item checked. Store this value for later
Properties.Settings.Default.ProcessingLevel = labelname;
Properties.Settings.Default.Save();
}
}
if (MyMode == LBContents.messages)
{
foreach (Control mycontrol in panelCheckboxes.Controls)
@ -319,6 +353,8 @@ namespace EduNetworkBuilder
if ((toFind & WhatToDisplay) == toFind)
{
cb.Checked = true;
labelname = mycontrol.Text;
mycount++;
}
else //If not, mark it as not checked.
{