1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 22:27:25 +08:00

Merge branch 'master' into fix-roomstate-on-cancel

This commit is contained in:
Dan Balasescu 2019-03-08 14:10:24 +09:00 committed by GitHub
commit 969d5bcbd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 16 deletions

View File

@ -16,18 +16,18 @@ namespace osu.Game.Rulesets.Osu.Tests
[TestFixture]
public class TestCaseGameplayCursor : OsuTestCase, IProvideCursor
{
private GameplayCursor cursor;
private GameplayCursorContainer cursorContainer;
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(CursorTrail) };
public CursorContainer Cursor => cursor;
public CursorContainer Cursor => cursorContainer;
public bool ProvidingUserCursor => true;
[BackgroundDependencyLoader]
private void load()
{
Add(cursor = new GameplayCursor { RelativeSizeAxes = Axes.Both });
Add(cursorContainer = new GameplayCursorContainer { RelativeSizeAxes = Axes.Both });
}
}
}

View File

@ -17,7 +17,7 @@ using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.UI.Cursor
{
public class GameplayCursor : CursorContainer, IKeyBindingHandler<OsuAction>
public class GameplayCursorContainer : CursorContainer, IKeyBindingHandler<OsuAction>
{
protected override Drawable CreateCursor() => new OsuCursor();
@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
private readonly Container<Drawable> fadeContainer;
public GameplayCursor()
public GameplayCursorContainer()
{
InternalChild = fadeContainer = new Container
{

View File

@ -60,6 +60,6 @@ namespace osu.Game.Rulesets.Osu.UI
}
}
protected override CursorContainer CreateCursor() => new GameplayCursor();
protected override CursorContainer CreateCursor() => new GameplayCursorContainer();
}
}

View File

@ -16,7 +16,9 @@ using System.Linq;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Game.Configuration;
using osu.Game.Graphics.Cursor;
using osu.Game.Input.Handlers;
using osu.Game.Overlays;
using osu.Game.Replays;
@ -32,7 +34,7 @@ namespace osu.Game.Rulesets.UI
/// Should not be derived - derive <see cref="RulesetContainer{TObject}"/> instead.
/// </para>
/// </summary>
public abstract class RulesetContainer : Container
public abstract class RulesetContainer : Container, IProvideCursor
{
/// <summary>
/// The selected variant.
@ -77,7 +79,11 @@ namespace osu.Game.Rulesets.UI
/// <summary>
/// The cursor provided by this <see cref="RulesetContainer"/>. May be null if no cursor is provided.
/// </summary>
public readonly CursorContainer Cursor;
public CursorContainer Cursor { get; }
public bool ProvidingUserCursor => Cursor != null && !HasReplayLoaded.Value;
protected override bool OnHover(HoverEvent e) => true; // required for IProvideCursor
public readonly Ruleset Ruleset;

View File

@ -11,7 +11,6 @@ using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Input.Events;
using osu.Framework.Logging;
using osu.Framework.Screens;
@ -20,7 +19,6 @@ using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Cursor;
using osu.Game.Online.API;
using osu.Game.Overlays;
using osu.Game.Rulesets;
@ -34,7 +32,7 @@ using osu.Game.Storyboards.Drawables;
namespace osu.Game.Screens.Play
{
public class Player : ScreenWithBeatmapBackground, IProvideCursor
public class Player : ScreenWithBeatmapBackground
{
protected override bool AllowBackButton => false; // handled by HoldForMenuButton
@ -59,9 +57,6 @@ namespace osu.Game.Screens.Play
public int RestartCount;
public CursorContainer Cursor => RulesetContainer.Cursor;
public bool ProvidingUserCursor => RulesetContainer?.Cursor != null && !RulesetContainer.HasReplayLoaded.Value;
private IAdjustableClock sourceClock;
/// <summary>

View File

@ -20,14 +20,14 @@ namespace osu.Game.Utils
private readonly List<Task> tasks = new List<Task>();
private Exception lastException;
public RavenLogger(OsuGame game)
{
raven.Release = game.Version;
if (!game.IsDeployedBuild) return;
Exception lastException = null;
Logger.NewEntry += entry =>
{
if (entry.Level < LogLevel.Verbose) return;