Added GUI Logic For Injecting (If base nto downlaoded can't inject, rom set, paths show up etc.)

ToDo:
Fix Injection logic and Add Logic to Inject Button (Including Image Issue)
Fix and Add Packing Logic
Add Packing GUI logic
Add Custom Base support ("LOADIINE")
Add Custom Base support (NUS)
Implement Configs feature
Add AutoUpdater.NET
Go live in Beta?
[MAYBE] Implement Downloading as a Task/Thread
[MAYBE] Check if Downloaded Bases Contain the Code Content and Meta folders
This commit is contained in:
NicoAICP 2020-04-04 02:41:56 +02:00
parent 2cdc4c5146
commit 0f8d652080
13 changed files with 264 additions and 34 deletions

View file

@ -9,17 +9,20 @@ using UWUVCI_AIO_WPF.Classes;
namespace UWUVCI_AIO_WPF
{
[Serializable]
class GameConfig
class GameConfig : BaseModel
{
public GameConsoles Console { get; set; }
public GameBases BaseRom { get; set; }
public string CBasePath { get; set; }
public string GameName { get; set; }
public PNGTGA TGAIco { get; set; }
public PNGTGA TGADrc { get; set; }
public PNGTGA TGATv { get; set; }
public PNGTGA TGALog { get; set; }
public N64Conf N64Stuff { get; set; }
public PNGTGA TGAIco { get; set; } = new PNGTGA();
public PNGTGA TGADrc { get; set; } = new PNGTGA();
public PNGTGA TGATv { get; set; } = new PNGTGA();
public PNGTGA TGALog { get; set; } = new PNGTGA();
public N64Conf N64Stuff { get; set; } = new N64Conf();
}
}

View file

@ -6,10 +6,29 @@ using System.Threading.Tasks;
namespace UWUVCI_AIO_WPF.Classes
{
class N64Conf
class N64Conf : BaseModel
{
public string INIPath { get; set; }
private string iniPath;
public string INIPath
{
get { return iniPath; }
set { iniPath = value;
OnPropertyChanged();
}
}
private bool darkFilter;
public bool DarkFilter
{
get { return darkFilter; }
set { darkFilter = value;
OnPropertyChanged();
}
}
public byte[] INIBin { get; set; }
public bool DarkFilter { get; set; }
}
}

View file

@ -6,9 +6,18 @@ using System.Threading.Tasks;
namespace UWUVCI_AIO_WPF.Classes
{
class PNGTGA
class PNGTGA : BaseModel
{
public string ImgPath { get; set; }
public byte[] ImgBin { get; set; }
private string imgPath;
public string ImgPath
{
get { return imgPath; }
set { imgPath = value;
OnPropertyChanged();
}
}
public byte[] ImgBin { get; set; }
}
}

View file

@ -102,6 +102,7 @@ namespace UWUVCI_AIO_WPF
public int OldIndex { get; set; }
public bool RomSet { get; set; }
private List<GameBases> lBases = new List<GameBases>();
@ -254,6 +255,50 @@ namespace UWUVCI_AIO_WPF
Environment.Exit(0);
}
public string GetFilePath(bool ROM, bool INI)
{
string ret = string.Empty;
using (var dialog = new System.Windows.Forms.OpenFileDialog())
{
if (ROM)
{
switch (GameConfiguration.Console)
{
case GameConsoles.NDS:
dialog.Filter = "Nintendo DS ROM (*.nds; *.srl) | *.nds;*.srl";
break;
case GameConsoles.N64:
dialog.Filter = "Nintendo 64 ROM (*.n64; *.v64; *.z64) | *.n64;*.v64;*.z64";
break;
case GameConsoles.GBA:
dialog.Filter = "GameBoy Advance ROM (*.gba) | *.gba";
break;
case GameConsoles.NES:
dialog.Filter = "Nintendo Entertainment System ROM (*.nes) | *.nes";
break;
case GameConsoles.SNES:
dialog.Filter = "Super Nintendo Entertainment System ROM (*.sfc; *.smc) | *.sfc;*.smc";
break;
}
}
else if(!INI)
{
dialog.Filter = "BootImages (*.png; *.tga) | *.png;*.tga";
}
else
{
dialog.Filter = "N64 VC Configuration (*.ini) | *.ini";
}
DialogResult res = dialog.ShowDialog();
if(res == DialogResult.OK)
{
ret = dialog.FileName;
}
}
return ret;
}
private static void CopyBase(string console)
{
File.Copy(console, $@"bases\{console}");

View file

@ -7,12 +7,12 @@ using System.Windows;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("UWUVCI AIO WPF")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("UWUVCI AIO")]
[assembly: AssemblyDescription("Ultimate Wii U Virtual Console Injector")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UWUVCI AIO WPF")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyProduct("UWUVCI AIO")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View file

@ -32,6 +32,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
this.console = console;
mvm = (MainViewModel)FindResource("mvm");
mvm.GetBases(console);
mvm.GameConfiguration.Console = console;
}
public BaseContainerFrame(GameConsoles console, GameBases index)
@ -52,6 +53,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
{
try
{
mvm = FindResource("mvm") as MainViewModel;
if (cbCombo.SelectedIndex != -1 && cbCombo.SelectedIndex != mvm.OldIndex)
{
if (cbCombo.SelectedIndex == 0)

View file

@ -52,6 +52,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
}
private void checkStuff(List<bool> info)
{
mvm.CanInject = false;
if (info[0])
{
tbDWNL.Text = "Base Downloaded";
@ -74,10 +75,12 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Bases
if (info[0])
{
mvm.BaseDownloaded = true;
if (mvm.RomSet) mvm.CanInject = true;
}
else
{
mvm.BaseDownloaded = false;
}
}

View file

@ -17,15 +17,15 @@
<TextBox materialDesign:HintAssist.Hint="BOOTTVTEX" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,219,157,144" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding GameConfiguration.TGATv.ImgPath}"/>
<TextBox materialDesign:HintAssist.Hint="BOOTLOGOTEX" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,264,157,99" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding GameConfiguration.TGALog.ImgPath}"/>
<TextBox materialDesign:HintAssist.Hint="GAME NAME" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,317,157,46" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" Text="{Binding GameConfiguration.GameName}"/>
<Button Content="Inject" HorizontalAlignment="Left" Margin="506,357,0,0" VerticalAlignment="Top" Width="127" Click="Button_Click" IsEnabled="{Binding CanInject}"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,277,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,232,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,187,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,141,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,21,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Inject" HorizontalAlignment="Left" Margin="506,357,0,0" VerticalAlignment="Top" Width="127" Click="InjectGame" IsEnabled="{Binding CanInject}"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,277,0,0" VerticalAlignment="Top" Width="127" Click="Set_LogoTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,232,0,0" VerticalAlignment="Top" Width="127" Click="Set_TvTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,187,0,0" VerticalAlignment="Top" Width="127" Click="Set_DrcTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,141,0,0" VerticalAlignment="Top" Width="127" Click="Set_IconTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,21,0,0" VerticalAlignment="Top" Width="127" Click="Set_Rom_Path"/>
<RadioButton x:Name="rbRDF" Content="Remove DarkFilter" HorizontalAlignment="Left" Margin="11,369,0,0" VerticalAlignment="Top" GroupName="df" IsChecked="{Binding GameConfiguration.N64Stuff.DarkFilter}"/>
<RadioButton Content="Keep DarkFilter" HorizontalAlignment="Left" Margin="151,369,0,0" VerticalAlignment="Top" GroupName="df" IsChecked="True"/>
<TextBox materialDesign:HintAssist.Hint="INI PATH" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,58,157,305" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding GameConfiguration.N64Stuff.INIPath}"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,72,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,72,0,0" VerticalAlignment="Top" Width="127" Click="Set_IniPath"/>
</Grid>
</Page>

View file

@ -12,6 +12,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.Classes;
namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
{
@ -24,12 +25,70 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
public N64Config()
{
mvm = (MainViewModel)FindResource("mvm");
mvm.GameConfiguration.N64Stuff = new N64Conf();
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
private void Set_Rom_Path(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(true, false);
if (!CheckIfNull(path))
{
mvm.RomSet = true;
mvm.RomPath = path;
if (mvm.BaseDownloaded)
{
mvm.CanInject = true;
}
}
}
private void InjectGame(object sender, RoutedEventArgs e)
{
}
private void Set_TvTex(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path)) mvm.GameConfiguration.TGATv.ImgPath = path;
}
private void Set_DrcTex(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path)) mvm.GameConfiguration.TGADrc.ImgPath = path;
}
private void Set_IconTex(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path)) mvm.GameConfiguration.TGAIco.ImgPath = path;
}
private void Set_LogoTex(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path)) mvm.GameConfiguration.TGALog.ImgPath = path;
}
private bool CheckIfNull(string s)
{
if (s == null || s.Equals(string.Empty))
{
return true;
}
return false;
}
private void Set_IniPath(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(false, true);
if (!CheckIfNull(path)) mvm.GameConfiguration.N64Stuff.INIPath = path;
}
}
}

View file

@ -17,11 +17,11 @@
<TextBox materialDesign:HintAssist.Hint="BOOTTVTEX" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,202,157,161" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding GameConfiguration.TGATv.ImgPath}"/>
<TextBox materialDesign:HintAssist.Hint="BOOTLOGOTEX" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,247,157,116" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding GameConfiguration.TGALog.ImgPath}"/>
<TextBox materialDesign:HintAssist.Hint="GAME NAME" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,316,157,47" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" Text="{Binding GameConfiguration.GameName}"/>
<Button Content="Inject" HorizontalAlignment="Left" Margin="506,340,0,0" VerticalAlignment="Top" Width="127" IsEnabled="{Binding CanInject}"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,260,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,215,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,170,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,124,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,51,0,0" VerticalAlignment="Top" Width="127"/>
<Button Content="Inject" HorizontalAlignment="Left" Margin="506,340,0,0" VerticalAlignment="Top" Width="127" IsEnabled="{Binding CanInject}" Click="InjectGame"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,260,0,0" VerticalAlignment="Top" Width="127" Click="Set_LogoTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,215,0,0" VerticalAlignment="Top" Width="127" Click="Set_TvTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,170,0,0" VerticalAlignment="Top" Width="127" Click="Set_DrcTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,124,0,0" VerticalAlignment="Top" Width="127" Click="Set_IconTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,51,0,0" VerticalAlignment="Top" Width="127" Click="Set_Rom_Path"/>
</Grid>
</Page>

View file

@ -12,7 +12,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.Properties;
namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
{
@ -21,14 +21,71 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
/// </summary>
public partial class OtherConfigs : Page, IDisposable
{
MainViewModel mvm;
public OtherConfigs()
{
InitializeComponent();
mvm = FindResource("mvm") as MainViewModel;
}
public void Dispose()
{
}
private void Set_Rom_Path(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(true, false);
if (!CheckIfNull(path)) {
mvm.RomPath = path;
mvm.RomSet = true;
if (mvm.BaseDownloaded)
{
mvm.CanInject = true;
}
}
}
private void InjectGame(object sender, RoutedEventArgs e)
{
}
private void Set_TvTex(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path)) mvm.GameConfiguration.TGATv.ImgPath = path;
}
private void Set_DrcTex(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path)) mvm.GameConfiguration.TGADrc.ImgPath = path;
}
private void Set_IconTex(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path)) mvm.GameConfiguration.TGAIco.ImgPath = path;
}
private void Set_LogoTex(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path)) mvm.GameConfiguration.TGALog.ImgPath = path;
}
private bool CheckIfNull(string s)
{
if(s == null || s.Equals(string.Empty))
{
return true;
}
return false;
}
}
}

View file

@ -61,8 +61,12 @@ namespace UWUVCI_AIO_WPF
private void ListView_Click(object sender, MouseButtonEventArgs e)
{
MainViewModel mvm = FindResource("mvm") as MainViewModel;
mvm.GameConfiguration = new GameConfig();
mvm.LGameBasesString.Clear();
mvm.CanInject = false;
mvm.BaseDownloaded = false;
mvm.RomSet = false;
mvm.RomPath = null;
switch ((sender as ListView).SelectedIndex)
{
case 0:

View file

@ -16,6 +16,21 @@
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -36,6 +51,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="GameBaseClassLibrary">
<HintPath>..\..\GameBaseClassLibrary\GameBaseClassLibrary\bin\Debug\GameBaseClassLibrary.dll</HintPath>
@ -221,7 +239,18 @@
<ItemGroup>
<Resource Include="UI\Images\snes64.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 und x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</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">