1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 04:02:59 +08:00

Merge pull request #978 from EVAST9919/mods_overlay_fix

Hide "Unranked" text in ModDisplay if play is ranked
This commit is contained in:
Dean Herbert 2017-07-14 17:36:46 +09:00 committed by GitHub
commit 36594afee3

View File

@ -12,16 +12,20 @@ using osu.Game.Rulesets.UI;
using OpenTK;
using osu.Framework.Input;
using osu.Game.Graphics.Containers;
using System.Linq;
namespace osu.Game.Screens.Play.HUD
{
public class ModDisplay : Container, IHasCurrentValue<IEnumerable<Mod>>
{
private const int fade_duration = 1000;
private readonly Bindable<IEnumerable<Mod>> mods = new Bindable<IEnumerable<Mod>>();
public Bindable<IEnumerable<Mod>> Current => mods;
private readonly FillFlowContainer<ModIcon> iconsContainer;
private readonly OsuSpriteText unrankedText;
public ModDisplay()
{
@ -35,8 +39,9 @@ namespace osu.Game.Screens.Play.HUD
Direction = FillDirection.Horizontal,
Margin = new MarginPadding { Left = 10, Right = 10 },
},
new OsuSpriteText
unrankedText = new OsuSpriteText
{
AlwaysPresent = true,
Anchor = Anchor.BottomCentre,
Origin = Anchor.TopCentre,
Text = @"/ UNRANKED /",
@ -70,8 +75,13 @@ namespace osu.Game.Screens.Play.HUD
private void appearTransform()
{
if (mods.Value.Any(m => !m.Ranked))
unrankedText.FadeInFromZero(fade_duration, EasingTypes.OutQuint);
else
unrankedText.Hide();
iconsContainer.Flush();
iconsContainer.FadeInFromZero(1000, EasingTypes.OutQuint);
iconsContainer.FadeInFromZero(fade_duration, EasingTypes.OutQuint);
expand();
using (iconsContainer.BeginDelayedSequence(1200))
contract();