diff --git a/.gitignore b/.gitignore index 931516d..cd438d8 100644 --- a/.gitignore +++ b/.gitignore @@ -373,3 +373,29 @@ Source/packages/ Source/Content/Unity/RimVibes Bundles/Temp/ Source/UnityProject/UserSettings/ + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries diff --git a/Source/AnimationMod/AnimRenderer.cs b/Source/AnimationMod/AnimRenderer.cs index 016c03a..343e791 100644 --- a/Source/AnimationMod/AnimRenderer.cs +++ b/Source/AnimationMod/AnimRenderer.cs @@ -911,14 +911,14 @@ protected void DrawPawns(Action labelDraw = null) Patch_PawnRenderer_RenderPawnAt.AllowNext = true; Patch_PawnRenderer_RenderPawnAt.DoNotModify = true; // Don't use animation position/rotation. Patch_PawnRenderer_RenderPawnAt.NextDrawMode = Patch_PawnRenderer_RenderPawnAt.DrawMode.Full; - Patch_PawnUtility_IsInvisible.IsRendering = true; + Patch_InvisibilityUtility_IsPsychologicallyInvisible.IsRendering = true; PrePawnSpecialRender?.Invoke(pawn, this, Map); pawn.DrawNowAt(pawn.DrawPosHeld ?? pawn.DrawPos); PostPawnSpecialRender?.Invoke(pawn, this, Map); Patch_PawnRenderer_RenderPawnAt.DoNotModify = false; - Patch_PawnUtility_IsInvisible.IsRendering = false; + Patch_InvisibilityUtility_IsPsychologicallyInvisible.IsRendering = false; // Draw label. Vector3 drawPos2 = pawn.DrawPos; @@ -971,7 +971,7 @@ protected void DrawPawns(Action labelDraw = null) : i == 0 ? Patch_PawnRenderer_RenderPawnAt.DrawMode.BodyOnly : Patch_PawnRenderer_RenderPawnAt.DrawMode.HeadOnly; Patch_PawnRenderer_DrawShadowInternal.Suppress = suppressShadow; // In 1.4 shadow rendering is baked into RenderPawnAt and may need to be prevented. - Patch_PawnUtility_IsInvisible.IsRendering = true; + Patch_InvisibilityUtility_IsPsychologicallyInvisible.IsRendering = true; PrePawnSpecialRender?.Invoke(pawn, this, Map); @@ -979,7 +979,7 @@ protected void DrawPawns(Action labelDraw = null) PostPawnSpecialRender?.Invoke(pawn, this, Map); Patch_PawnRenderer_DrawShadowInternal.Suppress = false; - Patch_PawnUtility_IsInvisible.IsRendering = false; + Patch_InvisibilityUtility_IsPsychologicallyInvisible.IsRendering = false; } // Render shadow. diff --git a/Source/AnimationMod/Patches/Patch_Building_ProximityDetector_RunDetection.cs b/Source/AnimationMod/Patches/Patch_Building_ProximityDetector_RunDetection.cs new file mode 100644 index 0000000..cf17d65 --- /dev/null +++ b/Source/AnimationMod/Patches/Patch_Building_ProximityDetector_RunDetection.cs @@ -0,0 +1,28 @@ +using HarmonyLib; +using JetBrains.Annotations; +using RimWorld; + +namespace AM.Patches; + +/// +/// The proximity detector freaks out if it detects any invisible pawn in range, +/// which includes the animated pawns. +/// This patch makes them not be considered invisible when the detection process is running. +/// +[HarmonyPatch(typeof(Building_ProximityDetector), nameof(Building_ProximityDetector.RunDetection))] +[UsedImplicitly(ImplicitUseKindFlags.Access, ImplicitUseTargetFlags.Itself | ImplicitUseTargetFlags.WithMembers)] +public class Patch_Building_ProximityDetector_RunDetection +{ + [HarmonyPriority(Priority.First)] + private static void Prefix(ref bool __state) + { + __state = Patch_InvisibilityUtility_IsPsychologicallyInvisible.IsRendering; + Patch_InvisibilityUtility_IsPsychologicallyInvisible.IsRendering = true; + } + + [HarmonyPriority(Priority.First)] + private static void Postfix(bool __state) + { + Patch_InvisibilityUtility_IsPsychologicallyInvisible.IsRendering = __state; + } +} \ No newline at end of file diff --git a/Source/AnimationMod/Patches/Patch_PawnUtility_IsInvisible.cs b/Source/AnimationMod/Patches/Patch_InvisibilityUtility_IsPsychologicallyInvisible.cs similarity index 93% rename from Source/AnimationMod/Patches/Patch_PawnUtility_IsInvisible.cs rename to Source/AnimationMod/Patches/Patch_InvisibilityUtility_IsPsychologicallyInvisible.cs index 2e0c0c2..a771d20 100644 --- a/Source/AnimationMod/Patches/Patch_PawnUtility_IsInvisible.cs +++ b/Source/AnimationMod/Patches/Patch_InvisibilityUtility_IsPsychologicallyInvisible.cs @@ -14,7 +14,7 @@ namespace AM.Patches; /// compromise. /// [HarmonyPatch(typeof(InvisibilityUtility), nameof(InvisibilityUtility.IsPsychologicallyInvisible))] -public static class Patch_PawnUtility_IsInvisible +public static class Patch_InvisibilityUtility_IsPsychologicallyInvisible { public static bool IsRendering; diff --git a/Source/FacialAnimationPatch/Patch_DrawFaceGraphicsComp_CompRenderNodes.cs b/Source/FacialAnimationPatch/Patch_DrawFaceGraphicsComp_CompRenderNodes.cs index 16c0a69..561686c 100644 --- a/Source/FacialAnimationPatch/Patch_DrawFaceGraphicsComp_CompRenderNodes.cs +++ b/Source/FacialAnimationPatch/Patch_DrawFaceGraphicsComp_CompRenderNodes.cs @@ -30,7 +30,7 @@ private static void Prefix(DrawFaceGraphicsComp __instance, ref bool __state) { __state = true; __instance.SetDirty(); - Patch_PawnUtility_IsInvisible.IsRendering = true; + Patch_InvisibilityUtility_IsPsychologicallyInvisible.IsRendering = true; } } @@ -38,7 +38,7 @@ private static void Postfix(bool __state) { if (__state) { - Patch_PawnUtility_IsInvisible.IsRendering = false; + Patch_InvisibilityUtility_IsPsychologicallyInvisible.IsRendering = false; } } } \ No newline at end of file