1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 13:17:26 +08:00

Merge branch 'master' into spin-in

This commit is contained in:
Kyle Chang 2018-09-30 11:39:08 -04:00 committed by GitHub
commit 846b06fce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
77 changed files with 319 additions and 162 deletions

View File

@ -10,8 +10,8 @@ before_build:
- cmd: nuget restore -verbosity quiet - cmd: nuget restore -verbosity quiet
build_script: build_script:
- ps: iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1')) - ps: iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1'))
- appveyor DownloadFile https://puu.sh/A6g5K/4d08705438.enc # signing certificate - appveyor DownloadFile https://puu.sh/BCrS8/7faccf7876.enc # signing certificate
- cmd: appveyor-tools\secure-file -decrypt 4d08705438.enc -secret %decode_secret% -out %HOMEPATH%\deanherbert.pfx - cmd: appveyor-tools\secure-file -decrypt 7faccf7876.enc -secret %decode_secret% -out %HOMEPATH%\deanherbert.pfx
- appveyor DownloadFile https://puu.sh/A6g75/fdc6f19b04.enc # deploy configuration - appveyor DownloadFile https://puu.sh/A6g75/fdc6f19b04.enc # deploy configuration
- cd osu-deploy - cd osu-deploy
- nuget restore -verbosity quiet - nuget restore -verbosity quiet

View File

@ -27,8 +27,8 @@ namespace osu.Desktop.Overlays
private NotificationOverlay notificationOverlay; private NotificationOverlay notificationOverlay;
private GameHost host; private GameHost host;
public override bool HandleKeyboardInput => false; public override bool HandleNonPositionalInput => false;
public override bool HandleMouseInput => false; public override bool HandlePositionalInput => false;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager config, GameHost host) private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager config, GameHost host)

View File

@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Edit.Layers.Selection.Overlays
} }
// Todo: This is temporary, since the note masks don't do anything special yet. In the future they will handle input. // Todo: This is temporary, since the note masks don't do anything special yet. In the future they will handle input.
public override bool HandleMouseInput => false; public override bool HandlePositionalInput => false;
} }
} }
} }

View File

@ -56,6 +56,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays
} }
// Todo: This is temporary, since the slider circle masks don't do anything special yet. In the future they will handle input. // Todo: This is temporary, since the slider circle masks don't do anything special yet. In the future they will handle input.
public override bool HandleMouseInput => false; public override bool HandlePositionalInput => false;
} }
} }

View File

@ -59,7 +59,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays
body.UpdateProgress(0); body.UpdateProgress(0);
} }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => body.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => body.ReceivePositionalInputAt(screenSpacePos);
public override Vector2 SelectionPoint => ToScreenSpace(OriginPosition); public override Vector2 SelectionPoint => ToScreenSpace(OriginPosition);
public override Quad SelectionQuad => body.PathDrawQuad; public override Quad SelectionQuad => body.PathDrawQuad;

View File

@ -184,6 +184,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public Drawable ProxiedLayer => HeadCircle.ApproachCircle; public Drawable ProxiedLayer => HeadCircle.ApproachCircle;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Body.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Body.ReceivePositionalInputAt(screenSpacePos);
} }
} }

View File

@ -153,10 +153,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
if (Time.Current < slider.EndTime) if (Time.Current < slider.EndTime)
{ {
// Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position. // Make sure to use the base version of ReceivePositionalInputAt so that we correctly check the position.
Tracking = canCurrentlyTrack Tracking = canCurrentlyTrack
&& lastState != null && lastState != null
&& ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) && ReceivePositionalInputAt(lastState.Mouse.NativeState.Position)
&& (drawableSlider?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false); && (drawableSlider?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);
} }
} }

View File

@ -112,7 +112,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
container.Attach(RenderbufferInternalFormat.DepthComponent16); container.Attach(RenderbufferInternalFormat.DepthComponent16);
} }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => path.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => path.ReceivePositionalInputAt(screenSpacePos);
public void SetRange(double p0, double p1) public void SetRange(double p0, double p1)
{ {

View File

@ -11,8 +11,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
public class SpinnerBackground : CircularContainer, IHasAccentColour public class SpinnerBackground : CircularContainer, IHasAccentColour
{ {
public override bool HandleKeyboardInput => false; public override bool HandleNonPositionalInput => false;
public override bool HandleMouseInput => false; public override bool HandlePositionalInput => false;
protected Box Disc; protected Box Disc;

View File

@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
}; };
} }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
private bool tracking; private bool tracking;
public bool Tracking public bool Tracking

View File

@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
} }
} }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(ShaderManager shaders, TextureStore textures) private void load(ShaderManager shaders, TextureStore textures)

View File

@ -72,7 +72,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
return false; return false;
} }
public override bool HandleMouseInput => true; // OverlayContainer will set this false when we go hidden, but we always want to receive input. public override bool HandlePositionalInput => true; // OverlayContainer will set this false when we go hidden, but we always want to receive input.
protected override void PopIn() protected override void PopIn()
{ {

View File

@ -72,7 +72,8 @@ namespace osu.Game.Rulesets.Osu.UI
DrawableOsuJudgement explosion = new DrawableOsuJudgement(result, judgedObject) DrawableOsuJudgement explosion = new DrawableOsuJudgement(result, judgedObject)
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,
Position = ((OsuHitObject)judgedObject.HitObject).StackedEndPosition Position = ((OsuHitObject)judgedObject.HitObject).StackedEndPosition,
Scale = new Vector2(((OsuHitObject)judgedObject.HitObject).Scale * 1.65f)
}; };
judgementLayer.Add(explosion); judgementLayer.Add(explosion);

View File

@ -24,6 +24,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
private bool validActionPressed; private bool validActionPressed;
private bool pressHandledThisFrame;
protected DrawableHit(Hit hit) protected DrawableHit(Hit hit)
: base(hit) : base(hit)
{ {
@ -51,6 +53,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public override bool OnPressed(TaikoAction action) public override bool OnPressed(TaikoAction action)
{ {
if (pressHandledThisFrame)
return true;
if (Judged) if (Judged)
return false; return false;
@ -62,6 +67,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
if (IsHit) if (IsHit)
HitAction = action; HitAction = action;
// Regardless of whether we've hit or not, any secondary key presses in the same frame should be discarded
// E.g. hitting a non-strong centre as a strong should not fall through and perform a hit on the next note
pressHandledThisFrame = true;
return result; return result;
} }
@ -76,6 +85,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
base.Update(); base.Update();
// The input manager processes all input prior to us updating, so this is the perfect time
// for us to remove the extra press blocking, before input is handled in the next frame
pressHandledThisFrame = false;
Size = BaseSize * Parent.RelativeChildSize; Size = BaseSize * Parent.RelativeChildSize;
} }

View File

@ -193,7 +193,7 @@ namespace osu.Game.Tests.Visual
public CursorContainer Cursor { get; } public CursorContainer Cursor { get; }
public bool ProvidingUserCursor { get; } public bool ProvidingUserCursor { get; }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => base.ReceiveMouseInputAt(screenSpacePos) || SmoothTransition && !ProvidingUserCursor; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => base.ReceivePositionalInputAt(screenSpacePos) || SmoothTransition && !ProvidingUserCursor;
private readonly Box background; private readonly Box background;

View File

@ -282,17 +282,19 @@ namespace osu.Game.Database
/// Is a no-op for already deleted items. /// Is a no-op for already deleted items.
/// </summary> /// </summary>
/// <param name="item">The item to delete.</param> /// <param name="item">The item to delete.</param>
public void Delete(TModel item) /// <returns>false if no operation was performed</returns>
public bool Delete(TModel item)
{ {
using (ContextFactory.GetForWrite()) using (ContextFactory.GetForWrite())
{ {
// re-fetch the model on the import context. // re-fetch the model on the import context.
var foundModel = queryModel().Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == item.ID); var foundModel = queryModel().Include(s => s.Files).ThenInclude(f => f.FileInfo).FirstOrDefault(s => s.ID == item.ID);
if (foundModel.DeletePending) return; if (foundModel == null || foundModel.DeletePending) return false;
if (ModelStore.Delete(foundModel)) if (ModelStore.Delete(foundModel))
Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray()); Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray());
return true;
} }
} }

View File

@ -30,8 +30,8 @@ namespace osu.Game.Graphics.Backgrounds
/// </summary> /// </summary>
private const float edge_smoothness = 1; private const float edge_smoothness = 1;
public override bool HandleKeyboardInput => false; public override bool HandleNonPositionalInput => false;
public override bool HandleMouseInput => false; public override bool HandlePositionalInput => false;
public Color4 ColourLight = Color4.White; public Color4 ColourLight = Color4.White;

View File

@ -20,7 +20,7 @@ namespace osu.Game.Graphics.Containers
{ {
} }
public override bool HandleMouseInput => true; public override bool HandlePositionalInput => true;
private OsuGame game; private OsuGame game;

View File

@ -22,7 +22,7 @@ namespace osu.Game.Graphics.Containers
protected virtual bool PlaySamplesOnStateChange => true; protected virtual bool PlaySamplesOnStateChange => true;
protected override bool BlockPassThroughKeyboard => true; protected override bool BlockNonPositionalInput => true;
private PreviewTrackManager previewTrackManager; private PreviewTrackManager previewTrackManager;
@ -54,14 +54,14 @@ namespace osu.Game.Graphics.Containers
/// Whether mouse input should be blocked screen-wide while this overlay is visible. /// Whether mouse input should be blocked screen-wide while this overlay is visible.
/// Performing mouse actions outside of the valid extents will hide the overlay. /// Performing mouse actions outside of the valid extents will hide the overlay.
/// </summary> /// </summary>
public virtual bool BlockScreenWideMouse => BlockPassThroughMouse; public virtual bool BlockScreenWideMouse => BlockPositionalInput;
// receive input outside our bounds so we can trigger a close event on ourselves. // receive input outside our bounds so we can trigger a close event on ourselves.
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => BlockScreenWideMouse || base.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => BlockScreenWideMouse || base.ReceivePositionalInputAt(screenSpacePos);
protected override bool OnClick(InputState state) protected override bool OnClick(InputState state)
{ {
if (!base.ReceiveMouseInputAt(state.Mouse.NativeState.Position)) if (!base.ReceivePositionalInputAt(state.Mouse.NativeState.Position))
{ {
State = Visibility.Hidden; State = Visibility.Hidden;
return true; return true;

View File

@ -54,7 +54,7 @@ namespace osu.Game.Graphics
Scheduler.AddDelayed(updateTimeWithReschedule, timeUntilNextUpdate); Scheduler.AddDelayed(updateTimeWithReschedule, timeUntilNextUpdate);
} }
public override bool HandleMouseInput => true; public override bool HandlePositionalInput => true;
protected virtual string Format() => Date.Humanize(); protected virtual string Format() => Date.Humanize();

View File

@ -47,10 +47,10 @@ namespace osu.Game.Graphics.UserInterface
public readonly SpriteIcon Chevron; public readonly SpriteIcon Chevron;
//don't allow clicking between transitions and don't make the chevron clickable //don't allow clicking between transitions and don't make the chevron clickable
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Alpha == 1f && Text.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Alpha == 1f && Text.ReceivePositionalInputAt(screenSpacePos);
public override bool HandleKeyboardInput => State == Visibility.Visible; public override bool HandleNonPositionalInput => State == Visibility.Visible;
public override bool HandleMouseInput => State == Visibility.Visible; public override bool HandlePositionalInput => State == Visibility.Visible;
public override bool IsRemovable => true; public override bool IsRemovable => true;
private Visibility state; private Visibility state;

View File

@ -211,7 +211,7 @@ namespace osu.Game.Graphics.UserInterface
} }
} }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => backgroundContainer.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => backgroundContainer.ReceivePositionalInputAt(screenSpacePos);
protected override bool OnClick(InputState state) protected override bool OnClick(InputState state)
{ {

View File

@ -34,7 +34,7 @@ namespace osu.Game.Graphics.UserInterface
} }
// We may not be focused yet, but we need to handle keyboard input to be able to request focus // We may not be focused yet, but we need to handle keyboard input to be able to request focus
public override bool HandleKeyboardInput => HoldFocus || base.HandleKeyboardInput; public override bool HandleNonPositionalInput => HoldFocus || base.HandleNonPositionalInput;
protected override void OnFocus(InputState state) protected override void OnFocus(InputState state)
{ {

View File

@ -170,7 +170,7 @@ namespace osu.Game.Graphics.UserInterface
} }
} }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => IconLayer.ReceiveMouseInputAt(screenSpacePos) || TextLayer.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => IconLayer.ReceivePositionalInputAt(screenSpacePos) || TextLayer.ReceivePositionalInputAt(screenSpacePos);
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {

View File

@ -37,7 +37,7 @@ namespace osu.Game.IPC
return; return;
} }
if (importer.HandledExtensions.Contains(Path.GetExtension(path))) if (importer.HandledExtensions.Contains(Path.GetExtension(path)?.ToLowerInvariant()))
importer.Import(path); importer.Import(path);
} }
} }

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Diagnostics; using System.Diagnostics;
using System.Net.Http;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.IO.Network; using osu.Framework.IO.Network;
@ -40,7 +41,7 @@ namespace osu.Game.Online.API
using (var req = new AccessTokenRequestPassword(username, password) using (var req = new AccessTokenRequestPassword(username, password)
{ {
Url = $@"{endpoint}/oauth/token", Url = $@"{endpoint}/oauth/token",
Method = HttpMethod.POST, Method = HttpMethod.Post,
ClientId = clientId, ClientId = clientId,
ClientSecret = clientSecret ClientSecret = clientSecret
}) })
@ -66,7 +67,7 @@ namespace osu.Game.Online.API
using (var req = new AccessTokenRequestRefresh(refresh) using (var req = new AccessTokenRequestRefresh(refresh)
{ {
Url = $@"{endpoint}/oauth/token", Url = $@"{endpoint}/oauth/token",
Method = HttpMethod.POST, Method = HttpMethod.Post,
ClientId = clientId, ClientId = clientId,
ClientSecret = clientSecret ClientSecret = clientSecret
}) })

View File

@ -2,34 +2,19 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using osu.Framework.IO.Network;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
namespace osu.Game.Online.API.Requests namespace osu.Game.Online.API.Requests
{ {
public class GetMessagesRequest : APIRequest<List<Message>> public class GetMessagesRequest : APIRequest<List<Message>>
{ {
private readonly List<Channel> channels; private readonly Channel channel;
private readonly long? since;
public GetMessagesRequest(List<Channel> channels, long? sinceId) public GetMessagesRequest(Channel channel)
{ {
this.channels = channels; this.channel = channel;
since = sinceId;
} }
protected override WebRequest CreateWebRequest() protected override string Target => $@"chat/channels/{channel.Id}/messages";
{
string channelString = string.Join(",", channels.Select(x => x.Id));
var req = base.CreateWebRequest();
req.AddParameter(@"channels", channelString);
if (since.HasValue) req.AddParameter(@"since", since.Value.ToString());
return req;
}
protected override string Target => @"chat/messages";
} }
} }

View File

@ -0,0 +1,32 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using JetBrains.Annotations;
using osu.Framework.IO.Network;
using osu.Game.Online.Chat;
namespace osu.Game.Online.API.Requests
{
public class GetUpdatesRequest : APIRequest<GetUpdatesResponse>
{
private readonly long since;
private readonly Channel channel;
public GetUpdatesRequest(long sinceId, [CanBeNull] Channel channel = null)
{
this.channel = channel;
since = sinceId;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
if (channel != null) req.AddParameter(@"channel", channel.Id.ToString());
req.AddParameter(@"since", since.ToString());
return req;
}
protected override string Target => @"chat/updates";
}
}

View File

@ -0,0 +1,18 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using Newtonsoft.Json;
using osu.Game.Online.Chat;
namespace osu.Game.Online.API.Requests
{
public class GetUpdatesResponse
{
[JsonProperty]
public List<Channel> Presence;
[JsonProperty]
public List<Message> Messages;
}
}

View File

@ -0,0 +1,31 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Online.Chat;
using osu.Game.Users;
namespace osu.Game.Online.API.Requests
{
public class JoinChannelRequest : APIRequest
{
private readonly Channel channel;
private readonly User user;
public JoinChannelRequest(Channel channel, User user)
{
this.channel = channel;
this.user = user;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.Method = HttpMethod.Put;
return req;
}
protected override string Target => $@"chat/channels/{channel.Id}/users/{user.Id}";
}
}

View File

@ -0,0 +1,31 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Online.Chat;
using osu.Game.Users;
namespace osu.Game.Online.API.Requests
{
public class LeaveChannelRequest : APIRequest
{
private readonly Channel channel;
private readonly User user;
public LeaveChannelRequest(Channel channel, User user)
{
this.channel = channel;
this.user = user;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.Method = HttpMethod.Delete;
return req;
}
protected override string Target => $@"chat/channels/{channel.Id}/users/{user.Id}";
}
}

View File

@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Extensions; using System.Net.Http;
using osu.Framework.IO.Network; using osu.Framework.IO.Network;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
@ -20,15 +20,13 @@ namespace osu.Game.Online.API.Requests
{ {
var req = base.CreateWebRequest(); var req = base.CreateWebRequest();
req.Method = HttpMethod.POST; req.Method = HttpMethod.Post;
req.AddParameter(@"target_type", message.TargetType.GetDescription());
req.AddParameter(@"target_id", message.TargetId.ToString());
req.AddParameter(@"is_action", message.IsAction.ToString().ToLowerInvariant()); req.AddParameter(@"is_action", message.IsAction.ToString().ToLowerInvariant());
req.AddParameter(@"message", message.Content); req.AddParameter(@"message", message.Content);
return req; return req;
} }
protected override string Target => @"chat/messages"; protected override string Target => $@"chat/channels/{message.ChannelId}/messages";
} }
} }

View File

@ -19,11 +19,14 @@ namespace osu.Game.Online.Chat
public string Topic; public string Topic;
[JsonProperty(@"type")] [JsonProperty(@"type")]
public string Type; public ChannelType Type;
[JsonProperty(@"channel_id")] [JsonProperty(@"channel_id")]
public int Id; public int Id;
[JsonProperty(@"last_message_id")]
public long? LastMessageId;
public readonly SortedList<Message> Messages = new SortedList<Message>(Comparer<Message>.Default); public readonly SortedList<Message> Messages = new SortedList<Message>(Comparer<Message>.Default);
private readonly List<LocalEchoMessage> pendingMessages = new List<LocalEchoMessage>(); private readonly List<LocalEchoMessage> pendingMessages = new List<LocalEchoMessage>();
@ -51,11 +54,20 @@ namespace osu.Game.Online.Chat
NewMessagesArrived?.Invoke(new[] { message }); NewMessagesArrived?.Invoke(new[] { message });
} }
public bool MessagesLoaded { get; private set; }
public void AddNewMessages(params Message[] messages) public void AddNewMessages(params Message[] messages)
{ {
messages = messages.Except(Messages).ToArray(); messages = messages.Except(Messages).ToArray();
if (messages.Length == 0) return;
Messages.AddRange(messages); Messages.AddRange(messages);
MessagesLoaded = true;
var maxMessageId = messages.Max(m => m.Id);
if (maxMessageId > LastMessageId)
LastMessageId = maxMessageId;
purgeOldMessages(); purgeOldMessages();

View File

@ -0,0 +1,11 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Online.Chat
{
public enum ChannelType
{
PM,
Public
}
}

View File

@ -24,7 +24,7 @@ namespace osu.Game.Online.Chat
/// </summary> /// </summary>
public List<SpriteText> Parts; public List<SpriteText> Parts;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceiveMouseInputAt(screenSpacePos)); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceivePositionalInputAt(screenSpacePos));
protected override HoverClickSounds CreateHoverClickSounds(HoverSampleSet sampleSet) => new LinkHoverSounds(sampleSet, Parts); protected override HoverClickSounds CreateHoverClickSounds(HoverSampleSet sampleSet) => new LinkHoverSounds(sampleSet, Parts);
@ -53,7 +53,7 @@ namespace osu.Game.Online.Chat
this.parts = parts; this.parts = parts;
} }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => parts.Any(d => d.ReceiveMouseInputAt(screenSpacePos)); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => parts.Any(d => d.ReceivePositionalInputAt(screenSpacePos));
} }
} }
} }

View File

@ -18,11 +18,8 @@ namespace osu.Game.Online.Chat
[JsonProperty(@"sender_id")] [JsonProperty(@"sender_id")]
public int UserId; public int UserId;
[JsonProperty(@"target_type")] [JsonProperty(@"channel_id")]
public TargetType TargetType; public int ChannelId;
[JsonProperty(@"target_id")]
public int TargetId;
[JsonProperty(@"is_action")] [JsonProperty(@"is_action")]
public bool IsAction; public bool IsAction;

View File

@ -154,7 +154,7 @@ namespace osu.Game
dependencies.Cache(RulesetStore = new RulesetStore(contextFactory)); dependencies.Cache(RulesetStore = new RulesetStore(contextFactory));
dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage)); dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage));
dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, api, Audio, Host)); dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, api, Audio, Host));
dependencies.Cache(ScoreStore = new ScoreStore(Host.Storage, contextFactory, Host, BeatmapManager, RulesetStore)); dependencies.Cache(ScoreStore = new ScoreStore(contextFactory, Host, BeatmapManager, RulesetStore));
dependencies.Cache(KeyBindingStore = new KeyBindingStore(contextFactory, RulesetStore)); dependencies.Cache(KeyBindingStore = new KeyBindingStore(contextFactory, RulesetStore));
dependencies.Cache(SettingsStore = new SettingsStore(contextFactory)); dependencies.Cache(SettingsStore = new SettingsStore(contextFactory));
dependencies.Cache(RulesetConfigCache = new RulesetConfigCache(SettingsStore)); dependencies.Cache(RulesetConfigCache = new RulesetConfigCache(SettingsStore));
@ -243,7 +243,7 @@ namespace osu.Game
public void Import(params string[] paths) public void Import(params string[] paths)
{ {
var extension = Path.GetExtension(paths.First()); var extension = Path.GetExtension(paths.First())?.ToLowerInvariant();
foreach (var importer in fileImporters) foreach (var importer in fileImporters)
if (importer.HandledExtensions.Contains(extension)) importer.Import(paths); if (importer.HandledExtensions.Contains(extension)) importer.Import(paths);

View File

@ -51,7 +51,7 @@ namespace osu.Game.Overlays
} }
// receive input outside our bounds so we can trigger a close event on ourselves. // receive input outside our bounds so we can trigger a close event on ourselves.
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
public BeatmapSetOverlay() public BeatmapSetOverlay()
{ {

View File

@ -47,7 +47,7 @@ namespace osu.Game.Overlays
public const float TAB_AREA_HEIGHT = 50; public const float TAB_AREA_HEIGHT = 50;
private GetMessagesRequest fetchReq; private GetUpdatesRequest fetchReq;
private readonly ChatTabControl channelTabs; private readonly ChatTabControl channelTabs;
@ -62,7 +62,7 @@ namespace osu.Game.Overlays
private readonly Container channelSelectionContainer; private readonly Container channelSelectionContainer;
private readonly ChannelSelectionOverlay channelSelection; private readonly ChannelSelectionOverlay channelSelection;
public override bool Contains(Vector2 screenSpacePos) => chatContainer.ReceiveMouseInputAt(screenSpacePos) || channelSelection.State == Visibility.Visible && channelSelection.ReceiveMouseInputAt(screenSpacePos); public override bool Contains(Vector2 screenSpacePos) => chatContainer.ReceivePositionalInputAt(screenSpacePos) || channelSelection.State == Visibility.Visible && channelSelection.ReceivePositionalInputAt(screenSpacePos);
public ChatOverlay() public ChatOverlay()
{ {
@ -285,7 +285,7 @@ namespace osu.Game.Overlays
chatBackground.Colour = colours.ChatBlue; chatBackground.Colour = colours.ChatBlue;
} }
private long? lastMessageId; private long lastMessageId;
private readonly List<Channel> careChannels = new List<Channel>(); private readonly List<Channel> careChannels = new List<Channel>();
@ -304,9 +304,9 @@ namespace osu.Game.Overlays
Scheduler.Add(delegate Scheduler.Add(delegate
{ {
//todo: decide how to handle default channels for a user now that they are saved server-side.
addChannel(channels.Find(c => c.Name == @"#lazer")); addChannel(channels.Find(c => c.Name == @"#lazer"));
addChannel(channels.Find(c => c.Name == @"#osu")); addChannel(channels.Find(c => c.Name == @"#osu"));
addChannel(channels.Find(c => c.Name == @"#lobby"));
channelSelection.OnRequestJoin = addChannel; channelSelection.OnRequestJoin = addChannel;
channelSelection.OnRequestLeave = removeChannel; channelSelection.OnRequestLeave = removeChannel;
@ -320,7 +320,7 @@ namespace osu.Game.Overlays
}; };
}); });
messageRequest = Scheduler.AddDelayed(fetchNewMessages, 1000, true); messageRequest = Scheduler.AddDelayed(fetchUpdates, 1000, true);
}; };
api.Queue(req); api.Queue(req);
@ -362,7 +362,7 @@ namespace osu.Game.Overlays
loadedChannels.Add(loaded); loadedChannels.Add(loaded);
LoadComponentAsync(loaded, l => LoadComponentAsync(loaded, l =>
{ {
if (currentChannel.Messages.Any()) if (currentChannel.MessagesLoaded)
loading.Hide(); loading.Hide();
currentChannelContainer.Clear(false); currentChannelContainer.Clear(false);
@ -394,6 +394,15 @@ namespace osu.Game.Overlays
{ {
careChannels.Add(channel); careChannels.Add(channel);
channelTabs.AddItem(channel); channelTabs.AddItem(channel);
if (channel.Type == ChannelType.Public && !channel.Joined)
{
var req = new JoinChannelRequest(channel, api.LocalUser);
req.Success += () => addChannel(channel);
req.Failure += ex => removeChannel(channel);
api.Queue(req);
return;
}
} }
// let's fetch a small number of messages to bring us up-to-date with the backlog. // let's fetch a small number of messages to bring us up-to-date with the backlog.
@ -415,47 +424,53 @@ namespace osu.Game.Overlays
loadedChannels.Remove(loadedChannels.Find(c => c.Channel == channel)); loadedChannels.Remove(loadedChannels.Find(c => c.Channel == channel));
channelTabs.RemoveItem(channel); channelTabs.RemoveItem(channel);
api.Queue(new LeaveChannelRequest(channel, api.LocalUser));
channel.Joined.Value = false; channel.Joined.Value = false;
} }
private void fetchInitialMessages(Channel channel) private void fetchInitialMessages(Channel channel)
{ {
var req = new GetMessagesRequest(new List<Channel> { channel }, null); var req = new GetMessagesRequest(channel);
req.Success += messages =>
req.Success += delegate (List<Message> messages)
{ {
loading.Hide();
channel.AddNewMessages(messages.ToArray()); channel.AddNewMessages(messages.ToArray());
Debug.Write("success!"); if (channel == currentChannel)
}; loading.Hide();
req.Failure += delegate
{
Debug.Write("failure!");
}; };
api.Queue(req); api.Queue(req);
} }
private void fetchNewMessages() private void fetchUpdates()
{ {
if (fetchReq != null) return; if (fetchReq != null) return;
fetchReq = new GetMessagesRequest(careChannels, lastMessageId); fetchReq = new GetUpdatesRequest(lastMessageId);
fetchReq.Success += delegate (List<Message> messages) fetchReq.Success += updates =>
{ {
foreach (var group in messages.Where(m => m.TargetType == TargetType.Channel).GroupBy(m => m.TargetId)) if (updates?.Presence != null)
careChannels.Find(c => c.Id == group.Key)?.AddNewMessages(group.ToArray()); {
foreach (var channel in updates.Presence)
{
if (careChannels.Find(c => c.Id == channel.Id) == null)
{
channel.Joined.Value = true;
addChannel(channel);
}
}
lastMessageId = messages.LastOrDefault()?.Id ?? lastMessageId; foreach (var group in updates.Messages.GroupBy(m => m.ChannelId))
careChannels.Find(c => c.Id == group.Key)?.AddNewMessages(group.ToArray());
lastMessageId = updates.Messages.LastOrDefault()?.Id ?? lastMessageId;
}
Debug.Write("success!");
fetchReq = null; fetchReq = null;
}; };
fetchReq.Failure += delegate fetchReq.Failure += delegate
{ {
Debug.Write("failure!");
fetchReq = null; fetchReq = null;
}; };
@ -517,8 +532,7 @@ namespace osu.Game.Overlays
{ {
Sender = api.LocalUser.Value, Sender = api.LocalUser.Value,
Timestamp = DateTimeOffset.Now, Timestamp = DateTimeOffset.Now,
TargetType = TargetType.Channel, //TODO: read this from channel ChannelId = target.Id,
TargetId = target.Id,
IsAction = isAction, IsAction = isAction,
Content = postText Content = postText
}; };

View File

@ -26,7 +26,7 @@ namespace osu.Game.Overlays.Dialog
public static readonly float ENTER_DURATION = 500; public static readonly float ENTER_DURATION = 500;
public static readonly float EXIT_DURATION = 200; public static readonly float EXIT_DURATION = 200;
protected override bool BlockPassThroughMouse => false; protected override bool BlockPositionalInput => false;
private readonly Vector2 ringSize = new Vector2(100f); private readonly Vector2 ringSize = new Vector2(100f);
private readonly Vector2 ringMinifiedSize = new Vector2(20f); private readonly Vector2 ringMinifiedSize = new Vector2(20f);

View File

@ -43,7 +43,7 @@ namespace osu.Game.Overlays
protected override bool PlaySamplesOnStateChange => false; protected override bool PlaySamplesOnStateChange => false;
protected override bool BlockPassThroughKeyboard => true; protected override bool BlockNonPositionalInput => true;
private void onDialogOnStateChanged(VisibilityContainer dialog, Visibility v) private void onDialogOnStateChanged(VisibilityContainer dialog, Visibility v)
{ {

View File

@ -73,8 +73,8 @@ namespace osu.Game.Overlays.Direct
iconContainer.FadeTo(Ruleset.ID == obj?.ID ? 1f : 0.5f, 100); iconContainer.FadeTo(Ruleset.ID == obj?.ID ? 1f : 0.5f, 100);
} }
public override bool HandleKeyboardInput => !bindable.Disabled && base.HandleKeyboardInput; public override bool HandleNonPositionalInput => !bindable.Disabled && base.HandleNonPositionalInput;
public override bool HandleMouseInput => !bindable.Disabled && base.HandleMouseInput; public override bool HandlePositionalInput => !bindable.Disabled && base.HandlePositionalInput;
public RulesetToggleButton(Bindable<RulesetInfo> bindable, RulesetInfo ruleset) public RulesetToggleButton(Bindable<RulesetInfo> bindable, RulesetInfo ruleset)
{ {

View File

@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Mods
protected readonly OsuSpriteText MultiplierLabel, UnrankedLabel; protected readonly OsuSpriteText MultiplierLabel, UnrankedLabel;
private readonly FillFlowContainer footerContainer; private readonly FillFlowContainer footerContainer;
protected override bool BlockPassThroughKeyboard => false; protected override bool BlockNonPositionalInput => false;
protected readonly FillFlowContainer<ModSection> ModSectionsContainer; protected readonly FillFlowContainer<ModSection> ModSectionsContainer;

View File

@ -25,8 +25,8 @@ namespace osu.Game.Overlays
{ {
private readonly Container box; private readonly Container box;
public override bool HandleKeyboardInput => false; public override bool HandleNonPositionalInput => false;
public override bool HandleMouseInput => false; public override bool HandlePositionalInput => false;
private readonly SpriteText textLine1; private readonly SpriteText textLine1;
private readonly SpriteText textLine2; private readonly SpriteText textLine2;

View File

@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Toolbar
private readonly ToolbarUserArea userArea; private readonly ToolbarUserArea userArea;
protected override bool BlockPassThroughMouse => false; protected override bool BlockPositionalInput => false;
private const double transition_time = 500; private const double transition_time = 500;

View File

@ -103,8 +103,8 @@ namespace osu.Game.Overlays.Toolbar
return false; return false;
} }
public override bool HandleKeyboardInput => !ruleset.Disabled && base.HandleKeyboardInput; public override bool HandleNonPositionalInput => !ruleset.Disabled && base.HandleNonPositionalInput;
public override bool HandleMouseInput => !ruleset.Disabled && base.HandleMouseInput; public override bool HandlePositionalInput => !ruleset.Disabled && base.HandlePositionalInput;
private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300); private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);

View File

@ -28,7 +28,7 @@ namespace osu.Game.Overlays
private VolumeMeter volumeMeterMusic; private VolumeMeter volumeMeterMusic;
private MuteButton muteButton; private MuteButton muteButton;
protected override bool BlockPassThroughMouse => false; protected override bool BlockPositionalInput => false;
private readonly BindableDouble muteAdjustment = new BindableDouble(); private readonly BindableDouble muteAdjustment = new BindableDouble();

View File

@ -11,7 +11,7 @@ namespace osu.Game.Overlays
{ {
protected readonly WaveContainer Waves; protected readonly WaveContainer Waves;
protected override bool BlockPassThroughKeyboard => true; protected override bool BlockNonPositionalInput => true;
protected override Container<Drawable> Content => Waves; protected override Container<Drawable> Content => Waves;
protected WaveOverlayContainer() protected WaveOverlayContainer()

View File

@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Edit
public readonly DrawableHitObject HitObject; public readonly DrawableHitObject HitObject;
protected override bool ShouldBeAlive => HitObject.IsAlive && HitObject.IsPresent || State == SelectionState.Selected; protected override bool ShouldBeAlive => HitObject.IsAlive && HitObject.IsPresent || State == SelectionState.Selected;
public override bool HandleMouseInput => ShouldBeAlive; public override bool HandlePositionalInput => ShouldBeAlive;
public override bool RemoveWhenNotAlive => false; public override bool RemoveWhenNotAlive => false;
public HitObjectMask(DrawableHitObject hitObject) public HitObjectMask(DrawableHitObject hitObject)

View File

@ -65,13 +65,15 @@ namespace osu.Game.Rulesets.Judgements
this.FadeInFromZero(100, Easing.OutQuint); this.FadeInFromZero(100, Easing.OutQuint);
var origScale = Scale;
switch (Result.Type) switch (Result.Type)
{ {
case HitResult.None: case HitResult.None:
break; break;
case HitResult.Miss: case HitResult.Miss:
this.ScaleTo(1.6f); this.ScaleTo(origScale * 1.6f);
this.ScaleTo(1, 100, Easing.In); this.ScaleTo(origScale, 100, Easing.In);
this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint); this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
this.RotateTo(40, 800, Easing.InQuint); this.RotateTo(40, 800, Easing.InQuint);
@ -79,8 +81,8 @@ namespace osu.Game.Rulesets.Judgements
this.Delay(600).FadeOut(200); this.Delay(600).FadeOut(200);
break; break;
default: default:
this.ScaleTo(0.9f); this.ScaleTo(origScale * 0.9f);
this.ScaleTo(1, 500, Easing.OutElastic); this.ScaleTo(origScale, 500, Easing.OutElastic);
this.Delay(100).FadeOut(400); this.Delay(100).FadeOut(400);
break; break;

View File

@ -78,8 +78,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
private bool judgementOccurred; private bool judgementOccurred;
public bool Interactive = true; public bool Interactive = true;
public override bool HandleKeyboardInput => Interactive; public override bool HandleNonPositionalInput => Interactive;
public override bool HandleMouseInput => Interactive; public override bool HandlePositionalInput => Interactive;
public override bool RemoveWhenNotAlive => false; public override bool RemoveWhenNotAlive => false;
public override bool RemoveCompletedTransforms => false; public override bool RemoveCompletedTransforms => false;

View File

@ -3,6 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Users; using osu.Game.Users;
@ -32,6 +33,7 @@ namespace osu.Game.Rulesets.Scoring
public User User; public User User;
[JsonIgnore]
public Replay Replay; public Replay Replay;
public BeatmapInfo Beatmap; public BeatmapInfo Beatmap;

View File

@ -3,6 +3,7 @@
using System; using System;
using System.IO; using System.IO;
using osu.Framework.Logging;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Database; using osu.Game.Database;
@ -13,8 +14,6 @@ namespace osu.Game.Rulesets.Scoring
{ {
public class ScoreStore : DatabaseBackedStore, ICanAcceptFiles public class ScoreStore : DatabaseBackedStore, ICanAcceptFiles
{ {
private readonly Storage storage;
private readonly BeatmapManager beatmaps; private readonly BeatmapManager beatmaps;
private readonly RulesetStore rulesets; private readonly RulesetStore rulesets;
@ -25,9 +24,8 @@ namespace osu.Game.Rulesets.Scoring
// ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised) // ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised)
private ScoreIPCChannel ipc; private ScoreIPCChannel ipc;
public ScoreStore(Storage storage, DatabaseContextFactory factory, IIpcHost importHost = null, BeatmapManager beatmaps = null, RulesetStore rulesets = null) : base(factory) public ScoreStore(DatabaseContextFactory factory, IIpcHost importHost = null, BeatmapManager beatmaps = null, RulesetStore rulesets = null) : base(factory)
{ {
this.storage = storage;
this.beatmaps = beatmaps; this.beatmaps = beatmaps;
this.rulesets = rulesets; this.rulesets = rulesets;
@ -49,8 +47,14 @@ namespace osu.Game.Rulesets.Scoring
public Score ReadReplayFile(string replayFilename) public Score ReadReplayFile(string replayFilename)
{ {
using (Stream s = storage.GetStream(Path.Combine(replay_folder, replayFilename))) if (File.Exists(replayFilename))
return new DatabasedLegacyScoreParser(rulesets, beatmaps).Parse(s); {
using (var stream = File.OpenRead(replayFilename))
return new DatabasedLegacyScoreParser(rulesets, beatmaps).Parse(stream);
}
Logger.Log($"Replay file {replayFilename} cannot be found", LoggingTarget.Information, LogLevel.Error);
return null;
} }
} }
} }

View File

@ -231,7 +231,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose
{ {
} }
public override bool HandleKeyboardInput => IsHovered && !CurrentNumber.Disabled; public override bool HandleNonPositionalInput => IsHovered && !CurrentNumber.Disabled;
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{ {

View File

@ -47,7 +47,7 @@ namespace osu.Game.Screens.Menu
private SampleChannel sampleClick; private SampleChannel sampleClick;
private SampleChannel sampleHover; private SampleChannel sampleHover;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => box.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => box.ReceivePositionalInputAt(screenSpacePos);
public Button(string text, string sampleName, FontAwesome symbol, Color4 colour, Action clickAction = null, float extraWidth = 0, Key triggerKey = Key.Unknown) public Button(string text, string sampleName, FontAwesome symbol, Color4 colour, Action clickAction = null, float extraWidth = 0, Key triggerKey = Key.Unknown)
{ {
@ -229,8 +229,8 @@ namespace osu.Game.Screens.Menu
boxHoverLayer.FadeOut(800, Easing.OutExpo); boxHoverLayer.FadeOut(800, Easing.OutExpo);
} }
public override bool HandleKeyboardInput => state == ButtonState.Expanded; public override bool HandleNonPositionalInput => state == ButtonState.Expanded;
public override bool HandleMouseInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f; public override bool HandlePositionalInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f;
protected override void Update() protected override void Update()
{ {

View File

@ -160,8 +160,8 @@ namespace osu.Game.Screens.Menu
private ButtonSystemState state = ButtonSystemState.Initial; private ButtonSystemState state = ButtonSystemState.Initial;
public override bool HandleKeyboardInput => state != ButtonSystemState.Exit; public override bool HandleNonPositionalInput => state != ButtonSystemState.Exit;
public override bool HandleMouseInput => state != ButtonSystemState.Exit; public override bool HandlePositionalInput => state != ButtonSystemState.Exit;
public ButtonSystemState State public ButtonSystemState State
{ {

View File

@ -64,8 +64,8 @@ namespace osu.Game.Screens.Menu
private readonly float[] frequencyAmplitudes = new float[256]; private readonly float[] frequencyAmplitudes = new float[256];
public override bool HandleKeyboardInput => false; public override bool HandleNonPositionalInput => false;
public override bool HandleMouseInput => false; public override bool HandlePositionalInput => false;
private Shader shader; private Shader shader;
private readonly Texture texture; private readonly Texture texture;

View File

@ -19,8 +19,8 @@ namespace osu.Game.Screens.Menu
{ {
public class MenuSideFlashes : BeatSyncedContainer public class MenuSideFlashes : BeatSyncedContainer
{ {
public override bool HandleKeyboardInput => false; public override bool HandleNonPositionalInput => false;
public override bool HandleMouseInput => false; public override bool HandlePositionalInput => false;
private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>(); private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();

View File

@ -68,7 +68,7 @@ namespace osu.Game.Screens.Menu
public bool BeatMatching = true; public bool BeatMatching = true;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => logoContainer.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => logoContainer.ReceivePositionalInputAt(screenSpacePos);
public bool Ripple public bool Ripple
{ {
@ -342,7 +342,7 @@ namespace osu.Game.Screens.Menu
} }
} }
public override bool HandleMouseInput => base.HandleMouseInput && Action != null && Alpha > 0.2f; public override bool HandlePositionalInput => base.HandlePositionalInput && Action != null && Alpha > 0.2f;
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{ {

View File

@ -28,9 +28,9 @@ namespace osu.Game.Screens.Play
private const int button_height = 70; private const int button_height = 70;
private const float background_alpha = 0.75f; private const float background_alpha = 0.75f;
protected override bool BlockPassThroughKeyboard => true; protected override bool BlockNonPositionalInput => true;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
public Action OnRetry; public Action OnRetry;
public Action OnQuit; public Action OnQuit;

View File

@ -51,7 +51,7 @@ namespace osu.Game.Screens.Play.HUD
protected override void PopOut() => this.FadeOut(fade_duration); protected override void PopOut() => this.FadeOut(fade_duration);
//We want to handle keyboard inputs all the time in order to trigger ToggleVisibility() when not visible //We want to handle keyboard inputs all the time in order to trigger ToggleVisibility() when not visible
public override bool HandleKeyboardInput => true; public override bool HandleNonPositionalInput => true;
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{ {

View File

@ -20,7 +20,7 @@ namespace osu.Game.Screens.Play.HUD
{ {
public class QuitButton : FillFlowContainer public class QuitButton : FillFlowContainer
{ {
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
private readonly Button button; private readonly Button button;

View File

@ -118,8 +118,8 @@ namespace osu.Game.Screens.Play
private void updateVisibility() => this.FadeTo(Visible.Value || configVisibility.Value ? 1 : 0, duration); private void updateVisibility() => this.FadeTo(Visible.Value || configVisibility.Value ? 1 : 0, duration);
public override bool HandleKeyboardInput => receptor == null; public override bool HandleNonPositionalInput => receptor == null;
public override bool HandleMouseInput => receptor == null; public override bool HandlePositionalInput => receptor == null;
public IFrameBasedClock AudioClock { get; set; } public IFrameBasedClock AudioClock { get; set; }
@ -149,7 +149,7 @@ namespace osu.Game.Screens.Play
Target = target; Target = target;
} }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
protected override bool Handle(UIEvent e) protected override bool Handle(UIEvent e)
{ {

View File

@ -17,7 +17,7 @@ namespace osu.Game.Screens.Play
Button = button; Button = button;
} }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
private static string getStringRepresentation(MouseButton button) private static string getStringRepresentation(MouseButton button)
{ {

View File

@ -37,8 +37,8 @@ namespace osu.Game.Screens.Play
private FadeContainer fadeContainer; private FadeContainer fadeContainer;
private double displayTime; private double displayTime;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
protected override bool BlockPassThroughMouse => false; protected override bool BlockPositionalInput => false;
public SkipOverlay(double startTime) public SkipOverlay(double startTime)
{ {

View File

@ -31,8 +31,8 @@ namespace osu.Game.Screens.Play
public Action<double> OnSeek; public Action<double> OnSeek;
public override bool HandleKeyboardInput => AllowSeeking; public override bool HandleNonPositionalInput => AllowSeeking;
public override bool HandleMouseInput => AllowSeeking; public override bool HandlePositionalInput => AllowSeeking;
private IClock audioClock; private IClock audioClock;
public IClock AudioClock { set { audioClock = info.AudioClock = value; } } public IClock AudioClock { set { audioClock = info.AudioClock = value; } }

View File

@ -21,8 +21,8 @@ namespace osu.Game.Screens.Play
public int ColumnCount => columns.Length; public int ColumnCount => columns.Length;
public override bool HandleKeyboardInput => false; public override bool HandleNonPositionalInput => false;
public override bool HandleMouseInput => false; public override bool HandlePositionalInput => false;
private int progress; private int progress;
public int Progress public int Progress

View File

@ -52,8 +52,8 @@ namespace osu.Game.Screens.Select
/// </summary> /// </summary>
public Action<BeatmapInfo> SelectionChanged; public Action<BeatmapInfo> SelectionChanged;
public override bool HandleKeyboardInput => AllowSelection; public override bool HandleNonPositionalInput => AllowSelection;
public override bool HandleMouseInput => AllowSelection; public override bool HandlePositionalInput => AllowSelection;
/// <summary> /// <summary>
/// Used to avoid firing null selections before the initial beatmaps have been loaded via <see cref="BeatmapSets"/>. /// Used to avoid firing null selections before the initial beatmaps have been loaded via <see cref="BeatmapSets"/>.

View File

@ -59,7 +59,7 @@ namespace osu.Game.Screens.Select
ruleset.ValueChanged += _ => updateDisplay(); ruleset.ValueChanged += _ => updateDisplay();
} }
protected override bool BlockPassThroughMouse => false; protected override bool BlockPositionalInput => false;
protected override void PopIn() protected override void PopIn()
{ {
@ -89,6 +89,8 @@ namespace osu.Game.Screens.Select
} }
} }
public override bool IsPresent => base.IsPresent || Info == null; // Visibility is updated in the LoadComponentAsync callback
private BufferedWedgeInfo loadingInfo; private BufferedWedgeInfo loadingInfo;
private void updateDisplay() private void updateDisplay()
@ -154,7 +156,7 @@ namespace osu.Game.Screens.Select
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
titleBinding = localisation.GetLocalisedString(new LocalisedString((metadata.TitleUnicode, metadata.Title))); titleBinding = localisation.GetLocalisedString(new LocalisedString((metadata.TitleUnicode, metadata.Title)));
artistBinding = localisation.GetLocalisedString(new LocalisedString((metadata.ArtistUnicode, metadata.Artist))); artistBinding = localisation.GetLocalisedString(new LocalisedString((metadata.ArtistUnicode, metadata.Artist)));
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -72,8 +72,8 @@ namespace osu.Game.Screens.Select
private readonly SearchTextBox searchTextBox; private readonly SearchTextBox searchTextBox;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
base.ReceiveMouseInputAt(screenSpacePos) || groupTabs.ReceiveMouseInputAt(screenSpacePos) || sortTabs.ReceiveMouseInputAt(screenSpacePos); base.ReceivePositionalInputAt(screenSpacePos) || groupTabs.ReceivePositionalInputAt(screenSpacePos) || sortTabs.ReceivePositionalInputAt(screenSpacePos);
public FilterControl() public FilterControl()
{ {

View File

@ -56,7 +56,7 @@ namespace osu.Game.Screens.Select
private readonly Box box; private readonly Box box;
private readonly Box light; private readonly Box light;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => box.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => box.ReceivePositionalInputAt(screenSpacePos);
public FooterButton() public FooterButton()
{ {

View File

@ -11,7 +11,7 @@ namespace osu.Game.Screens.Select.Leaderboards
{ {
protected const float TEXT_SIZE = 22; protected const float TEXT_SIZE = 22;
public override bool HandleMouseInput => true; public override bool HandlePositionalInput => true;
protected Placeholder() protected Placeholder()
: base(cp => cp.TextSize = TEXT_SIZE) : base(cp => cp.TextSize = TEXT_SIZE)

View File

@ -85,7 +85,7 @@ namespace osu.Game.Screens.Select.Options
return false; return false;
} }
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => box.ReceiveMouseInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => box.ReceivePositionalInputAt(screenSpacePos);
public BeatmapOptionsButton() public BeatmapOptionsButton()
{ {

View File

@ -536,7 +536,7 @@ namespace osu.Game.Screens.Select
private void delete(BeatmapSetInfo beatmap) private void delete(BeatmapSetInfo beatmap)
{ {
if (beatmap == null) return; if (beatmap == null || beatmap.ID <= 0) return;
dialogOverlay?.Push(new BeatmapDeleteDialog(beatmap)); dialogOverlay?.Push(new BeatmapDeleteDialog(beatmap));
} }

View File

@ -18,8 +18,8 @@ namespace osu.Game.Storyboards.Drawables
protected override Container<DrawableStoryboardLayer> Content => content; protected override Container<DrawableStoryboardLayer> Content => content;
protected override Vector2 DrawScale => new Vector2(Parent.DrawHeight / 480); protected override Vector2 DrawScale => new Vector2(Parent.DrawHeight / 480);
public override bool HandleKeyboardInput => false; public override bool HandleNonPositionalInput => false;
public override bool HandleMouseInput => false; public override bool HandlePositionalInput => false;
private bool passing = true; private bool passing = true;
public bool Passing public bool Passing

View File

@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="ppy.osu.Framework" Version="2018.920.1" /> <PackageReference Include="ppy.osu.Framework" Version="2018.928.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" /> <PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.10.1" /> <PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="SharpRaven" Version="2.4.0" /> <PackageReference Include="SharpRaven" Version="2.4.0" />

View File

@ -218,6 +218,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GMT/@EntryIndexedValue">GMT</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GMT/@EntryIndexedValue">GMT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QAT/@EntryIndexedValue">QAT</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QAT/@EntryIndexedValue">QAT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BNG/@EntryIndexedValue">BNG</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BNG/@EntryIndexedValue">BNG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue">HINT</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpFileLayoutPatterns/Pattern/@EntryValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&#xD; <s:String x:Key="/Default/CodeStyle/CSharpFileLayoutPatterns/Pattern/@EntryValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&#xD;
&lt;Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"&gt;&#xD; &lt;Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"&gt;&#xD;