Merge pull request #13 from stuff-by-3-random-dudes/dev

Dev
This commit is contained in:
NicoAICP 2020-12-27 14:58:09 +01:00 committed by GitHub
commit f88ac278dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 84 additions and 52 deletions

View file

@ -8,6 +8,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers; using System.Timers;
using System.Windows; using System.Windows;
using UWUVCI_AIO_WPF.Classes;
using UWUVCI_AIO_WPF.UI.Windows; using UWUVCI_AIO_WPF.UI.Windows;
namespace UWUVCI_AIO_WPF namespace UWUVCI_AIO_WPF
@ -98,12 +99,13 @@ namespace UWUVCI_AIO_WPF
} }
if (Environment.Is64BitOperatingSystem) if (Environment.Is64BitOperatingSystem)
{ {
} }
else else
{ {
//wnd.is32(); //wnd.is32();
Custom_Message cm = new Custom_Message("Warning", "Some features may cause issues on a 32Bit System. Upgrading to 64Bit would be recommended. \nReport any issues in the UWUVCI Discord, or ping @NicoAICP in #wiiu-assistance in the Nintendo Homebrew discord. "); Custom_Message cm = new Custom_Message("Warning", "Some features may cause issues on a 32Bit System. Upgrading to 64Bit would be recommended.\nDue to an Issue with packing on 32Bit Systems, you need Java installed for packing. \nReport any issues in the UWUVCI Discord, or ping @NicoAICP in #wiiu-assistance in the Nintendo Homebrew discord. ");
cm.ShowDialog(); cm.ShowDialog();
} }

View file

@ -1682,7 +1682,7 @@ namespace UWUVCI_AIO_WPF
mvvm.foldername = $"[WUP]{reg.Replace(gameName, "").Replace("|", " ")}_{i}"; mvvm.foldername = $"[WUP]{reg.Replace(gameName, "").Replace("|", " ")}_{i}";
i++; i++;
} }
var oldpath = Directory.GetCurrentDirectory();
mvm.Progress = 40; mvm.Progress = 40;
mvm.msg = "Packing..."; mvm.msg = "Packing...";
using (Process cnuspacker = new Process()) using (Process cnuspacker = new Process())
@ -1692,12 +1692,19 @@ namespace UWUVCI_AIO_WPF
cnuspacker.StartInfo.UseShellExecute = false; cnuspacker.StartInfo.UseShellExecute = false;
cnuspacker.StartInfo.CreateNoWindow = true; cnuspacker.StartInfo.CreateNoWindow = true;
} }
if (Environment.Is64BitOperatingSystem)
cnuspacker.StartInfo.FileName = Path.Combine(toolsPath, "CNUSPACKER.exe"); {
cnuspacker.StartInfo.Arguments = $"-in \"{baseRomPath}\" -out \"{outputPath}\" -encryptKeyWith {Properties.Settings.Default.Ckey}"; cnuspacker.StartInfo.FileName = Path.Combine(toolsPath, "CNUSPACKER.exe");
cnuspacker.StartInfo.Arguments = $"-in \"{baseRomPath}\" -out \"{outputPath}\" -encryptKeyWith {Properties.Settings.Default.Ckey}";
}
else
{
cnuspacker.StartInfo.FileName = "java";
cnuspacker.StartInfo.Arguments = $"-jar \"{Path.Combine(toolsPath, "NUSPacker.jar")}\" -in \"{baseRomPath}\" -out \"{outputPath}\" -encryptKeyWith {Properties.Settings.Default.Ckey}";
}
cnuspacker.Start(); cnuspacker.Start();
cnuspacker.WaitForExit(); cnuspacker.WaitForExit();
Directory.SetCurrentDirectory(oldpath);
} }
mvm.Progress = 90; mvm.Progress = 90;
mvm.msg = "Cleaning..."; mvm.msg = "Cleaning...";

View file

@ -506,8 +506,15 @@ namespace UWUVCI_AIO_WPF
} }
public MainViewModel() public MainViewModel()
{ {
if (!Environment.Is64BitOperatingSystem)
{
List<string> Tools = ToolCheck.ToolNames.ToList();
Tools.Remove("CNUSPACKER.exe");
Tools.Add("NUSPacker.jar");
ToolCheck.ToolNames = Tools.ToArray();
}
//if (Directory.Exists(@"Tools")) Directory.Delete(@"Tools", true); //if (Directory.Exists(@"Tools")) Directory.Delete(@"Tools", true);
if (Directory.Exists(@"bases")) Directory.Delete(@"bases", true); if (Directory.Exists(@"bases")) Directory.Delete(@"bases", true);
if (Directory.Exists(@"temp")) Directory.Delete(@"temp", true); if (Directory.Exists(@"temp")) Directory.Delete(@"temp", true);
@ -1807,7 +1814,7 @@ namespace UWUVCI_AIO_WPF
} }
else else
{ {
return $@"https://github.com/Hotbrawl20/UWUVCI-VCB/raw/master/" + toolname; return $@"https://github.com/Hotbrawl20/UWUVCI-VCB/raw/master/" + toolname.Replace("bin\\bases\\", "");
} }
} }
@ -1821,7 +1828,7 @@ namespace UWUVCI_AIO_WPF
} }
else else
{ {
return $@"https://github.com/Hotbrawl20/UWUVCI-VCB/raw/master/" + toolname; return $@"https://github.com/Hotbrawl20/UWUVCI-VCB/raw/master/" + toolname.Replace("bin\\bases\\","");
} }
} }
@ -1869,7 +1876,16 @@ namespace UWUVCI_AIO_WPF
foreach (MissingTool m in missingTools) foreach (MissingTool m in missingTools)
{ {
DownloadTool(m.Name,this); if(m.Name == "blank.ini")
{
StreamWriter sw = new StreamWriter(Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools", "blank.ini"));
sw.Close();
}
else
{
DownloadTool(m.Name, this);
}
Progress += Convert.ToInt32(l); Progress += Convert.ToInt32(l);
} }
Progress = 100; Progress = 100;
@ -3658,26 +3674,7 @@ namespace UWUVCI_AIO_WPF
{ {
WebRequest request; WebRequest request;
//get download link from uwuvciapi //get download link from uwuvciapi
try
{
request = WebRequest.Create("https://uwuvciapi.azurewebsites.net/GetURL?cns=" + console.ToLower());
var response = request.GetResponse();
using (Stream dataStream = response.GetResponseStream())
{
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
// Display the content.
return responseFromServer;
}
}
catch (Exception)
{
string url = ""; string url = "";
switch (console.ToLower()) switch (console.ToLower())
{ {
@ -3717,22 +3714,7 @@ namespace UWUVCI_AIO_WPF
url = null; url = null;
break; break;
} }
request = WebRequest.Create(url + console.ToLower()); return url;
var response = request.GetResponse();
using (Stream dataStream = response.GetResponseStream())
{
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
// Display the content.
return responseFromServer;
}
}
} }
WaveOutEvent waveOutEvent = new WaveOutEvent(); WaveOutEvent waveOutEvent = new WaveOutEvent();

View file

@ -0,0 +1,28 @@
namespace UWUVCI_AIO_WPF.Properties {
// Diese Klasse ermöglicht die Behandlung bestimmter Ereignisse der Einstellungsklasse:
// Das SettingChanging-Ereignis wird ausgelöst, bevor der Wert einer Einstellung geändert wird.
// Das PropertyChanged-Ereignis wird ausgelöst, nachdem der Wert einer Einstellung geändert wurde.
// Das SettingsLoaded-Ereignis wird ausgelöst, nachdem die Einstellungswerte geladen wurden.
// Das SettingsSaving-Ereignis wird ausgelöst, bevor die Einstellungswerte gespeichert werden.
internal sealed partial class Settings {
public Settings() {
// // Heben Sie die Auskommentierung der unten angezeigten Zeilen auf, um Ereignishandler zum Speichern und Ändern von Einstellungen hinzuzufügen:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// Fügen Sie hier Code zum Behandeln des SettingChangingEvent-Ereignisses hinzu.
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// Fügen Sie hier Code zum Behandeln des SettingsSaving-Ereignisses hinzu.
}
}
}

View file

@ -46,7 +46,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"/>
<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 15" HorizontalAlignment="Left" Margin="1039,10,0,0" VerticalAlignment="Top" Foreground="#DDFFFFFF" Width="81" Height="24"/>
</Grid> </Grid>

View file

@ -9,7 +9,7 @@
Title="Teaser" > Title="Teaser" >
<Grid> <Grid>
<TextBlock x:Name="tb" TextWrapping="Wrap" Text="Under Construction " FontSize="20" Height="29" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Width="1110" /> <TextBlock x:Name="tb" TextWrapping="Wrap" Text="Under Construction " FontSize="20" Height="28" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Width="179" PreviewMouseLeftButtonDown="tb_PreviewMouseLeftButtonDown" Margin="467,282,489,290" Cursor="Hand"/>
<Image Source="/UI/Images/rarch.png" Opacity="0.1" Margin="997,473,23,10"/> <Image Source="/UI/Images/rarch.png" Opacity="0.1" Margin="997,473,23,10"/>
</Grid> </Grid>

View file

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -24,5 +25,10 @@ namespace UWUVCI_AIO_WPF.UI.Frames
{ {
InitializeComponent(); InitializeComponent();
} }
private void tb_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Process.Start("https://www.reddit.com/r/WiiUHacks/comments/jchcls/poc_retroarch_autoboot_starts_rom_automatically/");
}
} }
} }

View file

@ -169,7 +169,7 @@
<Button HorizontalAlignment="Left" Margin="1159,38,0,0" Height="20" VerticalAlignment="Top" Width="21" Background="Transparent" BorderBrush="Transparent" Foreground="Transparent" Click="settings_Click" FontSize="22" Padding="0" Name="settings" IsTabStop="False"> <Button HorizontalAlignment="Left" Margin="1159,38,0,0" Height="20" VerticalAlignment="Top" Width="21" Background="Transparent" BorderBrush="Transparent" Foreground="Transparent" Click="settings_Click" FontSize="22" Padding="0" Name="settings" IsTabStop="False">
<Image Source="/UI/Images/cogwheel.png" Height="20" Width="16"/> <Image Source="/UI/Images/cogwheel.png" Height="20" Width="16"/>
</Button> </Button>
<Button HorizontalAlignment="Left" Margin="1080,38,0,0" Height="20" VerticalAlignment="Top" Background="Transparent" BorderBrush="White" FontSize="14" Padding="0" Name="vwiiMode" IsTabStop="False" Content=" vWii Mode " > <Button HorizontalAlignment="Left" Margin="1080,38,0,0" Height="20" VerticalAlignment="Top" Background="Transparent" BorderBrush="White" FontSize="14" Padding="0" Name="vwiiMode" IsTabStop="False" Content=" vWii Mode " Click="vwiiMode_Click">
</Button> </Button>
</Grid> </Grid>

View file

@ -11,6 +11,7 @@ using GameBaseClassLibrary;
using UWUVCI_AIO_WPF.UI.Frames.Path; using UWUVCI_AIO_WPF.UI.Frames.Path;
using System.IO; using System.IO;
using NAudio.Wave; using NAudio.Wave;
using System.Diagnostics;
namespace UWUVCI_AIO_WPF namespace UWUVCI_AIO_WPF
{ {
@ -505,5 +506,11 @@ namespace UWUVCI_AIO_WPF
tbTitleBar.Text = "UWUVCI AIO - Settings"; tbTitleBar.Text = "UWUVCI AIO - Settings";
load_frame.Content = new SettingsFrame(this); load_frame.Content = new SettingsFrame(this);
} }
private void vwiiMode_Click(object sender, RoutedEventArgs e)
{
Process.Start("UWUVCI VWII.exe");
Environment.Exit(0);
}
} }
} }

View file

@ -103,7 +103,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
throw new Exception(); throw new Exception();
} }
} }
catch (Exception) catch (Exception e)
{ {
Custom_Message cm = new Custom_Message("Not Implemented", $"The Helppage for {url.ToUpper()} is not implemented yet"); Custom_Message cm = new Custom_Message("Not Implemented", $"The Helppage for {url.ToUpper()} is not implemented yet");
try try