Skip to content

Commit 2204721

Browse files
committed
Added PlanningExtended support
1 parent c292ba8 commit 2204721

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

Progress-Renderer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
<Compile Include="Source\Harmony_Patches\Harmony_OptionListingUtility.cs" />
128128
<Compile Include="Source\Harmony_Patches\Harmony_OverlayDrawer.cs" />
129129
<Compile Include="Source\Harmony_Patches\Harmony_OverlayDrawHandler.cs" />
130+
<Compile Include="Source\Harmony_Patches\Harmony_PlanDesignation_DesignationDraw.cs" />
130131
<Compile Include="Source\Harmony_Patches\Harmony_RoofGrid.cs" />
131132
<Compile Include="Source\Harmony_Patches\Harmony_ScreenshotModeHandler.cs" />
132133
<Compile Include="Source\Harmony_Patches\Harmony_Targeter.cs" />
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using HarmonyLib;
3+
using Verse;
4+
5+
namespace ProgressRenderer
6+
{
7+
[HarmonyPatch("PlanDesignation", nameof(Designation.DesignationDraw))]
8+
public static class Harmony_PlanDesignation_DesignationDraw
9+
{
10+
public static bool Prefix(Designation __instance)
11+
{
12+
try
13+
{
14+
if (__instance.def == null) return true;
15+
16+
var target = __instance.target;
17+
18+
Map map = target.HasThing ? target.Thing.MapHeld : Find.CurrentMap;
19+
20+
var renderManager = map?.GetComponent<MapComponent_RenderManager>();
21+
22+
if (renderManager?.Rendering == false)
23+
return true;
24+
25+
return PrModSettings.RenderDesignations;
26+
}
27+
catch (Exception ex)
28+
{
29+
// 1.6 UPDATE: Enhanced error reporting
30+
Log.Error($"[ProgressRenderer] DesignationDraw patch error in 1.6: {ex}\n{ex.StackTrace}");
31+
return true;
32+
}
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)