fixed issue with offset sliders caused by positive to negative values

fixed issue with HAR as a soft dependency stopping resolveapparelgraphics patch from working
This commit is contained in:
c0ffee 2023-01-11 14:54:04 -08:00
parent fa0c4457e8
commit e5853d18a4
7 changed files with 26 additions and 13 deletions

View File

@ -60,7 +60,7 @@ namespace Rimworld_Animations {
bool mirrored = curPawn.TryGetComp<CompBodyAnimator>().Mirror;
float.TryParse(listingStandard.TextEntryLabeled("X Offset: ", offsetX.ToString()), out offsetX);
offsetX = listingStandard.Slider(offsetX, -2 * (mirrored ? -1 : 1), 2 * (mirrored ? -1 : 1));
offsetX = listingStandard.Slider(offsetX, -2, 2);
float.TryParse(listingStandard.TextEntryLabeled("Z Offset: ", offsetZ.ToString()), out offsetZ);
offsetZ = listingStandard.Slider(offsetZ, -2, 2);

View File

@ -0,0 +1,24 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
namespace Rimworld_Animations
{
[HarmonyPatch(typeof(PawnGraphicSet), "ResolveApparelGraphics")]
public static class HarmonyPatch_ResolveApparelGraphics
{
public static bool Prefix(ref Pawn ___pawn)
{
if (___pawn.TryGetComp<CompBodyAnimator>() != null && ___pawn.TryGetComp<CompBodyAnimator>().isAnimating)
{
return false;
}
return true;
}
}
}

View File

@ -139,19 +139,7 @@ namespace Rimworld_Animations {
}
}
[HarmonyPatch(typeof(PawnGraphicSet), "ResolveApparelGraphics")]
public static class HarmonyPatch_ResolveApparelGraphics
{
public static bool Prefix(ref Pawn ___pawn)
{
if (___pawn.TryGetComp<CompBodyAnimator>() != null && ___pawn.TryGetComp<CompBodyAnimator>().isAnimating)
{
return false;
}
return true;
}
}
/*

View File

@ -99,6 +99,7 @@
<Compile Include="1.4\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderer.cs" />
<Compile Include="1.4\Source\Patches\RimworldPatches\HarmonyPatch_PawnRotation.cs" />
<Compile Include="1.4\Source\Patches\RimworldPatches\HarmonyPatch_Pawn_DrawTracker.cs" />
<Compile Include="1.4\Source\Patches\RimworldPatches\HarmonyPatch_ResolveApparelGraphics.cs" />
<Compile Include="1.4\Source\Patches\RimworldPatches\HarmonyPatch_SetPawnAnimatable.cs" />
<Compile Include="1.4\Source\Patches\RimworldPatches\HarmonyPatch_Thing.cs" />
<Compile Include="1.4\Source\Patches\RJWPatches\HarmonyPatch_PlaySexSounds.cs" />