diff options
| author | lempamo <[email protected]> | 2017-07-27 00:25:37 -0400 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-07-27 00:25:37 -0400 |
| commit | b56050694f6473b13807a10d39881591e0f0f469 (patch) | |
| tree | 416ef18ac065815a0456a67998e739b80d63f550 | |
| parent | 27b0ef74642e98bf8c9a83d2700e7ce6643e3114 (diff) | |
| download | histacom2-b56050694f6473b13807a10d39881591e0f0f469.tar.gz histacom2-b56050694f6473b13807a10d39881591e0f0f469.tar.bz2 histacom2-b56050694f6473b13807a10d39881591e0f0f469.zip | |
the files thing, will fix in morning
| -rw-r--r-- | TimeHACK.Engine/DesktopController.cs | 21 | ||||
| -rw-r--r-- | TimeHACK.Engine/SaveSystem.cs | 66 | ||||
| -rw-r--r-- | TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs | 4 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95.Designer.cs | 8 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95.cs | 2 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 4 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs | 4 | ||||
| -rw-r--r-- | TimeHACK.Main/Properties/Resources.Designer.cs | 42 | ||||
| -rw-r--r-- | TimeHACK.Main/Properties/Resources.resx | 12 | ||||
| -rw-r--r-- | TimeHACK.Main/Resources/WinClassic/Win95File.png | bin | 0 -> 236 bytes | |||
| -rw-r--r-- | TimeHACK.Main/Resources/WinClassic/WinClassicApp.png | bin | 0 -> 148 bytes | |||
| -rw-r--r-- | TimeHACK.Main/Resources/WinClassic/WinClassicMinesweeper.png | bin | 0 -> 309 bytes | |||
| -rw-r--r-- | TimeHACK.Main/TimeHACK.Main.csproj | 3 |
13 files changed, 118 insertions, 48 deletions
diff --git a/TimeHACK.Engine/DesktopController.cs b/TimeHACK.Engine/DesktopController.cs index f507ab8..83fcc98 100644 --- a/TimeHACK.Engine/DesktopController.cs +++ b/TimeHACK.Engine/DesktopController.cs @@ -14,21 +14,20 @@ namespace TimeHACK.Engine public static string ReadDataFile(string reqDirectory, bool returnYesIfProtected = false) { string Val = ""; - string directoryFileInfo; - directoryFileInfo = File.ReadAllText(Path.Combine(reqDirectory, "_data.info")); + string directoryFileInfo = File.ReadAllText(Path.Combine(reqDirectory, "_data.info")); FileSystemFolderInfo toRead = new FileSystemFolderInfo(); toRead = JsonConvert.DeserializeObject<FileSystemFolderInfo>(directoryFileInfo); if (returnYesIfProtected == true) { - if (toRead.Isprotected == true) + if (toRead.IsProtected == true) { return "yes"; } } else { - return toRead.label; + return toRead.Label; } return Val; } @@ -49,11 +48,19 @@ namespace TimeHACK.Engine { if (Path.GetFileName(dir) != "_data.info") { - int appIcon = 12; + THFileInfo file = new THFileInfo(); + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject<FileSystemFolderInfo>(File.ReadAllText(Path.Combine(theDirectory, "_data.info"))); + foreach (THFileInfo f in fsfi.Files) + { + if (f.Name.ToLower() == Path.GetFileName(dir).ToLower()) + { + file = f; break; + } + } - if (new FileInfo(dir).Extension == ".exe") appIcon = 8; + if (new FileInfo(dir).Extension == ".exe" && file.FileIcon == 8) file.FileIcon = 10; - theView.Items.Add(Path.GetFileName(dir), appIcon); + theView.Items.Add(Path.GetFileName(dir), file.FileIcon); theView.FindItemWithText(Path.GetFileName(dir)).Tag = dir; } } diff --git a/TimeHACK.Engine/SaveSystem.cs b/TimeHACK.Engine/SaveSystem.cs index 2745738..5886d41 100644 --- a/TimeHACK.Engine/SaveSystem.cs +++ b/TimeHACK.Engine/SaveSystem.cs @@ -14,6 +14,9 @@ using Newtonsoft.Json; using System.Diagnostics; using System.Windows.Forms; using System.Runtime.CompilerServices; +using System.Drawing; +using System.Text.RegularExpressions; +using System.Runtime.InteropServices; namespace TimeHACK.Engine { @@ -102,7 +105,7 @@ namespace TimeHACK.Engine { get { - return Path.Combine(ProfileMyComputerDirectory, "Prog"); + return Path.Combine(ProfileMyComputerDirectory, "Program Files"); } } @@ -169,10 +172,10 @@ namespace TimeHACK.Engine SaveDirectoryInfo(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), true, "The Microsoft Network", true); SaveDirectoryInfo(ProfileWindowsDirectory, true, "Windows", true); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Accessories", "wordpad.exe"), "wordpad"); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer", "ie20.exe"), "ie"); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer", "lnfinst.exe"), "iebrokeninstaller"); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network", "msnver.txt"), "5900"); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Accessories"), "wordpad.exe", "wordpad"); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "ie20.exe", "ie"); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "lnfinst.exe", "iebrokeninstaller"); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), "msnver.txt", "5900"); CreateWindowsDirectory(); } @@ -187,13 +190,35 @@ namespace TimeHACK.Engine SaveDirectoryInfo(Path.Combine(ProfileWindowsDirectory, "Temp"), true, "Temp", true); SaveDirectoryInfo(Path.Combine(ProfileWindowsDirectory, "Desktop"), true, "Desktop", true); - CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "calc.exe"), "calc"); - CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "explorer.exe"), "explorer"); + CreateWindowsFile(ProfileWindowsDirectory, "calc.exe", "calc"); + CreateWindowsFile(ProfileWindowsDirectory, "explorer.exe", "explorer"); } - public static void CreateWindowsFile(string filepath, string contents) + public static void CreateWindowsFile(string filepath, string filename, string contents, int fileicon = 8) { - File.WriteAllText(filepath, contents); + File.WriteAllText(Path.Combine(filepath, filename), contents); + THFileInfo info = new THFileInfo(); + info.Name = filename; + info.FileIcon = fileicon; + UpdateDirectoryInfo(filepath, info); + } + + [DllImport("kernel32.dll", SetLastError = true)] + private static extern int GetShortPathName(String pathName, StringBuilder shortName, int cbShortName); + + public static void UpdateDirectoryInfo(string path, THFileInfo newfile) + { + StringBuilder sb = new StringBuilder(300); + GetShortPathName(newfile.Name, sb, 300); + Regex rgx = new Regex(".{8}\\.[A-Z]{3}"); + newfile.DOSName = Regex.Match(sb.ToString(), rgx.ToString(), RegexOptions.RightToLeft).ToString(); + if (File.ReadAllText(Path.Combine(path, "_data.info")).Contains(newfile.DOSName)) return; + FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject<FileSystemFolderInfo>(File.ReadAllText(Path.Combine(path, "_data.info"))); + fsfi.Files[fsfi.Files.Count()] = newfile; + + string toWrite = JsonConvert.SerializeObject(fsfi, Formatting.Indented); + + File.WriteAllText(Path.Combine(path, "_data.info"), toWrite); } public static void UpgradeFileSystem(string oldOS, string newOS) @@ -214,7 +239,7 @@ namespace TimeHACK.Engine // Add Address Book into existance! SaveDirectoryInfo(Path.Combine(ProfileProgramsDirectory, "Outlook Express"), false, "Outlook Express", true); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Outlook Express", "WAB.exe"), "addressbook"); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Outlook Express"), "WAB.exe", "addressbook"); // There is no "The Microsoft Network" folder! @@ -231,9 +256,10 @@ namespace TimeHACK.Engine FileSystemFolderInfo info = new FileSystemFolderInfo(); - info.Isprotected = isProtected; - info.label = label; - info.allowback = allowback; + info.IsProtected = isProtected; + info.Label = label; + info.AllowBack = allowback; + info.Files = new THFileInfo[200]; string toWrite = JsonConvert.SerializeObject(info, Formatting.Indented); @@ -603,8 +629,16 @@ namespace TimeHACK.Engine public class FileSystemFolderInfo { - public bool Isprotected { get; set; } - public string label { get; set; } - public bool allowback { get; set; } + public bool IsProtected { get; set; } + public string Label { get; set; } + public bool AllowBack { get; set; } + public THFileInfo[] Files { get; set; } + } + + public class THFileInfo + { + public string Name { get; set; } + public string DOSName { get; set; } + public int FileIcon { get; set; } } } diff --git a/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs b/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs index ce71b40..0237fac 100644 --- a/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs +++ b/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs @@ -38,10 +38,10 @@ namespace TimeHACK.OS.Win95.Win95Apps switch (appName.Text) { case "Downloading: FTP Client": - CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop", "FTP Client setup.exe"), "ftp client setup"); + CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop"), "FTP Client Setup.exe", "ftp client setup"); break; case "Downloading: Web Chat 1998": - CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop", "Web Chat Setup.exe"), "web chat setup"); + CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop"), "Web Chat Setup.exe", "web chat setup"); break; } /* if (appName.Text == "Downloading: Guess The Number") diff --git a/TimeHACK.Main/OS/Win95/Win95.Designer.cs b/TimeHACK.Main/OS/Win95/Win95.Designer.cs index df05e65..49bfba6 100644 --- a/TimeHACK.Main/OS/Win95/Win95.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95.Designer.cs @@ -434,7 +434,7 @@ namespace TimeHACK.OS.Win95 this.MinsweeperToolStripMenuItem.BackColor = System.Drawing.Color.Silver; this.MinsweeperToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver; this.MinsweeperToolStripMenuItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.MinsweeperToolStripMenuItem.Image = global::TimeHACK.Properties.Resources.minsweeper_logo; + this.MinsweeperToolStripMenuItem.Image = global::TimeHACK.Properties.Resources.WinClassicMinesweeper; this.MinsweeperToolStripMenuItem.Name = "MinsweeperToolStripMenuItem"; this.MinsweeperToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.MinsweeperToolStripMenuItem.Text = "Minesweeper"; @@ -963,9 +963,9 @@ namespace TimeHACK.OS.Win95 this.desktopImages.Images.SetKeyName(5, "WinClassicNetworking.png"); this.desktopImages.Images.SetKeyName(6, "WinClassicOutlook.png"); this.desktopImages.Images.SetKeyName(7, "WinClassicRecycle.png"); - this.desktopImages.Images.SetKeyName(8, "WinClassicSetup.png"); - this.desktopImages.Images.SetKeyName(9, "WinClassicSetup.png"); - this.desktopImages.Images.SetKeyName(10, "WinClassicSetup.png"); + this.desktopImages.Images.SetKeyName(8, "Win95File.png"); + this.desktopImages.Images.SetKeyName(9, "WinClassicFolder.png"); + this.desktopImages.Images.SetKeyName(10, "WinClassicApp.png"); this.desktopImages.Images.SetKeyName(11, "WinClassicSetup.png"); this.desktopImages.Images.SetKeyName(12, "blank-file-Windows95Icon.gif"); // diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs index caef618..3279967 100644 --- a/TimeHACK.Main/OS/Win95/Win95.cs +++ b/TimeHACK.Main/OS/Win95/Win95.cs @@ -574,7 +574,7 @@ namespace TimeHACK.OS.Win95 private void MinsweeperToolStripMenuItem_Click(object sender, EventArgs e) { - WinClassic app = wm.StartWin95(new WinClassicMinesweeper(), "Minesweeper", Properties.Resources.minsweeper_logo, false, false); + WinClassic app = wm.StartWin95(new WinClassicMinesweeper(), "Minesweeper", Properties.Resources.WinClassicMinesweeper, false, false); AddTaskBarItem(app, app.Tag.ToString(), "Calculator", Properties.Resources.WinClassicCalc); nonimportantapps.Add(app); diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index 4b0157e..7c999c8 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -93,14 +93,14 @@ namespace TimeHACK.OS.Win95.Win95Apps if (returnYesIfProtected == true) { - if (toRead.Isprotected == true) + if (toRead.IsProtected == true) { return "yes"; } } else { - return toRead.label; + return toRead.Label; } return Val; } diff --git a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index ef28bca..290d2f2 100644 --- a/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -110,14 +110,14 @@ namespace TimeHACK.OS.Win95.Win95Apps if (returnYesIfProtected == true) { - if (toRead.Isprotected == true) + if (toRead.IsProtected == true) { return "yes"; } } else { - return toRead.label; + return toRead.Label; } return Val; } diff --git a/TimeHACK.Main/Properties/Resources.Designer.cs b/TimeHACK.Main/Properties/Resources.Designer.cs index c4e9524..4abab30 100644 --- a/TimeHACK.Main/Properties/Resources.Designer.cs +++ b/TimeHACK.Main/Properties/Resources.Designer.cs @@ -378,16 +378,6 @@ namespace TimeHACK.Properties { /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> - internal static System.Drawing.Bitmap minsweeper_logo { - get { - object obj = ResourceManager.GetObject("minsweeper logo", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// <summary> - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// </summary> internal static System.Drawing.Bitmap minsweeper_sad { get { object obj = ResourceManager.GetObject("minsweeper_sad", resourceCulture); @@ -400,7 +390,7 @@ namespace TimeHACK.Properties { /// </summary> internal static System.Drawing.Bitmap minsweeper_smile { get { - object obj = ResourceManager.GetObject("minsweeper smile", resourceCulture); + object obj = ResourceManager.GetObject("minsweeper_smile", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -787,6 +777,16 @@ namespace TimeHACK.Properties { /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> + internal static System.Drawing.Bitmap Win95File { + get { + object obj = ResourceManager.GetObject("Win95File", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> internal static System.Drawing.Bitmap Win95HardDiskIcon { get { object obj = ResourceManager.GetObject("Win95HardDiskIcon", resourceCulture); @@ -1024,6 +1024,16 @@ namespace TimeHACK.Properties { /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> + internal static System.Drawing.Bitmap WinClassicApp { + get { + object obj = ResourceManager.GetObject("WinClassicApp", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> internal static System.Drawing.Bitmap WinClassicCalc { get { object obj = ResourceManager.GetObject("WinClassicCalc", resourceCulture); @@ -1204,6 +1214,16 @@ namespace TimeHACK.Properties { /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> + internal static System.Drawing.Bitmap WinClassicMinesweeper { + get { + object obj = ResourceManager.GetObject("WinClassicMinesweeper", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> internal static System.Drawing.Bitmap WinClassicMSN { get { object obj = ResourceManager.GetObject("WinClassicMSN", resourceCulture); diff --git a/TimeHACK.Main/Properties/Resources.resx b/TimeHACK.Main/Properties/Resources.resx index 779be5c..7a96a19 100644 --- a/TimeHACK.Main/Properties/Resources.resx +++ b/TimeHACK.Main/Properties/Resources.resx @@ -148,7 +148,7 @@ <data name="WinClassicNew" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\WinClassic\WinClassicNew.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> - <data name="minsweeper smile" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <data name="minsweeper_smile" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\minsweeper smile.PNG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> <data name="WinClassicAddressBookDeleteIcon" type="System.Resources.ResXFileRef, System.Windows.Forms"> @@ -681,7 +681,13 @@ <data name="ie4_mail" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\ie4_mail.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> - <data name="minsweeper logo" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>..\Resources\minsweeper logo.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + <data name="Win95File" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\WinClassic\Win95File.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinClassicApp" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\WinClassic\WinClassicApp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinClassicMinesweeper" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\WinClassic\WinClassicMinesweeper.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> </root>
\ No newline at end of file diff --git a/TimeHACK.Main/Resources/WinClassic/Win95File.png b/TimeHACK.Main/Resources/WinClassic/Win95File.png Binary files differnew file mode 100644 index 0000000..ada2ccd --- /dev/null +++ b/TimeHACK.Main/Resources/WinClassic/Win95File.png diff --git a/TimeHACK.Main/Resources/WinClassic/WinClassicApp.png b/TimeHACK.Main/Resources/WinClassic/WinClassicApp.png Binary files differnew file mode 100644 index 0000000..5d954ac --- /dev/null +++ b/TimeHACK.Main/Resources/WinClassic/WinClassicApp.png diff --git a/TimeHACK.Main/Resources/WinClassic/WinClassicMinesweeper.png b/TimeHACK.Main/Resources/WinClassic/WinClassicMinesweeper.png Binary files differnew file mode 100644 index 0000000..c528175 --- /dev/null +++ b/TimeHACK.Main/Resources/WinClassic/WinClassicMinesweeper.png diff --git a/TimeHACK.Main/TimeHACK.Main.csproj b/TimeHACK.Main/TimeHACK.Main.csproj index 77192ec..c6433e0 100644 --- a/TimeHACK.Main/TimeHACK.Main.csproj +++ b/TimeHACK.Main/TimeHACK.Main.csproj @@ -572,6 +572,7 @@ <None Include="Resources\WinClassic\Win95ComputerIcon.png" /> <None Include="Resources\WinClassic\Win95NetworkIcon.png" /> <None Include="Resources\WinClassic\Win95RecycleIcon.png" /> + <None Include="Resources\WinClassic\Win95File.png" /> <Content Include="Resources\WinClassic\Win95SideBar.png" /> <Content Include="Resources\WinClassic\Win95Start.wav" /> <None Include="Resources\WinClassic\Win95Warning.png" /> @@ -582,6 +583,7 @@ <None Include="Resources\WinClassic\Win98Computer.png" /> <None Include="Resources\WinClassic\Win98Start.wav" /> <None Include="Resources\WinClassic\Win98Stop.WAV" /> + <None Include="Resources\WinClassic\WinClassicApp.png" /> <Content Include="Resources\WinClassic\WinClassicClock.png" /> <Content Include="Resources\WinClassic\WinClassicComputer.png" /> <None Include="Resources\WinClassic\WinClassicCopy.png" /> @@ -599,6 +601,7 @@ <Content Include="Resources\WinClassic\WinClassicIE4.png" /> <Content Include="Resources\WinClassic\WinClassicInbox.png" /> <None Include="Resources\WinClassic\WinClassicInstallPic.png" /> + <None Include="Resources\WinClassic\WinClassicMinesweeper.png" /> <Content Include="Resources\WinClassic\WinClassicMSN.png" /> <Content Include="Resources\WinClassic\WinClassicNetworking.png" /> <None Include="Resources\WinClassic\WinClassicNotepad.png" /> |
