From 773173c48228b76e6442909c20f316081444cf7a Mon Sep 17 00:00:00 2001 From: E1int <110526002+E1int@users.noreply.github.com> Date: Wed, 28 May 2025 20:21:23 +0200 Subject: [PATCH] Add update order workaround for MemberEditors This implements the suggested workaround for https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/4431 --- CommunityBugFixCollection/Contributors.cs | 2 ++ CommunityBugFixCollection/Locale/de.json | 1 + CommunityBugFixCollection/Locale/en.json | 3 ++- .../MemberEditorUpdateOrder.cs | 24 +++++++++++++++++++ README.md | 1 + 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 CommunityBugFixCollection/MemberEditorUpdateOrder.cs diff --git a/CommunityBugFixCollection/Contributors.cs b/CommunityBugFixCollection/Contributors.cs index d1011a8..61bab7a 100644 --- a/CommunityBugFixCollection/Contributors.cs +++ b/CommunityBugFixCollection/Contributors.cs @@ -22,5 +22,7 @@ internal static class Contributors public static string[] Nytra { get; } = ["Nytra"]; public static string[] Onan { get; } = ["989onan"]; + + public static string[] yosh { get; } = ["yosh"]; } } \ No newline at end of file diff --git a/CommunityBugFixCollection/Locale/de.json b/CommunityBugFixCollection/Locale/de.json index c0d1a61..4dca68a 100644 --- a/CommunityBugFixCollection/Locale/de.json +++ b/CommunityBugFixCollection/Locale/de.json @@ -33,6 +33,7 @@ "CommunityBugFixCollection.ImportWebFilesAsUrls.Description": "Sorgt dafür, dass URLs zu Textdateien oder Resonite Packages nicht importiert werden, statt als Hyperlink aufzutauchen.", "CommunityBugFixCollection.LocalizedByteFormatting.Description": "Lokalisiert die Speichereinheiten (MiB, GiB, etc.), inbsesondere bei der StorageUsageStatus-Komponente. Es gibt eine Einstellung dafür, die Bytes nach IEC (Faktor 1024) statt dezimal (Faktor 1000) zu formatieren.", "CommunityBugFixCollection.LongerWorldLoadingFailIndication.Description": "Lässt den Welt-Ladefortschritts-Indikator frühestens nach 20s verschwinden, falls der Vorgang fehlgeschlagen ist.", + "CommunityBugFixCollection.MemberEditorUpdateOrder.Description": "Sets die Update Order von MemberEditor-Komponenten in Inspektoren auf den höchsten Wert, um (meistens) einen Frame Verzögerung beim angezeigten Wert zu verhindern.", "CommunityBugFixCollection.NaNtEqual.Description": "Sorgt dafür, dass NaN float / double Werte sich bei den == und != ProtoFlux Nodes sowie bei der ValueEqualityDriver-Komponente niemals gleichen.", "CommunityBugFixCollection.NoAudioOutputCrash.Description": "Verhindert, dass die AudioOutput-Komponente ihre Listener aktualisiert nachdem sie entfernt wurde und damit die Session crasht.", "CommunityBugFixCollection.NoLossOfColorProfile.Description": "Verhindert, dass Farbprofile nicht bei allen Berechnungen erhalten bleiben.", diff --git a/CommunityBugFixCollection/Locale/en.json b/CommunityBugFixCollection/Locale/en.json index e5d3329..221c59e 100644 --- a/CommunityBugFixCollection/Locale/en.json +++ b/CommunityBugFixCollection/Locale/en.json @@ -24,7 +24,7 @@ "CommunityBugFixCollection.ConsistentContextMenuAngularSize.Description": "Makes the context menu stay a fixed on-screen size in desktop mode, regardless of FOV.", "CommunityBugFixCollection.ConstantNodeNameAdjustments.Name": "(Legacy) Constant Node Name Adjustments", "CommunityBugFixCollection.ConstantNodeNameAdjustments.Description": "(Legacy) Changes the names of the ProtoFlux nodes in Strings > Constants to be how they were with the original fix.", - "CommunityBugFixCollection.CopySyncMemberToClipboardAction.Description": "Adds Copy to Clipboard action on any non-reference member fields in Inspectors.", + "CommunityBugFixCollection.CopySyncMemberToClipboardAction.Description": "Adds Copy to Clipboard action on any non-reference member fields in inspectors.", "CommunityBugFixCollection.CorrectMaterialGizmoScaling.Description": "Fixes the MaterialGizmo being scaled twice when using Edit on the Material Tool.", "CommunityBugFixCollection.CorrectOverriddenSpelling.Description": "Corrects the spelling of Overridden on ProtoFlux nodes.", "CommunityBugFixCollection.DuplicateAndMoveMultipleGrabbedItems.Description": "Fixes references between multiple duplicated or transferred-between-worlds items breaking.", @@ -39,6 +39,7 @@ "CommunityBugFixCollection.ImportWebFilesAsUrls.Description": "Fixes URLs to text files or Resonite Packages failing to import instead of appearing as a hyperlink.", "CommunityBugFixCollection.LocalizedByteFormatting.Description": "Localizes the storage units (MiB, GiB, etc.), in particular for the StorageUsageStatus component. There's an option to use IEC format (factor 1024) over decimal (factor 1000).", "CommunityBugFixCollection.LongerWorldLoadingFailIndication.Description": "Only lets the World Load Progress Indicator disappear after 20s or more if the process failed.", + "CommunityBugFixCollection.MemberEditorUpdateOrder.Description": "Sets the Update Order of MemberEditor components in inspectors to the highest value to (most of the time) prevent a frame delay in the value they show.", "CommunityBugFixCollection.NaNtEqual.Description": "Makes NaN floats / doubles never equal to each other for the ProtoFlux == and != nodes, as well as the ValueEqualityDriver component.", "CommunityBugFixCollection.NoAudioOutputCrash.Description": "Prevents the AudioOutput component from updating listeners when it's been removed and crashing the sessions.", "CommunityBugFixCollection.NoLossOfColorProfile.Description": "Fixes Color Profile not being preserved on all operations.", diff --git a/CommunityBugFixCollection/MemberEditorUpdateOrder.cs b/CommunityBugFixCollection/MemberEditorUpdateOrder.cs new file mode 100644 index 0000000..2e9cb94 --- /dev/null +++ b/CommunityBugFixCollection/MemberEditorUpdateOrder.cs @@ -0,0 +1,24 @@ +using FrooxEngine; +using HarmonyLib; +using MonkeyLoader.Resonite; + +// This originally came from yosh (https://git.unix.dog/yosh) +// But I can't find the mod anywhere anymore? + +namespace CommunityBugFixCollection +{ + [HarmonyPatchCategory(nameof(MemberEditorUpdateOrder))] + [HarmonyPatch(typeof(MemberEditor), nameof(MemberEditor.Setup))] + internal sealed class MemberEditorUpdateOrder : ResoniteMonkey + { + public override IEnumerable Authors => Contributors.yosh; + + public override bool CanBeDisabled => true; + + private static void Postfix(MemberEditor __instance) + { + if (Enabled) + __instance.UpdateOrder = int.MaxValue; + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index dbae887..65d53fd 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ just disable them in the settings in the meantime. * https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1158 * https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2979 * UIX Rendering issues in UI-Focus mode (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1292) +* Driven values in inspectors usually appear delayed by a frame (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/4431) ## Features