mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 08:02:55 +08:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into rankings-tables
This commit is contained in:
commit
da01f0ee5a
@ -129,6 +129,9 @@ namespace osu.Game.Tournament
|
||||
ladder = new LadderInfo();
|
||||
}
|
||||
|
||||
if (ladder.Ruleset.Value == null)
|
||||
ladder.Ruleset.Value = RulesetStore.AvailableRulesets.First();
|
||||
|
||||
Ruleset.BindTo(ladder.Ruleset);
|
||||
|
||||
dependencies.Cache(ladder);
|
||||
|
@ -19,14 +19,8 @@ namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
}
|
||||
|
||||
private OsuGame game;
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuGame game)
|
||||
{
|
||||
// will be null in tests
|
||||
this.game = game;
|
||||
}
|
||||
[Resolved(CanBeNull = true)]
|
||||
private OsuGame game { get; set; }
|
||||
|
||||
public void AddLinks(string text, List<Link> links)
|
||||
{
|
||||
@ -82,7 +76,7 @@ namespace osu.Game.Graphics.Containers
|
||||
if (action != null)
|
||||
action();
|
||||
else
|
||||
game.HandleLink(link);
|
||||
game?.HandleLink(link);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// 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.
|
||||
|
||||
using System.Linq;
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Threading;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
@ -20,6 +21,11 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
private SampleChannel sampleHover;
|
||||
|
||||
/// <summary>
|
||||
/// Length of debounce for hover sound playback, in milliseconds. Default is 50ms.
|
||||
/// </summary>
|
||||
public double HoverDebounceTime { get; set; } = 50;
|
||||
|
||||
protected readonly HoverSampleSet SampleSet;
|
||||
|
||||
public HoverSounds(HoverSampleSet sampleSet = HoverSampleSet.Normal)
|
||||
@ -28,9 +34,17 @@ namespace osu.Game.Graphics.UserInterface
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
|
||||
private ScheduledDelegate playDelegate;
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
sampleHover?.Play();
|
||||
playDelegate?.Cancel();
|
||||
|
||||
if (HoverDebounceTime <= 0)
|
||||
sampleHover?.Play();
|
||||
else
|
||||
playDelegate = Scheduler.AddDelayed(() => sampleHover?.Play(), HoverDebounceTime);
|
||||
|
||||
return base.OnHover(e);
|
||||
}
|
||||
|
||||
|
@ -42,5 +42,6 @@ namespace osu.Game.Online.API.Requests
|
||||
Ranked,
|
||||
Approved,
|
||||
Qualified,
|
||||
Loved
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user