Skip to content

Commit

Permalink
Better prefab override hadling for "Popup Visibility" log filter
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirkula committed Aug 18, 2024
1 parent ee25278 commit ae54397
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Plugins/IngameDebugConsole/Editor/DebugLogManagerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,21 @@ public override void OnInspectorGUI()
{
EditorGUI.indentLevel++;
#if UNITY_2017_3_OR_NEWER
popupVisibilityLogFilter.intValue = (int) (DebugLogFilter) EditorGUILayout.EnumFlagsField( popupVisibilityLogFilterLabel, (DebugLogFilter) popupVisibilityLogFilter.intValue );
Rect rect = EditorGUILayout.GetControlRect();
EditorGUI.BeginProperty( rect, GUIContent.none, popupVisibilityLogFilter );
popupVisibilityLogFilter.intValue = (int) (DebugLogFilter) EditorGUI.EnumFlagsField( rect, popupVisibilityLogFilterLabel, (DebugLogFilter) popupVisibilityLogFilter.intValue );
#else
EditorGUI.BeginProperty( new Rect(), GUIContent.none, popupVisibilityLogFilter );
EditorGUI.BeginChangeCheck();

bool infoLog = EditorGUILayout.Toggle( "Info", ( (DebugLogFilter) popupVisibilityLogFilter.intValue & DebugLogFilter.Info ) == DebugLogFilter.Info );
bool warningLog = EditorGUILayout.Toggle( "Warning", ( (DebugLogFilter) popupVisibilityLogFilter.intValue & DebugLogFilter.Warning ) == DebugLogFilter.Warning );
bool errorLog = EditorGUILayout.Toggle( "Error", ( (DebugLogFilter) popupVisibilityLogFilter.intValue & DebugLogFilter.Error ) == DebugLogFilter.Error );

if( EditorGUI.EndChangeCheck() )
popupVisibilityLogFilter.intValue = ( infoLog ? (int) DebugLogFilter.Info : 0 ) | ( warningLog ? (int) DebugLogFilter.Warning : 0 ) | ( errorLog ? (int) DebugLogFilter.Error : 0 );
#endif
EditorGUI.EndProperty();
EditorGUI.indentLevel--;
}

Expand Down

0 comments on commit ae54397

Please sign in to comment.