Skip to content

Commit

Permalink
Merge pull request #1868 from andy840119/upgrade-package-to-the-latest
Browse files Browse the repository at this point in the history
Upgrade package to the latest.
  • Loading branch information
andy840119 authored Mar 3, 2023
2 parents 14f6a50 + 31a6069 commit 9bec9ca
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,7 +25,7 @@ public void TestFlashlightExist() => CreateModTest(new ModTestData
return false;

// Should has at least one flashlight
return drawableRuleset.KeyBindingInputManager.Children.OfType<KaraokeModFlashlight.KaraokeFlashlight>().Any();
return drawableRuleset.KeyBindingInputManager.ChildrenOfType<KaraokeModFlashlight.KaraokeFlashlight>().Any();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SkinnableTargetContainer>().FirstOrDefault();
var skinnableTargetContainers = Player.HUDOverlay.OfType<ISerialisableDrawableContainer>().FirstOrDefault();

// todo: because setting buttons display created from skin transform , so might not able to get from here.
var hud = skinnableTargetContainers?.Components.OfType<SettingButtonsDisplay>().FirstOrDefault();
Expand Down
6 changes: 4 additions & 2 deletions osu.Game.Rulesets.Karaoke/Mods/KaraokeModFlashlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ public override void ApplyToDrawableRuleset(DrawableRuleset<KaraokeHitObject> 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<KaraokeFlashlight>().FirstOrDefault();
var flashlight = drawableKaraokeRuleset?.KeyBindingInputManager.Children.OfType<KaraokeFlashlight>().FirstOrDefault();
if (flashlight == null)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Popover GetPopover()
}
};

private partial class OpacitySliderBar : OsuSliderBar<float>
private partial class OpacitySliderBar : RoundedSliderBar<float>
{
public override LocalisableString TooltipText => (Current.Value * 100).ToString("N0") + "%";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private void load()
};
}

private partial class TimeSlider : OsuSliderBar<double>
private partial class TimeSlider : RoundedSliderBar<double>
{
public override LocalisableString TooltipText => Current.Value.ToString("N0") + "ms";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void load()
};
}

private partial class PitchSlider : OsuSliderBar<int>
private partial class PitchSlider : RoundedSliderBar<int>
{
public override LocalisableString TooltipText => (Current.Value >= 0 ? "+" : string.Empty) + Current.Value.ToString("N0");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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,
Expand Down Expand Up @@ -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()
};
}
Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Karaoke/UI/DrawableKaraokeRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public partial class DrawableKaraokeRuleset : DrawableScrollingRuleset<KaraokeHi

public new KaraokeRulesetConfigManager Config => (KaraokeRulesetConfigManager)base.Config;

public new KaraokeInputManager KeyBindingInputManager => (KaraokeInputManager)base.KeyBindingInputManager;

private readonly Bindable<KaraokeScrollingDirection> configDirection = new();

[Cached(typeof(INotePositionInfo))]
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Karaoke/UI/HUD/SettingButtonsDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SettingButton> triggerButtons;
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void load()
};
}

private partial class TimeSlider : OsuSliderBar<double>
private partial class TimeSlider : RoundedSliderBar<double>
{
public override LocalisableString TooltipText => Current.Value.ToString("N0") + "ms";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ClickablePlayerSliderBar()

public void TriggerIncrease() => bar.TriggerIncrease();

private partial class ClickableSliderBar : OsuSliderBar<int>
private partial class ClickableSliderBar : RoundedSliderBar<int>
{
private readonly ToolTipButton decreaseButton;
private readonly ToolTipButton increaseButton;
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ppy.osu.Game" Version="2023.207.0" />
<PackageReference Include="ppy.osu.Game" Version="2023.301.0" />
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.Analysis.Kuromoji" Version="4.8.0-beta00016" />
<PackageReference Include="NicoKaraParser" Version="1.1.0" />
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta18" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta15" />
<!--install because it might cause "Could not load file or assembly" error, might be removed eventually-->
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="7.0.0" />
<PackageReference Include="WanaKanaSharp" Version="0.2.0" />
<PackageReference Include="Zipangu" Version="1.1.8" />
</ItemGroup>
Expand Down

0 comments on commit 9bec9ca

Please sign in to comment.