Skip to content

Commit 8080356

Browse files
committed
Merge branch 'main' into dev1.3
2 parents 06ba9b2 + 485d1ae commit 8080356

9 files changed

Lines changed: 97 additions & 2 deletions

File tree

PolyMod.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
<Configurations>IL2CPP</Configurations>
1313
<RootNamespace>PolyMod</RootNamespace>
1414
<Version>1.3.0-pre</Version>
15-
<PolytopiaVersion>2.16.4.15698</PolytopiaVersion>
15+
<PolytopiaVersion>2.16.5.15700</PolytopiaVersion>
1616
<Authors>PolyModdingTeam</Authors>
1717
<Description>The Battle of Polytopia's mod loader.</Description>
1818
<NoWarn>IDE0130</NoWarn>
1919
<NoWarn>NU5104</NoWarn>
20+
<NoWarn>$(NoWarn);NU1902</NoWarn>
21+
<NoWarn>$(NoWarn);NU1903</NoWarn>
22+
<NoWarn>$(NoWarn);NU1904</NoWarn>
2023
</PropertyGroup>
2124

2225
<ItemGroup>

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_site/
2+
api/
3+
.cache/

docs/docfx.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
3+
"metadata": [
4+
{
5+
"src": [
6+
{
7+
"src": "..",
8+
"files": [
9+
"**/*.csproj"
10+
]
11+
}
12+
],
13+
"dest": "api"
14+
}
15+
],
16+
"build": {
17+
"content": [
18+
{
19+
"files": [
20+
"**/*.{md,yml}"
21+
],
22+
"exclude": [
23+
"_site/**"
24+
]
25+
}
26+
],
27+
"resource": [
28+
{
29+
"files": [
30+
"images/**"
31+
]
32+
}
33+
],
34+
"output": "_site",
35+
"template": [
36+
"default",
37+
"modern"
38+
],
39+
"globalMetadata": {
40+
"_appName": "PolyMod",
41+
"_appTitle": "PolyMod",
42+
"_enableSearch": true,
43+
"pdf": false
44+
}
45+
}
46+
}

docs/docs/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Introduction

docs/docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- name: Introduction
2+
href: introduction.md

docs/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
_layout: landing
3+
---
4+
5+
# This is the **HOMEPAGE**.
6+
7+
Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
8+
9+
## Quick Start Notes:
10+
11+
1. Add images to the *images* folder if the file is referencing an image.

docs/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: Docs
2+
href: docs/
3+
- name: API
4+
href: api/

src/Loader.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ internal record TypeMapping(Type type, bool shouldCreateCache = true);
6161
{
6262
if (duringEnumCacheCreation)
6363
{
64-
Registry.customTribes.Add((TribeType)Registry.autoidx);
64+
Registry.customTribes.Add((TribeType)(int)token["idx"]);
6565
token["style"] = Registry.climateAutoidx;
6666
token["climate"] = Registry.climateAutoidx;
6767
Registry.climateAutoidx++;
@@ -912,6 +912,7 @@ internal static void ProcessGameLogicData(GameLogicData gameLogicData, JObject r
912912
try
913913
{
914914
CreateMappings(rootObject);
915+
ProcessCustomTribes();
915916
ProcessPrefabs();
916917
ProcessEmbarkOverrides();
917918
ProcessAttractOverrides();
@@ -922,6 +923,17 @@ internal static void ProcessGameLogicData(GameLogicData gameLogicData, JObject r
922923
}
923924
}
924925

926+
internal static void ProcessCustomTribes()
927+
{
928+
foreach (var tribe in Registry.customTribes)
929+
{
930+
if(!GameLogicData.legacyTribeTypesOrder.Contains(tribe))
931+
{
932+
GameLogicData.legacyTribeTypesOrder.Add(tribe);
933+
}
934+
}
935+
}
936+
925937
/// <summary>
926938
/// Creates EnumCache mappings for custom enum values and invokes type handlers.
927939
/// </summary>

src/Managers/Visual.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,19 @@ private static void PolytopiaSpriteRenderer_ForceUpdateMesh(PolytopiaSpriteRende
413413
}
414414
}
415415

416+
[HarmonyPostfix]
417+
[HarmonyPatch(typeof(Tile), nameof(Tile.Render), typeof(MapRenderContext), typeof(SkinVisualsTransientData))]
418+
private static void Tile_Render(Tile __instance, MapRenderContext ctx, SkinVisualsTransientData transientSkinningData)
419+
{
420+
Sprite? sprite = Registry.GetSprite("hidden");
421+
if(sprite != null)
422+
{
423+
__instance.fogOfWarRenderer.atlasName = "";
424+
__instance.fogOfWarRenderer.sprite = sprite;
425+
__instance.fogOfWarRenderer.spriteRenderer.sprite = sprite;
426+
}
427+
}
428+
416429
#endregion
417430
#region TribePreview
418431

0 commit comments

Comments
 (0)