Skip to content

Commit

Permalink
Fix missing Handle implementation for Arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Banane9 committed Oct 3, 2024
1 parent b5b3c03 commit 083fefb
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ internal sealed class DefaultBuildMemberEditorHandlers : ResoniteMonkey<DefaultB

public bool SkipCanceled => true;

void ICancelableEventHandler<BuildArrayEditorEvent>.Handle(BuildArrayEditorEvent eventData) => throw new NotImplementedException();
void ICancelableEventHandler<BuildArrayEditorEvent>.Handle(BuildArrayEditorEvent eventData)
{
BuildArray(eventData.Member, eventData.Name, eventData.FieldInfo, eventData.UI, eventData.LabelSize!.Value);

eventData.Canceled = true;
}

public void Handle(BuildBagEditorEvent eventData)
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 083fefb

Please sign in to comment.