Skip to content

Commit

Permalink
Remove virtual ColourInfo properties from DaySeparator
Browse files Browse the repository at this point in the history
  • Loading branch information
jai-x committed May 7, 2022
1 parent 6fc808b commit bec28c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
3 changes: 1 addition & 2 deletions osu.Game/Online/Chat/StandAloneChatDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,8 @@ private void load(OsuColour colours)
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 },
};
Expand Down
18 changes: 1 addition & 17 deletions osu.Game/Overlays/Chat/DrawableChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
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;
Expand Down Expand Up @@ -124,8 +123,7 @@ protected override void Dispose(bool isDisposing)

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 },
};

Expand Down Expand Up @@ -214,12 +212,6 @@ public float TextSize
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
Expand All @@ -228,14 +220,6 @@ public float LineHeight
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;
Expand Down
10 changes: 2 additions & 8 deletions osu.Game/Overlays/ChatOverlayV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,26 +315,20 @@ private void handleChatMessage(string message)

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 },
};
Expand Down

0 comments on commit bec28c5

Please sign in to comment.