2020-06-05 11:02:11 +00:00
|
|
|
|
using GameBaseClassLibrary;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Drawing.Drawing2D;
|
|
|
|
|
using System.Drawing.Imaging;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
using UWUVCI_AIO_WPF.Classes;
|
|
|
|
|
|
|
|
|
|
namespace UWUVCI_AIO_WPF.UI.Windows
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaktionslogik für ImageCreator.xaml
|
|
|
|
|
/// </summary>
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-05 11:02:11 +00:00
|
|
|
|
public partial class IconCreator : Window, IDisposable
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
private static readonly string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
|
|
|
|
|
private static readonly string toolsPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
|
2020-06-05 11:02:11 +00:00
|
|
|
|
MenuIconImage bi = new MenuIconImage();
|
|
|
|
|
Bitmap b;
|
|
|
|
|
string console = "other";
|
2020-06-13 18:34:54 +00:00
|
|
|
|
string othercons = "";
|
2020-06-05 11:02:11 +00:00
|
|
|
|
bool drc = false;
|
2020-07-23 23:12:12 +00:00
|
|
|
|
private bool _disposed;
|
2020-06-05 11:02:11 +00:00
|
|
|
|
|
|
|
|
|
public IconCreator()
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpIconCreator();
|
2021-04-14 22:33:17 +00:00
|
|
|
|
SetTemplate();
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
public IconCreator(string name)
|
2020-06-08 07:34:21 +00:00
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpIconCreator();
|
2020-06-08 07:34:21 +00:00
|
|
|
|
console = name;
|
2021-04-14 22:33:17 +00:00
|
|
|
|
SetTemplate();
|
2020-06-08 07:34:21 +00:00
|
|
|
|
}
|
2020-06-13 18:34:54 +00:00
|
|
|
|
public IconCreator(string name, string extra)
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpIconCreator();
|
2020-06-13 18:34:54 +00:00
|
|
|
|
console = name;
|
|
|
|
|
othercons = extra;
|
2021-04-14 22:33:17 +00:00
|
|
|
|
SetTemplate();
|
2020-10-02 00:39:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setUpIconCreator()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2020-06-13 18:34:54 +00:00
|
|
|
|
imageName.Content = "iconTex";
|
|
|
|
|
}
|
2020-06-05 11:02:11 +00:00
|
|
|
|
private void SetTemplate()
|
|
|
|
|
{
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (othercons == "GB")
|
2020-06-13 18:34:54 +00:00
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpBiFrame();
|
2020-06-13 18:34:54 +00:00
|
|
|
|
wii.Content = "GB";
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (othercons == "GBC")
|
2020-06-13 18:34:54 +00:00
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpBiFrame();
|
2020-06-13 18:34:54 +00:00
|
|
|
|
wii.Content = "GBC";
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (console == "WII" && (FindResource("mvm") as MainViewModel).test != GameConsoles.GCN)
|
2020-06-08 07:34:21 +00:00
|
|
|
|
{
|
2020-06-10 21:22:10 +00:00
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Wii2);
|
|
|
|
|
ww.Visibility = Visibility.Visible;
|
|
|
|
|
ws.Visibility = Visibility.Visible;
|
|
|
|
|
hb.Visibility = Visibility.Visible;
|
|
|
|
|
wii.Visibility = Visibility.Visible;
|
2020-06-08 07:34:21 +00:00
|
|
|
|
}
|
2020-06-11 14:37:36 +00:00
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).test == GameConsoles.GCN)
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpBiFrame();
|
2020-06-11 15:22:58 +00:00
|
|
|
|
wii.Content = "GCN";
|
2020-06-11 14:37:36 +00:00
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.NDS)
|
2020-06-13 07:27:42 +00:00
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpBiFrame();
|
2020-06-13 07:27:42 +00:00
|
|
|
|
wii.Content = "NDS";
|
|
|
|
|
}
|
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.N64)
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpBiFrame();
|
2020-06-13 07:27:42 +00:00
|
|
|
|
wii.Content = "N64";
|
|
|
|
|
}
|
2020-06-13 18:34:54 +00:00
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.GBA && othercons == "")
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpBiFrame();
|
2020-06-13 18:34:54 +00:00
|
|
|
|
wii.Content = "GBA";
|
|
|
|
|
}
|
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.MSX)
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpBiFrame();
|
2020-06-13 18:34:54 +00:00
|
|
|
|
wii.Content = "MSX";
|
|
|
|
|
}
|
2020-06-13 15:53:59 +00:00
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.SNES)
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpBiFrame();
|
2020-06-13 15:53:59 +00:00
|
|
|
|
wii.Content = "SNES";
|
|
|
|
|
}
|
2020-06-13 18:34:54 +00:00
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.NES)
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpBiFrame();
|
2020-06-13 18:34:54 +00:00
|
|
|
|
wii.Content = "NES";
|
|
|
|
|
}
|
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.TG16)
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
setUpBiFrame();
|
2020-06-13 18:34:54 +00:00
|
|
|
|
wii.Content = "TGX";
|
|
|
|
|
}
|
2020-06-08 07:34:21 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-10-02 00:39:35 +00:00
|
|
|
|
private void setUpBiFrame()
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
wii.IsChecked = true;
|
|
|
|
|
ww.Content = "Alt 1";
|
|
|
|
|
hb.Content = "Alt 2";
|
|
|
|
|
ww.Visibility = Visibility.Visible;
|
|
|
|
|
ws.Visibility = Visibility.Visible;
|
|
|
|
|
hb.Visibility = Visibility.Visible;
|
|
|
|
|
wii.Visibility = Visibility.Visible;
|
|
|
|
|
}
|
2020-06-05 11:02:11 +00:00
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
Close();
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FileSelect_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MainViewModel mvm = FindResource("mvm") as MainViewModel;
|
2020-10-02 00:39:35 +00:00
|
|
|
|
string file = mvm.GetFilePath(false, false);
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (!string.IsNullOrEmpty(file))
|
2020-06-05 11:02:11 +00:00
|
|
|
|
{
|
|
|
|
|
string copy = "";
|
|
|
|
|
if (new FileInfo(file).Extension.Contains("tga"))
|
|
|
|
|
{
|
|
|
|
|
using (Process conv = new Process())
|
|
|
|
|
{
|
|
|
|
|
conv.StartInfo.UseShellExecute = false;
|
|
|
|
|
conv.StartInfo.CreateNoWindow = true;
|
2020-10-02 00:39:35 +00:00
|
|
|
|
if (Directory.Exists(Path.Combine(tempPath, "image")))
|
2020-06-05 11:02:11 +00:00
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
Directory.Delete(Path.Combine(tempPath, "image"), true);
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
2020-10-02 00:39:35 +00:00
|
|
|
|
Directory.CreateDirectory(Path.Combine(tempPath, "image"));
|
|
|
|
|
conv.StartInfo.FileName = Path.Combine(toolsPath, "tga2png.exe");
|
|
|
|
|
conv.StartInfo.Arguments = $"-i \"{file}\" -o \"{Path.Combine(tempPath, "image")}\"";
|
2020-06-05 11:02:11 +00:00
|
|
|
|
|
|
|
|
|
conv.Start();
|
|
|
|
|
conv.WaitForExit();
|
|
|
|
|
|
2020-10-02 00:39:35 +00:00
|
|
|
|
foreach (string sFile in Directory.GetFiles(Path.Combine(tempPath, "image"), "*.png"))
|
2020-06-05 11:02:11 +00:00
|
|
|
|
{
|
|
|
|
|
copy = sFile;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
copy = file;
|
|
|
|
|
}
|
2020-09-30 15:06:10 +00:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
bi.TitleScreen = new Bitmap(copy);
|
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
catch
|
2020-10-27 22:51:32 +00:00
|
|
|
|
{
|
|
|
|
|
Custom_Message cm = new Custom_Message("Image Issue", "The image you're trying to use will not work, please try a different image.");
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
cm.Owner = mvm.mw;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
//left empty on purpose
|
|
|
|
|
}
|
|
|
|
|
cm.ShowDialog();
|
2020-09-30 15:06:10 +00:00
|
|
|
|
}
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
2020-06-14 13:04:19 +00:00
|
|
|
|
enOv_Click(null, null);
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Finish_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!Directory.Exists(@"bin\createdIMG"))
|
|
|
|
|
{
|
|
|
|
|
Directory.CreateDirectory(@"bin\createdIMG");
|
|
|
|
|
}
|
2020-10-02 00:39:35 +00:00
|
|
|
|
if (File.Exists(Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
|
2020-06-05 11:02:11 +00:00
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
File.Delete(Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
|
|
|
|
if (drc)
|
|
|
|
|
{
|
|
|
|
|
b = ResizeImage(b, 854, 480);
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-10-02 00:39:35 +00:00
|
|
|
|
b.Save(Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
|
2020-06-05 11:02:11 +00:00
|
|
|
|
|
2020-10-02 00:39:35 +00:00
|
|
|
|
Close();
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
e.Handled = !IsTextAllowed(e.Text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static readonly Regex _regex = new Regex("[^0-9]+"); //regex that matches disallowed text
|
|
|
|
|
private static bool IsTextAllowed(string text)
|
|
|
|
|
{
|
|
|
|
|
return !_regex.IsMatch(text);
|
|
|
|
|
}
|
|
|
|
|
private void TextBoxPasting(object sender, DataObjectPastingEventArgs e)
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
if (e.DataObject.GetDataPresent(typeof(string)))
|
2020-06-05 11:02:11 +00:00
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
string text = (string)e.DataObject.GetData(typeof(string));
|
2020-06-05 11:02:11 +00:00
|
|
|
|
if (!IsTextAllowed(text))
|
|
|
|
|
{
|
|
|
|
|
e.CancelCommand();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
e.CancelCommand();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void wind_Loaded(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
BitmapImage BitmapToImageSource(Bitmap bitmap)
|
|
|
|
|
{
|
|
|
|
|
using (MemoryStream memory = new MemoryStream())
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
bitmap.Save(memory, ImageFormat.Bmp);
|
2020-06-05 11:02:11 +00:00
|
|
|
|
memory.Position = 0;
|
|
|
|
|
BitmapImage bitmapimage = new BitmapImage();
|
|
|
|
|
bitmapimage.BeginInit();
|
|
|
|
|
bitmapimage.StreamSource = memory;
|
|
|
|
|
bitmapimage.CacheOption = BitmapCacheOption.OnLoad;
|
|
|
|
|
bitmapimage.EndInit();
|
|
|
|
|
|
|
|
|
|
return bitmapimage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-05 11:02:11 +00:00
|
|
|
|
|
|
|
|
|
private void enOv_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (enOv.IsChecked == true)
|
2020-06-05 11:02:11 +00:00
|
|
|
|
{
|
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
2020-06-10 21:22:10 +00:00
|
|
|
|
ww.IsEnabled = true;
|
|
|
|
|
wii.IsEnabled = true;
|
|
|
|
|
hb.IsEnabled = true;
|
|
|
|
|
ws.IsEnabled = true;
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-06-10 21:22:10 +00:00
|
|
|
|
ww.IsEnabled = false;
|
|
|
|
|
wii.IsEnabled = false;
|
|
|
|
|
hb.IsEnabled = false;
|
|
|
|
|
ws.IsEnabled = false;
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
|
|
|
|
if (bi.TitleScreen != null)
|
2020-06-05 11:02:11 +00:00
|
|
|
|
{
|
2020-06-14 12:58:40 +00:00
|
|
|
|
b = ResizeImage(bi.TitleScreen, 128, 128); Image.Source = BitmapToImageSource(b);
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-06-10 21:22:10 +00:00
|
|
|
|
b = new Bitmap(128, 128);
|
2020-06-05 11:02:11 +00:00
|
|
|
|
using (Graphics gfx = Graphics.FromImage(b))
|
2020-10-02 00:39:35 +00:00
|
|
|
|
using (SolidBrush brush = new SolidBrush(Color.FromArgb(0, 0, 0)))
|
2020-06-05 11:02:11 +00:00
|
|
|
|
{
|
|
|
|
|
gfx.FillRectangle(brush, 0, 0, 128, 128);
|
|
|
|
|
}
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public static Bitmap ResizeImage(System.Drawing.Image image, int width, int height)
|
|
|
|
|
{
|
2020-10-02 00:39:35 +00:00
|
|
|
|
var destRect = new Rectangle(0, 0, width, height);
|
2020-06-05 11:02:11 +00:00
|
|
|
|
var destImage = new Bitmap(width, height);
|
|
|
|
|
|
|
|
|
|
destImage.SetResolution(image.HorizontalResolution, image.VerticalResolution);
|
|
|
|
|
|
|
|
|
|
using (var graphics = Graphics.FromImage(destImage))
|
|
|
|
|
{
|
|
|
|
|
graphics.CompositingMode = CompositingMode.SourceCopy;
|
|
|
|
|
graphics.CompositingQuality = CompositingQuality.HighQuality;
|
|
|
|
|
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
|
|
|
|
graphics.SmoothingMode = SmoothingMode.HighQuality;
|
|
|
|
|
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
|
|
|
|
|
|
|
|
|
using (var wrapMode = new ImageAttributes())
|
|
|
|
|
{
|
|
|
|
|
wrapMode.SetWrapMode(WrapMode.TileFlipXY);
|
|
|
|
|
graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, wrapMode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return destImage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrawImage()
|
|
|
|
|
{
|
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Players_TextChanged(object sender, TextChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
DrawImage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
2020-07-23 23:12:12 +00:00
|
|
|
|
Dispose(true);
|
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Dispose(bool disposing)
|
|
|
|
|
{
|
|
|
|
|
if (_disposed) return;
|
|
|
|
|
if (disposing)
|
|
|
|
|
{
|
|
|
|
|
bi?.Dispose();
|
|
|
|
|
b?.Dispose();
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-07-23 23:12:12 +00:00
|
|
|
|
_disposed = true;
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void combo_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (combo.SelectedIndex == 0)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = Properties.Resources.SNES_PAL;
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
else if (combo.SelectedIndex == 1)
|
2020-06-05 11:02:11 +00:00
|
|
|
|
{
|
|
|
|
|
bi.Frame = Properties.Resources.SNES_USA;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = Properties.Resources.SFAM;
|
|
|
|
|
}
|
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void pal_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (pal.IsChecked == true)
|
2020-06-05 11:02:11 +00:00
|
|
|
|
{
|
|
|
|
|
bi.Frame = Properties.Resources.SNES_PAL;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = Properties.Resources.SNES_USA;
|
|
|
|
|
}
|
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void RadioButton_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = Properties.Resources.SFAM;
|
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PLDi_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
DrawImage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void RLEn_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
DrawImage();
|
|
|
|
|
}
|
2020-06-10 21:22:10 +00:00
|
|
|
|
|
|
|
|
|
private void ww_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (othercons == "GB")
|
2020-06-13 18:34:54 +00:00
|
|
|
|
{
|
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.GB_alt1);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
console = "other";
|
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.GB_alt2);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
else if (othercons == "GBC")
|
2020-06-13 18:34:54 +00:00
|
|
|
|
{
|
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.GBC_alt1);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
console = "other";
|
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.GBC_alt2);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.NDS)
|
2020-06-13 07:27:42 +00:00
|
|
|
|
{
|
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.NDS_Alt1);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
console = "other";
|
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.NDS_Alt2);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-13 15:53:59 +00:00
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.SNES)
|
|
|
|
|
{
|
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.SNES_alt1);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
console = "other";
|
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.SNES_alt2);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-13 18:34:54 +00:00
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.NES)
|
|
|
|
|
{
|
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.NES_alt1);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
console = "other";
|
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.NES_alt2);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-13 07:27:42 +00:00
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.N64)
|
|
|
|
|
{
|
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.N64_alt1);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
console = "other";
|
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.N64_alt2);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-13 18:34:54 +00:00
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.MSX)
|
|
|
|
|
{
|
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.MSX_alt1);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
console = "other";
|
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.MSX_alt2);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.TG16)
|
|
|
|
|
{
|
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.TGFX_alt1);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
console = "other";
|
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.TGFX_alt2);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).GameConfiguration.Console == GameConsoles.GBA)
|
|
|
|
|
{
|
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.GBA_alt1);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
console = "other";
|
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.GBA_alt2);
|
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-13 07:27:42 +00:00
|
|
|
|
else if ((FindResource("mvm") as MainViewModel).test != GameConsoles.GCN)
|
2020-06-10 21:22:10 +00:00
|
|
|
|
{
|
2020-06-11 14:37:36 +00:00
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.WiiIcon);
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Wii2);
|
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.HBICON);
|
|
|
|
|
}
|
2020-06-10 21:22:10 +00:00
|
|
|
|
}
|
2020-06-11 14:37:36 +00:00
|
|
|
|
else
|
2020-06-10 21:22:10 +00:00
|
|
|
|
{
|
2020-06-11 14:37:36 +00:00
|
|
|
|
if (ww.IsChecked == true)
|
|
|
|
|
{
|
2020-06-11 15:22:58 +00:00
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.GCN_ICON2);
|
2020-06-11 14:37:36 +00:00
|
|
|
|
console = "WII";
|
|
|
|
|
}
|
|
|
|
|
else if (wii.IsChecked == true)
|
|
|
|
|
{
|
2020-06-11 15:22:58 +00:00
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.Icon);
|
|
|
|
|
console = "other";
|
2020-06-11 14:37:36 +00:00
|
|
|
|
}
|
|
|
|
|
else if (hb.IsChecked == true)
|
|
|
|
|
{
|
2020-06-11 16:10:48 +00:00
|
|
|
|
bi.Frame = new Bitmap(Properties.Resources.GCN_ICON3);
|
2020-06-11 15:22:58 +00:00
|
|
|
|
console = "WII";
|
2020-06-11 14:37:36 +00:00
|
|
|
|
}
|
2020-06-10 21:22:10 +00:00
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-10 21:22:10 +00:00
|
|
|
|
DrawImage();
|
|
|
|
|
}
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|