New Loading

This commit is contained in:
NicoAICP 2020-04-17 19:15:27 +02:00
parent a2e71aeb0d
commit 5b2a4f70f1
5 changed files with 104 additions and 24 deletions

View file

@ -539,7 +539,13 @@ namespace UWUVCI_AIO_WPF
Task.Run(() => { Injection.Packing(GameConfiguration.GameName, this); });
new DownloadWait("Packing Inject - Please Wait", "",this).ShowDialog();
DownloadWait dw = new DownloadWait("Packing Inject - Please Wait", "", this);
try
{
dw.Owner = mw;
}
catch (Exception) { }
dw.ShowDialog();
Progress = 0;
string extra = "";
if (GameConfiguration.Console == GameConsoles.WII) extra = "\nSome games cannot reboot into the WiiU Menu. Shut down via the GamePad.\nIf Stuck in a BlackScreen, you need to unplug your WiiU.";
@ -571,7 +577,14 @@ namespace UWUVCI_AIO_WPF
var task = new Task(() => runInjectThread(force));
task.Start();
new DownloadWait("Injecting Game - Please Wait", "",this).ShowDialog();
DownloadWait dw = new DownloadWait("Injecting Game - Please Wait", "",this);
try
{
dw.Owner = mw;
}
catch (Exception) { }
dw.ShowDialog();
if (Injected)
{
new Custom_Message("Finished Injection Part", "Injection Finished, please choose how you want to export the Inject next.").ShowDialog();
@ -596,7 +609,14 @@ namespace UWUVCI_AIO_WPF
}
Progress = 100;
});
new DownloadWait("Downloading needed Data - Please Wait", "",this).ShowDialog();
DownloadWait dw = new DownloadWait("Downloading needed Data - Please Wait", "", this);
try
{
dw.Owner = mw;
}
catch (Exception) { }
dw.ShowDialog();
BaseCheck();
@ -619,7 +639,13 @@ namespace UWUVCI_AIO_WPF
}
Progress = 100;
});
new DownloadWait("Downloading needed Data - Please Wait", "",this).ShowDialog();
DownloadWait dw = new DownloadWait("Downloading needed Data - Please Wait", "",this);
try
{
dw.Owner = mw;
}
catch (Exception) { }
dw.ShowDialog();
BaseCheck();
}
@ -640,7 +666,17 @@ namespace UWUVCI_AIO_WPF
}
Progress = 100;
});
new DownloadWait("Updating Tools - Please Wait", "", this).ShowDialog();
DownloadWait dw = new DownloadWait("Updating Tools - Please Wait", "", this);
try
{
dw.Owner = mw;
}
catch (Exception)
{
}
dw.ShowDialog();
new Custom_Message("Finished Updating Tools! Restarting UWUVCI AIO", "Finished Update").ShowDialog();
System.Diagnostics.Process.Start(System.Windows.Application.ResourceAssembly.Location);
Environment.Exit(0);
@ -692,7 +728,17 @@ namespace UWUVCI_AIO_WPF
}
Progress = 100;
});
new DownloadWait("Updating Base Files - Please Wait", "", this).ShowDialog();
DownloadWait dw = new DownloadWait("Updating Base Files - Please Wait", "", this);
try
{
dw.Owner = mw;
}
catch (Exception)
{
}
dw.ShowDialog();
new Custom_Message("Finished Updating", "Finished Updating Bases! Restarting UWUVCI AIO").ShowDialog();
System.Diagnostics.Process.Start(System.Windows.Application.ResourceAssembly.Location);
Environment.Exit(0);
@ -993,25 +1039,39 @@ namespace UWUVCI_AIO_WPF
}
}
private void ThreadDownload(List<MissingTool> missingTools)
{
var thread = new Thread(() =>
{
double l = 100 / missingTools.Count;
foreach (MissingTool m in missingTools)
{
DownloadTool(m.Name);
Progress += Convert.ToInt32(l);
}
Progress = 100;
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
private void toolCheck()
{
if (ToolCheck.DoesToolsFolderExist())
{
List<MissingTool> missingTools = new List<MissingTool>();
missingTools = ToolCheck.CheckForMissingTools();
if(missingTools.Count > 0)
{
foreach (MissingTool m in missingTools)
{
DownloadTool(m.Name);
}
//Download Tools
Task.Run(() => ThreadDownload(missingTools));
new DownloadWait("Downloading Tools - Please Wait", "", this).ShowDialog();
Thread.Sleep(200);
//Download Tools
Progress = 0;
toolCheck();
}
@ -1371,7 +1431,13 @@ namespace UWUVCI_AIO_WPF
{
Task.Run(() => { Injection.Download(this); });
new DownloadWait("Downloading Base - Please Wait", "", this).ShowDialog();
DownloadWait dw = new DownloadWait("Downloading Base - Please Wait", "", this);
try
{
dw.Owner = mw;
}
catch (Exception) { }
dw.ShowDialog();
Progress = 0;
}

View file

@ -20,7 +20,7 @@
</Grid.RowDefinitions>
<TextBlock HorizontalAlignment="Left" Margin="7,2,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="32" Width="618" FontSize="18" Foreground="Black" Name="Title" Grid.ColumnSpan="2" Grid.Row="0"/>
<Label HorizontalAlignment="Left" Margin="2,10,0,0" VerticalAlignment="Top" Height="Auto" Width="Auto" FontSize="18" Foreground="Black" x:Name="Message" HorizontalContentAlignment="Left" Content="" VerticalContentAlignment="Center" Grid.Row="1" />
<Label HorizontalAlignment="Left" Margin="2,10,0,0" VerticalAlignment="Top" Height="Auto" Width="Auto" FontSize="15" Foreground="Black" x:Name="Message" HorizontalContentAlignment="Left" Content="" VerticalContentAlignment="Center" Grid.Row="1" Grid.ColumnSpan="3"/>
<Button Content="Close" HorizontalAlignment="Left" Margin="7,8,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click" RenderTransformOrigin="0.5,0.5" Grid.Row="2" Grid.Column="2"/>
<Button Content="Open Folder" HorizontalAlignment="Left" Margin="5,8,0,0" VerticalAlignment="Top" Width="121" Name="Folder" Click="Folder_Click" RenderTransformOrigin="1,1" Grid.Row="2" Grid.Column="1"/>
<Button Content="Continue" HorizontalAlignment="Left" Margin="5,8,0,0" VerticalAlignment="Top" Width="121" x:Name="Reset" Click="Reset_Click" RenderTransformOrigin="1,1" Grid.Row="2" Grid.Column="1" Visibility="Hidden"/>

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -56,7 +57,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void Folder_Click(object sender, RoutedEventArgs e)
{
Process.Start(path);
Process.Start(new FileInfo(path).DirectoryName);
this.Close();
}

View file

@ -8,12 +8,17 @@
mc:Ignorable="d"
Title="MAIN" Height="160.656" Width="500" WindowStyle="None" WindowStartupLocation="CenterScreen" Foreground="White" Background="LightGray" ResizeMode="NoResize" Icon="/UWUVCI AIO WPF;component/a.ico">
<Grid DataContext="{StaticResource mvm}">
<Button Content="Check" HorizontalAlignment="Left" Margin="405,104,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_1"/>
<Button Content="Abort" HorizontalAlignment="Left" Margin="284,104,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
<TextBlock HorizontalAlignment="Left" Margin="53,10,0,0" TextWrapping="Wrap" Text="{Binding GbTemp.Name}" VerticalAlignment="Top" Height="25" Width="437" FontSize="18" Foreground="Black" Name="Key"/>
<TextBox Name="tbKey" materialDesign:HintAssist.Hint="ENTER KEY" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,35,20,78" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18"/>
<Button Content="Check" HorizontalAlignment="Left" Margin="315,104,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_1"/>
<Button Content="Abort" HorizontalAlignment="Left" Margin="405,104,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
<StackPanel Margin="10,10,10,126" Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="{Binding GbTemp.Region}" VerticalAlignment="Top" Height="25" Width="43" FontSize="18" Foreground="Black" Name="region"/>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding GbTemp.Region}" VerticalAlignment="Top" Height="25" Width="Auto" FontSize="18" Foreground="Black" x:Name="region"/>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text=" " VerticalAlignment="Top" Height="25" Width="Auto" FontSize="18" Foreground="Black"/>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding GbTemp.Name}" VerticalAlignment="Top" Height="25" Width="Auto" FontSize="18" Foreground="Black" x:Name="Key"/>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text=" " VerticalAlignment="Top" Height="25" Width="Auto" FontSize="18" Foreground="Black"/>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Height="25" Width="Auto" FontSize="18" Foreground="Black" x:Name="ID"/>
</StackPanel>
<TextBox Name="tbKey" materialDesign:HintAssist.Hint="ENTER KEY" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,35,20,78" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18"/>
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="161" VerticalAlignment="Top" Width="500"/>
</Grid>
</Window>

View file

@ -27,11 +27,19 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
InitializeComponent();
this.ckey = ckey;
if (ckey)
{
Key.Text = "CommonKey";
region.Text = "WIIU";
}
else
{
if ((FindResource("mvm") as MainViewModel).GbTemp.Tid != "")
{
ID.Text = $"({(FindResource("mvm") as MainViewModel).GbTemp.Tid})";
}
}
}
public EnterKey(int i)