mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:07:25 +08:00
Rename variable and add xmldoc
This commit is contained in:
parent
9c36cb4af4
commit
c0f0fbbaa9
@ -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 StripWidth() => TabContainer.Children.Sum(c => c.IsPresent ? c.DrawWidth + TabContainer.Spacing.X : 0) - TabContainer.Spacing.X;
|
||||||
protected virtual float StripHeight() => 1;
|
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;
|
private static bool isEnumType => typeof(T).IsEnum;
|
||||||
|
|
||||||
@ -47,7 +50,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Colour = Color4.White.Opacity(0),
|
Colour = Color4.White.Opacity(0),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isEnumType && AddAllItemsIfEnum)
|
if (isEnumType && AddEnumEntriesAutomatically)
|
||||||
foreach (var val in (T[])Enum.GetValues(typeof(T)))
|
foreach (var val in (T[])Enum.GetValues(typeof(T)))
|
||||||
AddItem(val);
|
AddItem(val);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
{
|
{
|
||||||
public class LeaderboardScopeSelector : PageTabControl<BeatmapLeaderboardScope>
|
public class LeaderboardScopeSelector : PageTabControl<BeatmapLeaderboardScope>
|
||||||
{
|
{
|
||||||
protected override bool AddAllItemsIfEnum => false;
|
protected override bool AddEnumEntriesAutomatically => false;
|
||||||
|
|
||||||
protected override Dropdown<BeatmapLeaderboardScope> CreateDropdown() => null;
|
protected override Dropdown<BeatmapLeaderboardScope> CreateDropdown() => null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user