mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Merge branch 'master' into update-statistics-async
This commit is contained in:
@ -29,11 +29,17 @@ namespace osu.Game.Screens.Select.Details
|
||||
if (value == metrics) return;
|
||||
metrics = value;
|
||||
|
||||
var ratings = Metrics.Ratings.ToList();
|
||||
negativeRatings.Text = ratings.GetRange(0, ratings.Count / 2 + 1).Sum().ToString();
|
||||
positiveRatings.Text = ratings.GetRange(ratings.Count / 2 + 1, ratings.Count / 2).Sum().ToString();
|
||||
ratingsBar.Length = (float)ratings.GetRange(0, ratings.Count / 2 + 1).Sum() / ratings.Sum();
|
||||
graph.Values = Metrics.Ratings.Select(r => (float)r);
|
||||
const int rating_range = 10;
|
||||
|
||||
var ratings = Metrics.Ratings.Skip(1).Take(rating_range); // adjust for API returning weird empty data at 0.
|
||||
|
||||
var negativeCount = ratings.Take(rating_range / 2).Sum();
|
||||
var totalCount = ratings.Sum();
|
||||
|
||||
negativeRatings.Text = negativeCount.ToString();
|
||||
positiveRatings.Text = (totalCount - negativeCount).ToString();
|
||||
ratingsBar.Length = totalCount == 0 ? 0 : (float)negativeCount / totalCount;
|
||||
graph.Values = ratings.Take(rating_range).Select(r => (float)r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@ using osu.Game.Screens.Select.Filter;
|
||||
using Container = osu.Framework.Graphics.Containers.Container;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
@ -60,6 +61,7 @@ namespace osu.Game.Screens.Select
|
||||
Group = group,
|
||||
Sort = sort,
|
||||
SearchText = searchTextBox.Text,
|
||||
AllowConvertedBeatmaps = showConverted,
|
||||
Ruleset = ruleset
|
||||
};
|
||||
|
||||
@ -163,17 +165,24 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||
|
||||
private Bindable<bool> showConverted;
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(OsuColour colours, OsuGame osu)
|
||||
private void load(OsuColour colours, OsuGame osu, OsuConfigManager config)
|
||||
{
|
||||
sortTabs.AccentColour = colours.GreenLight;
|
||||
|
||||
showConverted = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps);
|
||||
showConverted.ValueChanged += val => updateCriteria();
|
||||
|
||||
if (osu != null)
|
||||
ruleset.BindTo(osu.Ruleset);
|
||||
ruleset.ValueChanged += val => FilterChanged?.Invoke(CreateCriteria());
|
||||
ruleset.ValueChanged += val => updateCriteria();
|
||||
ruleset.TriggerChange();
|
||||
}
|
||||
|
||||
private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria());
|
||||
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||
|
||||
protected override bool OnMouseMove(InputState state) => true;
|
||||
@ -182,4 +191,4 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
protected override bool OnDragStart(InputState state) => true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ namespace osu.Game.Screens.Select
|
||||
public SortMode Sort;
|
||||
public string SearchText;
|
||||
public RulesetInfo Ruleset;
|
||||
public bool AllowConvertedBeatmaps;
|
||||
|
||||
public void Filter(List<BeatmapGroup> groups)
|
||||
{
|
||||
@ -23,7 +24,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
var set = g.BeatmapSet;
|
||||
|
||||
bool hasCurrentMode = set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0));
|
||||
bool hasCurrentMode = AllowConvertedBeatmaps || set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0));
|
||||
|
||||
bool match = hasCurrentMode;
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
using System.Linq;
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input;
|
||||
@ -42,9 +44,13 @@ namespace osu.Game.Screens.Select
|
||||
beatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s));
|
||||
}
|
||||
|
||||
private SampleChannel sampleConfirm;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
private void load(OsuColour colours, AudioManager audio)
|
||||
{
|
||||
sampleConfirm = audio.Sample.Get(@"SongSelect/confirm-selection");
|
||||
|
||||
Footer.AddButton(@"mods", colours.Yellow, modSelect, Key.F1, float.MaxValue);
|
||||
|
||||
BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1);
|
||||
@ -128,6 +134,8 @@ namespace osu.Game.Screens.Select
|
||||
Beatmap.Value.Track.Looping = false;
|
||||
Beatmap.Disabled = true;
|
||||
|
||||
sampleConfirm?.Play();
|
||||
|
||||
LoadComponentAsync(player = new PlayerLoader(new Player()), l => Push(player));
|
||||
}
|
||||
}
|
||||
|
@ -203,8 +203,8 @@ namespace osu.Game.Screens.Select
|
||||
Push(new Editor());
|
||||
}
|
||||
|
||||
private void onBeatmapRestored(BeatmapInfo b) => carousel.UpdateBeatmap(b);
|
||||
private void onBeatmapHidden(BeatmapInfo b) => carousel.UpdateBeatmap(b);
|
||||
private void onBeatmapRestored(BeatmapInfo b) => Schedule(() => carousel.UpdateBeatmap(b));
|
||||
private void onBeatmapHidden(BeatmapInfo b) => Schedule(() => carousel.UpdateBeatmap(b));
|
||||
|
||||
private void carouselBeatmapsLoaded()
|
||||
{
|
||||
@ -332,7 +332,11 @@ namespace osu.Game.Screens.Select
|
||||
logo.FadeIn(logo_transition, Easing.OutQuint);
|
||||
logo.ScaleTo(0.4f, logo_transition, Easing.OutQuint);
|
||||
|
||||
logo.Action = () => carouselRaisedStart();
|
||||
logo.Action = () =>
|
||||
{
|
||||
carouselRaisedStart();
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LogoExiting(OsuLogo logo)
|
||||
@ -413,7 +417,7 @@ namespace osu.Game.Screens.Select
|
||||
if (backgroundModeBeatmap != null)
|
||||
{
|
||||
backgroundModeBeatmap.Beatmap = beatmap;
|
||||
backgroundModeBeatmap.BlurTo(background_blur, 1000);
|
||||
backgroundModeBeatmap.BlurTo(background_blur, 750, Easing.OutQuint);
|
||||
backgroundModeBeatmap.FadeTo(1, 250);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user