diff --git a/EduNetworkBuilder/ListBoxWindow.cs b/EduNetworkBuilder/ListBoxWindow.cs index d015513..1549922 100644 --- a/EduNetworkBuilder/ListBoxWindow.cs +++ b/EduNetworkBuilder/ListBoxWindow.cs @@ -372,6 +372,62 @@ namespace EduNetworkBuilder btnOK.Enabled = false; } } + if (MyMode == LBContents.regressiontest) + { + cbLoadPuzzlesAtStart.Visible = false; + btnReset.Visible = false; + tbSearchBox.Visible = false; + + PuzzleInfo pi; + string shown_name; + string puzzle_name = ""; + List Puzzles = NB.GetPuzzleNames(); + NBSettings oursettings = NB.GetSettings(); + if (Puzzles == null) return; + bool wasfinished = false; + foreach (string str in Puzzles) + { + wasfinished = false; + pi = NB.GetPuzzleInfoFromName(str); + //shown_name = pi.PuzzleName; + shown_name = pi.NetTitle.GetText(); + puzzle_name = pi.PuzzleName; + if (oursettings.CheckIfDone(str)) + { + wasfinished = true; + } + foreach (string tag in pi.PuzzleTags) + { + if (isChecked(tag)) + { + MyPuzzleEntry MPE = new MyPuzzleEntry(); + MPE.PuzzleName = puzzle_name; + MPE.Title = shown_name; + MPE.isdone = wasfinished; + MPE.level = tag; + if (selected == "" && !wasfinished) selected = shown_name; //Select the first unfinished puzzle + lbWindowData.Items.Add(MPE); + break; + } + } + } + if (selected != null && selected != "") + { + foreach (object one in lbWindowData.Items) + { + if (one.ToString() == selected) + lbWindowData.SelectedItem = selected; + } + } + if (lbWindowData.SelectedIndex != -1) + { + btnOK.Enabled = true; + } + else + { + btnOK.Enabled = false; + } + } } private void btnOK_Click(object sender, EventArgs e)