Merge branch 'master' into followpoints

This commit is contained in:
Dean Herbert
2017-02-13 22:23:57 +09:00
committed by GitHub
63 changed files with 569 additions and 225 deletions

View File

@ -1,6 +1,4 @@
The MIT License Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -18,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@ -20,6 +20,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@ -28,6 +29,7 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="mscorlib" /> <Reference Include="mscorlib" />

View File

@ -71,7 +71,7 @@ namespace osu.Desktop.VisualTests.Tests
Add(flow = new FlowContainer Add(flow = new FlowContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Direction = FlowDirection.VerticalOnly Direction = FlowDirections.Vertical
}); });
SpriteText loading; SpriteText loading;

View File

@ -88,13 +88,13 @@ namespace osu.Desktop.VisualTests.Tests
if (n.Progress < 1) if (n.Progress < 1)
n.Progress += (float)(Time.Elapsed / 2000) * RNG.NextSingle(); n.Progress += (float)(Time.Elapsed / 2000) * RNG.NextSingle();
else else
n.Complete(); n.State = ProgressNotificationState.Completed;
} }
} }
private void sendProgress2() private void sendProgress2()
{ {
var n = new ProgressNotification(@"Downloading Haitai..."); var n = new ProgressNotification { Text = @"Downloading Haitai..." };
manager.Post(n); manager.Post(n);
progressingNotifications.Add(n); progressingNotifications.Add(n);
} }
@ -103,19 +103,19 @@ namespace osu.Desktop.VisualTests.Tests
private void sendProgress1() private void sendProgress1()
{ {
var n = new ProgressNotification(@"Uploading to BSS..."); var n = new ProgressNotification { Text = @"Uploading to BSS..." };
manager.Post(n); manager.Post(n);
progressingNotifications.Add(n); progressingNotifications.Add(n);
} }
private void sendNotification2() private void sendNotification2()
{ {
manager.Post(new SimpleNotification(@"You are amazing")); manager.Post(new SimpleNotification { Text = @"You are amazing" });
} }
private void sendNotification1() private void sendNotification1()
{ {
manager.Post(new SimpleNotification(@"Welcome to osu!. Enjoy your stay!")); manager.Post(new SimpleNotification { Text = @"Welcome to osu!. Enjoy your stay!" });
} }
} }
} }

View File

@ -59,6 +59,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>false</RunCodeAnalysis> <RunCodeAnalysis>false</RunCodeAnalysis>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
@ -73,6 +74,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<Win32Resource> <Win32Resource>

View File

@ -20,27 +20,22 @@ namespace osu.Desktop.Beatmaps.IO
public static void Register() => AddReader<LegacyFilesystemReader>((storage, path) => Directory.Exists(path)); public static void Register() => AddReader<LegacyFilesystemReader>((storage, path) => Directory.Exists(path));
private string basePath { get; set; } private string basePath { get; set; }
private string[] beatmaps { get; set; }
private Beatmap firstMap { get; set; } private Beatmap firstMap { get; set; }
public LegacyFilesystemReader(string path) public LegacyFilesystemReader(string path)
{ {
basePath = path; basePath = path;
beatmaps = Directory.GetFiles(basePath, @"*.osu").Select(f => Path.GetFileName(f)).ToArray(); BeatmapFilenames = Directory.GetFiles(basePath, @"*.osu").Select(f => Path.GetFileName(f)).ToArray();
if (beatmaps.Length == 0) if (BeatmapFilenames.Length == 0)
throw new FileNotFoundException(@"This directory contains no beatmaps"); throw new FileNotFoundException(@"This directory contains no beatmaps");
using (var stream = new StreamReader(GetStream(beatmaps[0]))) StoryboardFilename = Directory.GetFiles(basePath, @"*.osb").Select(f => Path.GetFileName(f)).FirstOrDefault();
using (var stream = new StreamReader(GetStream(BeatmapFilenames[0])))
{ {
var decoder = BeatmapDecoder.GetDecoder(stream); var decoder = BeatmapDecoder.GetDecoder(stream);
firstMap = decoder.Decode(stream); firstMap = decoder.Decode(stream);
} }
} }
public override string[] ReadBeatmaps()
{
return beatmaps;
}
public override Stream GetStream(string name) public override Stream GetStream(string name)
{ {
return File.OpenRead(Path.Combine(basePath, name)); return File.OpenRead(Path.Combine(basePath, name));

View File

@ -11,6 +11,9 @@ using System.Windows.Forms;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Framework.Desktop.Platform; using osu.Framework.Desktop.Platform;
using osu.Game.Database; using osu.Game.Database;
using osu.Desktop.Overlays;
using System.Reflection;
using System.Drawing;
namespace osu.Desktop namespace osu.Desktop
{ {
@ -22,12 +25,22 @@ namespace osu.Desktop
} }
protected override void LoadComplete()
{
base.LoadComplete();
(new VersionManager()).Preload(this, Add);
}
public override void SetHost(BasicGameHost host) public override void SetHost(BasicGameHost host)
{ {
base.SetHost(host); base.SetHost(host);
var desktopWindow = host.Window as DesktopGameWindow; var desktopWindow = host.Window as DesktopGameWindow;
if (desktopWindow != null) if (desktopWindow != null)
{ {
desktopWindow.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
desktopWindow.Title = @"osu!lazer";
desktopWindow.DragEnter += dragEnter; desktopWindow.DragEnter += dragEnter;
desktopWindow.DragDrop += dragDrop; desktopWindow.DragDrop += dragDrop;
} }

View File

@ -0,0 +1,97 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using osu.Game.Overlays.Notifications;
using Squirrel;
using System.Reflection;
namespace osu.Desktop.Overlays
{
public class VersionManager : OverlayContainer
{
private UpdateManager updateManager;
private NotificationManager notification;
[BackgroundDependencyLoader]
private void load(NotificationManager notification)
{
this.notification = notification;
AutoSizeAxes = Axes.Both;
Anchor = Anchor.BottomCentre;
Origin = Anchor.BottomCentre;
var asm = Assembly.GetEntryAssembly().GetName();
Add(new OsuSpriteText
{
Text = $@"osu!lazer v{asm.Version}"
});
updateChecker();
}
protected override void LoadComplete()
{
base.LoadComplete();
State = Visibility.Visible;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
updateManager?.Dispose();
}
private async void updateChecker()
{
updateManager = await UpdateManager.GitHubUpdateManager(@"https://github.com/ppy/osu", @"osulazer", null, null, true);
if (!updateManager.IsInstalledApp)
return;
var info = await updateManager.CheckForUpdate();
if (info.ReleasesToApply.Count > 0)
{
ProgressNotification n = new UpdateProgressNotification
{
Text = @"Downloading update..."
};
Schedule(() => notification.Post(n));
Schedule(() => n.State = ProgressNotificationState.Active);
await updateManager.DownloadReleases(info.ReleasesToApply, (int p) => Schedule(() => n.Progress = p / 100f));
Schedule(() => n.Text = @"Installing update...");
await updateManager.ApplyReleases(info, (int p) => Schedule(() => n.Progress = p / 100f));
Schedule(() => n.State = ProgressNotificationState.Completed);
}
else
{
//check again every 30 minutes.
Scheduler.AddDelayed(updateChecker, 60000 * 30);
}
}
protected override void PopIn()
{
}
protected override void PopOut()
{
}
class UpdateProgressNotification : ProgressNotification
{
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification(this)
{
Text = @"Update ready to install. Click to restart!",
Activated = () =>
{
UpdateManager.RestartApp();
return true;
}
};
}
}
}

View File

@ -0,0 +1,26 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("osu!lazer")]
[assembly: AssemblyDescription("click the circles. to the beat.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ppy Pty Ltd")]
[assembly: AssemblyProduct("osu!lazer")]
[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("55e28cb2-7b6c-4595-8dcc-9871d8aad7e9")]
[assembly: AssemblyVersion("0.0.5")]
[assembly: AssemblyFileVersion("0.0.5")]

11
osu.Desktop/app.config Normal file
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-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -59,6 +59,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>false</RunCodeAnalysis> <RunCodeAnalysis>false</RunCodeAnalysis>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<Commandlineparameters> <Commandlineparameters>
</Commandlineparameters> </Commandlineparameters>
</PropertyGroup> </PropertyGroup>
@ -75,21 +76,76 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<Win32Resource>osu!.res</Win32Resource> <Win32Resource>
</Win32Resource>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>lazer.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<Private>True</Private>
</Reference>
<Reference Include="mscorlib" /> <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>
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4" /> <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>
<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>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\osu.licenseheader"> <None Include="..\osu.licenseheader">
<Link>osu.licenseheader</Link> <Link>osu.licenseheader</Link>
</None> </None>
<None Include="app.config" />
<None Include="osu!.res" /> <None Include="osu!.res" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" /> <None Include="Properties\app.manifest" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -155,10 +211,14 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="OsuGameDesktop.cs" /> <Compile Include="OsuGameDesktop.cs" />
<Compile Include="Overlays\VersionManager.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Beatmaps\IO\LegacyFilesystemReader.cs" /> <Compile Include="Beatmaps\IO\LegacyFilesystemReader.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="lazer.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<ItemGroup /> <ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DeltaCompressionDotNet" version="1.0.0" targetFramework="net45" />
<package id="Mono.Cecil" version="0.9.6.1" targetFramework="net45" />
<package id="Splat" version="1.6.2" targetFramework="net45" />
<package id="squirrel.windows" version="1.5.2" targetFramework="net45" />
</packages>

View File

@ -20,6 +20,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@ -28,6 +29,7 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<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=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">

View File

@ -20,6 +20,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@ -28,6 +29,7 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<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=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">

View File

@ -24,7 +24,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
Origin = Anchor.Centre; Origin = Anchor.Centre;
Direction = FlowDirection.VerticalOnly; Direction = FlowDirections.Vertical;
Spacing = new Vector2(0, 2); Spacing = new Vector2(0, 2);
Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset; Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset;

View File

@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@ -29,6 +30,7 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<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=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">

View File

@ -20,6 +20,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@ -28,6 +29,7 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<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=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">

View File

@ -39,7 +39,7 @@ namespace osu.Game.Tests.Beatmaps.IO
"Soleily - Renatus (MMzz) [Muzukashii].osu", "Soleily - Renatus (MMzz) [Muzukashii].osu",
"Soleily - Renatus (MMzz) [Oni].osu" "Soleily - Renatus (MMzz) [Oni].osu"
}; };
var maps = reader.ReadBeatmaps(); var maps = reader.BeatmapFilenames;
foreach (var map in expected) foreach (var map in expected)
Assert.Contains(map, maps); Assert.Contains(map, maps);
} }

View File

@ -18,6 +18,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause> <ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize> <Optimize>true</Optimize>
@ -25,6 +26,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause> <ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">

View File

@ -77,7 +77,7 @@ namespace osu.Game.Beatmaps.Drawables
new FlowContainer new FlowContainer
{ {
Padding = new MarginPadding(5), Padding = new MarginPadding(5),
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
@ -93,13 +93,13 @@ namespace osu.Game.Beatmaps.Drawables
{ {
Padding = new MarginPadding { Left = 5 }, Padding = new MarginPadding { Left = 5 },
Spacing = new Vector2(0, 5), Spacing = new Vector2(0, 5),
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
new FlowContainer new FlowContainer
{ {
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Spacing = new Vector2(4, 0), Spacing = new Vector2(4, 0),
Children = new[] Children = new[]

View File

@ -39,7 +39,7 @@ namespace osu.Game.Beatmaps.Drawables
}, },
new FlowContainer new FlowContainer
{ {
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
Padding = new MarginPadding { Top = 5, Left = 18, Right = 10, Bottom = 10 }, Padding = new MarginPadding { Top = 5, Left = 18, Right = 10, Bottom = 10 },
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Children = new[] Children = new[]
@ -113,7 +113,7 @@ namespace osu.Game.Beatmaps.Drawables
new FlowContainer new FlowContainer
{ {
Depth = -1, Depth = -1,
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
// This makes the gradient not be perfectly horizontal, but diagonal at a ~40<34> angle // This makes the gradient not be perfectly horizontal, but diagonal at a ~40<34> angle
Shear = new Vector2(0.8f, 0), Shear = new Vector2(0.8f, 0),

View File

@ -7,6 +7,8 @@ using System.IO;
using osu.Game.Modes.Objects; using osu.Game.Modes.Objects;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Beatmaps.Timing;
using osu.Game.Database;
namespace osu.Game.Beatmaps.Formats namespace osu.Game.Beatmaps.Formats
{ {
@ -34,6 +36,11 @@ namespace osu.Game.Beatmaps.Formats
return b; return b;
} }
public virtual void Decode(TextReader stream, Beatmap beatmap)
{
ParseFile(stream, beatmap);
}
public virtual Beatmap Process(Beatmap beatmap) public virtual Beatmap Process(Beatmap beatmap)
{ {
ApplyColours(beatmap); ApplyColours(beatmap);
@ -41,7 +48,23 @@ namespace osu.Game.Beatmaps.Formats
return beatmap; return beatmap;
} }
protected abstract Beatmap ParseFile(TextReader stream); protected virtual Beatmap ParseFile(TextReader stream)
{
var beatmap = new Beatmap
{
HitObjects = new List<HitObject>(),
ControlPoints = new List<ControlPoint>(),
ComboColors = new List<Color4>(),
BeatmapInfo = new BeatmapInfo
{
Metadata = new BeatmapMetadata(),
BaseDifficulty = new BaseDifficulty(),
},
};
ParseFile(stream, beatmap);
return beatmap;
}
protected abstract void ParseFile(TextReader stream, Beatmap beatmap);
public virtual void ApplyColours(Beatmap b) public virtual void ApplyColours(Beatmap b)
{ {

View File

@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps.Formats
{ {
public class ConstructableBeatmapDecoder : BeatmapDecoder public class ConstructableBeatmapDecoder : BeatmapDecoder
{ {
protected override Beatmap ParseFile(TextReader stream) protected override void ParseFile(TextReader stream, Beatmap beatmap)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

View File

@ -233,20 +233,8 @@ namespace osu.Game.Beatmaps.Formats
}); });
} }
protected override Beatmap ParseFile(TextReader stream) protected override void ParseFile(TextReader stream, Beatmap beatmap)
{ {
var beatmap = new Beatmap
{
HitObjects = new List<HitObject>(),
ControlPoints = new List<ControlPoint>(),
ComboColors = new List<Color4>(),
BeatmapInfo = new BeatmapInfo
{
Metadata = new BeatmapMetadata(),
BaseDifficulty = new BaseDifficulty(),
},
};
HitObjectParser parser = null; HitObjectParser parser = null;
var section = Section.None; var section = Section.None;
@ -309,8 +297,6 @@ namespace osu.Game.Beatmaps.Formats
break; break;
} }
} }
return beatmap;
} }
} }
} }

View File

@ -19,7 +19,7 @@ namespace osu.Game.Beatmaps.IO
} }
private static List<Reader> readers { get; } = new List<Reader>(); private static List<Reader> readers { get; } = new List<Reader>();
public static ArchiveReader GetReader(BasicStorage storage, string path) public static ArchiveReader GetReader(BasicStorage storage, string path)
{ {
foreach (var reader in readers) foreach (var reader in readers)
@ -29,20 +29,27 @@ namespace osu.Game.Beatmaps.IO
} }
throw new IOException(@"Unknown file format"); throw new IOException(@"Unknown file format");
} }
protected static void AddReader<T>(Func<BasicStorage, string, bool> test) where T : ArchiveReader protected static void AddReader<T>(Func<BasicStorage, string, bool> test) where T : ArchiveReader
{ {
readers.Add(new Reader { Test = test, Type = typeof(T) }); readers.Add(new Reader { Test = test, Type = typeof(T) });
} }
/// <summary> /// <summary>
/// Reads the beatmap metadata from this archive. /// Reads the beatmap metadata from this archive.
/// </summary> /// </summary>
public abstract BeatmapMetadata ReadMetadata(); public abstract BeatmapMetadata ReadMetadata();
/// <summary> /// <summary>
/// Gets a list of beatmap file names. /// Gets a list of beatmap file names.
/// </summary> /// </summary>
public abstract string[] ReadBeatmaps(); public string[] BeatmapFilenames { get; protected set; }
/// <summary>
/// The storyboard filename. Null if no storyboard is present.
/// </summary>
public string StoryboardFilename { get; protected set; }
/// <summary> /// <summary>
/// Opens a stream for reading a specific file from this archive. /// Opens a stream for reading a specific file from this archive.
/// </summary> /// </summary>

View File

@ -25,29 +25,25 @@ namespace osu.Game.Beatmaps.IO
private Stream archiveStream; private Stream archiveStream;
private ZipFile archive; private ZipFile archive;
private string[] beatmaps;
private Beatmap firstMap; private Beatmap firstMap;
public OszArchiveReader(Stream archiveStream) public OszArchiveReader(Stream archiveStream)
{ {
this.archiveStream = archiveStream; this.archiveStream = archiveStream;
archive = ZipFile.Read(archiveStream); archive = ZipFile.Read(archiveStream);
beatmaps = archive.Entries.Where(e => e.FileName.EndsWith(@".osu")) BeatmapFilenames = archive.Entries.Where(e => e.FileName.EndsWith(@".osu"))
.Select(e => e.FileName).ToArray(); .Select(e => e.FileName).ToArray();
if (beatmaps.Length == 0) if (BeatmapFilenames.Length == 0)
throw new FileNotFoundException(@"This directory contains no beatmaps"); throw new FileNotFoundException(@"This directory contains no beatmaps");
using (var stream = new StreamReader(GetStream(beatmaps[0]))) StoryboardFilename = archive.Entries.Where(e => e.FileName.EndsWith(@".osb"))
.Select(e => e.FileName).FirstOrDefault();
using (var stream = new StreamReader(GetStream(BeatmapFilenames[0])))
{ {
var decoder = BeatmapDecoder.GetDecoder(stream); var decoder = BeatmapDecoder.GetDecoder(stream);
firstMap = decoder.Decode(stream); firstMap = decoder.Decode(stream);
} }
} }
public override string[] ReadBeatmaps()
{
return beatmaps;
}
public override Stream GetStream(string name) public override Stream GetStream(string name)
{ {
ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name); ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name);

View File

@ -18,6 +18,8 @@ namespace osu.Game.Beatmaps
public readonly BeatmapSetInfo BeatmapSetInfo; public readonly BeatmapSetInfo BeatmapSetInfo;
private readonly BeatmapDatabase database; private readonly BeatmapDatabase database;
public readonly bool WithStoryboard;
private ArchiveReader getReader() => database?.GetReader(BeatmapSetInfo); private ArchiveReader getReader() => database?.GetReader(BeatmapSetInfo);
private Texture background; private Texture background;
@ -30,7 +32,7 @@ namespace osu.Game.Beatmaps
{ {
if (background != null) return background; if (background != null) return background;
if (BeatmapInfo.Metadata?.BackgroundFile == null) return null; if (BeatmapInfo?.Metadata?.BackgroundFile == null) return null;
try try
{ {
@ -58,8 +60,19 @@ namespace osu.Game.Beatmaps
try try
{ {
using (var reader = getReader()) using (var reader = getReader())
using (var stream = new StreamReader(reader.GetStream(BeatmapInfo.Path))) {
beatmap = BeatmapDecoder.GetDecoder(stream)?.Decode(stream); BeatmapDecoder decoder;
using (var stream = new StreamReader(reader.GetStream(BeatmapInfo.Path)))
{
decoder = BeatmapDecoder.GetDecoder(stream);
beatmap = decoder?.Decode(stream);
}
if (WithStoryboard && beatmap != null && BeatmapSetInfo.StoryboardFile != null)
using (var stream = new StreamReader(reader.GetStream(BeatmapSetInfo.StoryboardFile)))
decoder?.Decode(stream, beatmap);
}
} }
catch { } catch { }
@ -103,11 +116,12 @@ namespace osu.Game.Beatmaps
this.beatmap = beatmap; this.beatmap = beatmap;
} }
public WorkingBeatmap(BeatmapInfo beatmapInfo, BeatmapSetInfo beatmapSetInfo, BeatmapDatabase database) public WorkingBeatmap(BeatmapInfo beatmapInfo, BeatmapSetInfo beatmapSetInfo, BeatmapDatabase database, bool withStoryboard = false)
{ {
BeatmapInfo = beatmapInfo; BeatmapInfo = beatmapInfo;
BeatmapSetInfo = beatmapSetInfo; BeatmapSetInfo = beatmapSetInfo;
this.database = database; this.database = database;
this.WithStoryboard = withStoryboard;
} }
private bool isDisposed; private bool isDisposed;

View File

@ -83,64 +83,67 @@ namespace osu.Game.Database
connection.DeleteAll<BeatmapInfo>(); connection.DeleteAll<BeatmapInfo>();
} }
public void Import(params string[] paths) public void Import(IEnumerable<string> paths)
{ {
foreach (string p in paths) foreach (string p in paths)
Import(p);
}
public void Import(string path)
{
string hash = null;
BeatmapMetadata metadata;
using (var reader = ArchiveReader.GetReader(storage, path))
metadata = reader.ReadMetadata();
if (metadata.OnlineBeatmapSetID.HasValue &&
connection.Table<BeatmapSetInfo>().Count(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID) != 0)
return; // TODO: Update this beatmap instead
if (File.Exists(path)) // Not always the case, i.e. for LegacyFilesystemReader
{ {
var path = p; using (var md5 = MD5.Create())
string hash = null; using (var input = storage.GetStream(path))
BeatmapMetadata metadata;
using (var reader = ArchiveReader.GetReader(storage, path))
metadata = reader.ReadMetadata();
if (metadata.OnlineBeatmapSetID.HasValue &&
connection.Table<BeatmapSetInfo>().Count(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID) != 0)
return; // TODO: Update this beatmap instead
if (File.Exists(path)) // Not always the case, i.e. for LegacyFilesystemReader
{ {
using (var md5 = MD5.Create()) hash = BitConverter.ToString(md5.ComputeHash(input)).Replace("-", "").ToLowerInvariant();
using (var input = storage.GetStream(path)) input.Seek(0, SeekOrigin.Begin);
{ path = Path.Combine(@"beatmaps", hash.Remove(1), hash.Remove(2), hash);
hash = BitConverter.ToString(md5.ComputeHash(input)).Replace("-", "").ToLowerInvariant(); using (var output = storage.GetStream(path, FileAccess.Write))
input.Seek(0, SeekOrigin.Begin); input.CopyTo(output);
path = Path.Combine(@"beatmaps", hash.Remove(1), hash.Remove(2), hash);
using (var output = storage.GetStream(path, FileAccess.Write))
input.CopyTo(output);
}
} }
var beatmapSet = new BeatmapSetInfo
{
OnlineBeatmapSetID = metadata.OnlineBeatmapSetID,
Beatmaps = new List<BeatmapInfo>(),
Path = path,
Hash = hash,
Metadata = metadata
};
using (var reader = ArchiveReader.GetReader(storage, path))
{
string[] mapNames = reader.ReadBeatmaps();
foreach (var name in mapNames)
{
using (var stream = new StreamReader(reader.GetStream(name)))
{
var decoder = BeatmapDecoder.GetDecoder(stream);
Beatmap beatmap = decoder.Decode(stream);
beatmap.BeatmapInfo.Path = name;
// TODO: Diff beatmap metadata with set metadata and leave it here if necessary
beatmap.BeatmapInfo.Metadata = null;
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
}
}
}
Import(new[] { beatmapSet });
} }
var beatmapSet = new BeatmapSetInfo
{
OnlineBeatmapSetID = metadata.OnlineBeatmapSetID,
Beatmaps = new List<BeatmapInfo>(),
Path = path,
Hash = hash,
Metadata = metadata
};
using (var reader = ArchiveReader.GetReader(storage, path))
{
string[] mapNames = reader.BeatmapFilenames;
foreach (var name in mapNames)
{
using (var stream = new StreamReader(reader.GetStream(name)))
{
var decoder = BeatmapDecoder.GetDecoder(stream);
Beatmap beatmap = decoder.Decode(stream);
beatmap.BeatmapInfo.Path = name;
// TODO: Diff beatmap metadata with set metadata and leave it here if necessary
beatmap.BeatmapInfo.Metadata = null;
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
}
beatmapSet.StoryboardFile = reader.StoryboardFilename;
}
}
Import(new[] { beatmapSet });
} }
public void Import(IEnumerable<BeatmapSetInfo> beatmapSets) public void Import(IEnumerable<BeatmapSetInfo> beatmapSets)
@ -169,7 +172,7 @@ namespace osu.Game.Database
return Query<BeatmapSetInfo>().FirstOrDefault(s => s.OnlineBeatmapSetID == id); return Query<BeatmapSetInfo>().FirstOrDefault(s => s.OnlineBeatmapSetID == id);
} }
public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null) public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null, bool withStoryboard = false)
{ {
var beatmapSetInfo = Query<BeatmapSetInfo>().FirstOrDefault(s => s.ID == beatmapInfo.BeatmapSetInfoID); var beatmapSetInfo = Query<BeatmapSetInfo>().FirstOrDefault(s => s.ID == beatmapInfo.BeatmapSetInfoID);
@ -182,7 +185,7 @@ namespace osu.Game.Database
if (beatmapInfo.Metadata == null) if (beatmapInfo.Metadata == null)
beatmapInfo.Metadata = beatmapSetInfo.Metadata; beatmapInfo.Metadata = beatmapSetInfo.Metadata;
var working = new WorkingBeatmap(beatmapInfo, beatmapSetInfo, this); var working = new WorkingBeatmap(beatmapInfo, beatmapSetInfo, this, withStoryboard);
previous?.TransferTo(working); previous?.TransferTo(working);

View File

@ -27,6 +27,8 @@ namespace osu.Game.Database
public string Hash { get; set; } public string Hash { get; set; }
public string Path { get; set; } public string Path { get; set; }
public string StoryboardFile { get; set; }
} }
} }

View File

@ -22,7 +22,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
new FlowContainer new FlowContainer
{ {
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Children = new Drawable[] Children = new Drawable[]

View File

@ -42,7 +42,7 @@ namespace osu.Game.Online.Chat.Drawables
{ {
flow = new FlowContainer flow = new FlowContainer
{ {
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Spacing = new Vector2(1, 1) Spacing = new Vector2(1, 1)

View File

@ -24,6 +24,7 @@ using osu.Game.Screens.Menu;
using OpenTK; using OpenTK;
using System.Linq; using System.Linq;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Primitives;
using System.Collections.Generic;
namespace osu.Game namespace osu.Game
{ {
@ -67,14 +68,17 @@ namespace osu.Game
} }
if (args?.Length > 0) if (args?.Length > 0)
ImportBeatmaps(args); {
var paths = args.Where(a => !a.StartsWith(@"-"));
ImportBeatmaps(paths);
}
Dependencies.Cache(this); Dependencies.Cache(this);
PlayMode = LocalConfig.GetBindable<PlayMode>(OsuConfig.PlayMode); PlayMode = LocalConfig.GetBindable<PlayMode>(OsuConfig.PlayMode);
} }
public void ImportBeatmaps(params string[] paths) public void ImportBeatmaps(IEnumerable<string> paths)
{ {
Schedule(delegate { Dependencies.Get<BeatmapDatabase>().Import(paths); }); Schedule(delegate { Dependencies.Get<BeatmapDatabase>().Import(paths); });
} }

View File

@ -240,7 +240,6 @@ namespace osu.Game.Overlays
if (current?.TrackLoaded ?? false) if (current?.TrackLoaded ?? false)
{ {
progress.UpdatePosition((float)(current.Track.CurrentTime / current.Track.Length)); progress.UpdatePosition((float)(current.Track.CurrentTime / current.Track.Length));
playButton.Icon = current.Track.IsRunning ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o; playButton.Icon = current.Track.IsRunning ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o;

View File

@ -45,7 +45,7 @@ namespace osu.Game.Overlays
{ {
sections = new FlowContainer<NotificationSection> sections = new FlowContainer<NotificationSection>
{ {
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Children = new [] Children = new []
@ -73,6 +73,8 @@ namespace osu.Game.Overlays
public void Post(Notification notification) public void Post(Notification notification)
{ {
State = Visibility.Visible;
++runningDepth; ++runningDepth;
notification.Depth = notification.DisplayOnTop ? runningDepth : -runningDepth; notification.Depth = notification.DisplayOnTop ? runningDepth : -runningDepth;

View File

@ -53,8 +53,7 @@ namespace osu.Game.Overlays.Notifications
} }
} }
[BackgroundDependencyLoader] public Notification()
private void load(OsuColour colours)
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;

View File

@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Notifications
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Direction = FlowDirection.VerticalOnly; Direction = FlowDirections.Vertical;
Padding = new MarginPadding Padding = new MarginPadding
{ {

View File

@ -1,6 +1,8 @@
// 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.Game.Graphics;
namespace osu.Game.Overlays.Notifications namespace osu.Game.Overlays.Notifications
{ {
public class ProgressCompletionNotification : SimpleNotification public class ProgressCompletionNotification : SimpleNotification
@ -8,9 +10,9 @@ namespace osu.Game.Overlays.Notifications
private ProgressNotification progressNotification; private ProgressNotification progressNotification;
public ProgressCompletionNotification(ProgressNotification progressNotification) public ProgressCompletionNotification(ProgressNotification progressNotification)
: base(@"Task has completed!")
{ {
this.progressNotification = progressNotification; this.progressNotification = progressNotification;
Icon = FontAwesome.fa_check;
} }
} }
} }

View File

@ -16,50 +16,91 @@ namespace osu.Game.Overlays.Notifications
{ {
public class ProgressNotification : Notification, IHasCompletionTarget public class ProgressNotification : Notification, IHasCompletionTarget
{ {
private string text; public string Text
private float progress;
public float Progress
{ {
get { return progress; } get { return textDrawable.Text; }
set set
{ {
Debug.Assert(state == ProgressNotificationState.Active); textDrawable.Text = value;
progress = value;
progressBar.Progress = progress;
} }
} }
public ProgressNotificationState State public float Progress
{
get { return progressBar.Progress; }
set
{
progressBar.Progress = value;
}
}
protected override void LoadComplete()
{
base.LoadComplete();
//we may have received changes before we were displayed.
State = state;
}
public virtual ProgressNotificationState State
{ {
get { return state; } get { return state; }
set set
{ {
bool stateChanged = state != value;
state = value; state = value;
switch (state)
if (IsLoaded)
{ {
case ProgressNotificationState.Queued: switch (state)
Light.Colour = colourQueued; {
Light.Pulsate = false; case ProgressNotificationState.Queued:
progressBar.Active = false; Light.Colour = colourQueued;
break; Light.Pulsate = false;
case ProgressNotificationState.Active: progressBar.Active = false;
Light.Colour = colourActive; break;
Light.Pulsate = true; case ProgressNotificationState.Active:
progressBar.Active = true; Light.Colour = colourActive;
break; Light.Pulsate = true;
case ProgressNotificationState.Cancelled: progressBar.Active = true;
Light.Colour = colourCancelled; break;
Light.Pulsate = false; case ProgressNotificationState.Cancelled:
progressBar.Active = false; Light.Colour = colourCancelled;
break; Light.Pulsate = false;
progressBar.Active = false;
break;
}
}
if (stateChanged)
{
switch (state)
{
case ProgressNotificationState.Completed:
NotificationContent.MoveToY(-DrawSize.Y / 2, 200, EasingTypes.OutQuint);
FadeTo(0.01f, 200); //don't completely fade out or our scheduled task won't run.
Delay(100);
Schedule(Completed);
break;
}
} }
} }
} }
private ProgressNotificationState state; private ProgressNotificationState state;
public Action Completed; protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification(this)
{
Activated = CompletionClickAction,
Text = $"Task \"{Text}\" has completed!"
};
protected virtual void Completed()
{
Expire();
CompletionTarget?.Invoke(CreateCompletionNotification());
}
public override bool DisplayOnTop => false; public override bool DisplayOnTop => false;
@ -68,30 +109,21 @@ namespace osu.Game.Overlays.Notifications
private Color4 colourActive; private Color4 colourActive;
private Color4 colourCancelled; private Color4 colourCancelled;
public ProgressNotification(string text) private SpriteText textDrawable;
{
this.text = text;
}
[BackgroundDependencyLoader] public ProgressNotification()
private void load(OsuColour colours)
{ {
colourQueued = colours.YellowDark;
colourActive = colours.Blue;
colourCancelled = colours.Red;
IconContent.Add(new Box IconContent.Add(new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}); });
Content.Add(new SpriteText Content.Add(textDrawable = new SpriteText
{ {
TextSize = 16, TextSize = 16,
Colour = OsuColour.Gray(128), Colour = OsuColour.Gray(128),
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = text
}); });
NotificationContent.Add(progressBar = new ProgressBar NotificationContent.Add(progressBar = new ProgressBar
@ -104,21 +136,12 @@ namespace osu.Game.Overlays.Notifications
State = ProgressNotificationState.Queued; State = ProgressNotificationState.Queued;
} }
public void Complete() [BackgroundDependencyLoader]
private void load(OsuColour colours)
{ {
Debug.Assert(state != ProgressNotificationState.Completed); colourQueued = colours.YellowDark;
colourActive = colours.Blue;
state = ProgressNotificationState.Completed; colourCancelled = colours.Red;
NotificationContent.MoveToY(-DrawSize.Y / 2, 200, EasingTypes.OutQuint);
FadeTo(0.01f, 200); //don't completely fade out or our scheduled task won't run.
Delay(100);
Schedule(() =>
{
CompletionTarget?.Invoke(new ProgressCompletionNotification(this));
base.Close();
});
} }
public override void Close() public override void Close()
@ -135,8 +158,16 @@ namespace osu.Game.Overlays.Notifications
} }
} }
/// <summary>
/// The function to post completion notifications back to.
/// </summary>
public Action<Notification> CompletionTarget { get; set; } public Action<Notification> CompletionTarget { get; set; }
/// <summary>
/// An action to complete when the completion notification is clicked.
/// </summary>
public Func<bool> CompletionClickAction;
class ProgressBar : Container class ProgressBar : Container
{ {
private Box box; private Box box;
@ -175,7 +206,7 @@ namespace osu.Game.Overlays.Notifications
{ {
colourActive = colours.Blue; colourActive = colours.Blue;
Colour = colourInactive = OsuColour.Gray(0.5f); Colour = colourInactive = OsuColour.Gray(0.5f);
Height = 5; Height = 5;
Children = new[] Children = new[]

View File

@ -12,14 +12,31 @@ namespace osu.Game.Overlays.Notifications
public class SimpleNotification : Notification public class SimpleNotification : Notification
{ {
private string text; private string text;
public string Text
public SimpleNotification(string text)
{ {
this.text = text; get { return text; }
set
{
text = value;
textDrawable.Text = text;
}
} }
[BackgroundDependencyLoader] private FontAwesome icon = FontAwesome.fa_info_circle;
private void load(OsuColour colours) public FontAwesome Icon
{
get { return icon; }
set
{
icon = value;
iconDrawable.Icon = icon;
}
}
private SpriteText textDrawable;
private TextAwesome iconDrawable;
public SimpleNotification()
{ {
IconContent.Add(new Drawable[] IconContent.Add(new Drawable[]
{ {
@ -28,14 +45,14 @@ namespace osu.Game.Overlays.Notifications
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
ColourInfo = ColourInfo.GradientVertical(OsuColour.Gray(0.2f), OsuColour.Gray(0.5f)) ColourInfo = ColourInfo.GradientVertical(OsuColour.Gray(0.2f), OsuColour.Gray(0.5f))
}, },
new TextAwesome iconDrawable = new TextAwesome
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Icon = FontAwesome.fa_info_circle, Icon = icon ,
} }
}); });
Content.Add(new SpriteText Content.Add(textDrawable = new SpriteText
{ {
TextSize = 16, TextSize = 16,
Colour = OsuColour.Gray(128), Colour = OsuColour.Gray(128),
@ -43,7 +60,11 @@ namespace osu.Game.Overlays.Notifications
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = text Text = text
}); });
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Light.Colour = colours.Green; Light.Colour = colours.Green;
} }

View File

@ -71,7 +71,14 @@ namespace osu.Game.Overlays.Options
{ {
items = value; items = value;
if(dropdown != null) if(dropdown != null)
{
dropdown.Items = value; dropdown.Items = value;
// We need to refresh the dropdown because our items changed,
// thus its selected value may be outdated.
if (bindable != null)
dropdown.SelectedValue = bindable.Value;
}
} }
} }
@ -79,7 +86,7 @@ namespace osu.Game.Overlays.Options
{ {
Items = new KeyValuePair<string, T>[0]; Items = new KeyValuePair<string, T>[0];
Direction = FlowDirection.VerticalOnly; Direction = FlowDirections.Vertical;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Children = new Drawable[] Children = new Drawable[]

View File

@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Options
public OptionSlider() public OptionSlider()
{ {
Direction = FlowDirection.VerticalOnly; Direction = FlowDirections.Vertical;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Padding = new MarginPadding { Right = 5 }; Padding = new MarginPadding { Right = 5 };

View File

@ -61,7 +61,7 @@ namespace osu.Game.Overlays.Options
FlowContent = new FlowContainer FlowContent = new FlowContainer
{ {
Margin = new MarginPadding { Top = header_size + header_margin }, Margin = new MarginPadding { Top = header_size + header_margin },
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
Spacing = new Vector2(0, 30), Spacing = new Vector2(0, 30),
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Direction = FlowDirection.VerticalOnly; Direction = FlowDirections.Vertical;
AddInternal(new Drawable[] AddInternal(new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText
@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Options
}, },
content = new FlowContainer content = new FlowContainer
{ {
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0, 5), Spacing = new Vector2(0, 5),

View File

@ -14,6 +14,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio
protected override string Header => "Devices"; protected override string Header => "Devices";
private AudioManager audio; private AudioManager audio;
private OptionDropDown<string> dropdown;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio) private void load(AudioManager audio)
@ -21,21 +22,45 @@ namespace osu.Game.Overlays.Options.Sections.Audio
this.audio = audio; this.audio = audio;
} }
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
audio.OnNewDevice -= onDeviceChanged;
audio.OnLostDevice -= onDeviceChanged;
}
private void updateItems()
{
var deviceItems = new List<KeyValuePair<string, string>>();
deviceItems.Add(new KeyValuePair<string, string>("Default", string.Empty));
deviceItems.AddRange(audio.AudioDeviceNames.Select(d => new KeyValuePair<string, string>(d, d)));
var preferredDeviceName = audio.AudioDevice.Value;
if (!deviceItems.Any(kv => kv.Value == preferredDeviceName))
deviceItems.Add(new KeyValuePair<string, string>(preferredDeviceName, preferredDeviceName));
dropdown.Items = deviceItems;
}
private void onDeviceChanged(string name) => updateItems();
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
var deviceItems = new List<KeyValuePair<string, string>>();
deviceItems.Add(new KeyValuePair<string, string>("Default", string.Empty));
deviceItems.AddRange(audio.GetDeviceNames().Select(d => new KeyValuePair<string, string>(d, d)));
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionDropDown<string>() dropdown = new OptionDropDown<string>()
{ {
Items = deviceItems,
Bindable = audio.AudioDevice Bindable = audio.AudioDevice
}, },
}; };
updateItems();
audio.OnNewDevice += onDeviceChanged;
audio.OnLostDevice += onDeviceChanged;
} }
} }
} }

View File

@ -101,7 +101,7 @@ namespace osu.Game.Overlays.Options.Sections.General
private void load(APIAccess api, OsuConfigManager config) private void load(APIAccess api, OsuConfigManager config)
{ {
this.api = api; this.api = api;
Direction = FlowDirection.VerticalOnly; Direction = FlowDirections.Vertical;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Spacing = new Vector2(0, 5); Spacing = new Vector2(0, 5);

View File

@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Options
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Direction = FlowDirection.VerticalOnly Direction = FlowDirections.Vertical
} }
} }
}, },

View File

@ -82,7 +82,7 @@ namespace osu.Game.Overlays
{ {
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
Children = new Drawable[] Children = new Drawable[]
{ {
@ -103,7 +103,7 @@ namespace osu.Game.Overlays
{ {
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
Children = sections, Children = sections,
} }
} }
@ -141,7 +141,7 @@ namespace osu.Game.Overlays
foreach (OptionsSection section in sections) foreach (OptionsSection section in sections)
{ {
float distance = Math.Abs(scrollContainer.GetChildYInContent(section) - currentScroll); float distance = Math.Abs(scrollContainer.GetChildPosInContent(section) - currentScroll);
if (distance < bestDistance) if (distance < bestDistance)
{ {
bestDistance = distance; bestDistance = distance;

View File

@ -104,7 +104,7 @@ namespace osu.Game.Overlays.Pause
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
Spacing = new Vector2(0f, 50f), Spacing = new Vector2(0f, 50f),
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -113,7 +113,7 @@ namespace osu.Game.Overlays.Pause
new FlowContainer new FlowContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
Spacing = new Vector2(0f, 20f), Spacing = new Vector2(0f, 20f),
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,

View File

@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Toolbar
new ToolbarBackground(), new ToolbarBackground(),
new FlowContainer new FlowContainer
{ {
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X, AutoSizeAxes = Axes.X,
Children = new Drawable[] Children = new Drawable[]
@ -63,7 +63,7 @@ namespace osu.Game.Overlays.Toolbar
{ {
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X, AutoSizeAxes = Axes.X,
Children = new Drawable[] Children = new Drawable[]

View File

@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Toolbar
}, },
Flow = new FlowContainer Flow = new FlowContainer
{ {
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Padding = new MarginPadding { Left = Toolbar.HEIGHT / 2, Right = Toolbar.HEIGHT / 2 }, Padding = new MarginPadding { Left = Toolbar.HEIGHT / 2, Right = Toolbar.HEIGHT / 2 },
@ -107,7 +107,7 @@ namespace osu.Game.Overlays.Toolbar
}, },
tooltipContainer = new FlowContainer tooltipContainer = new FlowContainer
{ {
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize
Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight, Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight,
Origin = TooltipAnchor, Origin = TooltipAnchor,

View File

@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Toolbar
{ {
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X, AutoSizeAxes = Axes.X,
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Padding = new MarginPadding { Left = 10, Right = 10 }, Padding = new MarginPadding { Left = 10, Right = 10 },

View File

@ -84,7 +84,7 @@ namespace osu.Game.Screens.Backgrounds
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
Sprite.Texture = beatmap.Background; Sprite.Texture = beatmap?.Background;
} }
} }
} }

View File

@ -126,7 +126,7 @@ namespace osu.Game.Screens
}, },
childModeButtons = new FlowContainer childModeButtons = new FlowContainer
{ {
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

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

View File

@ -81,7 +81,7 @@ namespace osu.Game.Screens.Menu
}, },
buttonFlow = new FlowContainerWithOrigin buttonFlow = new FlowContainerWithOrigin
{ {
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Spacing = new Vector2(-WEDGE_WIDTH, 0), Spacing = new Vector2(-WEDGE_WIDTH, 0),

View File

@ -12,7 +12,7 @@ namespace osu.Game.Screens.Play
{ {
public KeyCounterCollection() public KeyCounterCollection()
{ {
Direction = FlowDirection.HorizontalOnly; Direction = FlowDirections.Horizontal;
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
} }

View File

@ -74,7 +74,7 @@ namespace osu.Game.Screens.Play
try try
{ {
if (Beatmap == null) if (Beatmap == null)
Beatmap = beatmaps.GetWorkingBeatmap(BeatmapInfo); Beatmap = beatmaps.GetWorkingBeatmap(BeatmapInfo, withStoryboard: true);
} }
catch catch
{ {

View File

@ -69,7 +69,7 @@ namespace osu.Game.Screens.Ranking
new FlowContainer new FlowContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText

View File

@ -127,7 +127,7 @@ namespace osu.Game.Screens.Select
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 }, Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 },
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
@ -149,7 +149,7 @@ namespace osu.Game.Screens.Select
new FlowContainer new FlowContainer
{ {
Margin = new MarginPadding { Top = 10 }, Margin = new MarginPadding { Top = 10 },
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Children = new [] Children = new []
{ {

View File

@ -43,7 +43,7 @@ namespace osu.Game.Screens.Select
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
Width = 0.4f, // TODO: InnerWidth property or something Width = 0.4f, // TODO: InnerWidth property or something
Direction = FlowDirection.VerticalOnly, Direction = FlowDirections.Vertical,
Children = new Drawable[] Children = new Drawable[]
{ {
searchTextBox = new SearchTextBox { RelativeSizeAxes = Axes.X }, searchTextBox = new SearchTextBox { RelativeSizeAxes = Axes.X },
@ -175,7 +175,7 @@ namespace osu.Game.Screens.Select
new FlowContainer new FlowContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
Spacing = new Vector2(10, 0), Spacing = new Vector2(10, 0),
Children = new Drawable[] Children = new Drawable[]
{ {
@ -207,7 +207,7 @@ namespace osu.Game.Screens.Select
new FlowContainer new FlowContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
Spacing = new Vector2(10, 0), Spacing = new Vector2(10, 0),
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,

View File

@ -94,14 +94,14 @@ namespace osu.Game.Screens.Select
Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0), Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0),
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X, AutoSizeAxes = Axes.X,
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
Spacing = new Vector2(padding, 0), Spacing = new Vector2(padding, 0),
Children = new Drawable[] Children = new Drawable[]
{ {
buttons = new FlowContainer buttons = new FlowContainer
{ {
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirections.Horizontal,
Spacing = new Vector2(0.2f, 0), Spacing = new Vector2(0.2f, 0),
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
} }

View File

@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@ -31,6 +32,7 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">