mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 23:12:56 +08:00
Only hide UpdateableAvatar/Flag immediately
This commit is contained in:
parent
7734c4b41a
commit
739077ef4f
@ -53,7 +53,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
Size = new Vector2(40),
|
Size = new Vector2(40),
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
},
|
},
|
||||||
avatar = new UpdateableAvatar(transformImmediately: true)
|
avatar = new UpdateableAvatar(hideImmediately: true)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
@ -90,7 +90,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold)
|
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold)
|
||||||
},
|
},
|
||||||
flag = new UpdateableFlag(transformImmediately: true)
|
flag = new UpdateableFlag(hideImmediately: true)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
|
@ -5,6 +5,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
|
using osu.Framework.Graphics.Transforms;
|
||||||
|
|
||||||
namespace osu.Game.Users.Drawables
|
namespace osu.Game.Users.Drawables
|
||||||
{
|
{
|
||||||
@ -51,17 +52,14 @@ namespace osu.Game.Users.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly BindableBool OpenOnClick = new BindableBool(true);
|
public readonly BindableBool OpenOnClick = new BindableBool(true);
|
||||||
|
|
||||||
public UpdateableAvatar(User user = null, bool transformImmediately = false)
|
public UpdateableAvatar(User user = null, bool hideImmediately = false)
|
||||||
{
|
{
|
||||||
|
TransformImmediately = hideImmediately;
|
||||||
User = user;
|
User = user;
|
||||||
|
|
||||||
if (transformImmediately)
|
|
||||||
{
|
|
||||||
TransformDuration = 0;
|
|
||||||
TransformImmediately = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override TransformSequence<Drawable> ApplyHideTransforms(Drawable drawable) => TransformImmediately ? drawable?.FadeOut() : base.ApplyHideTransforms(drawable);
|
||||||
|
|
||||||
protected override Drawable CreateDrawable(User user)
|
protected override Drawable CreateDrawable(User user)
|
||||||
{
|
{
|
||||||
if (user == null && !ShowGuestOnNull)
|
if (user == null && !ShowGuestOnNull)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Transforms;
|
||||||
|
|
||||||
namespace osu.Game.Users.Drawables
|
namespace osu.Game.Users.Drawables
|
||||||
{
|
{
|
||||||
@ -23,17 +24,14 @@ namespace osu.Game.Users.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShowPlaceholderOnNull = true;
|
public bool ShowPlaceholderOnNull = true;
|
||||||
|
|
||||||
public UpdateableFlag(Country country = null, bool transformImmediately = false)
|
public UpdateableFlag(Country country = null, bool hideImmediately = false)
|
||||||
{
|
{
|
||||||
|
TransformImmediately = hideImmediately;
|
||||||
Country = country;
|
Country = country;
|
||||||
|
|
||||||
if (transformImmediately)
|
|
||||||
{
|
|
||||||
TransformDuration = 0;
|
|
||||||
TransformImmediately = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override TransformSequence<Drawable> ApplyHideTransforms(Drawable drawable) => TransformImmediately ? drawable?.FadeOut() : base.ApplyHideTransforms(drawable);
|
||||||
|
|
||||||
protected override Drawable CreateDrawable(Country country)
|
protected override Drawable CreateDrawable(Country country)
|
||||||
{
|
{
|
||||||
if (country == null && !ShowPlaceholderOnNull)
|
if (country == null && !ShowPlaceholderOnNull)
|
||||||
|
Loading…
Reference in New Issue
Block a user