Compare commits
3 Commits
a9d7a9d5d5
...
f5ca5083d6
| Author | SHA1 | Date | |
|---|---|---|---|
| f5ca5083d6 | |||
| 1d7c77d8d6 | |||
| 774e52fbd6 |
@@ -215,6 +215,9 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
|
||||
this.ScaleTo(0).Then().ScaleTo(1, APPEAR_DURATION, Easing.OutQuint);
|
||||
|
||||
if (!withFlair)
|
||||
accuracyCircle.Colour = OsuColour.ForRank(score.Rank);
|
||||
|
||||
if (withFlair)
|
||||
{
|
||||
const double swoosh_pre_delay = 443f;
|
||||
@@ -307,6 +310,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
{
|
||||
var dink = badgeNum < badges.Count - 1 ? badgeTickSound : badgeMaxSound;
|
||||
|
||||
accuracyCircle.FadeColour(OsuColour.ForRank(badge.Rank), 100, Easing.InOutSine); // TODO: nicer animations
|
||||
dink!.FrequencyTo(1 + badgeNum++ * 0.05);
|
||||
dink!.Play();
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Extensions.LocalisationExtensions;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
@@ -43,45 +44,63 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new[]
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new CircularContainer
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 12,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Masking = true,
|
||||
CornerRadius = 8f,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4Extensions.FromHex("#222")
|
||||
Colour = Color4Extensions.FromHex("#2222229f"),
|
||||
},
|
||||
HeaderText = new OsuSpriteText
|
||||
new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold),
|
||||
Text = header.ToUpper(),
|
||||
Anchor = Anchor.TopLeft,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
HeaderText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold),
|
||||
Text = header.ToUpper(),
|
||||
},
|
||||
content = CreateContent().With(d =>
|
||||
{
|
||||
d.Origin = Anchor.TopCentre;
|
||||
d.Anchor = Anchor.TopCentre;
|
||||
d.Alpha = 0;
|
||||
d.AlwaysPresent = true;
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new Container
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Children = new[]
|
||||
{
|
||||
content = CreateContent().With(d =>
|
||||
{
|
||||
d.Anchor = Anchor.TopCentre;
|
||||
d.Origin = Anchor.TopCentre;
|
||||
d.Alpha = 0;
|
||||
d.AlwaysPresent = true;
|
||||
}),
|
||||
}
|
||||
}
|
||||
// new Container
|
||||
// {
|
||||
// Anchor = Anchor.TopCentre,
|
||||
// Origin = Anchor.TopCentre,
|
||||
// AutoSizeAxes = Axes.Both,
|
||||
// Children = new[]
|
||||
// {
|
||||
// content = CreateContent().With(d =>
|
||||
// {
|
||||
// d.Anchor = Anchor.TopCentre;
|
||||
// d.Origin = Anchor.TopCentre;
|
||||
// d.Alpha = 0;
|
||||
// d.AlwaysPresent = true;
|
||||
// }),
|
||||
// }
|
||||
// }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace osu.Game.Screens.Ranking
|
||||
var rank = (ColourInfo)OsuColour.ForRank(Score.Rank);
|
||||
(float _, float _, float v) = Color4Extensions.ToHSV(ci);
|
||||
(float rh, float rs, _) = Color4Extensions.ToHSV(rank);
|
||||
return Color4Extensions.FromHSV(rh, rs * 0.2f, v);
|
||||
return Color4Extensions.FromHSV(rh, rs * 0.3f, v * 1.1f);
|
||||
}
|
||||
|
||||
topLayerContent?.FadeOut(content_fade_duration).Expire();
|
||||
|
||||
@@ -163,6 +163,7 @@ namespace osu.Game.Screens.Select
|
||||
private FillFlowContainer infoLabelContainer;
|
||||
private Container bpmLabelContainer;
|
||||
private Container lengthLabelContainer;
|
||||
private Container performanceLabelContainer;
|
||||
|
||||
private readonly WorkingBeatmap working;
|
||||
private readonly RulesetInfo ruleset;
|
||||
@@ -344,9 +345,11 @@ namespace osu.Game.Screens.Select
|
||||
settingChangeTracker?.Dispose();
|
||||
|
||||
refreshBPMAndLengthLabel();
|
||||
refreshPerformanceLabel();
|
||||
|
||||
settingChangeTracker = new ModSettingChangeTracker(m.NewValue);
|
||||
settingChangeTracker.SettingChanged += _ => refreshBPMAndLengthLabel();
|
||||
settingChangeTracker.SettingChanged += _ => refreshPerformanceLabel();
|
||||
}, true);
|
||||
}
|
||||
|
||||
@@ -385,7 +388,11 @@ namespace osu.Game.Screens.Select
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Spacing = new Vector2(20, 0),
|
||||
Children = playableBeatmap.GetStatistics().Select(s => new InfoLabel(s)).ToArray()
|
||||
}
|
||||
},
|
||||
performanceLabelContainer = new Container
|
||||
{
|
||||
AutoSizeAxes = Axes.Both
|
||||
},
|
||||
};
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -429,6 +436,27 @@ namespace osu.Game.Screens.Select
|
||||
});
|
||||
}
|
||||
|
||||
private void refreshPerformanceLabel()
|
||||
{
|
||||
var beatmap = working.Beatmap;
|
||||
|
||||
if (beatmap == null || performanceLabelContainer == null)
|
||||
return;
|
||||
|
||||
var diff = difficultyCache.GetBindableDifficulty(beatmap.BeatmapInfo);
|
||||
diff.BindValueChanged(d =>
|
||||
{
|
||||
float perf = (float?)d.NewValue.PerformanceAttributes?.Total ?? 0.0f;
|
||||
string disp = $"{Math.Round(perf, 1)} pp";
|
||||
performanceLabelContainer.Child = new InfoLabel(new BeatmapStatistic
|
||||
{
|
||||
Name = "Max PP",
|
||||
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Accuracy),
|
||||
Content = disp
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
|
||||
private Drawable getMapper(BeatmapMetadata metadata)
|
||||
{
|
||||
if (string.IsNullOrEmpty(metadata.Author.Username))
|
||||
|
||||
@@ -12,6 +12,7 @@ using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Configuration;
|
||||
@@ -233,6 +234,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
|
||||
private void updateDisplay()
|
||||
{
|
||||
countStatisticsDisplay.ForceTiny = true;
|
||||
cancellationSource?.Cancel();
|
||||
cancellationSource = new CancellationTokenSource();
|
||||
|
||||
@@ -293,8 +295,22 @@ namespace osu.Game.Screens.SelectV2
|
||||
|
||||
Ruleset rulesetInstance = ruleset.Value.CreateInstance();
|
||||
|
||||
var workingBeatmap = beatmap.Value;
|
||||
var diff = difficultyCache.GetBindableDifficulty(workingBeatmap.BeatmapInfo);
|
||||
|
||||
float perf = 0.0f;
|
||||
var displayAttributes = rulesetInstance.GetBeatmapAttributesForDisplay(beatmap.Value.BeatmapInfo, mods.Value).ToList();
|
||||
difficultyStatisticsDisplay.Statistics = displayAttributes.Select(a => new StatisticDifficulty.Data(a)).ToList();
|
||||
difficultyStatisticsDisplay.Statistics = displayAttributes.Select(a => new StatisticDifficulty.Data(a))
|
||||
.Prepend(new StatisticDifficulty.Data("Max PP", perf, perf, perf));
|
||||
|
||||
// at first, performance points won't be available, so we'd have to update them later
|
||||
diff.BindValueChanged(d =>
|
||||
{
|
||||
perf = (float)Math.Round((float?)d.NewValue.PerformanceAttributes?.Total ?? 0f, 1); // yikes
|
||||
var arr = difficultyStatisticsDisplay.Statistics.ToArray();
|
||||
arr[0] = new StatisticDifficulty.Data("Max PP", perf, perf, perf);
|
||||
difficultyStatisticsDisplay.Statistics = arr.AsEnumerable();
|
||||
});
|
||||
});
|
||||
|
||||
protected override void Update()
|
||||
|
||||
@@ -27,9 +27,11 @@ namespace osu.Game.Screens.SelectV2
|
||||
private readonly FillFlowContainer<StatisticDifficulty> statisticsFlow;
|
||||
private readonly GridContainer tinyStatisticsGrid;
|
||||
|
||||
private IReadOnlyList<StatisticDifficulty.Data> statistics = Array.Empty<StatisticDifficulty.Data>();
|
||||
public bool ForceTiny { get; set; } = false;
|
||||
|
||||
public IReadOnlyList<StatisticDifficulty.Data> Statistics
|
||||
private IEnumerable<StatisticDifficulty.Data> statistics = Array.Empty<StatisticDifficulty.Data>();
|
||||
|
||||
public IEnumerable<StatisticDifficulty.Data> Statistics
|
||||
{
|
||||
get => statistics;
|
||||
set
|
||||
@@ -137,7 +139,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
return;
|
||||
|
||||
float flowWidth = statisticsFlow[0].Width * statisticsFlow.Count + statisticsFlow.Spacing.X * (statisticsFlow.Count - 1);
|
||||
bool tiny = !autoSize && DrawWidth < flowWidth - 20;
|
||||
bool tiny = !autoSize && DrawWidth < flowWidth - 20 || ForceTiny;
|
||||
|
||||
if (displayedTinyStatistics != tiny)
|
||||
{
|
||||
@@ -180,8 +182,8 @@ namespace osu.Game.Screens.SelectV2
|
||||
if (statisticsFlow.Select(s => s.Value.Label)
|
||||
.SequenceEqual(statistics.Select(s => s.Label)))
|
||||
{
|
||||
for (int i = 0; i < statistics.Count; i++)
|
||||
statisticsFlow[i].Value = statistics[i];
|
||||
for (int i = 0; i < statistics.Count(); i++)
|
||||
statisticsFlow[i].Value = statistics.ToArray()[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user