Skip to content

Commit 2d2b790

Browse files
committed
Updated to Polytopia 2.16.0, updated to bepinex be 752, fixed localization skin data bug
1 parent 029c7fa commit 2d2b790

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

PolyMod.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
https://polymod.dev/nuget/v3/index.json;
1111
</RestoreAdditionalProjectSources>
1212
<Configurations>IL2CPP</Configurations>
13-
<Version>1.2.6</Version>
14-
<PolytopiaVersion>2.15.3.15099</PolytopiaVersion>
13+
<Version>1.2.7</Version>
14+
<PolytopiaVersion>2.16.0.15379</PolytopiaVersion>
1515
<Authors>PolyModdingTeam</Authors>
1616
<Description>The Battle of Polytopia's mod loader.</Description>
1717
<NoWarn>IDE0130</NoWarn>
1818
<NoWarn>NU5104</NoWarn>
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.738" />
22+
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.752" />
2323
<PackageReference Include="Costura.Fody" Version="6.0.0">
2424
<PrivateAssets>all</PrivateAssets>
2525
</PackageReference>

src/Managers/Loc.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ private static bool Localization_Get(ref string key, Il2CppReferenceArray<Il2Cpp
3939
{
4040
foreach (var typeMapping in Loader.typeMappings.Values)
4141
{
42+
if(!typeMapping.shouldCreateCache)
43+
continue;
44+
4245
MethodInfo? methodInfo = typeof(EnumCache<>).MakeGenericType(typeMapping.type).GetMethod("TryGetName");
4346
if (methodInfo != null)
4447
{

src/Managers/Visual.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ private static void SkinVisualsRenderer_SkinWorldObject(
231231

232232
/// <summary>Updates the visual parts of a resource with custom sprites.</summary>
233233
[HarmonyPostfix]
234-
[HarmonyPatch(typeof(Resource), nameof(Resource.UpdateObject), typeof(SkinVisualsTransientData))]
235-
private static void Resource_UpdateObject(Resource __instance, SkinVisualsTransientData transientSkinData)
234+
[HarmonyPatch(typeof(Resource), nameof(Resource.UpdateObject), typeof(MapRenderContext), typeof(SkinVisualsTransientData))]
235+
private static void Resource_UpdateObject(Resource __instance, MapRenderContext ctx, SkinVisualsTransientData transientSkinData)
236236
{
237237
if (__instance.data != null)
238238
{
@@ -248,8 +248,8 @@ private static void Resource_UpdateObject(Resource __instance, SkinVisualsTransi
248248

249249
/// <summary>Updates a building with a custom sprite.</summary>
250250
[HarmonyPostfix]
251-
[HarmonyPatch(typeof(Building), nameof(Building.UpdateObject), typeof(SkinVisualsTransientData))]
252-
private static void Building_UpdateObject(Building __instance, SkinVisualsTransientData transientSkinData)
251+
[HarmonyPatch(typeof(Building), nameof(Building.UpdateObject), typeof(MapRenderContext), typeof(SkinVisualsTransientData))]
252+
private static void Building_UpdateObject(Building __instance, MapRenderContext ctx, SkinVisualsTransientData transientSkinData)
253253
{
254254
string style = Util.GetStyle(transientSkinData.foundingTribeSettings.tribe, transientSkinData.foundingTribeSettings.skin);
255255
string name = EnumCache<ImprovementData.Type>.GetName(__instance.tile.data.improvement.type);

0 commit comments

Comments
 (0)