Changed design of titlekey window, ckey adding works and also detecting if keys are entered works now.

TODO:
Path menu
Injection Logic
SHould be done then i guess

also fuck spiders
This commit is contained in:
NicoAICP 2020-04-01 01:48:50 +02:00
parent c9c2ac244f
commit 3ac026aa8f
15 changed files with 390 additions and 70 deletions

View file

@ -19,6 +19,9 @@
<setting name="OutPath" serializeAs="String">
<value />
</setting>
<setting name="Ckey" serializeAs="String">
<value />
</setting>
</UWUVCI_AIO_WPF.Properties.Settings>
</userSettings>
</configuration>

View file

@ -11,6 +11,6 @@ namespace UWUVCI_AIO_WPF.Classes
public class TKeys
{
public GameBases Base { get; set; }
public string Tkey { get; set; }
public string Tkey { get; set; } = null;
}
}

View file

@ -121,6 +121,13 @@ namespace UWUVCI_AIO_WPF
set { lSNES = value; OnPropertyChanged(); }
}
private List<GameBases> ltemp = new List<GameBases>();
public List<GameBases> Ltemp
{
get { return ltemp; }
set { ltemp = value; OnPropertyChanged(); }
}
#endregion
@ -193,13 +200,55 @@ namespace UWUVCI_AIO_WPF
}
}
public void EnterKey()
public void getTempList(GameConsoles console)
{
EnterKey ek = new EnterKey();
ek.ShowDialog();
switch (console)
{
case GameConsoles.NDS:
Ltemp = LNDS;
break;
case GameConsoles.N64:
Ltemp = LN64;
break;
case GameConsoles.GBA:
Ltemp = LGBA;
break;
case GameConsoles.NES:
Ltemp = LNES;
break;
case GameConsoles.SNES:
Ltemp = LSNES;
break;
}
}
public void EnterKey(bool ck)
{
EnterKey ek = new EnterKey(ck);
ek.ShowDialog();
}
public bool checkcKey(string key)
{
if (487391367 == key.GetHashCode())
{
Settings.Default.Ckey = key;
Settings.Default.Save();
return true;
}
return false;
}
public bool isCkeySet()
{
if (Settings.Default.Ckey.GetHashCode() == 487391367)
{
return true;
}
else
{
return false;
}
}
public bool checkKey(string key)
{
if(GbTemp.KeyHash == key.GetHashCode())
@ -216,7 +265,7 @@ namespace UWUVCI_AIO_WPF
var temp = KeyFile.ReadBasesFromKeyFile(file);
foreach(TKeys t in temp)
{
if(t.Base == Base)
if(t.Base.Name == Base.Name && t.Base.Region == Base.Region)
{
t.Tkey = key;
}
@ -225,6 +274,22 @@ namespace UWUVCI_AIO_WPF
KeyFile.ExportFile(temp, console);
}
}
public bool isKeySet(GameBases bases)
{
var temp = KeyFile.ReadBasesFromKeyFile($@"keys\{GetConsoleOfBase(bases).ToString().ToLower()}.vck");
foreach(TKeys t in temp)
{
if(t.Base.Name == bases.Name && t.Base.Region == bases.Region)
{
if(t.Tkey != null)
{
return true;
}
}
}
return false;
}
public GameConsoles GetConsoleOfBase(GameBases gb)
{
GameConsoles ret = new GameConsoles();
@ -283,5 +348,34 @@ namespace UWUVCI_AIO_WPF
}
return ret;
}
public List<bool> getInfoOfBase(GameBases gb)
{
List<bool> info = new List<bool>();
if (Directory.Exists($@"{Settings.Default.BasePath}\{gb.Name}[{gb.Region}]"))
{
info.Add(true);
}
else
{
info.Add(false);
}
if (isKeySet(gb))
{
info.Add(true);
}
else
{
info.Add(false);
}
if (isCkeySet())
{
info.Add(true);
}
else
{
info.Add(false);
}
return info;
}
}
}

View file

@ -12,7 +12,7 @@ namespace UWUVCI_AIO_WPF.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@ -58,5 +58,17 @@ namespace UWUVCI_AIO_WPF.Properties {
this["OutPath"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string Ckey {
get {
return ((string)(this["Ckey"]));
}
set {
this["Ckey"] = value;
}
}
}
}

View file

@ -11,5 +11,8 @@
<Setting Name="OutPath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Ckey" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View file

@ -32,7 +32,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
{
createConfig(Base, console);
}
checkStuff(mvm.getInfoOfBase(Base));
}
public NonCustomBaseFrame()
@ -46,6 +46,30 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
mvm.GameConfiguration = new GameConfig();
mvm.GameConfiguration.BaseRom = Base;
mvm.GameConfiguration.Console = console;
}
private void checkStuff(List<bool> info)
{
if (info[0])
{
tbDWNL.Text = "Base Downloaded";
tbDWNL.Foreground = new SolidColorBrush(Color.FromRgb(0, 255, 0));
}
if (info[1])
{
tbTK.Text = "TitleKey Entered";
tbTK.Foreground = new SolidColorBrush(Color.FromRgb(0, 255, 0));
}
if (info[2])
{
tbCK.Text = "CommonKey Entered";
tbCK.Foreground = new SolidColorBrush(Color.FromRgb(0, 255, 0));
}
if(info[1] && info[2])
{
btnDwnlnd.IsEnabled = true;
}
}
}
}

View file

@ -0,0 +1,25 @@
<Page x:Class="UWUVCI_AIO_WPF.UI.Frames.KeyFrame.TKFrame"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:UWUVCI_AIO_WPF.UI.Frames.KeyFrame"
mc:Ignorable="d"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
d:DesignHeight="480" d:DesignWidth="1130"
Title="NDSFrame">
<Grid DataContext="{StaticResource mvm}">
<DataGrid Background="Transparent" AutoGenerateColumns="False" ItemsSource="{Binding Ltemp}" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False" CanUserReorderColumns="False" SelectedItem="{Binding GbTemp}" MouseDoubleClick="DataGrid_MouseDoubleClick" IsReadOnly="True">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
<DataGridTextColumn Header="Region" Binding="{Binding Region}"/>
<DataGridTextColumn Header="Title ID" Binding="{Binding Tid}"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Page>

View file

@ -0,0 +1,40 @@
using GameBaseClassLibrary;
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;
namespace UWUVCI_AIO_WPF.UI.Frames.KeyFrame
{
/// <summary>
/// Interaktionslogik für TKFrame.xaml
/// </summary>
public partial class TKFrame : Page
{
MainViewModel mvm;
public TKFrame(GameConsoles c)
{
InitializeComponent();
mvm = FindResource("mvm") as MainViewModel;
mvm.getTempList(c);
}
private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if(mvm.GbTemp != null)
{
mvm.EnterKey(false);
}
}
}
}

View file

@ -15,7 +15,7 @@
<TextBlock HorizontalAlignment="Left" Margin="325,279,0,0" TextWrapping="Wrap" Text="Injector Theme:" VerticalAlignment="Top" FontSize="20" />
<RadioButton Content="Light Theme" HorizontalAlignment="Left" Margin="494,286,0,0" VerticalAlignment="Top" GroupName="theme" x:Name="rblight" IsChecked="True"/>
<Button Content="Change Theme" HorizontalAlignment="Left" Margin="605,283,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116"/>
<Button Content="Open CK Menu" HorizontalAlignment="Left" Margin="605,174,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116"/>
<Button Content="Open CK Menu" HorizontalAlignment="Left" Margin="605,174,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116" Click="Button_Click_1"/>
<Button Content="Open Path Menu" HorizontalAlignment="Left" Margin="605,127,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116"/>
<Button Content="Open TK Menu" HorizontalAlignment="Left" Margin="605,223,0,0" VerticalAlignment="Top" Width="145" RenderTransformOrigin="-0.099,0.116" Click="Button_Click"/>

View file

@ -35,5 +35,11 @@ namespace UWUVCI_AIO_WPF.UI.Frames
TitleKeys tk = new TitleKeys();
tk.ShowDialog();
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
MainViewModel mvm = FindResource("mvm") as MainViewModel;
mvm.EnterKey(true);
}
}
}

View file

@ -10,9 +10,9 @@
<Grid DataContext="{StaticResource mvm}">
<Button Content="Check" HorizontalAlignment="Left" Margin="405,104,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_1"/>
<Button Content="Abort" HorizontalAlignment="Left" Margin="284,104,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
<TextBlock HorizontalAlignment="Left" Margin="85,10,0,0" TextWrapping="Wrap" Text="{Binding GbTemp.Name}" VerticalAlignment="Top" Height="25" Width="323" FontSize="18" Foreground="Black" Name="Key"/>
<TextBlock HorizontalAlignment="Left" Margin="39,10,0,0" TextWrapping="Wrap" Text="{Binding GbTemp.Name}" VerticalAlignment="Top" Height="25" Width="323" FontSize="18" Foreground="Black" Name="Key"/>
<TextBox Name="tbKey" materialDesign:HintAssist.Hint="TITLE KEY" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,35,20,78" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18"/>
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="{Binding GbTemp.Region}" VerticalAlignment="Top" Height="25" Width="75" FontSize="18" Foreground="Black"/>
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="{Binding GbTemp.Region}" VerticalAlignment="Top" Height="25" Width="24" FontSize="18" Foreground="Black" Name="region"/>
</Grid>
</Window>

View file

@ -19,9 +19,16 @@ namespace UWUVCI_AIO_WPF.UI.Windows
/// </summary>
public partial class EnterKey : Window
{
public EnterKey()
bool ckey = false;
public EnterKey(bool ckey)
{
InitializeComponent();
this.ckey = ckey;
if (ckey)
{
region.Visibility = Visibility.Hidden;
Key.Text = "CommonKey";
}
}
private void Button_Click(object sender, RoutedEventArgs e)
@ -31,11 +38,23 @@ namespace UWUVCI_AIO_WPF.UI.Windows
private void Button_Click_1(object sender, RoutedEventArgs e)
{
MainViewModel mvm = (MainViewModel)FindResource("mvm");
if (mvm.checkKey(tbKey.Text))
if (ckey)
{
this.Close();
MainViewModel mvm = (MainViewModel)FindResource("mvm");
if (mvm.checkcKey(tbKey.Text))
{
this.Close();
}
}
else
{
MainViewModel mvm = (MainViewModel)FindResource("mvm");
if (mvm.checkKey(tbKey.Text))
{
this.Close();
}
}
}
}
}

View file

@ -6,53 +6,39 @@
xmlns:local="clr-namespace:UWUVCI_AIO_WPF"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Title="MAIN" Height="586.885" Width="1392.476" WindowStyle="None" WindowStartupLocation="CenterScreen" Foreground="White" MouseDown="MoveWindow" Background="LightGray" ResizeMode="NoResize">
Title="MAIN" Height="550" Width="1194.525" WindowStyle="None" WindowStartupLocation="CenterScreen" Foreground="White" MouseDown="MoveWindow" Background="LightGray" ResizeMode="NoResize">
<Window.Resources>
<Storyboard x:Key="MenuOpen">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
<EasingDoubleKeyFrame KeyTime="0" Value="60"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="210"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="MenuClose">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
<EasingDoubleKeyFrame KeyTime="0" Value="200"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="60"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</Window.Resources>
<Window.Triggers>
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonOpenMenu">
<BeginStoryboard Storyboard="{StaticResource MenuOpen}"/>
</EventTrigger>
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonCloseMenu">
<BeginStoryboard Storyboard="{StaticResource MenuClose}"/>
</EventTrigger>
</Window.Triggers>
<Grid DataContext="{StaticResource mvm}">
<Grid Margin="0,70,0,0">
<DataGrid Name="dgNDS" ItemsSource="{Binding LNDS}" HorizontalAlignment="Left" Height="420" Margin="35,49,0,0" VerticalAlignment="Top" Width="247" Background="{x:Null}" BorderBrush="Black" SelectionMode="Single" AutoGenerateColumns="False" CanUserReorderColumns="False" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False" CanUserResizeColumns="False" CanUserSortColumns="False" SelectedItem="{Binding GbTemp}">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
<DataGridTextColumn Header="Region" Binding="{Binding Region}"/>
</DataGrid.Columns>
</DataGrid>
<TextBlock HorizontalAlignment="Left" Margin="38,21,0,0" TextWrapping="Wrap" Text="NDS" VerticalAlignment="Top" Foreground="Black" FontSize="18"/>
<DataGrid ItemsSource="{Binding LGBA}" Name="dgGBA" SelectedItem="{Binding GbTemp}" HorizontalAlignment="Left" Height="420" Margin="298,50,0,0" VerticalAlignment="Top" Width="247" Background="{x:Null}" BorderBrush="Black" SelectionMode="Single" AutoGenerateColumns="False" CanUserReorderColumns="False" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False" CanUserResizeColumns="False" CanUserSortColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
<DataGridTextColumn Header="Region" Binding="{Binding Region}"/>
</DataGrid.Columns>
</DataGrid>
<TextBlock HorizontalAlignment="Left" Margin="301,22,0,0" TextWrapping="Wrap" Text="GBA" VerticalAlignment="Top" Foreground="Black" FontSize="18"/>
<DataGrid ItemsSource="{Binding LN64}" Name="dgN64" SelectedItem="{Binding GbTemp}" HorizontalAlignment="Left" Height="420" Margin="561,50,0,0" VerticalAlignment="Top" Width="247" Background="{x:Null}" BorderBrush="Black" SelectionMode="Single" AutoGenerateColumns="False" CanUserReorderColumns="False" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False" CanUserResizeColumns="False" CanUserSortColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
<DataGridTextColumn Header="Region" Binding="{Binding Region}"/>
</DataGrid.Columns>
</DataGrid>
<TextBlock HorizontalAlignment="Left" Margin="564,22,0,0" TextWrapping="Wrap" Text="N64" VerticalAlignment="Top" Foreground="Black" FontSize="18"/>
<DataGrid Name="dgNES" ItemsSource="{Binding LNES}" SelectedItem="{Binding GbTemp}" HorizontalAlignment="Left" Height="420" Margin="821,49,0,0" VerticalAlignment="Top" Width="247" Background="{x:Null}" BorderBrush="Black" SelectionMode="Single" AutoGenerateColumns="False" CanUserReorderColumns="False" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False" CanUserResizeColumns="False" CanUserSortColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
<DataGridTextColumn Header="Region" Binding="{Binding Region}"/>
</DataGrid.Columns>
</DataGrid>
<TextBlock HorizontalAlignment="Left" Margin="824,21,0,0" TextWrapping="Wrap" Text="NES" VerticalAlignment="Top" Foreground="Black" FontSize="18"/>
<DataGrid ItemsSource="{Binding LSNES}" Name="dgSNES" SelectedItem="{Binding GbTemp}" HorizontalAlignment="Left" Height="420" Margin="1088,50,0,0" VerticalAlignment="Top" Width="247" Background="{x:Null}" BorderBrush="Black" SelectionMode="Single" AutoGenerateColumns="False" CanUserReorderColumns="False" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False" CanUserResizeColumns="False" CanUserSortColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
<DataGridTextColumn Header="Region" Binding="{Binding Region}"/>
</DataGrid.Columns>
</DataGrid>
<TextBlock HorizontalAlignment="Left" Margin="1091,22,0,0" TextWrapping="Wrap" Text="SNES" VerticalAlignment="Top" Foreground="Black" FontSize="18"/>
<Button Content="Enter Key of Selected Title" HorizontalAlignment="Left" Margin="1165,475,0,0" VerticalAlignment="Top" Width="205" Click="Button_Click"/>
<Grid Margin="60,70,0,0">
<Frame x:Name="load_frame" NavigationUIVisibility="Hidden"/>
<TextBlock Text="" HorizontalAlignment="Left" Margin="10,158,0,0" VerticalAlignment="Top" Height="106" Width="1115" FontSize="22" Name="tbA" Foreground="Black" />
</Grid>
<Grid Height="72" VerticalAlignment="Top" Margin="0,-2,0,0">
<Grid.Background>
@ -65,15 +51,70 @@
</Grid.Background>
<TextBlock Name="tbTitleBar" HorizontalAlignment="Left" Margin="61,19,0,0" TextWrapping="Wrap" Text="UWUVCI AIO - TitleKeys" VerticalAlignment="Top" FontSize="25" Width="1266" TextAlignment="Center"/>
<TextBlock Name="tbTitleBar" HorizontalAlignment="Left" Margin="61,19,0,0" TextWrapping="Wrap" Text="UWUVCI AIO - TitleKeys" VerticalAlignment="Top" FontSize="25" Width="1075" TextAlignment="Center"/>
</Grid>
<Grid x:Name="GridMenu" Width="60" HorizontalAlignment="Left">
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#5B6EAD" Offset="1"/>
<GradientStop Color="#7289DA" Offset="0"/>
<GradientStop Color="#6175B7" Offset="0.5"/>
</LinearGradientBrush>
</Grid.Background>
<StackPanel>
<Grid Height="70">
<Button x:Name="ButtonCloseMenu" Width="60" Height="60" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,5,0,0" Visibility="Collapsed" Click="ButtonCloseMenu_Click">
<materialDesign:PackIcon Foreground="White" Kind="ArrowLeft" Height="25" Width="25" />
</Button>
<Button x:Name="ButtonOpenMenu" Width="60" Height="60" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,5,0,0" Click="ButtonOpenMenu_Click">
<materialDesign:PackIcon Foreground="White" Kind="HamburgerMenu" Height="25" Width="25"/>
</Button>
</Grid>
<ListView Foreground="White" ScrollViewer.HorizontalScrollBarVisibility="Disabled" PreviewMouseLeftButtonUp="ListView_Click">
<!--NDS-->
<ListViewItem Height="60" x:Name="NDS" Cursor="Hand">
<StackPanel Orientation="Horizontal">
<Image Source="/UWUVCI AIO WPF;component/UI/Images/nds64v64.png"></Image>
<TextBlock Text="NDS VC Inject" VerticalAlignment="Center" Margin="20 10"/>
</StackPanel>
</ListViewItem>
<!--GBA-->
<ListViewItem Height="60" x:Name="GBA" Cursor="Hand">
<StackPanel Orientation="Horizontal">
<Image Source="/UWUVCI AIO WPF;component/UI/Images/gba64.png"></Image>
<TextBlock Text="GBA VC Inject" VerticalAlignment="Center" Margin="20 10"/>
</StackPanel>
</ListViewItem>
<!--N64-->
<ListViewItem Height="60" x:Name="N64" Cursor="Hand">
<StackPanel Orientation="Horizontal">
<Image Source="/UWUVCI AIO WPF;component/UI/Images/n64colorless.png"></Image>
<TextBlock Text="N64 VC Inject" VerticalAlignment="Center" Margin="20 10"/>
</StackPanel>
</ListViewItem>
<!--NES-->
<ListViewItem Height="60" x:Name="NES" Cursor="Hand">
<StackPanel Orientation="Horizontal">
<Image Source="/UWUVCI AIO WPF;component/UI/Images/nes64.png"></Image>
<TextBlock Text="NES VC Inject" VerticalAlignment="Center" Margin="20 10"/>
</StackPanel>
</ListViewItem>
<!--SNES-->
<ListViewItem Height="60" x:Name="SNES" Cursor="Hand">
<StackPanel Orientation="Horizontal">
<Image Source="/UWUVCI AIO WPF;component/UI/Images/snes64.png"></Image>
<TextBlock Text="SNES VC Inject" VerticalAlignment="Center" Margin="20 10"/>
</StackPanel>
</ListViewItem>
</ListView>
</StackPanel>
</Grid>
<TextBlock HorizontalAlignment="Left" Margin="1362,15,0,0" TextWrapping="Wrap" Text="X" VerticalAlignment="Top" Foreground="White" FontSize="16"/>
<Button Content="" HorizontalAlignment="Left" Margin="1358,13,0,0" VerticalAlignment="Top" Width="18" Background="{x:Null}" BorderBrush="{x:Null}" Height="25" Click="Window_Close"/>
<TextBlock HorizontalAlignment="Left" Margin="1335,15,0,0" TextWrapping="Wrap" Text="__" VerticalAlignment="Top" Foreground="White" FontSize="16"/>
<Button Content="" HorizontalAlignment="Left" Margin="1333,13,0,0" VerticalAlignment="Top" Width="18" Background="{x:Null}" BorderBrush="{x:Null}" Height="25" Click="Window_Minimize"/>
<TextBlock HorizontalAlignment="Left" Margin="1164,12,0,0" TextWrapping="Wrap" Text="X" VerticalAlignment="Top" Foreground="White" FontSize="16"/>
<Button Content="Button" HorizontalAlignment="Left" Margin="1160,11,0,0" VerticalAlignment="Top" Width="18" Background="{x:Null}" BorderBrush="{x:Null}" Height="25" Click="Window_Close"/>
<TextBlock HorizontalAlignment="Left" Margin="1144,11,0,0" TextWrapping="Wrap" Text="__" VerticalAlignment="Top" Foreground="White" FontSize="16"/>
<Button Content="Button" HorizontalAlignment="Left" Margin="1140,11,0,0" VerticalAlignment="Top" Width="18" Background="{x:Null}" BorderBrush="{x:Null}" Height="25" Click="Window_Minimize"/>
</Grid>
</Window>

View file

@ -12,6 +12,8 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.UI.Frames;
using UWUVCI_AIO_WPF.UI.Frames.KeyFrame;
namespace UWUVCI_AIO_WPF.UI.Windows
{
@ -23,16 +25,18 @@ namespace UWUVCI_AIO_WPF.UI.Windows
public TitleKeys()
{
InitializeComponent();
tbA.Text = "To enter a TitleKey, first select the console on your left\nand then double click on a Title you want to enter the Key for.";
}
private void Window_Close(object sender, RoutedEventArgs e)
private void ButtonCloseMenu_Click(object sender, RoutedEventArgs e)
{
this.Close();
ButtonOpenMenu.Visibility = Visibility.Visible;
ButtonCloseMenu.Visibility = Visibility.Collapsed;
}
private void Window_Minimize(object sender, RoutedEventArgs e)
private void ButtonOpenMenu_Click(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
ButtonOpenMenu.Visibility = Visibility.Collapsed;
ButtonCloseMenu.Visibility = Visibility.Visible;
}
private void MoveWindow(object sender, MouseButtonEventArgs e)
{
@ -46,11 +50,52 @@ namespace UWUVCI_AIO_WPF.UI.Windows
}
}
private void Button_Click(object sender, RoutedEventArgs e)
private void DestroyFrame()
{
MainViewModel mvm = (MainViewModel)FindResource("mvm");
mvm.EnterKey();
//(load_frame.Content as IDisposable).Dispose();
load_frame.Content = null;
load_frame.NavigationService.RemoveBackEntry();
}
private void ListView_Click(object sender, MouseButtonEventArgs e)
{
tbA.Visibility = Visibility.Hidden;
switch ((sender as ListView).SelectedIndex)
{
case 0:
DestroyFrame();
tbTitleBar.Text = "UWUVCI AIO - NDS TKeys";
load_frame.Content = new TKFrame(GameConsoles.NDS);
break;
case 1:
DestroyFrame();
tbTitleBar.Text = "UWUVCI AIO - GBA TKeys";
load_frame.Content = new TKFrame(GameConsoles.GBA);
break;
case 2:
DestroyFrame();
tbTitleBar.Text = "UWUVCI AIO - N64 TKeys";
load_frame.Content = new TKFrame(GameConsoles.N64);
break;
case 3:
DestroyFrame();
tbTitleBar.Text = "UWUVCI AIO - NES TKeys";
load_frame.Content = new TKFrame(GameConsoles.NES);
break;
case 4:
DestroyFrame();
tbTitleBar.Text = "UWUVCI AIO - TKeys";
load_frame.Content = new TKFrame(GameConsoles.SNES);
break;
}
}
private void Window_Close(object sender, RoutedEventArgs e)
{
this.Close();
}
private void Window_Minimize(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
}
}
}

View file

@ -70,6 +70,9 @@
</ApplicationDefinition>
<Compile Include="Classes\KeyFile.cs" />
<Compile Include="Classes\TKeys.cs" />
<Compile Include="UI\Frames\KeyFrame\TKFrame.xaml.cs">
<DependentUpon>TKFrame.xaml</DependentUpon>
</Compile>
<Compile Include="UI\Windows\EnterKey.xaml.cs">
<DependentUpon>EnterKey.xaml</DependentUpon>
</Compile>
@ -100,6 +103,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI\Frames\KeyFrame\TKFrame.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI\Frames\SettingsFrame.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -214,6 +221,7 @@
<ItemGroup>
<Resource Include="UI\Images\snes64.png" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">