Expose non-adjusted time from CalculateTimed()

This commit is contained in:
smoogipoo 2021-11-02 17:17:14 +09:00
parent eaeee80a26
commit 0cdd2898fe
3 changed files with 10 additions and 8 deletions

View File

@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Difficulty
foreach (var skill in skills)
skill.ProcessInternal(hitObject);
attribs.Add(new TimedDifficultyAttributes(hitObject.EndTime, CreateDifficultyAttributes(progressiveBeatmap, playableMods, skills, clockRate)));
attribs.Add(new TimedDifficultyAttributes(hitObject.EndTime * clockRate, CreateDifficultyAttributes(progressiveBeatmap, playableMods, skills, clockRate)));
}
return attribs;

View File

@ -11,7 +11,14 @@ namespace osu.Game.Rulesets.Difficulty
/// </summary>
public class TimedDifficultyAttributes : IComparable<TimedDifficultyAttributes>
{
/// <summary>
/// The non-clock adjusted time value at which the attributes take effect.
/// </summary>
public readonly double Time;
/// <summary>
/// The attributes.
/// </summary>
public readonly DifficultyAttributes Attributes;
public TimedDifficultyAttributes(double time, DifficultyAttributes attributes)

View File

@ -48,9 +48,6 @@ namespace osu.Game.Screens.Play.HUD
[CanBeNull]
private GameplayState gameplayState { get; set; }
[Resolved(CanBeNull = true)]
private GameplayClock gameplayClock { get; set; }
[CanBeNull]
private List<TimedDifficultyAttributes> timedAttributes;
@ -136,12 +133,10 @@ namespace osu.Game.Screens.Play.HUD
[CanBeNull]
private DifficultyAttributes getAttributeAtTime(JudgementResult judgement)
{
if (timedAttributes == null || timedAttributes.Count == 0 || gameplayClock == null)
if (timedAttributes == null || timedAttributes.Count == 0)
return null;
double judgementTime = judgement.HitObject.GetEndTime() / gameplayClock.TrueGameplayRate;
int attribIndex = timedAttributes.BinarySearch(new TimedDifficultyAttributes(judgementTime, null));
int attribIndex = timedAttributes.BinarySearch(new TimedDifficultyAttributes(judgement.HitObject.GetEndTime(), null));
if (attribIndex < 0)
attribIndex = ~attribIndex - 1;