From bf7fcf52ad5373e25fbe399f4f1dd1091f53c159 Mon Sep 17 00:00:00 2001 From: AShifter Date: Sun, 18 Jun 2017 18:39:27 -0700 Subject: Some more terminal work IT WORKS! IT WWOOOOORRRKKKSS!!! YOu can now use Thread.Sleep(); without issues. --- TimeHACK.Engine/TimeHACK.Engine.csproj | 5 ++-- TimeHACK.Engine/packages.config | 2 +- TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs | 28 ++++++++++++---------- .../Win95/Win95Apps/WinClassicTerminal.Designer.cs | 1 + .../OS/Win95/Win95Apps/WinClassicTerminal.cs | 4 ++-- TimeHACK.Main/TimeHACK.Main.csproj | 4 ++-- TimeHACK.Main/packages.config | 2 +- 7 files changed, 26 insertions(+), 20 deletions(-) diff --git a/TimeHACK.Engine/TimeHACK.Engine.csproj b/TimeHACK.Engine/TimeHACK.Engine.csproj index 980f7fb..7ee8e6e 100644 --- a/TimeHACK.Engine/TimeHACK.Engine.csproj +++ b/TimeHACK.Engine/TimeHACK.Engine.csproj @@ -30,8 +30,8 @@ 4 - - ..\TimeHACK.Main\bin\Release\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll @@ -46,6 +46,7 @@ + diff --git a/TimeHACK.Engine/packages.config b/TimeHACK.Engine/packages.config index f54866f..810e559 100644 --- a/TimeHACK.Engine/packages.config +++ b/TimeHACK.Engine/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs index 2310af4..faafdea 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs @@ -14,35 +14,39 @@ namespace TimeHACK.OS.Win95.Win95Apps.Story { static class Hack1 : Object { - static WinClassicTerminal term = new WinClassicTerminal(); + static WinClassicTerminal Console = new WinClassicTerminal(); static WindowManager wm = new WindowManager(); static Boolean ended = false; static Thread soundThread = new Thread(dialup_sound_play); + static Boolean devMode = false; // This is the very first story script! public static void startObjective() { System.Windows.Forms.Timer tmr = new System.Windows.Forms.Timer(); - wm.startWin95(term, "MS-DOS Prompt", null, true, true); - term.WriteLine("192.168.0.1 Connecting..."); - - term.Invalidate(); - Application.DoEvents(); + wm.startWin95(Console, "MS-DOS Prompt", null, true, true); + Console.WriteLine("telnet> 104.27.135.159 Connecting..."); tmr.Interval = 1; tmr.Tick += new EventHandler(CheckIfSoundFinished); - soundThread.Start(); - - tmr.Start(); + if (devMode == true) + { + continueObjective(); + } + else + { + soundThread.Start(); + tmr.Start(); + } } public static void continueObjective() { - term.WriteLine("192.168.0.1 Connected."); - - Application.DoEvents(); + Console.WriteLine("telnet> 104.27.135.159 Connected."); + Thread.Sleep(2500); + Console.WriteLine("telnet> 104.27.135.159 set hostname to 'TheHiddenHacker'."); } public static void CheckIfSoundFinished(Object sender, EventArgs e) diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.Designer.cs index d7e9781..ddae557 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.Designer.cs @@ -35,6 +35,7 @@ // this.richTextBox1.BackColor = System.Drawing.Color.Black; this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.richTextBox1.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.richTextBox1.ForeColor = System.Drawing.Color.White; this.richTextBox1.Location = new System.Drawing.Point(0, 0); this.richTextBox1.Name = "richTextBox1"; diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.cs index d25b409..174c5b4 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.cs @@ -20,9 +20,7 @@ namespace TimeHACK.OS.Win95.Win95Apps public WinClassicTerminal() { InitializeComponent(); - this.richTextBox1.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); } - private SoundPlayer startsound; /// /// Write text to the Terminal and create a new line. Very similar to the Win32 Console.WriteLine Function. /// @@ -30,6 +28,7 @@ namespace TimeHACK.OS.Win95.Win95Apps public void WriteLine(string Text) { richTextBox1.AppendText(Text + "\n"); + richTextBox1.Update(); } /// @@ -39,6 +38,7 @@ namespace TimeHACK.OS.Win95.Win95Apps public void Write(String Text) { richTextBox1.AppendText(Text); + richTextBox1.Update(); } } } diff --git a/TimeHACK.Main/TimeHACK.Main.csproj b/TimeHACK.Main/TimeHACK.Main.csproj index 0378561..fe54247 100644 --- a/TimeHACK.Main/TimeHACK.Main.csproj +++ b/TimeHACK.Main/TimeHACK.Main.csproj @@ -106,8 +106,7 @@ - False - bin\Release\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll @@ -345,6 +344,7 @@ TitleScreen.cs + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/TimeHACK.Main/packages.config b/TimeHACK.Main/packages.config index f54866f..810e559 100644 --- a/TimeHACK.Main/packages.config +++ b/TimeHACK.Main/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file -- cgit v1.2.3