mirror of
https://github.com/stuff-by-3-random-dudes/UWUVCI-AIO-WPF
synced 2024-11-22 19:13:11 +00:00
fixes
This commit is contained in:
parent
37d4b2154d
commit
d53100fb87
4 changed files with 100 additions and 51 deletions
|
@ -2135,19 +2135,20 @@ namespace UWUVCI_AIO_WPF
|
|||
|
||||
return true;
|
||||
}
|
||||
public void getBootIMGNDS(string rom)
|
||||
public void getBootIMGGBA(string rom)
|
||||
{
|
||||
string linkbase = "https://raw.githubusercontent.com/Flumpster/UWUVCI-Images/master/";
|
||||
string repoid = "";
|
||||
string SystemType = "nds/";
|
||||
string SystemType = "gba/";
|
||||
IMG_Message img = null;
|
||||
using (var fs = new FileStream(rom,
|
||||
FileMode.Open,
|
||||
FileAccess.Read))
|
||||
{
|
||||
byte[] procode = new byte[6];
|
||||
fs.Seek(0x3A, SeekOrigin.Begin);
|
||||
fs.Read(procode, 0, 6);
|
||||
|
||||
byte[] procode = new byte[4];
|
||||
fs.Seek(0xAC, SeekOrigin.Begin);
|
||||
fs.Read(procode, 0, 4);
|
||||
repoid = ByteArrayToString(procode);
|
||||
Regex rgx = new Regex("[^a-zA-Z0-9 -]");
|
||||
repoid = rgx.Replace(repoid, "");
|
||||
|
@ -2201,9 +2202,36 @@ namespace UWUVCI_AIO_WPF
|
|||
catch (Exception) { }
|
||||
img.ShowDialog();
|
||||
}
|
||||
else
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public void getBootIMGNDS(string rom)
|
||||
{
|
||||
string linkbase = "https://raw.githubusercontent.com/Flumpster/UWUVCI-Images/master/";
|
||||
string repoid = "";
|
||||
string SystemType = "nds/";
|
||||
IMG_Message img = null;
|
||||
using (var fs = new FileStream(rom,
|
||||
FileMode.Open,
|
||||
FileAccess.Read))
|
||||
{
|
||||
|
||||
byte[] procode = new byte[4];
|
||||
fs.Seek(0xC, SeekOrigin.Begin);
|
||||
fs.Read(procode, 0, 4);
|
||||
repoid = ByteArrayToString(procode);
|
||||
Regex rgx = new Regex("[^a-zA-Z0-9 -]");
|
||||
repoid = rgx.Replace(repoid, "");
|
||||
Console.WriteLine("prodcode before scramble: " + repoid);
|
||||
|
||||
fs.Close();
|
||||
Console.WriteLine("prodcode after scramble: " + repoid);
|
||||
}
|
||||
if (CheckForInternetConnectionWOWarning())
|
||||
{
|
||||
repoid = new string(new char[] { repoid[0], repoid[2], repoid[1], repoid[3] });
|
||||
if (RemoteFileExists(linkbase + SystemType + repoid + "/iconTex.png") == true)
|
||||
{
|
||||
img = new IMG_Message(linkbase + SystemType + repoid + "/iconTex.png", linkbase + SystemType + repoid + "/bootTvTex.png");
|
||||
|
@ -2247,7 +2275,7 @@ namespace UWUVCI_AIO_WPF
|
|||
catch (Exception) { }
|
||||
img.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -52,8 +52,8 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
|
|||
private void Set_Rom_Path(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string path = string.Empty;
|
||||
if (!cd) path = mvm.GetFilePath(true, false);
|
||||
else path = mvm.turbocd();
|
||||
path = mvm.GetFilePath(true, false);
|
||||
|
||||
|
||||
if (!CheckIfNull(path)) {
|
||||
mvm.RomPath = path;
|
||||
|
@ -63,6 +63,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
|
|||
mvm.CanInject = true;
|
||||
|
||||
}
|
||||
mvm.getBootIMGGBA(mvm.RomPath);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -246,7 +247,13 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
|
|||
{
|
||||
new TDRSHOW(tv.Text).ShowDialog();
|
||||
}
|
||||
|
||||
public void imgpath(string icon, string tv)
|
||||
{
|
||||
ic.Text = icon;
|
||||
this.tv.Text = tv;
|
||||
icoIMG.Visibility = Visibility.Visible;
|
||||
this.tv.Visibility = Visibility.Visible;
|
||||
}
|
||||
private void drcIMG_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
new TDRSHOW(drc.Text).ShowDialog();
|
||||
|
|
|
@ -59,6 +59,10 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
|
|||
{
|
||||
mvm.CanInject = true;
|
||||
|
||||
}
|
||||
if(mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.NDS)
|
||||
{
|
||||
mvm.getBootIMGNDS(mvm.RomPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,6 +81,10 @@ namespace UWUVCI_AIO_WPF.UI.Windows
|
|||
{
|
||||
(mvm.Thing as N64Config).icoIMG.Visibility = Visibility.Visible;
|
||||
}
|
||||
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.GBA)
|
||||
{
|
||||
(mvm.Thing as GBA).icoIMG.Visibility = Visibility.Visible;
|
||||
}
|
||||
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.NDS || mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.SNES)
|
||||
{
|
||||
(mvm.Thing as OtherConfigs).icoIMG.Visibility = Visibility.Visible;
|
||||
|
@ -101,8 +105,14 @@ namespace UWUVCI_AIO_WPF.UI.Windows
|
|||
(mvm.Thing as N64Config).tvIMG.Visibility = Visibility.Visible;
|
||||
(mvm.Thing as N64Config).imgpath(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "iconTex.png"), System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "bootTvTex.png"));
|
||||
}
|
||||
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.GBA)
|
||||
{
|
||||
(mvm.Thing as GBA).tvIMG.Visibility = Visibility.Visible;
|
||||
(mvm.Thing as GBA).imgpath(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "iconTex.png"), System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "bootTvTex.png"));
|
||||
}
|
||||
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.NDS || mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.SNES)
|
||||
{
|
||||
(mvm.Thing as OtherConfigs).tvIMG.Visibility = Visibility.Visible;
|
||||
(mvm.Thing as OtherConfigs).imgpath(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "iconTex.png"), System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "bootTvTex.png"));
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue