From 05bbceb1092a3315cdcb29bda7c756ffbb547500 Mon Sep 17 00:00:00 2001 From: lempamo Date: Sun, 27 Aug 2017 10:36:17 -0400 Subject: [PATCH 1/2] fixed minor things in hack1 --- Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs b/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs index 54716e5..b988092 100644 --- a/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs +++ b/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs @@ -13,12 +13,11 @@ namespace Histacom2.OS.Win95.Win95Apps.Story { - static class Hack1 : Object + static class Hack1 : object { static WindowManager wm = new WindowManager(); static bool ended = false; static Thread soundThread = new Thread(dialup_sound_play); - static bool devMode = true; // This is the very first story script! public static void StartObjective() @@ -28,7 +27,7 @@ public static void StartObjective() tmr.Interval = 1; tmr.Tick += new EventHandler(CheckIfSoundFinished); - if (devMode == true) ContinueObjective(); + if (SaveSystem.DevMode) ContinueObjective(); else { soundThread.Start(); From d5d50c6c205b505ea6f4dcae90b3797ed6c180f7 Mon Sep 17 00:00:00 2001 From: lempamo Date: Sun, 27 Aug 2017 12:25:52 -0400 Subject: [PATCH 2/2] better file removal and other smaller things --- Histacom2.Engine/SaveSystem.cs | 62 ++++++++++-------- Histacom2/OS/Win95/Win95.Designer.cs | 6 +- Histacom2/OS/Win95/Win95.resx | 2 +- Histacom2/OS/Win95/Win95Apps/Story/Hack2.cs | 2 +- .../Win95WindowsExplorer.Designer.cs | 40 +++++------ Histacom2/OS/Win98/Win98.cs | 2 +- .../Resources/WinClassic/Win95SideBar.png | Bin 835 -> 843 bytes 7 files changed, 62 insertions(+), 52 deletions(-) diff --git a/Histacom2.Engine/SaveSystem.cs b/Histacom2.Engine/SaveSystem.cs index ef98c10..5557dca 100644 --- a/Histacom2.Engine/SaveSystem.cs +++ b/Histacom2.Engine/SaveSystem.cs @@ -235,36 +235,46 @@ public static void UpdateDirectoryInfo(string path, THFileInfo newfile) File.WriteAllText(Path.Combine(path, "_data.info"), toWrite); } - public static void UpgradeFileSystem(string oldOS, string newOS) + public static void RemoveFileFromDirectory(string path, string filename) { - switch (oldOS) + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(path, "_data.info"))); + THFileInfo fi = fsfi.Files.Find((THFileInfo f) => { return f.Name == filename; }); + if (fi == null) return; + + fsfi.ByteSize -= fi.ByteSize; + CurrentSave.BytesLeft += fi.ByteSize; + + fsfi.Files.Remove(fi); + string toWrite = JsonConvert.SerializeObject(fsfi, Formatting.Indented); + + File.WriteAllText(Path.Combine(path, "_data.info"), toWrite); + } + + public static void UpgradeFileSystem(string newOS) + { + if (newOS == "98" || newOS == "2000" || newOS == "ME") { - case "95": - if (newOS == "98" || newOS == "2000" || newOS == "ME") + // We are upgrading from the old WinClassic file System to the new WinClassic filesystem! + // All the above OSes share basically the same file layout! + // (Excluding Documents And Settings) which is 2000 and ME only + + // Add Address Book into existance! + + SaveDirectoryInfo(ProfileProgramsDirectory, "Outlook Express", false, "Outlook Express", true); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Outlook Express"), "WAB.exe", "addressbook", 8, 512); + + // There is no "The Microsoft Network" folder! + + if (Directory.Exists(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"))) Directory.Delete(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), true); + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(ProfileProgramsDirectory, "_data.info"))); + foreach (THDirInfo dir in fsfi.SubDirs) + { + if (dir.Name == "The Microsoft Network") { - // We are upgrading from the old WinClassic file System to the new WinClassic filesystem! - // All the above OSes share basically the same file layout! - // (Excluding Documents And Settings) which is 2000 and ME only - - // Add Address Book into existance! - - SaveDirectoryInfo(ProfileProgramsDirectory, "Outlook Express", false, "Outlook Express", true); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Outlook Express"), "WAB.exe", "addressbook", 8, 512); - - // There is no "The Microsoft Network" folder! - - if (Directory.Exists(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"))) Directory.Delete(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), true); - FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(ProfileProgramsDirectory, "_data.info"))); - foreach (THDirInfo dir in fsfi.SubDirs) - { - if (dir.Name == "The Microsoft Network") - { - fsfi.SubDirs.Remove(dir); - break; - } - } + fsfi.SubDirs.Remove(dir); + break; } - break; + } } } diff --git a/Histacom2/OS/Win95/Win95.Designer.cs b/Histacom2/OS/Win95/Win95.Designer.cs index 753dfd6..40f40ca 100644 --- a/Histacom2/OS/Win95/Win95.Designer.cs +++ b/Histacom2/OS/Win95/Win95.Designer.cs @@ -218,7 +218,7 @@ private void InitializeComponent() this.SuspendToolStripMenuItem, this.ShutdownToolStripMenuItem}); this.startmenuitems.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.VerticalStackWithOverflow; - this.startmenuitems.Location = new System.Drawing.Point(28, 2); + this.startmenuitems.Location = new System.Drawing.Point(26, 2); this.startmenuitems.Margin = new System.Windows.Forms.Padding(0, 0, 5, 0); this.startmenuitems.Name = "startmenuitems"; this.startmenuitems.Padding = new System.Windows.Forms.Padding(6, 2, 0, 0); @@ -930,7 +930,7 @@ private void InitializeComponent() this.ossidestartmenu.Controls.Add(this.osimage); this.ossidestartmenu.Location = new System.Drawing.Point(0, 0); this.ossidestartmenu.Name = "ossidestartmenu"; - this.ossidestartmenu.Size = new System.Drawing.Size(26, 297); + this.ossidestartmenu.Size = new System.Drawing.Size(23, 297); this.ossidestartmenu.TabIndex = 4; // // osimage @@ -939,7 +939,7 @@ private void InitializeComponent() this.osimage.Image = global::Histacom2.Properties.Resources.Win95SideBar; this.osimage.Location = new System.Drawing.Point(0, 0); this.osimage.Name = "osimage"; - this.osimage.Size = new System.Drawing.Size(26, 297); + this.osimage.Size = new System.Drawing.Size(23, 297); this.osimage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.osimage.TabIndex = 0; this.osimage.TabStop = false; diff --git a/Histacom2/OS/Win95/Win95.resx b/Histacom2/OS/Win95/Win95.resx index 25103b3..419e624 100644 --- a/Histacom2/OS/Win95/Win95.resx +++ b/Histacom2/OS/Win95/Win95.resx @@ -374,7 +374,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACO - hAAAAk1TRnQBSQFMAgEBDQEAATQBAgE0AQIBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA + hAAAAk1TRnQBSQFMAgEBDQEAAUQBAgFEAQIBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA AwABgAMAAQEBAAEgBwABASQAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/ AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH//wChAAOAAf8DwAH/ A8AB/wPAAf8DwAH/A8AB/wPAAf8DwAH/A8AB/wPAAf8DwAH/A8AB/wPAAf8DwAH/A8AB/wPAAf8DwAH/ diff --git a/Histacom2/OS/Win95/Win95Apps/Story/Hack2.cs b/Histacom2/OS/Win95/Win95Apps/Story/Hack2.cs index 1dc99da..76b9baf 100644 --- a/Histacom2/OS/Win95/Win95Apps/Story/Hack2.cs +++ b/Histacom2/OS/Win95/Win95Apps/Story/Hack2.cs @@ -270,7 +270,7 @@ public static async void StartObjective() await Task.Delay(2000); sp.Stop(); - SaveSystem.UpgradeFileSystem("95", "98"); + SaveSystem.UpgradeFileSystem("98"); SaveSystem.CurrentSave.CurrentOS = "98"; SaveSystem.currentTheme = new Default98Theme(); SaveSystem.CurrentSave.ThemeName = "default98"; diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs index 3269e83..c3b4ded 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs @@ -107,7 +107,7 @@ private void InitializeComponent() // // MenuStrip1 // - this.MenuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200))))); + this.MenuStrip1.BackColor = System.Drawing.Color.Silver; this.MenuStrip1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.MenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.FileToolStripMenuItem, @@ -128,7 +128,7 @@ private void InitializeComponent() this.RenameToolStripMenuItem, this.CloseToolStripMenuItem}); this.FileToolStripMenuItem.Name = "FileToolStripMenuItem"; - this.FileToolStripMenuItem.Size = new System.Drawing.Size(40, 20); + this.FileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.FileToolStripMenuItem.Text = "File"; // // CreateShortcutToolStripMenuItem @@ -139,52 +139,52 @@ private void InitializeComponent() this.TextDocumentToolStripMenuItem, this.BitmapImageToolStripMenuItem}); this.CreateShortcutToolStripMenuItem.Name = "CreateShortcutToolStripMenuItem"; - this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.CreateShortcutToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.CreateShortcutToolStripMenuItem.Text = "New"; // // FolderToolStripMenuItem // this.FolderToolStripMenuItem.Name = "FolderToolStripMenuItem"; - this.FolderToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.FolderToolStripMenuItem.Size = new System.Drawing.Size(154, 22); this.FolderToolStripMenuItem.Text = "Folder"; this.FolderToolStripMenuItem.Click += new System.EventHandler(this.FolderToolStripMenuItem_Click); // // ShortcutToolStripMenuItem // this.ShortcutToolStripMenuItem.Name = "ShortcutToolStripMenuItem"; - this.ShortcutToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.ShortcutToolStripMenuItem.Size = new System.Drawing.Size(154, 22); this.ShortcutToolStripMenuItem.Text = "Shortcut"; // // TextDocumentToolStripMenuItem // this.TextDocumentToolStripMenuItem.Name = "TextDocumentToolStripMenuItem"; - this.TextDocumentToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.TextDocumentToolStripMenuItem.Size = new System.Drawing.Size(154, 22); this.TextDocumentToolStripMenuItem.Text = "Text Document"; // // BitmapImageToolStripMenuItem // this.BitmapImageToolStripMenuItem.Name = "BitmapImageToolStripMenuItem"; - this.BitmapImageToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.BitmapImageToolStripMenuItem.Size = new System.Drawing.Size(154, 22); this.BitmapImageToolStripMenuItem.Text = "Bitmap Image"; // // DeleteToolStripMenuItem // this.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem"; - this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.DeleteToolStripMenuItem.Text = "Delete"; this.DeleteToolStripMenuItem.Click += new System.EventHandler(this.DeleteToolStripMenuItem_Click); // // RenameToolStripMenuItem // this.RenameToolStripMenuItem.Name = "RenameToolStripMenuItem"; - this.RenameToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.RenameToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.RenameToolStripMenuItem.Text = "Rename"; this.RenameToolStripMenuItem.Click += new System.EventHandler(this.RenameToolStripMenuItem_Click); // // CloseToolStripMenuItem // this.CloseToolStripMenuItem.Name = "CloseToolStripMenuItem"; - this.CloseToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.CloseToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.CloseToolStripMenuItem.Text = "Close"; this.CloseToolStripMenuItem.Click += new System.EventHandler(this.CloseToolStripMenuItem_Click); // @@ -196,34 +196,34 @@ private void InitializeComponent() this.PasteToolStripMenuItem, this.SellectAllCtrlAToolStripMenuItem}); this.EditToolStripMenuItem.Name = "EditToolStripMenuItem"; - this.EditToolStripMenuItem.Size = new System.Drawing.Size(43, 20); + this.EditToolStripMenuItem.Size = new System.Drawing.Size(39, 20); this.EditToolStripMenuItem.Text = "Edit"; // // CutCtrlXToolStripMenuItem // this.CutCtrlXToolStripMenuItem.Name = "CutCtrlXToolStripMenuItem"; - this.CutCtrlXToolStripMenuItem.Size = new System.Drawing.Size(206, 22); + this.CutCtrlXToolStripMenuItem.Size = new System.Drawing.Size(197, 22); this.CutCtrlXToolStripMenuItem.Text = "Cut Ctrl+X"; this.CutCtrlXToolStripMenuItem.Click += new System.EventHandler(this.CutCtrlXToolStripMenuItem_Click); // // CopyCtrlCToolStripMenuItem // this.CopyCtrlCToolStripMenuItem.Name = "CopyCtrlCToolStripMenuItem"; - this.CopyCtrlCToolStripMenuItem.Size = new System.Drawing.Size(206, 22); + this.CopyCtrlCToolStripMenuItem.Size = new System.Drawing.Size(197, 22); this.CopyCtrlCToolStripMenuItem.Text = "Copy Ctrl+C"; this.CopyCtrlCToolStripMenuItem.Click += new System.EventHandler(this.CopyCtrlCToolStripMenuItem_Click); // // PasteToolStripMenuItem // this.PasteToolStripMenuItem.Name = "PasteToolStripMenuItem"; - this.PasteToolStripMenuItem.Size = new System.Drawing.Size(206, 22); + this.PasteToolStripMenuItem.Size = new System.Drawing.Size(197, 22); this.PasteToolStripMenuItem.Text = "Paste Ctrl+V"; this.PasteToolStripMenuItem.Click += new System.EventHandler(this.PasteToolStripMenuItem_Click); // // SellectAllCtrlAToolStripMenuItem // this.SellectAllCtrlAToolStripMenuItem.Name = "SellectAllCtrlAToolStripMenuItem"; - this.SellectAllCtrlAToolStripMenuItem.Size = new System.Drawing.Size(206, 22); + this.SellectAllCtrlAToolStripMenuItem.Size = new System.Drawing.Size(197, 22); this.SellectAllCtrlAToolStripMenuItem.Text = "Select All Ctrl+A"; this.SellectAllCtrlAToolStripMenuItem.Click += new System.EventHandler(this.SellectAllCtrlAToolStripMenuItem_Click); // @@ -232,13 +232,13 @@ private void InitializeComponent() this.ViewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.RefreshToolStripMenuItem}); this.ViewToolStripMenuItem.Name = "ViewToolStripMenuItem"; - this.ViewToolStripMenuItem.Size = new System.Drawing.Size(47, 20); + this.ViewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.ViewToolStripMenuItem.Text = "View"; // // RefreshToolStripMenuItem // this.RefreshToolStripMenuItem.Name = "RefreshToolStripMenuItem"; - this.RefreshToolStripMenuItem.Size = new System.Drawing.Size(121, 22); + this.RefreshToolStripMenuItem.Size = new System.Drawing.Size(113, 22); this.RefreshToolStripMenuItem.Text = "Refresh"; this.RefreshToolStripMenuItem.Click += new System.EventHandler(this.RefreshToolStripMenuItem_Click); // @@ -248,19 +248,19 @@ private void InitializeComponent() this.HelpToolStripMenuItem1, this.AboutWindows95ToolStripMenuItem}); this.HelpToolStripMenuItem.Name = "HelpToolStripMenuItem"; - this.HelpToolStripMenuItem.Size = new System.Drawing.Size(46, 20); + this.HelpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.HelpToolStripMenuItem.Text = "Help"; // // HelpToolStripMenuItem1 // this.HelpToolStripMenuItem1.Name = "HelpToolStripMenuItem1"; - this.HelpToolStripMenuItem1.Size = new System.Drawing.Size(188, 22); + this.HelpToolStripMenuItem1.Size = new System.Drawing.Size(174, 22); this.HelpToolStripMenuItem1.Text = "Help Topics"; // // AboutWindows95ToolStripMenuItem // this.AboutWindows95ToolStripMenuItem.Name = "AboutWindows95ToolStripMenuItem"; - this.AboutWindows95ToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + this.AboutWindows95ToolStripMenuItem.Size = new System.Drawing.Size(174, 22); this.AboutWindows95ToolStripMenuItem.Text = "About Windows 95"; this.AboutWindows95ToolStripMenuItem.Click += new System.EventHandler(this.AboutWindows95ToolStripMenuItem_Click); // diff --git a/Histacom2/OS/Win98/Win98.cs b/Histacom2/OS/Win98/Win98.cs index 3f75af7..146aa3c 100644 --- a/Histacom2/OS/Win98/Win98.cs +++ b/Histacom2/OS/Win98/Win98.cs @@ -71,7 +71,7 @@ private void MenuItem_MouseLeave(object sender, EventArgs e) // When New Game is clicked in TitleScreen.cs private void Desktop_Load(object sender, EventArgs e) { - UpgradeFileSystem("95", "98"); + UpgradeFileSystem( "98"); if (currentTheme.defaultWallpaper != null) desktopicons.BackgroundImage = new Bitmap(currentTheme.defaultWallpaper, Width, Height); //Start Menu Color - Commented until it works reliably diff --git a/Histacom2/Resources/WinClassic/Win95SideBar.png b/Histacom2/Resources/WinClassic/Win95SideBar.png index 2f0e77b17255cecacf6b57b13edb5061a8512394..f0ae5abf16ad5942626fa6c88124b11345e175ab 100644 GIT binary patch delta 757 zcmVeSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^MlX|MGF00PKKL_t(|UhR-ub{jDaL%Z{KY2KNOkQiB^ zpw~E_HZkv)2!i*_nP0cB;KTC!Ints@izY3av}n?zNsA^enlH8dd5*Mb(xOR=CM}wg z*&mVb36bv!k?#qS?+JfNi{@GjIt4}*2%`n#{eI_Qcv8R!xHB+LEMWvL;$X}zLE!|^ zJ6gi%gk)|3A;G&n(Uun9;t~2lSWYmqAos7Rk>#$XRe0|2aH1`);9!Kyu+^4Oa_TTh zg#}~JQa9_)e{KOi3tz_Ef~38vYhlzD;G#mfLBhf4S^)9_BO`w(0192pI{(6gro;IF z$;e_S-1@uVp@VV$ck6e-I}XM@OL#kYZ&*AB?KrWtZ_tjHSZYG-4)+r%@ORKwy<%4WW&Nm16Fej=RW96{w^@p z1Ev)SM;5!%uwh_)vBk=SQ9s=NyG*~c1u*J|T???Xh7AMb>n)C5Jz!daaBi6*EEpHz z!JAkL*8G6;0n;rDhtGr+-j{sK0QRo104sN4=@|{TG#wiI|EEj3o|!qU`Iu&W4nD;Dc(*ce!>)`g`5BpZL1jRvfiEZlWK z;Wgjl*i}&%mJX0;OTn%*Y^+!uyNYl(wOF|eOVVP6C3tYo!d?Z!RSVY&Y$q0`Lr~Ke n4r`zvEhk8e=Equ|<#ziErP`9!6z&+J00000NkvXXu0mjfRts8p delta 707 zcmV;!0zCc82EzuB7Z(c%0ssI2y(@~N00001b5ch_0Itp)>5(BD3c~;Z4#NS*Z>VIE zMj$scGy_|D0008BNklv$X6igOaeKQqaq3+-bx6C4%5RKK^t2 z3O+1+| z7HbN)u0Xh9;i3Vn7k__?V}}|xRxFNPMYy}-TdX;Pz0(#p4v=hExM;v?ZsFVqoyp$? zrh34%0^!JFR~j}9j4!rWnK0^y+kcnoPqqL?{jh5RR@Sg#V0^vBv8xA6D-g~tQ-lTM zB0P8#OTn5Sa6VwVW#RCdu)_P2ZyCVe6&7ISE-XD`VZ*>UvN(Ts^?+#w!ntM2#DdiT zmc|xqj$rQxS~&MXXa09N^g-tx|85WV#+G%21*0ea7~p+?_wToyKv*z_WD5G)QeZj+ zwTY#`wF28!OM$%#gxi(^52U5W%3WBRS_*a*;cmrZeGMA}i`BZYbbw^z@3PT=)sls~ z4k*0lTO7OU!qQIx5^X8im4=NKi(^+2?xq$icVS6dtgr+R&RN*2K)7n*T7m7v!gL5~ p+QMNC^rPhjY0>;z%d^~W{{WYbVf*IA?D_xz002ovPDHLkV1fy^O^N^j