mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Merge branch 'master' into osu-rulesetcontainer-aspect
This commit is contained in:
commit
ba10eb5e50
@ -7,7 +7,6 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using osu.Framework;
|
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
@ -16,7 +15,7 @@ using osu.Game.Users;
|
|||||||
|
|
||||||
namespace osu.Game.Online.API
|
namespace osu.Game.Online.API
|
||||||
{
|
{
|
||||||
public class APIAccess : IUpdateable
|
public class APIAccess : IAPIProvider
|
||||||
{
|
{
|
||||||
private readonly OAuth authentication;
|
private readonly OAuth authentication;
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ namespace osu.Game.Online.API
|
|||||||
|
|
||||||
public string Password;
|
public string Password;
|
||||||
|
|
||||||
public Bindable<User> LocalUser = new Bindable<User>(createGuestUser());
|
public Bindable<User> LocalUser { get; } = new Bindable<User>(createGuestUser());
|
||||||
|
|
||||||
public string Token
|
public string Token
|
||||||
{
|
{
|
||||||
|
31
osu.Game/Online/API/DummyAPIAccess.cs
Normal file
31
osu.Game/Online/API/DummyAPIAccess.cs
Normal 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 osu.Framework.Configuration;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
|
namespace osu.Game.Online.API
|
||||||
|
{
|
||||||
|
public class DummyAPIAccess : IAPIProvider
|
||||||
|
{
|
||||||
|
public Bindable<User> LocalUser { get; } = new Bindable<User>(new User
|
||||||
|
{
|
||||||
|
Username = @"Dummy",
|
||||||
|
Id = 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
public bool IsLoggedIn => true;
|
||||||
|
|
||||||
|
public void Update()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Queue(APIRequest request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Register(IOnlineComponent component)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
34
osu.Game/Online/API/IAPIProvider.cs
Normal file
34
osu.Game/Online/API/IAPIProvider.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework;
|
||||||
|
using osu.Framework.Configuration;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
|
namespace osu.Game.Online.API
|
||||||
|
{
|
||||||
|
public interface IAPIProvider : IUpdateable
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The local user.
|
||||||
|
/// </summary>
|
||||||
|
Bindable<User> LocalUser { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns whether the local user is logged in.
|
||||||
|
/// </summary>
|
||||||
|
bool IsLoggedIn { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Queue a new request.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request">The request to perform.</param>
|
||||||
|
void Queue(APIRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Register a component to receive state changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="component">The component to register.</param>
|
||||||
|
void Register(IOnlineComponent component);
|
||||||
|
}
|
||||||
|
}
|
@ -108,6 +108,7 @@ namespace osu.Game
|
|||||||
Username = LocalConfig.Get<string>(OsuSetting.Username),
|
Username = LocalConfig.Get<string>(OsuSetting.Username),
|
||||||
Token = LocalConfig.Get<string>(OsuSetting.Token)
|
Token = LocalConfig.Get<string>(OsuSetting.Token)
|
||||||
});
|
});
|
||||||
|
dependencies.CacheAs<IAPIProvider>(API);
|
||||||
|
|
||||||
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));
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
|
|||||||
this.capturedObjects = capturedObjects;
|
this.capturedObjects = capturedObjects;
|
||||||
|
|
||||||
Masking = true;
|
Masking = true;
|
||||||
BorderThickness = 3;
|
BorderThickness = SelectionBox.BORDER_RADIUS;
|
||||||
|
|
||||||
InternalChild = new Box
|
InternalChild = new Box
|
||||||
{
|
{
|
||||||
|
@ -14,32 +14,21 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class SelectionBox : VisibilityContainer
|
public class SelectionBox : VisibilityContainer
|
||||||
{
|
{
|
||||||
|
public const float BORDER_RADIUS = 2;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="SelectionBox"/>.
|
/// Creates a new <see cref="SelectionBox"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SelectionBox()
|
public SelectionBox()
|
||||||
{
|
{
|
||||||
InternalChildren = new Drawable[]
|
Masking = true;
|
||||||
|
BorderColour = Color4.White;
|
||||||
|
BorderThickness = BORDER_RADIUS;
|
||||||
|
|
||||||
|
Child = new Box
|
||||||
{
|
{
|
||||||
new Container
|
RelativeSizeAxes = Axes.Both,
|
||||||
{
|
Alpha = 0.1f
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Padding = new MarginPadding(-1),
|
|
||||||
Child = new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Masking = true,
|
|
||||||
BorderColour = Color4.White,
|
|
||||||
BorderThickness = 2,
|
|
||||||
MaskingSmoothness = 1,
|
|
||||||
Child = new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Alpha = 0.1f,
|
|
||||||
AlwaysPresent = true
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,6 +290,8 @@
|
|||||||
<Compile Include="IO\Archives\ArchiveReader.cs" />
|
<Compile Include="IO\Archives\ArchiveReader.cs" />
|
||||||
<Compile Include="IO\Archives\LegacyFilesystemReader.cs" />
|
<Compile Include="IO\Archives\LegacyFilesystemReader.cs" />
|
||||||
<Compile Include="IO\Archives\ZipArchiveReader.cs" />
|
<Compile Include="IO\Archives\ZipArchiveReader.cs" />
|
||||||
|
<Compile Include="Online\API\DummyAPIAccess.cs" />
|
||||||
|
<Compile Include="Online\API\IAPIProvider.cs" />
|
||||||
<Compile Include="Online\API\APIDownloadRequest.cs" />
|
<Compile Include="Online\API\APIDownloadRequest.cs" />
|
||||||
<Compile Include="Online\API\Requests\GetUserRequest.cs" />
|
<Compile Include="Online\API\Requests\GetUserRequest.cs" />
|
||||||
<Compile Include="Migrations\20180125143340_Settings.cs" />
|
<Compile Include="Migrations\20180125143340_Settings.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user