Skip to content

Commit

Permalink
fix: Fix 412.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Apr 13, 2024
1 parent 0011e3c commit a552185
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2024.221.0" />
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2024.412.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IGPlayerLoader\IGPlayerLoader.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void GetLyricFor(int id)
LyricProcessor.SearchByNeteaseID(id, CurrentWorkingBeatmap, onLyricRequestFinished, onLyricRequestFail);
}

private Track track = null!;
private ITrack track = null!;

public readonly BindableDouble Offset = new BindableDouble
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using M.DBus.Utils.Canonical.DBusMenuFlags;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Audio;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.Collections;
Expand Down Expand Up @@ -158,10 +158,10 @@ public bool TogglePause()
{
try
{
if (drawableTrack.IsRunning)
drawableTrack.Stop();
if (beatmapTrack.IsRunning)
beatmapTrack.Stop();
else
drawableTrack.Start();
beatmapTrack.Start();
}
catch (Exception e)
{
Expand Down Expand Up @@ -209,7 +209,7 @@ public bool Seek(double position)
return true;
}

private DrawableTrack drawableTrack = null!;
private ITrack beatmapTrack = null!;

private bool isCurrent;

Expand All @@ -220,8 +220,10 @@ public bool IsCurrent
{
if (trackChangedAfterDisable && value)
{
drawableTrack = new DrawableTrack(b.Value.Track);
drawableTrack.Completed += () =>
var track = b.Value.Track;

beatmapTrack = track;
track.Completed += () =>
{
if (IsCurrent) Schedule(() => NextTrack());
};
Expand All @@ -236,11 +238,13 @@ private void changeBeatmap(WorkingBeatmap working)
{
if (Disabled.Value) return;

var track = b.Value.Track;

b.Disabled = false;
b.Value = working;
b.Disabled = IsCurrent;
drawableTrack = new DrawableTrack(b.Value.Track);
drawableTrack.Completed += () =>
beatmapTrack = track;
track.Completed += () =>
{
if (IsCurrent) Schedule(() => NextTrack());
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public abstract partial class MusicAmplitudesProvider : CurrentBeatmapProvider
{
public readonly BindableBool IsKiai = new BindableBool();

private Track track;
private ITrack track;

protected override void OnBeatmapChanged(ValueChangedEvent<WorkingBeatmap> beatmap)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using osu.Game.Rulesets.IGPlayer.Feature.Player.Plugins.Config;
using osu.Game.Rulesets.IGPlayer.Feature.Player.Plugins.Types;
using osu.Game.Rulesets.IGPlayer.Localisation.LLin;
using osu.Game.Screens.Play;

namespace osu.Game.Rulesets.IGPlayer.Feature.Player.Plugins.Bundle.Storyboard
{
Expand Down Expand Up @@ -57,32 +56,18 @@ public BackgroundStoryBoardLoader()
});
}

private readonly EpilepsyWarning epilepsyWarning = new EpilepsyWarning
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Margin = new MarginPadding(20),
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Depth = -1
};

[BackgroundDependencyLoader]
private void load()
{
var config = (SbLoaderConfigManager)DependenciesContainer.Get<LLinPluginManager>().GetConfigManager(this);
config.BindWith(SbLoaderSettings.EnableStoryboard, Enabled);

if (LLin != null)
{
LLin.Exiting += UnLoad;
LLin.Suspending += onScreenSuspending;
LLin.Resuming += onScreenResuming;
LLin.OnBeatmapChanged(refresh, this, true);
}
if (LLin == null) return;

AddInternal(epilepsyWarning);
LLin?.AddProxy(epilepsyWarning.CreateProxy());
LLin.Exiting += UnLoad;
LLin.Suspending += onScreenSuspending;
LLin.Resuming += onScreenResuming;
LLin.OnBeatmapChanged(refresh, this, true);
}

private void onScreenResuming()
Expand Down Expand Up @@ -169,13 +154,6 @@ protected override bool PostInit()
if (targetBeatmap == null)
throw new InvalidOperationException("targetBeatmap 不能为 null");

epilepsyWarning.ScaleTo(1);

if (targetBeatmap.BeatmapInfo.EpilepsyWarning)
epilepsyWarning.Show();
else
epilepsyWarning.Hide();

sbLoaded.Value = false;
NeedToHideTriangles.Value = false;
StoryboardReplacesBackground.Value = false;
Expand Down Expand Up @@ -220,9 +198,6 @@ protected override bool OnContentLoaded(Drawable content)
else LLin.RequestNonBlackBackground(this);
}

if (targetBeatmap.BeatmapInfo.EpilepsyWarning)
epilepsyWarning.ScaleTo(1.001f, 5000).OnComplete(_ => epilepsyWarning.Hide());

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="NetCoreServer" Version="6.7.0" />
<PackageReference Include="NLua" Version="1.6.2" />
<PackageReference Include="ppy.osu.Game" Version="2024.312.0" />
<PackageReference Include="ppy.osu.Game" Version="2024.412.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\M.DBus\M.DBus.csproj" />
Expand Down

0 comments on commit a552185

Please sign in to comment.