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<PingTestStatus> PingTestStats = new List<PingTestStatus>();
private List<string> BrokenItems = new List<string>();
public bool IsRandomNetwork = false;
/// <summary>
/// WhatFrom: If we are launched from a homework, we remember it here.
@ -180,6 +181,7 @@ namespace EduNetworkBuilder
int newUnique=-1;
PuzzleName = Name;
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)
{
XmlNodeType myNodetype = Individual.NodeType;
@ -939,6 +941,8 @@ namespace EduNetworkBuilder
KillAllExtraWindows();
if (WhatFrom == null)
{
if (!IsRandomNetwork)
{
DialogResult answer = MessageBox.Show(NB.Translate("N_MarkAsSolvedDone"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
@ -950,6 +954,12 @@ namespace EduNetworkBuilder
}
}
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
{
PersonClass CurrentUser = NB.GetUser();
if (CurrentUser != null && CurrentUser.isAdmin)

View File

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

View File

@ -1929,6 +1929,10 @@
<value>Internet</value>
<comment>NB_InternetHomeAndOffice = Internet</comment>
</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">
<value>Full</value>
<comment>Options_Caption_full = Full</comment>