From cb082b12b7d61942c99cccf8c64127304c62cec4 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sun, 9 Aug 2026 21:36:12 -0400 Subject: Joints fixes, expose face joints Signed-off-by: Andrew Opalach --- Plugin.cs | 261 ++++++++++++++++++++++---------------------- Scripts/copy_libs.sh | 10 +- Scripts/zip_from_gamedir.sh | 9 +- 3 files changed, 140 insertions(+), 140 deletions(-) diff --git a/Plugin.cs b/Plugin.cs index 0451ea8..6fd0d83 100755 --- a/Plugin.cs +++ b/Plugin.cs @@ -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? updateJointsHook; - private delegate void UpdateJointChild(nint child, nint joint, nint obj); private List bodyJoints = new List(); private List ignoredJoints = new List(); - private Dictionary> jointOffsets = new Dictionary>(); - private bool didJointOffset = false; + private Dictionary> bodyOffsets = new Dictionary>(); + + private List faceJoints = new List(); + private Dictionary> faceOffsets = new Dictionary>(); #if QUARANTINED_FEATURES private delegate void UpdateIK(nint superOfChild, nint joint, nint obj); private Hook? updateIKHook; private Dictionary> ikOffsets = new Dictionary>(); -#endif private List ikJoints = new List(); +#endif private bool ikForcedOff = false; private Patch forceDisableIK; @@ -537,13 +539,6 @@ namespace NewCamera private nint chestBone1 = 0x0; private nint chestBone2 = 0x0; - private List faceJoints = new List(); - /* - private bool overrideFacePose; - private Patch noopFacePose; - private Patch noopFacePoseUpdate; - */ - /* private delegate void ChangeEquipment(nint unknownPtr, int unknownInt); private Hook? 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(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(addr, CalculateCameraHook); checkCameraHook = Hook.Create(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(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(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(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(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(addr, CheckMovementHook); collisionCheckHook = Hook.Create(0x1411C4E50, CollisionCheckHook); // nint, nint @@ -863,21 +846,15 @@ namespace NewCamera cameraEffectHook = Hook.Create(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(0x141AC0B60); getPlayerSettingsAddr = new NativeFunction(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(0x14223BA30, UpdateJointsHook); + #if QUARANTINED_FEATURES updateIKHook = Hook.Create(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((swapChestSides ? chestBone2 : chestBone1) + 0xD0); ref Vector3 jiggle2 = ref MemoryUtil.GetRef((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(sMain.Instance + 0xA4) = freezeGame ? 0.0f : 1.0f; + MemoryUtil.GetRef(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(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> 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() + offsets.Add(jointAddr, new List() { 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 joints, int i) + private void drawJoint(nint jointAddr) + { + drawJoint(jointAddr, bodyOffsets); + } + + private void drawJointLeaf(ref List joints, int i, Dictionary> offsets) { if (i >= joints.Count) return; nint jointAddr = joints[i]; byte treeLevel = MemoryUtil.Read(jointAddr + 0x14); + //byte id = MemoryUtil.Read(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(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 offsets) in jointOffsets) + foreach ((nint addr, List offsets) in bodyOffsets) { MemoryUtil.GetRef(addr + 0x70) *= Quaternion.CreateFromYawPitchRoll(offsets[0].X, offsets[0].Y, offsets[0].Z); } - didJointOffset = true; if (playerArmor[Armor.Waist] != 0x0) { MemoryUtil.GetRef(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 offsets) in faceOffsets) + { + MemoryUtil.GetRef(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(MemoryUtil.Read(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(MemoryUtil.Read(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(); diff --git a/Scripts/copy_libs.sh b/Scripts/copy_libs.sh index e5f97d3..f8b9172 100755 --- a/Scripts/copy_libs.sh +++ b/Scripts/copy_libs.sh @@ -5,9 +5,13 @@ BASE_PATH="$1" GAME_PATH="/mnt/ssd/SteamLibrary/steamapps/common/Monster Hunter World/" -rsync -av "$BASE_PATH/SharpPluginLoader-fork/x64/Release/mhw-cs-plugin-loader.dll" "$GAME_PATH/ucrtbase.dll" -rsync -av "$BASE_PATH/SharpPluginLoader-fork/SharpPluginLoader.Core/bin/Release/net8.0/SharpPluginLoader.Core.dll" "$GAME_PATH/nativePC/plugins/CSharp/Loader/" -rsync -av "$BASE_PATH/SharpPluginLoader-fork/SharpPluginLoader.Bootstrapper/bin/Release/net8.0/SharpPluginLoader.Bootstrapper.dll" "$GAME_PATH/nativePC/plugins/CSharp/Loader/" +BUILD_TYPE="Release" + +rsync -av "$BASE_PATH/SharpPluginLoader-fork/x64/$BUILD_TYPE/mhw-cs-plugin-loader.dll" "$GAME_PATH/ucrtbase.dll" +#rsync -av "$BASE_PATH/SharpPluginLoader-fork/x64/$BUILD_TYPE/mhw-cs-plugin-loader.dll" "$GAME_PATH/winmm.dll" +#rsync -av "$BASE_PATH/SharpPluginLoader-fork/x64/$BUILD_TYPE/SPLLauncher.exe" "$GAME_PATH/SPLLauncher.exe" +rsync -av "$BASE_PATH/SharpPluginLoader-fork/SharpPluginLoader.Core/bin/$BUILD_TYPE/net8.0/SharpPluginLoader.Core.dll" "$GAME_PATH/nativePC/plugins/CSharp/Loader/" +rsync -av "$BASE_PATH/SharpPluginLoader-fork/SharpPluginLoader.Bootstrapper/bin/$BUILD_TYPE/net8.0/SharpPluginLoader.Bootstrapper.dll" "$GAME_PATH/nativePC/plugins/CSharp/Loader/" rsync -av "$BASE_PATH/SharpPluginLoader-fork/Assets/Default.bin" "$GAME_PATH/nativePC/plugins/CSharp/Loader/" rsync -av "$BASE_PATH/NewCamera/bin/Release/net8.0/NewCamera.dll" "$GAME_PATH/nativePC/plugins/CSharp/" diff --git a/Scripts/zip_from_gamedir.sh b/Scripts/zip_from_gamedir.sh index cf7402b..8a6142a 100755 --- a/Scripts/zip_from_gamedir.sh +++ b/Scripts/zip_from_gamedir.sh @@ -8,12 +8,7 @@ nativePC/plugins/CSharp/Loader/SharpPluginLoader.runtimeconfig.json \ nativePC/plugins/CSharp/NewCamera.dll \ nativePC/plugins/CSharp/NewCamera.json \ - nativePC/plugins/CSharp/Shaders/body_skin.shdr \ - nativePC/plugins/CSharp/Shaders/cube_only.shdr \ - nativePC/plugins/CSharp/Shaders/face.shdr \ - nativePC/plugins/CSharp/Shaders/fxaa_max_quality.hlsl \ - nativePC/plugins/CSharp/Shaders/sslr.shdr \ - nativePC/plugins/CSharp/Shaders/volume_upsample1.shdr \ - nativePC/plugins/CSharp/Shaders/volume_upsample2.shdr \ + nativePC/plugins/CSharp/Shaders/* \ + nativePC/plugins/CSharp/LUT/* \ nativePC/plugins/CSharp/WorldTuningTool.dll \ nativePC/plugins/CSharp/WorldTuningTool.json -- cgit v1.2.3-101-g0448