Skip to content

Commit

Permalink
Update PKHeX.Core To 24.06.03 And Version To 1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
foohyfooh committed Jun 5, 2024
1 parent 1ed4c4d commit 41208db
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<BaseOutputPath>$(SolutionDir)bin\</BaseOutputPath>
<Version>1.7.2</Version>
<Version>1.8.0</Version>
<Company>foohyfooh</Company>
<Authors>foohyfooh</Authors>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions PluginPile.Common/AssemblyUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ public static class AssemblyUtil {
Single(assembly => assembly.GetName().Name == name);
}

public static Type GetTypeFromAssembly(String assemblyName, String typeName) {
public static Type GetTypeFromAssembly(string assemblyName, string typeName) {
return GetAssemblyByName(assemblyName).GetType(typeName)!;
}

public static MethodInfo GetMethodInfo(String assemblyName, String typeName, String methodName) {
public static MethodInfo GetMethodInfo(string assemblyName, string typeName, string methodName) {
return GetTypeFromAssembly(assemblyName, typeName).GetMethod(methodName)!;
}

public static MethodInfo GetMethodInfo(String assemblyName, String typeName, BindingFlags flags, Func<MethodInfo, bool> predicate) {
public static MethodInfo GetMethodInfo(string assemblyName, string typeName, BindingFlags flags, Func<MethodInfo, bool> predicate) {
return GetTypeFromAssembly(assemblyName, typeName).GetMethods(flags).Single(predicate);
}

Expand Down
11 changes: 10 additions & 1 deletion PluginPile.Common/Language.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ public static class Language {
"en" or _ => "New"
};

private static readonly Type UtilType = AssemblyUtil.GetTypeFromAssembly("PKHeX.Core", "PKHeX.Core.Util");

// Caching and Text Splitting Method From ResourceUtil
private static string[] LoadStringList(string filename, string text) {
MethodInfo loadStringListMethod = UtilType.GetMethods(BindingFlags.NonPublic | BindingFlags.Static)
.Single(m => m.Name == "LoadStringList");
return (string[])loadStringListMethod.Invoke(null, [filename, text])!;
}

private const string StringCachePrefix = "PluginPile";

// Modified Copy Of PKHeX ResourceUtil.GetStringList
Expand All @@ -42,7 +51,7 @@ public static class Language {
if (stream == null) return [];
using StreamReader reader = new StreamReader(stream);
string text = reader.ReadToEnd().Trim(); // Handle Final Newline Getting Counted
return Util.LoadStringList(fullyQualifiedName, text);
return LoadStringList(fullyQualifiedName, text);
}

}
2 changes: 1 addition & 1 deletion PluginPile.Common/PluginPile.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="PKHeX.Core" Version="24.5.5" />
<PackageReference Include="PKHeX.Core" Version="24.6.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Costura.Fody" Version="5.7.0" PrivateAssets="all" />
<PackageReference Include="Fody" Version="6.8.1" PrivateAssets="all" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.3.1" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="QRCoder" Version="1.5.1" />
<PackageReference Include="ZXing.Net" Version="0.16.9" />
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" />
Expand Down

0 comments on commit 41208db

Please sign in to comment.