aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-06-17 22:27:23 +0100
committerGitHub <[email protected]>2017-06-17 22:27:23 +0100
commit15f2e1a7e3ec5d85aee4a126144722feeff4682f (patch)
tree552cfd401bdcacd216a82c8e61864ba32dd2708a
parent331ac7f0aa424a49ff0f55fb87711a71384eb709 (diff)
parent2f9031e0ace7ddadec9c441551ccfecf80b6df28 (diff)
downloadhistacom2-15f2e1a7e3ec5d85aee4a126144722feeff4682f.tar.gz
histacom2-15f2e1a7e3ec5d85aee4a126144722feeff4682f.tar.bz2
histacom2-15f2e1a7e3ec5d85aee4a126144722feeff4682f.zip
Merge pull request #97 from Alex-TIMEHACK/master
A LOT of Tweaks - more to come
-rw-r--r--TimeHACK.Engine/SaveSystem.cs14
-rw-r--r--TimeHACK.Main/OS/Win95/Win95.Designer.cs18
-rw-r--r--TimeHACK.Main/OS/Win95/Win95.cs17
-rw-r--r--TimeHACK.Main/OS/Win95/Win95.resx2
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs45
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/Story/NormalHack.cs15
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/WinClassicIE4.cs3
-rw-r--r--TimeHACK.Main/Program.cs13
-rw-r--r--TimeHACK.Main/TimeHACK.Main.csproj1
9 files changed, 65 insertions, 63 deletions
diff --git a/TimeHACK.Engine/SaveSystem.cs b/TimeHACK.Engine/SaveSystem.cs
index 56a71a4..e217bf4 100644
--- a/TimeHACK.Engine/SaveSystem.cs
+++ b/TimeHACK.Engine/SaveSystem.cs
@@ -61,7 +61,7 @@ namespace TimeHACK.Engine
{
get
{
- return Path.Combine(ProfileMyComputerDirectory, "Settings");
+ return Path.Combine(ProfileMyComputerDirectory, "Settings");
}
}
@@ -69,13 +69,7 @@ namespace TimeHACK.Engine
{
get
{
- if (CurrentSave.CurrentOS == "95")
- {
- return Path.Combine(ProfileMyComputerDirectory, "Doc");
- } else {
- return Path.Combine(ProfileSettingsDirectory, "Doc");
- }
-
+ return Path.Combine(ProfileMyComputerDirectory, "Doc");
}
}
@@ -145,8 +139,8 @@ namespace TimeHACK.Engine
SaveDirectoryInfo(ProfileFileSystemDirectory, false, "My Computer", false);
SaveDirectoryInfo(ProfileMyComputerDirectory, false, "Win95", true);
- SaveDirectoryInfo(ProfileDocumentsDirectory, false, "My Documents", true);
- SaveDirectoryInfo(ProfileSettingsDirectory, false, "Documents and Settings", true);
+ if (CurrentSave.CurrentOS == "95") SaveDirectoryInfo(ProfileDocumentsDirectory, false, "My Documents", true);
+ if (CurrentSave.CurrentOS != "95") SaveDirectoryInfo(ProfileSettingsDirectory, false, "Documents and Settings", true);
SaveDirectoryInfo(ProfileProgramsDirectory, true, "Program Files", true);
SaveDirectoryInfo(ProfileWindowsDirectory, true, "Windows", true);
}
diff --git a/TimeHACK.Main/OS/Win95/Win95.Designer.cs b/TimeHACK.Main/OS/Win95/Win95.Designer.cs
index 27749a2..5a35e3d 100644
--- a/TimeHACK.Main/OS/Win95/Win95.Designer.cs
+++ b/TimeHACK.Main/OS/Win95/Win95.Designer.cs
@@ -92,6 +92,7 @@ namespace TimeHACK.OS.Win95
this.windowManagerTestToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.downloaderTestToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.installerTestToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.storyTest1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ControlPanelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.PrintersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -129,7 +130,6 @@ namespace TimeHACK.OS.Win95
this.BitmapImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MicrosoftDataLinkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.PropertiesToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
- this.storyTest1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout();
this.taskbar.SuspendLayout();
this.clockPanel.SuspendLayout();
@@ -778,6 +778,14 @@ namespace TimeHACK.OS.Win95
this.installerTestToolStripMenuItem.Text = "InstallerTest";
this.installerTestToolStripMenuItem.Click += new System.EventHandler(this.installerTestToolStripMenuItem_Click);
//
+ // storyTest1ToolStripMenuItem
+ //
+ this.storyTest1ToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver;
+ this.storyTest1ToolStripMenuItem.Name = "storyTest1ToolStripMenuItem";
+ this.storyTest1ToolStripMenuItem.Size = new System.Drawing.Size(186, 22);
+ this.storyTest1ToolStripMenuItem.Text = "StoryTest1";
+ this.storyTest1ToolStripMenuItem.Click += new System.EventHandler(this.storyTest1ToolStripMenuItem_Click);
+ //
// SettingsToolStripMenuItem
//
this.SettingsToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
@@ -1147,14 +1155,6 @@ namespace TimeHACK.OS.Win95
this.PropertiesToolStripMenuItem1.Size = new System.Drawing.Size(150, 22);
this.PropertiesToolStripMenuItem1.Text = "Properties";
//
- // storyTest1ToolStripMenuItem
- //
- this.storyTest1ToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver;
- this.storyTest1ToolStripMenuItem.Name = "storyTest1ToolStripMenuItem";
- this.storyTest1ToolStripMenuItem.Size = new System.Drawing.Size(186, 22);
- this.storyTest1ToolStripMenuItem.Text = "StoryTest1";
- this.storyTest1ToolStripMenuItem.Click += new System.EventHandler(this.storyTest1ToolStripMenuItem_Click);
- //
// Windows95
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs
index 8b272ec..bd706cb 100644
--- a/TimeHACK.Main/OS/Win95/Win95.cs
+++ b/TimeHACK.Main/OS/Win95/Win95.cs
@@ -109,12 +109,7 @@ namespace TimeHACK.OS.Win95
// Shutdown button
private void ShutdownToolStripMenuItem_Click(object sender, EventArgs e)
{
- startsound.Stop();
- Stream audio = Properties.Resources.tada;
- stopsound = new SoundPlayer(audio);
- stopsound.Play();
- System.Threading.Thread.Sleep(1500);
- Application.Exit();
+ Program.ShutdownApplication(Properties.Resources.tada);
}
#endregion //Region
@@ -343,12 +338,18 @@ namespace TimeHACK.OS.Win95
private void storyTest1ToolStripMenuItem_Click(object sender, EventArgs e)
{
- Win95Apps.Story.Hack1 story = new Win95Apps.Story.Hack1();
- story.startObjective();
+ Hack1.startObjective();
}
private void temp_for_std(object sender, EventArgs e)
{
+ System.Threading.Thread thread = new System.Threading.Thread(StartSurviveTheDay);
+
+ thread.Start();
+ }
+
+ void StartSurviveTheDay()
+ {
Win2K.Win2KApps.SurviveTheDay std = new Win2K.Win2KApps.SurviveTheDay();
WinClassic app = wm.startWin95(std, "Survive The Day", null, false, false);
AddTaskBarItem(app, app.Tag.ToString(), "Survive The Day", null);
diff --git a/TimeHACK.Main/OS/Win95/Win95.resx b/TimeHACK.Main/OS/Win95/Win95.resx
index 72d7350..38f1073 100644
--- a/TimeHACK.Main/OS/Win95/Win95.resx
+++ b/TimeHACK.Main/OS/Win95/Win95.resx
@@ -407,7 +407,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADq
- ggAAAk1TRnQBSQFMAgEBDAEAAVgBAQFYAQEBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
+ ggAAAk1TRnQBSQFMAgEBDAEAAWABAQFgAQEBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
AwABgAMAAQEBAAEgBwABAf8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AXAAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/x8AAf8DAAH/
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs
index a8a1323..2310af4 100644
--- a/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs
@@ -12,41 +12,52 @@ using TimeHACK.Engine;
namespace TimeHACK.OS.Win95.Win95Apps.Story
{
- class Hack1 : NormalHack
+ static class Hack1 : Object
{
- WinClassicTerminal term = new WinClassicTerminal();
- WindowManager wm = new WindowManager();
-
-
+ static WinClassicTerminal term = new WinClassicTerminal();
+ static WindowManager wm = new WindowManager();
+ static Boolean ended = false;
+ static Thread soundThread = new Thread(dialup_sound_play);
// This is the very first story script!
- public void startObjective()
+ public static void startObjective()
{
- Thread terminalThread = new Thread(main);
- terminalThread.Start();
- }
+ System.Windows.Forms.Timer tmr = new System.Windows.Forms.Timer();
- public void main()
- {
wm.startWin95(term, "MS-DOS Prompt", null, true, true);
term.WriteLine("192.168.0.1 Connecting...");
term.Invalidate();
- Application.DoEvents();
+ Application.DoEvents();
+
+ tmr.Interval = 1;
+ tmr.Tick += new EventHandler(CheckIfSoundFinished);
- Thread soundThread = new Thread(dialup_sound_play);
soundThread.Start();
- soundThread.Join();
+ tmr.Start();
+ }
+
+ public static void continueObjective()
+ {
term.WriteLine("192.168.0.1 Connected.");
Application.DoEvents();
+ }
+
+ public static void CheckIfSoundFinished(Object sender, EventArgs e)
+ {
+ if (soundThread.IsAlive == false)
+ {
+ // Continue from where we were
+ System.Windows.Forms.Timer trm = sender as System.Windows.Forms.Timer;
- Boolean ended = false;
- while (!ended) {
+ continueObjective();
+ trm.Stop();
}
}
- public void dialup_sound_play()
+
+ public static void dialup_sound_play()
{
SoundPlayer dialup_sound;
// Play Dial-up Sound
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Story/NormalHack.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Story/NormalHack.cs
deleted file mode 100644
index b5c63a6..0000000
--- a/TimeHACK.Main/OS/Win95/Win95Apps/Story/NormalHack.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace TimeHACK.OS.Win95.Win95Apps.Story
-{
- class NormalHack
- {
-
- }
-}
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicIE4.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicIE4.cs
index 97a0581..e3423a8 100644
--- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicIE4.cs
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicIE4.cs
@@ -60,8 +60,7 @@ namespace TimeHACK.OS.Win95.Win95Apps
googlealpha.Show();
break;
case "www.12padams.com":
- Story.Hack1 startStory = new Story.Hack1();
- startStory.startObjective();
+ Win95Apps.Story.Hack1.startObjective();
hidePrograms();
break;
case "www.microsoft.com/internetexplorer4/welcome":
diff --git a/TimeHACK.Main/Program.cs b/TimeHACK.Main/Program.cs
index 839a0c8..673ab07 100644
--- a/TimeHACK.Main/Program.cs
+++ b/TimeHACK.Main/Program.cs
@@ -17,6 +17,8 @@ namespace TimeHACK
{
static class Program
{
+ static System.Media.SoundPlayer stopsound;
+
internal static bool nightly = true;
internal static string gameID;
internal static TitleScreen title = null;
@@ -87,5 +89,16 @@ namespace TimeHACK
return "";
}
}
+
+ public static void ShutdownApplication(System.IO.UnmanagedMemoryStream audio)
+ {
+
+ System.IO.Stream audioPlay = audio;
+ stopsound = new System.Media.SoundPlayer(audioPlay);
+ stopsound.Play();
+
+ System.Threading.Thread.Sleep(1500);
+ Application.Exit();
+ }
}
}
diff --git a/TimeHACK.Main/TimeHACK.Main.csproj b/TimeHACK.Main/TimeHACK.Main.csproj
index f57c688..0378561 100644
--- a/TimeHACK.Main/TimeHACK.Main.csproj
+++ b/TimeHACK.Main/TimeHACK.Main.csproj
@@ -129,7 +129,6 @@
<DependentUpon>SurviveTheDay.cs</DependentUpon>
</Compile>
<Compile Include="OS\Win95\Win95Apps\Story\Hack1.cs" />
- <Compile Include="OS\Win95\Win95Apps\Story\NormalHack.cs" />
<Compile Include="OS\Win95\Win95Apps\WinClassicFTPClient.cs">
<SubType>UserControl</SubType>
</Compile>