1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:03:08 +08:00

Merge branch 'master' into master

This commit is contained in:
Dean Herbert 2017-03-02 18:06:31 +09:00 committed by GitHub
commit 51950eef43
96 changed files with 988 additions and 370 deletions

View File

@ -7,3 +7,21 @@ insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
#Roslyn naming styles
#PascalCase for public and protected members
dotnet_naming_style.pascalcase.capitalization = pascal_case
dotnet_naming_symbols.public_members.applicable_accessibilities = public,internal,protected,protected_internal
dotnet_naming_symbols.public_members.applicable_kinds = property,method,field,event,delegate
dotnet_naming_rule.public_members_pascalcase.severity = suggestion
dotnet_naming_rule.public_members_pascalcase.symbols = public_members
dotnet_naming_rule.public_members_pascalcase.style = pascalcase
#camelCase for private members
dotnet_naming_style.camelcase.capitalization = camel_case
dotnet_naming_symbols.private_members.applicable_accessibilities = private
dotnet_naming_symbols.private_members.applicable_kinds = property,method,field,event,delegate
dotnet_naming_rule.private_members_camelcase.severity = suggestion
dotnet_naming_rule.private_members_camelcase.symbols = private_members
dotnet_naming_rule.private_members_camelcase.style = camelcase

@ -1 +1 @@
Subproject commit 7cad7cf48b2ae9f16cac503d46bd0ea801e7561f
Subproject commit 5dbb4a5134dacb2e98ab8f2af219039a72bd32e6

View File

@ -23,6 +23,10 @@
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DeltaCompressionDotNet.MsDelta" publicKeyToken="46b2138a390abf55" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -36,52 +36,52 @@
<StartupObject>osu.Desktop.Deploy.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="DeltaCompressionDotNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll</HintPath>
<Reference Include="DeltaCompressionDotNet, Version=1.1.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="DeltaCompressionDotNet.MsDelta, Version=1.0.0.0, Culture=neutral, PublicKeyToken=46b2138a390abf55, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.MsDelta.dll</HintPath>
<Reference Include="DeltaCompressionDotNet.MsDelta, Version=1.1.0.0, Culture=neutral, PublicKeyToken=46b2138a390abf55, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.PatchApi.dll</HintPath>
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.1.5.2\lib\Net45\ICSharpCode.SharpZipLib.dll</HintPath>
<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">
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll</HintPath>
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath>
<Reference Include="Splat, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Squirrel, Version=1.5.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll</HintPath>
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DeltaCompressionDotNet" version="1.0.0" targetFramework="net452" />
<package id="Mono.Cecil" version="0.9.6.1" targetFramework="net452" />
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net452" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="NuGet.CommandLine" version="3.5.0" targetFramework="net452" developmentDependency="true" />
<package id="Splat" version="1.6.2" targetFramework="net452" />
<package id="Splat" version="2.0.0" targetFramework="net452" />
<package id="squirrel.windows" version="1.5.2" targetFramework="net452" />
</packages>

View File

@ -34,7 +34,7 @@
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll</HintPath>
<HintPath>$(SolutionDir)\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
@ -54,9 +54,6 @@
<Reference Include="SQLite.Net.Platform.Generic">
<HintPath>$(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll</HintPath>
</Reference>
<Reference Include="OpenTK">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BenchmarkTest.cs" />

View File

@ -13,7 +13,7 @@ namespace osu.Desktop.VisualTests
private double timePerTest = 200;
[BackgroundDependencyLoader]
private void load(Framework.Game game)
private void load()
{
Host.MaximumDrawHz = int.MaxValue;
Host.MaximumUpdateHz = int.MaxValue;

View File

@ -0,0 +1,80 @@
// 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;
using osu.Framework.Screens.Testing;
using osu.Game.Graphics;
using osu.Game.Overlays;
using osu.Game.Overlays.Dialog;
namespace osu.Desktop.VisualTests.Tests
{
class TestCaseDialogOverlay : TestCase
{
public override string Name => @"Dialog Overlay";
public override string Description => @"Display dialogs";
DialogOverlay overlay;
public override void Reset()
{
base.Reset();
Add(overlay = new DialogOverlay());
AddButton("dialog #1", () => overlay.Push(new PopupDialog
{
Icon = FontAwesome.fa_trash_o,
HeaderText = @"Confirm deletion of",
BodyText = @"Ayase Rie - Yuima-ru*World TVver.",
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = @"I never want to see this again.",
Action = () => System.Console.WriteLine(@"OK"),
},
new PopupDialogCancelButton
{
Text = @"Firetruck, I still want quick ranks!",
Action = () => System.Console.WriteLine(@"Cancel"),
},
},
}));
AddButton("dialog #2", () => overlay.Push(new PopupDialog
{
Icon = FontAwesome.fa_gear,
HeaderText = @"What do you want to do with",
BodyText = "Camellia as \"Bang Riot\" - Blastix Riotz",
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = @"Manage collections",
},
new PopupDialogOkButton
{
Text = @"Delete...",
},
new PopupDialogOkButton
{
Text = @"Remove from unplayed",
},
new PopupDialogOkButton
{
Text = @"Clear local scores",
},
new PopupDialogOkButton
{
Text = @"Edit",
},
new PopupDialogCancelButton
{
Text = @"Cancel",
},
},
}));
}
}
}

View File

@ -4,6 +4,7 @@
using System.Collections.Generic;
using osu.Framework.Screens.Testing;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.MathUtils;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
@ -27,9 +28,6 @@ namespace osu.Desktop.VisualTests.Tests
{
base.Reset();
//ensure we are at offset 0
Clock = new FramedClock();
List<HitObject> objects = new List<HitObject>();
int time = 500;
@ -52,33 +50,42 @@ namespace osu.Desktop.VisualTests.Tests
Add(new Drawable[]
{
new OsuHitRenderer
new Container
{
Beatmap = beatmap,
Scale = new Vector2(0.5f),
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft
},
new TaikoHitRenderer
{
Beatmap = beatmap,
Scale = new Vector2(0.5f),
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight
},
new CatchHitRenderer
{
Beatmap = beatmap,
Scale = new Vector2(0.5f),
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft
},
new ManiaHitRenderer
{
Beatmap = beatmap,
Scale = new Vector2(0.5f),
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight
RelativeSizeAxes = Axes.Both,
//ensure we are at offset 0
Clock = new FramedClock(),
Children = new Drawable[]
{
new OsuHitRenderer
{
Beatmap = beatmap,
Scale = new Vector2(0.5f),
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft
},
new TaikoHitRenderer
{
Beatmap = beatmap,
Scale = new Vector2(0.5f),
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight
},
new CatchHitRenderer
{
Beatmap = beatmap,
Scale = new Vector2(0.5f),
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft
},
new ManiaHitRenderer
{
Beatmap = beatmap,
Scale = new Vector2(0.5f),
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight
}
}
}
});
}

View File

@ -95,7 +95,7 @@ namespace osu.Desktop.VisualTests.Tests
AddButton(@"slider", () => load(HitObjectType.Slider));
AddButton(@"spinner", () => load(HitObjectType.Spinner));
AddToggle(@"auto", () => { auto = !auto; load(mode); });
AddToggle(@"auto", (state) => { auto = state; load(mode); });
ButtonsContainer.Add(new SpriteText { Text = "Playback Speed" });
ButtonsContainer.Add(new BasicSliderBar<double>

View File

@ -5,6 +5,7 @@ using osu.Framework.Screens.Testing;
using osu.Framework.Graphics;
using osu.Framework.Timing;
using osu.Game.Overlays;
using osu.Framework.Graphics.Containers;
namespace osu.Desktop.VisualTests.Tests
{
@ -30,7 +31,7 @@ namespace osu.Desktop.VisualTests.Tests
Anchor = Anchor.Centre
};
Add(mc);
AddToggle(@"Show", mc.ToggleVisibility);
AddToggle(@"Show", (state) => mc.State = state ? Visibility.Visible : Visibility.Hidden);
}
}
}

View File

@ -8,6 +8,7 @@ using osu.Framework.MathUtils;
using osu.Game.Overlays;
using System.Linq;
using osu.Game.Overlays.Notifications;
using osu.Framework.Graphics.Containers;
namespace osu.Desktop.VisualTests.Tests
{
@ -30,7 +31,7 @@ namespace osu.Desktop.VisualTests.Tests
Origin = Anchor.TopRight,
});
AddToggle(@"show", manager.ToggleVisibility);
AddToggle(@"show", (state) => manager.State = state ? Visibility.Visible : Visibility.Hidden);
AddButton(@"simple #1", sendNotification1);
AddButton(@"simple #2", sendNotification2);

View File

@ -22,9 +22,9 @@ namespace osu.Desktop.VisualTests.Tests
{
base.Reset();
FlowContainer flow;
FillFlowContainer flow;
Add(flow = new FlowContainer()
Add(flow = new FillFlowContainer()
{
RelativeSizeAxes = Axes.Both,
Size = new Vector2(0.5f),

View File

@ -82,6 +82,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll</HintPath>
@ -99,9 +103,8 @@
<Reference Include="SQLite.Net.Platform.Generic">
<HintPath>$(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll</HintPath>
</Reference>
<Reference Include="OpenTK">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<None Include="..\osu.licenseheader">
@ -191,6 +194,7 @@
<Compile Include="Platform\TestStorage.cs" />
<Compile Include="Tests\TestCaseOptions.cs" />
<Compile Include="Tests\TestCasePauseOverlay.cs" />
<Compile Include="Tests\TestCaseDialogOverlay.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup />

View File

@ -5,7 +5,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
-->
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1339" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1340" 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="SQLiteNetExtensions" version="1.3.0" targetFramework="net45" />

View File

@ -37,7 +37,7 @@ namespace osu.Desktop.Overlays
[BackgroundDependencyLoader]
private void load(NotificationManager notification, OsuColour colours, TextureStore textures)
{
this.notificationManager = notification;
notificationManager = notification;
AutoSizeAxes = Axes.Both;
Anchor = Anchor.BottomCentre;
@ -57,19 +57,19 @@ namespace osu.Desktop.Overlays
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(5),
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Spacing = new Vector2(5),
Children = new Drawable[]
{
new OsuSpriteText
@ -95,6 +95,8 @@ namespace osu.Desktop.Overlays
},
new Sprite
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Texture = textures.Get(@"Menu/dev-build-footer"),
},
}

View File

@ -10,6 +10,10 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DeltaCompressionDotNet.MsDelta" publicKeyToken="46b2138a390abf55" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -89,61 +89,61 @@
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="DeltaCompressionDotNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll</HintPath>
<Reference Include="DeltaCompressionDotNet, Version=1.1.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="DeltaCompressionDotNet.MsDelta, Version=1.0.0.0, Culture=neutral, PublicKeyToken=46b2138a390abf55, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.MsDelta.dll</HintPath>
<Reference Include="DeltaCompressionDotNet.MsDelta, Version=1.1.0.0, Culture=neutral, PublicKeyToken=46b2138a390abf55, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.PatchApi.dll</HintPath>
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.1.5.2\lib\Net45\ICSharpCode.SharpZipLib.dll</HintPath>
<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">
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll</HintPath>
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4" />
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath>
<Reference Include="Splat, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Squirrel, Version=1.5.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll</HintPath>
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=4.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
<HintPath>$(SolutionDir)\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />

View File

@ -4,9 +4,9 @@ Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-->
<packages>
<package id="DeltaCompressionDotNet" version="1.0.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="Mono.Cecil" version="0.9.6.1" targetFramework="net45" />
<package id="Splat" version="1.6.2" targetFramework="net45" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net45" />
<package id="Splat" version="2.0.0" targetFramework="net45" />
<package id="squirrel.windows" version="1.5.2" targetFramework="net45" />
</packages>

View File

@ -33,7 +33,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

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
-->
<packages>
<package id="ppy.OpenTK" version="2.0.50727.1339" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1340" targetFramework="net45" />
</packages>

View File

@ -33,7 +33,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

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
-->
<packages>
<package id="ppy.OpenTK" version="2.0.50727.1339" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1340" targetFramework="net45" />
</packages>

View File

@ -13,7 +13,7 @@ using OpenTK.Graphics;
namespace osu.Game.Modes.Osu.Objects.Drawables
{
public class HitExplosion : FlowContainer
public class HitExplosion : FillFlowContainer
{
private readonly OsuJudgementInfo judgement;
private SpriteText line1;
@ -25,7 +25,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
AutoSizeAxes = Axes.Both;
Origin = Anchor.Centre;
Direction = FlowDirections.Vertical;
Direction = FillDirection.Down;
Spacing = new Vector2(0, 2);
Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset;

View File

@ -14,6 +14,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
public TrianglesPiece()
{
TriangleScale = 1.2f;
HideAlphaDiscrepancies = false;
}
protected override void Update()

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
@ -7,9 +7,9 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup></configuration>

View File

@ -34,7 +34,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

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
-->
<packages>
<package id="ppy.OpenTK" version="2.0.50727.1339" targetFramework="net452" />
<package id="ppy.OpenTK" version="2.0.50727.1340" targetFramework="net45" />
</packages>

View File

@ -33,7 +33,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

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
-->
<packages>
<package id="ppy.OpenTK" version="2.0.50727.1339" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1340" targetFramework="net45" />
</packages>

View File

@ -33,17 +33,15 @@
<HintPath>$(SolutionDir)\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>$(SolutionDir)\packages\NUnit.3.5.0\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
<Reference Include="SQLite.Net">
<HintPath>$(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll</HintPath>
</Reference>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-->
<packages>
<package id="NUnit" version="3.5.0" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1339" 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" />
</packages>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-->
<packages>
<package id="NUnit" version="3.5.0" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1340" 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" />
</packages>

View File

@ -18,8 +18,8 @@ namespace osu.Game.Beatmaps
public List<HitObject> HitObjects { get; set; }
public List<ControlPoint> ControlPoints { get; set; }
public List<Color4> ComboColors { get; set; }
public double BPMMaximum => 60000 / ControlPoints.Where(c => c.BeatLength != 0).OrderBy(c => c.BeatLength).First().BeatLength;
public double BPMMinimum => 60000 / ControlPoints.Where(c => c.BeatLength != 0).OrderByDescending(c => c.BeatLength).First().BeatLength;
public double BPMMaximum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderBy(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength;
public double BPMMinimum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength;
public double BPMMode => BPMAt(ControlPoints.Where(c => c.BeatLength != 0).GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).First().First().Time);
public double BPMAt(double time)

View File

@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps.Drawables
}
[BackgroundDependencyLoader]
private void load(OsuGameBase game)
private void load()
{
if (working.Background != null)
Texture = working.Background;

View File

@ -64,7 +64,7 @@ namespace osu.Game.Beatmaps.Drawables
BeatmapSet = beatmapSet;
WorkingBeatmap beatmap = database.GetWorkingBeatmap(BeatmapSet.Beatmaps.FirstOrDefault());
foreach (var b in BeatmapSet.Beatmaps)
b.StarDifficulty = (float)database.GetWorkingBeatmap(b).Beatmap.CalculateStarDifficulty();
b.StarDifficulty = (float)(database.GetWorkingBeatmap(b).Beatmap?.CalculateStarDifficulty() ?? -1f);
Header = new BeatmapSetHeader(beatmap)
{

View File

@ -83,10 +83,10 @@ namespace osu.Game.Beatmaps.Drawables
ColourLight = OsuColour.FromHex(@"3a7285"),
ColourDark = OsuColour.FromHex(@"123744")
},
new FlowContainer
new FillFlowContainer
{
Padding = new MarginPadding(5),
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
AutoSizeAxes = Axes.Both,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
@ -98,18 +98,18 @@ namespace osu.Game.Beatmaps.Drawables
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
new FlowContainer
new FillFlowContainer
{
Padding = new MarginPadding { Left = 5 },
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
Direction = FlowDirections.Horizontal,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Right,
Spacing = new Vector2(4, 0),
AutoSizeAxes = Axes.Both,
Children = new[]
{
new OsuSpriteText

View File

@ -24,7 +24,7 @@ namespace osu.Game.Beatmaps.Drawables
private OsuConfigManager config;
private Bindable<bool> preferUnicode;
private WorkingBeatmap beatmap;
private FlowContainer difficultyIcons;
private FillFlowContainer difficultyIcons;
public BeatmapSetHeader(WorkingBeatmap beatmap)
{
@ -36,9 +36,9 @@ namespace osu.Game.Beatmaps.Drawables
{
RelativeSizeAxes = Axes.Both,
},
new FlowContainer
new FillFlowContainer
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Padding = new MarginPadding { Top = 5, Left = 18, Right = 10, Bottom = 10 },
AutoSizeAxes = Axes.Both,
Children = new[]
@ -58,7 +58,7 @@ namespace osu.Game.Beatmaps.Drawables
TextSize = 17,
Shadow = true,
},
difficultyIcons = new FlowContainer
difficultyIcons = new FillFlowContainer
{
Margin = new MarginPadding { Top = 5 },
AutoSizeAxes = Axes.Both,
@ -109,10 +109,10 @@ namespace osu.Game.Beatmaps.Drawables
Children = new[]
{
new FlowContainer
new FillFlowContainer
{
Depth = -1,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
RelativeSizeAxes = Axes.Both,
// This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle
Shear = new Vector2(0.8f, 0),

View File

@ -27,11 +27,14 @@ namespace osu.Game.Configuration
Set(OsuConfig.DimLevel, 30, 0, 100);
Set(OsuConfig.MouseDisableButtons, false);
Set(OsuConfig.MouseDisableWheel, false);
Set(OsuConfig.SnakingInSliders, true);
Set(OsuConfig.SnakingOutSliders, false);
Set(OsuConfig.MenuParallax, true);
Set(OsuConfig.KeyOverlay, false);
//todo: implement all settings below this line (remove the Disabled set when doing so).
Set(OsuConfig.MouseSpeed, 1.0).Disabled = true;
@ -79,7 +82,6 @@ namespace osu.Game.Configuration
Set(OsuConfig.IgnoreBeatmapSamples, false).Disabled = true;
Set(OsuConfig.IgnoreBeatmapSkins, false).Disabled = true;
Set(OsuConfig.IgnoreList, string.Empty).Disabled = true;
Set(OsuConfig.KeyOverlay, false).Disabled = true;
Set(OsuConfig.Language, @"unknown").Disabled = true;
Set(OsuConfig.AllowNowPlayingHighlights, false).Disabled = true;
Set(OsuConfig.LastVersion, string.Empty).Disabled = true;
@ -99,7 +101,6 @@ namespace osu.Game.Configuration
Set(OsuConfig.UsePerBeatmapManiaSpeed, true).Disabled = true;
Set(OsuConfig.ManiaSpeedBPMScale, true).Disabled = true;
Set(OsuConfig.MenuTip, 0).Disabled = true;
Set(OsuConfig.MouseDisableWheel, false).Disabled = true;
Set(OsuConfig.MouseSpeed, 1, 0.4, 6).Disabled = true;
Set(OsuConfig.Offset, 0, -300, 300).Disabled = true;
Set(OsuConfig.ScoreMeterScale, 1, 0.5, 2).Disabled = true;

View File

@ -57,6 +57,18 @@ namespace osu.Game.Database
try
{
storage.Delete(b.Path);
GetChildren(b, true);
foreach (var i in b.Beatmaps)
{
if (i.Metadata != null) connection.Delete(i.Metadata);
if (i.BaseDifficulty != null) connection.Delete(i.BaseDifficulty);
connection.Delete(i);
}
if (b.Metadata != null) connection.Delete(b.Metadata);
connection.Delete(b);
}
catch (Exception e)

View File

@ -10,6 +10,7 @@ using osu.Framework.MathUtils;
using OpenTK;
using OpenTK.Graphics;
using System;
using osu.Framework.Graphics.Colour;
namespace osu.Game.Graphics.Backgrounds
{
@ -37,6 +38,13 @@ namespace osu.Game.Graphics.Backgrounds
private float triangleScale = 1;
/// <summary>
/// Whether we should drop-off alpha values of triangles more quickly to improve
/// the visual appearance of fading. This defaults to on as it is generally more
/// aesthetically pleasing, but should be turned off in <see cref="BufferedContainer{T}"/>s.
/// </summary>
public bool HideAlphaDiscrepancies = true;
public float TriangleScale
{
get { return triangleScale; }
@ -63,8 +71,14 @@ namespace osu.Game.Graphics.Backgrounds
{
base.Update();
float adjustedAlpha = HideAlphaDiscrepancies ?
// Cubically scale alpha to make it drop off more sharply.
(float)Math.Pow(DrawInfo.Colour.AverageColour.Linear.A, 3) :
1;
foreach (var t in Children)
{
t.Alpha = adjustedAlpha;
t.Position -= new Vector2(0, (float)(t.Scale.X * (50 / DrawHeight) * (Time.Elapsed / 950)) / triangleScale);
if (ExpireOffScreenTriangles && t.DrawPosition.Y + t.DrawSize.Y * t.Scale.Y < 0)
t.Expire();

View File

@ -43,7 +43,7 @@ namespace osu.Game.Graphics.Cursor
class OsuCursor : Container
{
private Container cursorContainer;
private BindableDouble cursorScale;
private Bindable<double> cursorScale;
public OsuCursor()
{
@ -52,9 +52,9 @@ namespace osu.Game.Graphics.Cursor
}
[BackgroundDependencyLoader]
private void load(TextureStore textures, OsuConfigManager config)
private void load(OsuConfigManager config)
{
cursorScale = (BindableDouble)config.GetBindable<double>(OsuConfig.CursorSize);
cursorScale = config.GetBindable<double>(OsuConfig.CursorSize);
Children = new Drawable[]
{

View File

@ -13,17 +13,15 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Pause
namespace osu.Game.Graphics.UserInterface
{
public class PauseButton : ClickableContainer
public class DialogButton : ClickableContainer
{
private const float hover_width = 0.9f;
private const float hover_duration = 500;
private const float glow_fade_duration = 250;
private const float click_duration = 200;
private Color4 backgroundColour = OsuColour.Gray(34);
private Color4 buttonColour;
public Color4 ButtonColour
{
@ -35,8 +33,21 @@ namespace osu.Game.Overlays.Pause
{
buttonColour = value;
updateGlow();
if (colourContainer == null) return;
colourContainer.Colour = ButtonColour;
colourContainer.Colour = value;
}
}
private Color4 backgroundColour = OsuColour.Gray(34);
public Color4 BackgroundColour
{
get
{
return backgroundColour;
}
set
{
backgroundColour = value;
background.Colour = value;
}
}
@ -50,16 +61,30 @@ namespace osu.Game.Overlays.Pause
set
{
text = value;
if (spriteText == null) return;
spriteText.Text = Text;
}
}
private float textSize = 28;
internal float TextSize
{
get
{
return textSize;
}
set
{
textSize = value;
spriteText.TextSize = value;
}
}
public SampleChannel SampleClick, SampleHover;
private Container backgroundContainer, colourContainer, glowContainer;
private Box leftGlow, centerGlow, rightGlow;
private Box leftGlow, centerGlow, rightGlow, background;
private SpriteText spriteText;
private Vector2 hoverSpacing => new Vector2(3f, 0f);
private bool didClick; // Used for making sure that the OnMouseDown animation can call instead of OnHoverLost's when clicking
@ -85,8 +110,9 @@ namespace osu.Game.Overlays.Pause
protected override bool OnHover(Framework.Input.InputState state)
{
spriteText.TransformSpacingTo(hoverSpacing, hover_duration, EasingTypes.OutElastic);
colourContainer.ResizeTo(new Vector2(hover_width, 1f), hover_duration, EasingTypes.OutElastic);
spriteText.TransformSpacingTo(new Vector2(3f, 0f), hover_duration, EasingTypes.OutElastic);
glowContainer.FadeIn(glow_fade_duration, EasingTypes.Out);
SampleHover?.Play();
return true;
@ -127,8 +153,10 @@ namespace osu.Game.Overlays.Pause
rightGlow.ColourInfo = ColourInfo.GradientHorizontal(ButtonColour, new Color4(ButtonColour.R, ButtonColour.G, ButtonColour.B, 0f));
}
public PauseButton()
public DialogButton()
{
RelativeSizeAxes = Axes.X;
Children = new Drawable[]
{
backgroundContainer = new Container
@ -137,12 +165,12 @@ namespace osu.Game.Overlays.Pause
Width = 1f,
Children = new Drawable[]
{
new Box
background = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = backgroundColour
}
}
Colour = backgroundColour,
},
},
},
glowContainer = new Container
{
@ -156,23 +184,23 @@ namespace osu.Game.Overlays.Pause
RelativeSizeAxes = Axes.Both,
Origin = Anchor.TopLeft,
Anchor = Anchor.TopLeft,
Width = 0.125f
Width = 0.125f,
},
centerGlow = new Box
{
RelativeSizeAxes = Axes.Both,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Width = 0.75f
Width = 0.75f,
},
rightGlow = new Box
{
RelativeSizeAxes = Axes.Both,
Origin = Anchor.TopRight,
Anchor = Anchor.TopRight,
Width = 0.125f
}
}
Width = 0.125f,
},
},
},
new Container
{
@ -194,7 +222,7 @@ namespace osu.Game.Overlays.Pause
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.2f),
Radius = 5
Radius = 5,
},
Colour = ButtonColour,
Shear = new Vector2(0.2f, 0),
@ -203,7 +231,7 @@ namespace osu.Game.Overlays.Pause
new Box
{
EdgeSmoothness = new Vector2(2, 0),
RelativeSizeAxes = Axes.Both
RelativeSizeAxes = Axes.Both,
},
new Container
{
@ -217,13 +245,13 @@ namespace osu.Game.Overlays.Pause
RelativeSizeAxes = Axes.Both,
TriangleScale = 4,
ColourDark = OsuColour.Gray(0.88f),
Shear = new Vector2(-0.2f, 0)
}
}
Shear = new Vector2(-0.2f, 0),
},
},
},
}
}
}
},
},
},
},
spriteText = new OsuSpriteText
{
@ -234,8 +262,8 @@ namespace osu.Game.Overlays.Pause
Font = "Exo2.0-Bold",
Shadow = true,
ShadowColour = new Color4(0, 0, 0, 0.1f),
Colour = Color4.White
}
Colour = Color4.White,
},
};
updateGlow();

View File

@ -19,9 +19,9 @@ namespace osu.Game.Graphics.UserInterface
Children = new[]
{
new FlowContainer
new FillFlowContainer
{
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]

View File

@ -14,8 +14,6 @@ namespace osu.Game.Graphics.UserInterface
{
private readonly Container<Star> stars;
private double transformStartTime;
/// <summary>
/// Maximum amount of stars displayed.
/// </summary>
@ -70,10 +68,10 @@ namespace osu.Game.Graphics.UserInterface
Children = new Drawable[]
{
stars = new FlowContainer<Star>
stars = new FillFlowContainer<Star>
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(star_spacing),
}
};

View File

@ -33,7 +33,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Anchor = Anchor.BottomRight,
@ -82,9 +82,9 @@ namespace osu.Game.Graphics.UserInterface.Volume
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
volumeMeterMaster.Bindable.Weld(audio.Volume);
volumeMeterEffect.Bindable.Weld(audio.VolumeSample);
volumeMeterMusic.Bindable.Weld(audio.VolumeTrack);
volumeMeterMaster.Bindable.BindTo(audio.Volume);
volumeMeterEffect.Bindable.BindTo(audio.VolumeSample);
volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack);
}
ScheduledDelegate popOutDelegate;

View File

@ -9,6 +9,9 @@ using osu.Game.Modes.Objects;
using OpenTK;
using osu.Framework.Graphics.Primitives;
using osu.Game.Screens.Play;
using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Framework.Configuration;
namespace osu.Game.Modes.UI
{
@ -21,6 +24,8 @@ namespace osu.Game.Modes.UI
public HealthDisplay HealthDisplay;
public Score Score { get; set; }
private Bindable<bool> showKeyCounter;
protected abstract KeyCounterCollection CreateKeyCounter();
protected abstract ComboCounter CreateComboCounter();
protected abstract PercentageCounter CreateAccuracyCounter();
@ -58,13 +63,29 @@ namespace osu.Game.Modes.UI
};
}
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
showKeyCounter = config.GetBindable<bool>(OsuConfig.KeyOverlay);
showKeyCounter.ValueChanged += visibilityChanged;
showKeyCounter.TriggerChange();
}
private void visibilityChanged(object sender, EventArgs e)
{
if (showKeyCounter)
KeyCounter.Show();
else
KeyCounter.Hide();
}
public void BindProcessor(ScoreProcessor processor)
{
//bind processor bindables to combocounter, score display etc.
processor.TotalScore.ValueChanged += delegate { ScoreCounter?.Set((ulong)processor.TotalScore.Value); };
processor.Accuracy.ValueChanged += delegate { AccuracyCounter?.Set((float)processor.Accuracy.Value); };
processor.Combo.ValueChanged += delegate { ComboCounter?.Set((ulong)processor.Combo.Value); };
HealthDisplay?.Current.Weld(processor.Health);
HealthDisplay?.Current.BindTo(processor.Health);
}
}
}

View File

@ -15,7 +15,7 @@ namespace osu.Game.Online.Chat.Drawables
public class DrawableChannel : Container
{
private readonly Channel channel;
private FlowContainer flow;
private FillFlowContainer flow;
private ScrollContainer scroll;
public DrawableChannel(Channel channel)
@ -39,9 +39,9 @@ namespace osu.Game.Online.Chat.Drawables
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
flow = new FlowContainer
flow = new FillFlowContainer
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Left = 20, Right = 20 }

View File

@ -42,6 +42,8 @@ namespace osu.Game
private NotificationManager notificationManager;
private DialogOverlay dialogOverlay;
private Intro intro
{
get
@ -142,6 +144,11 @@ namespace osu.Game
Origin = Anchor.TopRight,
}).LoadAsync(this, overlayContent.Add);
(dialogOverlay = new DialogOverlay
{
Depth = -4,
}).LoadAsync(this, overlayContent.Add);
Logger.NewEntry += entry =>
{
if (entry.Level < LogLevel.Important) return;
@ -155,6 +162,7 @@ namespace osu.Game
Dependencies.Cache(options);
Dependencies.Cache(musicController);
Dependencies.Cache(notificationManager);
Dependencies.Cache(dialogOverlay);
(Toolbar = new Toolbar
{
@ -214,7 +222,7 @@ namespace osu.Game
}
}
return base.OnKeyDown(state, args);
return false;
}
public event Action<Screen> ModeChanged;

View File

@ -29,8 +29,6 @@ namespace osu.Game.Overlays
{
const float textbox_height = 40;
private DrawableChannel channelDisplay;
private ScheduledDelegate messageRequest;
private Container content;
@ -126,7 +124,7 @@ namespace osu.Game.Overlays
private void addChannel(Channel channel)
{
Add(channelDisplay = new DrawableChannel(channel));
Add(new DrawableChannel(channel));
careChannels.Add(channel);
}

View File

@ -0,0 +1,245 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
namespace osu.Game.Overlays.Dialog
{
public class PopupDialog : FocusedOverlayContainer
{
public static readonly float ENTER_DURATION = 500;
public static readonly float EXIT_DURATION = 200;
private readonly Vector2 ringSize = new Vector2(100f);
private readonly Vector2 ringMinifiedSize = new Vector2(20f);
private readonly Vector2 buttonsEnterSpacing = new Vector2(0f, 50f);
private Container content, ring;
private FillFlowContainer<PopupDialogButton> buttonsContainer;
private TextAwesome iconText;
private SpriteText header, body;
public FontAwesome Icon
{
get { return iconText.Icon; }
set { iconText.Icon = value; }
}
public string HeaderText
{
get { return header.Text; }
set { header.Text = value; }
}
public string BodyText
{
get { return body.Text; }
set { body.Text = value; }
}
public IEnumerable<PopupDialogButton> Buttons
{
get { return buttonsContainer.Children; }
set
{
buttonsContainer.Children = value;
foreach (PopupDialogButton b in value)
{
var action = b.Action;
b.Action = () =>
{
Hide();
action?.Invoke();
};
}
}
}
private void pressButtonAtIndex(int index)
{
if (index < Buttons.Count())
Buttons.Skip(index).First().TriggerClick();
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (args.Repeat) return false;
if (args.Key == Key.Enter)
{
Buttons.OfType<PopupDialogOkButton>().FirstOrDefault()?.TriggerClick();
return true;
}
// press button at number if 1-9 on number row or keypad are pressed
var k = args.Key;
if (k >= Key.Number1 && k <= Key.Number9)
{
pressButtonAtIndex(k - Key.Number1);
return true;
}
if (k >= Key.Keypad1 && k <= Key.Keypad9)
{
pressButtonAtIndex(k - Key.Keypad1);
return true;
}
return base.OnKeyDown(state, args);
}
protected override void PopIn()
{
base.PopIn();
// Reset various animations but only if the dialog animation fully completed
if (content.Alpha == 0)
{
buttonsContainer.TransformSpacingTo(buttonsEnterSpacing);
buttonsContainer.MoveToY(buttonsEnterSpacing.Y);
ring.ResizeTo(ringMinifiedSize);
}
content.FadeIn(ENTER_DURATION, EasingTypes.OutQuint);
ring.ResizeTo(ringSize, ENTER_DURATION, EasingTypes.OutQuint);
buttonsContainer.TransformSpacingTo(Vector2.Zero, ENTER_DURATION, EasingTypes.OutQuint);
buttonsContainer.MoveToY(0, ENTER_DURATION, EasingTypes.OutQuint);
}
protected override void PopOut()
{
base.PopOut();
content.FadeOut(EXIT_DURATION, EasingTypes.InSine);
}
public PopupDialog()
{
RelativeSizeAxes = Axes.Both;
Children = new Drawable[]
{
content = new Container
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Width = 0.4f,
Alpha = 0f,
Children = new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Masking = true,
EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.5f),
Radius = 8,
},
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.FromHex(@"221a21"),
},
new Triangles
{
RelativeSizeAxes = Axes.Both,
ColourLight = OsuColour.FromHex(@"271e26"),
ColourDark = OsuColour.FromHex(@"1e171e"),
TriangleScale = 4,
},
},
},
new FillFlowContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.BottomCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Position = new Vector2(0f, -50f),
Direction = FillDirection.Down,
Spacing = new Vector2(0f, 10f),
Children = new Drawable[]
{
new Container
{
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Size = ringSize,
Margin = new MarginPadding
{
Bottom = 30,
},
Children = new Drawable[]
{
ring = new CircularContainer
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
BorderColour = Color4.White,
BorderThickness = 5f,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(0),
},
iconText = new TextAwesome
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Icon = FontAwesome.fa_close,
TextSize = 50,
},
},
},
},
},
header = new SpriteText
{
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Text = @"Header",
TextSize = 25,
Shadow = true,
},
body = new SpriteText
{
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Text = @"Body",
TextSize = 18,
Shadow = true,
},
},
},
buttonsContainer = new FillFlowContainer<PopupDialogButton>
{
Anchor = Anchor.Centre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Down,
},
},
},
};
}
}
}

View File

@ -0,0 +1,20 @@
// 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.Allocation;
using osu.Framework.Audio;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Dialog
{
public class PopupDialogButton : DialogButton
{
public PopupDialogButton()
{
Height = 50;
BackgroundColour = OsuColour.FromHex(@"150e14");
TextSize = 18;
}
}
}

View File

@ -0,0 +1,20 @@
// 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.Allocation;
using osu.Framework.Audio;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Dialog
{
public class PopupDialogCancelButton : PopupDialogButton
{
[BackgroundDependencyLoader]
private void load(OsuColour colours, AudioManager audio)
{
ButtonColour = colours.Blue;
SampleHover = audio.Sample.Get(@"Menu/menuclick");
SampleClick = audio.Sample.Get(@"Menu/menuback");
}
}
}

View File

@ -0,0 +1,20 @@
// 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.Allocation;
using osu.Framework.Audio;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Dialog
{
public class PopupDialogOkButton : PopupDialogButton
{
[BackgroundDependencyLoader]
private void load(OsuColour colours, AudioManager audio)
{
ButtonColour = colours.Pink;
SampleHover = audio.Sample.Get(@"Menu/menuclick");
SampleClick = audio.Sample.Get(@"Menu/menu-play-click");
}
}
}

View File

@ -0,0 +1,82 @@
// 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;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
using osu.Game.Overlays.Dialog;
using OpenTK.Graphics;
namespace osu.Game.Overlays
{
public class DialogOverlay : FocusedOverlayContainer
{
private Container dialogContainer;
private PopupDialog currentDialog;
public void Push(PopupDialog dialog)
{
if (dialog == currentDialog) return;
currentDialog?.Hide();
currentDialog = dialog;
dialogContainer.Add(currentDialog);
currentDialog.Show();
currentDialog.StateChanged += onDialogOnStateChanged;
State = Visibility.Visible;
}
private void onDialogOnStateChanged(OverlayContainer dialog, Visibility v)
{
if (v != Visibility.Hidden) return;
//handle the dialog being dismissed.
dialog.Delay(PopupDialog.EXIT_DURATION);
dialog.Expire();
if (dialog == currentDialog)
State = Visibility.Hidden;
}
protected override void PopIn()
{
base.PopIn();
FadeIn(PopupDialog.ENTER_DURATION, EasingTypes.OutQuint);
}
protected override void PopOut()
{
base.PopOut();
FadeOut(PopupDialog.EXIT_DURATION, EasingTypes.InSine);
}
public DialogOverlay()
{
RelativeSizeAxes = Axes.Both;
Children = new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(0.5f),
},
},
},
dialogContainer = new Container
{
RelativeSizeAxes = Axes.Both,
},
};
}
}
}

View File

@ -75,8 +75,7 @@ namespace osu.Game.Overlays
}
[BackgroundDependencyLoader]
private void load(OsuGameBase osuGame, OsuConfigManager config, BeatmapDatabase beatmaps, AudioManager audio,
TextureStore textures, OsuColour colours)
private void load(OsuGameBase osuGame, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours)
{
game = osuGame;

View File

@ -25,7 +25,7 @@ namespace osu.Game.Overlays
private FlowContainer<NotificationSection> sections;
[BackgroundDependencyLoader(permitNulls: true)]
private void load(OsuColour colours)
private void load()
{
Width = width;
RelativeSizeAxes = Axes.Y;
@ -44,9 +44,9 @@ namespace osu.Game.Overlays
Margin = new MarginPadding { Top = Toolbar.Toolbar.HEIGHT },
Children = new[]
{
sections = new FlowContainer<NotificationSection>
sections = new FillFlowContainer<NotificationSection>
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Children = new []

View File

@ -256,7 +256,7 @@ namespace osu.Game.Overlays.Notifications
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load()
{
Size = new Vector2(6, 15);

View File

@ -16,7 +16,7 @@ using OpenTK;
namespace osu.Game.Overlays.Notifications
{
public class NotificationSection : FlowContainer
public class NotificationSection : FillFlowContainer
{
private OsuSpriteText titleText;
private OsuSpriteText countText;
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Notifications
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FlowDirections.Vertical;
Direction = FillDirection.Down;
Padding = new MarginPadding
{
@ -85,7 +85,7 @@ namespace osu.Game.Overlays.Notifications
Origin = Anchor.TopRight,
Action = clearAll
},
new FlowContainer
new FillFlowContainer
{
Margin = new MarginPadding
{
@ -110,7 +110,7 @@ namespace osu.Game.Overlays.Notifications
},
},
},
notifications = new FlowContainer<Notification>
notifications = new FillFlowContainer<Notification>
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,

View File

@ -14,7 +14,7 @@ using System.Collections.Generic;
namespace osu.Game.Overlays.Options
{
public class OptionDropDown<T> : FlowContainer
public class OptionDropDown<T> : FillFlowContainer
{
private DropDownMenu<T> dropdown;
private SpriteText text;
@ -89,7 +89,7 @@ namespace osu.Game.Overlays.Options
{
Items = new KeyValuePair<string, T>[0];
Direction = FlowDirections.Vertical;
Direction = FillDirection.Down;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Children = new Drawable[]
@ -101,7 +101,7 @@ namespace osu.Game.Overlays.Options
{
Margin = new MarginPadding { Top = 5 },
RelativeSizeAxes = Axes.X,
Items = this.Items,
Items = Items,
}
};
dropdown.ValueChanged += dropdown_ValueChanged;

View File

@ -12,7 +12,7 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options
{
public class OptionSlider<T> : FlowContainer where T : struct
public class OptionSlider<T> : FillFlowContainer where T : struct
{
private SliderBar<T> slider;
private SpriteText text;
@ -40,7 +40,6 @@ namespace osu.Game.Overlays.Options
public OptionSlider()
{
Direction = FlowDirections.Vertical;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Padding = new MarginPadding { Right = 5 };

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options
bindable = value;
if (bindable != null)
{
base.Text = bindable.Value;
Text = bindable.Value;
bindable.ValueChanged += bindableValueChanged;
}

View File

@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Options
{
public abstract class OptionsSection : Container
{
protected FlowContainer FlowContent;
protected FillFlowContainer FlowContent;
protected override Container<Drawable> Content => FlowContent;
public abstract FontAwesome Icon { get; }
@ -58,10 +58,10 @@ namespace osu.Game.Overlays.Options
TextSize = header_size,
Text = Header,
},
FlowContent = new FlowContainer
FlowContent = new FillFlowContainer
{
Margin = new MarginPadding { Top = header_size + header_margin },
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Spacing = new Vector2(0, 30),
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,

View File

@ -9,7 +9,7 @@ using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
public abstract class OptionsSubsection : FlowContainer
public abstract class OptionsSubsection : FillFlowContainer
{
private Container<Drawable> content;
protected override Container<Drawable> Content => content;
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Options
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FlowDirections.Vertical;
Direction = FillDirection.Down;
AddInternal(new Drawable[]
{
new OsuSpriteText
@ -29,12 +29,12 @@ namespace osu.Game.Overlays.Options
Margin = new MarginPadding { Bottom = 10 },
Font = @"Exo2.0-Black",
},
content = new FlowContainer
content = new FillFlowContainer
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Spacing = new Vector2(0, 5),
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0, 5),
},
});
}

View File

@ -7,6 +7,7 @@ using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Options.Sections
{

View File

@ -14,7 +14,7 @@ namespace osu.Game.Overlays.Options.Sections
public GameplaySection()
{
base.Children = new Drawable[]
Children = new Drawable[]
{
new GeneralOptions(),
new SongSelectOptions(),

View File

@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Options.Sections.General
}
}
class LoginForm : FlowContainer
class LoginForm : FillFlowContainer
{
private TextBox username;
private TextBox password;
@ -100,10 +100,10 @@ namespace osu.Game.Overlays.Options.Sections.General
private void load(APIAccess api, OsuConfigManager config)
{
this.api = api;
Direction = FlowDirections.Vertical;
Direction = FillDirection.Down;
Spacing = new Vector2(0, 5);
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
username = new OsuTextBox

View File

@ -5,6 +5,7 @@ using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Options.Sections
{

View File

@ -8,6 +8,7 @@ using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Options.Sections
{

View File

@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Options
{
public class Sidebar : Container
{
private FlowContainer content;
private FillFlowContainer content;
internal const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
internal const int EXPANDED_WIDTH = 200;
protected override Container<Drawable> Content => content;
@ -34,13 +34,13 @@ namespace osu.Game.Overlays.Options
{
Children = new []
{
content = new FlowContainer
content = new FillFlowContainer
{
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FlowDirections.Vertical
Direction = FillDirection.Down,
}
}
},

View File

@ -73,11 +73,11 @@ namespace osu.Game.Overlays
Margin = new MarginPadding { Left = SIDEBAR_WIDTH },
Children = new[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = new Drawable[]
{
@ -94,11 +94,11 @@ namespace osu.Game.Overlays
TextSize = 18,
Margin = new MarginPadding { Left = CONTENT_MARGINS, Bottom = 30 },
},
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = sections,
}
}

View File

@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Pause
}
}
private FlowContainer retryCounterContainer;
private FillFlowContainer retryCounterContainer;
public override bool Contains(Vector2 screenSpacePos) => true;
public override bool HandleInput => State == Visibility.Visible;
@ -100,21 +100,21 @@ namespace osu.Game.Overlays.Pause
Colour = Color4.Black,
Alpha = background_alpha,
},
new FlowContainer
new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FlowDirections.Vertical,
Spacing = new Vector2(0f, 50f),
Direction = FillDirection.Down,
Spacing = new Vector2(0, 50),
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Vertical,
Spacing = new Vector2(0f, 20f),
Direction = FillDirection.Down,
Spacing = new Vector2(0, 20),
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Children = new Drawable[]
@ -141,7 +141,7 @@ namespace osu.Game.Overlays.Pause
}
}
},
new FlowContainer
new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
@ -156,7 +156,6 @@ namespace osu.Game.Overlays.Pause
{
new ResumeButton
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Height = button_height,
@ -164,7 +163,6 @@ namespace osu.Game.Overlays.Pause
},
new RetryButton
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Height = button_height,
@ -176,7 +174,6 @@ namespace osu.Game.Overlays.Pause
},
new QuitButton
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Height = button_height,
@ -188,7 +185,7 @@ namespace osu.Game.Overlays.Pause
}
}
},
retryCounterContainer = new FlowContainer
retryCounterContainer = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.TopCentre,

View File

@ -5,13 +5,14 @@ using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Pause
{
public class QuitButton : PauseButton
public class QuitButton : DialogButton
{
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours)
private void load(AudioManager audio)
{
ButtonColour = new Color4(170, 27, 39, 255); // The red from the design isn't in the palette so it's used directly
SampleHover = audio.Sample.Get(@"Menu/menuclick");

View File

@ -4,10 +4,11 @@
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Pause
{
public class ResumeButton : PauseButton
public class ResumeButton : DialogButton
{
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours)

View File

@ -4,10 +4,11 @@
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Pause
{
public class RetryButton : PauseButton
public class RetryButton : DialogButton
{
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours)

View File

@ -41,9 +41,9 @@ namespace osu.Game.Overlays.Toolbar
Children = new Drawable[]
{
new ToolbarBackground(),
new FlowContainer
new FillFlowContainer
{
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Children = new Drawable[]
@ -63,7 +63,7 @@ namespace osu.Game.Overlays.Toolbar
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Children = new Drawable[]
@ -141,7 +141,7 @@ namespace osu.Game.Overlays.Toolbar
FadeOut(transition_time);
}
class PassThroughFlowContainer : FlowContainer
class PassThroughFlowContainer : FillFlowContainer
{
//needed to get input to the login overlay.
public override bool Contains(Vector2 screenSpacePos) => true;

View File

@ -62,10 +62,10 @@ namespace osu.Game.Overlays.Toolbar
protected TextAwesome DrawableIcon;
protected SpriteText DrawableText;
protected Box HoverBackground;
private FlowContainer tooltipContainer;
private FillFlowContainer tooltipContainer;
private SpriteText tooltip1;
private SpriteText tooltip2;
protected FlowContainer Flow;
protected FillFlowContainer Flow;
private SampleChannel sampleClick;
public ToolbarButton()
@ -82,21 +82,21 @@ namespace osu.Game.Overlays.Toolbar
BlendingMode = BlendingMode.Additive,
Alpha = 0,
},
Flow = new FlowContainer
Flow = new FillFlowContainer
{
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(5),
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Padding = new MarginPadding { Left = Toolbar.HEIGHT / 2, Right = Toolbar.HEIGHT / 2 },
Spacing = new Vector2(5),
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Children = new Drawable[]
{
DrawableIcon = new TextAwesome
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
DrawableText = new OsuSpriteText
{
@ -105,9 +105,9 @@ namespace osu.Game.Overlays.Toolbar
},
},
},
tooltipContainer = new FlowContainer
tooltipContainer = new FillFlowContainer
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize
Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight,
Origin = TooltipAnchor,

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Toolbar
{
const float padding = 10;
private FlowContainer modeButtons;
private FillFlowContainer modeButtons;
private Drawable modeButtonLine;
private ToolbarModeButton activeButton;
@ -32,11 +32,11 @@ namespace osu.Game.Overlays.Toolbar
Children = new Drawable[]
{
new OpaqueBackground(),
modeButtons = new FlowContainer
modeButtons = new FillFlowContainer
{
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Padding = new MarginPadding { Left = padding, Right = padding },

View File

@ -9,7 +9,7 @@ namespace osu.Game.Screens.Backgrounds
public class BackgroundScreenDefault : BackgroundScreen
{
[BackgroundDependencyLoader]
private void load(Framework.Game game)
private void load()
{
Add(new Background(@"Backgrounds/bg1"));
}

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens
protected virtual IEnumerable<Type> PossibleChildren => null;
private FlowContainer childModeButtons;
private FillFlowContainer childModeButtons;
private Container textContainer;
private Box box;
@ -124,9 +124,9 @@ namespace osu.Game.Screens
Exit();
}
},
childModeButtons = new FlowContainer
childModeButtons = new FillFlowContainer
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
RelativeSizeAxes = Axes.Both,

View File

@ -114,7 +114,7 @@ namespace osu.Game.Screens.Menu
new OsuSpriteText
{
Shadow = true,
Direction = FlowDirections.Horizontal,
AllowMultiline = false,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
TextSize = 16,

View File

@ -78,16 +78,16 @@ namespace osu.Game.Screens.Menu
},
buttonFlow = new FlowContainerWithOrigin
{
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(-WEDGE_WIDTH, 0),
Anchor = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Spacing = new Vector2(-WEDGE_WIDTH, 0),
Children = new[]
{
settingsButton = new Button(@"settings", @"options", FontAwesome.fa_gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O),
backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -WEDGE_WIDTH),
iconFacade = new Container //need a container to make the osu! icon flow properly.
{
{
Size = new Vector2(0, BUTTON_AREA_HEIGHT)
}
},
@ -117,7 +117,7 @@ namespace osu.Game.Screens.Menu
}
[BackgroundDependencyLoader(true)]
private void load(AudioManager audio, OsuGame game = null)
private void load(OsuGame game = null)
{
toolbar = game?.Toolbar;
}

View File

@ -27,12 +27,12 @@ namespace osu.Game.Screens.Menu
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Spacing = new Vector2(0, 2),
Children = new Drawable[]
{

View File

@ -12,7 +12,7 @@ namespace osu.Game.Screens.Menu
/// <summary>
/// A flow container with an origin based on one of its contained drawables.
/// </summary>
public class FlowContainerWithOrigin : FlowContainer
public class FlowContainerWithOrigin : FillFlowContainer
{
/// <summary>
/// A target drawable which this flowcontainer should be centered around.
@ -22,7 +22,7 @@ namespace osu.Game.Screens.Menu
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
protected override IEnumerable<Drawable> SortedChildren => base.SortedChildren.Reverse();
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
public override Anchor Origin => Anchor.Custom;

View File

@ -69,23 +69,20 @@ namespace osu.Game.Screens.Menu
{
base.OnEntering(last);
Scheduler.Add(delegate
welcome.Play();
Scheduler.AddDelayed(delegate
{
welcome.Play();
bgm.Start();
(mainMenu = new MainMenu()).LoadAsync(Game);
Scheduler.AddDelayed(delegate
{
bgm.Start();
(mainMenu = new MainMenu()).LoadAsync(Game);
Scheduler.AddDelayed(delegate
{
DidLoadMenu = true;
Push(mainMenu);
}, 2300);
}, 600);
});
DidLoadMenu = true;
Push(mainMenu);
}, 2300);
}, 600);
logo.ScaleTo(0.4f);
logo.FadeOut();

View File

@ -24,43 +24,20 @@ namespace osu.Game.Screens
protected new OsuGameBase Game => base.Game as OsuGameBase;
private bool boundToBeatmap;
private Bindable<WorkingBeatmap> beatmap;
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
public WorkingBeatmap Beatmap
{
get
{
bindBeatmap();
return beatmap.Value;
}
set
{
bindBeatmap();
beatmap.Value = value;
}
}
private void bindBeatmap()
{
if (beatmap == null)
beatmap = new Bindable<WorkingBeatmap>();
if (!boundToBeatmap)
{
beatmap.ValueChanged += beatmap_ValueChanged;
boundToBeatmap = true;
}
}
protected override void Dispose(bool isDisposing)
{
if (boundToBeatmap)
beatmap.ValueChanged -= beatmap_ValueChanged;
base.Dispose(isDisposing);
}
private void beatmap_ValueChanged(object sender, EventArgs e)
{
OnBeatmapChanged(beatmap.Value);
@ -69,19 +46,16 @@ namespace osu.Game.Screens
[BackgroundDependencyLoader(permitNulls: true)]
private void load(OsuGameBase game)
{
if (beatmap == null)
beatmap = game?.Beatmap;
}
public override bool Push(Screen screen)
{
OsuScreen nextOsu = screen as OsuScreen;
if (nextOsu != null)
if (game != null)
{
nextOsu.beatmap = beatmap;
//if we were given a beatmap at ctor time, we want to pass this on to the game-wide beatmap.
var localMap = beatmap.Value;
beatmap.BindTo(game.Beatmap);
if (localMap != null)
beatmap.Value = localMap;
}
return base.Push(screen);
beatmap.ValueChanged += beatmap_ValueChanged;
}
protected virtual void OnBeatmapChanged(WorkingBeatmap beatmap)

View File

@ -8,11 +8,11 @@ using OpenTK.Graphics;
namespace osu.Game.Screens.Play
{
public class KeyCounterCollection : FlowContainer<KeyCounter>
public class KeyCounterCollection : FillFlowContainer<KeyCounter>
{
public KeyCounterCollection()
{
Direction = FlowDirections.Horizontal;
Direction = FillDirection.Right;
AutoSizeAxes = Axes.Both;
}

View File

@ -24,6 +24,7 @@ using OpenTK.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Logging;
using osu.Framework.Input;
namespace osu.Game.Screens.Play
{
@ -72,6 +73,8 @@ namespace osu.Game.Screens.Play
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game, OsuConfigManager config)
{
dimLevel = config.GetBindable<int>(OsuConfig.DimLevel);
mouseWheelDisabled = config.GetBindable<bool>(OsuConfig.MouseDisableWheel);
try
{
if (Beatmap == null)
@ -149,7 +152,6 @@ namespace osu.Game.Screens.Play
playerInputManager = new PlayerInputManager(game.Host)
{
Clock = new InterpolatingFramedClock(sourceClock),
PassThrough = false,
Children = new Drawable[]
{
hitRenderer,
@ -193,7 +195,6 @@ namespace osu.Game.Screens.Play
if (canPause || force)
{
lastPauseActionTime = Time.Current;
playerInputManager.PassThrough = true;
scoreOverlay.KeyCounter.IsCounting = false;
pauseOverlay.Retries = RestartCount;
pauseOverlay.Show();
@ -209,7 +210,6 @@ namespace osu.Game.Screens.Play
public void Resume()
{
lastPauseActionTime = Time.Current;
playerInputManager.PassThrough = false;
scoreOverlay.KeyCounter.IsCounting = true;
pauseOverlay.Hide();
sourceClock.Start();
@ -325,5 +325,9 @@ namespace osu.Game.Screens.Play
{
Background?.FadeTo((100f - dimLevel) / 100, 800);
}
private Bindable<bool> mouseWheelDisabled;
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !isPaused;
}
}

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Screens;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Screens.Backgrounds;
@ -38,7 +39,6 @@ namespace osu.Game.Screens.Play
Interactive = false,
},
};
}
[BackgroundDependencyLoader]
@ -92,11 +92,6 @@ namespace osu.Game.Screens.Play
Content.ScaleTo(0.7f, 150, EasingTypes.InQuint);
FadeOut(150);
//OsuScreens are currently never finalised due to the Bindable<Beatmap> bindings.
//can be removed once we solve that one.
if (player != null && player.LoadState != LoadState.Alive)
player.Dispose();
return base.OnExiting(next);
}
@ -131,20 +126,22 @@ namespace osu.Game.Screens.Play
public BeatmapMetadataDisplay(WorkingBeatmap beatmap)
{
var metadata = beatmap?.BeatmapInfo?.Metadata ?? new BeatmapMetadata();
AutoSizeAxes = Axes.Both;
Children = new Drawable[]
{
new FlowContainer()
new FillFlowContainer()
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = new Drawable[]
{
new OsuSpriteText
{
Text = beatmap.BeatmapInfo.Metadata.Title,
Text = metadata.Title,
TextSize = 36,
Font = @"Exo2.0-MediumItalic",
Origin = Anchor.TopCentre,
@ -152,7 +149,7 @@ namespace osu.Game.Screens.Play
},
new OsuSpriteText
{
Text = beatmap.BeatmapInfo.Metadata.Artist,
Text = metadata.Artist,
TextSize = 26,
Font = @"Exo2.0-MediumItalic",
Origin = Anchor.TopCentre,
@ -179,7 +176,7 @@ namespace osu.Game.Screens.Play
},
new OsuSpriteText
{
Text = beatmap.BeatmapInfo.Version,
Text = beatmap.BeatmapInfo?.Version,
TextSize = 26,
Font = @"Exo2.0-MediumItalic",
Origin = Anchor.TopCentre,
@ -189,7 +186,7 @@ namespace osu.Game.Screens.Play
Bottom = 40
},
},
new MetadataLine("Source", beatmap.BeatmapInfo.Metadata.Source)
new MetadataLine("Source", metadata.Source)
{
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
@ -199,7 +196,7 @@ namespace osu.Game.Screens.Play
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
},
new MetadataLine("Mapper", beatmap.BeatmapInfo.Metadata.Author)
new MetadataLine("Mapper", metadata.Author)
{
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,

View File

@ -65,10 +65,10 @@ namespace osu.Game.Screens.Ranking
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = new Drawable[]
{
new OsuSpriteText

View File

@ -0,0 +1,46 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Allocation;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Overlays.Dialog;
namespace osu.Game
{
public class BeatmapDeleteDialog : PopupDialog
{
private BeatmapDatabase database;
[BackgroundDependencyLoader]
private void load(BeatmapDatabase beatmapDatabase)
{
database = beatmapDatabase;
}
public BeatmapDeleteDialog(WorkingBeatmap beatmap)
{
Icon = FontAwesome.fa_trash_o;
HeaderText = @"Confirm deletion of";
BodyText = $@"{beatmap?.Beatmap?.Metadata?.Artist} - {beatmap?.Beatmap?.Metadata?.Title}";
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = @"Yes. Totally. Delete it.",
Action = () =>
{
beatmap.Dispose();
database.Delete(beatmap.BeatmapSetInfo);
},
},
new PopupDialogCancelButton
{
Text = @"Firetruck, I didn't mean to!",
},
};
}
}
}

View File

@ -27,7 +27,7 @@ namespace osu.Game.Screens.Select
{
private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0);
private Container beatmapInfoContainer;
private BufferedContainer beatmapInfoContainer;
private OsuGameBase game;
@ -61,8 +61,8 @@ namespace osu.Game.Screens.Select
float newDepth = lastContainer?.Depth + 1 ?? 0;
BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo;
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;
BeatmapMetadata metadata = beatmap.BeatmapInfo?.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
List<InfoLabel> labels = new List<InfoLabel>();
@ -121,11 +121,11 @@ namespace osu.Game.Screens.Select
},
},
// Text for beatmap info
new FlowContainer
new FillFlowContainer
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 },
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
@ -133,7 +133,7 @@ namespace osu.Game.Screens.Select
new OsuSpriteText
{
Font = @"Exo2.0-MediumItalic",
Text = beatmapSetInfo.Metadata.Artist + " -- " + beatmapSetInfo.Metadata.Title,
Text = metadata.Artist + " -- " + metadata.Title,
TextSize = 28,
Shadow = true,
},
@ -144,10 +144,10 @@ namespace osu.Game.Screens.Select
TextSize = 17,
Shadow = true,
},
new FlowContainer
new FillFlowContainer
{
Margin = new MarginPadding { Top = 10 },
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
AutoSizeAxes = Axes.Both,
Children = new []
{
@ -161,16 +161,16 @@ namespace osu.Game.Screens.Select
new OsuSpriteText
{
Font = @"Exo2.0-Bold",
Text = beatmapSetInfo.Metadata.Author,
Text = metadata.Author,
TextSize = 15,
Shadow = true,
},
}
},
new FlowContainer
new FillFlowContainer
{
Margin = new MarginPadding { Top = 20 },
Spacing = new Vector2(40,0),
Spacing = new Vector2(40, 0),
AutoSizeAxes = Axes.Both,
Children = labels
},

View File

@ -47,7 +47,7 @@ namespace osu.Game.Screens.Select
Alpha = 0.8f,
RelativeSizeAxes = Axes.Both,
},
new FlowContainer
new FillFlowContainer
{
Padding = new MarginPadding(20),
AutoSizeAxes = Axes.Y,
@ -55,7 +55,7 @@ namespace osu.Game.Screens.Select
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Width = 0.4f, // TODO: InnerWidth property or something
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = new Drawable[]
{
searchTextBox = new SearchTextBox {
@ -185,10 +185,10 @@ namespace osu.Game.Screens.Select
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
},
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(10, 0),
Children = new Drawable[]
{
@ -217,10 +217,10 @@ namespace osu.Game.Screens.Select
}
}
},
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(10, 0),
Origin = Anchor.TopRight,
Anchor = Anchor.TopRight,

View File

@ -30,7 +30,7 @@ namespace osu.Game.Screens.Select
public Action OnBack;
public Action OnStart;
private FlowContainer buttons;
private FillFlowContainer buttons;
public OsuLogo StartButton;
@ -91,21 +91,20 @@ namespace osu.Game.Screens.Select
Origin = Anchor.BottomLeft,
Action = () => OnBack?.Invoke(),
},
new FlowContainer
new FillFlowContainer
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0),
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(padding, 0),
Children = new Drawable[]
{
buttons = new FlowContainer
buttons = new FillFlowContainer
{
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(0.2f, 0),
AutoSizeAxes = Axes.Both,
}

View File

@ -27,6 +27,7 @@ using osu.Framework.Input;
using OpenTK.Input;
using System.Collections.Generic;
using osu.Framework.Threading;
using osu.Game.Overlays;
namespace osu.Game.Screens.Select
{
@ -38,6 +39,7 @@ namespace osu.Game.Screens.Select
private CarouselContainer carousel;
private TrackManager trackManager;
private DialogOverlay dialogOverlay;
private static readonly Vector2 wedged_container_size = new Vector2(0.5f, 225);
private BeatmapInfoWedge beatmapInfoWedge;
@ -72,7 +74,7 @@ namespace osu.Game.Screens.Select
}
[BackgroundDependencyLoader(permitNulls: true)]
private void load(BeatmapDatabase beatmaps, AudioManager audio, Framework.Game game,
private void load(BeatmapDatabase beatmaps, AudioManager audio, DialogOverlay dialog, Framework.Game game,
OsuGame osuGame, OsuColour colours)
{
const float carousel_width = 640;
@ -137,7 +139,7 @@ namespace osu.Game.Screens.Select
PreferredPlayMode = playMode.Value
})).LoadAsync(Game, l => Push(player));
}
}
},
};
footer.AddButton(@"mods", colours.Yellow, null);
@ -157,6 +159,7 @@ namespace osu.Game.Screens.Select
database.BeatmapSetRemoved += onBeatmapSetRemoved;
trackManager = audio.Track;
dialogOverlay = dialog;
sampleChangeDifficulty = audio.Sample.Get(@"SongSelect/select-difficulty");
sampleChangeBeatmap = audio.Sample.Get(@"SongSelect/select-expand");
@ -399,12 +402,14 @@ namespace osu.Game.Screens.Select
footer.StartButton.TriggerClick();
return true;
case Key.Delete:
if (Beatmap != null)
if (state.Keyboard.ShiftPressed)
{
Beatmap.Dispose();
database.Delete(Beatmap.BeatmapSetInfo);
if (Beatmap != null)
dialogOverlay?.Push(new BeatmapDeleteDialog(Beatmap));
return true;
}
return true;
break;
}
return base.OnKeyDown(state, args);

View File

@ -40,19 +40,19 @@
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1340\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll</HintPath>
<HintPath>$(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SQLite.Net.Platform.Generic, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll</HintPath>
<HintPath>$(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SQLite.Net.Platform.Win32, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SQLite.Net-PCL.3.1.1\lib\net4\SQLite.Net.Platform.Win32.dll</HintPath>
<HintPath>$(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net4\SQLite.Net.Platform.Win32.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
@ -63,6 +63,8 @@
<Reference Include="SQLiteNetExtensions">
<HintPath>$(SolutionDir)\packages\SQLiteNetExtensions.1.3.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\SQLiteNetExtensions.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" />
@ -272,13 +274,19 @@
<Compile Include="Screens\Select\SearchTextBox.cs" />
<Compile Include="Screens\Select\FooterButton.cs" />
<Compile Include="Screens\Select\Footer.cs" />
<Compile Include="Overlays\Pause\PauseButton.cs" />
<Compile Include="Overlays\Pause\PauseOverlay.cs" />
<Compile Include="Overlays\Pause\PauseProgressBar.cs" />
<Compile Include="Overlays\Pause\PauseProgressGraph.cs" />
<Compile Include="Overlays\Pause\ResumeButton.cs" />
<Compile Include="Overlays\Pause\RetryButton.cs" />
<Compile Include="Overlays\Pause\QuitButton.cs" />
<Compile Include="Overlays\Dialog\PopupDialog.cs" />
<Compile Include="Graphics\UserInterface\DialogButton.cs" />
<Compile Include="Overlays\Dialog\PopupDialogButton.cs" />
<Compile Include="Overlays\Dialog\PopupDialogOKButton.cs" />
<Compile Include="Overlays\Dialog\PopupDialogCancelButton.cs" />
<Compile Include="Screens\Select\BeatmapDeleteDialog.cs" />
<Compile Include="Overlays\DialogOverlay.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\osu-framework\osu.Framework\osu.Framework.csproj">
@ -299,6 +307,9 @@
<ItemGroup />
<ItemGroup />
<ItemGroup />
<ItemGroup>
<Folder Include="Overlays\Dialog\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -6,7 +6,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<packages>
<package id="DotNetZip" version="1.10.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1339" targetFramework="net45" />
<package id="ppy.OpenTK" version="2.0.50727.1340" 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="SQLiteNetExtensions" version="1.3.0" targetFramework="net45" />