mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Changed what flags are set for member finding
This commit is contained in:
1 parent
bae3a245f1
commit
121744e9ef
1 file changed
+11
-4
@@ -153,12 +153,19 @@ public sealed class ModdedOptionVisiblityAttribute(Type? holderType = null, stri
|
||||
#pragma warning disable S3011 // Reflection should not be used to increase accessibility of classes, methods, or fields
|
||||
private MemberInfo? GetVisibilityMember(AbstractOptionGroup group, PropertyInfo property, out Type type)
|
||||
{
|
||||
type = holderType ?? group.GetType();
|
||||
memberName ??= $"{property.Name}Visible";
|
||||
Type groupType = group.GetType();
|
||||
BindingFlags flags = BindingFlags.Static | BindingFlags.Public;
|
||||
if (holderType == null)
|
||||
|
||||
type = holderType ?? groupType;
|
||||
memberName ??= $"{property.Name}Visible";
|
||||
if (type.IsAssignableTo(typeof(AbstractOptionGroup)))
|
||||
{
|
||||
flags |= BindingFlags.Instance | BindingFlags.NonPublic;
|
||||
flags |= BindingFlags.Instance;
|
||||
|
||||
if (type == groupType)
|
||||
{
|
||||
flags |= BindingFlags.NonPublic;
|
||||
}
|
||||
}
|
||||
return type.GetMember(memberName, flags).FirstOrDefault();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user