Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions osu.Game.Tests/Visual/Online/TestSceneChatLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Chat;
using osu.Game.Overlays;
using osu.Game.Overlays.Chat;
using osuTK.Graphics;

Expand All @@ -35,9 +35,9 @@ public TestSceneChatLink()
}

[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load()
{
linkColour = colours.Blue;
linkColour = new OverlayColourProvider(ColourScheme).Light2;

var chatManager = new ChannelManager(API);
BindableList<Channel> availableChannels = (BindableList<Channel>)chatManager.AvailableChannels;
Expand Down
5 changes: 0 additions & 5 deletions osu.Game.Tests/Visual/Online/TestSceneDrawableComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ namespace osu.Game.Tests.Visual.Online
{
public partial class TestSceneDrawableComment : ThemeComparisonTestScene
{
public TestSceneDrawableComment()
: base(false)
{
}

protected override Drawable CreateContent() => new OsuScrollContainer(Direction.Vertical)
{
RelativeSizeAxes = Axes.Both,
Expand Down
5 changes: 0 additions & 5 deletions osu.Game.Tests/Visual/Online/TestSceneGlobalRankDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ namespace osu.Game.Tests.Visual.Online
{
public partial class TestSceneGlobalRankDisplay : ThemeComparisonTestScene
{
public TestSceneGlobalRankDisplay()
: base(false)
{
}

protected override Drawable CreateContent() => new FillFlowContainer
{
RelativeSizeAxes = Axes.Both,
Expand Down
5 changes: 0 additions & 5 deletions osu.Game.Tests/Visual/Settings/TestSceneDirectorySelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ namespace osu.Game.Tests.Visual.Settings
{
public partial class TestSceneDirectorySelector : ThemeComparisonTestScene
{
public TestSceneDirectorySelector()
: base(false)
{
}

protected override Drawable CreateContent() => new OsuDirectorySelector
{
RelativeSizeAxes = Axes.Both
Expand Down
5 changes: 0 additions & 5 deletions osu.Game.Tests/Visual/Settings/TestSceneFileSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ namespace osu.Game.Tests.Visual.Settings
{
public partial class TestSceneFileSelector : ThemeComparisonTestScene
{
public TestSceneFileSelector()
: base(false)
{
}

[Test]
public void TestJpgFilesOnly()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ public partial class TestSceneBeatmapTitleWedgeStatistic : ThemeComparisonTestSc
private BeatmapTitleWedge.Statistic statistic3 = null!;
private BeatmapTitleWedge.Statistic statistic4 = null!;

public TestSceneBeatmapTitleWedgeStatistic()
: base(false)
{
}

[Test]
public void TestLoading()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ public partial class TestSceneDifficultyRangeSlider : ThemeComparisonTestScene
Precision = 0.1f
};

public TestSceneDifficultyRangeSlider()
: base(false)
{
}

protected override void LoadComplete()
{
base.LoadComplete();
Expand Down
5 changes: 0 additions & 5 deletions osu.Game.Tests/Visual/SongSelectV2/TestScenePanelBeatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public partial class TestScenePanelBeatmap : ThemeComparisonTestScene

private BeatmapInfo beatmap = null!;

public TestScenePanelBeatmap()
: base(false)
{
}

[SetUp]
public void SetUp() => Schedule(() =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public partial class TestScenePanelBeatmapStandalone : ThemeComparisonTestScene

private BeatmapInfo beatmap = null!;

public TestScenePanelBeatmapStandalone()
: base(false)
{
}

[SetUp]
public void SetUp() => Schedule(() =>
{
Expand Down
5 changes: 0 additions & 5 deletions osu.Game.Tests/Visual/SongSelectV2/TestScenePanelGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ namespace osu.Game.Tests.Visual.SongSelectV2
{
public partial class TestScenePanelGroup : ThemeComparisonTestScene
{
public TestScenePanelGroup()
: base(false)
{
}

[Test]
public void TestGeneral()
{
Expand Down
5 changes: 0 additions & 5 deletions osu.Game.Tests/Visual/SongSelectV2/TestScenePanelSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ public partial class TestScenePanelSet : ThemeComparisonTestScene

private BeatmapSetInfo beatmapSet = null!;

public TestScenePanelSet()
: base(false)
{
}

[SetUp]
public void SetUp() => Schedule(() =>
{
Expand Down
5 changes: 0 additions & 5 deletions osu.Game.Tests/Visual/UserInterface/TestSceneFormControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ namespace osu.Game.Tests.Visual.UserInterface
{
public partial class TestSceneFormControls : ThemeComparisonTestScene
{
public TestSceneFormControls()
: base(false)
{
}

protected override Drawable CreateContent() => new OsuContextMenuContainer
{
RelativeSizeAxes = Axes.Both,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ namespace osu.Game.Tests.Visual.UserInterface
{
public partial class TestSceneShearedDropdown : ThemeComparisonTestScene
{
public TestSceneShearedDropdown()
: base(false)
{
}

protected override Drawable CreateContent() => new Container
{
RelativeSizeAxes = Axes.Both,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ public partial class TestSceneShearedRangeSlider : ThemeComparisonTestScene

private ShearedRangeSlider shearedRangeSlider = null!;

public TestSceneShearedRangeSlider()
: base(false)
{
}

protected override void LoadComplete()
{
base.LoadComplete();
Expand Down
33 changes: 1 addition & 32 deletions osu.Game.Tests/Visual/UserInterface/ThemeComparisonTestScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,23 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Overlays;
using osuTK;

namespace osu.Game.Tests.Visual.UserInterface
{
public abstract partial class ThemeComparisonTestScene : OsuManualInputManagerTestScene
{
private readonly bool showWithoutColourProvider;

public Container ContentContainer { get; private set; } = null!;

protected ThemeComparisonTestScene(bool showWithoutColourProvider = true)
{
this.showWithoutColourProvider = showWithoutColourProvider;
}

[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load()
{
Child = ContentContainer = new Container
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
RelativeSizeAxes = Axes.Both,
};

if (showWithoutColourProvider)
{
ContentContainer.Size = new Vector2(0.5f, 1f);

Add(new Container
{
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft,
RelativeSizeAxes = Axes.Both,
Size = new Vector2(0.5f, 1f),
Children = new[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colours.GreySeaFoam
},
CreateContent()
}
});
}
}

protected void CreateThemedContent(OverlayColourScheme colourScheme)
Expand Down
14 changes: 3 additions & 11 deletions osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ public MarginPadding TextPadding
private const double animation_duration = 400;

[Resolved]
private OsuColour colours { get; set; } = null!;

[Resolved(CanBeNull = true)]
private OverlayColourProvider? colourProvider { get; set; }
private OverlayColourProvider colourProvider { get; set; } = null!;

public BeatmapSetOnlineStatusPill()
{
Expand Down Expand Up @@ -127,15 +124,10 @@ private void updateState()
if (Alpha == 0)
duration = 0;

Color4 statusTextColour;

if (colourProvider != null)
statusTextColour = status == BeatmapOnlineStatus.Graveyard ? colourProvider.Background1 : colourProvider.Background3;
else
statusTextColour = status == BeatmapOnlineStatus.Graveyard ? colours.GreySeaFoamLight : Color4.Black;
Color4 statusTextColour = status == BeatmapOnlineStatus.Graveyard ? colourProvider.Background1 : colourProvider.Background3;

statusText.FadeColour(statusTextColour, duration, Easing.OutQuint);
background.FadeColour(OsuColour.ForBeatmapSetOnlineStatus(Status) ?? colourProvider?.Light1 ?? colours.GreySeaFoamLighter, duration, Easing.OutQuint);
background.FadeColour(OsuColour.ForBeatmapSetOnlineStatus(Status) ?? colourProvider.Light1, duration, Easing.OutQuint);

statusText.Text = Status.GetLocalisableDescription().ToUpper();
}
Expand Down
7 changes: 3 additions & 4 deletions osu.Game/Beatmaps/Drawables/StarRatingDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
Expand Down Expand Up @@ -55,7 +54,7 @@ public Bindable<StarDifficulty> Current
private OsuColour colours { get; set; } = null!;

[Resolved]
private OverlayColourProvider? colourProvider { get; set; }
private OverlayColourProvider colourProvider { get; set; } = null!;

/// <summary>
/// Creates a new <see cref="StarRatingDisplay"/> using an already computed <see cref="StarDifficulty"/>.
Expand Down Expand Up @@ -160,8 +159,8 @@ protected override void LoadComplete()

background.Colour = colours.ForStarDifficulty(s.NewValue);

starIcon.Colour = s.NewValue >= OsuColour.STAR_DIFFICULTY_DEFINED_COLOUR_CUTOFF ? colours.Orange1 : colourProvider?.Background5 ?? Color4Extensions.FromHex("303d47");
starsText.Colour = s.NewValue >= OsuColour.STAR_DIFFICULTY_DEFINED_COLOUR_CUTOFF ? colours.Orange1 : colourProvider?.Background5 ?? Color4.Black.Opacity(0.75f);
starIcon.Colour = s.NewValue >= OsuColour.STAR_DIFFICULTY_DEFINED_COLOUR_CUTOFF ? colours.Orange1 : colourProvider.Background5;
starsText.Colour = s.NewValue >= OsuColour.STAR_DIFFICULTY_DEFINED_COLOUR_CUTOFF ? colours.Orange1 : colourProvider.Background5;
}, true);
}
}
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Graphics/Carousel/Carousel.ScrollContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ public ScrollBar()
}

[BackgroundDependencyLoader(true)]
private void load(OverlayColourProvider? colourProvider, OsuColour colours)
private void load(OverlayColourProvider colourProvider, OsuColour colours)
{
Colour = defaultColour = colours.Gray8;
hoverColour = colours.GrayF;
highlightColour = colourProvider?.Highlight1 ?? colours.Green;
highlightColour = colourProvider.Highlight1;
}

public override void ResizeTo(float val, int duration = 0, Easing easing = Easing.None)
Expand Down
6 changes: 3 additions & 3 deletions osu.Game/Graphics/Containers/OsuScrollContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ public OsuScrollbar(Direction scrollDir)
Child = box = new Box { RelativeSizeAxes = Axes.Both };
}

[BackgroundDependencyLoader(true)]
private void load(OverlayColourProvider? colourProvider, OsuColour colours)
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider, OsuColour colours)
{
Colour = defaultColour = colours.Gray8;
hoverColour = colours.GrayF;
highlightColour = colourProvider?.Highlight1 ?? colours.Green;
highlightColour = colourProvider.Highlight1;
}

public override void ResizeTo(float val, int duration = 0, Easing easing = Easing.None)
Expand Down
9 changes: 4 additions & 5 deletions osu.Game/Graphics/UserInterface/FocusedTextBox.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Input.Events;
using osu.Framework.Platform;
Expand Down Expand Up @@ -50,11 +49,11 @@ public bool HoldFocus
[Resolved]
private GameHost? host { get; set; }

[BackgroundDependencyLoader(true)]
private void load(OverlayColourProvider? colourProvider)
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
BackgroundUnfocused = colourProvider?.Background5 ?? new Color4(10, 10, 10, 255);
BackgroundFocused = colourProvider?.Background5 ?? new Color4(10, 10, 10, 255);
BackgroundUnfocused = colourProvider.Background5;
BackgroundFocused = colourProvider.Background5;
}

// We may not be focused yet, but we need to handle keyboard input to be able to request focus
Expand Down
6 changes: 3 additions & 3 deletions osu.Game/Graphics/UserInterface/HotkeyDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public HotkeyBox(string hotkey)
}

[BackgroundDependencyLoader]
private void load(OverlayColourProvider? colourProvider, OsuColour colours)
private void load(OverlayColourProvider colourProvider, OsuColour colours)
{
AutoSizeAxes = Axes.Both;
Masking = true;
Expand All @@ -94,14 +94,14 @@ private void load(OverlayColourProvider? colourProvider, OsuColour colours)
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider?.Background6 ?? Colour4.Black.Opacity(0.7f),
Colour = colourProvider.Background6,
},
new OsuSpriteText
{
Margin = new MarginPadding { Horizontal = 5, Bottom = 1, },
Text = hotkey.ToUpperInvariant(),
Font = OsuFont.Default.With(size: 12, weight: FontWeight.Bold),
Colour = colourProvider?.Light1 ?? colours.GrayA,
Colour = colourProvider.Light1,
}
};
}
Expand Down
10 changes: 5 additions & 5 deletions osu.Game/Graphics/UserInterface/Nub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ public Nub(float expandedSize = DEFAULT_EXPANDED_SIZE)
};
}

[BackgroundDependencyLoader(true)]
private void load(OverlayColourProvider? colourProvider, OsuColour colours)
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
AccentColour = colourProvider?.Highlight1 ?? colours.Pink;
GlowingAccentColour = colourProvider?.Highlight1.Lighten(0.2f) ?? colours.PinkLighter;
GlowColour = colourProvider?.Highlight1 ?? colours.PinkLighter;
AccentColour = colourProvider.Highlight1;
GlowingAccentColour = colourProvider.Highlight1.Lighten(0.2f);
GlowColour = colourProvider.Highlight1;

main.EdgeEffect = new EdgeEffectParameters
{
Expand Down
Loading
Loading