diff --git a/.gitignore b/.gitignore index aa8061f0c9..7097de6024 100644 --- a/.gitignore +++ b/.gitignore @@ -255,4 +255,5 @@ paket-files/ # Python Tools for Visual Studio (PTVS) __pycache__/ -*.pyc \ No newline at end of file +*.pyc +Staging/ diff --git a/osu-framework b/osu-framework index eae237f6a7..1cd7a165ec 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit eae237f6a7e2a6e7d7c621b2382bb08de2b470b8 +Subproject commit 1cd7a165ec42cd1eeb4eee06b5a4a6cdd8c280da diff --git a/osu-resources b/osu-resources index 2a3dd3f3dd..51f2b9b37f 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 2a3dd3f3dd68fe52b779d0fdded3ce444897efee +Subproject commit 51f2b9b37f38cd349a3dd728a78f8fffcb3a54f5 diff --git a/osu.Desktop.Deploy/App.config b/osu.Desktop.Deploy/App.config new file mode 100644 index 0000000000..6272e396fb --- /dev/null +++ b/osu.Desktop.Deploy/App.config @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/osu.Desktop.Deploy/GitHubObject.cs b/osu.Desktop.Deploy/GitHubObject.cs new file mode 100644 index 0000000000..f87de5cbdd --- /dev/null +++ b/osu.Desktop.Deploy/GitHubObject.cs @@ -0,0 +1,13 @@ +using Newtonsoft.Json; + +namespace osu.Desktop.Deploy +{ + internal class GitHubObject + { + [JsonProperty(@"id")] + public int Id; + + [JsonProperty(@"name")] + public string Name; + } +} \ No newline at end of file diff --git a/osu.Desktop.Deploy/GitHubRelease.cs b/osu.Desktop.Deploy/GitHubRelease.cs new file mode 100644 index 0000000000..7e7b04fe58 --- /dev/null +++ b/osu.Desktop.Deploy/GitHubRelease.cs @@ -0,0 +1,25 @@ +using Newtonsoft.Json; + +namespace osu.Desktop.Deploy +{ + internal class GitHubRelease + { + [JsonProperty(@"id")] + public int Id; + + [JsonProperty(@"tag_name")] + public string TagName => $"v{Name}"; + + [JsonProperty(@"name")] + public string Name; + + [JsonProperty(@"draft")] + public bool Draft; + + [JsonProperty(@"prerelease")] + public bool PreRelease; + + [JsonProperty(@"upload_url")] + public string UploadUrl; + } +} \ No newline at end of file diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs new file mode 100644 index 0000000000..07374e7541 --- /dev/null +++ b/osu.Desktop.Deploy/Program.cs @@ -0,0 +1,417 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.GitHubusercontent.com/ppy/osu-framework/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net; +using Newtonsoft.Json; +using osu.Framework.IO.Network; +using FileWebRequest = osu.Framework.IO.Network.FileWebRequest; +using WebRequest = osu.Framework.IO.Network.WebRequest; + +namespace osu.Desktop.Deploy +{ + internal static class Program + { + private const string nuget_path = @"packages\NuGet.CommandLine.3.5.0\tools\NuGet.exe"; + private const string squirrel_path = @"packages\squirrel.windows.1.5.2\tools\Squirrel.exe"; + private const string msbuild_path = @"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"; + + public static string StagingFolder = ConfigurationManager.AppSettings["StagingFolder"]; + public static string ReleasesFolder = ConfigurationManager.AppSettings["ReleasesFolder"]; + public static string GitHubAccessToken = ConfigurationManager.AppSettings["GitHubAccessToken"]; + public static string GitHubUsername = ConfigurationManager.AppSettings["GitHubUsername"]; + public static string GitHubRepoName = ConfigurationManager.AppSettings["GitHubRepoName"]; + public static string SolutionName = ConfigurationManager.AppSettings["SolutionName"]; + public static string ProjectName = ConfigurationManager.AppSettings["ProjectName"]; + public static string NuSpecName = ConfigurationManager.AppSettings["NuSpecName"]; + public static string TargetName = ConfigurationManager.AppSettings["TargetName"]; + public static string PackageName = ConfigurationManager.AppSettings["PackageName"]; + public static string IconName = ConfigurationManager.AppSettings["IconName"]; + public static string CodeSigningCertificate = ConfigurationManager.AppSettings["CodeSigningCertificate"]; + + public static string GitHubApiEndpoint => $"https://api.github.com/repos/{GitHubUsername}/{GitHubRepoName}/releases"; + public static string GitHubReleasePage => $"https://github.com/{GitHubUsername}/{GitHubRepoName}/releases"; + + /// + /// How many previous build deltas we want to keep when publishing. + /// + const int keep_delta_count = 3; + + private static string codeSigningCmd => string.IsNullOrEmpty(codeSigningPassword) ? "" : $"-n \"/a /f {codeSigningCertPath} /p {codeSigningPassword} /t http://timestamp.comodoca.com/authenticode\""; + + private static string homeDir => Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + private static string codeSigningCertPath => Path.Combine(homeDir, CodeSigningCertificate); + private static string solutionPath => Environment.CurrentDirectory; + private static string stagingPath => Path.Combine(solutionPath, StagingFolder); + private static string iconPath => Path.Combine(solutionPath, ProjectName, IconName); + + private static string nupkgFilename(string ver) => $"{PackageName}.{ver}.nupkg"; + private static string nupkgDistroFilename(string ver) => $"{PackageName}-{ver}-full.nupkg"; + + private static Stopwatch sw = new Stopwatch(); + + private static string codeSigningPassword; + + public static void Main(string[] args) + { + displayHeader(); + + findSolutionPath(); + + if (!Directory.Exists(ReleasesFolder)) + { + write("WARNING: No release directory found. Make sure you want this!", ConsoleColor.Yellow); + Directory.CreateDirectory(ReleasesFolder); + } + + checkGitHubReleases(); + + refreshDirectory(StagingFolder); + + //increment build number until we have a unique one. + string verBase = DateTime.Now.ToString("yyyy.Md."); + int increment = 0; + while (Directory.GetFiles(ReleasesFolder, $"*{verBase}{increment}*").Any()) + increment++; + + string version = $"{verBase}{increment}"; + + Console.ForegroundColor = ConsoleColor.White; + Console.Write($"Ready to deploy {version}: "); + Console.ReadLine(); + + sw.Start(); + + if (!string.IsNullOrEmpty(CodeSigningCertificate)) + { + Console.Write("Enter code signing password: "); + codeSigningPassword = readLineMasked(); + } + + write("Restoring NuGet packages..."); + runCommand(nuget_path, "restore " + solutionPath); + + write("Updating AssemblyInfo..."); + updateAssemblyInfo(version); + + write("Running build process..."); + runCommand(msbuild_path, $"/v:quiet /m /t:{TargetName.Replace('.', '_')} /p:OutputPath={stagingPath};Configuration=Release {SolutionName}.sln"); + + write("Creating NuGet deployment package..."); + runCommand(nuget_path, $"pack {NuSpecName} -Version {version} -Properties Configuration=Deploy -OutputDirectory {stagingPath} -BasePath {stagingPath}"); + + //prune once before checking for files so we can avoid erroring on files which aren't even needed for this build. + pruneReleases(); + + checkReleaseFiles(); + + write("Running squirrel build..."); + runCommand(squirrel_path, $"--releasify {stagingPath}\\{nupkgFilename(version)} --setupIcon {iconPath} --icon {iconPath} {codeSigningCmd} --no-msi"); + + //prune again to clean up before upload. + pruneReleases(); + + //rename setup to install. + File.Copy(Path.Combine(ReleasesFolder, "Setup.exe"), Path.Combine(ReleasesFolder, "install.exe"), true); + File.Delete(Path.Combine(ReleasesFolder, "Setup.exe")); + + uploadBuild(version); + + write("Done!", ConsoleColor.White); + Console.ReadLine(); + } + + private static void displayHeader() + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine(); + Console.WriteLine(" Please note that OSU! and PPY are registered trademarks and as such covered by trademark law."); + Console.WriteLine(" Do not distribute builds of this project publicly that make use of these."); + Console.ResetColor(); + Console.WriteLine(); + } + + /// + /// Ensure we have all the files in the release directory which are expected to be there. + /// This should have been accounted for in earlier steps, and just serves as a verification step. + /// + private static void checkReleaseFiles() + { + var releaseLines = getReleaseLines(); + + //ensure we have all files necessary + foreach (var l in releaseLines) + if (!File.Exists(Path.Combine(ReleasesFolder, l.Filename))) + error($"Local file missing {l.Filename}"); + } + + private static IEnumerable getReleaseLines() => File.ReadAllLines(Path.Combine(ReleasesFolder, "RELEASES")).Select(l => new ReleaseLine(l)); + + private static void pruneReleases() + { + write("Pruning RELEASES..."); + + var releaseLines = getReleaseLines().ToList(); + + var fulls = releaseLines.Where(l => l.Filename.Contains("-full")).Reverse().Skip(1); + + //remove any FULL releases (except most recent) + foreach (var l in fulls) + { + write($"- Removing old release {l.Filename}", ConsoleColor.Yellow); + File.Delete(Path.Combine(ReleasesFolder, l.Filename)); + releaseLines.Remove(l); + } + + //remove excess deltas + var deltas = releaseLines.Where(l => l.Filename.Contains("-delta")); + if (deltas.Count() > keep_delta_count) + { + foreach (var l in deltas.Take(deltas.Count() - keep_delta_count)) + { + write($"- Removing old delta {l.Filename}", ConsoleColor.Yellow); + File.Delete(Path.Combine(ReleasesFolder, l.Filename)); + releaseLines.Remove(l); + } + } + + var lines = new List(); + releaseLines.ForEach(l => lines.Add(l.ToString())); + File.WriteAllLines(Path.Combine(ReleasesFolder, "RELEASES"), lines); + } + + private static void uploadBuild(string version) + { + if (string.IsNullOrEmpty(GitHubAccessToken) || string.IsNullOrEmpty(codeSigningCertPath)) + return; + + write("Publishing to GitHub..."); + + write($"- Creating release {version}...", ConsoleColor.Yellow); + var req = new JsonWebRequest($"{GitHubApiEndpoint}") + { + Method = HttpMethod.POST + }; + req.AddRaw(JsonConvert.SerializeObject(new GitHubRelease + { + Name = version, + Draft = true, + PreRelease = true + })); + req.AuthenticatedBlockingPerform(); + + var assetUploadUrl = req.ResponseObject.UploadUrl.Replace("{?name,label}", "?name={0}"); + foreach (var a in Directory.GetFiles(ReleasesFolder).Reverse()) //reverse to upload RELEASES first. + { + write($"- Adding asset {a}...", ConsoleColor.Yellow); + var upload = new WebRequest(assetUploadUrl, Path.GetFileName(a)) + { + Method = HttpMethod.POST, + ContentType = "application/octet-stream", + }; + + upload.AddRaw(File.ReadAllBytes(a)); + upload.AuthenticatedBlockingPerform(); + } + + openGitHubReleasePage(); + } + + private static void openGitHubReleasePage() => Process.Start(GitHubReleasePage); + + private static void checkGitHubReleases() + { + write("Checking GitHub releases..."); + var req = new JsonWebRequest>($"{GitHubApiEndpoint}"); + req.AuthenticatedBlockingPerform(); + + var lastRelease = req.ResponseObject.FirstOrDefault(); + + if (lastRelease == null) + return; + + if (lastRelease.Draft) + { + openGitHubReleasePage(); + error("There's a pending draft release! You probably don't want to push a build with this present."); + } + + //there's a previous release for this project. + var assetReq = new JsonWebRequest>($"{GitHubApiEndpoint}/{lastRelease.Id}/assets"); + assetReq.AuthenticatedBlockingPerform(); + var assets = assetReq.ResponseObject; + + //make sure our RELEASES file is the same as the last build on the server. + var releaseAsset = assets.FirstOrDefault(a => a.Name == "RELEASES"); + + //if we don't have a RELEASES asset then the previous release likely wasn't a Squirrel one. + if (releaseAsset == null) return; + + write($"Last GitHub release was {lastRelease.Name}."); + + bool requireDownload = false; + + if (!File.Exists(Path.Combine(ReleasesFolder, nupkgDistroFilename(lastRelease.Name)))) + { + write("Last verion's package not found locally.", ConsoleColor.Red); + requireDownload = true; + } + else + { + var lastReleases = new RawFileWebRequest($"{GitHubApiEndpoint}/assets/{releaseAsset.Id}"); + lastReleases.AuthenticatedBlockingPerform(); + if (File.ReadAllText(Path.Combine(ReleasesFolder, "RELEASES")) != lastReleases.ResponseString) + { + write("Server's RELEASES differed from ours.", ConsoleColor.Red); + requireDownload = true; + } + } + + if (!requireDownload) return; + + write("Refreshing local releases directory..."); + refreshDirectory(ReleasesFolder); + + foreach (var a in assets) + { + write($"- Downloading {a.Name}...", ConsoleColor.Yellow); + new FileWebRequest(Path.Combine(ReleasesFolder, a.Name), $"{GitHubApiEndpoint}/assets/{a.Id}").AuthenticatedBlockingPerform(); + } + } + + private static void refreshDirectory(string directory) + { + if (Directory.Exists(directory)) + Directory.Delete(directory, true); + Directory.CreateDirectory(directory); + } + + private static void updateAssemblyInfo(string version) + { + string file = Path.Combine(ProjectName, "Properties", "AssemblyInfo.cs"); + + var l1 = File.ReadAllLines(file); + List l2 = new List(); + foreach (var l in l1) + { + if (l.StartsWith("[assembly: AssemblyVersion(")) + l2.Add($"[assembly: AssemblyVersion(\"{version}\")]"); + else if (l.StartsWith("[assembly: AssemblyFileVersion(")) + l2.Add($"[assembly: AssemblyFileVersion(\"{version}\")]"); + else + l2.Add(l); + } + + File.WriteAllLines(file, l2); + } + + /// + /// Find the base path of the active solution (git checkout location) + /// + private static void findSolutionPath() + { + string path = Path.GetDirectoryName(Environment.CommandLine.Replace("\"", "").Trim()); + + if (string.IsNullOrEmpty(path)) + path = Environment.CurrentDirectory; + + while (!File.Exists(Path.Combine(path, $"{SolutionName}.sln"))) + path = path.Remove(path.LastIndexOf('\\')); + path += "\\"; + + Environment.CurrentDirectory = path; + } + + private static bool runCommand(string command, string args) + { + var psi = new ProcessStartInfo(command, args) + { + WorkingDirectory = solutionPath, + CreateNoWindow = true, + RedirectStandardOutput = true, + UseShellExecute = false, + WindowStyle = ProcessWindowStyle.Hidden + }; + + Process p = Process.Start(psi); + string output = p.StandardOutput.ReadToEnd(); + if (p.ExitCode == 0) return true; + + write(output); + error($"Command {command} {args} failed!"); + return false; + } + + private static string readLineMasked() + { + var fg = Console.ForegroundColor; + Console.ForegroundColor = Console.BackgroundColor; + var ret = Console.ReadLine(); + Console.ForegroundColor = fg; + + return ret; + } + + private static void error(string message) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine($"FATAL ERROR: {message}"); + + Console.ReadLine(); + Environment.Exit(-1); + } + + private static void write(string message, ConsoleColor col = ConsoleColor.Gray) + { + if (sw.ElapsedMilliseconds > 0) + { + Console.ForegroundColor = ConsoleColor.Green; + Console.Write(sw.ElapsedMilliseconds.ToString().PadRight(8)); + } + Console.ForegroundColor = col; + Console.WriteLine(message); + } + + public static void AuthenticatedBlockingPerform(this WebRequest r) + { + r.AddHeader("Authorization", $"token {GitHubAccessToken}"); + r.BlockingPerform(); + } + } + + internal class RawFileWebRequest : WebRequest + { + public RawFileWebRequest(string url) : base(url) + { + } + + protected override HttpWebRequest CreateWebRequest(string requestString = null) + { + var req = base.CreateWebRequest(requestString); + req.Accept = "application/octet-stream"; + return req; + } + } + + internal class ReleaseLine + { + public string Hash; + public string Filename; + public int Filesize; + + public ReleaseLine(string line) + { + var split = line.Split(' '); + Hash = split[0]; + Filename = split[1]; + Filesize = int.Parse(split[2]); + } + + public override string ToString() => $"{Hash} {Filename} {Filesize}"; + } +} diff --git a/osu.Desktop.Deploy/Properties/AssemblyInfo.cs b/osu.Desktop.Deploy/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..c71d82df00 --- /dev/null +++ b/osu.Desktop.Deploy/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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.Desktop.Deploy")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("osu.Desktop.Deploy")] +[assembly: AssemblyCopyright("Copyright © 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("baea2f74-0315-4667-84e0-acac0b4bf785")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj new file mode 100644 index 0000000000..122c2ec0d6 --- /dev/null +++ b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj @@ -0,0 +1,125 @@ + + + + + Debug + AnyCPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785} + Exe + Properties + osu.Desktop.Deploy + osu.Desktop.Deploy + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + osu.Desktop.Deploy.Program + + + + ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll + True + + + ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.MsDelta.dll + True + + + ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.PatchApi.dll + True + + + ..\packages\squirrel.windows.1.5.2\lib\Net45\ICSharpCode.SharpZipLib.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll + True + + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + True + + + ..\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll + True + + + ..\packages\Splat.1.6.2\lib\Net45\Splat.dll + True + + + ..\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll + True + + + + + + + + + + + + + + + + + + + + + + + + {65dc628f-a640-4111-ab35-3a5652bc1e17} + osu.Framework.Desktop + + + {C76BF5B3-985E-4D39-95FE-97C9C879B83A} + osu.Framework + + + + + \ No newline at end of file diff --git a/osu.Desktop.Deploy/packages.config b/osu.Desktop.Deploy/packages.config new file mode 100644 index 0000000000..b7c4b9c3bb --- /dev/null +++ b/osu.Desktop.Deploy/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/osu.Desktop.Tests/app.config b/osu.Desktop.Tests/app.config index 44ccc4b77a..b9af3fdc80 100644 --- a/osu.Desktop.Tests/app.config +++ b/osu.Desktop.Tests/app.config @@ -1,4 +1,8 @@  + diff --git a/osu.Desktop.Tests/osu.Desktop.Tests.csproj b/osu.Desktop.Tests/osu.Desktop.Tests.csproj index 2c88548c3e..7a5bd59074 100644 --- a/osu.Desktop.Tests/osu.Desktop.Tests.csproj +++ b/osu.Desktop.Tests/osu.Desktop.Tests.csproj @@ -100,6 +100,9 @@ + + osu.licenseheader + diff --git a/osu.Desktop.Tests/packages.config b/osu.Desktop.Tests/packages.config index 05b53c019c..76b22db9d4 100644 --- a/osu.Desktop.Tests/packages.config +++ b/osu.Desktop.Tests/packages.config @@ -1,4 +1,8 @@  + diff --git a/osu.Desktop.VisualTests/OpenTK.dll.config b/osu.Desktop.VisualTests/OpenTK.dll.config index 1dd145f0c4..627e9f6009 100644 --- a/osu.Desktop.VisualTests/OpenTK.dll.config +++ b/osu.Desktop.VisualTests/OpenTK.dll.config @@ -1,8 +1,7 @@ - diff --git a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs b/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs index 0e83010caf..54f3957014 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs @@ -71,7 +71,7 @@ namespace osu.Desktop.VisualTests.Tests Add(flow = new FlowContainer { RelativeSizeAxes = Axes.Both, - Direction = FlowDirection.VerticalOnly + Direction = FlowDirections.Vertical }); SpriteText loading; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseNotificationManager.cs b/osu.Desktop.VisualTests/Tests/TestCaseNotificationManager.cs index 77b313f4ad..0b84eeaa30 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseNotificationManager.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseNotificationManager.cs @@ -26,8 +26,6 @@ namespace osu.Desktop.VisualTests.Tests progressingNotifications.Clear(); - AddInternal(new BackgroundModeDefault() { Depth = 10 }); - Content.Add(manager = new NotificationManager { Anchor = Anchor.TopRight, diff --git a/osu.Desktop.VisualTests/VisualTestGame.cs b/osu.Desktop.VisualTests/VisualTestGame.cs index 952de4ab26..51fcffce57 100644 --- a/osu.Desktop.VisualTests/VisualTestGame.cs +++ b/osu.Desktop.VisualTests/VisualTestGame.cs @@ -11,6 +11,7 @@ using System.Reflection; using System.IO; using System.Collections.Generic; using osu.Framework.Allocation; +using osu.Game.Screens.Backgrounds; namespace osu.Desktop.VisualTests { @@ -20,6 +21,8 @@ namespace osu.Desktop.VisualTests { base.LoadComplete(); + (new BackgroundModeDefault() { Depth = 10 }).Preload(this, AddInternal); + // Have to construct this here, rather than in the constructor, because // we depend on some dependencies to be loaded within OsuGameBase.load(). Add(new TestBrowser()); diff --git a/osu.Desktop.VisualTests/app.config b/osu.Desktop.VisualTests/app.config index 9bad888bf3..b9af3fdc80 100644 --- a/osu.Desktop.VisualTests/app.config +++ b/osu.Desktop.VisualTests/app.config @@ -1,9 +1,8 @@  - diff --git a/osu.Desktop.VisualTests/packages.config b/osu.Desktop.VisualTests/packages.config index 75affafd35..82404c059e 100644 --- a/osu.Desktop.VisualTests/packages.config +++ b/osu.Desktop.VisualTests/packages.config @@ -1,6 +1,6 @@  diff --git a/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs b/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs index 9b699a3d76..132f14ddb5 100644 --- a/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs +++ b/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs @@ -20,27 +20,22 @@ namespace osu.Desktop.Beatmaps.IO public static void Register() => AddReader((storage, path) => Directory.Exists(path)); private string basePath { get; set; } - private string[] beatmaps { get; set; } private Beatmap firstMap { get; set; } public LegacyFilesystemReader(string path) { basePath = path; - beatmaps = Directory.GetFiles(basePath, @"*.osu").Select(f => Path.GetFileName(f)).ToArray(); - if (beatmaps.Length == 0) + BeatmapFilenames = Directory.GetFiles(basePath, @"*.osu").Select(f => Path.GetFileName(f)).ToArray(); + if (BeatmapFilenames.Length == 0) 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); firstMap = decoder.Decode(stream); } } - public override string[] ReadBeatmaps() - { - return beatmaps; - } - public override Stream GetStream(string name) { return File.OpenRead(Path.Combine(basePath, name)); diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index f941401f43..e3cffc1804 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -1,4 +1,7 @@ -using osu.Framework.Allocation; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -6,6 +9,10 @@ using osu.Game.Overlays; using osu.Game.Overlays.Notifications; using Squirrel; using System.Reflection; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Game.Graphics; +using OpenTK; namespace osu.Desktop.Overlays { @@ -14,20 +21,65 @@ namespace osu.Desktop.Overlays private UpdateManager updateManager; private NotificationManager notification; + protected override bool HideOnEscape => false; + + public override bool HandleInput => false; + [BackgroundDependencyLoader] - private void load(NotificationManager notification) + private void load(NotificationManager notification, OsuColour colours, TextureStore textures) { this.notification = notification; AutoSizeAxes = Axes.Both; Anchor = Anchor.BottomCentre; Origin = Anchor.BottomCentre; + Alpha = 0; var asm = Assembly.GetEntryAssembly().GetName(); - Add(new OsuSpriteText + Children = new Drawable[] { - Text = $@"osu!lazer v{asm.Version}" - }); + new FlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FlowDirections.Vertical, + Children = new Drawable[] + { + new FlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FlowDirections.Horizontal, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Spacing = new Vector2(5), + Children = new Drawable[] + { + new OsuSpriteText + { + Font = @"Exo2.0-Bold", + Text = $@"osu!lazer" + }, + new OsuSpriteText + { + Text = $@"{asm.Version.Major}.{asm.Version.Minor}.{asm.Version.Build}" + }, + } + }, + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + TextSize = 12, + Colour = colours.Yellow, + Font = @"Venera", + Text = $@"Development Build" + }, + new Sprite + { + Texture = textures.Get(@"Menu/dev-build-footer"), + }, + } + } + }; updateChecker(); } @@ -75,6 +127,7 @@ namespace osu.Desktop.Overlays protected override void PopIn() { + FadeIn(1000); } protected override void PopOut() diff --git a/osu.Desktop/Properties/AssemblyInfo.cs b/osu.Desktop/Properties/AssemblyInfo.cs index 1f234d2993..c078b4caf5 100644 --- a/osu.Desktop/Properties/AssemblyInfo.cs +++ b/osu.Desktop/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -using System.Reflection; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -22,5 +25,5 @@ using System.Runtime.InteropServices; // 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")] +[assembly: AssemblyVersion("2017.212.0")] +[assembly: AssemblyFileVersion("2017.212.0")] diff --git a/osu.Desktop/app.config b/osu.Desktop/app.config index 44ccc4b77a..b9af3fdc80 100644 --- a/osu.Desktop/app.config +++ b/osu.Desktop/app.config @@ -1,4 +1,8 @@  + diff --git a/osu.Desktop/osu.nuspec b/osu.Desktop/osu.nuspec new file mode 100644 index 0000000000..2888f7c040 --- /dev/null +++ b/osu.Desktop/osu.nuspec @@ -0,0 +1,25 @@ + + + + osulazer + 0.0.0 + osulazer + ppy Pty Ltd + Dean Herbert + https://osu.ppy.sh/ + https://puu.sh/tYyXZ/9a01a5d1b0.ico + false + click the circles. to the beat. + click the circles. + testing + Copyright ppy Pty Ltd 2007-2017 + en-AU + + + + + + + + + diff --git a/osu.Desktop/packages.config b/osu.Desktop/packages.config index 8d1361bd0a..5fc8e82bfd 100644 --- a/osu.Desktop/packages.config +++ b/osu.Desktop/packages.config @@ -1,4 +1,8 @@  + diff --git a/osu.Game.Modes.Catch/OpenTK.dll.config b/osu.Game.Modes.Catch/OpenTK.dll.config index 1dd145f0c4..627e9f6009 100644 --- a/osu.Game.Modes.Catch/OpenTK.dll.config +++ b/osu.Game.Modes.Catch/OpenTK.dll.config @@ -1,8 +1,7 @@ - diff --git a/osu.Game.Modes.Catch/packages.config b/osu.Game.Modes.Catch/packages.config index 3c9e7e3fdc..d53e65896a 100644 --- a/osu.Game.Modes.Catch/packages.config +++ b/osu.Game.Modes.Catch/packages.config @@ -1,9 +1,8 @@  - \ No newline at end of file diff --git a/osu.Game.Modes.Mania/OpenTK.dll.config b/osu.Game.Modes.Mania/OpenTK.dll.config index 1dd145f0c4..627e9f6009 100644 --- a/osu.Game.Modes.Mania/OpenTK.dll.config +++ b/osu.Game.Modes.Mania/OpenTK.dll.config @@ -1,8 +1,7 @@ - diff --git a/osu.Game.Modes.Mania/app.config b/osu.Game.Modes.Mania/app.config index 9bad888bf3..b9af3fdc80 100644 --- a/osu.Game.Modes.Mania/app.config +++ b/osu.Game.Modes.Mania/app.config @@ -1,9 +1,8 @@  - diff --git a/osu.Game.Modes.Mania/packages.config b/osu.Game.Modes.Mania/packages.config index 3c9e7e3fdc..d53e65896a 100644 --- a/osu.Game.Modes.Mania/packages.config +++ b/osu.Game.Modes.Mania/packages.config @@ -1,9 +1,8 @@  - \ No newline at end of file diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs b/osu.Game.Modes.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs new file mode 100644 index 0000000000..a680c847ac --- /dev/null +++ b/osu.Game.Modes.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Containers; +using osu.Game.Modes.Objects; +using System.Collections.Generic; + +namespace osu.Game.Modes.Osu.Objects.Drawables.Connections +{ + /// + /// Connects hit objects visually, for example with follow points. + /// + public abstract class ConnectionRenderer : Container + where T : HitObject + { + /// + /// Hit objects to create connections for + /// + public abstract IEnumerable HitObjects { get; set; } + } +} diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPoint.cs b/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPoint.cs new file mode 100644 index 0000000000..bc24186e14 --- /dev/null +++ b/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPoint.cs @@ -0,0 +1,67 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transformations; +using osu.Game.Graphics; + +namespace osu.Game.Modes.Osu.Objects.Drawables.Connections +{ + public class FollowPoint : Container + { + public double StartTime; + public double EndTime; + public Vector2 EndPosition; + + const float width = 8; + + public FollowPoint() + { + Origin = Anchor.Centre; + Alpha = 0; + + Masking = true; + AutoSizeAxes = Axes.Both; + CornerRadius = width / 2; + EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Glow, + Colour = Color4.White.Opacity(0.2f), + Radius = 4, + }; + + Children = new Drawable[] + { + new Box + { + Size = new Vector2(width), + BlendingMode = BlendingMode.Additive, + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + Alpha = 0.5f, + }, + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + Delay(StartTime); + FadeIn(DrawableOsuHitObject.TIME_FADEIN); + ScaleTo(1.5f); + ScaleTo(1, DrawableOsuHitObject.TIME_FADEIN, EasingTypes.Out); + MoveTo(EndPosition, DrawableOsuHitObject.TIME_FADEIN, EasingTypes.Out); + + Delay(EndTime - StartTime); + FadeOut(DrawableOsuHitObject.TIME_FADEIN); + + Delay(DrawableOsuHitObject.TIME_FADEIN); + Expire(true); + } + } +} \ No newline at end of file diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs b/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs new file mode 100644 index 0000000000..b57f0881bc --- /dev/null +++ b/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs @@ -0,0 +1,97 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Game.Modes.Osu.Objects.Drawables.Connections; +using System; +using System.Collections.Generic; + +namespace osu.Game.Modes.Osu.Objects.Drawables +{ + public class FollowPointRenderer : ConnectionRenderer + { + private int pointDistance = 32; + /// + /// Determines how much space there is between points. + /// + public int PointDistance + { + get { return pointDistance; } + set + { + if (pointDistance == value) return; + pointDistance = value; + update(); + } + } + + private int preEmpt = 800; + /// + /// Follow points to the next hitobject start appearing for this many milliseconds before an hitobject's end time. + /// + public int PreEmpt + { + get { return preEmpt; } + set + { + if (preEmpt == value) return; + preEmpt = value; + update(); + } + } + + private IEnumerable hitObjects; + public override IEnumerable HitObjects + { + get { return hitObjects; } + set + { + hitObjects = value; + update(); + } + } + + private void update() + { + Clear(); + if (hitObjects == null) + return; + + OsuHitObject prevHitObject = null; + foreach (var currHitObject in hitObjects) + { + if (prevHitObject != null && !currHitObject.NewCombo && !(prevHitObject is Spinner) && !(currHitObject is Spinner)) + { + Vector2 startPosition = prevHitObject.EndPosition; + Vector2 endPosition = currHitObject.Position; + double startTime = prevHitObject.EndTime; + double endTime = currHitObject.StartTime; + + Vector2 distanceVector = endPosition - startPosition; + int distance = (int)distanceVector.Length; + float rotation = (float)Math.Atan2(distanceVector.Y, distanceVector.X); + double duration = endTime - startTime; + + for (int d = (int)(PointDistance * 1.5); d < distance - PointDistance; d += PointDistance) + { + float fraction = ((float)d / distance); + Vector2 pointStartPosition = startPosition + (fraction - 0.1f) * distanceVector; + Vector2 pointEndPosition = startPosition + fraction * distanceVector; + double fadeOutTime = startTime + fraction * duration; + double fadeInTime = fadeOutTime - PreEmpt; + + Add(new FollowPoint() + { + StartTime = fadeInTime, + EndTime = fadeOutTime, + Position = pointStartPosition, + EndPosition = pointEndPosition, + Rotation = rotation, + }); + } + } + prevHitObject = currHitObject; + } + } + } +} diff --git a/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs index 96360a6291..1a92436d74 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs @@ -24,7 +24,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables AutoSizeAxes = Axes.Both; Origin = Anchor.Centre; - Direction = FlowDirection.VerticalOnly; + Direction = FlowDirections.Vertical; Spacing = new Vector2(0, 2); Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset; diff --git a/osu.Game.Modes.Osu/OpenTK.dll.config b/osu.Game.Modes.Osu/OpenTK.dll.config index 1dd145f0c4..627e9f6009 100644 --- a/osu.Game.Modes.Osu/OpenTK.dll.config +++ b/osu.Game.Modes.Osu/OpenTK.dll.config @@ -1,8 +1,7 @@ - diff --git a/osu.Game.Modes.Osu/UI/OsuPlayfield.cs b/osu.Game.Modes.Osu/UI/OsuPlayfield.cs index 49c6869189..b6daffbb8b 100644 --- a/osu.Game.Modes.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Modes.Osu/UI/OsuPlayfield.cs @@ -1,13 +1,15 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Objects; using osu.Game.Modes.Osu.Objects.Drawables; +using osu.Game.Modes.Osu.Objects.Drawables.Connections; using osu.Game.Modes.UI; -using OpenTK; +using System.Linq; namespace osu.Game.Modes.Osu.UI { @@ -15,6 +17,7 @@ namespace osu.Game.Modes.Osu.UI { private Container approachCircles; private Container judgementLayer; + private ConnectionRenderer connectionLayer; public override Vector2 Size { @@ -36,6 +39,11 @@ namespace osu.Game.Modes.Osu.UI Add(new Drawable[] { + connectionLayer = new FollowPointRenderer + { + RelativeSizeAxes = Axes.Both, + Depth = 2, + }, judgementLayer = new Container { RelativeSizeAxes = Axes.Both, @@ -63,6 +71,13 @@ namespace osu.Game.Modes.Osu.UI base.Add(h); } + public override void PostProcess() + { + connectionLayer.HitObjects = HitObjects.Children + .Select(d => (OsuHitObject)d.HitObject) + .OrderBy(h => h.StartTime); + } + private void judgement(DrawableHitObject h, JudgementInfo j) { HitExplosion explosion = new HitExplosion((OsuJudgementInfo)j, (OsuHitObject)h.HitObject); diff --git a/osu.Game.Modes.Osu/app.config b/osu.Game.Modes.Osu/app.config index c42343ec69..d9da887349 100644 --- a/osu.Game.Modes.Osu/app.config +++ b/osu.Game.Modes.Osu/app.config @@ -1,9 +1,8 @@ - diff --git a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj index a659683c27..e0b9f5c904 100644 --- a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj @@ -46,9 +46,12 @@ + + + diff --git a/osu.Game.Modes.Osu/packages.config b/osu.Game.Modes.Osu/packages.config index 591ae8cd7f..d06cd15869 100644 --- a/osu.Game.Modes.Osu/packages.config +++ b/osu.Game.Modes.Osu/packages.config @@ -1,10 +1,8 @@  - - \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/OpenTK.dll.config b/osu.Game.Modes.Taiko/OpenTK.dll.config index 1dd145f0c4..627e9f6009 100644 --- a/osu.Game.Modes.Taiko/OpenTK.dll.config +++ b/osu.Game.Modes.Taiko/OpenTK.dll.config @@ -1,8 +1,7 @@ - diff --git a/osu.Game.Modes.Taiko/packages.config b/osu.Game.Modes.Taiko/packages.config index 3c9e7e3fdc..d53e65896a 100644 --- a/osu.Game.Modes.Taiko/packages.config +++ b/osu.Game.Modes.Taiko/packages.config @@ -1,9 +1,8 @@  - \ No newline at end of file diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs index 9a988d6eff..6613b5c370 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.IO; using NUnit.Framework; using OpenTK; diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 165181a332..6a162a4ab9 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs b/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs index a09d0c2f86..3d706a8026 100644 --- a/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.IO; using NUnit.Framework; using osu.Game.Beatmaps.IO; @@ -39,7 +42,7 @@ namespace osu.Game.Tests.Beatmaps.IO "Soleily - Renatus (MMzz) [Muzukashii].osu", "Soleily - Renatus (MMzz) [Oni].osu" }; - var maps = reader.ReadBeatmaps(); + var maps = reader.BeatmapFilenames; foreach (var map in expected) Assert.Contains(map, maps); } diff --git a/osu.Game.Tests/OpenTK.dll.config b/osu.Game.Tests/OpenTK.dll.config index 5620e3d9e2..627e9f6009 100644 --- a/osu.Game.Tests/OpenTK.dll.config +++ b/osu.Game.Tests/OpenTK.dll.config @@ -1,3 +1,7 @@ + diff --git a/osu.Game.Tests/Resources/Resource.cs b/osu.Game.Tests/Resources/Resource.cs index 21945ac504..6c66b6818b 100644 --- a/osu.Game.Tests/Resources/Resource.cs +++ b/osu.Game.Tests/Resources/Resource.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.IO; using System.Reflection; diff --git a/osu.Game.Tests/app.config b/osu.Game.Tests/app.config index 44ccc4b77a..b9af3fdc80 100644 --- a/osu.Game.Tests/app.config +++ b/osu.Game.Tests/app.config @@ -1,4 +1,8 @@  + diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index c6f0c6fa55..f555615f09 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -55,6 +55,9 @@ + + osu.licenseheader + diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config index f9151f1eaa..b9f1a2c8cd 100644 --- a/osu.Game.Tests/packages.config +++ b/osu.Game.Tests/packages.config @@ -1,4 +1,8 @@  + diff --git a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs index 1ee9e3e4c2..a6ad0a6457 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs @@ -77,7 +77,7 @@ namespace osu.Game.Beatmaps.Drawables new FlowContainer { Padding = new MarginPadding(5), - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, AutoSizeAxes = Axes.Both, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, @@ -93,13 +93,13 @@ namespace osu.Game.Beatmaps.Drawables { Padding = new MarginPadding { Left = 5 }, Spacing = new Vector2(0, 5), - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, AutoSizeAxes = Axes.Both, Children = new Drawable[] { new FlowContainer { - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, AutoSizeAxes = Axes.Both, Spacing = new Vector2(4, 0), Children = new[] diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 3b79d1bf1d..a0a7549caf 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -39,7 +39,7 @@ namespace osu.Game.Beatmaps.Drawables }, new FlowContainer { - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, Padding = new MarginPadding { Top = 5, Left = 18, Right = 10, Bottom = 10 }, AutoSizeAxes = Axes.Both, Children = new[] @@ -113,7 +113,7 @@ namespace osu.Game.Beatmaps.Drawables new FlowContainer { Depth = -1, - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, RelativeSizeAxes = Axes.Both, // This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle Shear = new Vector2(0.8f, 0), diff --git a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs index ba99b206b5..4846cf376d 100644 --- a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs @@ -7,6 +7,8 @@ using System.IO; using osu.Game.Modes.Objects; using OpenTK.Graphics; using osu.Game.Graphics; +using osu.Game.Beatmaps.Timing; +using osu.Game.Database; namespace osu.Game.Beatmaps.Formats { @@ -34,6 +36,11 @@ namespace osu.Game.Beatmaps.Formats return b; } + public virtual void Decode(TextReader stream, Beatmap beatmap) + { + ParseFile(stream, beatmap); + } + public virtual Beatmap Process(Beatmap beatmap) { ApplyColours(beatmap); @@ -41,7 +48,23 @@ namespace osu.Game.Beatmaps.Formats return beatmap; } - protected abstract Beatmap ParseFile(TextReader stream); + protected virtual Beatmap ParseFile(TextReader stream) + { + var beatmap = new Beatmap + { + HitObjects = new List(), + ControlPoints = new List(), + ComboColors = new List(), + 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) { diff --git a/osu.Game/Beatmaps/Formats/ConstructableBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/ConstructableBeatmapDecoder.cs index 6f81cae00f..f80c673e89 100644 --- a/osu.Game/Beatmaps/Formats/ConstructableBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/ConstructableBeatmapDecoder.cs @@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps.Formats { public class ConstructableBeatmapDecoder : BeatmapDecoder { - protected override Beatmap ParseFile(TextReader stream) + protected override void ParseFile(TextReader stream, Beatmap beatmap) { throw new NotImplementedException(); } diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 29bb7ca32b..c32c3fe2f1 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -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(), - ControlPoints = new List(), - ComboColors = new List(), - BeatmapInfo = new BeatmapInfo - { - Metadata = new BeatmapMetadata(), - BaseDifficulty = new BaseDifficulty(), - }, - }; - HitObjectParser parser = null; var section = Section.None; @@ -309,8 +297,6 @@ namespace osu.Game.Beatmaps.Formats break; } } - - return beatmap; } } } diff --git a/osu.Game/Beatmaps/IO/ArchiveReader.cs b/osu.Game/Beatmaps/IO/ArchiveReader.cs index 8ae495a1fe..cb5f936939 100644 --- a/osu.Game/Beatmaps/IO/ArchiveReader.cs +++ b/osu.Game/Beatmaps/IO/ArchiveReader.cs @@ -19,7 +19,7 @@ namespace osu.Game.Beatmaps.IO } private static List readers { get; } = new List(); - + public static ArchiveReader GetReader(BasicStorage storage, string path) { foreach (var reader in readers) @@ -29,20 +29,27 @@ namespace osu.Game.Beatmaps.IO } throw new IOException(@"Unknown file format"); } - + protected static void AddReader(Func test) where T : ArchiveReader { readers.Add(new Reader { Test = test, Type = typeof(T) }); } - + /// /// Reads the beatmap metadata from this archive. /// public abstract BeatmapMetadata ReadMetadata(); + /// /// Gets a list of beatmap file names. /// - public abstract string[] ReadBeatmaps(); + public string[] BeatmapFilenames { get; protected set; } + + /// + /// The storyboard filename. Null if no storyboard is present. + /// + public string StoryboardFilename { get; protected set; } + /// /// Opens a stream for reading a specific file from this archive. /// diff --git a/osu.Game/Beatmaps/IO/OszArchiveReader.cs b/osu.Game/Beatmaps/IO/OszArchiveReader.cs index 4b35805373..273e0c1fb9 100644 --- a/osu.Game/Beatmaps/IO/OszArchiveReader.cs +++ b/osu.Game/Beatmaps/IO/OszArchiveReader.cs @@ -25,29 +25,25 @@ namespace osu.Game.Beatmaps.IO private Stream archiveStream; private ZipFile archive; - private string[] beatmaps; private Beatmap firstMap; - + public OszArchiveReader(Stream archiveStream) { this.archiveStream = 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(); - if (beatmaps.Length == 0) + if (BeatmapFilenames.Length == 0) 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); firstMap = decoder.Decode(stream); } } - public override string[] ReadBeatmaps() - { - return beatmaps; - } - public override Stream GetStream(string name) { ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name); diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 446aaf8e49..62223ec879 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -18,6 +18,8 @@ namespace osu.Game.Beatmaps public readonly BeatmapSetInfo BeatmapSetInfo; private readonly BeatmapDatabase database; + public readonly bool WithStoryboard; + private ArchiveReader getReader() => database?.GetReader(BeatmapSetInfo); private Texture background; @@ -58,8 +60,19 @@ namespace osu.Game.Beatmaps try { 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 { } @@ -103,11 +116,12 @@ namespace osu.Game.Beatmaps this.beatmap = beatmap; } - public WorkingBeatmap(BeatmapInfo beatmapInfo, BeatmapSetInfo beatmapSetInfo, BeatmapDatabase database) + public WorkingBeatmap(BeatmapInfo beatmapInfo, BeatmapSetInfo beatmapSetInfo, BeatmapDatabase database, bool withStoryboard = false) { BeatmapInfo = beatmapInfo; BeatmapSetInfo = beatmapSetInfo; this.database = database; + this.WithStoryboard = withStoryboard; } private bool isDisposed; diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 8e71a54a34..381bca2a71 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -14,144 +14,148 @@ namespace osu.Game.Configuration { #pragma warning disable CS0612 // Type or member is obsolete - Set(OsuConfig.MouseSpeed, 1.0); - Set(OsuConfig.Username, string.Empty); Set(OsuConfig.Token, string.Empty); Set(OsuConfig.PlayMode, PlayMode.Osu); - - Set(OsuConfig.BeatmapDirectory, @"Songs"); // TODO: use this - Set(OsuConfig.AllowPublicInvites, true); - Set(OsuConfig.AutoChatHide, true); - Set(OsuConfig.AutomaticDownload, true); - Set(OsuConfig.AutomaticDownloadNoVideo, false); - Set(OsuConfig.BlockNonFriendPM, false); - Set(OsuConfig.BloomSoftening, false); - Set(OsuConfig.BossKeyFirstActivation, true); - Set(OsuConfig.ChatAudibleHighlight, true); - Set(OsuConfig.ChatChannels, string.Empty); - Set(OsuConfig.ChatFilter, false); - Set(OsuConfig.ChatHighlightName, true); - Set(OsuConfig.ChatMessageNotification, true); - Set(OsuConfig.ChatLastChannel, string.Empty); - Set(OsuConfig.ChatRemoveForeign, false); - //Set(OsuConfig.ChatSortMode, UserSortMode.Rank); - Set(OsuConfig.ComboBurst, true); - Set(OsuConfig.ComboFire, false); - Set(OsuConfig.ComboFireHeight, 3); - Set(OsuConfig.ConfirmExit, false); - Set(OsuConfig.AutoSendNowPlaying, true); - Set(OsuConfig.CursorSize, 1.0, 0.5f, 2); - Set(OsuConfig.AutomaticCursorSizing, false); - Set(OsuConfig.DimLevel, 30, 0, 100); - Set(OsuConfig.Display, 1); - Set(OsuConfig.DisplayCityLocation, false); - Set(OsuConfig.DistanceSpacingEnabled, true); - Set(OsuConfig.EditorTip, 0); - Set(OsuConfig.VideoEditor, true); - Set(OsuConfig.EditorDefaultSkin, false); - Set(OsuConfig.EditorSnakingSliders, true); - Set(OsuConfig.EditorHitAnimations, false); - Set(OsuConfig.EditorFollowPoints, true); - Set(OsuConfig.EditorStacking, true); - Set(OsuConfig.ForceSliderRendering, false); - Set(OsuConfig.FpsCounter, false); - Set(OsuConfig.FrameTimeDisplay, false); - Set(OsuConfig.GuideTips, @""); - Set(OsuConfig.CursorRipple, false); - Set(OsuConfig.HighlightWords, string.Empty); - Set(OsuConfig.HighResolution, false); - Set(OsuConfig.HitLighting, true); - Set(OsuConfig.IgnoreBarline, false); - Set(OsuConfig.IgnoreBeatmapSamples, false); - Set(OsuConfig.IgnoreBeatmapSkins, false); - Set(OsuConfig.IgnoreList, string.Empty); - Set(OsuConfig.KeyOverlay, false); - Set(OsuConfig.Language, @"unknown"); - Set(OsuConfig.AllowNowPlayingHighlights, false); - Set(OsuConfig.LastVersion, string.Empty); - Set(OsuConfig.LastVersionPermissionsFailed, string.Empty); - Set(OsuConfig.LoadSubmittedThread, true); - Set(OsuConfig.LobbyPlayMode, -1); - Set(OsuConfig.ShowInterface, true); - Set(OsuConfig.ShowInterfaceDuringRelax, false); - Set(OsuConfig.LobbyShowExistingOnly, false); - Set(OsuConfig.LobbyShowFriendsOnly, false); - Set(OsuConfig.LobbyShowFull, false); - Set(OsuConfig.LobbyShowInProgress, true); - Set(OsuConfig.LobbyShowPassworded, true); - Set(OsuConfig.LogPrivateMessages, false); - Set(OsuConfig.LowResolution, false); - //Set(OsuConfig.ManiaSpeed, SpeedMania.SPEED_DEFAULT, SpeedMania.SPEED_MIN, SpeedMania.SPEED_MAX); - Set(OsuConfig.UsePerBeatmapManiaSpeed, true); - Set(OsuConfig.ManiaSpeedBPMScale, true); - Set(OsuConfig.MenuTip, 0); - Set(OsuConfig.MouseDisableButtons, false); - Set(OsuConfig.MouseDisableWheel, false); - Set(OsuConfig.MouseSpeed, 1, 0.4, 6); - Set(OsuConfig.Offset, 0, -300, 300); - Set(OsuConfig.ScoreMeterScale, 1, 0.5, 2); - //Set(OsuConfig.ScoreMeterScale, 1, 0.5, OsuGame.Tournament ? 10 : 2); - Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6); - Set(OsuConfig.EditorBeatDivisor, 1, 1, 16); - Set(OsuConfig.EditorGridSize, 32, 4, 32); - Set(OsuConfig.EditorGridSizeDesign, 32, 4, 32); - Set(OsuConfig.CustomFrameLimit, 240, 240, 999); - Set(OsuConfig.MsnIntegration, false); - Set(OsuConfig.MyPcSucks, false); - Set(OsuConfig.NotifyFriends, true); - Set(OsuConfig.NotifySubmittedThread, true); - Set(OsuConfig.PopupDuringGameplay, true); - Set(OsuConfig.ProgressBarType, ProgressBarType.Pie); - Set(OsuConfig.RankType, RankingType.Top); - Set(OsuConfig.RefreshRate, 60); - Set(OsuConfig.OverrideRefreshRate, Get(OsuConfig.RefreshRate) != 60); - //Set(OsuConfig.ScaleMode, ScaleMode.WidescreenConservative); - Set(OsuConfig.ScoreboardVisible, true); - Set(OsuConfig.ScoreMeter, ScoreMeterType.Error); - //Set(OsuConfig.ScoreMeter, OsuGame.Tournament ? ScoreMeterType.Colour : ScoreMeterType.Error); - Set(OsuConfig.ScreenshotId, 0); - Set(OsuConfig.MenuSnow, false); - Set(OsuConfig.MenuTriangles, true); - Set(OsuConfig.SongSelectThumbnails, true); - Set(OsuConfig.ScreenshotFormat, ScreenshotFormat.Jpg); - Set(OsuConfig.ShowReplayComments, true); - Set(OsuConfig.ShowSpectators, true); - Set(OsuConfig.ShowStoryboard, true); - //Set(OsuConfig.Skin, SkinManager.DEFAULT_SKIN); - Set(OsuConfig.SkinSamples, true); - Set(OsuConfig.SkipTablet, false); - Set(OsuConfig.SnakingInSliders, true); - Set(OsuConfig.SnakingOutSliders, false); - Set(OsuConfig.Tablet, false); - Set(OsuConfig.UpdatePending, false); - Set(OsuConfig.UseSkinCursor, false); - Set(OsuConfig.UseTaikoSkin, false); - Set(OsuConfig.Video, true); - Set(OsuConfig.Wiimote, false); - Set(OsuConfig.YahooIntegration, false); - Set(OsuConfig.ForceFrameFlush, false); - Set(OsuConfig.DetectPerformanceIssues, true); - Set(OsuConfig.MenuMusic, true); - Set(OsuConfig.MenuVoice, true); - Set(OsuConfig.MenuParallax, true); - Set(OsuConfig.RawInput, false); - Set(OsuConfig.AbsoluteToOsuWindow, Get(OsuConfig.RawInput)); - Set(OsuConfig.ShowMenuTips, true); - Set(OsuConfig.HiddenShowFirstApproach, true); - Set(OsuConfig.ComboColourSliderBall, true); - Set(OsuConfig.AlternativeChatFont, false); - Set(OsuConfig.DisplayStarsMaximum, 10.0, 0.0, 10.0); - Set(OsuConfig.DisplayStarsMinimum, 0.0, 0.0, 10.0); Set(OsuConfig.AudioDevice, string.Empty); - Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer); - Set(OsuConfig.UpdateFailCount, 0); Set(OsuConfig.SavePassword, false); Set(OsuConfig.SaveUsername, true); - //Set(OsuConfig.TreeSortMode, TreeGroupMode.Show_All); - //Set(OsuConfig.TreeSortMode2, TreeSortMode.Title); + + Set(OsuConfig.CursorSize, 1.0, 0.5f, 2); + Set(OsuConfig.DimLevel, 30, 0, 100); + + Set(OsuConfig.MouseDisableButtons, false); + + Set(OsuConfig.SnakingInSliders, true); + Set(OsuConfig.SnakingOutSliders, false); + + //todo: implement all settings below this line (remove the Disabled set when doing so). + + Set(OsuConfig.MouseSpeed, 1.0).Disabled = true; + Set(OsuConfig.BeatmapDirectory, @"Songs").Disabled = true; // TODO: use thi.Disabled = trues + Set(OsuConfig.AllowPublicInvites, true).Disabled = true; + Set(OsuConfig.AutoChatHide, true).Disabled = true; + Set(OsuConfig.AutomaticDownload, true).Disabled = true; + Set(OsuConfig.AutomaticDownloadNoVideo, false).Disabled = true; + Set(OsuConfig.BlockNonFriendPM, false).Disabled = true; + Set(OsuConfig.BloomSoftening, false).Disabled = true; + Set(OsuConfig.BossKeyFirstActivation, true).Disabled = true; + Set(OsuConfig.ChatAudibleHighlight, true).Disabled = true; + Set(OsuConfig.ChatChannels, string.Empty).Disabled = true; + Set(OsuConfig.ChatFilter, false).Disabled = true; + Set(OsuConfig.ChatHighlightName, true).Disabled = true; + Set(OsuConfig.ChatMessageNotification, true).Disabled = true; + Set(OsuConfig.ChatLastChannel, string.Empty).Disabled = true; + Set(OsuConfig.ChatRemoveForeign, false).Disabled = true; + //Set(OsuConfig.ChatSortMode, UserSortMode.Rank).Disabled = true; + Set(OsuConfig.ComboBurst, true).Disabled = true; + Set(OsuConfig.ComboFire, false).Disabled = true; + Set(OsuConfig.ComboFireHeight, 3).Disabled = true; + Set(OsuConfig.ConfirmExit, false).Disabled = true; + Set(OsuConfig.AutoSendNowPlaying, true).Disabled = true; + Set(OsuConfig.AutomaticCursorSizing, false).Disabled = true; + Set(OsuConfig.Display, 1).Disabled = true; + Set(OsuConfig.DisplayCityLocation, false).Disabled = true; + Set(OsuConfig.DistanceSpacingEnabled, true).Disabled = true; + Set(OsuConfig.EditorTip, 0).Disabled = true; + Set(OsuConfig.VideoEditor, true).Disabled = true; + Set(OsuConfig.EditorDefaultSkin, false).Disabled = true; + Set(OsuConfig.EditorSnakingSliders, true).Disabled = true; + Set(OsuConfig.EditorHitAnimations, false).Disabled = true; + Set(OsuConfig.EditorFollowPoints, true).Disabled = true; + Set(OsuConfig.EditorStacking, true).Disabled = true; + Set(OsuConfig.ForceSliderRendering, false).Disabled = true; + Set(OsuConfig.FpsCounter, false).Disabled = true; + Set(OsuConfig.FrameTimeDisplay, false).Disabled = true; + Set(OsuConfig.GuideTips, @"").Disabled = true; + Set(OsuConfig.CursorRipple, false).Disabled = true; + Set(OsuConfig.HighlightWords, string.Empty).Disabled = true; + Set(OsuConfig.HighResolution, false).Disabled = true; + Set(OsuConfig.HitLighting, true).Disabled = true; + Set(OsuConfig.IgnoreBarline, false).Disabled = true; + 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; + Set(OsuConfig.LastVersionPermissionsFailed, string.Empty).Disabled = true; + Set(OsuConfig.LoadSubmittedThread, true).Disabled = true; + Set(OsuConfig.LobbyPlayMode, -1).Disabled = true; + Set(OsuConfig.ShowInterface, true).Disabled = true; + Set(OsuConfig.ShowInterfaceDuringRelax, false).Disabled = true; + Set(OsuConfig.LobbyShowExistingOnly, false).Disabled = true; + Set(OsuConfig.LobbyShowFriendsOnly, false).Disabled = true; + Set(OsuConfig.LobbyShowFull, false).Disabled = true; + Set(OsuConfig.LobbyShowInProgress, true).Disabled = true; + Set(OsuConfig.LobbyShowPassworded, true).Disabled = true; + Set(OsuConfig.LogPrivateMessages, false).Disabled = true; + Set(OsuConfig.LowResolution, false).Disabled = true; + //Set(OsuConfig.ManiaSpeed, SpeedMania.SPEED_DEFAULT, SpeedMania.SPEED_MIN, SpeedMania.SPEED_MAX).Disabled = true; + 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; + //Set(OsuConfig.ScoreMeterScale, 1, 0.5, OsuGame.Tournament ? 10 : 2).Disabled = true; + Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6).Disabled = true; + Set(OsuConfig.EditorBeatDivisor, 1, 1, 16).Disabled = true; + Set(OsuConfig.EditorGridSize, 32, 4, 32).Disabled = true; + Set(OsuConfig.EditorGridSizeDesign, 32, 4, 32).Disabled = true; + Set(OsuConfig.CustomFrameLimit, 240, 240, 999).Disabled = true; + Set(OsuConfig.MsnIntegration, false).Disabled = true; + Set(OsuConfig.MyPcSucks, false).Disabled = true; + Set(OsuConfig.NotifyFriends, true).Disabled = true; + Set(OsuConfig.NotifySubmittedThread, true).Disabled = true; + Set(OsuConfig.PopupDuringGameplay, true).Disabled = true; + Set(OsuConfig.ProgressBarType, ProgressBarType.Pie).Disabled = true; + Set(OsuConfig.RankType, RankingType.Top).Disabled = true; + Set(OsuConfig.RefreshRate, 60).Disabled = true; + Set(OsuConfig.OverrideRefreshRate, Get(OsuConfig.RefreshRate) != 60).Disabled = true; + //Set(OsuConfig.ScaleMode, ScaleMode.WidescreenConservative).Disabled = true; + Set(OsuConfig.ScoreboardVisible, true).Disabled = true; + Set(OsuConfig.ScoreMeter, ScoreMeterType.Error).Disabled = true; + //Set(OsuConfig.ScoreMeter, OsuGame.Tournament ? ScoreMeterType.Colour : ScoreMeterType.Error).Disabled = true; + Set(OsuConfig.ScreenshotId, 0).Disabled = true; + Set(OsuConfig.MenuSnow, false).Disabled = true; + Set(OsuConfig.MenuTriangles, true).Disabled = true; + Set(OsuConfig.SongSelectThumbnails, true).Disabled = true; + Set(OsuConfig.ScreenshotFormat, ScreenshotFormat.Jpg).Disabled = true; + Set(OsuConfig.ShowReplayComments, true).Disabled = true; + Set(OsuConfig.ShowSpectators, true).Disabled = true; + Set(OsuConfig.ShowStoryboard, true).Disabled = true; + //Set(OsuConfig.Skin, SkinManager.DEFAULT_SKIN).Disabled = true; + Set(OsuConfig.SkinSamples, true).Disabled = true; + Set(OsuConfig.SkipTablet, false).Disabled = true; + Set(OsuConfig.Tablet, false).Disabled = true; + Set(OsuConfig.UpdatePending, false).Disabled = true; + Set(OsuConfig.UseSkinCursor, false).Disabled = true; + Set(OsuConfig.UseTaikoSkin, false).Disabled = true; + Set(OsuConfig.Video, true).Disabled = true; + Set(OsuConfig.Wiimote, false).Disabled = true; + Set(OsuConfig.YahooIntegration, false).Disabled = true; + Set(OsuConfig.ForceFrameFlush, false).Disabled = true; + Set(OsuConfig.DetectPerformanceIssues, true).Disabled = true; + Set(OsuConfig.MenuMusic, true).Disabled = true; + Set(OsuConfig.MenuVoice, true).Disabled = true; + Set(OsuConfig.MenuParallax, true).Disabled = true; + Set(OsuConfig.RawInput, false).Disabled = true; + Set(OsuConfig.AbsoluteToOsuWindow, Get(OsuConfig.RawInput)).Disabled = true; + Set(OsuConfig.ShowMenuTips, true).Disabled = true; + Set(OsuConfig.HiddenShowFirstApproach, true).Disabled = true; + Set(OsuConfig.ComboColourSliderBall, true).Disabled = true; + Set(OsuConfig.AlternativeChatFont, false).Disabled = true; + Set(OsuConfig.DisplayStarsMaximum, 10.0, 0.0, 10.0).Disabled = true; + Set(OsuConfig.DisplayStarsMinimum, 0.0, 0.0, 10.0).Disabled = true; + Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer).Disabled = true; + Set(OsuConfig.UpdateFailCount, 0).Disabled = true; + //Set(OsuConfig.TreeSortMode, TreeGroupMode.Show_All).Disabled = true; + //Set(OsuConfig.TreeSortMode2, TreeSortMode.Title).Disabled = true; bool unicodeDefault = false; switch (Get(OsuConfig.Language)) { @@ -162,12 +166,12 @@ namespace osu.Game.Configuration break; } Set(OsuConfig.ShowUnicode, unicodeDefault); - Set(OsuConfig.PermanentSongInfo, false); - Set(OsuConfig.Ticker, false); - Set(OsuConfig.CompatibilityContext, false); - Set(OsuConfig.CanForceOptimusCompatibility, true); + Set(OsuConfig.PermanentSongInfo, false).Disabled = true; + Set(OsuConfig.Ticker, false).Disabled = true; + Set(OsuConfig.CompatibilityContext, false).Disabled = true; + Set(OsuConfig.CanForceOptimusCompatibility, true).Disabled = true; Set(OsuConfig.ConfineMouse, Get(OsuConfig.ConfineMouseToFullscreen) ? - ConfineMouseMode.Fullscreen : ConfineMouseMode.Never); + ConfineMouseMode.Fullscreen : ConfineMouseMode.Never).Disabled = true; GetBindable(OsuConfig.SavePassword).ValueChanged += delegate diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index d515c71ed4..9c7e70f8eb 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -125,7 +125,7 @@ namespace osu.Game.Database using (var reader = ArchiveReader.GetReader(storage, path)) { - string[] mapNames = reader.ReadBeatmaps(); + string[] mapNames = reader.BeatmapFilenames; foreach (var name in mapNames) { using (var stream = new StreamReader(reader.GetStream(name))) @@ -139,6 +139,7 @@ namespace osu.Game.Database beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo); } + beatmapSet.StoryboardFile = reader.StoryboardFilename; } } @@ -171,7 +172,7 @@ namespace osu.Game.Database return Query().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().FirstOrDefault(s => s.ID == beatmapInfo.BeatmapSetInfoID); @@ -184,7 +185,7 @@ namespace osu.Game.Database if (beatmapInfo.Metadata == null) beatmapInfo.Metadata = beatmapSetInfo.Metadata; - var working = new WorkingBeatmap(beatmapInfo, beatmapSetInfo, this); + var working = new WorkingBeatmap(beatmapInfo, beatmapSetInfo, this, withStoryboard); previous?.TransferTo(working); diff --git a/osu.Game/Database/BeatmapSetInfo.cs b/osu.Game/Database/BeatmapSetInfo.cs index f556c3546a..a9c3f03a49 100644 --- a/osu.Game/Database/BeatmapSetInfo.cs +++ b/osu.Game/Database/BeatmapSetInfo.cs @@ -27,6 +27,8 @@ namespace osu.Game.Database public string Hash { get; set; } public string Path { get; set; } + + public string StoryboardFile { get; set; } } } diff --git a/osu.Game/Graphics/Backgrounds/Background.cs b/osu.Game/Graphics/Backgrounds/Background.cs index 55c37cb71d..5ff63ead2a 100644 --- a/osu.Game/Graphics/Backgrounds/Background.cs +++ b/osu.Game/Graphics/Backgrounds/Background.cs @@ -20,6 +20,8 @@ namespace osu.Game.Graphics.Backgrounds public Background(string textureName = @"") { + CacheDrawnFrameBuffer = true; + this.textureName = textureName; RelativeSizeAxes = Axes.Both; Depth = float.MaxValue; diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index 7d88451a6f..31f66407ce 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -32,10 +32,15 @@ namespace osu.Game.Graphics.UserInterface Font = @"Exo2.0-Bold", }; + public override bool HandleInput => Action != null; + [BackgroundDependencyLoader] private void load(OsuColour colours) { - Colour = colours.BlueDark; + if (Action == null) + Colour = OsuColour.Gray(0.5f); + + BackgroundColour = colours.BlueDark; Content.Masking = true; Content.CornerRadius = 5; diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index bd580bb76b..206b0dc09d 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -39,6 +39,9 @@ namespace osu.Game.Graphics.UserInterface State = bindable.Value ? CheckBoxState.Checked : CheckBoxState.Unchecked; bindable.ValueChanged += bindableValueChanged; } + + if (bindable?.Disabled ?? true) + Alpha = 0.3f; } } @@ -123,20 +126,20 @@ namespace osu.Game.Graphics.UserInterface protected override void OnChecked() { - if (bindable != null) - bindable.Value = true; - sampleChecked?.Play(); nub.State = CheckBoxState.Checked; + + if (bindable != null) + bindable.Value = true; } protected override void OnUnchecked() { - if (bindable != null) - bindable.Value = false; - sampleUnchecked?.Play(); nub.State = CheckBoxState.Unchecked; + + if (bindable != null) + bindable.Value = false; } } } diff --git a/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs b/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs index 1b51177c09..bbc8bd3e47 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs @@ -22,7 +22,7 @@ namespace osu.Game.Graphics.UserInterface { new FlowContainer { - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] diff --git a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs index 13fbbb16e0..bc8be25035 100644 --- a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; diff --git a/osu.Game/Modes/UI/HitRenderer.cs b/osu.Game/Modes/UI/HitRenderer.cs index aa2af83cb4..14d9599be6 100644 --- a/osu.Game/Modes/UI/HitRenderer.cs +++ b/osu.Game/Modes/UI/HitRenderer.cs @@ -83,6 +83,7 @@ namespace osu.Game.Modes.UI Playfield.Add(drawableObject); } + Playfield.PostProcess(); } private void onJudgement(DrawableHitObject o, JudgementInfo j) => TriggerOnJudgement(j); diff --git a/osu.Game/Modes/UI/Playfield.cs b/osu.Game/Modes/UI/Playfield.cs index 748c71a8b3..91eddce73c 100644 --- a/osu.Game/Modes/UI/Playfield.cs +++ b/osu.Game/Modes/UI/Playfield.cs @@ -1,10 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Modes.Objects.Drawables; -using OpenTK; namespace osu.Game.Modes.UI { @@ -32,6 +32,10 @@ namespace osu.Game.Modes.UI }); } + public virtual void PostProcess() + { + } + public class ScaledContainer : Container { protected override Vector2 DrawScale => new Vector2(DrawSize.X / 512); diff --git a/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs b/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs index 131dc50699..08630a25aa 100644 --- a/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs +++ b/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs @@ -42,7 +42,7 @@ namespace osu.Game.Online.Chat.Drawables { flow = new FlowContainer { - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Spacing = new Vector2(1, 1) diff --git a/osu.Game/Overlays/NotificationManager.cs b/osu.Game/Overlays/NotificationManager.cs index ecfa3daa38..cb2025c576 100644 --- a/osu.Game/Overlays/NotificationManager.cs +++ b/osu.Game/Overlays/NotificationManager.cs @@ -45,7 +45,7 @@ namespace osu.Game.Overlays { sections = new FlowContainer { - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Children = new [] diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index ec286302b8..0f74df18de 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Notifications { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - Direction = FlowDirection.VerticalOnly; + Direction = FlowDirections.Vertical; Padding = new MarginPadding { diff --git a/osu.Game/Overlays/Options/OptionDropDown.cs b/osu.Game/Overlays/Options/OptionDropDown.cs index b9d676109e..2f88ab34ae 100644 --- a/osu.Game/Overlays/Options/OptionDropDown.cs +++ b/osu.Game/Overlays/Options/OptionDropDown.cs @@ -34,29 +34,32 @@ namespace osu.Game.Overlays.Options set { if (bindable != null) - bindable.ValueChanged -= Bindable_ValueChanged; + bindable.ValueChanged -= bindable_ValueChanged; bindable = value; - bindable.ValueChanged += Bindable_ValueChanged; - Bindable_ValueChanged(null, null); + bindable.ValueChanged += bindable_ValueChanged; + bindable_ValueChanged(null, null); + + if (bindable?.Disabled ?? true) + Alpha = 0.3f; } } private Bindable bindable; - void Bindable_ValueChanged(object sender, EventArgs e) + void bindable_ValueChanged(object sender, EventArgs e) { dropdown.SelectedValue = bindable.Value; } - void Dropdown_ValueChanged(object sender, EventArgs e) + void dropdown_ValueChanged(object sender, EventArgs e) { bindable.Value = dropdown.SelectedValue; } protected override void Dispose(bool isDisposing) { - bindable.ValueChanged -= Bindable_ValueChanged; - dropdown.ValueChanged -= Dropdown_ValueChanged; + bindable.ValueChanged -= bindable_ValueChanged; + dropdown.ValueChanged -= dropdown_ValueChanged; base.Dispose(isDisposing); } @@ -86,7 +89,7 @@ namespace osu.Game.Overlays.Options { Items = new KeyValuePair[0]; - Direction = FlowDirection.VerticalOnly; + Direction = FlowDirections.Vertical; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Children = new Drawable[] @@ -101,7 +104,7 @@ namespace osu.Game.Overlays.Options Items = this.Items, } }; - dropdown.ValueChanged += Dropdown_ValueChanged; + dropdown.ValueChanged += dropdown_ValueChanged; } } } diff --git a/osu.Game/Overlays/Options/OptionEnumDropDown.cs b/osu.Game/Overlays/Options/OptionEnumDropDown.cs index 81438fd59e..044e704d3a 100644 --- a/osu.Game/Overlays/Options/OptionEnumDropDown.cs +++ b/osu.Game/Overlays/Options/OptionEnumDropDown.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index e90da5f047..32ce420e7e 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK.Graphics; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -16,7 +17,7 @@ namespace osu.Game.Overlays.Options { private SliderBar slider; private SpriteText text; - + public string LabelText { get { return text.Text; } @@ -26,16 +27,21 @@ namespace osu.Game.Overlays.Options text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1; } } - + public BindableNumber Bindable { get { return slider.Bindable; } - set { slider.Bindable = value; } + set + { + slider.Bindable = value; + if (value?.Disabled ?? true) + Alpha = 0.3f; + } } public OptionSlider() { - Direction = FlowDirection.VerticalOnly; + Direction = FlowDirections.Vertical; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Padding = new MarginPadding { Right = 5 }; diff --git a/osu.Game/Overlays/Options/OptionTextBox.cs b/osu.Game/Overlays/Options/OptionTextBox.cs index 18fcfa6fca..813d372db6 100644 --- a/osu.Game/Overlays/Options/OptionTextBox.cs +++ b/osu.Game/Overlays/Options/OptionTextBox.cs @@ -24,6 +24,9 @@ namespace osu.Game.Overlays.Options base.Text = bindable.Value; bindable.ValueChanged += bindableValueChanged; } + + if (bindable?.Disabled ?? true) + Alpha = 0.3f; } } diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index a1cff0188c..61cfa868ec 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -61,7 +61,7 @@ namespace osu.Game.Overlays.Options FlowContent = new FlowContainer { Margin = new MarginPadding { Top = header_size + header_margin }, - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, Spacing = new Vector2(0, 30), AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Options/OptionsSubsection.cs index aa17ac7e52..37cb6d01c1 100644 --- a/osu.Game/Overlays/Options/OptionsSubsection.cs +++ b/osu.Game/Overlays/Options/OptionsSubsection.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - Direction = FlowDirection.VerticalOnly; + Direction = FlowDirections.Vertical; AddInternal(new Drawable[] { new OsuSpriteText @@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Options }, content = new FlowContainer { - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Spacing = new Vector2(0, 5), diff --git a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs index 08777c97a7..aca9b02f48 100644 --- a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs @@ -101,7 +101,7 @@ namespace osu.Game.Overlays.Options.Sections.General private void load(APIAccess api, OsuConfigManager config) { this.api = api; - Direction = FlowDirection.VerticalOnly; + Direction = FlowDirections.Vertical; AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; Spacing = new Vector2(0, 5); diff --git a/osu.Game/Overlays/Options/Sidebar.cs b/osu.Game/Overlays/Options/Sidebar.cs index 57865b84a7..f3fe3e1683 100644 --- a/osu.Game/Overlays/Options/Sidebar.cs +++ b/osu.Game/Overlays/Options/Sidebar.cs @@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Options Anchor = Anchor.CentreLeft, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Direction = FlowDirection.VerticalOnly + Direction = FlowDirections.Vertical } } }, diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index a93bbc10d3..68786b00e8 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -82,7 +82,7 @@ namespace osu.Game.Overlays { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, Children = new Drawable[] { @@ -103,7 +103,7 @@ namespace osu.Game.Overlays { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, Children = sections, } } @@ -141,7 +141,7 @@ namespace osu.Game.Overlays foreach (OptionsSection section in sections) { - float distance = Math.Abs(scrollContainer.GetChildYInContent(section) - currentScroll); + float distance = Math.Abs(scrollContainer.GetChildPosInContent(section) - currentScroll); if (distance < bestDistance) { bestDistance = distance; diff --git a/osu.Game/Overlays/Pause/PauseOverlay.cs b/osu.Game/Overlays/Pause/PauseOverlay.cs index 43365a610d..65eb5154a6 100644 --- a/osu.Game/Overlays/Pause/PauseOverlay.cs +++ b/osu.Game/Overlays/Pause/PauseOverlay.cs @@ -104,7 +104,7 @@ namespace osu.Game.Overlays.Pause { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, Spacing = new Vector2(0f, 50f), Origin = Anchor.Centre, Anchor = Anchor.Centre, @@ -113,7 +113,7 @@ namespace osu.Game.Overlays.Pause new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, Spacing = new Vector2(0f, 20f), Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index dc8b8d1e9a..7a112ae070 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Toolbar new ToolbarBackground(), new FlowContainer { - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, 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 = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 67b0039971..1b8e68151c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Toolbar }, Flow = new FlowContainer { - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Padding = new MarginPadding { Left = Toolbar.HEIGHT / 2, Right = Toolbar.HEIGHT / 2 }, @@ -107,7 +107,7 @@ namespace osu.Game.Overlays.Toolbar }, tooltipContainer = new FlowContainer { - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight, Origin = TooltipAnchor, diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index a63fcce2dc..d8ad235cec 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Toolbar { RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Padding = new MarginPadding { Left = padding, Right = padding }, diff --git a/osu.Game/Screens/Backgrounds/BackgroundModeBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundModeBeatmap.cs index 65b50542ce..e7b0ba1566 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundModeBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundModeBeatmap.cs @@ -78,7 +78,6 @@ namespace osu.Game.Screens.Backgrounds public BeatmapBackground(WorkingBeatmap beatmap) { this.beatmap = beatmap; - CacheDrawnFrameBuffer = true; } [BackgroundDependencyLoader] diff --git a/osu.Game/Screens/GameModeWhiteBox.cs b/osu.Game/Screens/GameModeWhiteBox.cs index 0cda73f225..dce33eefb0 100644 --- a/osu.Game/Screens/GameModeWhiteBox.cs +++ b/osu.Game/Screens/GameModeWhiteBox.cs @@ -126,7 +126,7 @@ namespace osu.Game.Screens }, childModeButtons = new FlowContainer { - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Both, @@ -145,7 +145,7 @@ namespace osu.Game.Screens Size = new Vector2(1, 40), Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, - Colour = getColourFor(t), + BackgroundColour = getColourFor(t), Action = delegate { Push(Activator.CreateInstance(t) as GameMode); diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index 7e1db73205..14d957733a 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -114,7 +114,7 @@ namespace osu.Game.Screens.Menu new OsuSpriteText { Shadow = true, - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, Anchor = Anchor.Centre, Origin = Anchor.Centre, TextSize = 16, diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 6d720569df..9a84a79333 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -81,7 +81,7 @@ namespace osu.Game.Screens.Menu }, buttonFlow = new FlowContainerWithOrigin { - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, Anchor = Anchor.Centre, AutoSizeAxes = Axes.Both, Spacing = new Vector2(-WEDGE_WIDTH, 0), diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index 709f34fac4..8e7f7558d7 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -12,7 +12,7 @@ namespace osu.Game.Screens.Play { public KeyCounterCollection() { - Direction = FlowDirection.HorizontalOnly; + Direction = FlowDirections.Horizontal; AutoSizeAxes = Axes.Both; } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a9584a1f10..7f2fa415d2 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -74,7 +74,7 @@ namespace osu.Game.Screens.Play try { if (Beatmap == null) - Beatmap = beatmaps.GetWorkingBeatmap(BeatmapInfo); + Beatmap = beatmaps.GetWorkingBeatmap(BeatmapInfo, withStoryboard: true); } catch { @@ -237,11 +237,10 @@ namespace osu.Game.Screens.Play { base.LoadComplete(); - Delay(250, true); + Content.Delay(250); Content.FadeIn(250); - Delay(500, true); - + Delay(750); Schedule(() => { sourceClock.Start(); diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 363b386b42..5e61f381e9 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -69,7 +69,7 @@ namespace osu.Game.Screens.Ranking new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, Children = new Drawable[] { new OsuSpriteText diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index ebee3090c1..390d175bd4 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -127,7 +127,7 @@ namespace osu.Game.Screens.Select { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 }, AutoSizeAxes = Axes.Both, Children = new Drawable[] @@ -149,7 +149,7 @@ namespace osu.Game.Screens.Select new FlowContainer { Margin = new MarginPadding { Top = 10 }, - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, AutoSizeAxes = Axes.Both, Children = new [] { diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index c3f0eb9b6d..512fa22b3a 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -43,7 +43,7 @@ namespace osu.Game.Screens.Select Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Width = 0.4f, // TODO: InnerWidth property or something - Direction = FlowDirection.VerticalOnly, + Direction = FlowDirections.Vertical, Children = new Drawable[] { searchTextBox = new SearchTextBox { RelativeSizeAxes = Axes.X }, @@ -175,7 +175,7 @@ namespace osu.Game.Screens.Select new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, Spacing = new Vector2(10, 0), Children = new Drawable[] { @@ -207,7 +207,7 @@ namespace osu.Game.Screens.Select new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, Spacing = new Vector2(10, 0), Origin = Anchor.TopRight, Anchor = Anchor.TopRight, diff --git a/osu.Game/Screens/Select/Footer.cs b/osu.Game/Screens/Select/Footer.cs index 1ef970b7f0..55fb36f144 100644 --- a/osu.Game/Screens/Select/Footer.cs +++ b/osu.Game/Screens/Select/Footer.cs @@ -94,14 +94,14 @@ namespace osu.Game.Screens.Select Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0), RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, Spacing = new Vector2(padding, 0), Children = new Drawable[] { buttons = new FlowContainer { - Direction = FlowDirection.HorizontalOnly, + Direction = FlowDirections.Horizontal, Spacing = new Vector2(0.2f, 0), AutoSizeAxes = Axes.Both, } diff --git a/osu.Game/packages.config b/osu.Game/packages.config index 98448d402f..0249d173ac 100644 --- a/osu.Game/packages.config +++ b/osu.Game/packages.config @@ -1,9 +1,8 @@  - diff --git a/osu.licenseheader b/osu.licenseheader index 94a06a7e14..30ea2f9ad9 100644 --- a/osu.licenseheader +++ b/osu.licenseheader @@ -4,6 +4,6 @@ extensions: .xml .config .xsd +--> \ No newline at end of file diff --git a/osu.sln b/osu.sln index 588cabf6b6..bda60c6318 100644 --- a/osu.sln +++ b/osu.sln @@ -31,6 +31,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Modes.Mania", "osu EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Tests", "osu.Desktop.Tests\osu.Desktop.Tests.csproj", "{230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Deploy", "osu.Desktop.Deploy\osu.Desktop.Deploy.csproj", "{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{6EAD7610-89D8-48A2-8BE0-E348297E4D8B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -85,6 +89,8 @@ Global {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Release|Any CPU.Build.0 = Release|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release|Any CPU.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -102,6 +108,7 @@ Global {F167E17A-7DE6-4AF5-B920-A5112296C695} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} {48F4582B-7687-4621-9CBE-5C24197CB536} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785} = {6EAD7610-89D8-48A2-8BE0-E348297E4D8B} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0