From e75e11bcc81e61ccdef78279aa8d39d91c860f8c Mon Sep 17 00:00:00 2001 From: JayXKanz666 Date: Wed, 12 Jul 2017 23:01:19 +0200 Subject: Added some stuff -Added another story-script (Hack2.cs) -Fixed an issue where the MS-DOS prompt would freeze when displaying text -Added Action Delegate (method/function) as an argument for Time Distorter (optional) --- TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs') diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs index b0542ba..57fa683 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using System.Windows.Forms; using TimeHACK.Engine; using TimeHACK.Engine.Template; @@ -8,9 +9,9 @@ namespace TimeHACK.OS.Win95 public partial class WinClassicTimeDistorter : UserControl { private int _counter; - private Form _action; + private Action _action; - public WinClassicTimeDistorter(string currentYear, string yearToTravel, int counter, Form action = null) + public WinClassicTimeDistorter(string currentYear, string yearToTravel, int counter, Action action = null) { InitializeComponent(); @@ -25,6 +26,8 @@ namespace TimeHACK.OS.Win95 { lblCountDown.Visible = true; btnGo.Enabled = false; + + _action?.Invoke(); countDownTimer.Start(); lblCountDown.Text = $"Preparing to travel... ETA: {_counter.ToString()} seconds"; @@ -37,10 +40,8 @@ namespace TimeHACK.OS.Win95 if (_counter == 0) { countDownTimer.Stop(); - - if (_action != null) - _action.ShowDialog(); } + lblCountDown.Text = $"Preparing to travel... ETA: {_counter.ToString()} seconds"; } } -- cgit v1.2.3