Merge pull request #65 from CasuallyCalm/master

Add console name to folder and space after brackets
This commit is contained in:
ZestyTS 2024-04-04 14:23:03 -07:00 committed by GitHub
commit a7f0b8154e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 12 deletions

View file

@ -1624,19 +1624,19 @@ namespace UWUVCI_AIO_WPF
}
}
[STAThread]
public static void Loadiine(string gameName)
public static void Loadiine(string gameName, string gameConsole)
{
if (gameName == null || gameName == string.Empty) gameName = "NoName";
gameName = gameName.Replace("|", " ");
Regex reg = new Regex("[^a-zA-Z0-9 é -]");
//string outputPath = Path.Combine(Properties.Settings.Default.InjectionPath, gameName);
string outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[LOADIINE]{reg.Replace(gameName,"")} [{mvvm.prodcode}]");
mvvm.foldername = $"[LOADIINE]{reg.Replace(gameName, "")} [{mvvm.prodcode}]";
string outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[LOADIINE][{gameConsole}] {reg.Replace(gameName,"")} [{mvvm.prodcode}]");
mvvm.foldername = $"[LOADIINE][{gameConsole}] {reg.Replace(gameName, "")} [{mvvm.prodcode}]";
int i = 0;
while (Directory.Exists(outputPath))
{
outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[LOADIINE]{reg.Replace(gameName, "")} [{mvvm.prodcode}]_{i}");
mvvm.foldername = $"[LOADIINE]{reg.Replace(gameName, "")} [{mvvm.prodcode}]_{i}";
outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[LOADIINE][{gameConsole}] {reg.Replace(gameName, "")} [{mvvm.prodcode}]_{i}");
mvvm.foldername = $"[LOADIINE][{gameConsole}] {reg.Replace(gameName, "")} [{mvvm.prodcode}]_{i}";
i++;
}
@ -1654,7 +1654,7 @@ namespace UWUVCI_AIO_WPF
Clean();
}
[STAThread]
public static void Packing(string gameName, MainViewModel mvm)
public static void Packing(string gameName, string gameConsole, MainViewModel mvm)
{
mvm.msg = "Checking Tools...";
mvm.InjcttoolCheck();
@ -1664,14 +1664,14 @@ namespace UWUVCI_AIO_WPF
if (gameName == null || gameName == string.Empty) gameName = "NoName";
//string outputPath = Path.Combine(Properties.Settings.Default.InjectionPath, gameName);
string outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[WUP]{reg.Replace(gameName,"").Replace("|", " ")}");
string outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[WUP][{gameConsole}] {reg.Replace(gameName,"").Replace("|", " ")}");
outputPath = outputPath.Replace("|", " ");
mvvm.foldername = $"[WUP]{reg.Replace(gameName, "").Replace("|"," ")}";
mvvm.foldername = $"[WUP][{gameConsole}] {reg.Replace(gameName, "").Replace("|"," ")}";
int i = 0;
while (Directory.Exists(outputPath))
{
outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[WUP]{reg.Replace(gameName,"").Replace("|", " ")}_{i}");
mvvm.foldername = $"[WUP]{reg.Replace(gameName, "").Replace("|", " ")}_{i}";
outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[WUP][{gameConsole}] {reg.Replace(gameName,"").Replace("|", " ")}_{i}");
mvvm.foldername = $"[WUP][{gameConsole}] {reg.Replace(gameName, "").Replace("|", " ")}_{i}";
i++;
}
var oldpath = Directory.GetCurrentDirectory();

View file

@ -1006,10 +1006,17 @@ namespace UWUVCI_AIO_WPF
}
public void Pack(bool loadiine)
{
string consoleName = GameConfiguration.Console.ToString();
if (GC)
{
consoleName = GameConsoles.GCN.ToString();
}
ValidatePathsStillExist();
if (loadiine)
{
Injection.Loadiine(GameConfiguration.GameName);
Injection.Loadiine(GameConfiguration.GameName, consoleName);
//
}
else
@ -1021,7 +1028,7 @@ namespace UWUVCI_AIO_WPF
gameConfiguration.GameName = reg.Replace(gameConfiguration.GameName, "");
}
Task.Run(() => { Injection.Packing(GameConfiguration.GameName, this); });
Task.Run(() => { Injection.Packing(GameConfiguration.GameName, consoleName, this); });
DownloadWait dw = new DownloadWait("Packing Inject - Please Wait", "", this);
try