From b76437ebaaee7cd66a118f479b7652c58becdd88 Mon Sep 17 00:00:00 2001 From: NicoAICP Date: Wed, 24 Jun 2020 17:54:51 +0200 Subject: [PATCH] Added Space Bypass function --- UWUVCI AIO WPF/App.xaml.cs | 12 +++- UWUVCI AIO WPF/Classes/Injection.cs | 27 ++++++-- UWUVCI AIO WPF/Models/MainViewModel.cs | 54 ++++++++++++++- UWUVCI AIO WPF/UI/Frames/SettingsFrame.xaml | 3 +- .../UI/Frames/SettingsFrame.xaml.cs | 7 +- .../UI/Windows/Custom Message.xaml.cs | 15 +++-- .../Windows/DownloadWait - Kopieren.xaml.cs | 67 ++++++++++++------- UWUVCI AIO WPF/UI/Windows/MenuWindow.xaml | 1 + UWUVCI AIO WPF/UI/Windows/MenuWindow.xaml.cs | 15 +++++ 9 files changed, 161 insertions(+), 40 deletions(-) diff --git a/UWUVCI AIO WPF/App.xaml.cs b/UWUVCI AIO WPF/App.xaml.cs index 210b3a2..407ba52 100644 --- a/UWUVCI AIO WPF/App.xaml.cs +++ b/UWUVCI AIO WPF/App.xaml.cs @@ -55,6 +55,7 @@ namespace UWUVCI_AIO_WPF } } bool check = true; + bool bypass = false; if (e.Args.Length >= 1) { foreach(var s in e.Args) @@ -63,6 +64,11 @@ namespace UWUVCI_AIO_WPF { check = false; } + if(s == "--spacebypass") + { + + bypass = true; + } } } @@ -71,7 +77,7 @@ namespace UWUVCI_AIO_WPF { t.Elapsed += KillProg; t.Start(); - Custom_Message cm = new Custom_Message("Another Instance Running", "You already got another instance of UWUVCI AIO running.\nThis instance will terminate in 5 seconds."); + Custom_Message cm = new Custom_Message("Another Instance Running", " You already got another instance of UWUVCI AIO running. \n This instance will terminate in 5 seconds. "); cm.ShowDialog(); KillProg(null, null); @@ -98,6 +104,10 @@ namespace UWUVCI_AIO_WPF cm.ShowDialog(); } MainWindow wnd = new MainWindow(); + if (bypass) { + wnd.allowBypass(); + + } // The OpenFile() method is just an example of what you could do with the // parameter. The method should be declared on your MainWindow class, where // you could use a range of methods to process the passed file path diff --git a/UWUVCI AIO WPF/Classes/Injection.cs b/UWUVCI AIO WPF/Classes/Injection.cs index 08d3ea7..a5537e0 100644 --- a/UWUVCI AIO WPF/Classes/Injection.cs +++ b/UWUVCI AIO WPF/Classes/Injection.cs @@ -148,30 +148,39 @@ namespace UWUVCI_AIO_WPF [STAThread] public static bool Inject(GameConfig Configuration, string RomPath, MainViewModel mvm, bool force) { - Clean(); - long gamesize = new FileInfo(RomPath).Length; - var drive = new DriveInfo(tempPath); + long freeSpaceInBytes = 0; + if (!mvm.saveworkaround) + { + long gamesize = new FileInfo(RomPath).Length; + + var drive = new DriveInfo(tempPath); + + + freeSpaceInBytes = drive.AvailableFreeSpace; + } long neededspace = 0; - long freeSpaceInBytes = drive.AvailableFreeSpace; - + mvvm = mvm; if (Directory.Exists(tempPath)) { + Directory.Delete(tempPath, true); } + Directory.CreateDirectory(tempPath); + mvm.msg = "Checking Tools..."; mvm.InjcttoolCheck(); mvm.Progress = 5; - + mvm.msg = "Copying Base..."; try { - if (Configuration.Console == GameConsoles.WII || Configuration.Console == GameConsoles.GCN) + if (!mvm.saveworkaround && (Configuration.Console == GameConsoles.WII || Configuration.Console == GameConsoles.GCN)) { if (mvm.GC) @@ -187,6 +196,10 @@ namespace UWUVCI_AIO_WPF throw new Exception("12G"); } } + else + { + MessageBox.Show("Using Bypass"); + } if(Configuration.BaseRom == null || Configuration.BaseRom.Name == null) { throw new Exception("BASE"); diff --git a/UWUVCI AIO WPF/Models/MainViewModel.cs b/UWUVCI AIO WPF/Models/MainViewModel.cs index 9eec713..6b67d53 100644 --- a/UWUVCI AIO WPF/Models/MainViewModel.cs +++ b/UWUVCI AIO WPF/Models/MainViewModel.cs @@ -36,6 +36,8 @@ namespace UWUVCI_AIO_WPF { public class MainViewModel : BaseModel { + public bool saveworkaround = false; + private bool Injected2 = false; public bool injected2 { @@ -1242,11 +1244,26 @@ namespace UWUVCI_AIO_WPF p.StartInfo.FileName = System.Windows.Application.ResourceAssembly.Location; if (debug) { - p.StartInfo.Arguments = "--debug --skip"; + if (saveworkaround) + { + p.StartInfo.Arguments = "--debug --skip --spacebypass"; + } + else + { + p.StartInfo.Arguments = "--debug --skip"; + } + } else { - p.StartInfo.Arguments = "--skip"; + if (saveworkaround) + { + p.StartInfo.Arguments = "--skip --spacebypass"; + } + else + { + p.StartInfo.Arguments = "--skip"; + } } p.Start(); Environment.Exit(0); @@ -3721,5 +3738,38 @@ namespace UWUVCI_AIO_WPF } } + public void RestartIntoBypass() + { + using(Process p = new Process()) + { + p.StartInfo.FileName = System.Windows.Application.ResourceAssembly.Location; + if (debug) + { + if (saveworkaround) + { + p.StartInfo.Arguments = "--debug --skip --spacebypass"; + } + else + { + p.StartInfo.Arguments = "--debug --skip"; + } + + } + else + { + if (saveworkaround) + { + p.StartInfo.Arguments = "--skip --spacebypass"; + } + else + { + p.StartInfo.Arguments = "--skip"; + } + } + p.Start(); + Environment.Exit(0); + } + + } } } diff --git a/UWUVCI AIO WPF/UI/Frames/SettingsFrame.xaml b/UWUVCI AIO WPF/UI/Frames/SettingsFrame.xaml index 0f247df..e1bd481 100644 --- a/UWUVCI AIO WPF/UI/Frames/SettingsFrame.xaml +++ b/UWUVCI AIO WPF/UI/Frames/SettingsFrame.xaml @@ -36,7 +36,7 @@