mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 15:47:38 +09:00
Merge branch 'master' into mute-mod-improvements
This commit is contained in:
commit
b01b0d711f
@ -168,8 +168,8 @@ namespace osu.Game.Tests.Online
|
|||||||
|
|
||||||
public override async Task<BeatmapSetInfo> Import(BeatmapSetInfo item, ArchiveReader archive = null, bool lowPriority = false, CancellationToken cancellationToken = default)
|
public override async Task<BeatmapSetInfo> Import(BeatmapSetInfo item, ArchiveReader archive = null, bool lowPriority = false, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
await AllowImport.Task;
|
await AllowImport.Task.ConfigureAwait(false);
|
||||||
return await (CurrentImportTask = base.Import(item, archive, lowPriority, cancellationToken));
|
return await (CurrentImportTask = base.Import(item, archive, lowPriority, cancellationToken)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,9 +143,9 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
public override async Task<StarDifficulty> GetDifficultyAsync(BeatmapInfo beatmapInfo, RulesetInfo rulesetInfo = null, IEnumerable<Mod> mods = null, CancellationToken cancellationToken = default)
|
public override async Task<StarDifficulty> GetDifficultyAsync(BeatmapInfo beatmapInfo, RulesetInfo rulesetInfo = null, IEnumerable<Mod> mods = null, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
if (blockCalculation)
|
if (blockCalculation)
|
||||||
await calculationBlocker.Task;
|
await calculationBlocker.Task.ConfigureAwait(false);
|
||||||
|
|
||||||
return await base.GetDifficultyAsync(beatmapInfo, rulesetInfo, mods, cancellationToken);
|
return await base.GetDifficultyAsync(beatmapInfo, rulesetInfo, mods, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ namespace osu.Game.Online.API
|
|||||||
|
|
||||||
userReq.Failure += ex =>
|
userReq.Failure += ex =>
|
||||||
{
|
{
|
||||||
if (ex.InnerException is WebException webException && webException.Message == @"Unauthorized")
|
if (ex is WebException webException && webException.Message == @"Unauthorized")
|
||||||
{
|
{
|
||||||
log.Add(@"Login no longer valid");
|
log.Add(@"Login no longer valid");
|
||||||
Logout();
|
Logout();
|
||||||
|
@ -19,14 +19,14 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TableColumn[] CreateAdditionalHeaders() => new[]
|
protected override RankingsTableColumn[] CreateAdditionalHeaders() => new[]
|
||||||
{
|
{
|
||||||
new TableColumn("Active Users", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
new RankingsTableColumn("Active Users", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
||||||
new TableColumn("Play Count", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
new RankingsTableColumn("Play Count", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
||||||
new TableColumn("Ranked Score", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
new RankingsTableColumn("Ranked Score", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
||||||
new TableColumn("Avg. Score", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
new RankingsTableColumn("Avg. Score", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
||||||
new TableColumn("Performance", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
new RankingsTableColumn("Performance", Anchor.Centre, new Dimension(GridSizeMode.AutoSize), true),
|
||||||
new TableColumn("Avg. Perf.", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
new RankingsTableColumn("Avg. Perf.", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override Country GetCountry(CountryStatistics item) => item.Country;
|
protected override Country GetCountry(CountryStatistics item) => item.Country;
|
||||||
|
@ -15,9 +15,9 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TableColumn[] CreateUniqueHeaders() => new[]
|
protected override RankingsTableColumn[] CreateUniqueHeaders() => new[]
|
||||||
{
|
{
|
||||||
new TableColumn("Performance", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
new RankingsTableColumn("Performance", Anchor.Centre, new Dimension(GridSizeMode.AutoSize), true),
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override Drawable[] CreateUniqueContent(UserStatistics item) => new Drawable[]
|
protected override Drawable[] CreateUniqueContent(UserStatistics item) => new Drawable[]
|
||||||
|
@ -55,29 +55,24 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
|
|
||||||
rankings.ForEach(_ => backgroundFlow.Add(new TableRowBackground { Height = row_height }));
|
rankings.ForEach(_ => backgroundFlow.Add(new TableRowBackground { Height = row_height }));
|
||||||
|
|
||||||
Columns = mainHeaders.Concat(CreateAdditionalHeaders()).ToArray();
|
Columns = mainHeaders.Concat(CreateAdditionalHeaders()).Cast<TableColumn>().ToArray();
|
||||||
Content = rankings.Select((s, i) => createContent((page - 1) * items_per_page + i, s)).ToArray().ToRectangular();
|
Content = rankings.Select((s, i) => createContent((page - 1) * items_per_page + i, s)).ToArray().ToRectangular();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Drawable[] createContent(int index, TModel item) => new Drawable[] { createIndexDrawable(index), createMainContent(item) }.Concat(CreateAdditionalContent(item)).ToArray();
|
private Drawable[] createContent(int index, TModel item) => new Drawable[] { createIndexDrawable(index), createMainContent(item) }.Concat(CreateAdditionalContent(item)).ToArray();
|
||||||
|
|
||||||
private static TableColumn[] mainHeaders => new[]
|
private static RankingsTableColumn[] mainHeaders => new[]
|
||||||
{
|
{
|
||||||
new TableColumn(string.Empty, Anchor.Centre, new Dimension(GridSizeMode.Absolute, 40)), // place
|
new RankingsTableColumn(string.Empty, Anchor.Centre, new Dimension(GridSizeMode.Absolute, 40)), // place
|
||||||
new TableColumn(string.Empty, Anchor.CentreLeft, new Dimension()), // flag and username (country name)
|
new RankingsTableColumn(string.Empty, Anchor.CentreLeft, new Dimension()), // flag and username (country name)
|
||||||
};
|
};
|
||||||
|
|
||||||
protected abstract TableColumn[] CreateAdditionalHeaders();
|
protected abstract RankingsTableColumn[] CreateAdditionalHeaders();
|
||||||
|
|
||||||
protected abstract Drawable[] CreateAdditionalContent(TModel item);
|
protected abstract Drawable[] CreateAdditionalContent(TModel item);
|
||||||
|
|
||||||
protected virtual string HighlightedColumn => @"Performance";
|
protected sealed override Drawable CreateHeader(int index, TableColumn column)
|
||||||
|
=> (column as RankingsTableColumn)?.CreateHeaderText() ?? new HeaderText(column?.Header ?? default, false);
|
||||||
protected override Drawable CreateHeader(int index, TableColumn column)
|
|
||||||
{
|
|
||||||
var title = column?.Header ?? default;
|
|
||||||
return new HeaderText(title, title == HighlightedColumn);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract Country GetCountry(TModel item);
|
protected abstract Country GetCountry(TModel item);
|
||||||
|
|
||||||
@ -106,6 +101,19 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
protected class RankingsTableColumn : TableColumn
|
||||||
|
{
|
||||||
|
protected readonly bool Highlighted;
|
||||||
|
|
||||||
|
public RankingsTableColumn(LocalisableString? header = null, Anchor anchor = Anchor.TopLeft, Dimension dimension = null, bool highlighted = false)
|
||||||
|
: base(header, anchor, dimension)
|
||||||
|
{
|
||||||
|
Highlighted = highlighted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual HeaderText CreateHeaderText() => new HeaderText(Header, Highlighted);
|
||||||
|
}
|
||||||
|
|
||||||
protected class HeaderText : OsuSpriteText
|
protected class HeaderText : OsuSpriteText
|
||||||
{
|
{
|
||||||
private readonly bool isHighlighted;
|
private readonly bool isHighlighted;
|
||||||
|
@ -15,10 +15,10 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TableColumn[] CreateUniqueHeaders() => new[]
|
protected override RankingsTableColumn[] CreateUniqueHeaders() => new[]
|
||||||
{
|
{
|
||||||
new TableColumn("Total Score", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
new RankingsTableColumn("Total Score", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
||||||
new TableColumn("Ranked Score", Anchor.Centre, new Dimension(GridSizeMode.AutoSize))
|
new RankingsTableColumn("Ranked Score", Anchor.Centre, new Dimension(GridSizeMode.AutoSize), true)
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override Drawable[] CreateUniqueContent(UserStatistics item) => new Drawable[]
|
protected override Drawable[] CreateUniqueContent(UserStatistics item) => new Drawable[]
|
||||||
@ -32,7 +32,5 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
Text = $@"{item.RankedScore:N0}",
|
Text = $@"{item.RankedScore:N0}",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override string HighlightedColumn => @"Ranked Score";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,20 +22,14 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
|
|
||||||
protected virtual IEnumerable<string> GradeColumns => new List<string> { "SS", "S", "A" };
|
protected virtual IEnumerable<string> GradeColumns => new List<string> { "SS", "S", "A" };
|
||||||
|
|
||||||
protected override TableColumn[] CreateAdditionalHeaders() => new[]
|
protected override RankingsTableColumn[] CreateAdditionalHeaders() => new[]
|
||||||
{
|
{
|
||||||
new TableColumn("Accuracy", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
new RankingsTableColumn("Accuracy", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
||||||
new TableColumn("Play Count", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
new RankingsTableColumn("Play Count", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
||||||
}.Concat(CreateUniqueHeaders())
|
}.Concat(CreateUniqueHeaders())
|
||||||
.Concat(GradeColumns.Select(grade => new TableColumn(grade, Anchor.Centre, new Dimension(GridSizeMode.AutoSize))))
|
.Concat(GradeColumns.Select(grade => new GradeTableColumn(grade, Anchor.Centre, new Dimension(GridSizeMode.AutoSize))))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
protected override Drawable CreateHeader(int index, TableColumn column)
|
|
||||||
{
|
|
||||||
var title = column?.Header ?? default;
|
|
||||||
return new UserTableHeaderText(title, HighlightedColumn == title, GradeColumns.Contains(title.ToString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected sealed override Country GetCountry(UserStatistics item) => item.User.Country;
|
protected sealed override Country GetCountry(UserStatistics item) => item.User.Country;
|
||||||
|
|
||||||
protected sealed override Drawable CreateFlagContent(UserStatistics item)
|
protected sealed override Drawable CreateFlagContent(UserStatistics item)
|
||||||
@ -61,19 +55,29 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
new ColoredRowText { Text = $@"{item.GradesCount[ScoreRank.A]:N0}", }
|
new ColoredRowText { Text = $@"{item.GradesCount[ScoreRank.A]:N0}", }
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
|
|
||||||
protected abstract TableColumn[] CreateUniqueHeaders();
|
protected abstract RankingsTableColumn[] CreateUniqueHeaders();
|
||||||
|
|
||||||
protected abstract Drawable[] CreateUniqueContent(UserStatistics item);
|
protected abstract Drawable[] CreateUniqueContent(UserStatistics item);
|
||||||
|
|
||||||
private class UserTableHeaderText : HeaderText
|
private class GradeTableColumn : RankingsTableColumn
|
||||||
{
|
{
|
||||||
public UserTableHeaderText(LocalisableString text, bool isHighlighted, bool isGrade)
|
public GradeTableColumn(LocalisableString? header = null, Anchor anchor = Anchor.TopLeft, Dimension dimension = null, bool highlighted = false)
|
||||||
|
: base(header, anchor, dimension, highlighted)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override HeaderText CreateHeaderText() => new GradeHeaderText(Header, Highlighted);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class GradeHeaderText : HeaderText
|
||||||
|
{
|
||||||
|
public GradeHeaderText(LocalisableString text, bool isHighlighted)
|
||||||
: base(text, isHighlighted)
|
: base(text, isHighlighted)
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding
|
Margin = new MarginPadding
|
||||||
{
|
{
|
||||||
// Grade columns have extra horizontal padding for readibility
|
// Grade columns have extra horizontal padding for readibility
|
||||||
Horizontal = isGrade ? 20 : 10,
|
Horizontal = 20,
|
||||||
Vertical = 5
|
Vertical = 5
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -11,11 +11,11 @@ using osu.Game.Skinning;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
namespace osu.Game.Rulesets.Mods
|
||||||
{
|
{
|
||||||
public class Metronome : BeatSyncedContainer
|
public class Metronome : BeatSyncedContainer, IAdjustableAudioComponent
|
||||||
{
|
{
|
||||||
private readonly double firstHitTime;
|
private readonly double firstHitTime;
|
||||||
|
|
||||||
private PausableSkinnableSound sample;
|
private readonly PausableSkinnableSound sample;
|
||||||
|
|
||||||
/// <param name="firstHitTime">Start time of the first hit object, used for providing a count down.</param>
|
/// <param name="firstHitTime">Start time of the first hit object, used for providing a count down.</param>
|
||||||
public Metronome(double firstHitTime)
|
public Metronome(double firstHitTime)
|
||||||
@ -23,15 +23,8 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
this.firstHitTime = firstHitTime;
|
this.firstHitTime = firstHitTime;
|
||||||
AllowMistimedEventFiring = false;
|
AllowMistimedEventFiring = false;
|
||||||
Divisor = 1;
|
Divisor = 1;
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
InternalChild = sample = new PausableSkinnableSound(new SampleInfo("Gameplay/catch-banana"));
|
||||||
private void load()
|
|
||||||
{
|
|
||||||
InternalChildren = new Drawable[]
|
|
||||||
{
|
|
||||||
sample = new PausableSkinnableSound(new SampleInfo("Gameplay/catch-banana"))
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
|
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
|
||||||
@ -49,5 +42,50 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
sample.Frequency.Value = beatIndex % timeSignature == 0 ? 1 : 0.5f;
|
sample.Frequency.Value = beatIndex % timeSignature == 0 ? 1 : 0.5f;
|
||||||
sample.Play();
|
sample.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region IAdjustableAudioComponent
|
||||||
|
|
||||||
|
public IBindable<double> AggregateVolume => sample.AggregateVolume;
|
||||||
|
|
||||||
|
public IBindable<double> AggregateBalance => sample.AggregateBalance;
|
||||||
|
|
||||||
|
public IBindable<double> AggregateFrequency => sample.AggregateFrequency;
|
||||||
|
|
||||||
|
public IBindable<double> AggregateTempo => sample.AggregateTempo;
|
||||||
|
|
||||||
|
public BindableNumber<double> Volume => sample.Volume;
|
||||||
|
|
||||||
|
public BindableNumber<double> Balance => sample.Balance;
|
||||||
|
|
||||||
|
public BindableNumber<double> Frequency => sample.Frequency;
|
||||||
|
|
||||||
|
public BindableNumber<double> Tempo => sample.Tempo;
|
||||||
|
|
||||||
|
public void BindAdjustments(IAggregateAudioAdjustment component)
|
||||||
|
{
|
||||||
|
sample.BindAdjustments(component);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnbindAdjustments(IAggregateAudioAdjustment component)
|
||||||
|
{
|
||||||
|
sample.UnbindAdjustments(component);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddAdjustment(AdjustableProperty type, IBindable<double> adjustBindable)
|
||||||
|
{
|
||||||
|
sample.AddAdjustment(type, adjustBindable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveAdjustment(AdjustableProperty type, IBindable<double> adjustBindable)
|
||||||
|
{
|
||||||
|
sample.RemoveAdjustment(type, adjustBindable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveAllAdjustments(AdjustableProperty type)
|
||||||
|
{
|
||||||
|
sample.RemoveAllAdjustments(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ namespace osu.Game.Screens.Play
|
|||||||
float barHeight = bottom_bar_height + handle_size.Y;
|
float barHeight = bottom_bar_height + handle_size.Y;
|
||||||
|
|
||||||
bar.ResizeHeightTo(ShowGraph.Value ? barHeight + graph_height : barHeight, transition_duration, Easing.In);
|
bar.ResizeHeightTo(ShowGraph.Value ? barHeight + graph_height : barHeight, transition_duration, Easing.In);
|
||||||
graph.MoveToY(ShowGraph.Value ? 0 : bottom_bar_height + graph_height, transition_duration, Easing.In);
|
graph.FadeTo(ShowGraph.Value ? 1 : 0, transition_duration, Easing.In);
|
||||||
|
|
||||||
updateInfoMargin();
|
updateInfoMargin();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user