mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:07:25 +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)
|
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;
|
Current.Value = i.Value;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
|
|
||||||
isDefault = value;
|
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[]
|
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,
|
text = new OsuSpriteText
|
||||||
Origin = Anchor.BottomLeft,
|
|
||||||
Anchor = Anchor.BottomLeft,
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
Spacing = new Vector2(3, 0),
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
text = new OsuSpriteText
|
Origin = Anchor.Centre,
|
||||||
{
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Text = value.Name,
|
||||||
Anchor = Anchor.Centre,
|
Font = OsuFont.GetFont()
|
||||||
Text = value.Name,
|
},
|
||||||
Font = OsuFont.GetFont()
|
icon = new SpriteIcon
|
||||||
},
|
{
|
||||||
icon = new SpriteIcon
|
Origin = Anchor.Centre,
|
||||||
{
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Alpha = 0,
|
||||||
Anchor = Anchor.Centre,
|
AlwaysPresent = true,
|
||||||
Alpha = 0,
|
Icon = FontAwesome.Solid.Star,
|
||||||
AlwaysPresent = true,
|
Size = new Vector2(12),
|
||||||
Icon = FontAwesome.Solid.Star,
|
},
|
||||||
Size = new Vector2(12),
|
}
|
||||||
},
|
},
|
||||||
}
|
new HoverClickSounds()
|
||||||
},
|
|
||||||
new HoverClickSounds()
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +113,7 @@ namespace osu.Game.Overlays.Profile
|
|||||||
string playMode = user.PlayMode;
|
string playMode = user.PlayMode;
|
||||||
|
|
||||||
gamemodeControl.SetDefaultGamemode(playMode);
|
gamemodeControl.SetDefaultGamemode(playMode);
|
||||||
|
gamemodeControl.SelectDefaultGamemode();
|
||||||
gamemodeControl.FadeInFromZero(100, Easing.OutQuint);
|
gamemodeControl.FadeInFromZero(100, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user