From 2d63873a79aeee961be10472533050c136dd98ee Mon Sep 17 00:00:00 2001 From: Arne Kiesewetter Date: Thu, 23 Jan 2025 11:58:47 +0100 Subject: [PATCH] Reclassify as workaround and make more compact --- CommunityBugFixCollection/SmoothDraggables.cs | 38 ++++++++++++ .../SmoothSlidersAndJoints.cs | 58 ------------------- README.md | 12 +++- 3 files changed, 48 insertions(+), 60 deletions(-) create mode 100644 CommunityBugFixCollection/SmoothDraggables.cs delete mode 100644 CommunityBugFixCollection/SmoothSlidersAndJoints.cs diff --git a/CommunityBugFixCollection/SmoothDraggables.cs b/CommunityBugFixCollection/SmoothDraggables.cs new file mode 100644 index 0000000..ac0daff --- /dev/null +++ b/CommunityBugFixCollection/SmoothDraggables.cs @@ -0,0 +1,38 @@ +using FrooxEngine; +using HarmonyLib; +using MonkeyLoader.Resonite; +using System; +using System.Collections.Generic; +using System.Text; + +// Originally released under MIT by LeCloutPanda here: +// https://github.com/LeCloutPanda/SoNoHeadCrash + +namespace CommunityBugFixCollection +{ + [HarmonyPatchCategory(nameof(SmoothDraggables))] + [HarmonyPatch(typeof(Draggable), nameof(Draggable.OnAwake))] + internal sealed class SmoothDraggables : ResoniteMonkey + { + public override IEnumerable Authors => base.Authors; + + public override bool CanBeDisabled => true; + + public static void Postfix(Draggable __instance) + { + if (!Enabled || __instance.LocalUser.HeadDevice != HeadOutputDevice.Headless || !__instance.LocalUser.IsHost) + return; + + __instance.RunInUpdates(3, () => + { + if (__instance.FilterWorldElement() is null) + return; + + __instance.DontDrive.Value = true; + + Logger.Info(() => $"Set DontDrive to true for Draggable:"); + Logger.Info(() => __instance.ParentHierarchyToString()); + }); + } + } +} \ No newline at end of file diff --git a/CommunityBugFixCollection/SmoothSlidersAndJoints.cs b/CommunityBugFixCollection/SmoothSlidersAndJoints.cs deleted file mode 100644 index c30a0f8..0000000 --- a/CommunityBugFixCollection/SmoothSlidersAndJoints.cs +++ /dev/null @@ -1,58 +0,0 @@ -using FrooxEngine; -using HarmonyLib; -using MonkeyLoader.Resonite; -using System; -using System.Collections.Generic; -using System.Text; - -// Originally released under MIT by LeCloutPanda here: -// https://github.com/LeCloutPanda/SoNoHeadCrash - -namespace CommunityBugFixCollection -{ - [HarmonyPatch("OnAwake")] - [HarmonyPatchCategory(nameof(SmoothSlidersAndJoints))] - internal sealed class SmoothSlidersAndJoints : ResoniteMonkey - { - public override IEnumerable Authors => base.Authors; - public override bool CanBeDisabled => true; - - [HarmonyPostfix] - [HarmonyPatch(typeof(Joint))] - public static void JointOnAwakePostfix(Joint __instance) - { - if (!Enabled || __instance.LocalUser.HeadDevice != HeadOutputDevice.Headless || !__instance.LocalUser.IsHost) - return; - - __instance.RunInUpdates(3, () => - { - if (__instance.FilterWorldElement() is null) - return; - - __instance.DontDrive.Value = true; - - Logger.Info(() => $"Set DontDrive to true for Joint:"); - Logger.Info(() => __instance.ParentHierarchyToString()); - }); - } - - [HarmonyPostfix] - [HarmonyPatch(typeof(Slider))] - public static void SliderOnAwakePostfix(Slider __instance) - { - if (!Enabled || __instance.LocalUser.HeadDevice != HeadOutputDevice.Headless || !__instance.LocalUser.IsHost) - return; - - __instance.RunInUpdates(3, () => - { - if (__instance.FilterWorldElement() is null) - return; - - __instance.DontDrive.Value = true; - - Logger.Info(() => $"Set DontDrive to true for Slider:"); - Logger.Info(() => __instance.ParentHierarchyToString()); - }); - } - } -} \ No newline at end of file diff --git a/README.md b/README.md index b704d13..af9b3d5 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,6 @@ just disable them in the settings in the meantime. * ColorX Luminance calculations being incorrect for non-linear color profiles (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/281) * Non-HDR variants of Color(X) channel addition not clamping (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/316) * Color Profile not being preserved on all operations (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/318) -* Sliders and Joints snapping in sessions hosted by a headless (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/399) * ProtoFlux Node names containing `ColorX` being spaced wrong (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/496) * The selected Home World in the Inventory not being highlighted as a favorite (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/503) * The MaterialGizmo being scaled twice when using Edit on the Material Tool (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/528) @@ -36,4 +35,13 @@ just disable them in the settings in the meantime. * URLs to text files or Resonite Packages failing to import instead of appearing as a hyperlink (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/785) * References in multiple duplicated or transferred-between-worlds items breaking (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/984) * UserInspectors not listing existing users in the session for non-host users (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1964) -* Animators updating all associated fields every frame while enabled but not playing (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3480) \ No newline at end of file +* Animators updating all associated fields every frame while enabled but not playing (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3480) + + +## Workarounds + +The issues that have workarounds in this mod will be linked in the following list. +If any of them have been closed and not removed from the mod, +just disable them in the settings in the meantime. + +* Sliders and Joints snapping in sessions hosted by a headless (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/399) \ No newline at end of file