aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Engine/SaveSystem.cs
diff options
context:
space:
mode:
authorjtsshieh <[email protected]>2017-08-02 22:08:21 -0400
committerGitHub <[email protected]>2017-08-02 22:08:21 -0400
commit2029bbc59969fd4554022bc23dd6a88a2adc6d19 (patch)
treeb5a5281108d8f0983fdf3b3446a4911059fd3497 /TimeHACK.Engine/SaveSystem.cs
parentd2286b7d68db20fae6bdb58078853379faf5ac08 (diff)
parenta3b48880bf4136cb8033305fde052727e24ab8b1 (diff)
downloadhistacom2-2029bbc59969fd4554022bc23dd6a88a2adc6d19.tar.gz
histacom2-2029bbc59969fd4554022bc23dd6a88a2adc6d19.tar.bz2
histacom2-2029bbc59969fd4554022bc23dd6a88a2adc6d19.zip
Merge branch 'master' into master
Diffstat (limited to 'TimeHACK.Engine/SaveSystem.cs')
-rw-r--r--TimeHACK.Engine/SaveSystem.cs51
1 files changed, 30 insertions, 21 deletions
diff --git a/TimeHACK.Engine/SaveSystem.cs b/TimeHACK.Engine/SaveSystem.cs
index 691e06d..f7dc954 100644
--- a/TimeHACK.Engine/SaveSystem.cs
+++ b/TimeHACK.Engine/SaveSystem.cs
@@ -89,7 +89,7 @@ namespace TimeHACK.Engine
{
get
{
- return Path.Combine(ProfileMyComputerDirectory, "Settings");
+ return Path.Combine(ProfileMyComputerDirectory, "Documents and Settings");
}
}
@@ -97,7 +97,7 @@ namespace TimeHACK.Engine
{
get
{
- return Path.Combine(ProfileMyComputerDirectory, "Doc");
+ return Path.Combine(ProfileMyComputerDirectory, "My Documents");
}
}
@@ -105,7 +105,7 @@ namespace TimeHACK.Engine
{
get
{
- return Path.Combine(ProfileMyComputerDirectory, "Prog");
+ return Path.Combine(ProfileMyComputerDirectory, "Program Files");
}
}
@@ -113,7 +113,7 @@ namespace TimeHACK.Engine
{
get
{
- return Path.Combine(ProfileMyComputerDirectory, "Win");
+ return Path.Combine(ProfileMyComputerDirectory, "Windows");
}
}
@@ -160,13 +160,13 @@ namespace TimeHACK.Engine
SaveDirectoryInfo(ProfileDirectory, "folders", false, "My Computer", false);
SaveDirectoryInfo(ProfileFileSystemDirectory, "CDrive", false, "C:", true);
- if (CurrentSave.CurrentOS == "95" || CurrentSave.CurrentOS == "98") SaveDirectoryInfo(ProfileMyComputerDirectory, "Doc", false, "My Documents", true);
- if (CurrentSave.CurrentOS == "2000" || CurrentSave.CurrentOS == "ME") SaveDirectoryInfo(ProfileMyComputerDirectory, "Settings", false, "Documents and Settings", true);
- SaveDirectoryInfo(ProfileMyComputerDirectory, "Prog", true, "Program Files", true);
+ if (CurrentSave.CurrentOS == "95" || CurrentSave.CurrentOS == "98") SaveDirectoryInfo(ProfileMyComputerDirectory, "My Documents", false, "My Documents", true);
+ if (CurrentSave.CurrentOS == "2000" || CurrentSave.CurrentOS == "ME") SaveDirectoryInfo(ProfileMyComputerDirectory, "Documents and Settings", false, "Documents and Settings", true);
+ SaveDirectoryInfo(ProfileMyComputerDirectory, "Program Files", true, "Program Files", true);
SaveDirectoryInfo(ProfileProgramsDirectory, "Accessories", false, "Accessories", true);
SaveDirectoryInfo(ProfileProgramsDirectory, "Internet Explorer", true, "Internet Explorer", true);
SaveDirectoryInfo(ProfileProgramsDirectory, "The Microsoft Network", true, "The Microsoft Network", true);
- SaveDirectoryInfo(ProfileMyComputerDirectory, "Win", true, "Windows", true);
+ SaveDirectoryInfo(ProfileMyComputerDirectory, "Windows", true, "Windows", true);
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Accessories"), "wordpad.exe", "wordpad");
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "ie20.exe", "ie");
@@ -186,9 +186,14 @@ namespace TimeHACK.Engine
SaveDirectoryInfo(ProfileWindowsDirectory, "Temp", true, "Temp", true);
SaveDirectoryInfo(ProfileWindowsDirectory, "Desktop", true, "Desktop", true);
- CreateWindowsFile(ProfileWindowsDirectory, "calc.exe", "calc", 10, 59392);
- CreateWindowsFile(ProfileWindowsDirectory, "explorer.exe", "explorer", 10, 204288);
- CreateWindowsFile(ProfileWindowsDirectory, "notepad.exe", "notepad", 12, 34034);
+ CreateWindowsFile(ProfileWindowsDirectory, "c", "", 8, 515);
+ CreateWindowsFile(ProfileWindowsDirectory, "calc.exe", "calc", 13, 59392);
+ CreateWindowsFile(ProfileWindowsDirectory, "emm386.exe", "emm386", 10, 125495);
+ CreateWindowsFile(ProfileWindowsDirectory, "explorer.exe", "explorer", 0, 204288);
+ CreateWindowsFile(ProfileWindowsDirectory, "notepad.exe", "notepad", 14, 34034);
+ CreateWindowsFile(ProfileWindowsDirectory, "regedit.exe", "regedit", 15, 120320);
+ CreateWindowsFile(ProfileWindowsDirectory, "win.com", "", 10, 22679);
+ CreateWindowsFile(ProfileWindowsDirectory, "write.exe", "wordpad", 16, 5120);
}
public static void CreateWindowsFile(string filepath, string filename, string contents, int fileicon = 8, int bytes = 512)
@@ -205,18 +210,22 @@ namespace TimeHACK.Engine
public static void UpdateDirectoryInfo(string path, THFileInfo newfile)
{
newfile.DOSName = newfile.Name.ToUpper().Replace("*", "").Replace("+", "").Replace(":", "").Replace(";", "").Replace(" ", "");
- string[] dos = newfile.DOSName.Split('.');
-
- if (dos.Count() > 2)
+ if (newfile.DOSName.Contains("."))
{
- List<string> dosb = dos.ToList();
- dosb.RemoveRange(1, dos.Count() - 2);
- dos = dosb.ToArray();
- }
- dos[1] = dos[1].Substring(0, 3);
- if (dos[0].Length > 8) dos[0] = dos[0].Substring(0, 6) + "~1";
+ string[] dos = newfile.DOSName.Split('.');
+
+ if (dos.Count() > 2)
+ {
+ List<string> dosb = dos.ToList();
+ dosb.RemoveRange(1, dos.Count() - 2);
+ dos = dosb.ToArray();
+ }
+ dos[1] = dos[1].Substring(0, 3);
+ if (dos[0].Length > 8) dos[0] = dos[0].Substring(0, 6) + "~1";
- newfile.DOSName = dos[0] + "." + dos[1];
+ newfile.DOSName = dos[0] + "." + dos[1];
+ }
+ else if (newfile.DOSName.Length > 8) newfile.DOSName = newfile.DOSName.Substring(0, 6) + "~1";
if (File.ReadAllText(Path.Combine(path, "_data.info")).Contains(newfile.DOSName)) return;
FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject<FileSystemFolderInfo>(File.ReadAllText(Path.Combine(path, "_data.info")));