1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Rename variable and add xmldoc

This commit is contained in:
Dean Herbert 2019-08-13 00:14:37 +09:00
parent 9c36cb4af4
commit c0f0fbbaa9
2 changed files with 6 additions and 3 deletions

View File

@ -31,7 +31,10 @@ namespace osu.Game.Graphics.UserInterface
protected virtual float StripWidth() => TabContainer.Children.Sum(c => c.IsPresent ? c.DrawWidth + TabContainer.Spacing.X : 0) - TabContainer.Spacing.X;
protected virtual float StripHeight() => 1;
protected virtual bool AddAllItemsIfEnum => true;
/// <summary>
/// Whether entries should be automatically populated if <see cref="T"/> is an <see cref="Enum"/> type.
/// </summary>
protected virtual bool AddEnumEntriesAutomatically => true;
private static bool isEnumType => typeof(T).IsEnum;
@ -47,7 +50,7 @@ namespace osu.Game.Graphics.UserInterface
Colour = Color4.White.Opacity(0),
});
if (isEnumType && AddAllItemsIfEnum)
if (isEnumType && AddEnumEntriesAutomatically)
foreach (var val in (T[])Enum.GetValues(typeof(T)))
AddItem(val);
}

View File

@ -18,7 +18,7 @@ namespace osu.Game.Overlays.BeatmapSet
{
public class LeaderboardScopeSelector : PageTabControl<BeatmapLeaderboardScope>
{
protected override bool AddAllItemsIfEnum => false;
protected override bool AddEnumEntriesAutomatically => false;
protected override Dropdown<BeatmapLeaderboardScope> CreateDropdown() => null;