mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
VisualCloneFix: Fixed FPRExclusion support
This commit is contained in:
parent
c8c9dd89aa
commit
9e3edf9241
3 changed files with 20 additions and 6 deletions
|
@ -26,9 +26,14 @@ public static class Patches
|
|||
ref Dictionary<Transform, FPRExclusion> __result)
|
||||
{
|
||||
// add an fpr exclusion to the head bone
|
||||
FPRExclusion headExclusion = headBone.gameObject.AddComponent<FPRExclusion>();
|
||||
if (!headBone.TryGetComponent(out FPRExclusion headExclusion))
|
||||
{
|
||||
headExclusion = headBone.gameObject.AddComponent<FPRExclusion>();
|
||||
headExclusion.isShown = false; // default to hidden
|
||||
headExclusion.target = headBone;
|
||||
}
|
||||
|
||||
MeshHiderExclusion headExclusionBehaviour = new();
|
||||
headExclusion.target = headBone;
|
||||
headExclusion.behaviour = headExclusionBehaviour;
|
||||
headExclusionBehaviour.id = 1; // head bone is always 1
|
||||
|
||||
|
@ -128,4 +133,13 @@ public static class Patches
|
|||
__result = vertexIndices;
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(MeshHiderExclusion), nameof(MeshHiderExclusion.UpdateExclusions))]
|
||||
private static bool OnUpdateExclusions(bool isShown, bool shrinkToZero, ref int ___id)
|
||||
{
|
||||
if (isShown) LocalCloneManager.cullingMask &= ~(1 << ___id);
|
||||
else LocalCloneManager.cullingMask |= 1 << ___id;
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -27,6 +27,6 @@ using System.Reflection;
|
|||
namespace NAK.VisualCloneFix.Properties;
|
||||
internal static class AssemblyInfoParams
|
||||
{
|
||||
public const string Version = "1.0.0";
|
||||
public const string Version = "1.0.1";
|
||||
public const string Author = "NotAKidoS";
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"_id": 221,
|
||||
"name": "VisualCloneFix",
|
||||
"modversion": "1.0.0",
|
||||
"modversion": "1.0.1",
|
||||
"gameversion": "2024r175",
|
||||
"loaderversion": "0.6.1",
|
||||
"modtype": "Mod",
|
||||
|
@ -16,8 +16,8 @@
|
|||
"requirements": [
|
||||
"None"
|
||||
],
|
||||
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r34/VisualCloneFix.dll",
|
||||
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r36/VisualCloneFix.dll",
|
||||
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/VisualCloneFix/",
|
||||
"changelog": "- Initial release",
|
||||
"changelog": "- Fixed FPRExclusions IsShown state being inverted when toggled.\n- Fixed head FPRExclusion generation not checking for existing exclusion.",
|
||||
"embedcolor": "#f61963"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue