1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-20 16:52:56 +08:00
osu-lazer/osu.Game/Overlays/Changelog/Header/TextBadgePairRelease.cs

44 lines
1.4 KiB
C#
Raw Normal View History

2018-07-17 05:50:22 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Colour;
namespace osu.Game.Overlays.Changelog.Header
{
public class TextBadgePairRelease : TextBadgePair
{
private TextBadgePairListing listingBadge;
2018-07-17 21:01:53 +08:00
private const float transition_duration = 125;
2018-07-17 05:50:22 +08:00
public TextBadgePairRelease(ColourInfo badgeColour, string displayText) : base(badgeColour, displayText)
{
this.listingBadge = listingBadge;
text.Font = "Exo2.0-Bold";
text.Y = 20;
text.Alpha = 0;
}
public void SetText(string displayText)
{
text.Text = displayText;
}
public void Activate(string displayText = null)
{
2018-07-18 00:32:11 +08:00
//ClearTransforms();
// not using if (!lineBadge.IsCollapsed) because the text sometimes gets reset
// when quickly switching release streams
if (text.IsPresent) ChangeText(transition_duration, displayText);
2018-07-17 21:01:53 +08:00
else ShowText(transition_duration, displayText);
2018-07-17 05:50:22 +08:00
OnActivation?.Invoke();
}
public override void Deactivate()
{
2018-07-18 00:32:11 +08:00
//FinishTransforms(true);
2018-07-17 21:01:53 +08:00
HideText(transition_duration);
2018-07-17 05:50:22 +08:00
OnDeactivation?.Invoke();
}
}
}