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

View file

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