Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,4 @@ UpgradeLog*.htm

# Microsoft Fakes
FakesAssemblies/
.vs/
39 changes: 15 additions & 24 deletions YGOPro Tweaker/App.config
Original file line number Diff line number Diff line change
@@ -1,44 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>

</configSections>
<startup>

<supportedRuntime version="v2.0.50727" /></startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
<parameter value="v11.0"/>
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"/>
</providers>
</entityFramework>
<system.data>
<!--
NOTE: The extra "remove" element below is to prevent the design-time
support components within EF6 from selecting the legacy ADO.NET
provider for SQLite (i.e. the one without any EF6 support). It
appears to only consider the first ADO.NET provider in the list
within the resulting "app.config" or "web.config" file.
-->
<DbProviderFactories>


<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
</system.data>

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.97.0" newVersion="1.0.97.0" />
<assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.0.97.0" newVersion="1.0.97.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite"/>
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/>
</DbProviderFactories>
</system.data></configuration>
9 changes: 3 additions & 6 deletions YGOPro Tweaker/CConf.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

using System.IO;
using System.Text.RegularExpressions;

namespace YGOPro_Tweaker
Expand Down Expand Up @@ -38,9 +35,9 @@ public enum configVar
mute_opponent,
mute_spectators,
volume,
background,
alignment_fix,
show_anime
show_anime,
ignore_instant_updates
}

public string readConfig(configVar config)
Expand Down
184 changes: 0 additions & 184 deletions YGOPro Tweaker/CLanguage.cs

This file was deleted.

3 changes: 1 addition & 2 deletions YGOPro Tweaker/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace YGOPro_Tweaker
Expand All @@ -14,7 +13,7 @@ static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmSelectLanguage());
Application.Run(new frmMain());
}
}
}
7 changes: 3 additions & 4 deletions YGOPro Tweaker/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand All @@ -10,7 +9,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("YGOProTH")]
[assembly: AssemblyProduct("YGOPro Tweaker")]
[assembly: AssemblyCopyright("Copyright © 2013 YGOProTH")]
[assembly: AssemblyCopyright("Copyright © 2013-2016 YGOProTH")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.5.0")]
[assembly: AssemblyFileVersion("1.8.5.0")]
[assembly: AssemblyVersion("2.2.0.0")]
[assembly: AssemblyFileVersion("2.2.0.0")]
22 changes: 1 addition & 21 deletions YGOPro Tweaker/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions YGOPro Tweaker/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,4 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Thailand-Flag-icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Thailand-Flag-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="United-Kingdom-flag-icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\United-Kingdom-flag-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
2 changes: 1 addition & 1 deletion YGOPro Tweaker/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed YGOPro Tweaker/Resources/Thailand-Flag-icon.png
Binary file not shown.
Binary file not shown.
30 changes: 11 additions & 19 deletions YGOPro Tweaker/YGOPro Tweaker.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand All @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>YGOPro_Tweaker</RootNamespace>
<AssemblyName>YGOPro Tweaker</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
Expand Down Expand Up @@ -61,19 +61,18 @@
</ItemGroup>
<ItemGroup>
<Compile Include="CConf.cs" />
<Compile Include="CLanguage.cs" />
<Compile Include="CReplayManager.cs" />
<Compile Include="frmConfig.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmConfig.Designer.cs">
<DependentUpon>frmConfig.cs</DependentUpon>
</Compile>
<Compile Include="frmDeckExtractor.cs">
<Compile Include="FrmDeckExtractor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmDeckExtractor.Designer.cs">
<DependentUpon>frmDeckExtractor.cs</DependentUpon>
<Compile Include="FrmDeckExtractor.Designer.cs">
<DependentUpon>FrmDeckExtractor.cs</DependentUpon>
</Compile>
<Compile Include="frmDeckList.cs">
<SubType>Form</SubType>
Expand All @@ -87,29 +86,21 @@
<Compile Include="frmMain.Designer.cs">
<DependentUpon>frmMain.cs</DependentUpon>
</Compile>
<Compile Include="frmSelectLanguage.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmSelectLanguage.Designer.cs">
<DependentUpon>frmSelectLanguage.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="YGOProUtils.cs" />
<EmbeddedResource Include="frmConfig.resx">
<DependentUpon>frmConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmDeckExtractor.resx">
<DependentUpon>frmDeckExtractor.cs</DependentUpon>
<EmbeddedResource Include="FrmDeckExtractor.resx">
<DependentUpon>FrmDeckExtractor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmDeckList.resx">
<DependentUpon>frmDeckList.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmMain.resx">
<DependentUpon>frmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmSelectLanguage.resx">
<DependentUpon>frmSelectLanguage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
Expand All @@ -136,8 +127,9 @@
</ItemGroup>
<ItemGroup>
<Content Include="Guillendesign-Variations-3-Tools.ico" />
<None Include="Resources\United-Kingdom-flag-icon.png" />
<None Include="Resources\Thailand-Flag-icon.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.98.1\build\net20\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.98.1\build\net20\System.Data.SQLite.Core.targets')" />
Expand Down
88 changes: 88 additions & 0 deletions YGOPro Tweaker/YGOProUtils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
using System.Collections.Generic;
using System.Data.SQLite;
using System.IO;
using System.Windows.Forms;

namespace YGOPro_Tweaker
{
public class YGOProUtils
{
private static YGOProUtils INSTANCE = null;
private Dictionary<int, string> _CardIdToNameCache = new Dictionary<int, string>();

private YGOProUtils() { }

public static YGOProUtils getInstance()
{
if (INSTANCE == null)
{
INSTANCE = new YGOProUtils();
}

return INSTANCE;
}

public string GetCardName(int CardId)
{
if (_CardIdToNameCache.ContainsKey(CardId))
{
return _CardIdToNameCache[CardId];
}

var CardName = _GetCardName(CardId);
_CardIdToNameCache[CardId] = CardName;

return CardName;
}

private string _GetCardName(int CardID)
{
// Normal
using (var conn = new SQLiteConnection(@"Data Source=cards.cdb"))
using (var cmd = conn.CreateCommand())
{
conn.Open();
cmd.CommandText = "SELECT name FROM texts WHERE id LIKE @CardID";
cmd.Parameters.Add(new SQLiteParameter("@CardID", CardID));
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
string CardName = reader.GetString(reader.GetOrdinal("name"));
return CardName;
}
}
conn.Close();
}

// Expansions
string[] expansionDirectories = Directory.GetDirectories(Application.StartupPath + @"\expansions\");
foreach (string directory in expansionDirectories)
{
string[] expansionsDatabaseFileList = Directory.GetFiles(directory, "*.cdb", SearchOption.TopDirectoryOnly);
foreach (string exp in expansionsDatabaseFileList)
{
using (var conn = new SQLiteConnection(@"Data Source=" + Path.Combine(directory, exp)))
using (var cmd = conn.CreateCommand())
{
try { conn.Open(); } catch { return string.Empty; }
cmd.CommandText = "SELECT name FROM texts WHERE id LIKE @CardID";
cmd.Parameters.Add(new SQLiteParameter("@CardID", CardID));
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
string CardName = reader.GetString(reader.GetOrdinal("name"));
return CardName;
}
}
conn.Close();
}
}
}


return string.Empty;
}
}
}
6 changes: 1 addition & 5 deletions YGOPro Tweaker/cReplayManager.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;

using System.IO;
using System.Runtime.InteropServices;
using SevenZip.Sdk.Compression;
using System.Text;

namespace YGOPro_Tweaker
{
Expand Down
Loading