File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff line change 44
55namespace ProgressRenderer
66{
7-
87 [ StaticConstructorOnStartup ]
98 static class HarmonySetup
109 {
1110 static HarmonySetup ( )
1211 {
1312 var harmony = new Harmony ( "rimworld.neptimus7.progressrenderer" ) ;
14- harmony . PatchAll ( Assembly . GetExecutingAssembly ( ) ) ;
13+
14+ if ( LoadedModManager . RunningModsListForReading . Any ( x => x . Name == "scherub.planningextended" ) )
15+ harmony . PatchCategory ( "PlanningExtended" ) ;
16+
17+ harmony . PatchAllUncategorized ( Assembly . GetExecutingAssembly ( ) ) ;
1518 }
1619 }
1720}
Original file line number Diff line number Diff line change 1+ using System ;
2+ using HarmonyLib ;
3+ using Verse ;
4+
5+ namespace ProgressRenderer
6+ {
7+ [ HarmonyPatchCategory ( "PlanningExtended" ) ]
8+ [ HarmonyPatch ( "PlanDesignation" , nameof ( Designation . DesignationDraw ) ) ]
9+ public static class Harmony_PlanDesignation_DesignationDraw
10+ {
11+ public static bool Prefix ( Designation __instance )
12+ {
13+ try
14+ {
15+ if ( __instance . def == null ) return true ;
16+
17+ var target = __instance . target ;
18+
19+ Map map = target . HasThing ? target . Thing . MapHeld : Find . CurrentMap ;
20+
21+ var renderManager = map ? . GetComponent < MapComponent_RenderManager > ( ) ;
22+
23+ if ( renderManager ? . Rendering == false ) 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+ }
You can’t perform that action at this time.
0 commit comments