1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 02:33:02 +08:00

Split SetDefaultGamemode into two functions

This commit is contained in:
EVAST9919 2019-06-04 18:37:31 +03:00
parent d0d846469a
commit 0c48aec265
3 changed files with 37 additions and 29 deletions

View File

@ -59,9 +59,16 @@ namespace osu.Game.Overlays.Profile.Header.Components
{
foreach (GamemodeTabItem i in TabContainer)
{
if (i.Value.ShortName == gamemode)
i.IsDefault = i.Value.ShortName == gamemode;
}
}
public void SelectDefaultGamemode()
{
foreach (GamemodeTabItem i in TabContainer)
{
if (i.IsDefault)
{
i.IsDefault = true;
Current.Value = i.Value;
return;
}

View File

@ -48,7 +48,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
isDefault = value;
icon.FadeTo(isDefault ? 1 : 0, 100, Easing.OutQuint);
icon.FadeTo(isDefault ? 1 : 0, 200, Easing.OutQuint);
}
}
@ -59,34 +59,34 @@ namespace osu.Game.Overlays.Profile.Header.Components
Children = new Drawable[]
{
new FillFlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(3, 0),
Children = new Drawable[]
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(3, 0),
Children = new Drawable[]
text = new OsuSpriteText
{
text = new OsuSpriteText
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Text = value.Name,
Font = OsuFont.GetFont()
},
icon = new SpriteIcon
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Alpha = 0,
AlwaysPresent = true,
Icon = FontAwesome.Solid.Star,
Size = new Vector2(12),
},
}
},
new HoverClickSounds()
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Text = value.Name,
Font = OsuFont.GetFont()
},
icon = new SpriteIcon
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Alpha = 0,
AlwaysPresent = true,
Icon = FontAwesome.Solid.Star,
Size = new Vector2(12),
},
}
},
new HoverClickSounds()
};
}

View File

@ -113,6 +113,7 @@ namespace osu.Game.Overlays.Profile
string playMode = user.PlayMode;
gamemodeControl.SetDefaultGamemode(playMode);
gamemodeControl.SelectDefaultGamemode();
gamemodeControl.FadeInFromZero(100, Easing.OutQuint);
}