give a nice message when the random puzzle is solved.

This commit is contained in:
Tim Young 2017-09-01 15:15:16 -05:00
parent 7908de2fe3
commit ec6dbe0c3f
3 changed files with 23 additions and 8 deletions

View File

@ -67,6 +67,7 @@ namespace EduNetworkBuilder
private List<Image> PacketImages = new List<Image>(); private List<Image> PacketImages = new List<Image>();
private List<PingTestStatus> PingTestStats = new List<PingTestStatus>(); private List<PingTestStatus> PingTestStats = new List<PingTestStatus>();
private List<string> BrokenItems = new List<string>(); private List<string> BrokenItems = new List<string>();
public bool IsRandomNetwork = false;
/// <summary> /// <summary>
/// WhatFrom: If we are launched from a homework, we remember it here. /// WhatFrom: If we are launched from a homework, we remember it here.
@ -180,6 +181,7 @@ namespace EduNetworkBuilder
int newUnique=-1; int newUnique=-1;
PuzzleName = Name; PuzzleName = Name;
LoadedFromResource = FromResource; LoadedFromResource = FromResource;
IsRandomNetwork = false; //right now, it is set up from disk. We set this when we randomize the network
foreach (XmlNode Individual in TheNode.ChildNodes) foreach (XmlNode Individual in TheNode.ChildNodes)
{ {
XmlNodeType myNodetype = Individual.NodeType; XmlNodeType myNodetype = Individual.NodeType;
@ -940,13 +942,21 @@ namespace EduNetworkBuilder
if (WhatFrom == null) if (WhatFrom == null)
{ {
DialogResult answer = MessageBox.Show(NB.Translate("N_MarkAsSolvedDone"), NB.Translate("_Solved"), MessageBoxButtons.YesNo); if (!IsRandomNetwork)
if (answer == DialogResult.Yes)
{ {
KillAllExtraWindows(true); DialogResult answer = MessageBox.Show(NB.Translate("N_MarkAsSolvedDone"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
ListBoxWindow LBW = new ListBoxWindow();
LBW.ShowDialog(); if (answer == DialogResult.Yes)
{
KillAllExtraWindows(true);
ListBoxWindow LBW = new ListBoxWindow();
LBW.ShowDialog();
}
}
else
{
//It was a randomly generated puzzle. Let them know it was solved. But we do not auto-load a new one.
MessageBox.Show(NB.Translate("N_MarkRandomAsSolvedDone"), NB.Translate("_Solved"), MessageBoxButtons.OK);
} }
} }
else else

View File

@ -2179,7 +2179,8 @@ namespace EduNetworkBuilder
myNetwork.StartingHelpLevel = NetTestVerbosity.full; myNetwork.StartingHelpLevel = NetTestVerbosity.full;
myNetwork.HintsToDisplay = NetTestVerbosity.full; myNetwork.HintsToDisplay = NetTestVerbosity.full;
myNetwork.IsRandomNetwork = true;
myNetwork.PuzzleIsSolved = false;
myNetwork.NonVisualDoDHCPOnAll(); myNetwork.NonVisualDoDHCPOnAll();
List<TraversalClass> TraversalCollection = new List<TraversalClass>(); List<TraversalClass> TraversalCollection = new List<TraversalClass>();

View File

@ -1929,6 +1929,10 @@
<value>Internet</value> <value>Internet</value>
<comment>NB_InternetHomeAndOffice = Internet</comment> <comment>NB_InternetHomeAndOffice = Internet</comment>
</data> </data>
<data name="N_MarkRandomAsSolvedDone" xml:space="preserve">
<value>You have completed the randomly broken puzzle. Congratulations!</value>
<comment>N_MarkRandomAsSolvedDone = You have completed the randomly broken puzzle. Congratulations!</comment>
</data>
<data name="Options_Caption_full" xml:space="preserve"> <data name="Options_Caption_full" xml:space="preserve">
<value>Full</value> <value>Full</value>
<comment>Options_Caption_full = Full</comment> <comment>Options_Caption_full = Full</comment>