diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFlashlight.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFlashlight.cs index 99345f020..495277b14 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFlashlight.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFlashlight.cs @@ -3,6 +3,7 @@ using System.Linq; using NUnit.Framework; +using osu.Framework.Testing; using osu.Game.Rulesets.Karaoke.Mods; using osu.Game.Rulesets.Karaoke.Tests.Beatmaps; using osu.Game.Rulesets.Karaoke.Tests.Extensions; @@ -24,7 +25,7 @@ public void TestFlashlightExist() => CreateModTest(new ModTestData return false; // Should has at least one flashlight - return drawableRuleset.KeyBindingInputManager.Children.OfType().Any(); + return drawableRuleset.KeyBindingInputManager.ChildrenOfType().Any(); } }); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModPractice.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModPractice.cs index 66632f3b5..9e2b6f8c7 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModPractice.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModPractice.cs @@ -21,7 +21,7 @@ public void TestAllPanelExist() => CreateModTest(new ModTestData PassCondition = () => { // just need to check has setting button display area. - var skinnableTargetContainers = Player.HUDOverlay.OfType().FirstOrDefault(); + var skinnableTargetContainers = Player.HUDOverlay.OfType().FirstOrDefault(); // todo: because setting buttons display created from skin transform , so might not able to get from here. var hud = skinnableTargetContainers?.Components.OfType().FirstOrDefault(); diff --git a/osu.Game.Rulesets.Karaoke/Mods/KaraokeModFlashlight.cs b/osu.Game.Rulesets.Karaoke/Mods/KaraokeModFlashlight.cs index 7e44213c7..1768e032f 100644 --- a/osu.Game.Rulesets.Karaoke/Mods/KaraokeModFlashlight.cs +++ b/osu.Game.Rulesets.Karaoke/Mods/KaraokeModFlashlight.cs @@ -45,11 +45,13 @@ public override void ApplyToDrawableRuleset(DrawableRuleset dr { base.ApplyToDrawableRuleset(drawableRuleset); - var notePlayfield = (drawableRuleset as DrawableKaraokeRuleset)?.Playfield?.NotePlayfield; + var drawableKaraokeRuleset = drawableRuleset as DrawableKaraokeRuleset; + + var notePlayfield = drawableKaraokeRuleset?.Playfield?.NotePlayfield; if (notePlayfield == null) return; - var flashlight = drawableRuleset.KeyBindingInputManager.Children.OfType().FirstOrDefault(); + var flashlight = drawableKaraokeRuleset?.KeyBindingInputManager.Children.OfType().FirstOrDefault(); if (flashlight == null) return; diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/Components/LabelledOpacityAdjustment.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/Components/LabelledOpacityAdjustment.cs index d89545a4c..99f65acd2 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/Components/LabelledOpacityAdjustment.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/Components/LabelledOpacityAdjustment.cs @@ -89,7 +89,7 @@ public Popover GetPopover() } }; - private partial class OpacitySliderBar : OsuSliderBar + private partial class OpacitySliderBar : RoundedSliderBar { public override LocalisableString TooltipText => (Current.Value * 100).ToString("N0") + "%"; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/NoteSettings.cs b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/NoteSettings.cs index c9f034a6f..867ccdb3d 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/NoteSettings.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/NoteSettings.cs @@ -44,7 +44,7 @@ private void load() }; } - private partial class TimeSlider : OsuSliderBar + private partial class TimeSlider : RoundedSliderBar { public override LocalisableString TooltipText => Current.Value.ToString("N0") + "ms"; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/ScoringSettings.cs b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/ScoringSettings.cs index 564a9b86d..fd3ea42b1 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/ScoringSettings.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/ScoringSettings.cs @@ -55,7 +55,7 @@ private void load() }; } - private partial class PitchSlider : OsuSliderBar + private partial class PitchSlider : RoundedSliderBar { public override LocalisableString TooltipText => (Current.Value >= 0 ? "+" : string.Empty) + Current.Value.ToString("N0"); } diff --git a/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs b/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs index a17e793de..465ccad75 100644 --- a/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs +++ b/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs @@ -9,6 +9,7 @@ using osu.Game.Rulesets.Karaoke.UI.HUD; using osu.Game.Rulesets.Scoring; using osu.Game.Skinning; +using Container = osu.Framework.Graphics.Containers.Container; namespace osu.Game.Rulesets.Karaoke.Skinning.Legacy { @@ -30,11 +31,11 @@ public KaraokeLegacySkinTransformer(ISkin source, IBeatmap beatmap) { switch (lookup) { - case GlobalSkinComponentLookup targetComponent: - switch (targetComponent.Lookup) + case SkinComponentsContainerLookup targetComponent: + switch (targetComponent.Target) { - case GlobalSkinComponentLookup.LookupType.MainHUDComponents: - var components = base.GetDrawableComponent(lookup) as SkinnableTargetComponentsContainer ?? getTargetComponentsContainerFromOtherPlace(); + case SkinComponentsContainerLookup.TargetArea.MainHUDComponents: + var components = base.GetDrawableComponent(lookup) as Container ?? getTargetComponentsContainerFromOtherPlace(); components?.Add(new SettingButtonsDisplay { Anchor = Anchor.CentreRight, @@ -67,10 +68,10 @@ public KaraokeLegacySkinTransformer(ISkin source, IBeatmap beatmap) return base.GetDrawableComponent(lookup); } - SkinnableTargetComponentsContainer? getTargetComponentsContainerFromOtherPlace() => + Container? getTargetComponentsContainerFromOtherPlace() => Skin switch { - LegacySkin legacySkin => new TempLegacySkin(legacySkin.SkinInfo.Value).GetDrawableComponent(lookup) as SkinnableTargetComponentsContainer, + LegacySkin legacySkin => new TempLegacySkin(legacySkin.SkinInfo.Value).GetDrawableComponent(lookup) as Container, _ => throw new InvalidCastException() }; } diff --git a/osu.Game.Rulesets.Karaoke/UI/DrawableKaraokeRuleset.cs b/osu.Game.Rulesets.Karaoke/UI/DrawableKaraokeRuleset.cs index 57200d321..03784ddb7 100644 --- a/osu.Game.Rulesets.Karaoke/UI/DrawableKaraokeRuleset.cs +++ b/osu.Game.Rulesets.Karaoke/UI/DrawableKaraokeRuleset.cs @@ -32,6 +32,8 @@ public partial class DrawableKaraokeRuleset : DrawableScrollingRuleset (KaraokeRulesetConfigManager)base.Config; + public new KaraokeInputManager KeyBindingInputManager => (KaraokeInputManager)base.KeyBindingInputManager; + private readonly Bindable configDirection = new(); [Cached(typeof(INotePositionInfo))] diff --git a/osu.Game.Rulesets.Karaoke/UI/HUD/SettingButtonsDisplay.cs b/osu.Game.Rulesets.Karaoke/UI/HUD/SettingButtonsDisplay.cs index fb8b59c7c..59655ce5f 100644 --- a/osu.Game.Rulesets.Karaoke/UI/HUD/SettingButtonsDisplay.cs +++ b/osu.Game.Rulesets.Karaoke/UI/HUD/SettingButtonsDisplay.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Karaoke.UI.HUD { - public partial class SettingButtonsDisplay : CompositeDrawable, ISkinnableDrawable + public partial class SettingButtonsDisplay : CompositeDrawable, ISerialisableDrawable { private readonly CornerBackground background; private readonly FillFlowContainer triggerButtons; diff --git a/osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs b/osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs index a9f04ff76..bc99b65bf 100644 --- a/osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs +++ b/osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs @@ -131,7 +131,7 @@ private void load() }; } - private partial class TimeSlider : OsuSliderBar + private partial class TimeSlider : RoundedSliderBar { public override LocalisableString TooltipText => Current.Value.ToString("N0") + "ms"; } diff --git a/osu.Game.Rulesets.Karaoke/UI/PlayerSettings/ClickablePlayerSliderBar.cs b/osu.Game.Rulesets.Karaoke/UI/PlayerSettings/ClickablePlayerSliderBar.cs index 5322cbe19..2ca7c0f1d 100644 --- a/osu.Game.Rulesets.Karaoke/UI/PlayerSettings/ClickablePlayerSliderBar.cs +++ b/osu.Game.Rulesets.Karaoke/UI/PlayerSettings/ClickablePlayerSliderBar.cs @@ -38,7 +38,7 @@ public ClickablePlayerSliderBar() public void TriggerIncrease() => bar.TriggerIncrease(); - private partial class ClickableSliderBar : OsuSliderBar + private partial class ClickableSliderBar : RoundedSliderBar { private readonly ToolTipButton decreaseButton; private readonly ToolTipButton increaseButton; diff --git a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj index b0792090c..cffd91ef1 100644 --- a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj +++ b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj @@ -18,14 +18,14 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - +