1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 10:22:56 +08:00

Remove virtual ColourInfo properties from DaySeparator

This commit is contained in:
Jai Sharma 2022-05-07 22:16:11 +01:00
parent 6fc808be22
commit bec28c5b28
3 changed files with 4 additions and 27 deletions

View File

@ -174,9 +174,8 @@ namespace osu.Game.Online.Chat
protected override DaySeparator CreateDaySeparator(DateTimeOffset time) => new DaySeparator(time)
{
TextSize = 14,
TextColour = daySepColour,
Colour = daySepColour,
LineHeight = 1,
LineColour = daySepColour,
Padding = new MarginPadding { Horizontal = 10 },
Margin = new MarginPadding { Vertical = 5 },
};

View File

@ -9,7 +9,6 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
@ -124,8 +123,7 @@ namespace osu.Game.Overlays.Chat
protected virtual DaySeparator CreateDaySeparator(DateTimeOffset time) => new DaySeparator(time)
{
TextColour = colours.ChatBlue.Lighten(0.7f),
LineColour = colours.ChatBlue.Lighten(0.7f),
Colour = colours.ChatBlue.Lighten(0.7f),
Margin = new MarginPadding { Vertical = 10 },
};
@ -214,12 +212,6 @@ namespace osu.Game.Overlays.Chat
set => text.Font = text.Font.With(size: value);
}
public ColourInfo TextColour
{
get => text.Colour;
set => text.Colour = value;
}
private float lineHeight = 2;
public float LineHeight
@ -228,14 +220,6 @@ namespace osu.Game.Overlays.Chat
set => lineHeight = leftBox.Height = rightBox.Height = value;
}
private ColourInfo lineColour;
public ColourInfo LineColour
{
get => lineColour;
set => lineColour = leftBox.Colour = rightBox.Colour = value;
}
private readonly SpriteText text;
private readonly Box leftBox;
private readonly Box rightBox;

View File

@ -315,26 +315,20 @@ namespace osu.Game.Overlays
public class ChatOverlayDrawableChannel : DrawableChannel
{
private Colour4 daySepTextColour;
private Colour4 daySepLineColour;
public ChatOverlayDrawableChannel(Channel channel)
: base(channel)
{
}
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
private void load()
{
ChatLineFlow.Padding = new MarginPadding(0);
daySepTextColour = colourProvider.Content1;
daySepLineColour = colourProvider.Background5;
}
protected override DaySeparator CreateDaySeparator(DateTimeOffset time) => new DaySeparator(time)
{
TextColour = daySepTextColour,
LineColour = daySepLineColour,
Colour = Colour4.White,
Margin = new MarginPadding { Vertical = 10 },
Padding = new MarginPadding { Horizontal = 15 },
};