mirror of
https://github.com/stuff-by-3-random-dudes/UWUVCI-AIO-WPF
synced 2024-11-10 13:44:13 +00:00
Added Space Bypass function
This commit is contained in:
parent
56f16eb3b0
commit
b76437ebaa
9 changed files with 161 additions and 40 deletions
|
@ -55,6 +55,7 @@ namespace UWUVCI_AIO_WPF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool check = true;
|
bool check = true;
|
||||||
|
bool bypass = false;
|
||||||
if (e.Args.Length >= 1)
|
if (e.Args.Length >= 1)
|
||||||
{
|
{
|
||||||
foreach(var s in e.Args)
|
foreach(var s in e.Args)
|
||||||
|
@ -63,6 +64,11 @@ namespace UWUVCI_AIO_WPF
|
||||||
{
|
{
|
||||||
check = false;
|
check = false;
|
||||||
}
|
}
|
||||||
|
if(s == "--spacebypass")
|
||||||
|
{
|
||||||
|
|
||||||
|
bypass = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +77,7 @@ namespace UWUVCI_AIO_WPF
|
||||||
{
|
{
|
||||||
t.Elapsed += KillProg;
|
t.Elapsed += KillProg;
|
||||||
t.Start();
|
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();
|
cm.ShowDialog();
|
||||||
KillProg(null, null);
|
KillProg(null, null);
|
||||||
|
@ -98,6 +104,10 @@ namespace UWUVCI_AIO_WPF
|
||||||
cm.ShowDialog();
|
cm.ShowDialog();
|
||||||
}
|
}
|
||||||
MainWindow wnd = new MainWindow();
|
MainWindow wnd = new MainWindow();
|
||||||
|
if (bypass) {
|
||||||
|
wnd.allowBypass();
|
||||||
|
|
||||||
|
}
|
||||||
// The OpenFile() method is just an example of what you could do with the
|
// 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
|
// parameter. The method should be declared on your MainWindow class, where
|
||||||
// you could use a range of methods to process the passed file path
|
// you could use a range of methods to process the passed file path
|
||||||
|
|
|
@ -148,30 +148,39 @@ namespace UWUVCI_AIO_WPF
|
||||||
[STAThread]
|
[STAThread]
|
||||||
public static bool Inject(GameConfig Configuration, string RomPath, MainViewModel mvm, bool force)
|
public static bool Inject(GameConfig Configuration, string RomPath, MainViewModel mvm, bool force)
|
||||||
{
|
{
|
||||||
|
|
||||||
Clean();
|
Clean();
|
||||||
long gamesize = new FileInfo(RomPath).Length;
|
long freeSpaceInBytes = 0;
|
||||||
var drive = new DriveInfo(tempPath);
|
if (!mvm.saveworkaround)
|
||||||
|
{
|
||||||
|
long gamesize = new FileInfo(RomPath).Length;
|
||||||
|
|
||||||
|
var drive = new DriveInfo(tempPath);
|
||||||
|
|
||||||
|
|
||||||
|
freeSpaceInBytes = drive.AvailableFreeSpace;
|
||||||
|
}
|
||||||
long neededspace = 0;
|
long neededspace = 0;
|
||||||
long freeSpaceInBytes = drive.AvailableFreeSpace;
|
|
||||||
|
|
||||||
mvvm = mvm;
|
mvvm = mvm;
|
||||||
|
|
||||||
|
|
||||||
if (Directory.Exists(tempPath))
|
if (Directory.Exists(tempPath))
|
||||||
{
|
{
|
||||||
|
|
||||||
Directory.Delete(tempPath, true);
|
Directory.Delete(tempPath, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Directory.CreateDirectory(tempPath);
|
Directory.CreateDirectory(tempPath);
|
||||||
|
|
||||||
|
|
||||||
mvm.msg = "Checking Tools...";
|
mvm.msg = "Checking Tools...";
|
||||||
mvm.InjcttoolCheck();
|
mvm.InjcttoolCheck();
|
||||||
mvm.Progress = 5;
|
mvm.Progress = 5;
|
||||||
|
|
||||||
mvm.msg = "Copying Base...";
|
mvm.msg = "Copying Base...";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Configuration.Console == GameConsoles.WII || Configuration.Console == GameConsoles.GCN)
|
if (!mvm.saveworkaround && (Configuration.Console == GameConsoles.WII || Configuration.Console == GameConsoles.GCN))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (mvm.GC)
|
if (mvm.GC)
|
||||||
|
@ -187,6 +196,10 @@ namespace UWUVCI_AIO_WPF
|
||||||
throw new Exception("12G");
|
throw new Exception("12G");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Using Bypass");
|
||||||
|
}
|
||||||
if(Configuration.BaseRom == null || Configuration.BaseRom.Name == null)
|
if(Configuration.BaseRom == null || Configuration.BaseRom.Name == null)
|
||||||
{
|
{
|
||||||
throw new Exception("BASE");
|
throw new Exception("BASE");
|
||||||
|
|
|
@ -36,6 +36,8 @@ namespace UWUVCI_AIO_WPF
|
||||||
{
|
{
|
||||||
public class MainViewModel : BaseModel
|
public class MainViewModel : BaseModel
|
||||||
{
|
{
|
||||||
|
public bool saveworkaround = false;
|
||||||
|
|
||||||
private bool Injected2 = false;
|
private bool Injected2 = false;
|
||||||
public bool injected2
|
public bool injected2
|
||||||
{
|
{
|
||||||
|
@ -1242,11 +1244,26 @@ namespace UWUVCI_AIO_WPF
|
||||||
p.StartInfo.FileName = System.Windows.Application.ResourceAssembly.Location;
|
p.StartInfo.FileName = System.Windows.Application.ResourceAssembly.Location;
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
p.StartInfo.Arguments = "--debug --skip";
|
if (saveworkaround)
|
||||||
|
{
|
||||||
|
p.StartInfo.Arguments = "--debug --skip --spacebypass";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p.StartInfo.Arguments = "--debug --skip";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p.StartInfo.Arguments = "--skip";
|
if (saveworkaround)
|
||||||
|
{
|
||||||
|
p.StartInfo.Arguments = "--skip --spacebypass";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p.StartInfo.Arguments = "--skip";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
p.Start();
|
p.Start();
|
||||||
Environment.Exit(0);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<TextBlock HorizontalAlignment="Left" Margin="1022,10,0,0" TextWrapping="Wrap" Text="v2.1 BETA" VerticalAlignment="Top" FontSize="20" Width="98" Visibility="Hidden"/>
|
<TextBlock HorizontalAlignment="Left" Margin="1022,10,0,0" TextWrapping="Wrap" Text="v2.1 BETA" VerticalAlignment="Top" FontSize="20" Width="98" Visibility="Hidden"/>
|
||||||
<Button Content="Reset TitleKeys" HorizontalAlignment="Left" Margin="337,226,0,0" VerticalAlignment="Top" Width="153" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_8" IsTabStop="False"/>
|
<Button Content="Reset TitleKeys" HorizontalAlignment="Left" Margin="337,226,0,0" VerticalAlignment="Top" Width="153" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_8" IsTabStop="False"/>
|
||||||
<Button Content="Start Nintendont Config Tool" HorizontalAlignment="Left" Margin="337,314,0,0" VerticalAlignment="Top" Width="267" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_9" IsTabStop="False"/>
|
<Button Content="Start Nintendont Config Tool" HorizontalAlignment="Left" Margin="337,314,0,0" VerticalAlignment="Top" Width="267" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_9" IsTabStop="False"/>
|
||||||
<Button Content="Reset Don't show this again Option" HorizontalAlignment="Left" Margin="422,358,0,0" VerticalAlignment="Top" Width="266" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_10" IsTabStop="False"/>
|
<Button Content="Reset Don't show this again Option" HorizontalAlignment="Left" Margin="346,357,0,0" VerticalAlignment="Top" Width="258" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_10" IsTabStop="False"/>
|
||||||
<Button Content="Button" HorizontalAlignment="Left" Margin="337,422,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_11" IsTabStop="False"/>
|
<Button Content="Button" HorizontalAlignment="Left" Margin="337,422,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_11" IsTabStop="False"/>
|
||||||
<Grid Margin="0,0,5,0"/>
|
<Grid Margin="0,0,5,0"/>
|
||||||
<Rectangle Fill="LightGray" HorizontalAlignment="Left" Height="32" Margin="12,7,0,0" VerticalAlignment="Top" Width="1108"/>
|
<Rectangle Fill="LightGray" HorizontalAlignment="Left" Height="32" Margin="12,7,0,0" VerticalAlignment="Top" Width="1108"/>
|
||||||
|
@ -47,6 +47,7 @@
|
||||||
<Ellipse Fill="#FF2196F3" HorizontalAlignment="Left" Height="21" Margin="12,7,0,0" VerticalAlignment="Top" Width="17"/>
|
<Ellipse Fill="#FF2196F3" HorizontalAlignment="Left" Height="21" Margin="12,7,0,0" VerticalAlignment="Top" Width="17"/>
|
||||||
<Border BorderBrush="#FF2196F3" BorderThickness="1" HorizontalAlignment="Left" Height="33" Margin="12,6,0,0" VerticalAlignment="Top" Width="1108" CornerRadius="5" Background="#FF2196F3"/>
|
<Border BorderBrush="#FF2196F3" BorderThickness="1" HorizontalAlignment="Left" Height="33" Margin="12,6,0,0" VerticalAlignment="Top" Width="1108" CornerRadius="5" Background="#FF2196F3"/>
|
||||||
<Label Content="v3.0 BETA" HorizontalAlignment="Left" Margin="1048,10,0,0" VerticalAlignment="Top" Foreground="#DDFFFFFF" Width="72" Height="24"/>
|
<Label Content="v3.0 BETA" HorizontalAlignment="Left" Margin="1048,10,0,0" VerticalAlignment="Top" Foreground="#DDFFFFFF" Width="72" Height="24"/>
|
||||||
|
<Button Content="SpaceBypass Mode" HorizontalAlignment="Left" Margin="609,357,0,0" VerticalAlignment="Top" Width="153" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_12" IsTabStop="False" ToolTip="Restarts UWUVCI AIO into SpaceBypass mode." Name="spm"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Page>
|
</Page>
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
parent = mw;
|
parent = mw;
|
||||||
|
spm.Content += "\nThis will most likely fix the Injection Process, if it's stuck before it shows Copy Base";
|
||||||
}
|
}
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
@ -135,6 +135,9 @@ namespace UWUVCI_AIO_WPF.UI.Frames
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Button_Click_12(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
(FindResource("mvm") as MainViewModel).RestartIntoBypass();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,8 +266,12 @@ namespace UWUVCI_AIO_WPF.UI.Windows
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if((FindResource("mvm") as MainViewModel).mw != null)
|
if (!Title.Text.Contains("Warning"))
|
||||||
(FindResource("mvm") as MainViewModel).mw.Topmost = true;
|
{
|
||||||
|
if ((FindResource("mvm") as MainViewModel).mw != null)
|
||||||
|
(FindResource("mvm") as MainViewModel).mw.Topmost = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception )
|
catch (Exception )
|
||||||
{
|
{
|
||||||
|
@ -280,8 +284,11 @@ namespace UWUVCI_AIO_WPF.UI.Windows
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ((FindResource("mvm") as MainViewModel).mw != null)
|
if (!Title.Text.Contains("Warning"))
|
||||||
(FindResource("mvm") as MainViewModel).mw.Topmost = false;
|
{
|
||||||
|
if ((FindResource("mvm") as MainViewModel).mw != null)
|
||||||
|
(FindResource("mvm") as MainViewModel).mw.Topmost = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
|
@ -250,39 +250,60 @@ namespace UWUVCI_AIO_WPF.UI.Windows
|
||||||
return String.Format("{0:0.##} {1}", dblSByte, Suffix[i]);
|
return String.Format("{0:0.##} {1}", dblSByte, Suffix[i]);
|
||||||
}
|
}
|
||||||
private void setup_Click(object sender, RoutedEventArgs e)
|
private void setup_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{if(!(FindResource("mvm") as MainViewModel).saveworkaround)
|
||||||
long injctSize = GetDirectorySize(System.IO.Path.Combine(path, (FindResource("mvm") as MainViewModel).foldername), true);
|
|
||||||
if(injctSize >= new DriveInfo(driveletter).AvailableFreeSpace)
|
|
||||||
{
|
{
|
||||||
long div = injctSize - new DriveInfo(driveletter).AvailableFreeSpace + 1048576;
|
long injctSize = GetDirectorySize(System.IO.Path.Combine(path, (FindResource("mvm") as MainViewModel).foldername), true);
|
||||||
Custom_Message cm = new Custom_Message("Insufficient Space", $" You do not have enough space on the selected drive. \n Please make sure you have at least {FormatBytes(div)} free! ");
|
if (injctSize >= new DriveInfo(driveletter).AvailableFreeSpace)
|
||||||
try
|
|
||||||
{
|
|
||||||
cm.Owner = (FindResource("mvm") as MainViewModel).mw;
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
{
|
||||||
|
long div = injctSize - new DriveInfo(driveletter).AvailableFreeSpace + 1048576;
|
||||||
|
Custom_Message cm = new Custom_Message("Insufficient Space", $" You do not have enough space on the selected drive. \n Please make sure you have at least {FormatBytes(div)} free! ");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
cm.Owner = (FindResource("mvm") as MainViewModel).mw;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
cm.ShowDialog();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dp.Tick += Dp_Tick;
|
||||||
|
dp.Interval = TimeSpan.FromSeconds(1);
|
||||||
|
dp.Start();
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
|
||||||
|
if (gc)
|
||||||
|
{
|
||||||
|
SetupNintendont();
|
||||||
|
}
|
||||||
|
CopyInject();
|
||||||
|
});
|
||||||
|
setup.IsEnabled = false;
|
||||||
}
|
}
|
||||||
cm.ShowDialog();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dp.Tick += Dp_Tick;
|
|
||||||
dp.Interval = TimeSpan.FromSeconds(1);
|
dp.Tick += Dp_Tick;
|
||||||
dp.Start();
|
dp.Interval = TimeSpan.FromSeconds(1);
|
||||||
Task.Run(() =>
|
dp.Start();
|
||||||
{
|
Task.Run(() =>
|
||||||
|
|
||||||
if (gc)
|
|
||||||
{
|
{
|
||||||
SetupNintendont();
|
|
||||||
}
|
if (gc)
|
||||||
CopyInject();
|
{
|
||||||
});
|
SetupNintendont();
|
||||||
setup.IsEnabled = false;
|
}
|
||||||
|
CopyInject();
|
||||||
|
});
|
||||||
|
setup.IsEnabled = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
|
|
||||||
</Grid.Background>
|
</Grid.Background>
|
||||||
<TextBlock Name="tbTitleBar" HorizontalAlignment="Left" Margin="61,19,0,0" TextWrapping="Wrap" Text="UWUVCI AIO - Start" VerticalAlignment="Top" FontSize="25" Width="1075" TextAlignment="Center"/>
|
<TextBlock Name="tbTitleBar" HorizontalAlignment="Left" Margin="61,19,0,0" TextWrapping="Wrap" Text="UWUVCI AIO - Start" VerticalAlignment="Top" FontSize="25" Width="1075" TextAlignment="Center"/>
|
||||||
|
<TextBlock HorizontalAlignment="Left" Margin="61,3,0,0" TextWrapping="Wrap" Text="Space Bypass Mode" VerticalAlignment="Top" ToolTip="Disables all Space checks. May cause issues." Name="spc" Visibility="Hidden"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid x:Name="GridMenu" Width="60" HorizontalAlignment="Left">
|
<Grid x:Name="GridMenu" Width="60" HorizontalAlignment="Left">
|
||||||
<Grid.Background>
|
<Grid.Background>
|
||||||
|
|
|
@ -409,6 +409,21 @@ namespace UWUVCI_AIO_WPF
|
||||||
{
|
{
|
||||||
MainViewModel mvm = FindResource("mvm") as MainViewModel;
|
MainViewModel mvm = FindResource("mvm") as MainViewModel;
|
||||||
mvm.debug = true;
|
mvm.debug = true;
|
||||||
|
spc.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
if (mvm.saveworkaround)
|
||||||
|
{
|
||||||
|
spc.Text = "Debug & Space Bypass Mode";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spc.Text = "Debug Mode";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void allowBypass()
|
||||||
|
{
|
||||||
|
(FindResource("mvm") as MainViewModel).saveworkaround = true;
|
||||||
|
spc.Visibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue