mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Split SetDefaultGamemode into two functions
This commit is contained in:
parent
d0d846469a
commit
0c48aec265
@ -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;
|
||||
}
|
||||
|
@ -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()
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -113,6 +113,7 @@ namespace osu.Game.Overlays.Profile
|
||||
string playMode = user.PlayMode;
|
||||
|
||||
gamemodeControl.SetDefaultGamemode(playMode);
|
||||
gamemodeControl.SelectDefaultGamemode();
|
||||
gamemodeControl.FadeInFromZero(100, Easing.OutQuint);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user