-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add remaining build member events and default handlers
- Loading branch information
Showing
9 changed files
with
500 additions
and
240 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
75 changes: 0 additions & 75 deletions
75
MonkeyLoader.Resonite.Integration/UI/BuildSyncMemberEditorEvents.cs
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
MonkeyLoader.Resonite.Integration/UI/DefaultSyncMemberEditorBuilderHandlers.cs
This file was deleted.
Oops, something went wrong.
111 changes: 111 additions & 0 deletions
111
MonkeyLoader.Resonite.Integration/UI/Inspectors/BuildConcreteEditorEvents.cs
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,111 @@ | ||
using FrooxEngine.UIX; | ||
using FrooxEngine; | ||
using System; | ||
using System.Reflection; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace MonkeyLoader.Resonite.UI.Inspectors | ||
{ | ||
/// <summary> | ||
/// Represents the event fired during construction of a <see cref="MemberEditor"/> for an <see cref="ISyncArray"/>. | ||
/// </summary> | ||
public sealed class BuildArrayEditorEvent : BuildMemberEditorEvent | ||
{ | ||
/// <summary> | ||
/// Gets the sync array that a <see cref="MemberEditor"/> is being constructed for. | ||
/// </summary> | ||
public new ISyncArray Member { get; } | ||
|
||
internal BuildArrayEditorEvent(ISyncArray member, string name, FieldInfo fieldInfo, UIBuilder ui, float labelSize) | ||
: base(member, name, fieldInfo, ui, labelSize) | ||
{ | ||
Member = member; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Represents the event fired during construction of a <see cref="MemberEditor"/> for an <see cref="ISyncBag"/>. | ||
/// </summary> | ||
public sealed class BuildBagEditorEvent : BuildMemberEditorEvent | ||
{ | ||
/// <summary> | ||
/// Gets the sync bag that a <see cref="MemberEditor"/> is being constructed for. | ||
/// </summary> | ||
public new ISyncBag Member { get; } | ||
|
||
internal BuildBagEditorEvent(ISyncBag member, string name, FieldInfo fieldInfo, UIBuilder ui) | ||
: base(member, name, fieldInfo, ui) | ||
{ | ||
Member = member; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Represents the event fired during construction of a <see cref="MemberEditor"/> for an <see cref="IField"/>. | ||
/// </summary> | ||
public sealed class BuildFieldEditorEvent : BuildMemberEditorEvent | ||
{ | ||
/// <summary> | ||
/// Gets the field that a <see cref="MemberEditor"/> is being constructed for. | ||
/// </summary> | ||
public new IField Member { get; } | ||
|
||
internal BuildFieldEditorEvent(IField member, string name, FieldInfo fieldInfo, UIBuilder ui, float labelSize) | ||
: base(member, name, fieldInfo, ui, labelSize) | ||
{ | ||
Member = member; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Represents the event fired during construction of a <see cref="MemberEditor"/> for an <see cref="ISyncList"/>. | ||
/// </summary> | ||
public sealed class BuildListEditorEvent : BuildMemberEditorEvent | ||
{ | ||
/// <summary> | ||
/// Gets the sync list that a <see cref="MemberEditor"/> is being constructed for. | ||
/// </summary> | ||
public new ISyncList Member { get; } | ||
|
||
internal BuildListEditorEvent(ISyncList member, string name, FieldInfo fieldInfo, UIBuilder ui) | ||
: base(member, name, fieldInfo, ui) | ||
{ | ||
Member = member; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Represents the event fired during construction of a <see cref="MemberEditor"/> for an <see cref="SyncObject"/>. | ||
/// </summary> | ||
public sealed class BuildObjectEditorEvent : BuildMemberEditorEvent | ||
{ | ||
/// <summary> | ||
/// Gets the sync object that a <see cref="MemberEditor"/> is being constructed for. | ||
/// </summary> | ||
public new SyncObject Member { get; } | ||
|
||
internal BuildObjectEditorEvent(SyncObject member, string name, FieldInfo fieldInfo, UIBuilder ui, float labelSize) | ||
: base(member, name, fieldInfo, ui, labelSize) | ||
{ | ||
Member = member; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Represents the event fired during construction of a <see cref="MemberEditor"/> for an <see cref="SyncPlayback"/>. | ||
/// </summary> | ||
public sealed class BuildPlaybackEditorEvent : BuildMemberEditorEvent | ||
{ | ||
/// <summary> | ||
/// Gets the sync playback that a <see cref="MemberEditor"/> is being constructed for. | ||
/// </summary> | ||
public new SyncPlayback Member { get; } | ||
|
||
internal BuildPlaybackEditorEvent(SyncPlayback member, string name, FieldInfo fieldInfo, UIBuilder ui, float labelSize) | ||
: base(member, name, fieldInfo, ui, labelSize) | ||
{ | ||
Member = member; | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
MonkeyLoader.Resonite.Integration/UI/Inspectors/BuildMemberEditorEvent.cs
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,47 @@ | ||
using FrooxEngine.UIX; | ||
using FrooxEngine; | ||
using MonkeyLoader.Resonite.Events; | ||
using System.Reflection; | ||
using MonkeyLoader.Events; | ||
|
||
namespace MonkeyLoader.Resonite.UI.Inspectors | ||
{ | ||
/// <summary> | ||
/// Represents the base class for the events fired during construction of a <see cref="MemberEditor"/> | ||
/// </summary> | ||
[DispatchableBaseEvent] | ||
public abstract class BuildMemberEditorEvent : CancelableBuildUIEvent | ||
{ | ||
/// <summary> | ||
/// Gets the reflection data for the field that stores the <see cref="Member">Member</see> | ||
/// that a <see cref="MemberEditor"/> is being constructed for. | ||
/// </summary> | ||
public FieldInfo FieldInfo { get; } | ||
|
||
/// <summary> | ||
/// Gets the size for the <see cref="Name">Name</see> label | ||
/// that should be displayed for the <see cref="MemberEditor"/>.<br/> | ||
/// Not all member editors get passed a label size. | ||
/// </summary> | ||
public float? LabelSize { get; } | ||
|
||
/// <summary> | ||
/// Gets the sync member that a <see cref="MemberEditor"/> is being constructed for. | ||
/// </summary> | ||
public ISyncMember Member { get; } | ||
|
||
/// <summary> | ||
/// Gets the name that should be used for the <see cref="MemberEditor"/> label. | ||
/// </summary> | ||
public string Name { get; } | ||
|
||
internal BuildMemberEditorEvent(ISyncMember member, string name, FieldInfo fieldInfo, UIBuilder ui, float? labelSize = null) | ||
: base(ui) | ||
{ | ||
Member = member; | ||
Name = name; | ||
FieldInfo = fieldInfo; | ||
LabelSize = labelSize; | ||
} | ||
} | ||
} |
Oops, something went wrong.