mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Merge pull request #23954 from Joehuu/fix-drain-length-tooltip
Fix beatmap info length tooltip not showing actual drain length
This commit is contained in:
commit
ba8ca3facf
@ -86,6 +86,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
StarRating = 9.99,
|
StarRating = 9.99,
|
||||||
DifficultyName = @"TEST",
|
DifficultyName = @"TEST",
|
||||||
Length = 456000,
|
Length = 456000,
|
||||||
|
HitLength = 400000,
|
||||||
RulesetID = 3,
|
RulesetID = 3,
|
||||||
CircleSize = 1,
|
CircleSize = 1,
|
||||||
DrainRate = 2.3f,
|
DrainRate = 2.3f,
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Beatmaps
|
|||||||
IBeatmapSetInfo? BeatmapSet { get; }
|
IBeatmapSetInfo? BeatmapSet { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The playable length in milliseconds of this beatmap.
|
/// The total length in milliseconds of this beatmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
double Length { get; }
|
double Length { get; }
|
||||||
|
|
||||||
|
@ -59,5 +59,10 @@ namespace osu.Game.Beatmaps
|
|||||||
int PassCount { get; }
|
int PassCount { get; }
|
||||||
|
|
||||||
APIFailTimes? FailTimes { get; }
|
APIFailTimes? FailTimes { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The playable length in milliseconds of this beatmap.
|
||||||
|
/// </summary>
|
||||||
|
double HitLength { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,16 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
set => Length = TimeSpan.FromSeconds(value).TotalMilliseconds;
|
set => Length = TimeSpan.FromSeconds(value).TotalMilliseconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public double HitLength { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"hit_length")]
|
||||||
|
private double hitLengthInSeconds
|
||||||
|
{
|
||||||
|
get => TimeSpan.FromMilliseconds(HitLength).TotalSeconds;
|
||||||
|
set => HitLength = TimeSpan.FromSeconds(value).TotalMilliseconds;
|
||||||
|
}
|
||||||
|
|
||||||
[JsonProperty(@"convert")]
|
[JsonProperty(@"convert")]
|
||||||
public bool Convert { get; set; }
|
public bool Convert { get; set; }
|
||||||
|
|
||||||
|
@ -68,13 +68,13 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
length.TooltipText = BeatmapsetsStrings.ShowStatsTotalLength(TimeSpan.FromMilliseconds(beatmapInfo.Length).ToFormattedDuration());
|
|
||||||
length.Value = TimeSpan.FromMilliseconds(beatmapInfo.Length).ToFormattedDuration();
|
length.Value = TimeSpan.FromMilliseconds(beatmapInfo.Length).ToFormattedDuration();
|
||||||
|
|
||||||
var onlineInfo = beatmapInfo as IBeatmapOnlineInfo;
|
if (beatmapInfo is not IBeatmapOnlineInfo onlineInfo) return;
|
||||||
|
|
||||||
circleCount.Value = (onlineInfo?.CircleCount ?? 0).ToLocalisableString(@"N0");
|
circleCount.Value = onlineInfo.CircleCount.ToLocalisableString(@"N0");
|
||||||
sliderCount.Value = (onlineInfo?.SliderCount ?? 0).ToLocalisableString(@"N0");
|
sliderCount.Value = onlineInfo.SliderCount.ToLocalisableString(@"N0");
|
||||||
|
length.TooltipText = BeatmapsetsStrings.ShowStatsTotalLength(TimeSpan.FromMilliseconds(onlineInfo.HitLength).ToFormattedDuration());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user