diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableSound.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableSound.cs index 3f78dbfd96..6c8dc6a220 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableSound.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableSound.cs @@ -23,7 +23,7 @@ namespace osu.Game.Tests.Visual.Gameplay private TestSkinSourceContainer skinSource = null!; private PausableSkinnableSound skinnableSound = null!; - private const string sample_lookup = "Gameplay/normal-sliderslide"; + private const string sample_lookup = "Gameplay/Argon/normal-sliderslide"; [SetUpSteps] public void SetUpSteps() diff --git a/osu.Game/Overlays/Wiki/WikiPanelContainer.cs b/osu.Game/Overlays/Wiki/WikiPanelContainer.cs index cbffe5732e..555dab852e 100644 --- a/osu.Game/Overlays/Wiki/WikiPanelContainer.cs +++ b/osu.Game/Overlays/Wiki/WikiPanelContainer.cs @@ -3,7 +3,6 @@ #nullable disable -using System; using Markdig.Syntax; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; @@ -22,29 +21,61 @@ using osuTK.Graphics; namespace osu.Game.Overlays.Wiki { - public partial class WikiPanelContainer : Container + public partial class WikiPanelContainer : CompositeDrawable { - private WikiPanelMarkdownContainer panelContainer; + private const float padding = 3; private readonly string text; - private readonly bool isFullWidth; public WikiPanelContainer(string text, bool isFullWidth = false) { this.text = text; this.isFullWidth = isFullWidth; - - RelativeSizeAxes = Axes.X; - Padding = new MarginPadding(3); } + private PanelBackground background; + [BackgroundDependencyLoader] - private void load(OverlayColourProvider colourProvider, IAPIProvider api) + private void load(IAPIProvider api) { - Children = new Drawable[] + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + InternalChildren = new Drawable[] { + background = new PanelBackground + { + BypassAutoSizeAxes = Axes.Both + }, new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Padding = new MarginPadding(padding), + Child = new WikiPanelMarkdownContainer(isFullWidth) + { + CurrentPath = $@"{api.WebsiteRootUrl}/wiki/", + Text = text, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y + } + } + }; + } + + protected override void Update() + { + base.Update(); + background.Size = Parent!.DrawSize * new Vector2(Size.X, 1); + } + + private partial class PanelBackground : CompositeDrawable + { + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + Padding = new MarginPadding(padding); + InternalChild = new Container { RelativeSizeAxes = Axes.Both, Masking = true, @@ -60,22 +91,9 @@ namespace osu.Game.Overlays.Wiki { Colour = colourProvider.Background4, RelativeSizeAxes = Axes.Both, - }, - }, - panelContainer = new WikiPanelMarkdownContainer(isFullWidth) - { - CurrentPath = $@"{api.WebsiteRootUrl}/wiki/", - Text = text, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - } - }; - } - - protected override void Update() - { - base.Update(); - Height = Math.Max(panelContainer.Height, Parent!.DrawHeight); + } + }; + } } private partial class WikiPanelMarkdownContainer : WikiMarkdownContainer diff --git a/osu.Game/Screens/Edit/Timing/ControlPointList.cs b/osu.Game/Screens/Edit/Timing/ControlPointList.cs index 7cd1dbc630..4e4090ccd0 100644 --- a/osu.Game/Screens/Edit/Timing/ControlPointList.cs +++ b/osu.Game/Screens/Edit/Timing/ControlPointList.cs @@ -162,26 +162,43 @@ namespace osu.Game.Screens.Edit.Timing // If the selected group only has one control point, update the tracking type. case 1: - trackedType = selectedGroup.Value?.ControlPoints.Single().GetType(); + trackedType = selectedGroup.Value?.ControlPoints[0].GetType(); break; // If the selected group has more than one control point, choose the first as the tracking type // if we don't already have a singular tracked type. default: - trackedType ??= selectedGroup.Value?.ControlPoints.FirstOrDefault()?.GetType(); + trackedType ??= selectedGroup.Value?.ControlPoints[0].GetType(); break; } } if (trackedType != null) { + double accurateTime = clock.CurrentTimeAccurate; + // We don't have an efficient way of looking up groups currently, only individual point types. // To improve the efficiency of this in the future, we should reconsider the overall structure of ControlPointInfo. // Find the next group which has the same type as the selected one. - var found = Beatmap.ControlPointInfo.Groups - .Where(g => g.ControlPoints.Any(cp => cp.GetType() == trackedType)) - .LastOrDefault(g => g.Time <= clock.CurrentTimeAccurate); + ControlPointGroup? found = null; + + for (int i = 0; i < Beatmap.ControlPointInfo.Groups.Count; i++) + { + var g = Beatmap.ControlPointInfo.Groups[i]; + + if (g.Time > accurateTime) + continue; + + for (int j = 0; j < g.ControlPoints.Count; j++) + { + if (g.ControlPoints[j].GetType() == trackedType) + { + found = g; + break; + } + } + } if (found != null) selectedGroup.Value = found; diff --git a/osu.Game/Users/Drawables/DrawableFlag.cs b/osu.Game/Users/Drawables/DrawableFlag.cs index 289f68ee7f..6813b13cef 100644 --- a/osu.Game/Users/Drawables/DrawableFlag.cs +++ b/osu.Game/Users/Drawables/DrawableFlag.cs @@ -15,11 +15,12 @@ namespace osu.Game.Users.Drawables { private readonly CountryCode countryCode; - public LocalisableString TooltipText => countryCode == CountryCode.Unknown ? string.Empty : countryCode.GetDescription(); + public LocalisableString TooltipText { get; } public DrawableFlag(CountryCode countryCode) { this.countryCode = countryCode; + TooltipText = countryCode == CountryCode.Unknown ? string.Empty : countryCode.GetDescription(); } [BackgroundDependencyLoader] diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b143a3a6b1..55bd68dea0 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -37,7 +37,7 @@ - +