mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
More formatting changes
This commit is contained in:
parent
83db25ab3f
commit
2abaa9705c
@ -83,17 +83,17 @@ namespace XNodeEditor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void AddCustomContextMenuItems(GenericMenu contextMenu, object obj) {
|
public static void AddCustomContextMenuItems(GenericMenu contextMenu, object obj) {
|
||||||
KeyValuePair<ContextMenu, System.Reflection.MethodInfo>[] items = GetContextMenuMethods(obj);
|
KeyValuePair<ContextMenu, MethodInfo>[] items = GetContextMenuMethods(obj);
|
||||||
if (items.Length != 0) {
|
if (items.Length != 0) {
|
||||||
contextMenu.AddSeparator("");
|
contextMenu.AddSeparator("");
|
||||||
List<string> invalidatedEntries = new List<string>();
|
List<string> invalidatedEntries = new List<string>();
|
||||||
foreach (var checkValidate in items) {
|
foreach (KeyValuePair<ContextMenu, MethodInfo> checkValidate in items) {
|
||||||
if (checkValidate.Key.validate && !(bool) checkValidate.Value.Invoke(obj, null)) {
|
if (checkValidate.Key.validate && !(bool) checkValidate.Value.Invoke(obj, null)) {
|
||||||
invalidatedEntries.Add(checkValidate.Key.menuItem);
|
invalidatedEntries.Add(checkValidate.Key.menuItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0; i < items.Length; i++) {
|
for (int i = 0; i < items.Length; i++) {
|
||||||
KeyValuePair<ContextMenu, System.Reflection.MethodInfo> kvp = items[i];
|
KeyValuePair<ContextMenu, MethodInfo> kvp = items[i];
|
||||||
if (invalidatedEntries.Contains(kvp.Key.menuItem)) {
|
if (invalidatedEntries.Contains(kvp.Key.menuItem)) {
|
||||||
contextMenu.AddDisabledItem(new GUIContent(kvp.Key.menuItem));
|
contextMenu.AddDisabledItem(new GUIContent(kvp.Key.menuItem));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user