From c199065efd819bca4a960c1bc1d4ec22f8cfa938 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Wed, 16 May 2018 09:35:19 -0500 Subject: [PATCH] Message to store Replays if in replay mode and we solved a puzzle --- EduNetworkBuilder/Network.cs | 23 ++- .../Resources/EduNetworkReplay.xml | 148 ++++++++++++++++++ .../Resources/languages/edustrings.resx | 8 + 3 files changed, 178 insertions(+), 1 deletion(-) diff --git a/EduNetworkBuilder/Network.cs b/EduNetworkBuilder/Network.cs index 2b66326..e4907bb 100644 --- a/EduNetworkBuilder/Network.cs +++ b/EduNetworkBuilder/Network.cs @@ -1191,7 +1191,28 @@ namespace EduNetworkBuilder { if (!IsRandomNetwork) { - DialogResult answer = MessageBox.Show(NB.Translate("N_MarkAsSolvedDone"), NB.Translate("_Solved"), MessageBoxButtons.YesNo); + DialogResult answer; + NBSettings oursettings = NB.GetSettings(); + if(oursettings != null && oursettings.ReplayMode) + { + ActionCollection AC = oursettings.GetUserActionCollection(); + if(AC != null) + { + NetworkAction pastTry = AC.GetActionlistFromNet(this); + + //If we never had an action list + if(AC.CurrentNeedsStoring) + { + if(pastTry == null) + answer = MessageBox.Show(NB.Translate("N_StoreReplay"), NB.Translate("_Solved"), MessageBoxButtons.YesNo); + else + answer = MessageBox.Show(NB.Translate("N_StoreReplayAgain"), NB.Translate("_Solved"), MessageBoxButtons.YesNo); + if (answer == DialogResult.Yes) + AC.PushActionToList(); + } + } + } + answer = MessageBox.Show(NB.Translate("N_MarkAsSolvedDone"), NB.Translate("_Solved"), MessageBoxButtons.YesNo); if (answer == DialogResult.Yes) { diff --git a/EduNetworkBuilder/Resources/EduNetworkReplay.xml b/EduNetworkBuilder/Resources/EduNetworkReplay.xml index 382c90c..62868fb 100644 --- a/EduNetworkBuilder/Resources/EduNetworkReplay.xml +++ b/EduNetworkBuilder/Resources/EduNetworkReplay.xml @@ -213,6 +213,12 @@ 1 Untagged + + <_ID>1 + <_Tag>Untagged + 1 + Untagged + @@ -257,6 +263,12 @@ 1 Untagged + + <_ID>1 + <_Tag>Untagged + 1 + Untagged + @@ -301,6 +313,12 @@ 1 Untagged + + <_ID>1 + <_Tag>Untagged + 1 + Untagged + @@ -345,6 +363,12 @@ 1 Untagged + + <_ID>1 + <_Tag>Untagged + 1 + Untagged + @@ -389,6 +413,12 @@ 1 Untagged + + <_ID>1 + <_Tag>Untagged + 1 + Untagged + @@ -433,6 +463,12 @@ 1 Untagged + + <_ID>1 + <_Tag>Untagged + 1 + Untagged + @@ -477,6 +513,12 @@ 1 Untagged + + <_ID>1 + <_Tag>Untagged + 1 + Untagged + @@ -521,6 +563,12 @@ 1 Untagged + + <_ID>1 + <_Tag>Untagged + 1 + Untagged + @@ -565,6 +613,12 @@ 1 Untagged + + <_ID>1 + <_Tag>Untagged + 1 + Untagged + @@ -641,6 +695,100 @@ true + + Level0_Ping + + + ping + 100 + + <_ip>3232235779 + <_mask>4294967040 + <_gw>0 + ip + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + none + + + ping + 100 + + <_ip>3232236034 + <_mask>4294967040 + <_gw>0 + ip + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + none + + + true + + + Level0_NeedsLink + + + changecomponent + -1 + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + none + + false + 117 + + + 110 + 112 + pc0 + eth0 + + + 100 + 104 + net_switch0 + port2 + + normal + true + + + + true + true \ No newline at end of file diff --git a/EduNetworkBuilder/Resources/languages/edustrings.resx b/EduNetworkBuilder/Resources/languages/edustrings.resx index 0eb57cb..0809f53 100644 --- a/EduNetworkBuilder/Resources/languages/edustrings.resx +++ b/EduNetworkBuilder/Resources/languages/edustrings.resx @@ -2117,4 +2117,12 @@ Network Card sprays net when used NT_TstDeviceNICSprays = Network Card sprays net when used + + You are in replay mode. Would you like to store this replay? + N_StoreReplay = You are in replay mode. Would you like to store this replay? + + + This network already had a replay. Would you like to replace the replay with this one? + N_StoreReplayAgain = This network already had a replay. Would you like to replace the replay with this one? + \ No newline at end of file