From 083fefb6928eae76f70fb16e69fbdc65c3236c02 Mon Sep 17 00:00:00 2001 From: Arne Kiesewetter Date: Thu, 3 Oct 2024 12:06:59 +0200 Subject: [PATCH] Fix missing Handle implementation for Arrays --- .../UI/Inspectors/DefaultBuildMemberEditorHandlers.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/MonkeyLoader.Resonite.Integration/UI/Inspectors/DefaultBuildMemberEditorHandlers.cs b/MonkeyLoader.Resonite.Integration/UI/Inspectors/DefaultBuildMemberEditorHandlers.cs index a8246d6..7c53dda 100644 --- a/MonkeyLoader.Resonite.Integration/UI/Inspectors/DefaultBuildMemberEditorHandlers.cs +++ b/MonkeyLoader.Resonite.Integration/UI/Inspectors/DefaultBuildMemberEditorHandlers.cs @@ -24,7 +24,12 @@ internal sealed class DefaultBuildMemberEditorHandlers : ResoniteMonkey true; - void ICancelableEventHandler.Handle(BuildArrayEditorEvent eventData) => throw new NotImplementedException(); + void ICancelableEventHandler.Handle(BuildArrayEditorEvent eventData) + { + BuildArray(eventData.Member, eventData.Name, eventData.FieldInfo, eventData.UI, eventData.LabelSize!.Value); + + eventData.Canceled = true; + } public void Handle(BuildBagEditorEvent eventData) { @@ -75,6 +80,8 @@ protected override bool OnEngineReady() return base.OnEngineReady(); } +#pragma warning disable IDE0060 // Remove unused parameter + [HarmonyReversePatch] [HarmonyPatch(nameof(SyncMemberEditorBuilder.BuildArray))] private static void BuildArray(ISyncArray array, string name, FieldInfo fieldInfo, UIBuilder ui, float labelSize) @@ -105,6 +112,8 @@ private static void BuildPlayback(SyncPlayback playback, string name, FieldInfo private static void BuildSyncObject(SyncObject syncObject, string name, FieldInfo fieldInfo, UIBuilder ui, float labelSize) => ThrowNotImplemented(); +#pragma warning restore IDE0060 // Remove unused parameter + [DoesNotReturn] private static void ThrowNotImplemented() => throw new NotImplementedException();