Skip to content
This repository has been archived by the owner on Apr 4, 2021. It is now read-only.

Commit

Permalink
Update SourceCode
Browse files Browse the repository at this point in the history
  • Loading branch information
Arimodu authored Aug 4, 2020
1 parent 972d014 commit d15215e
Showing 1 changed file with 48 additions and 10 deletions.
58 changes: 48 additions & 10 deletions SourceCode
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,48 @@ namespace BeatZip
string PCVRInstallDir;
string destFolder;
bool historyEnabled = true;
bool beatSageMode = false;
string historyFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"BeatZip\History.txt");
string beatZipData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"BeatZip");
string pathHistoryFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"BeatZip\PathHistory.txt");
string PCVRSongDir;


if (args.Length != 0)
{
if (args[0].ToLower() == "disablehistory")
for (int i = 0; i < args.Length; i++)
{
historyEnabled = false;
Console.WriteLine("History disabled!");
Thread.Sleep(1000);
switch (args[i].ToLower())
{
case "-disablehistory":
historyEnabled = false;
Console.WriteLine("History disabled!");
Thread.Sleep(1000);
break;

case "disablehistory":
historyEnabled = false;
Console.WriteLine("History disabled!");
Thread.Sleep(1000);
break;

case "-BeatSageMode":
beatSageMode = true;
Console.WriteLine("Beat Sage Mode enabled!");
Thread.Sleep(1000);
break;

case "BeatSageMode":
beatSageMode = true;
Console.WriteLine("Beat Sage Mode enabled!");
Thread.Sleep(1000);
break;

default:
Console.WriteLine(args[i] + " is an unknown argument. Ignoring...");
Thread.Sleep(1000);
break;
}
}
}

Expand All @@ -45,7 +75,7 @@ namespace BeatZip
{
Console.WriteLine("History file detected and enabled!");
Console.WriteLine("To disable history start the application with the -disablehistory argument");
Thread.Sleep(5000);
Thread.Sleep(1000);
Console.Clear();
}
if (!File.Exists(pathHistoryFile))
Expand Down Expand Up @@ -100,7 +130,15 @@ namespace BeatZip
Directory.CreateDirectory(destFolderOld);
}

string PCVRSongDir = PCVRInstallDir + @"\Beat Saber_Data\CustomLevels";
if (!beatSageMode)
{
PCVRSongDir = PCVRInstallDir + @"\Beat Saber_Data\CustomLevels";
}
else
{
PCVRSongDir = PCVRInstallDir;
}

string[] subdirs = Directory.GetDirectories(PCVRSongDir);


Expand All @@ -112,15 +150,15 @@ namespace BeatZip

if (File.Exists(currentFilePath))
{
Console.WriteLine("Already exists! Moving to old!");
Console.WriteLine("Already exists! Moving to old {0} out of {1}", i + 1, subdirs.Length);
File.Move(currentFilePath, destFolderOld + @"\" + currentFileName, true);
Console.WriteLine();
Thread.Sleep(5);
continue;
}
else if (File.Exists(destFolderOld + @"\" + currentFileName))
{
Console.WriteLine("Already exists in old! Skipping!");
Console.WriteLine("Already exists in old! Skipping {0} out of {1}", i + 1, subdirs.Length);
Console.WriteLine();
Thread.Sleep(5);
continue;
Expand All @@ -132,7 +170,7 @@ namespace BeatZip
{
if (song == currentFileName)
{
Console.WriteLine("Found in history! Skipping!");
Console.WriteLine("Found in history! Skipping {0} out of {1}", i + 1, subdirs.Length);
Console.WriteLine();
foundInHistory = true;
break;
Expand All @@ -143,7 +181,7 @@ namespace BeatZip
continue;
}
}
Console.WriteLine("Zipping!");
Console.WriteLine("Zipping {0} out of {1}", i + 1, subdirs.Length);
ZipFile.CreateFromDirectory(subdirs[i], destFolder + @"\" + currentFileName);
Console.WriteLine("Zipped succesfully!");
if (historyEnabled == true)
Expand Down

0 comments on commit d15215e

Please sign in to comment.