Skip to content

Commit

Permalink
Merge pull request #2317 from andy840119/update-package-to-latest
Browse files Browse the repository at this point in the history
Update package to latest.
  • Loading branch information
andy840119 authored Jan 27, 2025
2 parents 2605dae + c750fc3 commit d1226a5
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Shapes;
using osu.Framework.IO.Stores;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Karaoke.Objects;
Expand Down Expand Up @@ -41,8 +42,10 @@ protected override void Update()
}

[BackgroundDependencyLoader]
private void load(OsuColour colour)
private void load(OsuGameBase game, OsuColour colour)
{
game.Resources.AddStore(new NamespacedResourceStore<byte[]>(new ShaderResourceStore(), "Resources"));

Child = new Container
{
Anchor = Anchor.Centre,
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Karaoke/Edit/KaraokeHitObjectComposer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
Expand Down Expand Up @@ -179,5 +180,5 @@ protected void CreateMenuBar()

protected override IReadOnlyList<CompositionTool> CompositionTools => Array.Empty<CompositionTool>();

protected override IEnumerable<TernaryButton> CreateTernaryButtons() => Array.Empty<TernaryButton>();
protected override IEnumerable<Drawable> CreateTernaryButtons() => Array.Empty<Drawable>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public static class ScrollContainerExtensions
public static void ScrollIntoViewWithSpacing<T>(this ScrollContainer<T> container, Drawable d, MarginPadding p, bool animated = true)
where T : Drawable
{
float childPos0 = Math.Clamp(container.GetChildPosInContent(d, -new Vector2(p.Left, p.Top)), 0, container.AvailableContent);
float childPos1 = Math.Clamp(container.GetChildPosInContent(d, d.DrawSize + new Vector2(p.Right, p.Bottom)), 0, container.AvailableContent);
double childPos0 = Math.Clamp(container.GetChildPosInContent(d, -new Vector2(p.Left, p.Top)), 0, container.AvailableContent);
double childPos1 = Math.Clamp(container.GetChildPosInContent(d, d.DrawSize + new Vector2(p.Right, p.Bottom)), 0, container.AvailableContent);

int scrollDim = container.ScrollDirection == Direction.Horizontal ? 0 : 1;
float minPos = Math.Min(childPos0, childPos1);
float maxPos = Math.Max(childPos0, childPos1);
double minPos = Math.Min(childPos0, childPos1);
double maxPos = Math.Max(childPos0, childPos1);

if (minPos < container.Current || (minPos > container.Current && d.DrawSize[scrollDim] > container.DisplayableContent))
container.ScrollTo(minPos, animated);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
sidebarContainer.Height = DrawHeight;
sidebarContainer.Y = Math.Clamp(ScrollFlow.Current - Header.DrawHeight, 0, Math.Max(ScrollFlow.ScrollContent.DrawHeight - DrawHeight - Header.DrawHeight, 0));
sidebarContainer.Y = (float)Math.Clamp(ScrollFlow.Current - Header.DrawHeight, 0, Math.Max(ScrollFlow.ScrollContent.DrawHeight - DrawHeight - Header.DrawHeight, 0));
}

protected override ChangelogHeader CreateHeader() => new()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public partial class RecordingTimeTagScrollContainer : TimeTagScrollContainer
/// <summary>
/// The timeline's scroll position in the last frame.
/// </summary>
private float lastScrollPosition;
private double lastScrollPosition;

/// <summary>
/// The track time in the last frame.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public double GetPreviewTime(TimeTag timeTag)
return index * preempt_time;
}

public double TimeAtPosition(float x)
public double TimeAtPosition(double x)
{
return x / Content.DrawWidth * editorClock.TrackLength;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
Expand All @@ -19,9 +18,11 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Content.Compose

public partial class PlaybackSwitchButton : CompositeDrawable
{
private readonly IBindable<Track> track = new Bindable<Track>();
private readonly BindableNumber<double> freqAdjust = new BindableDouble(1);

[Resolved]
private EditorClock editorClock { get; set; } = null!;

public PlaybackSwitchButton()
{
Height = SpecialActionToolbar.HEIGHT;
Expand All @@ -32,26 +33,18 @@ public PlaybackSwitchButton()
Origin = Anchor.Centre,
Current = freqAdjust,
};

track.BindValueChanged(tr =>
{
tr.OldValue?.RemoveAdjustment(AdjustableProperty.Frequency, freqAdjust);

// notice that it's not the same bindable as PlaybackControl because track can accept many bindable at the same time.
// should have the better way to get the overall playback speed in the editor but it's OK for now.
tr.NewValue?.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
});
}

[BackgroundDependencyLoader]
private void load(EditorClock clock)
protected override void LoadComplete()
{
track.BindTo(clock.Track);
base.LoadComplete();

editorClock.AudioAdjustments.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
}

protected override void Dispose(bool isDisposing)
{
track.Value?.RemoveAdjustment(AdjustableProperty.Frequency, freqAdjust);
editorClock.AudioAdjustments.RemoveAdjustment(AdjustableProperty.Frequency, freqAdjust);

base.Dispose(isDisposing);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ float getCurrentPosition()
*/
}

protected override void OnUserScroll(float value, bool animated = true, double? distanceDecay = null)
protected override void OnUserScroll(double value, bool animated = true, double? distanceDecay = null)
{
base.OnUserScroll(value, animated, distanceDecay);

// update current value if user scroll to.
BindableCurrent.Value = value;
BindableCurrent.Value = (float)value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ void initialBackground()
if (x.NewValue == null)
return;

const int offset = 8;
float position = scrollContainer.GetChildPosInContent(x.NewValue);
const float offset = 8;
float position = (float)scrollContainer.GetChildPosInContent(x.NewValue);
hoverBackground.MoveToY(position + offset, 50);
hoverBackground.ResizeHeightTo(x.NewValue.DrawHeight, 100);
});
Expand Down
12 changes: 6 additions & 6 deletions osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
<PackageReference Include="osu.Game.Rulesets.Karaoke.Resources" Version="2022.611.0" />
<PackageReference Include="LanguageDetection.karaoke-dev" Version="1.3.3-alpha" />
<PackageReference Include="LrcParser" Version="2024.728.2" />
<PackageReference Include="Octokit" Version="13.0.1" />
<PackageReference Include="osu.Framework.KaraokeFont" Version="2024.914.1" />
<PackageReference Include="Octokit" Version="14.0.0" />
<PackageReference Include="osu.Framework.KaraokeFont" Version="2025.120.0" />
<PackageReference Include="osu.Framework.Microphone" Version="2024.219.0" />
<PackageReference Include="ppy.LocalisationAnalyser" Version="2024.802.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ppy.osu.Game" Version="2024.1205.0" />
<PackageReference Include="ppy.osu.Game" Version="2025.122.0" />
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.Analysis.Kuromoji" Version="4.8.0-beta00016" />
<PackageReference Include="SixLabors.Fonts" Version="2.0.6" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
<PackageReference Include="SixLabors.Fonts" Version="2.1.0" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.5" />
<!--install because it might cause "Could not load file or assembly" error, might be removed eventually-->
<PackageReference Include="System.Text.Encodings.Web" Version="7.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.1" />
<PackageReference Include="WanaKanaSharp" Version="0.2.0" />
<PackageReference Include="Zipangu" Version="1.1.8" />
</ItemGroup>
Expand Down

0 comments on commit d1226a5

Please sign in to comment.