mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 16:02:58 +08:00
Make icons container private
This commit is contained in:
parent
88cc552534
commit
0f11ecce01
@ -41,7 +41,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected readonly FillFlowContainer<ModIcon> IconsContainer;
|
private readonly FillFlowContainer<ModIcon> iconsContainer;
|
||||||
private readonly OsuSpriteText unrankedText;
|
private readonly OsuSpriteText unrankedText;
|
||||||
|
|
||||||
public ModDisplay()
|
public ModDisplay()
|
||||||
@ -50,7 +50,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
IconsContainer = new ReverseChildIDFillFlowContainer<ModIcon>
|
iconsContainer = new ReverseChildIDFillFlowContainer<ModIcon>
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
@ -68,11 +68,11 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
Current.ValueChanged += mods =>
|
Current.ValueChanged += mods =>
|
||||||
{
|
{
|
||||||
IconsContainer.Clear();
|
iconsContainer.Clear();
|
||||||
|
|
||||||
foreach (Mod mod in mods.NewValue)
|
foreach (Mod mod in mods.NewValue)
|
||||||
{
|
{
|
||||||
IconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) });
|
iconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsLoaded)
|
if (IsLoaded)
|
||||||
@ -91,7 +91,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
appearTransform();
|
appearTransform();
|
||||||
IconsContainer.FadeInFromZero(fade_duration, Easing.OutQuint);
|
iconsContainer.FadeInFromZero(fade_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void appearTransform()
|
private void appearTransform()
|
||||||
@ -103,20 +103,20 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
expand();
|
expand();
|
||||||
|
|
||||||
using (IconsContainer.BeginDelayedSequence(1200))
|
using (iconsContainer.BeginDelayedSequence(1200))
|
||||||
contract();
|
contract();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void expand()
|
private void expand()
|
||||||
{
|
{
|
||||||
if (ExpansionMode != ExpansionMode.AlwaysContracted)
|
if (ExpansionMode != ExpansionMode.AlwaysContracted)
|
||||||
IconsContainer.TransformSpacingTo(new Vector2(5, 0), 500, Easing.OutQuint);
|
iconsContainer.TransformSpacingTo(new Vector2(5, 0), 500, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void contract()
|
private void contract()
|
||||||
{
|
{
|
||||||
if (ExpansionMode != ExpansionMode.AlwaysExpanded)
|
if (ExpansionMode != ExpansionMode.AlwaysExpanded)
|
||||||
IconsContainer.TransformSpacingTo(new Vector2(-25, 0), 500, Easing.OutQuint);
|
iconsContainer.TransformSpacingTo(new Vector2(-25, 0), 500, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
Loading…
Reference in New Issue
Block a user