stop displaying spurious help messages & pop open help when we launch a network

This commit is contained in:
Tim Young 2017-07-31 19:14:05 -05:00
parent e5512b06b0
commit 3a7a3f4299
3 changed files with 15 additions and 9 deletions

View File

@ -96,6 +96,7 @@ namespace EduNetworkBuilder
public static void Clone(Network source, Network dest)
{
dest.AlreadyDisplayedMessage = false;
dest.DefaultTimeout = source.DefaultTimeout;
dest.HintsToDisplay = source.HintsToDisplay;
dest.itemsize = source.itemsize;
@ -161,7 +162,7 @@ namespace EduNetworkBuilder
}
}
public void Load(XmlNode TheNode, string Name, bool FromResource=false)
public void Load(XmlNode TheNode, string Name, bool FromResource=false, bool skipOpeningWindows = false)
{
_isDirty = true;
NetworkDevice newND;
@ -277,7 +278,17 @@ namespace EduNetworkBuilder
}
DoAllVerifyLinks();
DoAllAutoJoin();
if (NetMessage.GetText() != "" && !AlreadyDisplayedMessage)
OpenHelpIfNeeded(skipOpeningWindows);
if (NetTests.Count > 0)
PuzzleIsSolved = false; //When we load the puzzle.
if (newUnique != -1)
UniqueIdentifier = newUnique;
}
public void OpenHelpIfNeeded(bool skipOpeningWindows)
{
if (NetMessage.GetText() != "" && !AlreadyDisplayedMessage & !skipOpeningWindows)
{
//We have a message loaded on this network. Display it
BuilderWindow myWin = (BuilderWindow)Application.OpenForms["BuilderWindow"];
@ -291,14 +302,8 @@ namespace EduNetworkBuilder
}
AlreadyDisplayedMessage = true;
}
if(NetTests.Count > 0)
PuzzleIsSolved = false; //When we load the puzzle.
if (newUnique != -1)
UniqueIdentifier = newUnique;
}
public void Save()
{
Save(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Test.enbx"));

View File

@ -1585,6 +1585,7 @@ namespace EduNetworkBuilder
{
PrepForLoad();
Network.Clone(NewNet, myNetwork); //Push the settings
myNetwork.OpenHelpIfNeeded(false);
UpdateMenu();
UpdateForm();
}

View File

@ -103,7 +103,7 @@ namespace EduNetworkBuilder
break;
case "network":
theProject = new Network();
theProject.Load(Individual, "");
theProject.Load(Individual, "",false,true);
break;
}
}