UWUVCI-AIO-WPF/UWUVCI AIO WPF/UI/Windows/MenuWindow.xaml.cs

286 lines
10 KiB
C#
Raw Normal View History

2020-03-01 13:12:17 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.UI.Frames;
using GameBaseClassLibrary;
using UWUVCI_AIO_WPF.UI.Frames.Path;
2020-03-01 13:12:17 +00:00
namespace UWUVCI_AIO_WPF
{
/// <summary>
/// Interaktionslogik für MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
load_frame.Content = new StartFrame();
(FindResource("mvm") as MainViewModel).setMW(this);
2020-03-01 13:12:17 +00:00
}
private void ButtonCloseMenu_Click(object sender, RoutedEventArgs e)
{
ButtonOpenMenu.Visibility = Visibility.Visible;
ButtonCloseMenu.Visibility = Visibility.Collapsed;
}
private void ButtonOpenMenu_Click(object sender, RoutedEventArgs e)
{
ButtonOpenMenu.Visibility = Visibility.Collapsed;
ButtonCloseMenu.Visibility = Visibility.Visible;
}
private void MoveWindow(object sender, MouseButtonEventArgs e)
{
try
{
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
catch (Exception)
{
}
}
private void DestroyFrame()
{
//(load_frame.Content as IDisposable).Dispose();
load_frame.Content = null;
load_frame.NavigationService.RemoveBackEntry();
}
2020-03-01 13:12:17 +00:00
private void ListView_Click(object sender, MouseButtonEventArgs e)
{
2020-04-21 02:05:19 +00:00
MainViewModel mvm = FindResource("mvm") as MainViewModel;
2020-04-21 19:52:52 +00:00
/*if((sender as ListView).SelectedIndex == 9)
{
mvm.saveconf = mvm.GameConfiguration.Clone();
}*/
if (mvm.curr != null)
2020-04-21 02:05:19 +00:00
{
mvm.curr.Background = null;
}
mvm.curr = (sender as ListView).SelectedItem as ListViewItem;
mvm.curr.Background = new SolidColorBrush(Color.FromArgb(25, 255, 255, 255));
mvm.GameConfiguration = new GameConfig();
mvm.LGameBasesString.Clear();
mvm.CanInject = false;
mvm.BaseDownloaded = false;
mvm.RomSet = false;
mvm.RomPath = null;
mvm.Injected = false;
2020-04-06 19:30:31 +00:00
mvm.CBasePath = null;
mvm.bcf = null;
mvm.BootSound = null;
2020-04-06 19:30:31 +00:00
mvm.setThing(null);
switch ((sender as ListView).SelectedIndex)
{
case 0:
DestroyFrame();
2020-04-21 02:05:19 +00:00
mvm.GC = false;
tbTitleBar.Text = "UWUVCI AIO - NDS VC INJECT";
2020-04-21 19:52:52 +00:00
/* if(mvm.saveconf != null && mvm.saveconf.Console == GameConsoles.NDS)
2020-04-21 02:05:19 +00:00
{
load_frame.Content = new INJECTFRAME(GameConsoles.NDS, mvm.saveconf);
}
else
2020-04-21 19:52:52 +00:00
{*/
2020-04-21 02:05:19 +00:00
load_frame.Content = new INJECTFRAME(GameConsoles.NDS);
2020-04-21 19:52:52 +00:00
//}
mvm.saveconf = null;
break;
case 1:
DestroyFrame();
2020-04-21 02:05:19 +00:00
mvm.GC = false;
tbTitleBar.Text = "UWUVCI AIO - GBA VC INJECT";
2020-04-21 19:52:52 +00:00
/*if (mvm.saveconf != null && mvm.saveconf.Console == GameConsoles.GBA)
2020-04-21 02:05:19 +00:00
{
load_frame.Content = new INJECTFRAME(GameConsoles.GBA, mvm.saveconf);
}
else
2020-04-21 19:52:52 +00:00
{*/
2020-04-21 02:05:19 +00:00
load_frame.Content = new INJECTFRAME(GameConsoles.GBA);
2020-04-21 19:52:52 +00:00
//}
mvm.saveconf = null;
break;
case 2:
DestroyFrame();
2020-04-21 02:05:19 +00:00
mvm.GC = false;
tbTitleBar.Text = "UWUVCI AIO - N64 VC INJECT";
2020-04-21 19:52:52 +00:00
/*if (mvm.saveconf != null && mvm.saveconf.Console == GameConsoles.N64)
2020-04-21 02:05:19 +00:00
{
load_frame.Content = new INJECTFRAME(GameConsoles.N64, mvm.saveconf);
}
else
2020-04-21 19:52:52 +00:00
{*/
2020-04-21 02:05:19 +00:00
mvm.GameConfiguration.N64Stuff = new Classes.N64Conf();
load_frame.Content = new INJECTFRAME(GameConsoles.N64);
2020-04-21 19:52:52 +00:00
//}
mvm.saveconf = null;
break;
case 4:
DestroyFrame();
2020-04-21 02:05:19 +00:00
mvm.GC = false;
tbTitleBar.Text = "UWUVCI AIO - NES VC INJECT";
2020-04-21 19:52:52 +00:00
/*if (mvm.saveconf != null && mvm.saveconf.Console == GameConsoles.NES)
2020-04-21 02:05:19 +00:00
{
load_frame.Content = new INJECTFRAME(GameConsoles.NES, mvm.saveconf);
}
else
2020-04-21 19:52:52 +00:00
{*/
2020-04-21 02:05:19 +00:00
load_frame.Content = new INJECTFRAME(GameConsoles.NES);
2020-04-21 19:52:52 +00:00
//}
mvm.saveconf = null;
break;
case 3:
DestroyFrame();
2020-04-21 02:05:19 +00:00
mvm.GC = false;
tbTitleBar.Text = "UWUVCI AIO - SNES VC INJECT";
2020-04-21 19:52:52 +00:00
/*if (mvm.saveconf != null && mvm.saveconf.Console == GameConsoles.SNES)
2020-04-21 02:05:19 +00:00
{
load_frame.Content = new INJECTFRAME(GameConsoles.SNES, mvm.saveconf);
}
else
2020-04-21 19:52:52 +00:00
{*/
2020-04-21 02:05:19 +00:00
load_frame.Content = new INJECTFRAME(GameConsoles.SNES);
mvm.saveconf = null;
2020-04-21 19:52:52 +00:00
//}
break;
case 5:
DestroyFrame();
2020-04-21 02:05:19 +00:00
mvm.GC = false;
tbTitleBar.Text = "UWUVCI AIO - TurboGrafX-16 VC INJECT";
2020-04-21 19:52:52 +00:00
/*if (mvm.saveconf != null && mvm.saveconf.Console == GameConsoles.TG16 )
2020-04-21 02:05:19 +00:00
{
load_frame.Content = new INJECTFRAME(GameConsoles.TG16, mvm.saveconf);
}
else
2020-04-21 19:52:52 +00:00
{*/
2020-04-21 02:05:19 +00:00
load_frame.Content = new INJECTFRAME(GameConsoles.TG16);
2020-04-21 19:52:52 +00:00
// }
mvm.saveconf = null;
break;
case 6:
2020-04-07 01:09:05 +00:00
DestroyFrame();
2020-04-21 02:05:19 +00:00
mvm.GC = false;
2020-04-07 01:09:05 +00:00
tbTitleBar.Text = "UWUVCI AIO - MSX VC INJECT";
2020-04-21 19:52:52 +00:00
/*if (mvm.saveconf != null && mvm.saveconf.Console == GameConsoles.MSX)
2020-04-21 02:05:19 +00:00
{
load_frame.Content = new INJECTFRAME(GameConsoles.MSX, mvm.saveconf);
}
else
2020-04-21 19:52:52 +00:00
{*/
2020-04-21 02:05:19 +00:00
load_frame.Content = new INJECTFRAME(GameConsoles.MSX);
2020-04-21 19:52:52 +00:00
//}
mvm.saveconf = null;
2020-04-07 01:09:05 +00:00
break;
case 7:
2020-04-16 04:41:25 +00:00
DestroyFrame();
2020-04-21 02:05:19 +00:00
mvm.GC = false;
2020-04-16 04:41:25 +00:00
tbTitleBar.Text = "UWUVCI AIO - Wii VC INJECT";
2020-04-21 19:52:52 +00:00
/*if (mvm.saveconf != null && mvm.saveconf.Console == GameConsoles.WII)
2020-04-21 02:05:19 +00:00
{
load_frame.Content = new INJECTFRAME(GameConsoles.WII, mvm.saveconf);
}
else
2020-04-21 19:52:52 +00:00
{*/
2020-04-21 02:05:19 +00:00
load_frame.Content = new INJECTFRAME(GameConsoles.WII);
2020-04-21 19:52:52 +00:00
//}
mvm.saveconf = null;
2020-04-16 04:41:25 +00:00
break;
case 8:
DestroyFrame();
tbTitleBar.Text = "UWUVCI AIO - GC VC INJECT";
2020-04-21 19:52:52 +00:00
/*if (mvm.saveconf != null && (mvm.saveconf.Console == GameConsoles.WII || mvm.saveconf.Console == GameConsoles.GCN) && mvm.GC == true)
2020-04-21 02:05:19 +00:00
{
load_frame.Content = new INJECTFRAME(GameConsoles.GCN, mvm.saveconf);
}
else
2020-04-21 19:52:52 +00:00
{*/
2020-04-21 02:05:19 +00:00
load_frame.Content = new INJECTFRAME(GameConsoles.GCN);
2020-04-21 19:52:52 +00:00
//}
mvm.saveconf = null;
2020-04-16 04:41:25 +00:00
break;
case 9:
DestroyFrame();
tbTitleBar.Text = "UWUVCI AIO - SETTINGS";
load_frame.Content = new SettingsFrame(this);
2020-04-25 06:40:38 +00:00
break;
}
2020-04-21 02:05:19 +00:00
2020-03-01 13:12:17 +00:00
}
public void paths(bool remove)
{
load_frame.Content = null;
if (remove)
{
load_frame.Content = new SettingsFrame(this);
}
else
{
load_frame.Content = new Paths(this);
}
}
2020-03-01 13:12:17 +00:00
private void Window_Close(object sender, RoutedEventArgs e)
{
this.Close();
}
private void Window_Minimize(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
}
private void Button_MouseEnter(object sender, MouseEventArgs e)
{
min.Background = new SolidColorBrush(Color.FromArgb(100, 255, 255, 255));
}
private void close_MouseEnter(object sender, MouseEventArgs e)
{
close.Background = new SolidColorBrush(Color.FromArgb(150,255, 100, 100));
}
private void close_MouseLeave(object sender, MouseEventArgs e)
{
close.Background = new SolidColorBrush(Color.FromArgb(0, 250, 250, 250));
}
private void min_MouseLeave(object sender, MouseEventArgs e)
{
min.Background = new SolidColorBrush(Color.FromArgb(0, 250, 250, 250));
}
public void setDebug()
{
MainViewModel mvm = FindResource("mvm") as MainViewModel;
mvm.debug = true;
}
2020-03-01 13:12:17 +00:00
}
}