too much to explain, injections work, thats the important thing

This commit is contained in:
NicoAICP 2020-04-18 05:31:36 +02:00
parent 5b2a4f70f1
commit db2a39deff
23 changed files with 537 additions and 192 deletions

View file

@ -6,7 +6,9 @@ using System.IO;
using System.IO.Compression;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using System.Xml;
using UWUVCI_AIO_WPF.Classes;
using UWUVCI_AIO_WPF.Properties;
@ -40,15 +42,20 @@ namespace UWUVCI_AIO_WPF
* iniPath = Only used for N64. Path to the INI configuration. If "blank", a blank ini will be used.
* darkRemoval = Only used for N64. Indicates whether the dark filter should be removed.
*/
[STAThread]
public static bool Inject(GameConfig Configuration, string RomPath, MainViewModel mvm, bool force)
{
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
{
@ -117,11 +124,18 @@ namespace UWUVCI_AIO_WPF
mvm.Index = -1;
mvm.LR = false;
mvm.msg = "";
mvm.Progress = 0;
}
}
static void timer_Tick(object sender, EventArgs e)
{
if(mvvm.Progress < 50)
{
mvvm.Progress += 5;
}
}
private static void RunSpecificInjection(GameConfig cfg, GameConsoles console, string RomPath, bool force, MainViewModel mvm)
{
switch (console)
@ -238,12 +252,16 @@ namespace UWUVCI_AIO_WPF
mvvm.msg = "Video Patching ROM...";
using (Process process = new Process())
{
process.StartInfo.FileName = "wii-vmc.exe";
process.StartInfo.FileName = Path.Combine(toolsPath,"wii-vmc.exe");
process.StartInfo.Arguments = $"\"{Path.Combine(tempPath, "IsoExt", "sys", "main.dol")}\"";
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.Start();
Thread.Sleep(2000);
process.StandardInput.WriteLine("a");
Thread.Sleep(2000);
if (mvm.toPal)
{
process.StandardInput.WriteLine("1");
@ -252,9 +270,10 @@ namespace UWUVCI_AIO_WPF
{
process.StandardInput.WriteLine("2");
}
Thread.Sleep(200);
Thread.Sleep(2000);
process.StandardInput.WriteLine();
process.WaitForExit();
}
mvvm.Progress = 50;
@ -298,10 +317,12 @@ namespace UWUVCI_AIO_WPF
mvm.Progress = 40;
mvvm.msg = "Injecting GameCube Game into NintendontBase...";
File.Copy(romPath, Path.Combine(tempPath, "TempBase", "files", "game.iso"));
Thread.Sleep(6000);
tik.StartInfo.FileName = Path.Combine(toolsPath, "wit.exe");
tik.StartInfo.Arguments = $"copy \"{Path.Combine(tempPath, "TempBase")}\" --DEST \"{Path.Combine(tempPath, "game.iso")}\" -ovv --links --iso";
tik.Start();
tik.WaitForExit();
Thread.Sleep(6000);
if (!File.Exists(Path.Combine(tempPath, "game.iso")))
{
Console.Clear();
@ -336,6 +357,7 @@ namespace UWUVCI_AIO_WPF
}
Console.WriteLine("Finished Copying");
mvvm.Progress = 70;
Thread.Sleep(6000);
mvvm.msg = "Injecting ROM...";
Console.WriteLine("Converting Game to NFS format...");
string olddir = Directory.GetCurrentDirectory();
@ -491,13 +513,14 @@ namespace UWUVCI_AIO_WPF
mvm.InjcttoolCheck();
GameBases b = mvm.getBasefromName(mvm.SelectedBaseAsString);
//GetKeyOfBase
TKeys key = mvm.getTkey(b);
if (mvm.GameConfiguration.Console == GameConsoles.WII || mvm.GameConfiguration.Console == GameConsoles.GCN)
{
using (Process zip = new Process())
{
if (Directory.Exists(tempPath)) Directory.Delete(tempPath, true);
Directory.CreateDirectory(tempPath);
using (Process download = new Process())
@ -514,7 +537,8 @@ namespace UWUVCI_AIO_WPF
download.Start();
download.WaitForExit();
}
mvm.Progress += 10;
mvm.Progress = 75;
using (Process decrypt = new Process())
{
if (!mvm.debug)
@ -531,9 +555,9 @@ namespace UWUVCI_AIO_WPF
}
mvm.Progress += 10;
File.Delete(Path.Combine(Properties.Settings.Default.BasePath, $"{b.Name.Replace(":", "")} [{b.Region.ToString()}]","code","fw.img"));
mvm.Progress += 10;
File.Delete(Path.Combine(Properties.Settings.Default.BasePath, $"{b.Name.Replace(":", "")} [{b.Region.ToString()}]", "code", "fw.tmd"));
mvm.Progress += 10;
if (Directory.Exists(Path.Combine(toolsPath, "IKVM"))) { Directory.Delete(Path.Combine(toolsPath, "IKVM"), true); }
if (!mvm.debug)
{
@ -548,18 +572,17 @@ namespace UWUVCI_AIO_WPF
mvm.Progress += 10;
string[] JNUSToolConfig = { "http://ccs.cdn.wup.shop.nintendo.net/ccs/download", Properties.Settings.Default.Ckey };
string savedir = Directory.GetCurrentDirectory();
mvm.Progress += 5;
File.WriteAllLines(Path.Combine(toolsPath, "IKVM", "config"), JNUSToolConfig);
Directory.SetCurrentDirectory(Path.Combine(toolsPath, "IKVM"));
zip.StartInfo.FileName = "JNUSTool.exe";
zip.StartInfo.Arguments = $"{b.Tid} {key.Tkey} -file /code/fw.img";
zip.Start();
zip.WaitForExit();
mvm.Progress += 10;
zip.StartInfo.Arguments = $"{b.Tid} {key.Tkey} -file /code/fw.tmd";
zip.Start();
zip.WaitForExit();
mvm.Progress += 5;
Directory.SetCurrentDirectory(savedir);
var directories = Directory.GetDirectories(Path.Combine(toolsPath, "IKVM"));
string name = "";
@ -574,17 +597,17 @@ namespace UWUVCI_AIO_WPF
}
File.Copy(Path.Combine(toolsPath, "IKVM", name, "code", "fw.img"), Path.Combine(Properties.Settings.Default.BasePath, $"{b.Name.Replace(":", "")} [{b.Region.ToString()}]","code","fw.img"));
mvm.Progress += 10;
File.Copy(Path.Combine(toolsPath, "IKVM", name, "code", "fw.tmd"), Path.Combine(Properties.Settings.Default.BasePath, $"{b.Name.Replace(":", "")} [{b.Region.ToString()}]", "code", "fw.tmd"));
mvm.Progress += 10;
Directory.Delete(Path.Combine(toolsPath, "IKVM"), true);
mvm.Progress += 10;
mvm.Progress += 5;
}
}
else
{
if (Directory.Exists(tempPath)) Directory.Delete(tempPath, true);
Directory.CreateDirectory(tempPath);
@ -601,7 +624,7 @@ namespace UWUVCI_AIO_WPF
download.Start();
download.WaitForExit();
}
mvm.Progress += 50;
mvm.Progress = 75;
using (Process decrypt = new Process())
{
if (!mvm.debug)
@ -615,7 +638,7 @@ namespace UWUVCI_AIO_WPF
decrypt.Start();
decrypt.WaitForExit();
}
mvm.Progress += 50;
mvm.Progress =100;
}
//GetCurrentSelectedBase

View file

@ -20,6 +20,8 @@ using UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations;
using UWUVCI_AIO_WPF.UI.Windows;
using AutoUpdaterDotNET;
using System.Threading;
using System.Windows.Threading;
using System.Diagnostics;
namespace UWUVCI_AIO_WPF
{
@ -273,8 +275,14 @@ namespace UWUVCI_AIO_WPF
public MainWindow mw;
private CustomBaseFrame cb = null;
public void Update()
DispatcherTimer timer = new DispatcherTimer();
Thread injct;
public void Update(bool button)
{
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion;
AutoUpdater.Start("https://raw.githubusercontent.com/Hotbrawl20/testing/master/update.xml");
if (Properties.Settings.Default.UpgradeRequired)
{
@ -282,10 +290,58 @@ namespace UWUVCI_AIO_WPF
Properties.Settings.Default.UpgradeRequired = false;
Properties.Settings.Default.Save();
}
if (button && Convert.ToInt32(version.Split('.')[3]) >= GetNewVersion())
{
Custom_Message cm = new Custom_Message("No Updates available", "You are currently using the newest version of UWUVCI AIO");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
}
public void OpenDialog(string title, string msg)
private int GetNewVersion()
{
new Custom_Message(title, msg).ShowDialog();
try
{
WebRequest request;
//get download link from uwuvciapi
request = WebRequest.Create("https://uwuvciapi.azurewebsites.net/GetVersionNum");
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 Convert.ToInt32(responseFromServer);
}
}
catch (Exception)
{
return 100000;
}
}
public void OpenDialog(string title, string msg)
{
Custom_Message cm = new Custom_Message(title, msg);
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
public MainViewModel()
{
@ -315,7 +371,7 @@ namespace UWUVCI_AIO_WPF
Settings.Default.Save();
ArePathsSet();
Update();
Update(false);
toolCheck();
BaseCheck();
@ -332,7 +388,13 @@ namespace UWUVCI_AIO_WPF
public string turbocd()
{
string ret = string.Empty;
new Custom_Message("Information", "Please put a TurboGraf CD ROM into a folder and select said folder.\n\nThe Folder should atleast contain:\nEXACTLY ONE *.hcd file\nOne or more *.ogg files\nOne or More *.bin files\n\nNot doing so will result in a faulty Inject. You have been warned!").ShowDialog();
Custom_Message cm = new Custom_Message("Information", "Please put a TurboGraf CD ROM into a folder and select said folder.\n\nThe Folder should atleast contain:\nEXACTLY ONE *.hcd file\nOne or more *.ogg files\nOne or More *.bin files\n\nNot doing so will result in a faulty Inject. You have been warned!");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
using (var dialog = new FolderBrowserDialog())
{
@ -344,13 +406,25 @@ namespace UWUVCI_AIO_WPF
{
if (DirectoryIsEmpty(dialog.SelectedPath))
{
new Custom_Message("Issue", "The folder is Empty. Please choose another folder").ShowDialog();
cm = new Custom_Message("Issue", "The folder is Empty. Please choose another folder");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
else
{
if (Directory.GetDirectories(dialog.SelectedPath).Length > 0)
{
new Custom_Message("Issue", "This folder mustn't contain any subfolders.").ShowDialog();
cm = new Custom_Message("Issue", "This folder mustn't contain any subfolders.");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
else
@ -362,8 +436,14 @@ namespace UWUVCI_AIO_WPF
}
else
{
new Custom_Message("Issue", "This Folder does not contain needed minimum of Files").ShowDialog();
cm = new Custom_Message("Issue", "This Folder does not contain needed minimum of Files");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
}
@ -424,8 +504,14 @@ namespace UWUVCI_AIO_WPF
formatter.Serialize(compressedStream, GameConfiguration);
compressedStream.Close();
createConfigStream.Close();
new Custom_Message("Export success", "The Config was successfully exported.\nClick the Open Folder Button to open the Location where the Config is stored.", Path.Combine(Directory.GetCurrentDirectory(), outputPath)).ShowDialog();
}
Custom_Message cm = new Custom_Message("Export success", "The Config was successfully exported.\nClick the Open Folder Button to open the Location where the Config is stored.", Path.Combine(Directory.GetCurrentDirectory(), outputPath));
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
public void ImportConfig(string configPath)
{
FileInfo fn = new FileInfo(configPath);
@ -551,7 +637,13 @@ namespace UWUVCI_AIO_WPF
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.";
if (GC) extra = "\nMake sure to have Nintendon't + config on your SD.\nYou can add them under Settings -> \"Start Nintendont Config Tool\".";
new Custom_Message("Injection Complete", $"Only Install to USB!{extra}\nConfig will stay filled, choose a Console again to clear it!\nTo Open the Location of the Inject press Open Folder.", Settings.Default.OutPath).ShowDialog();
Custom_Message cm = new Custom_Message("Injection Complete", $"Only Install to USB!{extra}\nConfig will stay filled, choose a Console again to clear it!\nTo Open the Location of the Inject press Open Folder.", Settings.Default.OutPath);
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
LGameBasesString.Clear();
CanInject = false;
@ -561,35 +653,56 @@ namespace UWUVCI_AIO_WPF
GameConfiguration.CBasePath = null;
GC = false;
}
[STAThread]
DownloadWait Injectwait;
public void runInjectThread(bool force)
{
timer.Interval = TimeSpan.FromSeconds(1);
timer.Tick += timer_Tick2;
timer.Start();
var thread = new Thread(() =>
{
Injectwait =new DownloadWait("Injecting Game - Please Wait", "", this);
try
{
Injectwait.Owner = mw;
}
catch (Exception) { }
Injectwait.Topmost = true;
Injectwait.ShowDialog();
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
public void Inject(bool force)
{
/* var task = new Task(() => runInjectThread(true));
task.Start();*/
Task.Run(() =>
{
if (Injection.Inject(GameConfiguration, RomPath, this, force)) Injected = true;
else Injected = false;
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
public void Inject(bool force)
{
var task = new Task(() => runInjectThread(force));
task.Start();
DownloadWait dw = new DownloadWait("Injecting Game - Please Wait", "",this);
try
{
dw.Owner = mw;
}
catch (Exception) { }
dw.ShowDialog();
new DownloadWait("Injecting Game - Please Wait", "", this).ShowDialog();
Progress = 0;
if (Injected)
{
new Custom_Message("Finished Injection Part", "Injection Finished, please choose how you want to export the Inject next.").ShowDialog();
Custom_Message cm = new Custom_Message("Finished Injection Part", "Injection Finished, please choose how you want to export the Inject next.");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
}
private void BaseCheck()
{
@ -604,7 +717,7 @@ namespace UWUVCI_AIO_WPF
double stuff = 100 / test.Count;
foreach (string s in test)
{
DownloadBase(s);
DownloadBase(s, this);
Progress += Convert.ToInt32(stuff);
}
Progress = 100;
@ -634,7 +747,7 @@ namespace UWUVCI_AIO_WPF
double stuff = 100 / test.Count;
foreach (string s in test)
{
DownloadBase(s);
DownloadBase(s, this);
Progress += Convert.ToInt32(stuff);
}
Progress = 100;
@ -646,6 +759,7 @@ namespace UWUVCI_AIO_WPF
}
catch (Exception) { }
dw.ShowDialog();
Progress = 0;
BaseCheck();
}
@ -661,7 +775,7 @@ namespace UWUVCI_AIO_WPF
foreach (string s in bases)
{
DeleteTool(s);
DownloadTool(s);
DownloadTool(s,this);
Progress += Convert.ToInt32(l);
}
Progress = 100;
@ -677,13 +791,25 @@ namespace UWUVCI_AIO_WPF
}
dw.ShowDialog();
new Custom_Message("Finished Updating Tools! Restarting UWUVCI AIO", "Finished Update").ShowDialog();
Custom_Message cm = new Custom_Message("Finished Update","Finished Updating Tools! Restarting UWUVCI AIO" );
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
System.Diagnostics.Process.Start(System.Windows.Application.ResourceAssembly.Location);
Environment.Exit(0);
}
public void ResetTKQuest()
{
new Custom_Message("Resetting TitleKeys", "This Option will reset all entered TitleKeys meaning you will need to reenter them again!\nDo you still wish to continue?").ShowDialog();
Custom_Message cm = new Custom_Message("Resetting TitleKeys", "This Option will reset all entered TitleKeys meaning you will need to reenter them again!\nDo you still wish to continue?");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog(); ;
}
public void ResetTitleKeys()
@ -696,8 +822,14 @@ namespace UWUVCI_AIO_WPF
File.Delete("bin/keys/tg16.vck");
File.Delete("bin/keys/snes.vck");
File.Delete("bin/keys/wii.vck");
new Custom_Message("Reset Successfull", "The TitleKeys are now reseted.\nThe Programm will now restart.").ShowDialog();
System.Diagnostics.Process.Start(System.Windows.Application.ResourceAssembly.Location);
Custom_Message cm = new Custom_Message("Reset Successfull", "The TitleKeys are now reseted.\nThe Programm will now restart.");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
System.Diagnostics.Process.Start(System.Windows.Application.ResourceAssembly.Location);
Environment.Exit(0);
@ -712,7 +844,7 @@ namespace UWUVCI_AIO_WPF
foreach (string s in bases)
{
DeleteBase(s);
DownloadBase(s);
DownloadBase(s, this);
GameConsoles g = new GameConsoles();
if (s.Contains("nds")) g = GameConsoles.NDS;
@ -739,7 +871,13 @@ namespace UWUVCI_AIO_WPF
}
dw.ShowDialog();
new Custom_Message("Finished Updating", "Finished Updating Bases! Restarting UWUVCI AIO").ShowDialog();
Custom_Message cm = new Custom_Message("Finished Updating", "Finished Updating Bases! Restarting UWUVCI AIO");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
System.Diagnostics.Process.Start(System.Windows.Application.ResourceAssembly.Location);
Environment.Exit(0);
@ -799,11 +937,23 @@ namespace UWUVCI_AIO_WPF
if (GetConsoleOfConfig(ret, console))
{
ImportConfig(ret);
new Custom_Message("Import Complete", "Importing of Config completed.\nPlease reselect a Base!").ShowDialog();
Custom_Message cm = new Custom_Message("Import Complete", "Importing of Config completed.\nPlease reselect a Base!");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
else
{
new Custom_Message("Import Failed", $"The config you are trying to import is not made for {console.ToString()} Injections. \nPlease choose a config made for these kind of Injections or choose a different kind of Injection").ShowDialog();
Custom_Message cm = new Custom_Message("Import Failed", $"The config you are trying to import is not made for {console.ToString()} Injections. \nPlease choose a config made for these kind of Injections or choose a different kind of Injection");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
}
}
@ -812,15 +962,28 @@ namespace UWUVCI_AIO_WPF
public string GetFilePath(bool ROM, bool INI)
{
Custom_Message cm;
string ret = string.Empty;
switch (GameConfiguration.Console)
{
case GameConsoles.NDS:
new Custom_Message("Information", "You can only inject NDS ROMs that are not DSi Enhanced (example for not working: Pokémon Black & White)\n\nIf attempting to inject a DSi Enhanced ROM, we will not give you any support with fixing said injection").ShowDialog();
cm = new Custom_Message("Information", "You can only inject NDS ROMs that are not DSi Enhanced (example for not working: Pokémon Black & White)\n\nIf attempting to inject a DSi Enhanced ROM, we will not give you any support with fixing said injection");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
break;
case GameConsoles.SNES:
new Custom_Message("Information", "You can only inject SNES ROMs that are not using any Co-Processors (example for not working: Star Fox)\n\nIf attempting to inject a ROM in need of a Co-Processor, we will not give you any support with fixing said injection").ShowDialog();
cm = new Custom_Message("Information", "You can only inject SNES ROMs that are not using any Co-Processors (example for not working: Star Fox)\n\nIf attempting to inject a ROM in need of a Co-Processor, we will not give you any support with fixing said injection");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
break;
}
@ -828,36 +991,53 @@ namespace UWUVCI_AIO_WPF
{
if (ROM)
{
switch (GameConfiguration.Console)
if (GC)
{
case GameConsoles.NDS:
dialog.Filter = "Nintendo DS ROM (*.nds; *.srl) | *.nds;*.srl";
break;
case GameConsoles.N64:
dialog.Filter = "Nintendo 64 ROM (*.n64; *.v64; *.z64) | *.n64;*.v64;*.z64";
break;
case GameConsoles.GBA:
dialog.Filter = "GameBoy Series ROM (*.gba;*.gbc;*.gb) | *.gba;*.gbc;*.gb";
break;
case GameConsoles.NES:
dialog.Filter = "Nintendo Entertainment System ROM (*.nes) | *.nes";
break;
case GameConsoles.SNES:
dialog.Filter = "Super Nintendo Entertainment System ROM (*.sfc; *.smc) | *.sfc;*.smc";
break;
case GameConsoles.TG16:
dialog.Filter = "TurboGrafX-16 ROM (*.pce) | *.pce";
break;
case GameConsoles.MSX:
dialog.Filter = "MSX/MSX2 ROM (*.ROM) | *.ROM";
break;
case GameConsoles.WII:
dialog.Filter = "Wii ROM (*.iso; *.wbfs) | *.iso; *.wbfs";
break;
case GameConsoles.GCN:
dialog.Filter = "GCN ROM (*.iso; *.gcm) | *.iso; *.gcm";
break;
dialog.Filter = "GCN ROM (*.iso; *.gcm) | *.iso; *.gcm";
}
else
{
switch (GameConfiguration.Console)
{
case GameConsoles.NDS:
dialog.Filter = "Nintendo DS ROM (*.nds; *.srl) | *.nds;*.srl";
break;
case GameConsoles.N64:
dialog.Filter = "Nintendo 64 ROM (*.n64; *.v64; *.z64) | *.n64;*.v64;*.z64";
break;
case GameConsoles.GBA:
dialog.Filter = "GameBoy Series ROM (*.gba;*.gbc;*.gb) | *.gba;*.gbc;*.gb";
break;
case GameConsoles.NES:
dialog.Filter = "Nintendo Entertainment System ROM (*.nes) | *.nes";
break;
case GameConsoles.SNES:
dialog.Filter = "Super Nintendo Entertainment System ROM (*.sfc; *.smc) | *.sfc;*.smc";
break;
case GameConsoles.TG16:
dialog.Filter = "TurboGrafX-16 ROM (*.pce) | *.pce";
break;
case GameConsoles.MSX:
dialog.Filter = "MSX/MSX2 ROM (*.ROM) | *.ROM";
break;
case GameConsoles.WII:
if(test == GameConsoles.GCN)
{
dialog.Filter = "GCN ROM (*.iso; *.gcm) | *.iso; *.gcm";
}
else
{
dialog.Filter = "Wii ROM (*.iso; *.wbfs) | *.iso; *.wbfs";
}
break;
case GameConsoles.GCN:
dialog.Filter = "GCN ROM (*.iso; *.gcm) | *.iso; *.gcm";
break;
}
}
}
else if(!INI)
{
@ -867,6 +1047,11 @@ namespace UWUVCI_AIO_WPF
{
dialog.Filter = "N64 VC Configuration (*.ini) | *.ini";
}
if (Directory.Exists("SourceFiles"))
{
dialog.InitialDirectory = "SourceFiles";
}
DialogResult res = dialog.ShowDialog();
if(res == DialogResult.OK)
{
@ -875,7 +1060,7 @@ namespace UWUVCI_AIO_WPF
}
return ret;
}
public GameConsoles test;
private static void CopyBase(string console)
{
File.Copy(console, $@"bin\bases\{console}");
@ -928,7 +1113,7 @@ namespace UWUVCI_AIO_WPF
}
return ret;
}
public static void DownloadBase(string name)
public static void DownloadBase(string name, MainViewModel mvm)
{
string olddir = Directory.GetCurrentDirectory();
try
@ -944,12 +1129,18 @@ namespace UWUVCI_AIO_WPF
}catch(Exception e)
{
Console.WriteLine(e.Message);
new Custom_Message("Error 005: \"Unable to Download VCB Base\"", "There was an Error downloading the VCB Base File.\nThe Programm will now terminate.").ShowDialog();
Custom_Message cm = new Custom_Message("Error 005: \"Unable to Download VCB Base\"", "There was an Error downloading the VCB Base File.\nThe Programm will now terminate.");
try
{
cm.Owner = mvm.mw;
}
catch (Exception) { }
cm.ShowDialog();
Environment.Exit(1);
}
Directory.SetCurrentDirectory(olddir);
}
public static void DownloadTool(string name)
public static void DownloadTool(string name, MainViewModel mvm)
{
string olddir = Directory.GetCurrentDirectory();
try
@ -968,7 +1159,13 @@ namespace UWUVCI_AIO_WPF
catch (Exception e)
{
Console.WriteLine(e.Message);
new Custom_Message("Error 006: \"Unable to Download Tool\"", "There was an Error downloading the Tool.\nThe Programm will now terminate.").ShowDialog();
Custom_Message cm = new Custom_Message("Error 006: \"Unable to Download Tool\"", "There was an Error downloading the Tool.\nThe Programm will now terminate.");
try
{
cm.Owner = mvm.mw;
}
catch (Exception) { }
cm.ShowDialog();
Environment.Exit(1);
}
@ -1020,7 +1217,7 @@ namespace UWUVCI_AIO_WPF
foreach (MissingTool m in missingTools)
{
DownloadTool(m.Name);
DownloadTool(m.Name,this);
}
@ -1041,6 +1238,7 @@ namespace UWUVCI_AIO_WPF
}
private void ThreadDownload(List<MissingTool> missingTools)
{
var thread = new Thread(() =>
{
double l = 100 / missingTools.Count;
@ -1048,16 +1246,29 @@ namespace UWUVCI_AIO_WPF
foreach (MissingTool m in missingTools)
{
DownloadTool(m.Name);
DownloadTool(m.Name,this);
Progress += Convert.ToInt32(l);
}
Progress = 100;
});
thread.SetApartmentState(ApartmentState.STA);
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
private void timer_Tick2(object sender, EventArgs e)
{
if (Progress == 100)
{
Injectwait.Close();
injct.Abort();
timer.Stop();
Progress = 0;
}
}
private void toolCheck()
{
if (ToolCheck.DoesToolsFolderExist())
@ -1395,16 +1606,28 @@ namespace UWUVCI_AIO_WPF
}
public void ImageWarning()
{
new Custom_Message("Image Warning", "Images need to either be in a Bit Depth of 32bit or 24bit. \nIf using Tools like paint.net do not choose the Auto function.").ShowDialog();
Custom_Message cm = new Custom_Message("Image Warning", "Images need to either be in a Bit Depth of 32bit or 24bit. \nIf using Tools like paint.net do not choose the Auto function.");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
public bool choosefolder = false;
public bool CBaseConvertInfo()
{
bool ret = false;
new Custom_Message("NUS Custom Base", "You seem to have added a NUS format Custom Base.\nDo you want it to be converted to be used with the Injector?").ShowDialog();
Custom_Message cm = new Custom_Message("NUS Custom Base", "You seem to have added a NUS format Custom Base.\nDo you want it to be converted to be used with the Injector?");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
if(choosefolder)
if (choosefolder)
{
ret = true;
choosefolder = false;
@ -1426,11 +1649,17 @@ namespace UWUVCI_AIO_WPF
}
return null;
}
public void ThreadDOwn()
{
}
public void Download()
{
Task.Run(() => { Injection.Download(this); });
Task.Run(() => { Injection.Download(this); });
DownloadWait dw = new DownloadWait("Downloading Base - Please Wait", "", this);
try
{
@ -1580,7 +1809,13 @@ namespace UWUVCI_AIO_WPF
}
else
{
new Custom_Message("Information", "Folder contains Files or Subfolders, do you really want to use this folder as the Inject Folder?").ShowDialog();
Custom_Message cm = new Custom_Message("Information", "Folder contains Files or Subfolders, do you really want to use this folder as the Inject Folder?");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
if (choosefolder)
{
choosefolder = false;
@ -1598,7 +1833,13 @@ namespace UWUVCI_AIO_WPF
}catch(Exception e)
{
Console.WriteLine(e.Message);
new Custom_Message("Error", "An Error occured, please try again!").ShowDialog();
Custom_Message cm = new Custom_Message("Error", "An Error occured, please try again!");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
}
@ -1623,7 +1864,13 @@ namespace UWUVCI_AIO_WPF
}
else
{
new Custom_Message("Information", "Folder contains Files or Subfolders, do you really want to use this folder as the Base Folder?").ShowDialog();
Custom_Message cm = new Custom_Message("Information", "Folder contains Files or Subfolders, do you really want to use this folder as the Base Folder?");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
if (choosefolder)
{
@ -1642,7 +1889,13 @@ namespace UWUVCI_AIO_WPF
catch (Exception e)
{
Console.WriteLine(e.Message);
new Custom_Message("Error", "An Error occured, please try again!").ShowDialog();
Custom_Message cm = new Custom_Message("Error", "An Error occured, please try again!");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
}
}
@ -1718,7 +1971,13 @@ namespace UWUVCI_AIO_WPF
}
}catch(Exception e)
{
new Custom_Message("Unknown ROM", "It seems that you inserted an unknown ROM as a Wii or GameCube game.\nIt is not recommended continuing with said ROM!").ShowDialog();
Custom_Message cm = new Custom_Message("Unknown ROM", "It seems that you inserted an unknown ROM as a Wii or GameCube game.\nIt is not recommended continuing with said ROM!");
try
{
cm.Owner = mw;
}
catch (Exception) { }
cm.ShowDialog();
ret = "";
}

View file

@ -12,7 +12,7 @@
<Grid DataContext="{StaticResource mvm}">
<Grid>
<Frame Name="fBaseFrame" Width="403" Height="297" Margin="20,64,706,239"></Frame>
<Frame Name="fBaseFrame" Width="403" Margin="20,64,706,130"/>
</Grid>
<Button Content="WUP Installable" HorizontalAlignment="Left" Margin="51,533,0,0" VerticalAlignment="Top" Width="137" IsEnabled="{Binding Injected}" Click="Button_Click_3"/>
<Button Content="Loadiine" HorizontalAlignment="Left" Margin="270,533,0,0" VerticalAlignment="Top" Width="99" IsEnabled="{Binding Injected}" Click="Button_Click_2"/>

View file

@ -5,15 +5,16 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases"
mc:Ignorable="d"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
d:DesignHeight="297" d:DesignWidth="403"
Title="BaseContainerFrame">
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" d:DesignWidth="403"
Title="BaseContainerFrame" Height="406">
<Grid DataContext="{StaticResource mvm}">
<TextBlock Text="Choose a Base from the dropdown menu" Margin="10,2,10,275" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" FontSize="15" Width="383"></TextBlock>
<TextBlock Text="Choose a Base from the dropdown menu" Margin="10,5,10,381" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" FontSize="15" Width="383"></TextBlock>
<ComboBox x:Name="cbCombo" HorizontalAlignment="Left" Margin="10,27,0,0" VerticalAlignment="Top" Width="383" Background="#FFCFCFCF" BorderBrush="#FF008BFF" ItemsSource="{Binding LGameBasesString}" SelectionChanged="ComboBox_SelectionChanged" SelectedItem="{Binding SelectedBaseAsString}">
</ComboBox>
<Frame Name="fLoadFrame" HorizontalAlignment="Left" Height="198" Margin="10,65,0,0" VerticalAlignment="Top" Width="383"/>
<Frame Name="fLoadFrame" HorizontalAlignment="Left" Height="198" Margin="10,126,0,0" VerticalAlignment="Top" Width="383"/>
<Button Content="Copy ID" HorizontalAlignment="Left" Margin="298,61,0,0" VerticalAlignment="Top" Width="94" Height="31" Name="id" Click="id_Click" Visibility="Hidden" />
<Label Content="" HorizontalAlignment="Left" Margin="179,64,0,0" VerticalAlignment="Top" Width="114" Name="idtxt" Visibility="Hidden" Foreground="Black"/>
</Grid>
</Page>

View file

@ -65,12 +65,17 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
if (cbCombo.SelectedIndex == 0)
{
id.Visibility = Visibility.Hidden;
idtxt.Visibility = Visibility.Hidden;
fLoadFrame.Content = new CustomBaseFrame(mvm.LBases[cbCombo.SelectedIndex], console, insertedConfig);
}
else
{
id.Visibility = Visibility.Visible;
idtxt.Visibility = Visibility.Visible;
fLoadFrame.Content = new NonCustomBaseFrame(mvm.LBases[cbCombo.SelectedIndex], console, insertedConfig, this);
idtxt.Content = mvm.GameConfiguration.BaseRom.Tid;
}
mvm.OldIndex = cbCombo.SelectedIndex;
}
@ -82,5 +87,11 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
}
private void id_Click(object sender, RoutedEventArgs e)
{
Clipboard.SetText(mvm.GameConfiguration.BaseRom.Tid);
}
}
}

View file

@ -58,8 +58,8 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
tbMeta.Foreground = new SolidColorBrush(Color.FromRgb(205, 50, 50));
mvm.BaseDownloaded = false;
mvm.CBasePath = null;
//warning if using custom bases programm may crash
new Custom_Message("Information", "If using Custom Bases there will be a chance that the programm crashes if adding a wrong base (example: a normal wiiu game instead of a nds vc game).\nIf you add a wrong base, we will not assist you fixing it, other than telling you to use another base.\nIf you agree to this please hit continue").ShowDialog();
//warning if using custom bases program may crash
new Custom_Message("Information", "If using Custom Bases there will be a chance that the program crashes if adding a wrong base (example: a normal wiiu game instead of a nds vc game).\nIf you add a wrong base, we will not assist you fixing it, other than telling you to use another base.\nIf you agree to this please hit continue").ShowDialog();
if(mvm.choosefolder)
{

View file

@ -13,9 +13,9 @@
<TextBlock x:Name="tbDWNL" HorizontalAlignment="Center" Margin="10,32,10,0" TextWrapping="Wrap" Text="Base not downloaded" VerticalAlignment="Top" TextAlignment="Center" Width="363" FontSize="20" Foreground="DarkRed"/>
<TextBlock x:Name="tbTK" HorizontalAlignment="Center" Margin="10,67,10,0" TextWrapping="Wrap" Text="TitleKey missing" VerticalAlignment="Top" TextAlignment="Center" Width="363" FontSize="20" Foreground="DarkRed"/>
<TextBlock x:Name="tbCK" HorizontalAlignment="Center" Margin="10,102,10,0" TextWrapping="Wrap" Text="CommonKey missing" VerticalAlignment="Top" TextAlignment="Center" Width="363" FontSize="20" Foreground="DarkRed"/>
<Button x:Name="btnDwnlnd" Content="Download" HorizontalAlignment="Left" Margin="267,158,0,0" VerticalAlignment="Top" Width="102" IsEnabled="False" Click="btnDwnlnd_Click"/>
<Button x:Name="TK" Content="Enter TKey" HorizontalAlignment="Left" Margin="160,158,0,0" VerticalAlignment="Top" Width="102" Click="btnDwnlnd_Copy_Click" Visibility="Hidden"/>
<Button x:Name="CK" Content="Enter CKey" HorizontalAlignment="Left" Margin="53,158,0,0" VerticalAlignment="Top" Width="102" Click="btnDwnlnd_Copy1_Click" Visibility="Hidden"/>
<Button x:Name="btnDwnlnd" Content="Download" HorizontalAlignment="Left" Margin="258,158,0,0" VerticalAlignment="Top" Width="111" IsEnabled="False" Click="btnDwnlnd_Click"/>
<Button x:Name="TK" Content="Enter TKey" HorizontalAlignment="Left" Margin="151,158,0,0" VerticalAlignment="Top" Width="102" Click="btnDwnlnd_Copy_Click" Visibility="Hidden"/>
<Button x:Name="CK" Content="Enter CKey" HorizontalAlignment="Left" Margin="44,158,0,0" VerticalAlignment="Top" Width="102" Click="btnDwnlnd_Copy1_Click" Visibility="Hidden" />
</Grid>
</Page>

View file

@ -62,6 +62,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
{
tbDWNL.Text = "Base Downloaded";
tbDWNL.Foreground = new SolidColorBrush(Color.FromRgb(50, 205, 50));
btnDwnlnd.Content = "Redownload";
}
if (info[1])
{
@ -105,6 +106,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
{
mvm.Download();
Thread.Sleep(500);
checkStuff(mvm.getInfoOfBase(Base));

View file

@ -22,7 +22,9 @@
<Button Content="Select File" HorizontalAlignment="Left" Margin="506,254,0,0" VerticalAlignment="Top" Width="127" Click="Set_DrcTex"/>
<Button Content="Select File" HorizontalAlignment="Left" Margin="506,163,0,0" VerticalAlignment="Top" Width="127" Click="Set_IconTex"/>
<Button Content="Select File" HorizontalAlignment="Left" Margin="506,79,0,0" VerticalAlignment="Top" Width="127" Click="Set_Rom_Path" Name="Injection"/>
<CheckBox Content="Force 4:3" HorizontalAlignment="Left" Margin="10,39,0,0" VerticalAlignment="Top" Width="98" Click="CheckBox_Click" ToolTip="If checked Games will run in 4:3 instead of 16:9"/>
<CheckBox Content="Force 4:3" HorizontalAlignment="Left" Margin="10,39,0,0" VerticalAlignment="Top" Width="98" Click="CheckBox_Click" ToolTip="If checked Games will run in 4:3 instead of 16:9">
</CheckBox>
<CheckBox Content="Use GamePad" HorizontalAlignment="Left" Margin="113,39,0,0" VerticalAlignment="Top" Width="98" Click="CheckBox_Click_1" ToolTip="If checked the GamePad will be used as a controller" Name="gp"/>
</Grid>

View file

@ -1,4 +1,5 @@
using System;
using GameBaseClassLibrary;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -31,6 +32,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
mvm = FindResource("mvm") as MainViewModel;
mvm.setThing(this);
Injection.ToolTip = "Changing the extension of a ROM may result in a faulty inject.\nWe will not give any support in such cases";
mvm.test = GameConsoles.GCN;
}
public void Dispose()
{
@ -51,11 +53,12 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
mvm.CanInject = true;
}
}
string rom = mvm.getInternalName(mvm.RomPath);
Regex reg = new Regex("[*'\",_&#^@:;?!<>|µ~#°²³]");
gn.Text = reg.Replace(rom, string.Empty);
mvm.GameConfiguration.GameName = reg.Replace(rom, string.Empty);
string rom = mvm.getInternalName(mvm.RomPath);
Regex reg = new Regex("[*'\",_&#^@:;?!<>|µ~#°²³]");
gn.Text = reg.Replace(rom, string.Empty);
mvm.GameConfiguration.GameName = reg.Replace(rom, string.Empty);
}
}

View file

@ -16,18 +16,18 @@
<TextBox materialDesign:HintAssist.Hint="BOOTLOGOTEX (OPTIONAL)" ToolTip="Needs a BitDepth of 32 and a Dimension of 170x42" x:Name="log" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,317,157,121" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Cursor="Help" Text="{Binding GameConfiguration.TGALog.ImgPath}"/>
<TextBox materialDesign:HintAssist.Hint="GAME NAME" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,369,157,69" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" Text="{Binding GameConfiguration.GameName}" x:Name="gn" KeyUp="gn_KeyUp" MaxLength="250"/>
<Button Content="Inject" HorizontalAlignment="Left" Margin="506,413,0,0" VerticalAlignment="Top" Width="127" Click="InjectGame" IsEnabled="{Binding CanInject}"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,329,0,0" VerticalAlignment="Top" Width="127" Click="Set_LogoTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,239,0,0" VerticalAlignment="Top" Width="127" Click="Set_TvTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,284,0,0" VerticalAlignment="Top" Width="127" Click="Set_DrcTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,193,0,0" VerticalAlignment="Top" Width="127" Click="Set_IconTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,72,0,0" VerticalAlignment="Top" Width="127" Click="Set_Rom_Path" x:Name="Injection"/>
<Button Content="Select File" HorizontalAlignment="Left" Margin="506,329,0,0" VerticalAlignment="Top" Width="127" Click="Set_LogoTex"/>
<Button Content="Select File" HorizontalAlignment="Left" Margin="506,239,0,0" VerticalAlignment="Top" Width="127" Click="Set_TvTex"/>
<Button Content="Select File" HorizontalAlignment="Left" Margin="506,284,0,0" VerticalAlignment="Top" Width="127" Click="Set_DrcTex"/>
<Button Content="Select File" HorizontalAlignment="Left" Margin="506,193,0,0" VerticalAlignment="Top" Width="127" Click="Set_IconTex"/>
<Button Content="Select File" HorizontalAlignment="Left" Margin="506,72,0,0" VerticalAlignment="Top" Width="127" Click="Set_Rom_Path" x:Name="Injection"/>
<ComboBox HorizontalAlignment="Left" Margin="10,138,0,0" VerticalAlignment="Top" Width="476" x:Name="gamepad" SelectionChanged="gamepad_SelectionChanged"/>
<Label Content="Use GamePad as:" HorizontalAlignment="Left" Margin="6,113,0,0" VerticalAlignment="Top" FontSize="14"/>
<CheckBox Content="Swap L/R and ZL/ZR" HorizontalAlignment="Left" Margin="506,142,0,0" VerticalAlignment="Top" Width="137" x:Name="LR" IsEnabled="False" IsChecked="False"/>
<StackPanel Margin="10,20,244,436" Orientation="Horizontal" ToolTip="This may not work with every Game">
<Label Content="Video Patch:" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="14" Width="102"/>
<RadioButton Content="None" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" GroupName="VMC" IsChecked="True" Click="RadioButton_Click_2" Width="78"/>
<RadioButton Content="NTSC to PAL" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" GroupName="VMC" Click="RadioButton_Click" Width="111"/>
<RadioButton Content="NTSC TO PAL" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" GroupName="VMC" Click="RadioButton_Click" Width="111"/>
<RadioButton Content="PAL TO NTSC" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" GroupName="VMC" Click="RadioButton_Click_1"/>
</StackPanel>
</Grid>

View file

@ -38,6 +38,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
gpEmu.Add("Force No Classic Controller");
gamepad.ItemsSource = gpEmu;
gamepad.SelectedIndex = 0;
mvm.test = GameBaseClassLibrary.GameConsoles.WII;
}
public void Dispose()
{
@ -182,13 +183,13 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
private void RadioButton_Click_1(object sender, RoutedEventArgs e)
{
mvm.toPal = false;
mvm.Patch = false;
mvm.Patch = true;
}
private void RadioButton_Click_2(object sender, RoutedEventArgs e)
{
mvm.toPal = false;
mvm.Patch =true;
mvm.Patch = false;
}
}
}

View file

@ -6,14 +6,14 @@
xmlns:local="clr-namespace:UWUVCI_AIO_WPF.UI.Frames.Path"
mc:Ignorable="d"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
d:DesignHeight="480" d:DesignWidth="1130"
d:DesignHeight="600" d:DesignWidth="1130"
Title="Paths">
<Grid DataContext="{StaticResource mvm}">
<TextBox materialDesign:HintAssist.Hint="PATH TO STORE DOWNLOADED BASES" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="180,139,474,296" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding BaseStore}"/>
<TextBox materialDesign:HintAssist.Hint="PATH TO STORE INJECTS" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="180,212,474,222" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding InjectStore}"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="700,152,0,0" VerticalAlignment="Top" Width="126" Click="Button_Click"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="700,226,0,0" VerticalAlignment="Top" Width="127" Click="Button_Click_1"/>
<TextBox materialDesign:HintAssist.Hint="PATH TO STORE DOWNLOADED BASES" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="234,215,420,340" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding BaseStore}"/>
<TextBox materialDesign:HintAssist.Hint="PATH TO STORE INJECTS" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="234,288,420,266" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding InjectStore}"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="754,228,0,0" VerticalAlignment="Top" Width="126" Click="Button_Click"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="754,302,0,0" VerticalAlignment="Top" Width="127" Click="Button_Click_1"/>
<Button Content="Back" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="82" Click="Button_Click_2"/>
</Grid>

View file

@ -9,23 +9,23 @@
Title="SettingsFrame">
<Grid Margin="0,2,0,-2">
<TextBlock HorizontalAlignment="Left" Margin="325,154,0,0" TextWrapping="Wrap" Text="Set Injector Paths:" VerticalAlignment="Top" FontSize="20" />
<TextBlock HorizontalAlignment="Left" Margin="325,201,0,0" TextWrapping="Wrap" Text="Enter CommonKey:" VerticalAlignment="Top" FontSize="20" />
<TextBlock HorizontalAlignment="Left" Margin="325,250,0,0" TextWrapping="Wrap" Text="Enter TitleKeys:" VerticalAlignment="Top" FontSize="20" />
<TextBlock HorizontalAlignment="Left" Margin="325,293,0,0" TextWrapping="Wrap" Text="Injector Theme:" VerticalAlignment="Top" FontSize="20" />
<RadioButton Content="Light Theme" HorizontalAlignment="Left" Margin="494,300,0,0" VerticalAlignment="Top" GroupName="theme" x:Name="rblight" IsChecked="True"/>
<Button Content="Change Theme" HorizontalAlignment="Left" Margin="605,293,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116"/>
<Button Content="Open CK Menu" HorizontalAlignment="Left" Margin="605,196,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_1"/>
<Button Content="Open Path Menu" HorizontalAlignment="Left" Margin="605,149,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_2"/>
<Button Content="Open TK Menu" HorizontalAlignment="Left" Margin="605,245,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116" Click="Button_Click"/>
<Button Content="Update Base Files" HorizontalAlignment="Left" Margin="605,338,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_3"/>
<Button Content="Start N64 Virtual Console INI Creator" HorizontalAlignment="Left" Margin="325,381,0,0" VerticalAlignment="Top" Width="425" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_4"/>
<TextBlock HorizontalAlignment="Left" Margin="325,170,0,0" TextWrapping="Wrap" Text="Set Injector Paths:" VerticalAlignment="Top" FontSize="20" />
<TextBlock HorizontalAlignment="Left" Margin="325,217,0,0" TextWrapping="Wrap" Text="Enter CommonKey:" VerticalAlignment="Top" FontSize="20" />
<TextBlock HorizontalAlignment="Left" Margin="325,541,0,0" TextWrapping="Wrap" Text="Enter TitleKeys:" VerticalAlignment="Top" FontSize="20" Visibility="Hidden" />
<TextBlock HorizontalAlignment="Left" Margin="325,257,0,0" TextWrapping="Wrap" Text="Injector Theme:" VerticalAlignment="Top" FontSize="20" />
<RadioButton Content="Light Theme" HorizontalAlignment="Left" Margin="494,264,0,0" VerticalAlignment="Top" GroupName="theme" x:Name="rblight" IsChecked="True"/>
<Button Content="Change Theme" HorizontalAlignment="Left" Margin="605,257,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116"/>
<Button Content="Open CK Menu" HorizontalAlignment="Left" Margin="605,212,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_1"/>
<Button Content="Open Path Menu" HorizontalAlignment="Left" Margin="605,165,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_2"/>
<Button Content="Open TK Menu" HorizontalAlignment="Left" Margin="605,537,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116" Click="Button_Click" Visibility="Hidden"/>
<Button Content="Update Base Files" HorizontalAlignment="Left" Margin="605,302,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_3"/>
<Button Content="Start N64 Virtual Console INI Creator" HorizontalAlignment="Left" Margin="325,345,0,0" VerticalAlignment="Top" Width="425" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_4"/>
<Button Content="Credits" HorizontalAlignment="Left" Margin="1040,558,0,0" VerticalAlignment="Top" Width="80" Click="Button_Click_5"/>
<Button Content="Update Tools" HorizontalAlignment="Left" Margin="483,338,0,0" VerticalAlignment="Top" Width="117" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_7"/>
<Button Content="Check For Updates" HorizontalAlignment="Left" Margin="597,422,0,0" VerticalAlignment="Top" Width="153" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_6"/>
<Button Content="Update Tools" HorizontalAlignment="Left" Margin="483,302,0,0" VerticalAlignment="Top" Width="117" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_7"/>
<Button Content="Check For Updates" HorizontalAlignment="Left" Margin="597,386,0,0" VerticalAlignment="Top" Width="153" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_6"/>
<TextBlock HorizontalAlignment="Left" Margin="1022,10,0,0" TextWrapping="Wrap" Text="v2.1 BETA" VerticalAlignment="Top" FontSize="20" Width="98"/>
<Button Content="Reset TitleKeys" HorizontalAlignment="Left" Margin="325,338,0,0" VerticalAlignment="Top" Width="153" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_8"/>
<Button Content="Start Nintendont Config Tool" HorizontalAlignment="Left" Margin="325,422,0,0" VerticalAlignment="Top" Width="267" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_9"/>
<Button Content="Reset TitleKeys" HorizontalAlignment="Left" Margin="325,302,0,0" VerticalAlignment="Top" Width="153" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_8"/>
<Button Content="Start Nintendont Config Tool" HorizontalAlignment="Left" Margin="325,386,0,0" VerticalAlignment="Top" Width="267" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_9"/>
</Grid>
</Page>

View file

@ -59,7 +59,12 @@ namespace UWUVCI_AIO_WPF.UI.Frames
private void Button_Click_4(object sender, RoutedEventArgs e)
{
Process.Start(@"bin\Tools\INICreator.exe");
Process[] pname = Process.GetProcessesByName("INICreator");
if (pname.Length == 0)
{
Process.Start(@"bin\Tools\INICreator.exe");
}
}
private void Button_Click_5(object sender, RoutedEventArgs e)
@ -70,7 +75,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames
private void Button_Click_6(object sender, RoutedEventArgs e)
{
MainViewModel mvm = FindResource("mvm") as MainViewModel;
mvm.Update();
mvm.Update(true);
}
private void Button_Click_7(object sender, RoutedEventArgs e)
@ -87,7 +92,12 @@ namespace UWUVCI_AIO_WPF.UI.Frames
private void Button_Click_9(object sender, RoutedEventArgs e)
{
Process.Start(@"bin\Tools\NintendontConfig.exe");
Process[] pname = Process.GetProcessesByName("NintendontConfig");
if (pname.Length == 0)
{
Process.Start(@"bin\Tools\NintendontConfig.exe");
}
}
}
}

View file

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:UWUVCI_AIO_WPF"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Title="MAIN" Height="223.859" Width="717.416" WindowStyle="None" WindowStartupLocation="CenterScreen" Foreground="White" Background="LightGray" ResizeMode="NoResize" Icon="/UWUVCI AIO WPF;component/a.ico" Name="wind" SizeToContent="WidthAndHeight" BorderThickness="1" BorderBrush="Black">
Title="MAIN" Height="223.859" Width="717.416" WindowStyle="None" WindowStartupLocation="CenterScreen" Foreground="White" Background="LightGray" ResizeMode="NoResize" Icon="/UWUVCI AIO WPF;component/a.ico" Name="wind" SizeToContent="WidthAndHeight" BorderBrush="#FF2196F3" BorderThickness="1.5,1.5,1.5,1.5" ShowInTaskbar="False">
<Grid Name="grid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="496*"/>
@ -19,7 +19,7 @@
<RowDefinition Height="48"/>
</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"/>
<TextBlock HorizontalAlignment="Left" Margin="7,2,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="32" Width="618" FontSize="15" Foreground="Black" Name="Title" Grid.ColumnSpan="2" Grid.Row="0" FontWeight="Bold"/>
<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"/>

View file

@ -49,6 +49,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
Message.Content = message;
this.path = Path;
Folder.Visibility = Visibility.Visible;
}
private void Button_Click(object sender, RoutedEventArgs e)
{

View file

@ -4,15 +4,15 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:UWUVCI_AIO_WPF"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Title="MAIN" Height="93.662" Width="500" WindowStyle="None" WindowStartupLocation="CenterScreen" Foreground="White" Background="LightGray" ResizeMode="NoResize" Icon="/UWUVCI AIO WPF;component/a.ico">
Title="MAIN" Height="93.662" Width="500" WindowStyle="None" WindowStartupLocation="CenterScreen" Foreground="White" Background="LightGray" ResizeMode="NoResize" Icon="/UWUVCI AIO WPF;component/a.ico" BorderBrush="#FF2196F3" BorderThickness="1.5,1.5,1.5,1.5" ShowInTaskbar="False">
<Grid>
<TextBlock HorizontalAlignment="Left" Margin="10,11,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="25" Width="480" FontSize="18" Foreground="Black" Name="Key" TextAlignment="Center"/>
<TextBlock HorizontalAlignment="Left" Margin="10,41,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="18" Width="480" FontSize="10" Foreground="Black" Name="msgT" TextAlignment="Center"/>
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="93" VerticalAlignment="Top" Width="500"/>
<ProgressBar HorizontalAlignment="Left" Height="11" Margin="31,59,0,0" VerticalAlignment="Top" Width="443" Name="pb"/>
</Grid>
</Window>

View file

@ -33,14 +33,32 @@ namespace UWUVCI_AIO_WPF.UI.Windows
timer.Tick += timer_Tick;
timer.Start();
}
public DownloadWait(string doing, string msg, MainViewModel mvm, bool t)
{
this.mvm = mvm;
InitializeComponent();
Key.Text = doing;
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(1);
timer.Tick += timer_Tick;
}
void timer_Tick(object sender, EventArgs e)
private void timer_Tick(object sender, EventArgs e)
{
msgT.Text = mvm.msg;
pb.Value = mvm.Progress;
if(Key.Text.Contains("Downloading Base"))
{
if(mvm.Progress < 70)
{
mvm.Progress += 5;
}
}
if(mvm.Progress == 100)
{
this.Close();
Close();
mvm.Progress = 0;
}
}

View file

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:UWUVCI_AIO_WPF"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
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">
Title="MAIN" Height="160.656" Width="500" WindowStyle="None" WindowStartupLocation="CenterScreen" Foreground="White" Background="LightGray" ResizeMode="NoResize" Icon="/UWUVCI AIO WPF;component/a.ico" BorderBrush="#FF2196F3" BorderThickness="1.5,1.5,1.5,1.5" ShowInTaskbar="False">
<Grid DataContext="{StaticResource mvm}">
<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"/>
@ -19,6 +19,6 @@
<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

@ -21,8 +21,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
public partial class EnterKey : Window
{
bool ckey = false;
bool wiiu = false;
bool sys1 = false;
public EnterKey(bool ckey)
{
InitializeComponent();
@ -56,8 +55,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
Key.Text += "1";
}
wiiu = true;
if (i == 1) sys1 = true;
}
@ -68,38 +66,54 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void Button_Click_1(object sender, RoutedEventArgs e)
{
if (ckey)
if(tbKey.Text.Length > 32 || tbKey.Text.Length < 32)
{
MainViewModel mvm = (MainViewModel)FindResource("mvm");
if (mvm.checkcKey(tbKey.Text))
if(tbKey.Text.Length > 32)
{
this.Close();
new Custom_Message("Correct Key", "The entered CommonKey is correct!").ShowDialog();
mvm.ArePathsSet();
new Custom_Message("Wrong Key", "The entered Key is too long").ShowDialog();
}
else
{
new Custom_Message("Incorrect Key", "The entered CommonKey is incorrect!").ShowDialog();
new Custom_Message("Wrong Key", "The entered Key is too short").ShowDialog();
}
}
else
{
MainViewModel mvm = (MainViewModel)FindResource("mvm");
if (mvm.checkKey(tbKey.Text))
if (ckey)
{
new Custom_Message("Correct Key", "The entered TitleKey is correct!").ShowDialog();
MainViewModel mvm = (MainViewModel)FindResource("mvm");
if (mvm.checkcKey(tbKey.Text))
{
this.Close();
new Custom_Message("Correct Key", "The entered CommonKey is correct!").ShowDialog();
this.Close();
mvm.ArePathsSet();
}
else
{
new Custom_Message("Incorrect Key", "The entered CommonKey is incorrect!").ShowDialog();
}
}
else
{
new Custom_Message("Incorrect Key", "The entered TitleKey is incorrect!").ShowDialog();
MainViewModel mvm = (MainViewModel)FindResource("mvm");
if (mvm.checkKey(tbKey.Text))
{
new Custom_Message("Correct Key", "The entered TitleKey is correct!").ShowDialog();
this.Close();
}
else
{
new Custom_Message("Incorrect Key", "The entered TitleKey is incorrect!").ShowDialog();
}
}
}
}
}
}

View file

@ -146,11 +146,11 @@
</StackPanel>
</Grid>
<TextBlock HorizontalAlignment="Left" Margin="1164,12,0,0" TextWrapping="Wrap" Text="X" VerticalAlignment="Top" Foreground="White" FontSize="16"/>
<Button Content="Button" HorizontalAlignment="Left" Margin="1160,11,0,0" VerticalAlignment="Top" Width="18" Background="{x:Null}" BorderBrush="{x:Null}" Height="25" Click="Window_Close" Name="close" MouseEnter="close_MouseEnter" MouseLeave="close_MouseLeave"/>
<TextBlock HorizontalAlignment="Left" Margin="1141,10,0,0" TextWrapping="Wrap" Text="🗕" VerticalAlignment="Top" Foreground="White" FontSize="16"/>
<TextBlock HorizontalAlignment="Left" Margin="1164,12,0,0" TextWrapping="Wrap" Text="X" VerticalAlignment="Top" Foreground="White" FontSize="16" IsHitTestVisible="False"/>
<Button Content="Button" HorizontalAlignment="Left" Margin="1140,11,0,0" VerticalAlignment="Top" Width="18" Background="{x:Null}" BorderBrush="{x:Null}" Height="25" Click="Window_Minimize" MouseEnter="Button_MouseEnter" Name="min" MouseLeave="min_MouseLeave"/>
<TextBlock HorizontalAlignment="Left" Margin="1141,10,0,0" TextWrapping="Wrap" Text="🗕" VerticalAlignment="Top" Foreground="White" FontSize="16" IsHitTestVisible="False"/>
</Grid>
</Window>

View file

@ -153,12 +153,12 @@ namespace UWUVCI_AIO_WPF
private void Button_MouseEnter(object sender, MouseEventArgs e)
{
min.Background = new SolidColorBrush(Color.FromArgb(20, 250, 250, 250));
min.Background = new SolidColorBrush(Color.FromArgb(100, 255, 255, 255));
}
private void close_MouseEnter(object sender, MouseEventArgs e)
{
close.Background = new SolidColorBrush(Color.FromArgb(20, 250, 250, 250));
close.Background = new SolidColorBrush(Color.FromArgb(150,255, 100, 100));
}
private void close_MouseLeave(object sender, MouseEventArgs e)