Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Commit

Permalink
Add summaries to DrawEnumGrid and DrawPartialEnumGrid
Browse files Browse the repository at this point in the history
  • Loading branch information
jmickle66666666 committed Jan 13, 2019
1 parent 035026b commit b0732d0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Scripts/UI/SabreGUILayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ public static GUIStyle FormatStyle(Color textColor, int fontSize, FontStyle font
}
}

/// <summary>
/// Displays a list of enum buttons.
/// </summary>
/// <param name="value">The active value enum.</param>
/// <returns>The enum selected when the user clicks one of the buttons.</returns>
public static T DrawEnumGrid<T>(T value, params GUILayoutOption[] options) where T : struct, IConvertible
{
if (!typeof(T).IsEnum)
Expand Down Expand Up @@ -347,6 +352,12 @@ public static T DrawEnumGrid<T>(T value, params GUILayoutOption[] options) where
return value;
}

/// <summary>
/// Displays a list of enum buttons, using only the provided enums.
/// </summary>
/// <param name="value">The active value enum.</param>
/// <param name="enabled">The visible enum values.</param>
/// <returns>The enum selected when the user clicks one of the buttons.</returns>
public static T DrawPartialEnumGrid<T>(T value, T[] enabled, params GUILayoutOption[] options) where T : struct, IConvertible
{
if (!typeof(T).IsEnum)
Expand Down

0 comments on commit b0732d0

Please sign in to comment.