diff options
| author | 2026-08-09 21:36:12 -0400 | |
|---|---|---|
| committer | 2026-08-09 21:36:12 -0400 | |
| commit | cb082b12b7d61942c99cccf8c64127304c62cec4 (patch) | |
| tree | 85bf717738dc03e5ec666dd0d06c06ae0731d41d /Plugin.cs | |
| parent | d8fda32bb62dbc02e4e881e5e5a2b865aa862493 (diff) | |
| download | NewCamera-cb082b12b7d61942c99cccf8c64127304c62cec4.tar.gz NewCamera-cb082b12b7d61942c99cccf8c64127304c62cec4.tar.bz2 NewCamera-cb082b12b7d61942c99cccf8c64127304c62cec4.zip | |
Joints fixes, expose face joints
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'Plugin.cs')
| -rwxr-xr-x | Plugin.cs | 261 |
1 files changed, 131 insertions, 130 deletions
@@ -48,6 +48,7 @@ using SharpPluginLoader.Core.Configuration; // - Open Poses Menu
// @TODO:
+// - Unchecked nint overflow ntol.
// - Cleanup math.
// - pCamera refactor.
// - Attempt to document all test cases I can think of.
@@ -515,18 +516,19 @@ namespace NewCamera private delegate void UpdateJoints(nint obj);
private Hook<UpdateJoints>? updateJointsHook;
- private delegate void UpdateJointChild(nint child, nint joint, nint obj);
private List<nint> bodyJoints = new List<nint>();
private List<nint> ignoredJoints = new List<nint>();
- private Dictionary<nint, List<Vector3>> jointOffsets = new Dictionary<nint, List<Vector3>>();
- private bool didJointOffset = false;
+ private Dictionary<nint, List<Vector3>> bodyOffsets = new Dictionary<nint, List<Vector3>>();
+
+ private List<nint> faceJoints = new List<nint>();
+ private Dictionary<nint, List<Vector3>> faceOffsets = new Dictionary<nint, List<Vector3>>();
#if QUARANTINED_FEATURES
private delegate void UpdateIK(nint superOfChild, nint joint, nint obj);
private Hook<UpdateIK>? updateIKHook;
private Dictionary<nint, List<Vector3>> ikOffsets = new Dictionary<nint, List<Vector3>>();
-#endif
private List<nint> ikJoints = new List<nint>();
+#endif
private bool ikForcedOff = false;
private Patch forceDisableIK;
@@ -537,13 +539,6 @@ namespace NewCamera private nint chestBone1 = 0x0;
private nint chestBone2 = 0x0;
- private List<nint> faceJoints = new List<nint>();
- /*
- private bool overrideFacePose;
- private Patch noopFacePose;
- private Patch noopFacePoseUpdate;
- */
-
/*
private delegate void ChangeEquipment(nint unknownPtr, int unknownInt);
private Hook<ChangeEquipment>? changeEquipmentHook;
@@ -693,6 +688,8 @@ namespace NewCamera private void debugLog(string message)
{
#if LOG_DEBUG_MESSAGES
+ Log.Info(message);
+#else
Log.Debug(message);
#endif
}
@@ -769,16 +766,12 @@ namespace NewCamera // @TODO: Pick camera functions out of the upper function (they happen in immediate succession).
// Place where we can check camera state early.
IntPtr addr = PatternScanner.FindFirst(Pattern.FromString("40 53 48 81 EC 80 00 00 00 8B 81 B0 17 00 00 48 8B D9 85 C0 ?? ??"));
-#if ADDR_ASSERTS
Assert(addr == 0x141FA11A0); // nint
-#endif
setCameraHook = Hook.Create<ProcessCameraDelegate>(addr, SetCameraHook);
// Place where we can adjust the camera position.
addr = PatternScanner.FindFirst(Pattern.FromString("48 8B C4 55 41 57 48 81 EC D8 00 00 00 44 0F 29 40 B8 45 33 FF ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B E9"));
-#if ADDR_ASSERTS
Assert(addr == 0x141FA5380); // nint
-#endif
calculateCameraHook = Hook.Create<ProcessCameraDelegate>(addr, CalculateCameraHook);
checkCameraHook = Hook.Create<ProcessCameraDelegate>(0x141FA2130, CheckCameraHook); // nint
@@ -826,36 +819,26 @@ namespace NewCamera // Very special case for inside tent.
addr = PatternScanner.FindFirst(Pattern.FromString("48 89 5C 24 10 48 89 6C 24 18 48 89 7C 24 20 41 56 48 83 EC 60 48 8B D9 0F 57 DB ?? ?? ?? ?? ?? ?? ?? 0F 57 D2 33 D2"));
-#if ADDR_ASSERTS
Assert(addr == 0x142106450); // nint
-#endif
setCameraTentHook = Hook.Create<SetCameraTentDelegate>(addr, SetCameraTentHook);
addr = PatternScanner.FindFirst(Pattern.FromString("48 8B C4 48 89 58 10 48 89 70 18 55 57 41 54 41 56 41 57 48 8D 6C 24 80 48 81 EC 80 01 00 00 0F 29 70 C8 48 8B F9 0F 29 78 B8 0F 57 C9 44 0F 29 40 A8 0F 57 F6 44 0F 29 48 98 44 0F 29 50 88"));
-#if ADDR_ASSERTS
Assert(addr == 0x141FB12D0); // nint
-#endif
setCameraCutsceneHook = Hook.Create<SetCameraCutsceneDelegate>(addr, SetCameraCutsceneHook);
/*
addr = PatternScanner.FindFirst(Pattern.FromString("48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 48 89 7C 24 20 41 54 41 56 41 57 48 81 EC 90 00 00 00 ?? ?? ?? ?? ?? ?? ?? 48 8B F9"));
-#if ADDR_ASSERTS
Assert(addr == 0X14228EB60); // nint
-#endif
calculateViewHook = Hook.Create<CalculateViewDelegate>(addr, CalculateViewHook);
*/
addr = PatternScanner.FindFirst(Pattern.FromString("48 89 5C 24 08 57 44 8B 9A 60 01 00 00 48 8B DA 41 0F BF 40 08 4D 8B D0 89 82 80 01 00 00 BF 00 10 00 00 41 0F BF 40 0A 89 82 84 01 00 00 41 0F BF 40 0C 89 82 78 01 00 00 41 0F BF 40 0E 89 82 7C 01 00 00"));
-#if ADDR_ASSERTS
Assert(addr == 0x1422A1280); // nint, nint, nint
-#endif
writePadInputHook = Hook.Create<WritePadInputDelegate>(addr, WritePadInputHook);
// Place where we can change the analog stick value the game uses for player movement.
addr = PatternScanner.FindFirst(Pattern.FromString("66 0F 6E C1 0F 5B C0 85 C9 78 11"));
-#if ADDR_ASSERTS
Assert(addr == 0x142107CB0); // int, float
-#endif
checkMovementHook = Hook.Create<CheckMovementDelegate>(addr, CheckMovementHook);
collisionCheckHook = Hook.Create<CollisionCheckDelegate>(0x1411C4E50, CollisionCheckHook); // nint, nint
@@ -863,21 +846,15 @@ namespace NewCamera cameraEffectHook = Hook.Create<CameraEffectDelegate>(0x141AB6AE0, CameraEffectHook); // nint, nint, nint
addr = PatternScanner.FindFirst(Pattern.FromString("84 C0 0F 84 ?? ?? ?? ?? 48 8B 57 28 45 33 C0 48 8B CE E8 ?? ?? ?? ?? 48 8B 97 E0 01 00 00 41 B0 01 48 8B CE E8 ?? ?? ?? ?? 48 8B 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B D8"));
-#if ADDR_ASSERTS
Assert(addr == 0x141E55D9E);
-#endif
forceMinimapFollowsCamera = new Patch(addr + 0x3, [0xE9]); // je -> jmp.
addr = PatternScanner.FindFirst(Pattern.FromString("48 89 5C 24 18 48 89 6C 24 20 57 48 83 EC 20 48 8B 59 68 48 8B FA 48 8B E9 48 85 DB 0F 84 ?? ?? ?? ?? 4C 89 74 24 38 4C 8B B3 80 00 00 00 4D 85 F6"));
-#if ADDR_ASSERTS
Assert(addr == 0x14234DD60);
-#endif
jmpOverUi = new Patch(addr + 0x1C, [0xE9, 0x65, 0x01, 0x00, 0x00, 0x90]);
addr = PatternScanner.FindFirst(Pattern.FromString("CC 48 89 5C 24 18 57 48 83 EC 30 48 89 74 24 48 48 8B D9 E8 ?? ?? ?? ?? 48 8B 8B B0 0D 00 00 8B 81 54 89 00 00 C1 E8 0D A8 01"));
-#if ADDR_ASSERTS
Assert(addr == 0x1411A6A9F);
-#endif
noopCharacterFade = new Patch(addr + 0x13, [0x90, 0x90, 0x90, 0x90, 0x90]); // call MonsterHunterWorld.exe+11A6D50.
if (disableCharacterFade && !disableMod)
{
@@ -895,14 +872,11 @@ namespace NewCamera getSaveSlotGuiAddr = new NativeFunction<nint, nint>(0x141AC0B60);
getPlayerSettingsAddr = new NativeFunction<nint, nint>(0x141B8DBB0);
- /*
- noopFacePose = new Patch(new nint(0x14237B093), [0x90, 0x90, 0x90, 0x90, 0x90]);
- noopFacePoseUpdate = new Patch(new nint(0x14223BAAB), [0x90, 0x90, 0x90, 0x90, 0x90]);
- */
-
forceDisableIK = new Patch(new nint(0x14031FD40), [0xC6, 0x81, 0x81, 0x01, 0x00, 0x00, 0x00, 0xC3]);
+ // Alt: 0x141FBC7A0 (model - 0x958)
updateJointsHook = Hook.Create<UpdateJoints>(0x14223BA30, UpdateJointsHook);
+
#if QUARANTINED_FEATURES
updateIKHook = Hook.Create<UpdateIK>(0x142472C00, UpdateIKHook);
#endif
@@ -924,35 +898,23 @@ namespace NewCamera // Noop collision checks.
addr = PatternScanner.FindFirst(Pattern.FromString("F3 0F 11 06 F3 0F 10 48 04 F3 0F 58 4E 04 F3 0F 11 4E 04 F3 0F 10 40 08 F3 0F 58 46 08 F3 0F 11 46 08 44 8B AF E0 0B 00 00"));
-#if ADDR_ASSERTS
Assert(addr == 0x141C001B5);
-#endif
disableXCollision = new Patch(addr, [0x90, 0x90, 0x90, 0x90]);
-#if ADDR_ASSERTS
Assert(addr + 0xE == 0x141C001C3);
-#endif
disableYCollision = new Patch(addr + 0xE, [0x90, 0x90, 0x90, 0x90, 0x90]);
-#if ADDR_ASSERTS
Assert(addr + 0x1D == 0x141C001D2);
-#endif
disableZCollision = new Patch(addr + 0x1D, [0x90, 0x90, 0x90, 0x90, 0x90]);
addr = PatternScanner.FindFirst(Pattern.FromString("F3 0F 11 46 04 F3 0F 10 46 08 F3 0F 5C C2 F3 0F 11 46 08 ?? ?? F3 0F"));
-#if ADDR_ASSERTS
Assert(addr == 0x141C000D2);
-#endif
disableSecondaryYCollision = new Patch(addr, [0x90, 0x90, 0x90, 0x90, 0x90]);
addr = PatternScanner.FindFirst(Pattern.FromString("F3 0F 11 46 04 F3 0F 10 58 08 F3 0F 58 5E 08 F3 0F 11 5E 08 44 8B 87 D0 0B 00 00 41 F6 C0 03"));
-#if ADDR_ASSERTS
Assert(addr == 0x141BFFF90);
-#endif
disableExtraYCollision = new Patch(addr, [0x90, 0x90, 0x90, 0x90, 0x90]);
addr = PatternScanner.FindFirst(Pattern.FromString("F3 0F 11 83 80 00 00 00 F3 0F 11 8B 84 00 00 00 F3 0F 11 93 88 00 00 00 89 B3 8C 00 00 00 8B 83 A4 01 00 00 C1 E8 05 44 0F 29 A4 24 D0 01 00 00 44 0F 29 B4 24 B0 01 00 00 A8 01"));
-#if ADDR_ASSERTS
Assert(addr + 0x8 == 0x1413259ED);
-#endif
disableGravityYUpdate = new Patch(addr + 0x8, [
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
]);
@@ -963,9 +925,7 @@ namespace NewCamera ]);
addr = PatternScanner.FindFirst(Pattern.FromString("F3 0F 11 97 54 15 00 00 F3 0F 11 8F 58 15 00 00 F3 0F 10 47 68 F3 0F 5E D8 44 89 B7 6C 15 00 00 F3 0F 5E D0 F3 0F 5E C8 F3 0F 11 9F 60 15 00 00 F3 0F 11 97 64 15 00 00 F3 0F 11 8F 68 15 00 00"));
-#if ADDR_ASSERTS
Assert(addr + 0x40 == 0x141BFFF75);
-#endif
disableGravityEval = new Patch(addr + 0x40, [0x90, 0x90, 0x90, 0x90, 0x90]); // call MonsterHunterWorld.exe+1325810.
return data;
@@ -1232,8 +1192,6 @@ namespace NewCamera PadRx = 0; PadRy = 0;
cameraOffset = Vector3.Zero;
-
- didJointOffset = false;
}
public void OnUpdate(float deltaTime)
@@ -1556,10 +1514,8 @@ namespace NewCamera ref Vector3 jiggle1 = ref MemoryUtil.GetRef<Vector3>((swapChestSides ? chestBone2 : chestBone1) + 0xD0);
ref Vector3 jiggle2 = ref MemoryUtil.GetRef<Vector3>((swapChestSides ? chestBone1 : chestBone2) + 0xD0);
float scale = (Int16.MaxValue / adjustedSpeed / chestMoveScale);
- jiggle1 -= right * (PadLx / scale);
- jiggle1 -= up * (PadLy / scale);
- jiggle2 -= right * (PadRx / scale);
- jiggle2 -= up * (PadRy / scale);
+ jiggle1 -= (right * (PadLx / scale)) + (up * (PadLy / scale));
+ jiggle2 -= (right * (PadRx / scale)) + (up * (PadRy / scale));
lockCameraLook = true;
}
else
@@ -2148,7 +2104,7 @@ namespace NewCamera }
*/
- private void toggleFreezeGame()
+ private void toggleFreezeGame(float resumeSpeed = 1.0f)
{
freezeGame = !freezeGame;
if (freezeGame)
@@ -2168,7 +2124,7 @@ namespace NewCamera forceOffMotionBlurOverride = 0;
}
}
- MemoryUtil.GetRef<float>(sMain.Instance + 0xA4) = freezeGame ? 0.0f : 1.0f;
+ MemoryUtil.GetRef<float>(sMain.Instance + 0xA4) = freezeGame ? 0.0f : resumeSpeed;
}
private bool playerInMenu()
@@ -2317,6 +2273,7 @@ namespace NewCamera uint BumperMask = (uint)Button.L1 | (uint)Button.R1;
uint StickMask = (uint)Button.LsUp | (uint)Button.LsDown | (uint)Button.LsLeft | (uint)Button.LsRight |
(uint)Button.RsUp | (uint)Button.RsDown | (uint)Button.RsLeft | (uint)Button.RsRight;
+ // @TODO: This is broken if you mix keyboard/mouse and controller input.
if (unlockInputForMenu)
{
// Idealy we wouldn't block Y or X here but triggering Rearrange or Edit Shoutout in
@@ -2624,7 +2581,7 @@ namespace NewCamera private static string extractPartName(string fullString)
{
string partName = "";
- if (fullString.StartsWith("pl\\f_equip"))
+ if (fullString.StartsWith("pl\\f_equip") || fullString.StartsWith("pl\\m_equip"))
{
partName = fullString.Split('\\')[3];
}
@@ -2636,7 +2593,7 @@ namespace NewCamera {
partName = fullString.Split('\\')[2];
}
- else if (fullString.StartsWith("pl\\f_face"))
+ else if (fullString.StartsWith("pl\\f_face") || fullString.StartsWith("pl\\m_face"))
{
partName = fullString.Split('\\')[4].Substring(2);
}
@@ -2718,6 +2675,7 @@ namespace NewCamera ignoredJoints.Add(jointAddr);
}
}
+#if QUARANTINED_FEATURES
else if (childVtable == 0x143249170)
{
childAddr = MemoryUtil.Read<nint>(childAddr + 0x188);
@@ -2726,18 +2684,17 @@ namespace NewCamera ikJoints.Add(jointAddr);
}
}
+#endif
}
}
if (part == Armor.Body)
{
bodyJoints.Add(jointAddr);
}
- /*
else if (part == Armor.Face)
{
faceJoints.Add(jointAddr);
}
- */
jointAddr += 0xC0;
}
if (part == Armor.Body)
@@ -2767,17 +2724,19 @@ namespace NewCamera {
break;
}
- // Guess that all extra joints come between Unknown2 and LeftHip and
- // that none of them are at level 2 like LeftHip.
- if (adjustedIndex == Joint.Unknown2)
+ if (adjustedIndex == Joint.LeftArmUnk7)
+ {
+ skipExtraBones = 4;
+ }
+ else if (adjustedIndex == Joint.Unknown2)
{
skipExtraBones = 2;
}
playerJoints[i - extraBonesOffset] = jointAddr;
}
- foreach (nint joint in jointOffsets.Where(e => !bodyJoints.Contains(e.Key)).Select(e => e.Key).ToList())
+ foreach (nint joint in bodyOffsets.Where(e => !bodyJoints.Contains(e.Key)).Select(e => e.Key).ToList())
{
- jointOffsets.Remove(joint);
+ bodyOffsets.Remove(joint);
}
#if QUARANTINED_FEATURES
foreach (nint joint in ikOffsets.Where(e => !bodyJoints.Contains(e.Key)).Select(e => e.Key).ToList())
@@ -2788,7 +2747,7 @@ namespace NewCamera }
}
- private void drawJoint(nint jointAddr)
+ private void drawJoint(nint jointAddr, Dictionary<nint, List<Vector3>> offsets)
{
if (jointAddr == 0x0) return;
ImGui.PushID(jointAddr);
@@ -2826,12 +2785,12 @@ namespace NewCamera {
ImGui.PushStyleVar(ImGuiStyleVar.Alpha, ImGui.GetStyle().Alpha * 0.5f);
}
- bool hasOffset = jointOffsets.ContainsKey(jointAddr);
+ bool hasOffset = offsets.ContainsKey(jointAddr);
if (!hasOffset)
{
if (ImGui.Button("Add Offset"))
{
- jointOffsets.Add(jointAddr, new List<Vector3>()
+ offsets.Add(jointAddr, new List<Vector3>()
{
new Vector3()
});
@@ -2852,31 +2811,37 @@ namespace NewCamera ImGui.SameLine();
if (ImGui.Button("Reset"))
{
- jointOffsets[jointAddr][0] = new Vector3();
+ offsets[jointAddr][0] = new Vector3();
}
ImGui.SameLine();
- Vector3 v = jointOffsets[jointAddr][0];
+ Vector3 v = offsets[jointAddr][0];
if (ImGui.DragFloat3($"Offset", ref v, 0.005f))
{
- jointOffsets[jointAddr][0] = v;
+ offsets[jointAddr][0] = v;
}
- if (doRemove) jointOffsets.Remove(jointAddr);
+ if (doRemove) offsets.Remove(jointAddr);
}
ImGui.PopID();
}
- private void drawJointLeaf(ref List<nint> joints, int i)
+ private void drawJoint(nint jointAddr)
+ {
+ drawJoint(jointAddr, bodyOffsets);
+ }
+
+ private void drawJointLeaf(ref List<nint> joints, int i, Dictionary<nint, List<Vector3>> offsets)
{
if (i >= joints.Count) return;
nint jointAddr = joints[i];
byte treeLevel = MemoryUtil.Read<byte>(jointAddr + 0x14);
+ //byte id = MemoryUtil.Read<byte>(jointAddr + 0xA5);
ImGui.PushID(jointAddr);
if (ImGui.CollapsingHeader($"Joint #{i} (0x{jointAddr:X}, tree_level: 0x{treeLevel:X})"))
{
- drawJoint(jointAddr);
+ drawJoint(jointAddr, offsets);
}
ImGui.PopID();
- drawJointLeaf(ref joints, i + 1);
+ drawJointLeaf(ref joints, i + 1, offsets);
}
private void drawJoints(float width)
@@ -3307,9 +3272,13 @@ namespace NewCamera }
}
ImGui.Separator();
- if (ImGui.CollapsingHeader("All Joints"))
+ if (ImGui.CollapsingHeader("Body Joints"))
{
- drawJointLeaf(ref bodyJoints, 0);
+ drawJointLeaf(ref bodyJoints, 0, bodyOffsets);
+ }
+ if (ImGui.CollapsingHeader("Face Joints"))
+ {
+ drawJointLeaf(ref faceJoints, 0, faceOffsets);
}
ImGui.PopItemWidth();
}
@@ -3360,7 +3329,7 @@ namespace NewCamera int partLodCount = lastLod - lodOffset;
// This is not a "proper" way to hide a part. It abuses the fact that if the lower
// 16 bits (lodVisible) of these 4 bytes are 0, a check to skip rendering it will
- // always pass. Also that +0xA appears to be padding.
+ // always pass. Also that +0xA appears to be unused/padding.
// MonsterHunterWorld.exe+222FCE3 - mov eax,[r8]
ushort lod0Visible = MemoryUtil.GetRef<ushort>(lod0);
for (int j = 0; j < partLodCount; j++)
@@ -3392,16 +3361,20 @@ namespace NewCamera Array.Clear(playerArmor, 0, playerArmor.Length);
Array.Clear(playerJoints, 0, playerJoints.Length);
bodyJoints.Clear();
- chestBone1 = 0x0;
- chestBone2 = 0x0;
ignoredJoints.Clear();
- jiggleBones.Clear();
faceJoints.Clear();
+#if QUARANTINED_FEATURES
+ ikJoints.Clear();
+#endif
+ jiggleBones.Clear();
+ chestBone1 = 0x0;
+ chestBone2 = 0x0;
}
private void dropJointOffsets()
{
- jointOffsets.Clear();
+ bodyOffsets.Clear();
+ faceOffsets.Clear();
#if QUARANTINED_FEATURES
ikOffsets.Clear();
#endif
@@ -3504,30 +3477,37 @@ namespace NewCamera private bool usingArmorState()
{
- return jointOffsets.Count > 0 || (hideKnife || checkKnifeHidden) || (enableFreeCamera && orbitPlayer && orbitJoint >= 0);
+ return (bodyOffsets.Count > 0 || faceOffsets.Count > 0) || (hideKnife || checkKnifeHidden) || (enableFreeCamera && orbitPlayer && orbitJoint >= 0);
}
- private void UpdateJointsHook(nint obj)
+ private void UpdateJointsHook(nint model)
{
- if (!disableMod && !didJointOffset && usingArmorState())
+ if (!disableMod && usingArmorState())
{
Player? player = getPlayerWithFallback();
- if (player != null && obj == player.Instance)
+ if (player != null && model == player.Instance)
{
refreshArmorState(player);
- foreach ((nint addr, List<Vector3> offsets) in jointOffsets)
+ foreach ((nint addr, List<Vector3> offsets) in bodyOffsets)
{
MemoryUtil.GetRef<Quaternion>(addr + 0x70) *= Quaternion.CreateFromYawPitchRoll(offsets[0].X, offsets[0].Y, offsets[0].Z);
}
- didJointOffset = true;
if (playerArmor[Armor.Waist] != 0x0)
{
MemoryUtil.GetRef<byte>(playerArmor[Armor.Waist] + 0x2D0) = hideKnife ? (byte)0xFD : (byte)0xFF;
checkKnifeHidden = false;
}
}
+ else if (player != null && model == playerArmor[Armor.Face])
+ {
+ refreshArmorState(player);
+ foreach ((nint addr, List<Vector3> offsets) in faceOffsets)
+ {
+ MemoryUtil.GetRef<Quaternion>(addr + 0x70) *= Quaternion.CreateFromYawPitchRoll(offsets[0].X, offsets[0].Y, offsets[0].Z);
+ }
+ }
}
- updateJointsHook!.Original(obj);
+ updateJointsHook!.Original(model);
}
#if QUARANTINED_FEATURES
@@ -4104,46 +4084,23 @@ namespace NewCamera ImGui.Separator();
- /*
- ref byte ikDisabledB = ref MemoryUtil.GetRef<byte>(MemoryUtil.Read<nint>(player.Instance + 0x990) + 0x5C);
- bool ikDisabled = ikDisabledB == 0x0;
- if (ImGui.Checkbox("Disable IK", ref ikDisabled))
- {
- ikDisabledB = ByteFlag(!ikDisabled);
- }
- if (ImGui.BeginItemTooltip())
- {
- ImGui.Text("Mostly disable inverse kinematics on your player. To rotate ankles, you need to use Force Disable IK.");
- ImGui.EndTooltip();
- }
- ImGui.SameLine();
- */
- if (ImGui.Checkbox("Disable IK", ref ikForcedOff))
+
+
+ bool armorStateRefreshed = false;
+
+ ImGui.PushID("Joints");
+ if (ImGui.CollapsingHeader("Joints"))
{
- if (ikForcedOff)
+ if (!armorStateRefreshed)
{
- forceDisableIK.Enable();
- }
- else
- {
- forceDisableIK.Disable();
+ refreshArmorState(player);
+ armorStateRefreshed = true;
}
- }
- if (ImGui.BeginItemTooltip())
- {
- ImGui.Text("Forcefully disable inverse kinematics.");
- ImGui.EndTooltip();
- }
-
- ImGui.PushID("PartsAndJoints");
- if (ImGui.CollapsingHeader("Armor Parts & Joints"))
- {
- refreshArmorState(player);
ImGui.SetCursorPos(ImGui.GetCursorPos() + new Vector2(0.0f, 6.0f));
#if QUARANTINED_FEATURES
- ImGui.Text($"Joint Offsets: {jointOffsets.Count}, IK Offsets: {ikOffsets.Count}");
+ ImGui.Text($"Joint Offsets: {bodyOffsets.Count + faceOffsets.Count}, IK Offsets: {ikOffsets.Count}");
#else
- ImGui.Text($"Joint Offsets: {jointOffsets.Count}");
+ ImGui.Text($"Joint Offsets: {bodyOffsets.Count + faceOffsets.Count}");
#endif
ImGui.SameLine();
ImGui.SetCursorPos(ImGui.GetCursorPos() - new Vector2(0.0f, 6.0f));
@@ -4151,10 +4108,50 @@ namespace NewCamera {
dropJointOffsets();
}
- if (ImGui.CollapsingHeader("Joints"))
+ ImGui.SameLine();
+ /*
+ ref byte ikDisabledB = ref MemoryUtil.GetRef<byte>(MemoryUtil.Read<nint>(player.Instance + 0x990) + 0x5C);
+ bool ikDisabled = ikDisabledB == 0x0;
+ if (ImGui.Checkbox("Disable IK", ref ikDisabled))
{
- drawJoints(width);
- ImGui.Separator();
+ ikDisabledB = ByteFlag(!ikDisabled);
+ }
+ if (ImGui.BeginItemTooltip())
+ {
+ ImGui.Text("Mostly disable inverse kinematics on your player. To rotate ankles, you need to use Force Disable IK.");
+ ImGui.EndTooltip();
+ }
+ ImGui.SameLine();
+ */
+ ImGui.SetCursorPos(ImGui.GetCursorPos() - new Vector2(0.0f, 6.0f));
+ if (ImGui.Checkbox("Disable IK", ref ikForcedOff))
+ {
+ if (ikForcedOff)
+ {
+ forceDisableIK.Enable();
+ }
+ else
+ {
+ forceDisableIK.Disable();
+ }
+ }
+ if (ImGui.BeginItemTooltip())
+ {
+ ImGui.Text("Forcefully disable inverse kinematics.");
+ ImGui.EndTooltip();
+ }
+ drawJoints(width);
+ ImGui.Separator();
+ }
+ ImGui.PopID();
+
+ ImGui.PushID("Parts");
+ if (ImGui.CollapsingHeader("Armor Parts"))
+ {
+ if (!armorStateRefreshed)
+ {
+ refreshArmorState(player);
+ armorStateRefreshed = true;
}
bool expaned = ImGui.CollapsingHeader("Helmet");
ImGui.SameLine();
@@ -5310,9 +5307,13 @@ namespace NewCamera ImGui.SetNextItemWidth(width * 0.125f);
if (ImGui.DragFloat("Game Speed", ref gameSpeed, 0.005f, 0.0f, Single.MaxValue))
{
- if (gameSpeed == 1.0f)
+ if (freezeGame && gameSpeed != 0.0f)
+ {
+ toggleFreezeGame(gameSpeed);
+ }
+ else if (!freezeGame && gameSpeed == 0.0f)
{
- decoupleDtFromGameTime = false;
+ toggleFreezeGame();
}
}
ImGui.SameLine();
|