Merge branch 'master' into cancel-select-random

This commit is contained in:
Dan Balasescu
2017-06-14 14:11:45 +09:00
committed by GitHub
82 changed files with 594 additions and 359 deletions

View File

@ -31,6 +31,10 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.17.1.0" newVersion="0.17.1.0" />
</dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
</configuration> </configuration>

View File

@ -49,10 +49,6 @@
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath> <HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\ICSharpCode.SharpZipLib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL"> <Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll</HintPath> <HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll</HintPath>
<Private>True</Private> <Private>True</Private>
@ -73,15 +69,19 @@
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll</HintPath> <HintPath>$(SolutionDir)\packages\squirrel.windows.1.7.5\lib\Net45\NuGet.Squirrel.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SharpCompress, Version=0.17.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\SharpCompress.0.17.1\lib\net45\SharpCompress.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Splat, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Splat, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll</HintPath> <HintPath>$(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Squirrel, Version=1.5.2.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Squirrel, Version=1.7.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll</HintPath> <HintPath>$(SolutionDir)\packages\squirrel.windows.1.7.5\lib\Net45\Squirrel.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />

View File

@ -7,7 +7,8 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net452" /> <package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net452" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net452" /> <package id="Mono.Cecil" version="0.9.6.4" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" /> <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
<package id="NuGet.CommandLine" version="3.5.0" targetFramework="net452" developmentDependency="true" /> <package id="NuGet.CommandLine" version="4.1.0" targetFramework="net452" developmentDependency="true" />
<package id="SharpCompress" version="0.17.1" targetFramework="net452" />
<package id="Splat" version="2.0.0" targetFramework="net452" /> <package id="Splat" version="2.0.0" targetFramework="net452" />
<package id="squirrel.windows" version="1.5.2" targetFramework="net452" /> <package id="squirrel.windows" version="1.7.5" targetFramework="net452" />
</packages> </packages>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -37,8 +37,9 @@
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=3.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath> <HintPath>$(SolutionDir)\packages\NUnit.3.7.1\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -100,6 +101,7 @@
<None Include="..\osu.licenseheader"> <None Include="..\osu.licenseheader">
<Link>osu.licenseheader</Link> <Link>osu.licenseheader</Link>
</None> </None>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -5,7 +5,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
--> -->
<packages> <packages>
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" /> <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
<package id="NUnit" version="3.6.1" targetFramework="net45" /> <package id="NUnit" version="3.7.1" targetFramework="net45" />
<package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="net45" /> <package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="net45" />
<package id="SQLite.Net-PCL" version="3.1.1" targetFramework="net45" /> <package id="SQLite.Net-PCL" version="3.1.1" targetFramework="net45" />
<package id="SQLiteNetExtensions" version="1.3.0" targetFramework="net45" /> <package id="SQLiteNetExtensions" version="1.3.0" targetFramework="net45" />

View File

@ -0,0 +1,125 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Testing;
using osu.Game.Graphics.UserInterface;
namespace osu.Desktop.VisualTests.Tests
{
internal class TestCaseContextMenu : TestCase
{
public override string Description => @"Menu visible on right click";
private const int start_time = 0;
private const int duration = 1000;
private MyContextMenuContainer container;
public override void Reset()
{
base.Reset();
Add(container = new MyContextMenuContainer
{
Size = new Vector2(200),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Green,
}
}
});
Add(new AnotherContextMenuContainer
{
Size = new Vector2(200),
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Red,
}
}
});
container.Transforms.Add(new TransformPosition
{
StartValue = Vector2.Zero,
EndValue = new Vector2(0, 100),
StartTime = start_time,
EndTime = start_time + duration,
LoopCount = -1,
LoopDelay = duration * 3
});
container.Transforms.Add(new TransformPosition
{
StartValue = new Vector2(0, 100),
EndValue = new Vector2(100, 100),
StartTime = start_time + duration,
EndTime = start_time + duration * 2,
LoopCount = -1,
LoopDelay = duration * 3
});
container.Transforms.Add(new TransformPosition
{
StartValue = new Vector2(100, 100),
EndValue = new Vector2(100, 0),
StartTime = start_time + duration * 2,
EndTime = start_time + duration * 3,
LoopCount = -1,
LoopDelay = duration * 3
});
container.Transforms.Add(new TransformPosition
{
StartValue = new Vector2(100, 0),
EndValue = Vector2.Zero,
StartTime = start_time + duration * 3,
EndTime = start_time + duration * 4,
LoopCount = -1,
LoopDelay = duration * 3
});
}
private class MyContextMenuContainer : Container, IHasContextMenu
{
public ContextMenuItem[] ContextMenuItems => new ContextMenuItem[]
{
new OsuContextMenuItem(@"Some option"),
new OsuContextMenuItem(@"Highlighted option", MenuItemType.Highlighted),
new OsuContextMenuItem(@"Another option"),
new OsuContextMenuItem(@"Choose me please"),
new OsuContextMenuItem(@"And me too"),
new OsuContextMenuItem(@"Trying to fill"),
new OsuContextMenuItem(@"Destructive option", MenuItemType.Destructive),
};
}
private class AnotherContextMenuContainer : Container, IHasContextMenu
{
public ContextMenuItem[] ContextMenuItems => new ContextMenuItem[]
{
new OsuContextMenuItem(@"Simple option"),
new OsuContextMenuItem(@"Simple very very long option"),
new OsuContextMenuItem(@"Change width", MenuItemType.Highlighted) { Action = () => ResizeWidthTo(Width * 2, 100, EasingTypes.OutQuint) },
new OsuContextMenuItem(@"Change height", MenuItemType.Highlighted) { Action = () => ResizeHeightTo(Height * 2, 100, EasingTypes.OutQuint) },
new OsuContextMenuItem(@"Change width back", MenuItemType.Destructive) { Action = () => ResizeWidthTo(Width / 2, 100, EasingTypes.OutQuint) },
new OsuContextMenuItem(@"Change height back", MenuItemType.Destructive) { Action = () => ResizeHeightTo(Height / 2, 100, EasingTypes.OutQuint) },
};
}
}
}

View File

@ -87,11 +87,13 @@
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL"> <Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll</HintPath> <HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SharpCompress, Version=0.15.2.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL"> <Reference Include="SharpCompress, Version=0.17.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\SharpCompress.0.15.2\lib\net45\SharpCompress.dll</HintPath> <HintPath>$(SolutionDir)\packages\SharpCompress.0.17.1\lib\net45\SharpCompress.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -187,6 +189,7 @@
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Tests\TestCaseChatDisplay.cs" /> <Compile Include="Tests\TestCaseChatDisplay.cs" />
<Compile Include="Tests\TestCaseBeatmapDetails.cs" /> <Compile Include="Tests\TestCaseBeatmapDetails.cs" />
<Compile Include="Tests\TestCaseContextMenu.cs" />
<Compile Include="Tests\TestCaseDrawings.cs" /> <Compile Include="Tests\TestCaseDrawings.cs" />
<Compile Include="Tests\TestCaseGamefield.cs" /> <Compile Include="Tests\TestCaseGamefield.cs" />
<Compile Include="Tests\TestCaseGraph.cs" /> <Compile Include="Tests\TestCaseGraph.cs" />

View File

@ -5,8 +5,8 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
--> -->
<packages> <packages>
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" /> <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1341" targetFramework="net45" /> <package id="ppy.OpenTK" version="3.0" targetFramework="net45" />
<package id="SharpCompress" version="0.15.2" targetFramework="net45" /> <package id="SharpCompress" version="0.17.1" targetFramework="net45" />
<package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="net45" /> <package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="net45" />
<package id="SQLite.Net-PCL" version="3.1.1" targetFramework="net45" /> <package id="SQLite.Net-PCL" version="3.1.1" targetFramework="net45" />
<package id="SQLiteNetExtensions" version="1.3.0" targetFramework="net45" /> <package id="SQLiteNetExtensions" version="1.3.0" targetFramework="net45" />

View File

@ -121,18 +121,23 @@
</Reference> </Reference>
<Reference Include="mscorlib" /> <Reference Include="mscorlib" />
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll</HintPath> <HintPath>$(SolutionDir)\packages\squirrel.windows.1.7.5\lib\Net45\NuGet.Squirrel.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL"> <Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll</HintPath> <HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SharpCompress, Version=0.17.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\SharpCompress.0.17.1\lib\net45\SharpCompress.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Splat, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Splat, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll</HintPath> <HintPath>$(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Squirrel, Version=1.5.2.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Squirrel, Version=1.7.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll</HintPath> <HintPath>$(SolutionDir)\packages\squirrel.windows.1.7.5\lib\Net45\Squirrel.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />

View File

@ -7,7 +7,8 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net45" /> <package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" /> <package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net45" /> <package id="Mono.Cecil" version="0.9.6.4" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1341" targetFramework="net45" /> <package id="ppy.OpenTK" version="3.0" targetFramework="net45" />
<package id="SharpCompress" version="0.17.1" targetFramework="net45" />
<package id="Splat" version="2.0.0" targetFramework="net45" /> <package id="Splat" version="2.0.0" targetFramework="net45" />
<package id="squirrel.windows" version="1.5.2" targetFramework="net45" /> <package id="squirrel.windows" version="1.7.5" targetFramework="net45" />
</packages> </packages>

View File

@ -33,8 +33,9 @@
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL"> <Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll</HintPath> <HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />

View File

@ -5,5 +5,5 @@ Copyright (c) 2007-2017 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
--> -->
<packages> <packages>
<package id="ppy.OpenTK" version="2.0.50727.1341" targetFramework="net45" /> <package id="ppy.OpenTK" version="3.0" targetFramework="net45" />
</packages> </packages>

View File

@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
{ {
base.AccentColour = value; base.AccentColour = value;
glowContainer.EdgeEffect = new EdgeEffect glowContainer.EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Radius = 2f, Radius = 2f,

View File

@ -171,14 +171,14 @@ namespace osu.Game.Rulesets.Mania.UI
background.Colour = accentColour; background.Colour = accentColour;
hitTargetBar.EdgeEffect = new EdgeEffect hitTargetBar.EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Radius = 5, Radius = 5,
Colour = accentColour.Opacity(0.5f), Colour = accentColour.Opacity(0.5f),
}; };
keyIcon.EdgeEffect = new EdgeEffect keyIcon.EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Radius = 5, Radius = 5,

View File

@ -33,8 +33,9 @@
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL"> <Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll</HintPath> <HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />

View File

@ -5,5 +5,5 @@ Copyright (c) 2007-2017 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
--> -->
<packages> <packages>
<package id="ppy.OpenTK" version="2.0.50727.1341" targetFramework="net45" /> <package id="ppy.OpenTK" version="3.0" targetFramework="net45" />
</packages> </packages>

View File

@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
Masking = true; Masking = true;
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
CornerRadius = width / 2; CornerRadius = width / 2;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Colour = Color4.White.Opacity(0.2f), Colour = Color4.White.Opacity(0.2f),

View File

@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
Masking = true, Masking = true,
Origin = Anchor.Centre, Origin = Anchor.Centre,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Radius = 60, Radius = 60,

View File

@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
Disc.Colour = value; Disc.Colour = value;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Hollow = true, Hollow = true,
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
Colour = Color4.Black, Colour = Color4.Black,
Alpha = 0.4f, Alpha = 0.4f,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Radius = 10, Radius = 10,

View File

@ -34,8 +34,9 @@
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL"> <Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll</HintPath> <HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />

View File

@ -5,5 +5,5 @@ Copyright (c) 2007-2017 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
--> -->
<packages> <packages>
<package id="ppy.OpenTK" version="2.0.50727.1341" targetFramework="net45" /> <package id="ppy.OpenTK" version="3.0" targetFramework="net45" />
</packages> </packages>

View File

@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
private void resetEdgeEffects() private void resetEdgeEffects()
{ {
background.EdgeEffect = new EdgeEffect background.EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Colour = AccentColour.Opacity(KiaiMode ? edge_alpha_kiai : 1f), Colour = AccentColour.Opacity(KiaiMode ? edge_alpha_kiai : 1f),

View File

@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Taiko.UI
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Colour = isRim ? colours.BlueDarker : colours.PinkDarker, Colour = isRim ? colours.BlueDarker : colours.PinkDarker,

View File

@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Taiko.UI
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
BorderThickness = 2, BorderThickness = 2,
Masking = true, Masking = true,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.2f), Colour = Color4.Black.Opacity(0.2f),

View File

@ -33,8 +33,9 @@
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL"> <Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll</HintPath> <HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />

View File

@ -4,5 +4,5 @@ Copyright (c) 2007-2017 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
--> -->
<packages> <packages>
<package id="ppy.OpenTK" version="2.0.50727.1341" targetFramework="net45" /> <package id="ppy.OpenTK" version="3.0" targetFramework="net45" />
</packages> </packages>

View File

@ -30,11 +30,13 @@
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=3.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath> <HintPath>$(SolutionDir)\packages\NUnit.3.7.1\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL"> <Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll</HintPath> <HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="SQLite.Net"> <Reference Include="SQLite.Net">

View File

@ -4,8 +4,8 @@ Copyright (c) 2007-2017 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
--> -->
<packages> <packages>
<package id="NUnit" version="3.6.1" targetFramework="net45" /> <package id="NUnit" version="3.7.1" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1341" targetFramework="net45" /> <package id="ppy.OpenTK" version="3.0" targetFramework="net45" />
<package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="net45" /> <package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="net45" />
<package id="SQLite.Net-PCL" version="3.1.1" targetFramework="net45" /> <package id="SQLite.Net-PCL" version="3.1.1" targetFramework="net45" />
</packages> </packages>

View File

@ -88,7 +88,7 @@ namespace osu.Game.Beatmaps.Drawables
protected virtual void Selected() protected virtual void Selected()
{ {
nestedContainer.BorderThickness = 2.5f; nestedContainer.BorderThickness = 2.5f;
nestedContainer.EdgeEffect = new EdgeEffect nestedContainer.EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Colour = new Color4(130, 204, 255, 150), Colour = new Color4(130, 204, 255, 150),
@ -100,7 +100,7 @@ namespace osu.Game.Beatmaps.Drawables
protected virtual void Deselected() protected virtual void Deselected()
{ {
nestedContainer.BorderThickness = 0; nestedContainer.BorderThickness = 0;
nestedContainer.EdgeEffect = new EdgeEffect nestedContainer.EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Offset = new Vector2(1), Offset = new Vector2(1),

View File

@ -67,7 +67,7 @@ namespace osu.Game.Graphics.Cursor
Masking = true, Masking = true,
BorderThickness = Size.X / 6, BorderThickness = Size.X / 6,
BorderColour = Color4.White, BorderColour = Color4.White,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Pink.Opacity(0.5f), Colour = Color4.Pink.Opacity(0.5f),

View File

@ -0,0 +1,18 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Graphics.Cursor
{
public class OsuContextMenuContainer : ContextMenuContainer
{
protected override ContextMenu<ContextMenuItem> CreateContextMenu() => new OsuContextMenu<ContextMenuItem>();
public OsuContextMenuContainer(CursorContainer cursor) : base(cursor)
{
}
}
}

View File

@ -1,129 +0,0 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Game.Configuration;
using System;
namespace osu.Game.Graphics.Cursor
{
public class OsuCursorContainer : CursorContainer
{
protected override Drawable CreateCursor() => new OsuCursor();
public OsuCursorContainer()
{
Add(new CursorTrail { Depth = 1 });
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
ActiveCursor.Scale = new Vector2(1);
ActiveCursor.ScaleTo(1.2f, 100, EasingTypes.OutQuad);
return base.OnMouseDown(state, args);
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
if (!state.Mouse.HasMainButtonPressed)
ActiveCursor.ScaleTo(1, 200, EasingTypes.OutQuad);
return base.OnMouseUp(state, args);
}
public class OsuCursor : Container
{
private Container cursorContainer;
private Bindable<double> cursorScale;
public OsuCursor()
{
Origin = Anchor.Centre;
Size = new Vector2(42);
}
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
cursorScale = config.GetBindable<double>(OsuConfig.CursorSize);
Children = new Drawable[]
{
cursorContainer = new CircularContainer
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Scale = new Vector2((float)cursorScale),
Masking = true,
BorderThickness = Size.X / 6,
BorderColour = Color4.White,
EdgeEffect = new EdgeEffect {
Type = EdgeEffectType.Shadow,
Colour = Color4.Pink.Opacity(0.5f),
Radius = 5,
},
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true,
},
new CircularContainer
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = Size.X / 3,
BorderColour = Color4.White.Opacity(0.5f),
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true,
},
},
},
new CircularContainer
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Scale = new Vector2(0.1f),
Masking = true,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White,
},
},
},
}
},
};
cursorScale.ValueChanged += scaleChanged;
}
private void scaleChanged(object sender, EventArgs e)
{
cursorContainer.Scale = new Vector2((float)cursorScale);
}
}
}
}

View File

@ -52,7 +52,7 @@ namespace osu.Game.Graphics.Cursor
CornerRadius = 5; CornerRadius = 5;
Masking = true; Masking = true;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(40), Colour = Color4.Black.Opacity(40),

View File

@ -87,5 +87,7 @@ namespace osu.Game.Graphics
public readonly Color4 RedDarker = FromHex(@"870000"); public readonly Color4 RedDarker = FromHex(@"870000");
public readonly Color4 ChatBlue = FromHex(@"17292e"); public readonly Color4 ChatBlue = FromHex(@"17292e");
public readonly Color4 ContextMenuGray = FromHex(@"223034");
} }
} }

View File

@ -222,7 +222,7 @@ namespace osu.Game.Graphics.UserInterface
Width = 0.8f, Width = 0.8f,
Masking = true, Masking = true,
MaskingSmoothness = 2, MaskingSmoothness = 2,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.2f), Colour = Color4.Black.Opacity(0.2f),

View File

@ -50,7 +50,7 @@ namespace osu.Game.Graphics.UserInterface
CornerRadius = 5, CornerRadius = 5,
Masking = true, Masking = true,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Colour = Color4.Black.Opacity(0.04f), Colour = Color4.Black.Opacity(0.04f),
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,

View File

@ -1,15 +1,48 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 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.Graphics.Sprites; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using OpenTK;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
public class LoadingAnimation : SpriteText public class LoadingAnimation : VisibilityContainer
{ {
private readonly TextAwesome spinner;
public LoadingAnimation() public LoadingAnimation()
{ {
Text = "Loading"; Size = new Vector2(20);
}
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Children = new Drawable[]
{
spinner = new TextAwesome
{
TextSize = 20,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Icon = FontAwesome.fa_spinner
}
};
}
protected override void LoadComplete()
{
base.LoadComplete();
spinner.RotateTo(360, 2000);
using (spinner.BeginDelayedSequence(2000))
spinner.Loop();
}
private const float transition_duration = 500;
protected override void PopIn() => FadeIn(transition_duration * 5, EasingTypes.OutQuint);
protected override void PopOut() => FadeOut(transition_duration, EasingTypes.OutQuint);
} }
} }

View File

@ -0,0 +1,12 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Graphics.UserInterface
{
public enum MenuItemType
{
Standard,
Highlighted,
Destructive,
}
}

View File

@ -56,7 +56,7 @@ namespace osu.Game.Graphics.UserInterface
GlowingAccentColour = colours.PinkLighter; GlowingAccentColour = colours.PinkLighter;
GlowColour = colours.PinkDarker; GlowColour = colours.PinkDarker;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Colour = GlowColour, Colour = GlowColour,
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,

View File

@ -0,0 +1,52 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
namespace osu.Game.Graphics.UserInterface
{
public class OsuContextMenu<TItem> : ContextMenu<TItem>
where TItem : ContextMenuItem
{
protected override Menu<TItem> CreateMenu() => new CustomMenu();
public class CustomMenu : Menu<TItem>
{
private const int fade_duration = 250;
public CustomMenu()
{
CornerRadius = 5;
ItemsContainer.Padding = new MarginPadding { Vertical = OsuContextMenuItem.MARGIN_VERTICAL };
Masking = true;
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.1f),
Radius = 4,
};
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Background.Colour = colours.ContextMenuGray;
}
protected override void AnimateOpen() => FadeIn(fade_duration, EasingTypes.OutQuint);
protected override void AnimateClose() => FadeOut(fade_duration, EasingTypes.OutQuint);
protected override void UpdateContentHeight()
{
var actualHeight = (RelativeSizeAxes & Axes.Y) > 0 ? 1 : ContentHeight;
ResizeTo(new Vector2(1, State == MenuState.Opened ? actualHeight : 0), 300, EasingTypes.OutQuint);
}
}
}
}

View File

@ -0,0 +1,114 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Graphics.UserInterface
{
public class OsuContextMenuItem : ContextMenuItem
{
private const int transition_length = 80;
private const int margin_horizontal = 17;
public const int MARGIN_VERTICAL = 4;
private const int text_size = 17;
private OsuSpriteText text;
private OsuSpriteText textBold;
private SampleChannel sampleClick;
private SampleChannel sampleHover;
private readonly MenuItemType type;
protected override Container CreateTextContainer(string title) => new Container
{
AutoSizeAxes = Axes.Both,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Children = new Drawable[]
{
text = new OsuSpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
TextSize = text_size,
Text = title,
Margin = new MarginPadding { Horizontal = margin_horizontal, Vertical = MARGIN_VERTICAL },
},
textBold = new OsuSpriteText
{
AlwaysPresent = true,
Alpha = 0,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
TextSize = text_size,
Text = title,
Font = @"Exo2.0-Bold",
Margin = new MarginPadding { Horizontal = margin_horizontal, Vertical = MARGIN_VERTICAL },
}
}
};
public OsuContextMenuItem(string title, MenuItemType type = MenuItemType.Standard) : base(title)
{
this.type = type;
}
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
sampleHover = audio.Sample.Get(@"Menu/menuclick");
sampleClick = audio.Sample.Get(@"Menu/menuback");
BackgroundColour = Color4.Transparent;
BackgroundColourHover = OsuColour.FromHex(@"172023");
updateTextColour();
}
private void updateTextColour()
{
switch (type)
{
case MenuItemType.Standard:
textBold.Colour = text.Colour = Color4.White;
break;
case MenuItemType.Destructive:
textBold.Colour = text.Colour = Color4.Red;
break;
case MenuItemType.Highlighted:
textBold.Colour = text.Colour = OsuColour.FromHex(@"ffcc22");
break;
}
}
protected override bool OnHover(InputState state)
{
sampleHover.Play();
textBold.FadeIn(transition_length, EasingTypes.OutQuint);
text.FadeOut(transition_length, EasingTypes.OutQuint);
return base.OnHover(state);
}
protected override void OnHoverLost(InputState state)
{
textBold.FadeOut(transition_length, EasingTypes.OutQuint);
text.FadeIn(transition_length, EasingTypes.OutQuint);
base.OnHoverLost(state);
}
protected override bool OnClick(InputState state)
{
sampleClick.Play();
return base.OnClick(state);
}
}
}

View File

@ -74,21 +74,6 @@ namespace osu.Game.Graphics.UserInterface
} }
} }
public override bool Active
{
get { return base.Active; }
set
{
if (Active == value) return;
if (value)
fadeActive();
else
fadeInactive();
base.Active = value;
}
}
private const float transition_length = 500; private const float transition_length = 500;
private void fadeActive() private void fadeActive()
@ -150,6 +135,10 @@ namespace osu.Game.Graphics.UserInterface
} }
}; };
} }
protected override void OnActivated() => fadeActive();
protected override void OnDeactivated() => fadeInactive();
} }
private class OsuTabDropdown : OsuDropdown<T> private class OsuTabDropdown : OsuDropdown<T>

View File

@ -29,21 +29,6 @@ namespace osu.Game.Graphics.UserInterface
private readonly Box box; private readonly Box box;
public override bool Active
{
get { return base.Active; }
set
{
if (Active == value) return;
if (value)
slideActive();
else
slideInactive();
base.Active = value;
}
}
public PageTabItem(T value) : base(value) public PageTabItem(T value) : base(value)
{ {
AutoSizeAxes = Axes.X; AutoSizeAxes = Axes.X;
@ -100,6 +85,10 @@ namespace osu.Game.Graphics.UserInterface
{ {
box.ScaleTo(new Vector2(1f, 0f), transition_duration); box.ScaleTo(new Vector2(1f, 0f), transition_duration);
} }
protected override void OnActivated() => slideActive();
protected override void OnDeactivated() => slideInactive();
} }
} }
} }

View File

@ -79,18 +79,21 @@ namespace osu.Game.Graphics.UserInterface
Width = 0.4f, Width = 0.4f,
Children = new Drawable[] Children = new Drawable[]
{ {
new Container { new Container
{
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Shear = new Vector2(shear, 0), Shear = new Vector2(shear, 0),
Masking = true, Masking = true,
MaskingSmoothness = 2, MaskingSmoothness = 2,
EdgeEffect = new EdgeEffect { EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.2f), Colour = Color4.Black.Opacity(0.2f),
Offset = new Vector2(2, 0), Offset = new Vector2(2, 0),
Radius = 2, Radius = 2,
}, },
Children = new[] { Children = new[]
{
IconLayer = new Box IconLayer = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -113,18 +116,21 @@ namespace osu.Game.Graphics.UserInterface
Width = 0.6f, Width = 0.6f,
Children = new Drawable[] Children = new Drawable[]
{ {
new Container { new Container
{
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Shear = new Vector2(shear, 0), Shear = new Vector2(shear, 0),
Masking = true, Masking = true,
MaskingSmoothness = 2, MaskingSmoothness = 2,
EdgeEffect = new EdgeEffect { EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.2f), Colour = Color4.Black.Opacity(0.2f),
Offset = new Vector2(2, 0), Offset = new Vector2(2, 0),
Radius = 2, Radius = 2,
}, },
Children = new[] { Children = new[]
{
TextLayer = new Box TextLayer = new Box
{ {
Origin = Anchor.TopLeft, Origin = Anchor.TopLeft,

View File

@ -158,6 +158,7 @@ namespace osu.Game
Children = new Drawable[] Children = new Drawable[]
{ {
Cursor = new MenuCursor(), Cursor = new MenuCursor(),
new OsuContextMenuContainer(Cursor) { Depth = -2 },
new OsuTooltipContainer(Cursor) { Depth = -1 }, new OsuTooltipContainer(Cursor) { Depth = -1 },
} }
}, },

View File

@ -26,6 +26,8 @@ namespace osu.Game.Overlays.Chat
public readonly Bindable<bool> ChannelSelectorActive = new Bindable<bool>(); public readonly Bindable<bool> ChannelSelectorActive = new Bindable<bool>();
private readonly ChannelTabItem.ChannelSelectorTabItem selectorTab;
public ChatTabControl() public ChatTabControl()
{ {
TabContainer.Margin = new MarginPadding { Left = 50 }; TabContainer.Margin = new MarginPadding { Left = 50 };
@ -41,7 +43,22 @@ namespace osu.Game.Overlays.Chat
Padding = new MarginPadding(10), Padding = new MarginPadding(10),
}); });
AddTabItem(new ChannelTabItem.ChannelSelectorTabItem(new Channel { Name = "+" }, ChannelSelectorActive)); AddTabItem(selectorTab = new ChannelTabItem.ChannelSelectorTabItem(new Channel { Name = "+" }));
ChannelSelectorActive.BindTo(selectorTab.Active);
}
protected override void SelectTab(TabItem<Channel> tab)
{
if (tab is ChannelTabItem.ChannelSelectorTabItem)
{
tab.Active.Toggle();
return;
}
selectorTab.Active.Value = false;
base.SelectTab(tab);
} }
private class ChannelTabItem : TabItem<Channel> private class ChannelTabItem : TabItem<Channel>
@ -56,18 +73,6 @@ namespace osu.Game.Overlays.Chat
private readonly Box highlightBox; private readonly Box highlightBox;
private readonly TextAwesome icon; private readonly TextAwesome icon;
public override bool Active
{
get { return base.Active; }
set
{
if (Active == value) return;
base.Active = value;
updateState();
}
}
private void updateState() private void updateState()
{ {
if (Active) if (Active)
@ -141,7 +146,7 @@ namespace osu.Game.Overlays.Chat
Shear = new Vector2(shear_width / ChatOverlay.TAB_AREA_HEIGHT, 0); Shear = new Vector2(shear_width / ChatOverlay.TAB_AREA_HEIGHT, 0);
Masking = true; Masking = true;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Radius = 10, Radius = 10,
@ -205,28 +210,8 @@ namespace osu.Game.Overlays.Chat
public class ChannelSelectorTabItem : ChannelTabItem public class ChannelSelectorTabItem : ChannelTabItem
{ {
public override bool Active public ChannelSelectorTabItem(Channel value) : base(value)
{ {
get { return false; }
// ReSharper disable once ValueParameterNotUsed
set
{
// we basically never want this tab to become active.
// this allows us to become a "toggle" tab.
// is a bit hacky, to say the least.
activeBindable.Value = !activeBindable.Value;
base.Active = false;
}
}
private readonly Bindable<bool> activeBindable;
public ChannelSelectorTabItem(Channel value, Bindable<bool> active) : base(value)
{
activeBindable = active;
activeBindable.ValueChanged += v => selectorUpdateState();
Depth = float.MaxValue; Depth = float.MaxValue;
Width = 45; Width = 45;
@ -242,27 +227,11 @@ namespace osu.Game.Overlays.Chat
backgroundInactive = colour.Gray2; backgroundInactive = colour.Gray2;
backgroundActive = colour.Gray3; backgroundActive = colour.Gray3;
} }
protected override void LoadComplete()
{
base.LoadComplete();
selectorUpdateState();
} }
protected override void OnHoverLost(InputState state) protected override void OnActivated() => updateState();
{
selectorUpdateState();
}
private void selectorUpdateState() protected override void OnDeactivated() => updateState();
{
if (activeBindable.Value)
fadeActive();
else
fadeInactive();
}
}
} }
} }
} }

View File

@ -12,7 +12,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
@ -33,7 +32,9 @@ namespace osu.Game.Overlays
private ScheduledDelegate messageRequest; private ScheduledDelegate messageRequest;
private readonly Container currentChannelContainer; private readonly Container<DrawableChannel> currentChannelContainer;
private readonly LoadingAnimation loading;
private readonly FocusedTextBox inputTextBox; private readonly FocusedTextBox inputTextBox;
@ -104,7 +105,7 @@ namespace osu.Game.Overlays
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, },
currentChannelContainer = new Container currentChannelContainer = new Container<DrawableChannel>
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding Padding = new MarginPadding
@ -138,7 +139,8 @@ namespace osu.Game.Overlays
HoldFocus = true, HoldFocus = true,
} }
} }
} },
loading = new LoadingAnimation(),
} }
}, },
new Container new Container
@ -274,14 +276,7 @@ namespace osu.Game.Overlays
private void initializeChannels() private void initializeChannels()
{ {
SpriteText loading; loading.Show();
Add(loading = new OsuSpriteText
{
Text = @"initialising chat...",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
TextSize = 40,
});
messageRequest?.Cancel(); messageRequest?.Cancel();
@ -290,9 +285,6 @@ namespace osu.Game.Overlays
{ {
Scheduler.Add(delegate Scheduler.Add(delegate
{ {
loading.FadeOut(100);
loading.Expire();
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")); addChannel(channels.Find(c => c.Name == @"#lobby"));
@ -336,13 +328,17 @@ namespace osu.Game.Overlays
if (loaded == null) if (loaded == null)
{ {
currentChannelContainer.FadeOut(500, EasingTypes.OutQuint); currentChannelContainer.FadeOut(500, EasingTypes.OutQuint);
loading.Show();
loaded = new DrawableChannel(currentChannel); loaded = new DrawableChannel(currentChannel);
loadedChannels.Add(loaded); loadedChannels.Add(loaded);
LoadComponentAsync(loaded, l => LoadComponentAsync(loaded, l =>
{ {
if (currentChannel.Messages.Any())
loading.Hide();
currentChannelContainer.Clear(false); currentChannelContainer.Clear(false);
currentChannelContainer.Add(l); currentChannelContainer.Add(loaded);
currentChannelContainer.FadeIn(500, EasingTypes.OutQuint); currentChannelContainer.FadeIn(500, EasingTypes.OutQuint);
}); });
} }
@ -386,6 +382,7 @@ namespace osu.Game.Overlays
req.Success += delegate (List<Message> messages) req.Success += delegate (List<Message> messages)
{ {
loading.Hide();
channel.AddNewMessages(messages.ToArray()); channel.AddNewMessages(messages.ToArray());
Debug.Write("success!"); Debug.Write("success!");
}; };

View File

@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Dialog
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Masking = true, Masking = true,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.5f), Colour = Color4.Black.Opacity(0.5f),

View File

@ -29,7 +29,7 @@ namespace osu.Game.Overlays
State = Visibility.Visible; State = Visibility.Visible;
} }
private void onDialogOnStateChanged(OverlayContainer dialog, Visibility v) private void onDialogOnStateChanged(VisibilityContainer dialog, Visibility v)
{ {
if (v != Visibility.Hidden) return; if (v != Visibility.Hidden) return;

View File

@ -30,7 +30,7 @@ namespace osu.Game.Overlays.Direct
CornerRadius = 4; CornerRadius = 4;
Masking = true; Masking = true;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Offset = new Vector2(0f, 1f), Offset = new Vector2(0f, 1f),

View File

@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Direct
Height = height; Height = height;
CornerRadius = 5; CornerRadius = 5;
Masking = true; Masking = true;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Offset = new Vector2(0f, 1f), Offset = new Vector2(0f, 1f),

View File

@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Music
Icon.TextSize = 14; Icon.TextSize = 14;
Icon.Margin = new MarginPadding(0); Icon.Margin = new MarginPadding(0);
Foreground.Padding = new MarginPadding { Top = 4, Bottom = 4, Left = 10, Right = 10 }; Foreground.Padding = new MarginPadding { Top = 4, Bottom = 4, Left = 10, Right = 10 };
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.3f), Colour = Color4.Black.Opacity(0.3f),
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Music
public CollectionsMenu() public CollectionsMenu()
{ {
CornerRadius = 5; CornerRadius = 5;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.3f), Colour = Color4.Black.Opacity(0.3f),

View File

@ -52,7 +52,7 @@ namespace osu.Game.Overlays.Music
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
CornerRadius = 5, CornerRadius = 5,
Masking = true, Masking = true,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(40), Colour = Color4.Black.Opacity(40),

View File

@ -106,7 +106,7 @@ namespace osu.Game.Overlays
Height = player_height, Height = player_height,
Masking = true, Masking = true,
CornerRadius = 5, CornerRadius = 5,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(40), Colour = Color4.Black.Opacity(40),

View File

@ -238,7 +238,7 @@ namespace osu.Game.Overlays.Notifications
set set
{ {
base.Colour = value; base.Colour = value;
pulsateLayer.EdgeEffect = new EdgeEffect pulsateLayer.EdgeEffect = new EdgeEffectParameters
{ {
Colour = ((Color4)value).Opacity(0.5f), //todo: avoid cast Colour = ((Color4)value).Opacity(0.5f), //todo: avoid cast
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,

View File

@ -253,7 +253,7 @@ namespace osu.Game.Overlays
Masking = true; Masking = true;
CornerRadius = 3; CornerRadius = 3;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Colour = colours.BlueDark.Opacity(glow_strength), Colour = colours.BlueDark.Opacity(glow_strength),
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,

View File

@ -290,7 +290,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
Margin = new MarginPadding { Bottom = 5 }; Margin = new MarginPadding { Bottom = 5 };
Masking = true; Masking = true;
CornerRadius = 5; CornerRadius = 5;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.25f), Colour = Color4.Black.Opacity(0.25f),
@ -326,7 +326,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
CornerRadius = 5; CornerRadius = 5;
ItemsContainer.Padding = new MarginPadding(0); ItemsContainer.Padding = new MarginPadding(0);
Masking = true; Masking = true;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.25f), Colour = Color4.Black.Opacity(0.25f),

View File

@ -9,6 +9,7 @@ using OpenTK.Graphics;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests;
using osu.Game.Overlays.SearchableList; using osu.Game.Overlays.SearchableList;
@ -29,6 +30,8 @@ namespace osu.Game.Overlays
protected override SearchableListFilterControl<SocialSortCriteria, SortDirection> CreateFilterControl() => new FilterControl(); protected override SearchableListFilterControl<SocialSortCriteria, SortDirection> CreateFilterControl() => new FilterControl();
private IEnumerable<User> users; private IEnumerable<User> users;
private readonly LoadingAnimation loading;
public IEnumerable<User> Users public IEnumerable<User> Users
{ {
get { return users; } get { return users; }
@ -68,6 +71,8 @@ namespace osu.Game.Overlays
Spacing = new Vector2(10f), Spacing = new Vector2(10f),
}, },
}; };
Add(loading = new LoadingAnimation());
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -83,8 +88,14 @@ namespace osu.Game.Overlays
// no this is not the correct data source, but it's something. // no this is not the correct data source, but it's something.
var request = new GetUsersRequest(); var request = new GetUsersRequest();
request.Success += res => Users = res.Select(e => e.User); request.Success += res =>
{
Users = res.Select(e => e.User);
loading.Hide();
};
api.Queue(request); api.Queue(request);
loading.Show();
} }
public void APIStateChanged(APIAccess api, APIState state) public void APIStateChanged(APIAccess api, APIState state)

View File

@ -172,7 +172,7 @@ namespace osu.Game.Overlays.Toolbar
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
Masking = true; Masking = true;
MaskingSmoothness = 0; MaskingSmoothness = 0;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(40), Colour = Color4.Black.Opacity(40),

View File

@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Toolbar
{ {
DrawableIcon.Colour = Color4.White; DrawableIcon.Colour = Color4.White;
DrawableIcon.Masking = true; DrawableIcon.Masking = true;
DrawableIcon.EdgeEffect = new EdgeEffect DrawableIcon.EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Colour = new Color4(255, 194, 224, 100), Colour = new Color4(255, 194, 224, 100),

View File

@ -46,7 +46,7 @@ namespace osu.Game.Overlays.Toolbar
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.TopLeft, Origin = Anchor.TopLeft,
Masking = true, Masking = true,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Colour = new Color4(255, 194, 224, 100), Colour = new Color4(255, 194, 224, 100),

View File

@ -45,7 +45,7 @@ namespace osu.Game.Overlays.Toolbar
stateContainer.StateChanged -= stateChanged; stateContainer.StateChanged -= stateChanged;
} }
private void stateChanged(OverlayContainer c, Visibility state) private void stateChanged(VisibilityContainer c, Visibility state)
{ {
switch (state) switch (state)
{ {

View File

@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Toolbar
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
CornerRadius = 4, CornerRadius = 4,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Radius = 4, Radius = 4,

View File

@ -173,7 +173,7 @@ namespace osu.Game.Overlays
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Width = 1.5f; Width = 1.5f;
Masking = true; Masking = true;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(50), Colour = Color4.Black.Opacity(50),

View File

@ -54,7 +54,7 @@ namespace osu.Game.Screens.Menu
{ {
Masking = true, Masking = true,
MaskingSmoothness = 2, MaskingSmoothness = 2,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.2f), Colour = Color4.Black.Opacity(0.2f),

View File

@ -47,7 +47,7 @@ namespace osu.Game.Screens.Multiplayer
Height = height; Height = height;
CornerRadius = 5; CornerRadius = 5;
Masking = true; Masking = true;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(40), Colour = Color4.Black.Opacity(40),

View File

@ -57,7 +57,7 @@ namespace osu.Game.Screens.Play.HUD
return; return;
glowColour = value; glowColour = value;
fill.EdgeEffect = new EdgeEffect fill.EdgeEffect = new EdgeEffectParameters
{ {
Colour = glowColour.Opacity(base_glow_opacity), Colour = glowColour.Opacity(base_glow_opacity),
Radius = 8, Radius = 8,

View File

@ -164,7 +164,7 @@ namespace osu.Game.Screens.Play
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Masking = true, Masking = true,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.6f), Colour = Color4.Black.Opacity(0.6f),

View File

@ -36,19 +36,6 @@ namespace osu.Game.Screens.Ranking
} }
} }
public override bool Active
{
get
{
return base.Active;
}
set
{
base.Active = value;
colouredPart.FadeColour(Active ? activeColour : inactiveColour, 200, EasingTypes.OutQuint);
}
}
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
@ -60,7 +47,7 @@ namespace osu.Game.Screens.Ranking
activeColour = colours.PinkDarker; activeColour = colours.PinkDarker;
inactiveColour = OsuColour.Gray(0.8f); inactiveColour = OsuColour.Gray(0.8f);
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Colour = Color4.Black.Opacity(0.4f), Colour = Color4.Black.Opacity(0.4f),
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
@ -104,5 +91,9 @@ namespace osu.Game.Screens.Ranking
} }
}; };
} }
protected override void OnActivated() => colouredPart.FadeColour(activeColour, 200, EasingTypes.OutQuint);
protected override void OnDeactivated() => colouredPart.FadeColour(inactiveColour, 200, EasingTypes.OutQuint);
} }
} }

View File

@ -134,7 +134,7 @@ namespace osu.Game.Screens.Ranking
circleOuter = new CircularContainer circleOuter = new CircularContainer
{ {
Size = new Vector2(circle_outer_scale), Size = new Vector2(circle_outer_scale),
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Colour = Color4.Black.Opacity(0.4f), Colour = Color4.Black.Opacity(0.4f),
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
@ -225,7 +225,7 @@ namespace osu.Game.Screens.Ranking
circleInner = new CircularContainer circleInner = new CircularContainer
{ {
Size = new Vector2(0.6f), Size = new Vector2(0.6f),
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Colour = Color4.Black.Opacity(0.4f), Colour = Color4.Black.Opacity(0.4f),
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,

View File

@ -50,7 +50,7 @@ namespace osu.Game.Screens.Ranking
}, },
new CircularContainer new CircularContainer
{ {
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Colour = colours.GrayF.Opacity(0.8f), Colour = colours.GrayF.Opacity(0.8f),
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
@ -74,7 +74,7 @@ namespace osu.Game.Screens.Ranking
}, },
content = new CircularContainer content = new CircularContainer
{ {
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Colour = Color4.Black.Opacity(0.2f), Colour = Color4.Black.Opacity(0.2f),
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,

View File

@ -89,6 +89,7 @@ namespace osu.Game.Screens.Select
lookup.Failure += e => updateMetrics(null); lookup.Failure += e => updateMetrics(null);
api.Queue(lookup); api.Queue(lookup);
loading.Show();
} }
updateMetrics(requestedBeatmap.Metrics, false); updateMetrics(requestedBeatmap.Metrics, false);
@ -104,6 +105,9 @@ namespace osu.Game.Screens.Select
var hasRatings = metrics?.Ratings.Any() ?? false; var hasRatings = metrics?.Ratings.Any() ?? false;
var hasRetriesFails = (metrics?.Retries.Any() ?? false) && metrics.Fails.Any(); var hasRetriesFails = (metrics?.Retries.Any() ?? false) && metrics.Fails.Any();
if (failOnMissing)
loading.Hide();
if (hasRatings) if (hasRatings)
{ {
var ratings = metrics.Ratings.ToList(); var ratings = metrics.Ratings.ToList();
@ -320,11 +324,13 @@ namespace osu.Game.Screens.Select
} }
}, },
}, },
} },
loading = new LoadingAnimation()
}; };
} }
private APIAccess api; private APIAccess api;
private readonly LoadingAnimation loading;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colour, APIAccess api) private void load(OsuColour colour, APIAccess api)

View File

@ -36,7 +36,7 @@ namespace osu.Game.Screens.Select
Masking = true; Masking = true;
BorderColour = new Color4(221, 255, 255, 255); BorderColour = new Color4(221, 255, 255, 255);
BorderThickness = 2.5f; BorderThickness = 2.5f;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Colour = new Color4(130, 204, 255, 150), Colour = new Color4(130, 204, 255, 150),

View File

@ -12,6 +12,7 @@ using System;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests;
@ -25,6 +26,8 @@ namespace osu.Game.Screens.Select.Leaderboards
public Action<Score> ScoreSelected; public Action<Score> ScoreSelected;
private readonly LoadingAnimation loading;
private IEnumerable<Score> scores; private IEnumerable<Score> scores;
public IEnumerable<Score> Scores public IEnumerable<Score> Scores
{ {
@ -86,6 +89,7 @@ namespace osu.Game.Screens.Select.Leaderboards
}, },
}, },
}, },
loading = new LoadingAnimation()
}; };
} }
@ -117,6 +121,7 @@ namespace osu.Game.Screens.Select.Leaderboards
} }
private GetScoresRequest getScoresRequest; private GetScoresRequest getScoresRequest;
private void updateScores() private void updateScores()
{ {
if (!IsLoaded) return; if (!IsLoaded) return;
@ -126,8 +131,14 @@ namespace osu.Game.Screens.Select.Leaderboards
if (api == null || Beatmap == null) return; if (api == null || Beatmap == null) return;
loading.Show();
getScoresRequest = new GetScoresRequest(Beatmap); getScoresRequest = new GetScoresRequest(Beatmap);
getScoresRequest.Success += r => Scores = r.Scores; getScoresRequest.Success += r =>
{
Scores = r.Scores;
loading.Hide();
};
api.Queue(getScoresRequest); api.Queue(getScoresRequest);
} }

View File

@ -147,7 +147,7 @@ namespace osu.Game.Screens.Select.Leaderboards
CornerRadius = corner_radius, CornerRadius = corner_radius,
Masking = true, Masking = true,
OnLoadComplete = d => d.FadeInFromZero(200), OnLoadComplete = d => d.FadeInFromZero(200),
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Radius = 1, Radius = 1,

View File

@ -99,7 +99,7 @@ namespace osu.Game.Screens.Select.Options
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Shear = new Vector2(0.2f, 0f), Shear = new Vector2(0.2f, 0f),
Masking = true, Masking = true,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.2f), Colour = Color4.Black.Opacity(0.2f),

View File

@ -34,7 +34,7 @@ namespace osu.Game.Users
Height = height - status_height; Height = height - status_height;
Masking = true; Masking = true;
CornerRadius = 5; CornerRadius = 5;
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.25f), Colour = Color4.Black.Opacity(0.25f),
@ -68,7 +68,7 @@ namespace osu.Game.Users
User = user, User = user,
Masking = true, Masking = true,
CornerRadius = 5, CornerRadius = 5,
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.25f), Colour = Color4.Black.Opacity(0.25f),

View File

@ -39,12 +39,13 @@
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL"> <Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1341\lib\net45\OpenTK.dll</HintPath> <HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SharpCompress, Version=0.15.2.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL"> <Reference Include="SharpCompress, Version=0.17.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath Condition="Exists('$(SolutionDir)\packages\sharpcompress.0.15.2')" >$(SolutionDir)\packages\sharpcompress.0.15.2\lib\net45\SharpCompress.dll</HintPath> <Private>True</Private>
<HintPath Condition="Exists('$(SolutionDir)\packages\SharpCompress.0.15.2')" >$(SolutionDir)\packages\SharpCompress.0.15.2\lib\net45\SharpCompress.dll</HintPath> <HintPath>$(SolutionDir)\packages\SharpCompress.0.17.1\lib\net45\SharpCompress.dll</HintPath>
</Reference> </Reference>
<Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
@ -75,8 +76,12 @@
<Compile Include="Audio\SampleInfo.cs" /> <Compile Include="Audio\SampleInfo.cs" />
<Compile Include="Audio\SampleInfoList.cs" /> <Compile Include="Audio\SampleInfoList.cs" />
<Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" /> <Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" />
<Compile Include="Beatmaps\DifficultyCalculator.cs" />
<Compile Include="Graphics\Cursor\OsuContextMenuContainer.cs" /> <Compile Include="Graphics\Cursor\OsuContextMenuContainer.cs" />
<Compile Include="Graphics\UserInterface\IconButton.cs" /> <Compile Include="Graphics\UserInterface\IconButton.cs" />
<Compile Include="Configuration\SelectionRandomType.cs" />
<Compile Include="Graphics\UserInterface\MenuItemType.cs" />
<Compile Include="Graphics\UserInterface\OsuContextMenu.cs" />
<Compile Include="Graphics\UserInterface\OsuContextMenuItem.cs" /> <Compile Include="Graphics\UserInterface\OsuContextMenuItem.cs" />
<Compile Include="Online\API\Requests\GetUsersRequest.cs" /> <Compile Include="Online\API\Requests\GetUsersRequest.cs" />
<Compile Include="Online\API\Requests\PostMessageRequest.cs" /> <Compile Include="Online\API\Requests\PostMessageRequest.cs" />

View File

@ -6,8 +6,8 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<packages> <packages>
<package id="DotNetZip" version="1.10.1" targetFramework="net45" /> <package id="DotNetZip" version="1.10.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" /> <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1341" targetFramework="net45" /> <package id="ppy.OpenTK" version="3.0" targetFramework="net45" />
<package id="SharpCompress" version="0.15.2" targetFramework="net45" /> <package id="SharpCompress" version="0.17.1" targetFramework="net45" />
<package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="net45" /> <package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="net45" />
<package id="SQLite.Net-PCL" version="3.1.1" targetFramework="net45" /> <package id="SQLite.Net-PCL" version="3.1.1" targetFramework="net45" />
<package id="SQLiteNetExtensions" version="1.3.0" targetFramework="net45" /> <package id="SQLiteNetExtensions" version="1.3.0" targetFramework="net45" />