i hope this reverts the second last commit if nto fuck this tool

This commit is contained in:
NicoAICP 2020-06-14 14:58:40 +02:00
parent 2ff014cfbc
commit 40837e4999
2 changed files with 73 additions and 115 deletions

View file

@ -34,7 +34,6 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private static readonly string toolsPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
MenuIconImage bi = new MenuIconImage();
Bitmap b;
Bitmap framecopy;
string console = "other";
string othercons = "";
bool drc = false;
@ -62,9 +61,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
}
private void SetTemplate()
{
if(othercons == "GB")
if (othercons == "GB")
{
bi.Frame = new Bitmap(Properties.Resources.Icon);
wii.IsChecked = true;
ww.Content = "Alt 1";
@ -75,7 +73,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
hb.Visibility = Visibility.Visible;
wii.Visibility = Visibility.Visible;
}
if(othercons == "GBC")
if (othercons == "GBC")
{
bi.Frame = new Bitmap(Properties.Resources.Icon);
wii.IsChecked = true;
@ -87,7 +85,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
hb.Visibility = Visibility.Visible;
wii.Visibility = Visibility.Visible;
}
if(console == "WII" && (FindResource("mvm") as MainViewModel).test != GameConsoles.GCN)
if (console == "WII" && (FindResource("mvm") as MainViewModel).test != GameConsoles.GCN)
{
bi.Frame = new Bitmap(Properties.Resources.Wii2);
ww.Visibility = Visibility.Visible;
@ -107,7 +105,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
hb.Visibility = Visibility.Visible;
wii.Visibility = Visibility.Visible;
}
else if((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.NDS)
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.NDS)
{
bi.Frame = new Bitmap(Properties.Resources.Icon);
wii.IsChecked = true;
@ -195,7 +193,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
bi.Frame = new Bitmap(Properties.Resources.Icon);
}
framecopy = bi.Frame.Clone() as Bitmap;
}
private void Button_Click(object sender, RoutedEventArgs e)
@ -208,7 +206,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
string file = "";
MainViewModel mvm = FindResource("mvm") as MainViewModel;
file = mvm.GetFilePath(false, false);
if(!string.IsNullOrEmpty(file))
if (!string.IsNullOrEmpty(file))
{
string copy = "";
@ -240,24 +238,10 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
copy = file;
}
if(enOv.IsChecked == false)
{
//bi.TitleScreen = new Bitmap(copy);
bi.Frame = new Bitmap(copy);
b = bi.Create(console);
Image.Source = BitmapToImageSource(b);
}
else
{
bi.TitleScreen = new Bitmap(copy);
b = bi.Create(console);
Image.Source = BitmapToImageSource(b);
}
}
}
private void Finish_Click(object sender, RoutedEventArgs e)
@ -266,7 +250,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
Directory.CreateDirectory(@"bin\createdIMG");
}
if(File.Exists(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
if (File.Exists(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
{
File.Delete(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
}
@ -338,13 +322,9 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void enOv_Click(object sender, RoutedEventArgs e)
{
if(enOv.IsChecked == true)
if (enOv.IsChecked == true)
{
if(bi.Frame != framecopy)
{
bi.TitleScreen = bi.Frame.Clone() as Bitmap;
bi.Frame = framecopy;
}
b = bi.Create(console);
Image.Source = BitmapToImageSource(b);
ww.IsEnabled = true;
@ -359,12 +339,9 @@ namespace UWUVCI_AIO_WPF.UI.Windows
hb.IsEnabled = false;
ws.IsEnabled = false;
if(bi.TitleScreen != null)
if (bi.TitleScreen != null)
{
//b = ResizeImage(bi.TitleScreen, 128, 128);
bi.Frame = bi.TitleScreen;
b = bi.Create(console);
Image.Source = BitmapToImageSource(b);
b = ResizeImage(bi.TitleScreen, 128, 128); Image.Source = BitmapToImageSource(b);
}
else
{
@ -431,7 +408,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
bi.Frame = Properties.Resources.SNES_PAL;
}
else if(combo.SelectedIndex == 1)
else if (combo.SelectedIndex == 1)
{
bi.Frame = Properties.Resources.SNES_USA;
}
@ -445,7 +422,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void pal_Click(object sender, RoutedEventArgs e)
{
if(pal.IsChecked == true)
if (pal.IsChecked == true)
{
bi.Frame = Properties.Resources.SNES_PAL;
@ -479,7 +456,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void ww_Click(object sender, RoutedEventArgs e)
{
if(othercons == "GB")
if (othercons == "GB")
{
if (ww.IsChecked == true)
{
@ -497,7 +474,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
console = "WII";
}
}
else if(othercons == "GBC")
else if (othercons == "GBC")
{
if (ww.IsChecked == true)
@ -675,7 +652,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
console = "WII";
}
}
framecopy = bi.Frame.Clone() as Bitmap;
DrawImage();
}
}

View file

@ -34,7 +34,6 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private static readonly string toolsPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
BootImage bi = new BootImage();
Bitmap b;
Bitmap framecopy;
string console = "other";
bool drc = false;
private string backupcons;
@ -57,7 +56,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
InitializeComponent();
Bitmap bit;
if(consoles == GameConsoles.TG16)
if (consoles == GameConsoles.TG16)
{
if (other)
{
@ -87,7 +86,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void SetTemplate(GameConsoles console)
{
Bitmap bit;
switch (console){
switch (console)
{
case GameConsoles.NDS:
bit = new Bitmap(Properties.Resources.NDS);
@ -149,7 +149,6 @@ namespace UWUVCI_AIO_WPF.UI.Windows
break;
}
bi.Frame = bit;
framecopy = bit.Clone() as Bitmap;
}
private void Button_Click(object sender, RoutedEventArgs e)
@ -162,7 +161,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
string file = "";
MainViewModel mvm = FindResource("mvm") as MainViewModel;
file = mvm.GetFilePath(false, false);
if(!string.IsNullOrEmpty(file))
if (!string.IsNullOrEmpty(file))
{
string copy = "";
@ -194,20 +193,10 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
copy = file;
}
if(enOv.IsChecked == false)
{
bi.Frame = new Bitmap(copy);
b = bi.Create(console);
Image.Source = BitmapToImageSource(b);
}
else
{
bi.TitleScreen = new Bitmap(copy);
b = bi.Create(console);
Image.Source = BitmapToImageSource(b);
}
}
}
private void Finish_Click(object sender, RoutedEventArgs e)
@ -216,7 +205,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
Directory.CreateDirectory(@"bin\createdIMG");
}
if(File.Exists(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
if (File.Exists(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
{
File.Delete(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
}
@ -292,7 +281,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
RLDi.IsEnabled = en;
RLEn.IsEnabled = en;
ReleaseYear.IsEnabled = en;
if(en && RLDi.IsChecked == true)
if (en && RLDi.IsChecked == true)
{
ReleaseYear.IsEnabled = false;
}
@ -304,7 +293,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
Players.IsEnabled = false;
}
PlayerLabel.IsEnabled = en;
if(snesonly.IsVisible == true)
if (snesonly.IsVisible == true)
{
snesonly.IsEnabled = en;
}
@ -312,13 +301,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void enOv_Click(object sender, RoutedEventArgs e)
{
if((ovl.IsVisible == true && enOv.IsChecked == true))
if ((ovl.IsVisible == true && enOv.IsChecked == true))
{
if (bi.Frame != framecopy)
{
bi.TitleScreen = bi.Frame.Clone() as Bitmap;
bi.Frame = framecopy;
}
EnableOrDisbale(true);
b = bi.Create(console);
Image.Source = BitmapToImageSource(b);
@ -326,12 +310,9 @@ namespace UWUVCI_AIO_WPF.UI.Windows
else
{
EnableOrDisbale(false);
if(bi.TitleScreen != null)
if (bi.TitleScreen != null)
{
//b = ResizeImage(bi.TitleScreen, 1280, 720);
bi.Frame = bi.TitleScreen;
b = bi.Create(console);
Image.Source = BitmapToImageSource(b);
b = ResizeImage(bi.TitleScreen, 1280, 720); Image.Source = BitmapToImageSource(b);
}
else
{
@ -386,7 +367,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
bi.Longname = false;
}
if(PLEn.IsChecked == true && !String.IsNullOrWhiteSpace(Players.Text))
if (PLEn.IsChecked == true && !String.IsNullOrWhiteSpace(Players.Text))
{
bi.Players = Convert.ToInt32(Players.Text);
}
@ -429,7 +410,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
bi.Frame = Properties.Resources.SNES_PAL;
}
else if(combo.SelectedIndex == 1)
else if (combo.SelectedIndex == 1)
{
bi.Frame = Properties.Resources.SNES_USA;
}
@ -443,7 +424,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void pal_Click(object sender, RoutedEventArgs e)
{
if(console != "WII" && backupcons != "WII")
if (console != "WII" && backupcons != "WII")
{
if (pal.IsChecked == true)
{
@ -470,14 +451,14 @@ namespace UWUVCI_AIO_WPF.UI.Windows
bi.Frame = Properties.Resources.WIIWARE;
}
}
framecopy = bi.Frame.Clone() as Bitmap;
b = bi.Create(console);
Image.Source = BitmapToImageSource(b);
}
private void RadioButton_Click(object sender, RoutedEventArgs e)
{
if(console != "WII" && backupcons != "WII")
if (console != "WII" && backupcons != "WII")
{
backupcons = console;
bi.Frame = Properties.Resources.SFAM;
@ -485,7 +466,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
else
{
backupcons = "WII";
if(altwii.IsChecked == false)
if (altwii.IsChecked == false)
{
console = "WII";
switchs(Visibility.Hidden);
@ -499,7 +480,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
}
}
framecopy = bi.Frame.Clone() as Bitmap;
b = bi.Create(console);
Image.Source = BitmapToImageSource(b);
}
@ -532,7 +513,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void CheckBox_Click(object sender, RoutedEventArgs e)
{
if(alt.IsChecked == true)
if (alt.IsChecked == true)
{
bi.changefont(true);
}
@ -553,7 +534,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
Players.Visibility = v;
if(v == Visibility.Hidden)
if (v == Visibility.Hidden)
{
bi.NameLine1 = "";
bi.NameLine2 = "";