2019-01-24 08:43:03 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using osu.Framework.Graphics;
|
2018-06-28 04:04:39 +00:00
|
|
|
|
using osu.Game.Graphics.Containers;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-01-04 17:26:31 +00:00
|
|
|
|
namespace osu.Game.Online.Placeholders
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-06-28 04:04:39 +00:00
|
|
|
|
public abstract class Placeholder : OsuTextFlowContainer, IEquatable<Placeholder>
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-06-28 04:04:39 +00:00
|
|
|
|
protected const float TEXT_SIZE = 22;
|
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
|
protected Placeholder()
|
2019-02-20 10:32:30 +00:00
|
|
|
|
: base(cp => cp.Font = cp.Font.With(size: TEXT_SIZE))
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Origin = Anchor.Centre;
|
2018-06-28 04:04:39 +00:00
|
|
|
|
TextAnchor = Anchor.TopCentre;
|
|
|
|
|
|
|
|
|
|
Padding = new MarginPadding(20);
|
|
|
|
|
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual bool Equals(Placeholder other) => GetType() == other?.GetType();
|
|
|
|
|
}
|
|
|
|
|
}
|