mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge branch 'master' into scoring-standardisation
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Graphics.Audio;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Mods
|
||||
/// </summary>
|
||||
public interface IApplicableToSample : IApplicableMod
|
||||
{
|
||||
void ApplyToSample(SampleChannel sample);
|
||||
void ApplyToSample(DrawableSample sample);
|
||||
}
|
||||
}
|
||||
|
@ -52,10 +52,10 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public class NightcoreBeatContainer : BeatSyncedContainer
|
||||
{
|
||||
private SkinnableSound hatSample;
|
||||
private SkinnableSound clapSample;
|
||||
private SkinnableSound kickSample;
|
||||
private SkinnableSound finishSample;
|
||||
private PausableSkinnableSound hatSample;
|
||||
private PausableSkinnableSound clapSample;
|
||||
private PausableSkinnableSound kickSample;
|
||||
private PausableSkinnableSound finishSample;
|
||||
|
||||
private int? firstBeat;
|
||||
|
||||
@ -69,10 +69,10 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
hatSample = new SkinnableSound(new SampleInfo("nightcore-hat")),
|
||||
clapSample = new SkinnableSound(new SampleInfo("nightcore-clap")),
|
||||
kickSample = new SkinnableSound(new SampleInfo("nightcore-kick")),
|
||||
finishSample = new SkinnableSound(new SampleInfo("nightcore-finish")),
|
||||
hatSample = new PausableSkinnableSound(new SampleInfo("nightcore-hat")),
|
||||
clapSample = new PausableSkinnableSound(new SampleInfo("nightcore-clap")),
|
||||
kickSample = new PausableSkinnableSound(new SampleInfo("nightcore-kick")),
|
||||
finishSample = new PausableSkinnableSound(new SampleInfo("nightcore-finish")),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Audio;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
track.AddAdjustment(AdjustableProperty.Tempo, SpeedChange);
|
||||
}
|
||||
|
||||
public virtual void ApplyToSample(SampleChannel sample)
|
||||
public virtual void ApplyToSample(DrawableSample sample)
|
||||
{
|
||||
sample.AddAdjustment(AdjustableProperty.Frequency, SpeedChange);
|
||||
}
|
||||
|
@ -6,11 +6,11 @@ using System.Linq;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
@ -59,7 +59,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
AdjustPitch.TriggerChange();
|
||||
}
|
||||
|
||||
public void ApplyToSample(SampleChannel sample)
|
||||
public void ApplyToSample(DrawableSample sample)
|
||||
{
|
||||
sample.AddAdjustment(AdjustableProperty.Frequency, SpeedChange);
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Screens.Play;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Drawables
|
||||
@ -35,7 +34,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
/// </summary>
|
||||
public readonly Bindable<Color4> AccentColour = new Bindable<Color4>(Color4.Gray);
|
||||
|
||||
protected SkinnableSound Samples { get; private set; }
|
||||
protected PausableSkinnableSound Samples { get; private set; }
|
||||
|
||||
public virtual IEnumerable<HitSampleInfo> GetSamples() => HitObject.Samples;
|
||||
|
||||
@ -180,7 +179,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
+ $" This is an indication that {nameof(HitObject.ApplyDefaults)} has not been invoked on {this}.");
|
||||
}
|
||||
|
||||
Samples = new SkinnableSound(samples.Select(s => HitObject.SampleControlPoint.ApplyTo(s)));
|
||||
Samples = new PausableSkinnableSound(samples.Select(s => HitObject.SampleControlPoint.ApplyTo(s)));
|
||||
AddInternal(Samples);
|
||||
}
|
||||
|
||||
@ -360,9 +359,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
{
|
||||
}
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
private GameplayClock gameplayClock { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Calculate the position to be used for sample playback at a specified X position (0..1).
|
||||
/// </summary>
|
||||
@ -375,18 +371,13 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
return balance_adjust_amount * (userPositionalHitSounds.Value ? position - 0.5f : 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether samples should currently be playing. Will be false during seek operations.
|
||||
/// </summary>
|
||||
protected bool ShouldPlaySamples => gameplayClock?.IsSeeking != true;
|
||||
|
||||
/// <summary>
|
||||
/// Plays all the hit sounds for this <see cref="DrawableHitObject"/>.
|
||||
/// This is invoked automatically when this <see cref="DrawableHitObject"/> is hit.
|
||||
/// </summary>
|
||||
public virtual void PlaySamples()
|
||||
{
|
||||
if (Samples != null && ShouldPlaySamples)
|
||||
if (Samples != null)
|
||||
{
|
||||
Samples.Balance.Value = CalculateSamplePlaybackBalance(SamplePlaybackPosition);
|
||||
Samples.Play();
|
||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// </summary>
|
||||
[Description(@"")]
|
||||
[Order(14)]
|
||||
None = 0,
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the object has been judged as a miss.
|
||||
@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// </remarks>
|
||||
[Description(@"Miss")]
|
||||
[Order(5)]
|
||||
Miss = 64,
|
||||
Miss,
|
||||
|
||||
[Description(@"Meh")]
|
||||
[Order(4)]
|
||||
@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// Indicates small tick miss.
|
||||
/// </summary>
|
||||
[Order(11)]
|
||||
SmallTickMiss = 128,
|
||||
SmallTickMiss,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates a small tick hit.
|
||||
@ -71,7 +71,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// Indicates a large tick miss.
|
||||
/// </summary>
|
||||
[Order(10)]
|
||||
LargeTickMiss = 192,
|
||||
LargeTickMiss,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates a large tick hit.
|
||||
@ -85,20 +85,20 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// </summary>
|
||||
[Description("S Bonus")]
|
||||
[Order(9)]
|
||||
SmallBonus = 254,
|
||||
SmallBonus,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates a large bonus.
|
||||
/// </summary>
|
||||
[Description("L Bonus")]
|
||||
[Order(8)]
|
||||
LargeBonus = 320,
|
||||
LargeBonus,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates a miss that should be ignored for scoring purposes.
|
||||
/// </summary>
|
||||
[Order(13)]
|
||||
IgnoreMiss = 384,
|
||||
IgnoreMiss,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates a hit that should be ignored for scoring purposes.
|
||||
|
@ -2,7 +2,10 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Timing;
|
||||
@ -59,7 +62,7 @@ namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
if (clock != null)
|
||||
{
|
||||
stabilityGameplayClock.ParentGameplayClock = parentGameplayClock = clock;
|
||||
parentGameplayClock = stabilityGameplayClock.ParentGameplayClock = clock;
|
||||
GameplayClock.IsPaused.BindTo(clock.IsPaused);
|
||||
}
|
||||
}
|
||||
@ -215,7 +218,9 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
private class StabilityGameplayClock : GameplayClock
|
||||
{
|
||||
public IFrameBasedClock ParentGameplayClock;
|
||||
public GameplayClock ParentGameplayClock;
|
||||
|
||||
public override IEnumerable<Bindable<double>> NonGameplayAdjustments => ParentGameplayClock?.NonGameplayAdjustments ?? Enumerable.Empty<Bindable<double>>();
|
||||
|
||||
public StabilityGameplayClock(FramedClock underlyingClock)
|
||||
: base(underlyingClock)
|
||||
|
Reference in New Issue
Block a user