2020-06-01 23:36:49 +00:00
|
|
|
|
using GameBaseClassLibrary;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2020-06-05 11:02:11 +00:00
|
|
|
|
using System.Diagnostics;
|
2020-06-01 23:36:49 +00:00
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Drawing.Drawing2D;
|
|
|
|
|
using System.Drawing.Imaging;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Runtime.InteropServices.ComTypes;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Documents;
|
2020-06-05 11:02:11 +00:00
|
|
|
|
using System.Windows.Forms;
|
2020-06-01 23:36:49 +00:00
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
using UWUVCI_AIO_WPF.Classes;
|
|
|
|
|
|
|
|
|
|
namespace UWUVCI_AIO_WPF.UI.Windows
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaktionslogik für ImageCreator.xaml
|
2020-06-05 11:02:11 +00:00
|
|
|
|
/// </summary>
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-01 23:36:49 +00:00
|
|
|
|
public partial class ImageCreator : Window, IDisposable
|
|
|
|
|
{
|
2020-06-05 11:02:11 +00:00
|
|
|
|
private static readonly string tempPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
|
|
|
|
|
private static readonly string toolsPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
|
2020-06-01 23:36:49 +00:00
|
|
|
|
BootImage bi = new BootImage();
|
|
|
|
|
Bitmap b;
|
|
|
|
|
string console = "other";
|
2020-06-05 11:02:11 +00:00
|
|
|
|
bool drc = false;
|
2020-06-10 22:30:40 +00:00
|
|
|
|
private string backupcons;
|
2020-07-23 23:12:12 +00:00
|
|
|
|
private bool _disposed;
|
2020-06-01 23:36:49 +00:00
|
|
|
|
|
|
|
|
|
public ImageCreator(string name)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
imageName.Content = name;
|
2020-06-15 14:17:50 +00:00
|
|
|
|
|
|
|
|
|
|
2020-06-05 11:02:11 +00:00
|
|
|
|
if (name.ToLower().Contains("drc"))
|
|
|
|
|
{
|
|
|
|
|
drc = true;
|
2020-06-15 14:17:50 +00:00
|
|
|
|
imageName_Copy.Content = "DRC IMAGE";
|
2020-06-05 11:02:11 +00:00
|
|
|
|
}
|
2020-06-01 23:36:49 +00:00
|
|
|
|
}
|
|
|
|
|
public ImageCreator(GameConsoles console, string name) : this(name)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
SetTemplate(console);
|
|
|
|
|
}
|
|
|
|
|
public ImageCreator(bool other, GameConsoles consoles, string name) : this(name)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
Bitmap bit;
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (consoles == GameConsoles.TG16)
|
2020-06-01 23:36:49 +00:00
|
|
|
|
{
|
|
|
|
|
if (other)
|
|
|
|
|
{
|
|
|
|
|
bit = new Bitmap(Properties.Resources.TGCD);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bit = new Bitmap(Properties.Resources.TG16);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.console = "GBC";
|
|
|
|
|
if (other)
|
|
|
|
|
{
|
|
|
|
|
bit = new Bitmap(Properties.Resources.GBC);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bit = new Bitmap(Properties.Resources.newgameboy);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
bi.Frame = bit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SetTemplate(GameConsoles console)
|
|
|
|
|
{
|
|
|
|
|
Bitmap bit;
|
2020-06-14 12:58:40 +00:00
|
|
|
|
switch (console)
|
|
|
|
|
{
|
2020-06-01 23:36:49 +00:00
|
|
|
|
case GameConsoles.NDS:
|
|
|
|
|
bit = new Bitmap(Properties.Resources.NDS);
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-01 23:36:49 +00:00
|
|
|
|
this.console = "NDS";
|
|
|
|
|
break;
|
|
|
|
|
case GameConsoles.N64:
|
|
|
|
|
bit = new Bitmap(Properties.Resources.N64);
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-01 23:36:49 +00:00
|
|
|
|
break;
|
|
|
|
|
case GameConsoles.NES:
|
|
|
|
|
bit = new Bitmap(Properties.Resources.NES);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case GameConsoles.GBA:
|
|
|
|
|
bit = new Bitmap(Properties.Resources.GBA);
|
|
|
|
|
this.console = "GBA";
|
|
|
|
|
break;
|
2020-06-07 22:40:51 +00:00
|
|
|
|
case GameConsoles.WII:
|
|
|
|
|
bit = new Bitmap(Properties.Resources.WII);
|
|
|
|
|
this.console = "WII";
|
|
|
|
|
GameName1.Visibility = Visibility.Hidden;
|
|
|
|
|
GameName2.Visibility = Visibility.Hidden;
|
|
|
|
|
ReleaseYearLabel.Visibility = Visibility.Hidden;
|
|
|
|
|
RLDi.Visibility = Visibility.Hidden;
|
|
|
|
|
RLEn.Visibility = Visibility.Hidden;
|
|
|
|
|
ReleaseYear.Visibility = Visibility.Hidden;
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-07 22:40:51 +00:00
|
|
|
|
PLDi.Visibility = Visibility.Hidden;
|
|
|
|
|
PLEn.Visibility = Visibility.Hidden;
|
|
|
|
|
Players.Visibility = Visibility.Hidden;
|
|
|
|
|
|
|
|
|
|
PlayerLabel.Visibility = Visibility.Hidden;
|
2020-06-10 21:22:10 +00:00
|
|
|
|
snesonly.Visibility = Visibility.Visible;
|
|
|
|
|
pal.Content = "Wii";
|
|
|
|
|
sntsc.Content = "WiiWare";
|
|
|
|
|
sfc.Content = "Homebrew";
|
2020-06-10 22:30:40 +00:00
|
|
|
|
altwii.Visibility = Visibility.Visible;
|
|
|
|
|
backupcons = "WII";
|
2020-06-07 22:40:51 +00:00
|
|
|
|
break;
|
2020-06-01 23:36:49 +00:00
|
|
|
|
case GameConsoles.GCN:
|
|
|
|
|
bit = new Bitmap(Properties.Resources.GCN);
|
|
|
|
|
break;
|
|
|
|
|
case GameConsoles.MSX:
|
|
|
|
|
bit = new Bitmap(Properties.Resources.MSX);
|
|
|
|
|
break;
|
|
|
|
|
case GameConsoles.SNES:
|
|
|
|
|
bit = new Bitmap(Properties.Resources.SNES_PAL);
|
|
|
|
|
snesonly.Visibility = Visibility.Visible;
|
|
|
|
|
List<string> styles = new List<string>();
|
|
|
|
|
styles.Add("SNES - PAL");
|
|
|
|
|
styles.Add("SNES - NTSC");
|
|
|
|
|
styles.Add("Super Famicom");
|
|
|
|
|
combo.ItemsSource = styles;
|
|
|
|
|
combo.SelectedIndex = 0;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
bit = null;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
bi.Frame = bit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FileSelect_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
string file = "";
|
|
|
|
|
MainViewModel mvm = FindResource("mvm") as MainViewModel;
|
2020-06-14 12:58:40 +00:00
|
|
|
|
file = mvm.GetFilePath(false, false);
|
|
|
|
|
if (!string.IsNullOrEmpty(file))
|
2020-06-01 23:36:49 +00:00
|
|
|
|
{
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
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;
|
|
|
|
|
if (Directory.Exists(System.IO.Path.Combine(tempPath, "image")))
|
|
|
|
|
{
|
|
|
|
|
Directory.Delete(System.IO.Path.Combine(tempPath, "image"), true);
|
|
|
|
|
}
|
|
|
|
|
Directory.CreateDirectory(System.IO.Path.Combine(tempPath, "image"));
|
|
|
|
|
conv.StartInfo.FileName = System.IO.Path.Combine(toolsPath, "tga2png.exe");
|
|
|
|
|
conv.StartInfo.Arguments = $"-i \"{file}\" -o \"{System.IO.Path.Combine(tempPath, "image")}\"";
|
|
|
|
|
|
|
|
|
|
conv.Start();
|
|
|
|
|
conv.WaitForExit();
|
|
|
|
|
|
|
|
|
|
foreach (string sFile in Directory.GetFiles(System.IO.Path.Combine(tempPath, "image"), "*.png"))
|
|
|
|
|
{
|
|
|
|
|
copy = sFile;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
copy = file;
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
bi.TitleScreen = new Bitmap(copy);
|
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
2020-06-01 23:36:49 +00:00
|
|
|
|
}
|
2020-06-14 13:04:19 +00:00
|
|
|
|
enOv_Click(null, null);
|
2020-06-01 23:36:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Finish_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!Directory.Exists(@"bin\createdIMG"))
|
|
|
|
|
{
|
|
|
|
|
Directory.CreateDirectory(@"bin\createdIMG");
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (File.Exists(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
|
2020-06-01 23:36:49 +00:00
|
|
|
|
{
|
|
|
|
|
File.Delete(System.IO.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
|
|
|
|
|
|
|
|
|
b.Save(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
|
|
|
|
|
|
|
|
|
|
|
2020-06-01 23:36:49 +00:00
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-05 11:02:11 +00:00
|
|
|
|
private void TextBox_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
2020-06-01 23:36:49 +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
|
2020-07-23 23:12:12 +00:00
|
|
|
|
|
2020-06-01 23:36:49 +00:00
|
|
|
|
private static bool IsTextAllowed(string text)
|
|
|
|
|
{
|
|
|
|
|
return !_regex.IsMatch(text);
|
|
|
|
|
}
|
|
|
|
|
private void TextBoxPasting(object sender, DataObjectPastingEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (e.DataObject.GetDataPresent(typeof(String)))
|
|
|
|
|
{
|
|
|
|
|
String text = (String)e.DataObject.GetData(typeof(String));
|
|
|
|
|
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())
|
|
|
|
|
{
|
|
|
|
|
bitmap.Save(memory, System.Drawing.Imaging.ImageFormat.Bmp);
|
|
|
|
|
memory.Position = 0;
|
|
|
|
|
BitmapImage bitmapimage = new BitmapImage();
|
|
|
|
|
bitmapimage.BeginInit();
|
|
|
|
|
bitmapimage.StreamSource = memory;
|
|
|
|
|
bitmapimage.CacheOption = BitmapCacheOption.OnLoad;
|
|
|
|
|
bitmapimage.EndInit();
|
|
|
|
|
|
|
|
|
|
return bitmapimage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EnableOrDisbale(bool en)
|
|
|
|
|
{
|
|
|
|
|
GameName1.IsEnabled = en;
|
|
|
|
|
GameName2.IsEnabled = en;
|
|
|
|
|
ReleaseYearLabel.IsEnabled = en;
|
|
|
|
|
RLDi.IsEnabled = en;
|
|
|
|
|
RLEn.IsEnabled = en;
|
|
|
|
|
ReleaseYear.IsEnabled = en;
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (en && RLDi.IsChecked == true)
|
2020-06-01 23:36:49 +00:00
|
|
|
|
{
|
|
|
|
|
ReleaseYear.IsEnabled = false;
|
|
|
|
|
}
|
|
|
|
|
PLDi.IsEnabled = en;
|
|
|
|
|
PLEn.IsEnabled = en;
|
|
|
|
|
Players.IsEnabled = en;
|
|
|
|
|
if (en && PLDi.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
Players.IsEnabled = false;
|
|
|
|
|
}
|
|
|
|
|
PlayerLabel.IsEnabled = en;
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (snesonly.IsVisible == true)
|
2020-06-01 23:36:49 +00:00
|
|
|
|
{
|
|
|
|
|
snesonly.IsEnabled = en;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void enOv_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if ((ovl.IsVisible == true && enOv.IsChecked == true))
|
2020-06-01 23:36:49 +00:00
|
|
|
|
{
|
|
|
|
|
EnableOrDisbale(true);
|
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
EnableOrDisbale(false);
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (bi.TitleScreen != null)
|
2020-06-01 23:36:49 +00:00
|
|
|
|
{
|
2020-06-14 12:58:40 +00:00
|
|
|
|
b = ResizeImage(bi.TitleScreen, 1280, 720); Image.Source = BitmapToImageSource(b);
|
2020-06-01 23:36:49 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
b = new Bitmap(1280, 720);
|
|
|
|
|
using (Graphics gfx = Graphics.FromImage(b))
|
|
|
|
|
using (SolidBrush brush = new SolidBrush(System.Drawing.Color.FromArgb(0, 0, 0)))
|
|
|
|
|
{
|
|
|
|
|
gfx.FillRectangle(brush, 0, 0, 1280, 720);
|
|
|
|
|
}
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public static Bitmap ResizeImage(System.Drawing.Image image, int width, int height)
|
|
|
|
|
{
|
|
|
|
|
var destRect = new System.Drawing.Rectangle(0, 0, width, height);
|
|
|
|
|
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()
|
|
|
|
|
{
|
|
|
|
|
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
|
|
|
|
|
2020-06-01 23:36:49 +00:00
|
|
|
|
bi.NameLine1 = GameName1.Text;
|
|
|
|
|
bi.NameLine2 = GameName2.Text;
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(GameName2.Text))
|
|
|
|
|
{
|
|
|
|
|
bi.Longname = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bi.Longname = false;
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
|
|
|
|
if (PLEn.IsChecked == true && !String.IsNullOrWhiteSpace(Players.Text))
|
2020-06-01 23:36:49 +00:00
|
|
|
|
{
|
|
|
|
|
bi.Players = Convert.ToInt32(Players.Text);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bi.Players = 0;
|
|
|
|
|
}
|
|
|
|
|
if (RLEn.IsChecked == true && !String.IsNullOrWhiteSpace(ReleaseYear.Text))
|
|
|
|
|
{
|
|
|
|
|
bi.Released = Convert.ToInt32(ReleaseYear.Text);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bi.Released = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-05 11:02:11 +00:00
|
|
|
|
private void Players_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
2020-06-01 23:36:49 +00:00
|
|
|
|
{
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-01 23:36:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-01 23:36:49 +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-01 23:36:49 +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 (console != "WII" && backupcons != "WII")
|
2020-06-01 23:36:49 +00:00
|
|
|
|
{
|
2020-06-10 21:22:10 +00:00
|
|
|
|
if (pal.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = Properties.Resources.SNES_PAL;
|
2020-06-01 23:36:49 +00:00
|
|
|
|
|
2020-06-10 21:22:10 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = Properties.Resources.SNES_USA;
|
|
|
|
|
}
|
2020-06-01 23:36:49 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-06-10 22:30:40 +00:00
|
|
|
|
|
|
|
|
|
console = "WII";
|
|
|
|
|
switchs(Visibility.Hidden);
|
2020-06-10 21:22:10 +00:00
|
|
|
|
if (pal.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = Properties.Resources.WII;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bi.Frame = Properties.Resources.WIIWARE;
|
|
|
|
|
}
|
2020-06-01 23:36:49 +00:00
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-01 23:36:49 +00:00
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void RadioButton_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (console != "WII" && backupcons != "WII")
|
2020-06-10 21:22:10 +00:00
|
|
|
|
{
|
2020-06-10 22:30:40 +00:00
|
|
|
|
backupcons = console;
|
2020-06-10 21:22:10 +00:00
|
|
|
|
bi.Frame = Properties.Resources.SFAM;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-06-10 22:30:40 +00:00
|
|
|
|
backupcons = "WII";
|
2020-06-14 12:58:40 +00:00
|
|
|
|
if (altwii.IsChecked == false)
|
2020-06-10 22:30:40 +00:00
|
|
|
|
{
|
|
|
|
|
console = "WII";
|
|
|
|
|
switchs(Visibility.Hidden);
|
|
|
|
|
bi.Frame = Properties.Resources.homebrew3;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
switchs(Visibility.Visible);
|
|
|
|
|
console = "other";
|
2020-06-11 15:22:58 +00:00
|
|
|
|
bi.Frame = Properties.Resources.wii3New;
|
2020-06-10 22:30:40 +00:00
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-10 21:22:10 +00:00
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-01 23:36:49 +00:00
|
|
|
|
b = bi.Create(console);
|
|
|
|
|
Image.Source = BitmapToImageSource(b);
|
|
|
|
|
}
|
2020-06-05 11:02:11 +00:00
|
|
|
|
|
|
|
|
|
private void PLDi_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (PLEn.IsChecked != true)
|
|
|
|
|
{
|
|
|
|
|
Players.IsEnabled = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Players.IsEnabled = true;
|
|
|
|
|
}
|
|
|
|
|
DrawImage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void RLEn_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (RLEn.IsChecked != true)
|
|
|
|
|
{
|
|
|
|
|
ReleaseYear.IsEnabled = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ReleaseYear.IsEnabled = true;
|
|
|
|
|
}
|
|
|
|
|
DrawImage();
|
|
|
|
|
}
|
2020-06-10 08:15:58 +00:00
|
|
|
|
|
2020-06-10 22:30:40 +00:00
|
|
|
|
private void switchs(Visibility v)
|
|
|
|
|
{
|
|
|
|
|
GameName1.Visibility = v;
|
|
|
|
|
GameName2.Visibility = v;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReleaseYear.Visibility = v;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Players.Visibility = v;
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
|
|
|
|
if (v == Visibility.Hidden)
|
2020-06-10 22:30:40 +00:00
|
|
|
|
{
|
|
|
|
|
bi.NameLine1 = "";
|
|
|
|
|
bi.NameLine2 = "";
|
|
|
|
|
bi.Released = 0;
|
|
|
|
|
bi.Players = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bi.NameLine1 = GameName1.Text;
|
|
|
|
|
bi.NameLine2 = GameName2.Text;
|
|
|
|
|
if (!String.IsNullOrEmpty(ReleaseYear.Text))
|
|
|
|
|
{
|
|
|
|
|
bi.Released = Convert.ToInt32(ReleaseYear.Text);
|
|
|
|
|
}
|
|
|
|
|
if (!String.IsNullOrEmpty(Players.Text))
|
|
|
|
|
{
|
|
|
|
|
bi.Players = Convert.ToInt32(Players.Text);
|
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-10 22:30:40 +00:00
|
|
|
|
}
|
2020-06-14 12:58:40 +00:00
|
|
|
|
|
2020-06-10 22:30:40 +00:00
|
|
|
|
}
|
2020-06-01 23:36:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|