-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phedg1 #234
Phedg1 #234
Conversation
Changed drop list operation lists so they are cleared each time they are used, as a stop gap measure so my other mods would be able to continue functioning normally. I know Rein's methods will make this redundant shortly. Drop lists should never be empty now and will always contain PickupIndex.none instead. This was for increased consistency, as previously these lists could sometimes contain none and sometimes be empty, causing bugs. Added function to determine if a drop list only contained PickupIndex.none, this has been substituted in wherever a check was done previously to see if a drop list was empty. All world unique items are now stored in a list in Catalog and are no longer added to the subset drop lists in DropList by default. When using the command artifact, world unique items will now be listed by themselves unless they are added to the subset drop list of their tier. Boss drops now check their availability against the world unique drop list if their drop is a world unique item.
Added ability to add items of any tier to any drop list. Added hooks and functionality so the artifact of command interfact can display a custom list. Added hooks so interactables would not filter drop lists to limit them to specific tiers. Altered tiers in InteractableCalculator so items in a tier of drop list could be differentiated from items of a tier in any drop list. Added functions to Reflection for getting nested field and method infos. Added function to Reflection log all opcodes for a cursor to help with debugging. Added function to Reflection for getting a generic method info when multiple functions with the same name exist. Added Unity physics module dependency for a hook that required the Collision type. Fixed bug in MonsterItemsAPI that occured when the ItemDropAPI drop lists differed from the MonsterItemsAPI drop lists.
It's worth noting that in order to add this extra functionality the surface area of this module is MUCH greater. |
Added proper binding flags to my contributions in Reflection. Steamlined my contributions in Reflection. Enumerated the drop types in InteractableCalculator. Removed some checks against the Run drop lists and increased relaince on InteractableCalculator TiersPresent. Expanded IsValidList so it returns false when given an empty list.
return null; | ||
} | ||
|
||
public static void LogCursorOpcodes(ILCursor cursor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between this and just logging the cursor to string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know you could just log the cursor to a string. If you can do that then I agree that this function is redundant.
cursor.Index = indexOld; | ||
} | ||
|
||
public static MethodInfo GetGenericMethod(Type type, string name, Type[] parameters) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer needed, correct?
@@ -923,5 +925,60 @@ public static class Reflection { | |||
} | |||
|
|||
#endregion | |||
|
|||
public static System.Reflection.FieldInfo GetNestedField(Type type, string fieldName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could replace these two with a generic GetNestedMember
and take in a generic type parameter that is constrained to a MemberInfo like here:
R2API/R2API/Utils/Reflection.cs
Line 196 in 1d9c3bd
private static T GetMemberFull<T>(this Type type, string name) where T : MemberInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be good. Would you like to persue that change or should I? I'm not familiar with creating generic type functions.
Added ability to have items of any tier in any drop list
Added ability to add items of any tier to any drop list.
Added hooks and functionality so the artifact of command interfact can display a custom list.
Added hooks so interactables would not filter drop lists to limit them to specific tiers.
Altered tiers in InteractableCalculator so items in a tier of drop list could be differentiated from items of a tier in any drop list.
Added functions to Reflection for getting nested field and method infos.
Added function to Reflection log all opcodes for a cursor to help with debugging.
Added function to Reflection for getting a generic method info when multiple functions with the same name exist.
Added Unity physics module dependency for a hook that required the Collision type.
Fixed bug in MonsterItemsAPI that occured when the ItemDropAPI drop lists differed from the MonsterItemsAPI drop lists.