-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reclassify as workaround and make more compact
- Loading branch information
Showing
3 changed files
with
48 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<SmoothDraggables> | ||
{ | ||
public override IEnumerable<string> 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()); | ||
}); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters