Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CommunityBugFixCollection/Locale/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"CommunityBugFixCollection.PauseAnimatorUpdates.Description": "Verhindert, dass Animatoren jeden Frame in alle assoziierten Felder schreiben, obwohl sie nicht am animieren sind.",
"CommunityBugFixCollection.ReallyNoDestroyUndo.Description": "Sorgt dafür, dass die NoDestroyUndo Komponente tatsächlich verhindert, dass das Zerstören eines Objekts rückgängig gemacht werden kann.",
"CommunityBugFixCollection.SmoothDraggables.Description": "Umgeht, dass Slider und Joints in Headless-Sessions verrutschen.",
"CommunityBugFixCollection.StopTrackedDeviceSpam.Description": "Fügt null-Checks in der UpdateBodyNode-Methode der TrackedDevicePositioner-Komponente hinzu, um Logspam zu verhindern.",
"CommunityBugFixCollection.TiltedUIAlignment.Description": "Kippt die UI-fokussierte Kamera, um UIX-Renderprobleme zum umgehen.",
"CommunityBugFixCollection.SteamVRFocusResolutionScale.Description": "Verhindert, dass das SteamVR Unity Plugin die Renderauflösung dauerhaft verringert, wenn ein Fokusevent verpasst wird.",
"CommunityBugFixCollection.StationaryGrabWorldActivation.Description": "Verhindert, dass die Welt-Greifen Fortbewegung den Spieler bei jeder Aktivierung bewegt.",
Expand Down
1 change: 1 addition & 0 deletions CommunityBugFixCollection/Locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"CommunityBugFixCollection.SmoothDraggables.Description": "Workaround for Sliders and Joints snapping in sessions hosted by a headless.",
"CommunityBugFixCollection.StationaryGrabWorldActivation.Description": "Stops the Grab World Locomotion from moving the player with each activiation.",
"CommunityBugFixCollection.SteamVRFocusResolutionScale.Description": "Prevents the SteamVR Unity plugin from permanently lowering the render resolution when a focus event is missed.",
"CommunityBugFixCollection.StopTrackedDeviceSpam.Description": "Adds null-checks in the TrackedDevicePositioner component's UpdateBodyNode method to prevent log spam.",
"CommunityBugFixCollection.TiltedUIAlignment.Description": "Tilts the UI-Focus camera to work around UIX rendering issues.",
"CommunityBugFixCollection.ValidQuaternionInputs.Description": "Makes the ProtoFlux Tool spawn valid float and double quaternion inputs.",
"CommunityBugFixCollection.ValueModDecimal.Description": "Adds a zero check to the Decimal ValueMod ProtoFlux node to prevent DIV/0 crashes.",
Expand Down
76 changes: 76 additions & 0 deletions CommunityBugFixCollection/StopTrackedDeviceSpam.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using Elements.Core;
using FrooxEngine;
using FrooxEngine.CommonAvatar;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommunityBugFixCollection
{
[HarmonyPatchCategory(nameof(StopTrackedDeviceSpam))]
[HarmonyPatch(typeof(TrackedDevicePositioner), nameof(TrackedDevicePositioner.UpdateBodyNode))]
internal sealed class StopTrackedDeviceSpam : ResoniteBugFixMonkey<StopTrackedDeviceSpam>
{
public override IEnumerable<string> Authors => Contributors.Banane9;

[HarmonyPatch()]
private static bool Prefix(TrackedDevicePositioner __instance)
{
if (!Enabled)
return true;

if (__instance.TrackedDevice is not ITrackedDevice device)
return false;

var bodyNode = device.CorrespondingBodyNode;
if (__instance.ObjectSlot.Target is not null && __instance.UsingExternalObjectSlot)
{
if (__instance.ObjectSlot.Target.Node.Value == bodyNode)
return false;

__instance.ObjectSlot.Target = null!;
}

var target = __instance.ObjectSlot.Target;
if (target is null || target.Node.Value != bodyNode)
{
var existingBodyNode = __instance.LocalUserRoot.GetRegisteredComponent((AvatarObjectSlot s) => s.Node.Value == bodyNode);

if (existingBodyNode != null)
{
UniLog.Log($"Device corresponding body node: {bodyNode}. Exiting: {__instance.ObjectSlot.Target?.Node.Value}");

__instance.RemoveBodyNode();
__instance.ObjectSlot.Target = existingBodyNode;

return false;
}
}

if (__instance.CreateAvatarObjectSlot.Value)
__instance.UpdateObjectSlot();

if (__instance.BodyNodeRoot.Target.FilterWorldElement() is not null)
{
if (device.IsDeviceActive)
{
__instance.BodyNodeRoot.Target.LocalPosition = device.BodyNodePositionOffset;
__instance.BodyNodeRoot.Target.LocalRotation = device.BodyNodeRotationOffset;
}
else
{
__instance.BodyNodeRoot.Target.LocalPosition = float3.Zero;
__instance.BodyNodeRoot.Target.LocalRotation = floatQ.Identity;
}
}

if (__instance.ObjectSlot.Target!.FilterWorldElement() is not null)
__instance.ObjectSlot.Target!.Node.Value = bodyNode;

return false;
}
}
}
1 change: 0 additions & 1 deletion CommunityBugFixCollection/ValidQuaternionInputs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using FrooxEngine.ProtoFlux;
using FrooxEngine.ProtoFlux.Runtimes.Execution.Nodes;
using HarmonyLib;
using MonkeyLoader;
using System;
using System.Collections.Generic;
using System.Text;
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ just disable them in the settings in the meantime.
* Animators updating all associated fields every frame while enabled but not playing (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3480)
* Grid World floor shaking on AMD and Intel GPUs (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3829)
* DuplicateSlot ProtoFlux node crashes game when if OverrideParent is identical to Template (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3950)
* Log spam from `TrackedDevicePositioner.UpdateBodyNode()` in certain scenarios (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/5182)

Fixes with no issue (that could be found).
* Content of notification being off-center.
Expand Down
Loading