Some more terminal work

IT WORKS! IT WWOOOOORRRKKKSS!!! YOu can now use Thread.Sleep(); without
issues.
This commit is contained in:
AShifter 2017-06-18 18:39:27 -07:00
parent 15f2e1a7e3
commit bf7fcf52ad
7 changed files with 26 additions and 20 deletions

View file

@ -30,8 +30,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..\TimeHACK.Main\bin\Release\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -46,6 +46,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BSODCreator.cs" />
<None Include="packages.config" />
<None Include="Resources\WinClassic\Window\pjBg6mKP.bin" />
<Compile Include="FileDialogBoxManager.cs" />
<Compile Include="SaveSystem.cs" />

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="10.0.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
</packages>

View file

@ -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);
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)

View file

@ -35,6 +35,7 @@ private void InitializeComponent()
//
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";

View file

@ -20,9 +20,7 @@ public partial class WinClassicTerminal : UserControl
public WinClassicTerminal()
{
InitializeComponent();
this.richTextBox1.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
}
private SoundPlayer startsound;
/// <summary>
/// Write text to the Terminal and create a new line. Very similar to the Win32 Console.WriteLine Function.
/// </summary>
@ -30,6 +28,7 @@ public WinClassicTerminal()
public void WriteLine(string Text)
{
richTextBox1.AppendText(Text + "\n");
richTextBox1.Update();
}
/// <summary>
@ -39,6 +38,7 @@ public void WriteLine(string Text)
public void Write(String Text)
{
richTextBox1.AppendText(Text);
richTextBox1.Update();
}
}
}

View file

@ -106,8 +106,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Release\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -345,6 +344,7 @@
<EmbeddedResource Include="TitleScreen.resx">
<DependentUpon>TitleScreen.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="10.0.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
</packages>