From b87d1acd930d1d7408fdd1179c8755d3d41afb18 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Mon, 24 Sep 2018 11:18:45 -0500 Subject: [PATCH] Get the puzzle to do a replay --- EduNetworkBuilder/ListBoxWindow.cs | 15 +++++++++++++++ EduNetworkBuilder/NetworkBuilder.cs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/EduNetworkBuilder/ListBoxWindow.cs b/EduNetworkBuilder/ListBoxWindow.cs index 2ccf741..003604d 100644 --- a/EduNetworkBuilder/ListBoxWindow.cs +++ b/EduNetworkBuilder/ListBoxWindow.cs @@ -495,6 +495,21 @@ namespace EduNetworkBuilder NB.LoadNetworkFromResource(TheName); } } + else if (MyMode == LBContents.regressiontest) + { + if (lbWindowData.SelectedItem is MyPuzzleEntry) + { + MyPuzzleEntry MPE = (MyPuzzleEntry)lbWindowData.SelectedItem; + string TheName = MPE.PuzzleName; + Visible = false; + BuilderWindow myWin = (BuilderWindow)Application.OpenForms["BuilderWindow"]; + if (myWin != null) + { + myWin.Activate(); + myWin.replayNetwork(TheName, 1); + } + } + } Close(); } diff --git a/EduNetworkBuilder/NetworkBuilder.cs b/EduNetworkBuilder/NetworkBuilder.cs index e992c8e..d1e8c56 100644 --- a/EduNetworkBuilder/NetworkBuilder.cs +++ b/EduNetworkBuilder/NetworkBuilder.cs @@ -2830,7 +2830,7 @@ namespace EduNetworkBuilder #endregion Random Map Stuff #region network replay stuff - private void replayNetwork(string NetworkName, int delay_between) + public void replayNetwork(string NetworkName, int delay_between) { //Prepare for replay // reset to original map