1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

Merge branch 'simplify-test-spectator-client' into spectator-state-rework

This commit is contained in:
Dan Balasescu 2022-02-04 22:42:53 +09:00
commit 3a8ec205b3
5 changed files with 10 additions and 21 deletions

View File

@ -51,7 +51,7 @@
<Reference Include="Java.Interop" /> <Reference Include="Java.Interop" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.202.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2022.204.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.204.0" /> <PackageReference Include="ppy.osu.Framework.Android" Version="2022.204.0" />
</ItemGroup> </ItemGroup>
<ItemGroup Label="Transitive Dependencies"> <ItemGroup Label="Transitive Dependencies">

View File

@ -154,6 +154,7 @@ namespace osu.Game.Screens.Select
private readonly DrawablePool<DrawableCarouselBeatmapSet> setPool = new DrawablePool<DrawableCarouselBeatmapSet>(100); private readonly DrawablePool<DrawableCarouselBeatmapSet> setPool = new DrawablePool<DrawableCarouselBeatmapSet>(100);
private Sample spinSample; private Sample spinSample;
private Sample randomSelectSample;
private int visibleSetsCount; private int visibleSetsCount;
@ -178,6 +179,7 @@ namespace osu.Game.Screens.Select
private void load(OsuConfigManager config, AudioManager audio) private void load(OsuConfigManager config, AudioManager audio)
{ {
spinSample = audio.Samples.Get("SongSelect/random-spin"); spinSample = audio.Samples.Get("SongSelect/random-spin");
randomSelectSample = audio.Samples.Get(@"SongSelect/select-random");
config.BindWith(OsuSetting.RandomSelectAlgorithm, RandomAlgorithm); config.BindWith(OsuSetting.RandomSelectAlgorithm, RandomAlgorithm);
config.BindWith(OsuSetting.SongSelectRightMouseScroll, RightClickScrollingEnabled); config.BindWith(OsuSetting.SongSelectRightMouseScroll, RightClickScrollingEnabled);
@ -495,6 +497,8 @@ namespace osu.Game.Screens.Select
var chan = spinSample.GetChannel(); var chan = spinSample.GetChannel();
chan.Frequency.Value = 1f + Math.Min(1f, distance / visibleSetsCount); chan.Frequency.Value = 1f + Math.Min(1f, distance / visibleSetsCount);
chan.Play(); chan.Play();
randomSelectSample?.Play();
} }
private void select(CarouselItem item) private void select(CarouselItem item)

View File

@ -100,7 +100,6 @@ namespace osu.Game.Screens.Select
private Sample sampleChangeDifficulty; private Sample sampleChangeDifficulty;
private Sample sampleChangeBeatmap; private Sample sampleChangeBeatmap;
private Sample sampleRandomBeatmap;
private Container carouselContainer; private Container carouselContainer;
@ -110,8 +109,6 @@ namespace osu.Game.Screens.Select
private double audioFeedbackLastPlaybackTime; private double audioFeedbackLastPlaybackTime;
private bool randomSelectionPending;
[Resolved] [Resolved]
private MusicController music { get; set; } private MusicController music { get; set; }
@ -291,7 +288,6 @@ namespace osu.Game.Screens.Select
sampleChangeDifficulty = audio.Samples.Get(@"SongSelect/select-difficulty"); sampleChangeDifficulty = audio.Samples.Get(@"SongSelect/select-difficulty");
sampleChangeBeatmap = audio.Samples.Get(@"SongSelect/select-expand"); sampleChangeBeatmap = audio.Samples.Get(@"SongSelect/select-expand");
sampleRandomBeatmap = audio.Samples.Get(@"SongSelect/select-random");
SampleConfirm = audio.Samples.Get(@"SongSelect/confirm-selection"); SampleConfirm = audio.Samples.Get(@"SongSelect/confirm-selection");
if (dialogOverlay != null) if (dialogOverlay != null)
@ -319,16 +315,8 @@ namespace osu.Game.Screens.Select
(new FooterButtonMods { Current = Mods }, ModSelect), (new FooterButtonMods { Current = Mods }, ModSelect),
(new FooterButtonRandom (new FooterButtonRandom
{ {
NextRandom = () => NextRandom = () => Carousel.SelectNextRandom(),
{ PreviousRandom = Carousel.SelectPreviousRandom
randomSelectionPending = true;
Carousel.SelectNextRandom();
},
PreviousRandom = () =>
{
randomSelectionPending = true;
Carousel.SelectPreviousRandom();
}
}, null), }, null),
(new FooterButtonOptions(), BeatmapOptions) (new FooterButtonOptions(), BeatmapOptions)
}; };
@ -498,9 +486,7 @@ namespace osu.Game.Screens.Select
{ {
if (beatmap != null && beatmapInfoPrevious != null && Time.Current - audioFeedbackLastPlaybackTime >= 50) if (beatmap != null && beatmapInfoPrevious != null && Time.Current - audioFeedbackLastPlaybackTime >= 50)
{ {
if (randomSelectionPending) if (beatmap.BeatmapSet?.ID == beatmapInfoPrevious.BeatmapSet?.ID)
sampleRandomBeatmap.Play();
else if (beatmap.BeatmapSet?.ID == beatmapInfoPrevious.BeatmapSet?.ID)
sampleChangeDifficulty.Play(); sampleChangeDifficulty.Play();
else else
sampleChangeBeatmap.Play(); sampleChangeBeatmap.Play();
@ -508,7 +494,6 @@ namespace osu.Game.Screens.Select
audioFeedbackLastPlaybackTime = Time.Current; audioFeedbackLastPlaybackTime = Time.Current;
} }
randomSelectionPending = false;
beatmapInfoPrevious = beatmap; beatmapInfoPrevious = beatmap;
} }

View File

@ -37,7 +37,7 @@
</PackageReference> </PackageReference>
<PackageReference Include="Realm" Version="10.8.0" /> <PackageReference Include="Realm" Version="10.8.0" />
<PackageReference Include="ppy.osu.Framework" Version="2022.204.0" /> <PackageReference Include="ppy.osu.Framework" Version="2022.204.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.202.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2022.204.0" />
<PackageReference Include="Sentry" Version="3.13.0" /> <PackageReference Include="Sentry" Version="3.13.0" />
<PackageReference Include="SharpCompress" Version="0.30.1" /> <PackageReference Include="SharpCompress" Version="0.30.1" />
<PackageReference Include="NUnit" Version="3.13.2" /> <PackageReference Include="NUnit" Version="3.13.2" />

View File

@ -61,7 +61,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup Label="Package References"> <ItemGroup Label="Package References">
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.204.0" /> <PackageReference Include="ppy.osu.Framework.iOS" Version="2022.204.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.202.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2022.204.0" />
</ItemGroup> </ItemGroup>
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) --> <!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
<PropertyGroup> <PropertyGroup>