From b574b817f9c63bc336aaeb5d6bed3c7e613256d4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 30 Oct 2017 22:03:45 +0900 Subject: [PATCH 001/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 5986f21268..bd2dafb7df 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 5986f2126832451a5a7ec832a483e1dcec1b38b8 +Subproject commit bd2dafb7dfb3df3eb204104291de4f0d937edf3d From 5a8ed4c2425150b670ae9ba8d6de79591d5cf51a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 30 Oct 2017 22:23:42 +0900 Subject: [PATCH 002/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index bd2dafb7df..b57d461c6c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit bd2dafb7dfb3df3eb204104291de4f0d937edf3d +Subproject commit b57d461c6ce963f0b614005d816ce8780dfd6bc2 From 04b271cce9cd9b05c5f8a7295e8a48cb2e127ac3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 30 Oct 2017 22:24:11 +0900 Subject: [PATCH 003/282] Migrate osu.Game project to VS2017 project structure --- LangVer.props | 5 + osu.Game/Beatmaps/BeatmapManager.cs | 4 + osu.Game/Database/OsuDbContext.cs | 4 +- osu.Game/IO/FileStore.cs | 2 +- .../Ranks/DrawablePerformanceScore.cs | 2 +- .../Sections/Ranks/DrawableTotalScore.cs | 2 +- osu.Game/Overlays/Settings/SettingsItem.cs | 4 +- osu.Game/Properties/AssemblyInfo.cs | 28 - osu.Game/Resources/Resource.cs | 20 - .../Soleily - Renatus (Gamu) [Insane].osu | 1002 ----------------- .../Timeline/ScrollingTimelineContainer.cs | 2 +- osu.Game/osu.Game.csproj | 838 +------------- 12 files changed, 45 insertions(+), 1868 deletions(-) create mode 100644 LangVer.props delete mode 100644 osu.Game/Properties/AssemblyInfo.cs delete mode 100644 osu.Game/Resources/Resource.cs delete mode 100644 osu.Game/Resources/Soleily - Renatus (Gamu) [Insane].osu diff --git a/LangVer.props b/LangVer.props new file mode 100644 index 0000000000..c9341fa720 --- /dev/null +++ b/LangVer.props @@ -0,0 +1,5 @@ + + + 6 + + \ No newline at end of file diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index f02a9a176c..ff0abd3d78 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -341,6 +341,8 @@ namespace osu.Game.Beatmaps /// Returns a to a usable state if it has previously been deleted but not yet purged. /// Is a no-op for already usable beatmaps. /// + /// The store to restore beatmaps from. + /// The store to restore beatmap files from. /// The beatmap to restore. private void undelete(BeatmapStore beatmaps, FileStore files, BeatmapSetInfo beatmapSet) { @@ -426,6 +428,8 @@ namespace osu.Game.Beatmaps /// Import a beamap into our local storage. /// If the beatmap is already imported, the existing instance will be returned. /// + /// The store to import beatmap files to. + /// The store to import beatmaps to. /// The beatmap archive to be read. /// The imported beatmap, or an existing instance if it is already present. private BeatmapSetInfo importToStorage(FileStore files, BeatmapStore beatmaps, ArchiveReader reader) diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index cb2bdf5c9f..928c355696 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -102,7 +102,7 @@ namespace osu.Game.Database return null; } - public new int SaveChanges(IDbContextTransaction transaction = null) + public int SaveChanges(IDbContextTransaction transaction = null) { var ret = base.SaveChanges(); transaction?.Commit(); @@ -262,7 +262,7 @@ namespace osu.Game.Database throw new MigrationFailedException(e); } } - catch (MigrationFailedException e) + catch (MigrationFailedException) { throw; } diff --git a/osu.Game/IO/FileStore.cs b/osu.Game/IO/FileStore.cs index 93d1086ee5..4eca310424 100644 --- a/osu.Game/IO/FileStore.cs +++ b/osu.Game/IO/FileStore.cs @@ -19,7 +19,7 @@ namespace osu.Game.IO { public readonly IResourceStore Store; - public Storage Storage => base.Storage; + public new Storage Storage => base.Storage; public FileStore(Func createContext, Storage storage) : base(createContext, storage.GetStorageForDirectory(@"files")) { diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs index 0380b6c4b7..e6ba5b26ac 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks } [BackgroundDependencyLoader] - private new void load(OsuColour colour) + private void load(OsuColour colour) { double pp = Score.PP ?? 0; Stats.Add(new OsuSpriteText diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs index 7aa9d75f02..537b208b39 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs @@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks } [BackgroundDependencyLoader] - private new void load() + private void load() { Stats.Add(new OsuSpriteText { diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 5a0f25f7e0..b7dc182e2f 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Settings private SpriteText text; - private readonly RestoreDefaultValueButton restoreDefaultValueButton = new RestoreDefaultValueButton(); + private readonly RestoreDefaultValueButton restoreDefaultValueButton = new RestoreDefaultValueButton(); public bool ShowsDefaultIndicator = true; @@ -132,7 +132,7 @@ namespace osu.Game.Overlays.Settings } } - private class RestoreDefaultValueButton : Box, IHasTooltip + private class RestoreDefaultValueButton : Box, IHasTooltip { internal readonly Bindable Bindable = new Bindable(); diff --git a/osu.Game/Properties/AssemblyInfo.cs b/osu.Game/Properties/AssemblyInfo.cs deleted file mode 100644 index e28f8a3873..0000000000 --- a/osu.Game/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// 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.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.Game")] -[assembly: AssemblyDescription("click the circles. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game")] -[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("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game/Resources/Resource.cs b/osu.Game/Resources/Resource.cs deleted file mode 100644 index 6c66b6818b..0000000000 --- a/osu.Game/Resources/Resource.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -namespace osu.Game.Tests.Resources -{ - public static class Resource - { - public static Stream OpenResource(string name) - { - var localPath = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path)); - - return Assembly.GetExecutingAssembly().GetManifestResourceStream($@"osu.Game.Tests.Resources.{name}") ?? - Assembly.LoadFrom(Path.Combine(localPath, @"osu.Game.Resources.dll")).GetManifestResourceStream($@"osu.Game.Resources.{name}"); - } - } -} \ No newline at end of file diff --git a/osu.Game/Resources/Soleily - Renatus (Gamu) [Insane].osu b/osu.Game/Resources/Soleily - Renatus (Gamu) [Insane].osu deleted file mode 100644 index 3e44dc0af8..0000000000 --- a/osu.Game/Resources/Soleily - Renatus (Gamu) [Insane].osu +++ /dev/null @@ -1,1002 +0,0 @@ -osu file format v14 - -[General] -AudioFilename: 03. Renatus - Soleily 192kbps.mp3 -AudioLeadIn: 0 -PreviewTime: 164471 -Countdown: 0 -SampleSet: Soft -StackLeniency: 0.7 -Mode: 0 -LetterboxInBreaks: 0 -WidescreenStoryboard: 0 - -[Editor] -Bookmarks: 11505,22054,32604,43153,53703,64252,74802,85351,95901,106450,116999,119637,130186,140735,151285,161834,164471,175020,185570,196119,206669,209306 -DistanceSpacing: 1.8 -BeatDivisor: 4 -GridSize: 4 -TimelineZoom: 2 - -[Metadata] -Title:Renatus -TitleUnicode:Renatus -Artist:Soleily -ArtistUnicode:Soleily -Creator:Gamu -Version:Insane -Source: -Tags:MBC7 Unisphere 地球ヤバイEP Chikyu Yabai -BeatmapID:557821 -BeatmapSetID:241526 - -[Difficulty] -HPDrainRate:6.5 -CircleSize:4 -OverallDifficulty:8 -ApproachRate:9 -SliderMultiplier:1.8 -SliderTickRate:2 - -[Events] -//Background and Video events -0,0,"machinetop_background.jpg",0,0 -//Break Periods -2,122474,140135 -//Storyboard Layer 0 (Background) -//Storyboard Layer 1 (Fail) -//Storyboard Layer 2 (Pass) -//Storyboard Layer 3 (Foreground) -//Storyboard Sound Samples - -[TimingPoints] -956,329.67032967033,4,2,0,60,1,0 -20736,-100,4,2,0,65,0,0 -22054,-100,4,2,0,70,0,0 -43153,-100,4,2,0,60,0,0 -48428,-100,4,2,0,50,0,0 -52879,-100,4,2,0,50,0,0 -53373,-100,4,2,0,60,0,0 -53703,-100,4,2,0,70,0,1 -74719,-100,4,2,0,70,0,0 -74802,-100,4,2,0,70,0,1 -95901,-100,4,2,0,70,0,0 -116999,-133.333333333333,4,2,0,50,0,0 -117164,-133.333333333333,4,2,0,30,0,0 -117329,-79.9999999999999,4,2,0,50,0,0 -117659,-100,4,2,0,50,0,0 -118977,-100,4,2,0,60,0,0 -119307,-100,4,2,0,70,0,0 -119637,659.340659340659,4,2,0,80,1,0 -119966,-100,4,2,0,70,0,0 -120296,-100,4,2,0,60,0,0 -120626,-100,4,2,0,50,0,0 -120955,-100,4,2,0,40,0,0 -121285,-100,4,2,0,30,0,0 -121615,-100,4,2,0,20,0,0 -121944,-100,4,2,0,10,0,0 -122274,-100,4,2,0,5,0,0 -140735,-100,4,2,0,50,0,0 -151285,-80,4,2,0,60,0,0 -161834,329.67032967033,4,2,0,65,1,0 -164141,-100,4,2,0,70,0,0 -164471,-100,4,2,0,70,0,1 -185487,-100,4,2,0,70,0,0 -185570,-100,4,2,0,70,0,1 -206669,659.340659340659,4,2,0,80,1,0 -206998,-100,4,2,0,70,0,0 -207328,-100,4,2,0,60,0,0 -207658,-100,4,2,0,50,0,0 -207987,-100,4,2,0,40,0,0 -208317,-100,4,2,0,30,0,0 -208647,-100,4,2,0,20,0,0 -208976,-100,4,2,0,10,0,0 -209306,-100,4,2,0,5,0,0 - - -[Colours] -Combo1 : 142,199,255 -Combo2 : 255,128,128 -Combo3 : 128,255,255 -Combo4 : 128,255,128 -Combo5 : 255,187,255 -Combo6 : 255,177,140 - -[HitObjects] -192,168,956,6,0,P|184:128|200:80,1,90,4|0,1:2|0:0,0:0:0:0: -304,56,1285,1,8,0:0:0:0: -244,236,1450,2,0,P|204:252|156:244,1,90,2|0,0:0|0:0,0:0:0:0: -276,156,1780,2,0,P|310:181|329:226,1,90,2|8,1:2|0:0,0:0:0:0: -300,328,2109,1,2,0:0:0:0: -192,332,2274,6,0,L|144:340,2,45,0|0|0,1:0|0:0|0:0,0:0:0:0: -388,300,2604,1,8,0:0:0:0: -244,236,2769,1,0,1:0:0:0: -232,208,2851,1,0,0:0:0:0: -224,176,2934,1,0,0:0:0:0: -228,144,3016,1,0,0:0:0:0: -244,116,3098,1,0,1:0:0:0: -332,52,3263,2,0,P|376:48|424:56,1,90,8|0,0:0|0:0,0:0:0:0: -488,228,3593,5,0,1:0:0:0: -460,240,3675,1,0,0:0:0:0: -428,236,3758,1,0,0:0:0:0: -292,160,3923,2,0,P|288:204|300:252,1,90,8|0,0:0|0:0,0:0:0:0: -316,276,4170,1,0,0:0:0:0: -344,292,4252,2,0,L|388:300,1,45,0|0,0:0|0:0,0:0:0:0: -288,356,4417,2,0,L|244:364,1,45,0|0,1:0|0:0,0:0:0:0: -168,328,4582,2,0,P|124:324|72:332,1,90,8|0,0:0|0:0,0:0:0:0: -24,188,4912,5,0,1:0:0:0: -56,192,4994,1,0,0:0:0:0: -88,196,5076,1,0,0:0:0:0: -148,108,5241,1,8,0:0:0:0: -188,240,5406,1,0,1:0:0:0: -188,240,5488,1,0,0:0:0:0: -188,240,5571,2,0,L|168:328,1,90,0|0,0:0|1:0,0:0:0:0: -260,216,5901,2,0,P|236:180|188:164,1,90,8|0,0:0|0:0,0:0:0:0: -248,296,6230,6,0,L|348:292,1,90,0|0,1:0|0:0,0:0:0:0: -504,232,6560,1,8,0:0:0:0: -400,204,6725,1,0,0:0:0:0: -392,176,6807,1,0,0:0:0:0: -384,144,6890,1,0,0:0:0:0: -376,116,6972,1,0,0:0:0:0: -368,88,7054,1,0,1:0:0:0: -188,48,7219,2,0,L|208:140,1,90,8|0,0:0|0:0,0:0:0:0: -248,296,7549,5,0,1:0:0:0: -207,135,7714,1,0,0:0:0:0: -156,232,7879,1,8,0:0:0:0: -316,191,8043,1,0,1:0:0:0: -316,191,8126,1,0,0:0:0:0: -316,191,8208,2,0,L|372:200,1,45,0|0,0:0|0:0,0:0:0:0: -492,200,8373,2,0,L|447:207,1,45,0|0,1:0|0:0,0:0:0:0: -408,136,8538,2,0,P|396:92|400:48,1,90,8|0,0:0|0:0,0:0:0:0: -260,32,8868,5,0,1:0:0:0: -252,64,8950,1,0,0:0:0:0: -236,92,9032,2,0,P|204:116|148:128,1,90,0|8,0:0|0:0,0:0:0:0: -28,188,9362,1,0,0:0:0:0: -60,196,9445,1,0,0:0:0:0: -88,212,9527,2,0,P|112:244|124:300,1,90,0|0,0:0|1:0,0:0:0:0: -112,128,9857,2,0,P|152:156|184:196,1,90,8|0,0:0|0:0,0:0:0:0: -216,288,10186,5,0,1:0:0:0: -216,288,10269,1,0,0:0:0:0: -216,288,10351,1,0,0:0:0:0: -268,192,10516,1,8,0:0:0:0: -356,128,10681,1,0,1:0:0:0: -388,120,10763,1,0,0:0:0:0: -420,128,10846,2,0,P|440:168|436:220,1,90,0|0,0:0|1:0,0:0:0:0: -332,328,11175,2,0,L|280:332,1,45,8|8,0:0|0:0,0:0:0:0: -216,288,11340,2,0,L|164:292,1,45,0|0,1:0|0:0,1:0:0:0: -100,248,11505,5,4,1:2:0:0: -148,116,11670,1,2,0:0:0:0: -268,192,11835,1,10,0:0:0:0: -136,328,11999,2,0,L|44:336,1,90,2|0,0:0|0:0,0:0:0:0: -216,288,12329,1,2,1:2:0:0: -148,116,12494,1,10,0:0:0:0: -100,248,12659,1,2,0:0:0:0: -268,192,12824,5,0,1:0:0:0: -268,192,12906,1,0,0:0:0:0: -268,192,12988,1,0,0:0:0:0: -340,272,13153,2,0,P|384:276|432:264,1,90,8|0,0:0|1:0,0:0:0:0: -452,244,13401,1,0,0:0:0:0: -468,216,13483,2,0,L|476:124,1,90,0|0,0:0|1:0,0:0:0:0: -368,32,13813,2,0,L|360:121,1,90,8|0,0:0|0:0,0:0:0:0: -340,272,14142,6,0,L|316:316,2,45,0|0|0,1:0|0:0|0:0,0:0:0:0: -452,244,14472,1,8,0:0:0:0: -268,192,14637,1,0,0:0:0:0: -236,188,14719,1,0,0:0:0:0: -204,192,14802,2,0,P|172:228|160:272,1,90,0|0,0:0|1:0,0:0:0:0: -128,140,15131,2,0,P|160:104|172:60,1,90,8|0,0:0|0:0,0:0:0:0: -64,52,15461,6,0,L|20:68,2,45,0|0|0,1:0|0:0|0:0,0:0:0:0: -171,64,15791,1,8,0:0:0:0: -264,8,15956,2,0,L|356:12,1,90,0|0,1:0|0:0,0:0:0:0: -452,56,16285,1,0,1:0:0:0: -296,140,16450,2,0,L|206:136,1,90,8|0,0:0|0:0,0:0:0:0: -108,184,16780,6,0,P|92:224|96:272,1,90,0|0,1:0|0:0,0:0:0:0: -200,244,17109,1,8,0:0:0:0: -108,108,17274,2,0,L|12:116,1,90,0|0,0:0|0:0,0:0:0:0: -200,244,17604,1,0,1:0:0:0: -296,140,17769,2,0,L|385:132,1,90,8|0,0:0|0:0,0:0:0:0: -480,184,18098,5,0,1:0:0:0: -488,216,18181,1,0,0:0:0:0: -496,248,18263,2,0,L|492:340,1,90,0|8,0:0|0:0,0:0:0:0: -404,224,18593,2,0,L|396:176,2,45,0|0|0,1:0|0:0|0:0,0:0:0:0: -304,264,18923,1,0,1:0:0:0: -200,244,19087,2,0,P|156:240|108:248,1,90,8|0,0:0|0:0,0:0:0:0: -296,140,19417,6,0,P|340:144|388:136,1,90,0|0,1:0|0:0,0:0:0:0: -440,44,19747,1,8,0:0:0:0: -404,224,19912,1,0,0:0:0:0: -404,224,19994,1,0,0:0:0:0: -404,224,20076,2,0,L|412:320,1,90,0|0,0:0|1:0,0:0:0:0: -200,244,20406,2,0,L|192:154,1,90,8|0,0:0|0:0,0:0:0:0: -184,44,20736,5,4,1:2:0:0: -152,40,20818,1,0,0:0:0:0: -120,48,20901,1,0,0:0:0:0: -96,68,20983,1,0,0:0:0:0: -76,92,21065,1,2,0:3:0:0: -64,120,21148,1,0,0:0:0:0: -60,152,21230,1,0,1:0:0:0: -64,184,21313,1,0,0:0:0:0: -76,212,21395,2,0,L|96:252,3,45,0|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -144,316,21725,2,0,L|188:324,3,45,0|0|2|0,0:0|0:0|0:3|0:0,0:0:0:0: -268,340,22054,6,0,L|364:336,1,90,4|0,1:2|0:0,0:0:0:0: -452,280,22384,1,8,0:0:0:0: -512,188,22549,2,0,P|516:144|504:96,1,90,2|0,0:0|0:0,0:0:0:0: -340,24,22879,2,0,P|336:68|348:116,1,90,2|8,1:2|0:0,0:0:0:0: -420,192,23208,1,2,0:0:0:0: -328,252,23373,6,0,L|232:240,1,90,0|0,1:0|0:0,0:0:0:0: -64,256,23703,1,8,0:0:0:0: -144,184,23868,2,0,P|148:140|136:88,1,90,0|0,1:0|0:0,0:0:0:0: -40,52,24197,1,2,1:2:0:0: -139,95,24362,1,8,0:0:0:0: -216,20,24527,1,0,0:0:0:0: -315,63,24692,6,0,P|360:72|408:68,1,90,2|0,1:2|0:0,0:0:0:0: -492,132,25021,1,8,0:0:0:0: -412,204,25186,2,0,P|403:249|407:297,1,90,2|0,0:0|0:0,0:0:0:0: -268,328,25516,2,0,P|277:283|273:235,1,90,2|8,1:2|0:0,0:0:0:0: -232,140,25846,2,0,P|187:131|139:135,1,90,2|0,0:0|1:0,0:0:0:0: -64,208,26175,5,2,0:0:0:0: -44,316,26340,1,8,0:0:0:0: -148,280,26505,1,2,1:2:0:0: -456,208,26835,1,2,1:2:0:0: -476,316,26999,1,10,0:0:0:0: -372,280,27164,1,2,0:0:0:0: -356,172,27329,6,0,L|380:80,1,90,0|0,1:0|0:0,0:0:0:0: -456,208,27659,1,8,0:0:0:0: -300,236,27824,1,2,0:0:0:0: -300,236,27906,1,0,0:0:0:0: -300,236,27988,2,0,L|208:228,1,90,0|2,0:0|1:2,0:0:0:0: -140,312,28318,1,8,0:0:0:0: -372,280,28483,2,0,L|464:272,1,90,2|0,0:0|1:0,0:0:0:0: -500,136,28813,5,2,0:0:0:0: -432,56,28977,1,8,0:0:0:0: -328,24,29142,2,0,P|284:24|236:28,1,90,2|0,1:2|0:0,0:0:0:0: -80,144,29472,1,2,1:2:0:0: -116,44,29637,1,10,0:0:0:0: -184,128,29802,1,2,0:0:0:0: -20,88,29966,6,0,P|1:164|73:227,1,180,2|10,1:2|0:0,0:0:0:0: -184,128,30461,2,0,P|227:120|276:124,1,90,2|0,0:0|0:0,0:0:0:0: -392,188,30791,1,2,1:2:0:0: -272,260,30956,1,8,0:0:0:0: -396,328,31120,1,0,0:0:0:0: -256,348,31285,5,2,1:2:0:0: -224,344,31368,1,0,1:0:0:0: -192,340,31450,2,0,L|172:248,1,90,2|0,1:2|1:0,0:0:0:0: -8,136,31780,2,0,L|27:223,1,90,2|0,1:2|0:0,0:0:0:0: -56,328,32109,1,2,1:2:0:0: -108,192,32274,1,2,1:2:0:0: -100,160,32357,1,0,1:0:0:0: -92,132,32439,1,2,1:2:0:0: -84,104,32521,1,0,1:0:0:0: -76,72,32604,6,0,P|100:112|148:136,1,90,4|0,1:2|0:0,0:0:0:0: -240,168,32934,1,8,0:0:0:0: -336,124,33098,2,0,L|344:80,2,45,2|0|0,0:0|0:0|0:0,0:0:0:0: -264,248,33428,2,0,P|220:248|176:220,1,90,2|8,1:2|0:0,0:0:0:0: -260,84,33758,1,2,0:0:0:0: -344,212,33923,5,0,1:0:0:0: -344,212,34005,1,0,0:0:0:0: -344,212,34087,1,0,0:0:0:0: -440,160,34252,1,8,0:0:0:0: -312,320,34417,2,0,P|272:336|220:324,1,90,0|0,1:0|0:0,0:0:0:0: -156,176,34747,2,0,P|196:160|248:172,2,90,2|8|0,1:2|0:0|0:0,0:0:0:0: -132,280,35241,5,2,1:2:0:0: -132,280,35324,1,0,0:0:0:0: -132,280,35406,2,0,L|120:376,1,90,0|8,0:0|0:0,0:0:0:0: -312,320,35736,2,0,L|300:230,1,90,2|0,0:0|0:0,0:0:0:0: -316,124,36065,1,2,1:2:0:0: -400,192,36230,1,8,0:0:0:0: -300,230,36395,2,0,P|255:231|211:224,1,90,2|0,0:0|1:0,0:0:0:0: -24,132,36725,5,0,0:0:0:0: -132,152,36890,1,8,0:0:0:0: -60,232,37054,1,2,1:2:0:0: -60,232,37137,1,0,0:0:0:0: -60,232,37219,1,0,0:0:0:0: -92,56,37384,2,0,L|184:44,1,90,2|10,1:2|0:0,0:0:0:0: -316,124,37714,2,0,L|226:135,1,90,2|0,0:0|1:0,0:0:0:0: -60,232,38043,6,0,P|52:276|64:328,1,90,0|8,0:0|0:0,0:0:0:0: -220,152,38373,2,0,P|176:144|124:156,1,90,2|0,0:0|0:0,0:0:0:0: -176,252,38703,1,2,1:2:0:0: -323,213,38868,2,0,L|316:124,1,90,8|2,0:0|0:0,0:0:0:0: -332,320,39197,5,0,1:0:0:0: -424,260,39362,1,2,0:0:0:0: -260,272,39527,2,0,P|246:313|256:360,1,90,8|2,0:0|1:2,0:0:0:0: -408,336,39857,1,0,0:0:0:0: -176,252,40021,2,0,L|80:260,2,90,2|10|2,1:2|0:0|0:0,0:0:0:0: -324,212,40516,5,2,1:2:0:0: -324,212,40598,1,0,1:0:0:0: -324,212,40681,1,0,1:0:0:0: -200,336,40846,1,2,1:2:0:0: -236,188,41010,1,2,1:2:0:0: -236,188,41093,1,0,1:0:0:0: -236,188,41175,1,0,1:0:0:0: -281,357,41340,1,2,1:2:0:0: -176,252,41505,1,2,1:2:0:0: -176,252,41587,1,0,1:0:0:0: -176,252,41670,1,0,1:0:0:0: -344,297,41835,5,2,1:2:0:0: -432,232,41999,1,2,1:2:0:0: -444,204,42082,1,0,1:0:0:0: -448,172,42164,1,0,1:0:0:0: -444,140,42247,1,0,1:0:0:0: -432,112,42329,2,0,L|440:64,2,45,2|0|0,1:2|1:0|1:0,0:0:0:0: -236,188,42659,1,0,0:0:0:0: -340,172,42824,1,2,0:3:0:0: -272,88,42988,1,0,0:0:0:0: -132,160,43153,6,0,P|148:248|220:296,1,180,4|8,1:2|0:0,0:0:0:0: -324,320,43648,2,0,L|336:364,2,45,0|0|0,0:0|0:0|0:0,0:0:0:0: -292,216,43977,1,0,1:0:0:0: -396,240,44142,2,0,P|440:244|488:232,1,90,8|0,0:0|0:0,0:0:0:0: -328,124,44472,6,0,P|284:120|236:132,1,90,0|0,1:0|0:0,0:0:0:0: -168,212,44802,1,8,0:0:0:0: -192,316,44966,1,0,1:0:0:0: -140,220,45131,1,0,0:0:0:0: -83,310,45296,1,0,1:0:0:0: -114,205,45461,1,8,0:0:0:0: -10,229,45626,1,0,0:0:0:0: -106,176,45791,6,0,P|113:133|108:85,1,90,0|0,1:0|0:0,0:0:0:0: -204,136,46120,1,8,0:0:0:0: -256,40,46285,1,0,0:0:0:0: -256,40,46368,1,0,0:0:0:0: -256,40,46450,2,0,L|356:44,1,90,0|0,0:0|1:0,0:0:0:0: -501,124,46780,2,0,L|412:128,1,90,8|0,0:0|0:0,0:0:0:0: -324,192,47109,5,0,1:0:0:0: -356,296,47274,1,0,0:0:0:0: -284,216,47439,1,8,0:0:0:0: -269,323,47604,1,0,1:0:0:0: -237,220,47769,1,0,0:0:0:0: -178,311,47934,1,0,1:0:0:0: -191,203,48098,1,8,0:0:0:0: -99,261,48263,1,0,0:0:0:0: -156,168,48428,6,0,B|176:112|136:64|136:64|200:96,1,180,4|8,1:2|0:0,0:0:0:0: -300,124,48923,2,0,L|392:120,1,90,0|0,0:0|0:0,0:0:0:0: -468,48,49252,1,0,1:0:0:0: -390,120,49417,2,0,P|390:164|406:208,1,90,8|0,0:0|0:0,0:0:0:0: -352,344,49747,6,0,P|352:300|336:256,1,90,4|0,1:2|0:0,0:0:0:0: -240,208,50076,1,8,0:0:0:0: -163,320,50241,2,0,P|207:324|252:316,1,90,0|0,1:0|0:0,0:0:0:0: -240,208,50571,1,0,1:0:0:0: -76,296,50736,2,0,P|76:340|92:384,1,90,8|0,0:0|0:0,0:0:0:0: -312,164,51065,6,0,P|236:124|160:184,1,180,4|8,1:2|0:0,0:0:0:0: -247,297,51560,2,0,L|240:208,1,90,0|0,0:0|0:0,0:0:0:0: -224,48,51890,1,0,1:0:0:0: -332,56,52054,2,0,L|366:58,5,30,8|0|0|0|0|0,0:0|0:0|0:0|0:0|0:0|0:0,0:0:0:0: -408,64,52384,6,0,P|420:108|416:156,1,90,0|0,1:0|0:0,0:0:0:0: -360,260,52714,1,8,0:0:0:0: -247,297,52879,2,0,B|203:281|159:297|159:297|115:313|71:297,1,180,0|0,1:0|1:0,0:0:0:0: -116,196,53373,1,8,0:0:0:0: -120,164,53456,1,0,0:0:0:0: -124,132,53538,1,0,0:0:0:0: -128,100,53620,1,0,0:0:0:0: -132,68,53703,5,4,1:2:0:0: -40,136,53868,1,0,0:0:0:0: -204,160,54032,2,0,L|304:152,1,90,8|0,0:0|0:0,0:0:0:0: -408,64,54362,1,0,0:0:0:0: -408,64,54445,1,0,0:0:0:0: -408,64,54527,2,0,P|404:112|416:160,1,90,0|8,1:0|0:0,0:0:0:0: -484,236,54857,1,0,0:0:0:0: -428,328,55021,5,0,1:0:0:0: -328,296,55186,1,0,0:0:0:0: -328,296,55269,1,0,0:0:0:0: -328,296,55351,1,8,0:0:0:0: -416,300,55516,1,0,1:0:0:0: -472,208,55681,1,0,0:0:0:0: -316,268,55846,1,0,1:0:0:0: -460,180,56010,1,8,0:0:0:0: -304,240,56175,1,0,0:0:0:0: -404,272,56340,5,0,1:0:0:0: -448,152,56505,1,0,0:0:0:0: -448,152,56587,1,0,0:0:0:0: -448,152,56670,2,0,P|456:112|448:60,1,90,8|0,0:0|0:0,0:0:0:0: -268,28,56999,2,0,P|260:68|268:120,1,90,0|0,0:0|1:0,0:0:0:0: -404,272,57329,2,0,P|444:280|496:272,2,90,8|0|0,0:0|0:0|1:0,0:0:0:0: -304,240,57824,5,0,0:0:0:0: -252,336,57988,1,8,0:0:0:0: -196,244,58153,1,0,1:0:0:0: -24,256,58318,1,0,0:0:0:0: -116,200,58483,1,0,1:0:0:0: -136,60,58648,1,8,0:0:0:0: -192,152,58813,1,0,0:0:0:0: -304,240,58977,6,0,P|348:252|396:248,1,90,0|0,1:0|0:0,0:0:0:0: -456,116,59307,2,0,P|412:104|364:108,1,90,8|0,0:0|0:0,0:0:0:0: -273,161,59637,1,0,0:0:0:0: -136,60,59802,1,0,1:0:0:0: -192,152,59966,1,8,0:0:0:0: -23,177,60131,1,0,0:0:0:0: -129,203,60296,5,0,1:0:0:0: -88,304,60461,2,0,P|132:311|176:303,1,90,0|8,0:0|0:0,0:0:0:0: -304,240,60791,1,0,1:0:0:0: -304,240,60873,1,0,0:0:0:0: -304,240,60956,2,0,L|312:288,3,45,0|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -384,256,61285,2,0,L|392:304,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -464,272,61615,5,2,1:2:0:0: -488,168,61780,1,2,0:0:0:0: -428,80,61945,1,10,0:0:0:0: -332,32,62109,2,0,P|288:28|240:36,1,90,2|0,0:0|0:0,0:0:0:0: -28,216,62439,1,2,1:2:0:0: -88,304,62604,1,10,0:0:0:0: -184,352,62769,2,0,P|228:356|276:348,1,90,2|0,0:0|1:0,0:0:0:0: -384,256,63098,6,0,P|409:219|426:174,1,90,2|8,0:0|0:0,0:0:0:0: -428,80,63428,2,0,L|420:36,2,45,2|0|0,1:2|0:0|0:0,0:0:0:0: -456,288,63758,1,2,1:2:0:0: -324,200,63923,1,10,1:2:0:0: -292,204,64005,1,0,1:0:0:0: -260,208,64087,1,2,1:2:0:0: -228,212,64170,1,0,1:0:0:0: -196,216,64252,5,4,1:2:0:0: -104,160,64417,1,0,0:0:0:0: -228,296,64582,2,0,L|320:284,1,90,8|0,0:0|0:0,0:0:0:0: -344,112,64912,1,0,0:0:0:0: -344,112,64994,1,0,0:0:0:0: -344,112,65076,2,0,L|254:123,1,90,0|8,1:0|0:0,0:0:0:0: -144,284,65406,2,0,P|148:328|176:364,1,90,0|0,0:0|1:0,0:0:0:0: -196,216,65736,5,0,0:0:0:0: -196,216,65818,1,0,0:0:0:0: -196,216,65901,2,0,P|155:198|110:205,1,90,8|0,0:0|1:0,0:0:0:0: -36,284,66230,1,0,0:0:0:0: -4,180,66395,1,0,1:0:0:0: -132,24,66560,1,8,0:0:0:0: -100,128,66725,1,0,0:0:0:0: -24,48,66890,5,0,1:0:0:0: -212,108,67054,1,0,0:0:0:0: -212,108,67137,1,0,0:0:0:0: -212,108,67219,2,0,L|300:92,1,90,8|0,0:0|0:0,0:0:0:0: -472,144,67549,2,0,L|384:160,1,90,0|0,0:0|1:0,0:0:0:0: -196,216,67879,2,0,P|240:216|288:240,1,90,8|0,0:0|0:0,0:0:0:0: -324,336,68208,5,0,1:0:0:0: -144,288,68373,1,0,0:0:0:0: -58,170,68538,1,8,0:0:0:0: -196,215,68703,1,0,1:0:0:0: -58,260,68868,1,0,0:0:0:0: -144,142,69032,2,0,L|138:108,2,30,0|0|0,1:0|0:0|0:0,0:0:0:0: -144,142,69197,2,0,P|184:124|232:132,1,90,8|0,0:0|0:0,0:0:0:0: -312,248,69527,6,0,L|324:338,1,90,0|0,1:0|0:0,0:0:0:0: -436,248,69857,1,8,0:0:0:0: -432,216,69939,1,0,0:0:0:0: -428,184,70021,1,0,0:0:0:0: -328,120,70186,1,0,0:0:0:0: -324,152,70269,1,0,0:0:0:0: -320,184,70351,1,0,1:0:0:0: -316,216,70434,1,0,0:0:0:0: -312,248,70516,2,0,L|320:300,1,45,8|0,0:0|0:0,0:0:0:0: -244,340,70681,2,0,L|237:295,1,45,0|0,0:0|0:0,0:0:0:0: -216,224,70846,6,0,P|168:216|124:224,1,90,0|0,1:0|0:0,0:0:0:0: -40,288,71175,1,8,0:0:0:0: -2,95,71340,2,0,P|-4:139|4:184,1,90,0|0,1:0|0:0,0:0:0:0: -164,304,71670,1,0,1:0:0:0: -312,248,71835,1,8,0:0:0:0: -244,340,71999,1,0,0:0:0:0: -216,224,72164,6,0,L|228:132,1,90,0|0,1:0|0:0,0:0:0:0: -332,148,72494,2,0,L|344:56,1,90,8|0,0:0|0:0,0:0:0:0: -312,248,72824,1,0,0:0:0:0: -164,304,72988,1,0,1:0:0:0: -332,336,73153,1,8,0:0:0:0: -360,324,73236,1,0,0:0:0:0: -384,304,73318,1,0,0:0:0:0: -399,276,73401,1,0,0:0:0:0: -403,244,73483,6,0,L|396:200,3,45,4|0|2|0,1:2|0:0|0:0|1:0,0:0:0:0: -420,112,73813,2,0,L|427:68,3,45,2|0|2|0,1:2|0:0|1:2|0:0,0:0:0:0: -352,16,74142,2,0,L|345:60,3,45,0|0|2|0,0:0|1:0|1:2|0:0,0:0:0:0: -332,148,74472,1,2,1:2:0:0: -332,148,74554,1,0,1:0:0:0: -332,148,74637,1,2,1:2:0:0: -332,148,74719,1,0,1:0:0:0: -332,148,74802,6,0,P|360:216|320:312,1,180,4|2,1:2|0:3,0:0:0:0: -190,310,75296,2,0,P|151:231|180:148,1,180,4|0,1:2|0:0,0:0:0:0: -256,56,75791,1,0,0:0:0:0: -332,148,75956,1,2,0:3:0:0: -179,148,76120,5,4,1:2:0:0: -336,64,76285,1,4,1:2:0:0: -256,224,76450,1,2,0:3:0:0: -176,64,76615,1,4,1:2:0:0: -256,140,76780,2,0,L|256:324,1,180,2|0,0:0|0:0,0:0:0:0: -364,300,77274,1,2,0:3:0:0: -148,300,77439,6,0,P|104:316|76:356,1,90,4|0,1:2|0:0,0:0:0:0: -24,252,77769,2,0,L|16:208,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -96,212,78098,2,0,L|104:168,3,45,0|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -32,128,78428,2,0,L|24:84,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -104,88,78758,5,2,1:2:0:0: -204,132,78923,1,0,0:0:0:0: -236,124,79005,1,0,0:0:0:0: -268,116,79087,2,0,L|280:68,3,45,8|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -348,100,79417,2,0,L|360:52,3,45,0|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -428,84,79747,1,8,1:2:0:0: -460,76,79829,1,0,1:0:0:0: -492,68,79912,1,0,1:0:0:0: -492,260,80076,6,0,P|400:248|328:296,1,180,4|2,1:2|0:3,0:0:0:0: -144,236,80571,2,0,P|236:248|308:200,1,180,4|0,1:2|0:0,0:0:0:0: -348,100,81065,2,0,P|348:56|336:8,1,90,0|2,0:0|0:3,0:0:0:0: -140,48,81395,5,4,1:2:0:0: -244,68,81560,1,4,1:2:0:0: -144,236,81725,1,2,0:3:0:0: -176,133,81890,1,4,1:2:0:0: -184,304,82054,2,0,P|100:300|68:220,1,180,2|0,0:0|0:0,0:0:0:0: -100,116,82549,1,2,0:3:0:0: -264,244,82714,6,0,L|272:340,1,90,4|0,1:2|0:0,0:0:0:0: -380,316,83043,1,8,0:0:0:0: -396,288,83126,1,0,0:0:0:0: -400,256,83208,1,0,0:0:0:0: -396,224,83291,1,0,0:0:0:0: -380,196,83373,2,0,L|336:176,3,45,0|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -272,148,83703,1,8,0:0:0:0: -256,120,83785,1,0,0:0:0:0: -252,88,83868,1,0,0:0:0:0: -256,56,83950,1,0,0:0:0:0: -272,28,84032,6,0,L|316:8,3,45,2|0|0|0,1:2|0:0|0:0|0:0,0:0:0:0: -360,72,84362,2,0,L|408:72,3,45,8|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -421,149,84692,2,0,L|464:169,3,45,2|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -443,244,85021,2,0,L|473:281,3,45,8|0|0|0,1:2|1:0|0:0|0:0,0:0:0:0: -422,339,85351,6,0,L|240:348,1,180,4|2,1:2|0:3,0:0:0:0: -76,172,85846,2,0,L|255:163,1,180,4|0,1:2|0:0,0:0:0:0: -421,149,86340,2,0,P|435:107|428:56,1,90,0|2,0:0|0:3,0:0:0:0: -228,56,86670,5,4,1:2:0:0: -280,192,86835,1,4,1:2:0:0: -328,96,86999,1,2,0:3:0:0: -180,152,87164,1,4,1:2:0:0: -28,100,87330,2,0,P|16:56|20:8,1,90,2|0,0:0|0:0,0:0:0:0: -0,180,87659,1,0,0:0:0:0: -28,284,87824,1,2,0:3:0:0: -108,352,87988,6,0,P|152:360|196:356,1,90,4|0,1:2|0:0,0:0:0:0: -276,284,88318,1,8,0:0:0:0: -304,272,88401,1,0,0:0:0:0: -336,268,88483,1,0,0:0:0:0: -368,272,88565,1,0,0:0:0:0: -396,284,88648,2,0,L|432:312,1,45,0|0,0:0|0:0,0:0:0:0: -488,252,88813,2,0,L|452:224,1,45,0|0,1:0|0:0,0:0:0:0: -400,164,88977,2,0,L|396:116,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -316,64,89307,6,0,L|320:160,1,90,2|0,1:2|0:0,0:0:0:0: -276,284,89637,1,8,0:0:0:0: -248,296,89719,1,0,0:0:0:0: -216,300,89802,1,0,1:0:0:0: -184,296,89884,1,0,0:0:0:0: -156,284,89966,2,0,L|120:256,1,45,0|0,0:0|0:0,0:0:0:0: -176,200,90131,2,0,L|140:172,1,45,0|0,1:0|0:0,0:0:0:0: -196,116,90296,2,0,L|160:88,3,45,8|0|0|0,1:2|1:0|1:0|0:0,0:0:0:0: -92,44,90626,6,0,P|48:44|24:160,1,180,4|2,1:2|0:3,0:0:0:0: -156,284,91120,2,0,B|200:300|244:284|244:284|288:268|332:284,1,180,4|0,1:2|0:0,0:0:0:0: -176,200,91615,2,0,P|176:156|196:116,1,90,0|2,0:0|0:3,0:0:0:0: -264,28,91945,6,0,L|353:39,1,90,4|0,1:2|1:0,0:0:0:0: -453,159,92274,2,0,L|364:148,1,90,2|4,0:3|1:2,0:0:0:0: -268,196,92604,2,0,P|260:268|328:348,1,180,2|0,0:0|0:0,0:0:0:0: -364,248,93098,1,2,0:3:0:0: -176,200,93263,5,4,1:2:0:0: -72,228,93428,1,0,1:0:0:0: -152,92,93593,1,0,1:0:0:0: -256,64,93758,1,0,1:0:0:0: -336,200,93923,5,0,1:0:0:0: -440,228,94087,1,0,1:0:0:0: -360,92,94252,1,0,1:0:0:0: -256,64,94417,1,0,1:0:0:0: -176,200,94582,5,2,1:2:0:0: -168,228,94664,1,0,1:0:0:0: -168,260,94747,1,0,1:0:0:0: -172,292,94829,1,0,1:0:0:0: -192,316,94912,1,0,1:0:0:0: -220,328,94994,1,0,1:0:0:0: -252,332,95076,1,0,1:0:0:0: -280,320,95159,1,0,1:0:0:0: -300,296,95241,2,0,L|308:248,3,45,2|0|0|0,1:2|1:0|1:0|1:0,0:0:0:0: -312,172,95571,2,0,L|304:127,3,45,0|0|0|0,1:0|1:0|1:0|1:0,0:0:0:0: -256,64,95901,6,0,P|208:56|164:60,1,90,4|0,1:2|0:0,0:0:0:0: -76,116,96230,1,8,0:0:0:0: -60,224,96395,1,0,0:0:0:0: -60,224,96477,1,0,0:0:0:0: -160,184,96642,1,0,0:0:0:0: -160,184,96725,1,0,1:0:0:0: -63,26,96890,2,0,L|76:116,1,90,8|0,0:0|0:0,0:0:0:0: -136,272,97219,5,0,1:0:0:0: -168,268,97302,1,0,0:0:0:0: -200,264,97384,1,0,0:0:0:0: -232,260,97466,1,0,0:0:0:0: -264,256,97549,1,8,0:0:0:0: -384,136,97714,1,0,1:0:0:0: -376,168,97796,1,0,0:0:0:0: -380,200,97879,1,0,0:0:0:0: -392,228,97961,1,0,0:0:0:0: -416,248,98043,2,0,P|464:260|512:260,2,90,0|8|0,1:0|0:0|0:0,0:0:0:0: -231,105,98538,6,0,L|188:116,2,45,0|0|0,1:0|0:0|0:0,0:0:0:0: -376,56,98868,2,0,L|420:64,1,45,8|0,0:0|0:0,0:0:0:0: -384,136,99032,1,0,0:0:0:0: -384,136,99115,2,0,P|340:128|304:92,1,90,0|0,0:0|0:0,0:0:0:0: -303,18,99362,2,0,L|207:26,2,90,0|8|0,1:0|0:0|0:0,0:0:0:0: -452,88,99857,5,0,1:0:0:0: -465,116,99939,1,0,0:0:0:0: -466,147,100021,1,0,0:0:0:0: -456,177,100104,1,0,0:0:0:0: -436,201,100186,2,0,P|416:213|389:216,3,45,8|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -320,188,100516,2,0,P|300:176|273:173,3,45,0|0|0|0,0:0|1:0|1:0|0:0,0:0:0:0: -204,200,100846,2,0,P|192:220|189:247,3,45,8|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -188,320,101175,6,0,P|143:322|100:310,1,90,0|0,1:0|0:0,0:0:0:0: -76,292,101423,1,0,0:0:0:0: -76,292,101505,1,8,0:0:0:0: -76,292,101587,2,0,L|72:248,1,45 -12,68,101835,2,0,L|6:24,2,45,0|0|0,0:0|0:0|1:0,0:0:0:0: -104,140,102164,2,0,L|171:132,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -224,124,102494,6,0,P|236:164|232:216,1,90,0|0,1:0|0:0,0:0:0:0: -288,296,102824,1,8,0:0:0:0: -288,296,102906,1,0,0:0:0:0: -288,296,102988,2,0,P|328:284|380:288,1,90,0|0,1:0|0:0,0:0:0:0: -404,304,103236,1,0,0:0:0:0: -424,328,103318,1,0,1:0:0:0: -448,188,103483,2,0,L|440:140,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -424,72,103813,5,0,1:0:0:0: -324,112,103977,1,0,0:0:0:0: -324,112,104060,1,0,0:0:0:0: -324,112,104142,2,0,P|280:116|232:104,1,90,8|0,0:0|0:0,0:0:0:0: -160,28,104472,1,0,0:0:0:0: -216,208,104637,1,0,1:0:0:0: -216,208,104719,1,0,0:0:0:0: -216,208,104802,1,8,0:0:0:0: -352,240,104966,1,0,0:0:0:0: -384,244,105049,1,0,0:0:0:0: -416,248,105131,6,0,L|460:240,4,45,0|0|0|0|8,1:0|0:0|0:0|0:0|0:0,0:0:0:0: -272,288,105626,1,0,1:0:0:0: -264,320,105708,1,0,0:0:0:0: -256,352,105791,2,0,L|204:356,5,30,0|0|0|0|0|0,0:0|0:0|0:0|1:0|0:0|0:0,0:0:0:0: -156,332,106120,2,0,L|104:336,5,30,8|0|0|0|0|0,0:0|0:0|0:0|1:0|0:0|0:0,0:0:0:0: -56,312,106450,5,4,1:2:0:0: -4,188,106615,1,0,0:0:0:0: -168,220,106780,2,0,P|127:232|79:228,1,90,8|0,0:0|0:0,0:0:0:0: -112,124,107109,1,0,0:0:0:0: -272,216,107274,2,0,L|264:316,1,90,0|8,1:0|0:0,0:0:0:0: -400,268,107604,1,0,0:0:0:0: -428,132,107769,5,0,1:0:0:0: -428,132,107851,1,0,0:0:0:0: -428,132,107934,1,0,0:0:0:0: -428,132,108016,1,0,0:0:0:0: -428,132,108098,1,8,0:0:0:0: -332,84,108263,2,0,P|288:80|232:88,1,90,0|0,1:0|0:0,0:0:0:0: -112,124,108593,1,0,1:0:0:0: -148,264,108758,1,8,0:0:0:0: -16,236,108923,1,0,0:0:0:0: -264,126,109087,6,0,L|272:216,1,90,0|0,1:0|0:0,0:0:0:0: -452,224,109417,2,0,L|460:320,1,90,8|0,0:0|0:0,0:0:0:0: -360,232,109747,1,0,0:0:0:0: -348,56,109912,1,0,1:0:0:0: -416,140,110076,1,8,0:0:0:0: -256,112,110241,2,0,P|212:120|160:112,1,90,0|0,0:0|1:0,0:0:0:0: -348,56,110571,6,0,L|331:150,1,90,0|8,0:0|0:0,0:0:0:0: -208,328,110901,2,0,L|191:239,1,90,0|0,1:0|0:0,0:0:0:0: -184,216,111148,1,0,1:0:0:0: -178,194,111230,1,0,1:0:0:0: -68,272,111395,1,8,0:0:0:0: -56,136,111560,1,0,1:0:0:0: -178,194,111725,6,0,P|219:203|267:199,1,90,4|0,1:2|0:0,0:0:0:0: -364,148,112054,1,8,0:0:0:0: -384,256,112219,2,0,P|406:291|443:322,1,90,0|0,0:0|0:0,0:0:0:0: -488,224,112549,1,0,1:0:0:0: -304,232,112714,2,0,L|208:224,2,90,8|0|0,0:0|0:0|1:0,0:0:0:0: -208,328,113208,6,0,L|112:320,1,90,0|8,0:0|0:0,0:0:0:0: -26,184,113538,2,0,L|116:192,1,90,0|0,1:0|0:0,0:0:0:0: -304,232,113868,1,0,1:0:0:0: -116,192,114032,1,8,0:0:0:0: -224,132,114197,1,0,0:0:0:0: -208,328,114362,6,0,B|272:360|320:312|320:312|340:368,1,180,4|8,1:2|0:0,0:0:0:0: -304,232,114857,2,0,P|300:184|308:140,1,90,0|0,0:0|0:0,0:0:0:0: -384,64,115186,1,0,1:0:0:0: -307,143,115351,1,8,0:0:0:0: -256,48,115516,1,0,0:0:0:0: -456,24,115681,6,0,B|482:101|420:136|420:136|440:184,1,180,4|8,1:2|0:0,0:0:0:0: -384,64,116175,2,0,P|340:56|296:64,1,90,0|0,1:0|0:0,0:0:0:0: -211,171,116505,1,0,1:0:0:0: -439,181,116670,2,0,L|448:84,1,90,8|0,0:0|0:0,0:0:0:0: -372,296,116999,6,2,L|304:292,1,67.5000025749208,2|0,0:1|0:0,0:0:0:0: -136,252,117329,6,2,P|196:260|212:172,1,168.75,0|0,0:0|0:0,0:0:0:0: -192,148,117659,1,2,0:3:0:0: -164,132,117741,1,2,0:3:0:0: -132,124,117824,1,2,1:3:0:0: -100,132,117906,1,2,0:3:0:0: -72,148,117988,2,0,L|52:56,1,90,2|8,0:3|0:0,0:0:0:0: -36,244,118318,5,0,1:0:0:0: -76,344,118483,1,0,1:0:0:0: -184,352,118648,1,0,1:0:0:0: -244,264,118813,1,0,1:0:0:0: -244,264,118895,1,0,1:0:0:0: -244,264,118977,2,0,L|288:260,3,45,2|0|2|0,1:2|0:0|0:0|0:0,0:0:0:0: -332,328,119307,2,0,L|376:324,3,45,2|0|2|0,1:2|0:0|0:0|0:0,0:0:0:0: -412,252,119637,5,4,1:2:0:0: -256,192,119719,12,0,122274,0:0:0:0: -256,192,140735,6,0,L|228:156,1,45,4|0,1:2|0:0,0:0:0:0: -152,132,141065,2,0,P|129:129|104:136,1,45 -48,192,141395,2,0,P|40:236|52:280,1,90,8|8,0:0|0:0,0:0:0:0: -196,352,142054,6,0,L|308:340,1,90,8|8,0:0|1:2,0:0:0:0: -336,280,142549,1,0,0:0:0:0: -404,324,142713,1,8,0:0:0:0: -404,324,142878,1,8,0:0:0:0: -292,120,143373,5,0,1:0:0:0: -212,104,143538,1,0,0:0:0:0: -140,140,143702,1,0,0:0:0:0: -120,220,143867,1,0,0:0:0:0: -144,296,144032,2,0,P|184:320|228:316,1,90,10|8,0:0|0:0,0:0:0:0: -372,212,144691,6,0,P|327:209|290:232,1,90,10|8,0:0|1:2,0:0:0:0: -348,288,145186,1,0,0:0:0:0: -452,220,145351,1,10,0:0:0:0: -452,220,145516,1,8,0:0:0:0: -328,36,146010,5,2,1:2:0:0: -264,88,146175,1,0,0:0:0:0: -184,108,146340,1,0,0:0:0:0: -104,88,146505,1,0,0:0:0:0: -44,36,146669,1,8,0:0:0:0: -44,36,146999,1,8,0:0:0:0: -44,36,147329,6,0,L|24:84,1,45,8|0,0:0|0:0,0:0:0:0: -52,156,147658,2,0,L|71:204,1,45,8|0,1:2|0:0,0:0:0:0: -144,236,147988,1,8,0:0:0:0: -144,236,148153,1,8,0:0:0:0: -316,64,148647,5,0,1:0:0:0: -380,116,148812,1,0,0:0:0:0: -408,192,148977,1,0,0:0:0:0: -380,268,149142,1,0,0:0:0:0: -316,320,149307,2,0,L|224:316,1,90,10|8,0:0|0:0,0:0:0:0: -64,248,149966,5,10,0:0:0:0: -144,236,150131,1,0,0:0:0:0: -188,168,150296,1,8,1:2:0:0: -192,88,150461,1,0,0:0:0:0: -140,24,150626,2,0,P|120:16|96:20,1,45,10|0,0:0|0:0,0:0:0:0: -260,132,150955,2,0,P|280:140|304:136,1,45,2|0,0:0|0:0,0:0:0:0: -476,48,151285,6,0,L|484:160,1,112.5,4|0,1:2|0:0,0:0:0:0: -464,236,151779,1,0,0:0:0:0: -436,308,151944,2,0,P|380:320|324:308,1,112.5,8|8,0:0|0:0,0:0:0:0: -76,308,152604,6,0,P|132:320|188:308,1,112.5,8|8,0:0|1:2,0:0:0:0: -256,88,153263,1,8,0:0:0:0: -256,168,153428,1,8,0:0:0:0: -256,168,153922,5,4,1:2:0:0: -256,248,154087,1,0,0:0:0:0: -324,128,154252,1,0,0:0:0:0: -188,128,154417,1,0,0:0:0:0: -332,212,154582,2,0,L|388:204,1,56.25,10|0,0:0|0:0,0:0:0:0: -492,152,154911,2,0,L|436:144,1,56.25,8|0,0:0|0:0,0:0:0:0: -324,128,155241,5,10,0:0:0:0: -180,212,155406,1,0,0:0:0:0: -332,212,155571,1,8,1:2:0:0: -188,128,155735,1,0,0:0:0:0: -256,248,155900,1,10,0:0:0:0: -256,248,156065,2,0,L|256:304,2,56.25,0|0|0,0:0|0:0|0:0,0:0:0:0: -180,212,156560,6,0,L|124:204,1,56.25,4|0,1:2|0:0,0:0:0:0: -20,152,156889,2,0,L|76:144,1,56.25,0|0,0:0|0:0,0:0:0:0: -188,128,157219,2,0,P|212:72|192:16,1,112.5,8|8,0:0|0:0,0:0:0:0: -132,72,157713,1,0,0:0:0:0: -180,212,157878,6,0,L|236:208,1,56.25,8|0,0:0|0:0,0:0:0:0: -360,252,158208,2,8,L|304:248,1,56.25,8|0,1:2|0:0,0:0:0:0: -168,292,158538,2,0,L|160:356,2,56.25,8|8|0,0:0|0:0|0:0,0:0:0:0: -180,212,159032,1,0,0:0:0:0: -144,140,159197,6,0,P|104:128|36:148,1,112.5,2|0,1:2|0:0,0:0:0:0: -12,220,159691,1,0,0:0:0:0: -36,296,159856,2,0,P|60:316|92:324,1,56.25,8|0,0:0|0:0,0:0:0:0: -215,264,160186,2,0,P|189:273|168:292,1,56.25,8|0,0:0|0:0,0:0:0:0: -228,344,160516,6,0,L|284:340,1,56.25,10|0,0:0|0:0,0:0:0:0: -328,276,160845,2,0,L|384:272,1,56.25,8|0,1:2|0:0,0:0:0:0: -428,208,161175,1,8,0:0:0:0: -440,128,161340,1,8,0:0:0:0: -400,60,161505,1,2,0:0:0:0: -328,28,161669,1,0,0:0:0:0: -212,76,161834,6,0,P|200:120|208:164,1,90,2|0,1:2|1:0,0:0:0:0: -300,308,162163,2,0,P|312:264|304:220,1,90,2|0,1:2|1:0,0:0:0:0: -140,236,162493,2,0,P|184:248|228:240,1,90,2|0,1:2|1:0,0:0:0:0: -372,148,162823,2,0,P|328:136|284:144,1,90,2|0,1:2|1:0,0:0:0:0: -104,316,163152,5,2,1:2:0:0: -78,297,163235,1,0,1:0:0:0: -60,270,163317,1,0,1:0:0:0: -54,239,163399,1,0,1:0:0:0: -58,207,163482,1,2,1:2:0:0: -74,180,163564,1,0,1:0:0:0: -98,159,163647,1,0,1:0:0:0: -127,149,163729,1,0,1:0:0:0: -158,150,163812,2,0,L|208:160,1,45,2|0,1:2|1:0,0:0:0:0: -344,184,163976,2,0,L|294:194,1,45,0|0,1:0|1:0,0:0:0:0: -140,236,164141,1,4,1:2:0:0: -140,236,164471,6,0,L|232:252,1,90,4|0,1:2|0:0,0:0:0:0: -344,184,164801,1,8,0:0:0:0: -380,284,164965,1,0,0:0:0:0: -368,104,165130,2,0,P|324:104|284:128,1,90,0|0,0:0|1:0,0:0:0:0: -356,360,165460,2,0,P|400:360|440:336,1,90,8|0,0:0|0:0,0:0:0:0: -432,208,165790,5,0,1:0:0:0: -292,260,165954,1,0,0:0:0:0: -344,184,166119,1,8,0:0:0:0: -204,236,166284,1,0,1:0:0:0: -204,236,166366,1,0,0:0:0:0: -204,236,166449,2,0,L|216:328,1,90,0|0,0:0|1:0,0:0:0:0: -120,208,166779,2,0,L|131:118,1,90,8|0,0:0|0:0,0:0:0:0: -204,236,167108,5,0,1:0:0:0: -32,216,167273,1,0,0:0:0:0: -130,118,167438,1,8,0:0:0:0: -110,298,167603,1,0,0:0:0:0: -110,298,167685,1,0,0:0:0:0: -110,298,167768,2,0,L|121:208,1,90,0|0,0:0|1:0,0:0:0:0: -304,40,168097,2,0,L|315:130,1,90,8|0,0:0|0:0,0:0:0:0: -328,236,168427,5,0,1:0:0:0: -184,148,168592,1,0,0:0:0:0: -314,129,168757,1,8,0:0:0:0: -197,254,168921,1,0,1:0:0:0: -197,254,169004,1,0,0:0:0:0: -197,254,169086,2,0,P|220:292|260:312,1,90,0|0,0:0|1:0,0:0:0:0: -409,210,169416,2,0,P|365:211|328:236,1,90,8|0,0:0|0:0,0:0:0:0: -488,232,169746,6,0,P|487:192|464:149,1,90,0|0,1:0|0:0,0:0:0:0: -314,129,170075,1,8,0:0:0:0: -409,210,170240,1,0,0:0:0:0: -332,40,170405,2,0,L|240:36,1,90,0|0,0:0|1:0,0:0:0:0: -68,144,170735,2,0,L|157:140,1,90,8|0,0:0|0:0,0:0:0:0: -314,129,171064,5,0,1:0:0:0: -332,40,171229,1,0,0:0:0:0: -324,216,171394,1,8,0:0:0:0: -306,305,171559,1,0,1:0:0:0: -257,178,171724,1,0,0:0:0:0: -168,160,171888,1,0,1:0:0:0: -384,164,172053,1,8,0:0:0:0: -473,182,172218,1,0,0:0:0:0: -306,305,172383,6,0,L|216:312,1,90,0|0,1:0|0:0,0:0:0:0: -60,172,172713,1,8,0:0:0:0: -120,260,172877,1,0,0:0:0:0: -168,160,173042,2,0,L|172:68,1,90,0|0,0:0|1:0,0:0:0:0: -309,216,173372,2,0,L|306:306,1,90,8|0,0:0|0:0,0:0:0:0: -120,260,173702,5,0,1:0:0:0: -152,256,173784,1,0,1:0:0:0: -184,252,173866,1,0,1:0:0:0: -309,216,174031,1,8,0:0:0:0: -103,168,174196,1,0,1:0:0:0: -135,164,174279,1,0,1:0:0:0: -167,160,174361,1,0,1:0:0:0: -292,124,174526,1,0,1:0:0:0: -87,76,174691,1,8,1:2:0:0: -119,72,174773,1,0,1:0:0:0: -151,68,174855,1,0,1:0:0:0: -276,32,175020,6,0,L|368:40,1,90,0|0,1:0|0:0,0:0:0:0: -448,108,175350,1,8,0:0:0:0: -292,124,175515,1,0,0:0:0:0: -292,124,175597,1,0,0:0:0:0: -292,124,175680,2,0,L|308:216,1,90,0|0,0:0|1:0,0:0:0:0: -328,320,176009,1,8,0:0:0:0: -408,248,176174,1,0,0:0:0:0: -220,300,176339,6,0,P|176:304|128:292,1,90,0|0,1:0|0:0,0:0:0:0: -16,120,176669,1,8,0:0:0:0: -120,152,176834,1,0,1:0:0:0: -120,152,176916,1,0,0:0:0:0: -120,152,176998,2,0,L|124:200,1,45 -212,176,177163,2,0,L|239:215,1,45,0|0,1:0|0:0,0:0:0:0: -292,124,177328,2,0,P|302:79|283:30,1,90,8|0,0:0|0:0,0:0:0:0: -344,192,177658,6,0,P|372:156|376:104,1,90,0|0,1:0|0:0,0:0:0:0: -212,88,177987,1,8,0:0:0:0: -272,228,178152,1,0,0:0:0:0: -272,228,178235,1,0,0:0:0:0: -272,228,178317,1,0,0:0:0:0: -292,124,178482,1,0,1:0:0:0: -180,180,178647,1,8,0:0:0:0: -200,284,178812,1,0,0:0:0:0: -292,124,178976,5,0,1:0:0:0: -288,92,179059,1,0,0:0:0:0: -280,60,179141,2,0,P|248:24|208:14,1,90,0|8,0:0|0:0,0:0:0:0: -22,65,179471,2,0,P|67:71|112:68,1,90,0|0,1:0|0:0,0:0:0:0: -212,88,179801,1,0,1:0:0:0: -22,65,179965,1,8,0:0:0:0: -180,180,180130,5,0,0:0:0:0: -180,180,180213,1,0,0:0:0:0: -180,180,180295,2,0,P|184:224|172:272,1,90,0|0,1:0|0:0,0:0:0:0: -76,216,180625,2,0,P|72:172|84:124,1,90,8|0,0:0|0:0,0:0:0:0: -380,240,180954,2,0,P|384:284|372:332,1,90,0|0,0:0|1:0,0:0:0:0: -276,276,181284,2,0,P|272:232|284:184,1,90,8|0,0:0|0:0,0:0:0:0: -374,129,181614,5,0,1:0:0:0: -300,352,181779,2,0,L|204:348,2,90,0|8|0,0:0|0:0|1:0,0:0:0:0: -448,180,182273,1,2,0:0:0:0: -448,180,182438,1,2,1:2:0:0: -276,276,182603,1,10,0:0:0:0: -276,276,182768,1,2,0:0:0:0: -96,200,182932,6,0,L|88:108,1,90,0|0,1:0|0:0,0:0:0:0: -96,200,183262,1,8,0:0:0:0: -12,68,183427,2,0,P|72:24|164:68,1,180,0|0,0:0|1:0,0:0:0:0: -140,272,183921,2,0,P|92:284|52:271,1,90,8|0,0:0|0:0,0:0:0:0: -176,156,184251,5,0,1:0:0:0: -208,152,184334,1,0,1:0:0:0: -240,148,184416,1,0,1:0:0:0: -308,64,184581,1,8,0:0:0:0: -296,240,184746,1,0,1:0:0:0: -312,268,184828,1,0,1:0:0:0: -336,284,184910,1,0,1:0:0:0: -368,292,184993,1,0,1:0:0:0: -400,288,185075,1,0,1:0:0:0: -464,184,185240,1,8,0:0:0:0: -468,152,185323,1,0,0:0:0:0: -472,120,185405,2,0,L|464:76,1,45,0|0,1:0|1:0,0:0:0:0: -388,96,185570,6,0,P|360:132|316:148,1,90,4|0,1:2|0:0,0:0:0:0: -224,46,185899,2,0,P|268:43|308:63,1,90,8|0,0:0|0:0,0:0:0:0: -296,240,186229,1,0,0:0:0:0: -308,64,186394,1,0,1:0:0:0: -296,240,186559,2,0,L|312:332,1,90,8|0,0:0|0:0,0:0:0:0: -464,184,186888,6,0,P|420:180|372:188,1,90,0|0,1:0|0:0,0:0:0:0: -296,240,187218,1,8,0:0:0:0: -136,292,187383,2,0,P|94:277|54:249,1,90,0|0,1:0|0:0,0:0:0:0: -21,159,187713,1,0,1:0:0:0: -104,8,187877,2,0,L|124:96,1,90,10|0,0:0|0:0,0:0:0:0: -124,96,188207,6,0,P|152:132|196:148,1,90,0|0,1:0|0:0,0:0:0:0: -287,46,188537,2,0,P|243:43|204:63,1,90,8|0,0:0|0:0,0:0:0:0: -216,240,188866,1,2,0:0:0:0: -204,64,189031,1,0,1:0:0:0: -216,240,189196,2,0,L|200:332,1,90,8|0,0:0|0:0,0:0:0:0: -40,240,189526,5,2,1:2:0:0: -128,192,189691,1,0,0:0:0:0: -216,240,189855,1,8,0:0:0:0: -304,192,190020,1,0,1:0:0:0: -392,240,190185,2,0,L|400:332,1,90,2|0,0:0|1:0,0:0:0:0: -464,168,190515,2,0,L|456:76,1,90,8|0,0:0|0:0,0:0:0:0: -392,240,190844,6,0,P|364:272|312:292,1,90,2|0,1:2|0:0,0:0:0:0: -220,140,191174,2,0,P|248:108|296:92,1,90,8|0,0:0|0:0,0:0:0:0: -324,96,191421,1,0,0:0:0:0: -356,104,191504,2,0,L|340:16,1,90,0|0,0:0|1:0,0:0:0:0: -256,276,191834,2,0,L|272:364,1,90,8|0,0:0|0:0,0:0:0:0: -392,240,192163,5,0,1:0:0:0: -356,104,192328,1,0,0:0:0:0: -220,140,192493,1,8,0:0:0:0: -256,276,192658,1,0,1:0:0:0: -305,191,192823,1,0,0:0:0:0: -212,56,192987,1,0,1:0:0:0: -200,220,193152,1,10,0:0:0:0: -200,220,193482,6,0,P|156:228|108:220,1,90,0|0,1:0|0:0,0:0:0:0: -88,116,193812,1,8,0:0:0:0: -16,192,193976,1,0,0:0:0:0: -16,192,194059,1,0,0:0:0:0: -16,192,194141,2,0,L|28:288,1,90,2|0,0:0|1:0,0:0:0:0: -188,309,194471,2,0,L|200:220,1,90,8|0,0:0|0:0,0:0:0:0: -216,112,194801,5,2,1:2:0:0: -216,112,194883,1,0,1:0:0:0: -216,112,194965,1,0,1:0:0:0: -361,25,195130,1,8,0:0:0:0: -294,180,195295,1,0,1:0:0:0: -294,180,195377,1,0,1:0:0:0: -294,180,195460,1,2,0:0:0:0: -256,16,195625,1,0,1:0:0:0: -384,127,195790,1,10,1:2:0:0: -416,132,195872,1,0,1:0:0:0: -448,140,195954,2,0,L|452:84,1,45,0|0,1:0|1:0,0:0:0:0: -416,216,196119,6,0,P|412:264|432:312,1,90,4|0,1:2|0:0,0:0:0:0: -304,268,196449,2,0,P|308:220|288:172,1,90,8|0,0:0|0:0,0:0:0:0: -216,112,196779,2,0,L|120:104,1,90,0|0,0:0|1:0,0:0:0:0: -52,248,197108,2,0,L|141:255,1,90,8|0,0:0|0:0,0:0:0:0: -304,268,197438,5,0,1:0:0:0: -416,216,197603,1,0,0:0:0:0: -408,340,197768,1,8,0:0:0:0: -332,180,197932,1,0,1:0:0:0: -332,180,198015,1,0,0:0:0:0: -332,180,198097,2,0,P|360:140|400:120,1,90,0|0,0:0|1:0,0:0:0:0: -484,284,198427,1,10,0:0:0:0: -304,268,198592,1,2,0:0:0:0: -416,216,198757,6,0,P|428:172|420:124,1,90,2|0,1:2|0:0,0:0:0:0: -344,52,199086,1,8,0:0:0:0: -332,180,199251,1,0,0:0:0:0: -164,236,199416,2,0,P|152:192|160:144,1,90,0|0,0:0|1:0,0:0:0:0: -236,72,199746,1,8,0:0:0:0: -248,200,199910,1,0,0:0:0:0: -156,328,200075,6,0,L|56:320,1,90,2|0,1:2|0:0,0:0:0:0: -164,236,200405,1,8,0:0:0:0: -256,292,200570,2,0,P|300:296|344:284,1,90,0|0,1:0|0:0,0:0:0:0: -432,220,200899,2,0,L|460:308,2,90,0|8|0,1:0|0:0|0:0,0:0:0:0: -392,120,201394,5,4,1:2:0:0: -396,32,201559,1,0,1:0:0:0: -316,72,201724,1,0,1:0:0:0: -256,6,201888,1,0,1:0:0:0: -228,91,202053,1,0,1:0:0:0: -139,87,202218,1,0,1:0:0:0: -179,166,202383,1,0,1:0:0:0: -113,226,202548,1,0,1:0:0:0: -197,253,202713,5,4,1:2:0:0: -193,342,202877,1,0,1:0:0:0: -272,302,203042,1,0,1:0:0:0: -332,367,203207,1,0,1:0:0:0: -359,283,203372,1,2,1:2:0:0: -448,287,203537,1,2,1:2:0:0: -407,208,203702,1,2,1:2:0:0: -472,147,203866,1,2,1:2:0:0: -387,121,204031,5,4,1:2:0:0: -360,100,204114,1,0,1:0:0:0: -344,72,204196,1,0,1:0:0:0: -336,40,204279,1,0,1:0:0:0: -340,8,204361,1,0,1:0:0:0: -316,28,204443,1,0,1:0:0:0: -284,32,204526,1,0,1:0:0:0: -252,28,204608,1,0,1:0:0:0: -228,8,204691,2,0,L|184:20,7,45,4|0|0|0|0|0|0|0,1:2|1:0|1:0|1:0|1:0|1:0|1:0|1:0,0:0:0:0: -112,56,205350,5,4,1:2:0:0: -100,84,205432,1,0,1:0:0:0: -96,116,205515,1,0,1:0:0:0: -100,148,205597,1,0,1:0:0:0: -112,176,205680,1,0,1:0:0:0: -124,204,205762,1,0,1:0:0:0: -128,236,205844,1,0,1:0:0:0: -124,268,205927,1,0,1:0:0:0: -112,296,206009,2,0,L|71:313,3,45,2|0|2|0,1:2|0:0|0:0|0:0,0:0:0:0: -192,312,206339,2,0,L|175:353,3,45,2|0|2|0,1:2|0:0|0:0|0:0,0:0:0:0: -256,264,206669,5,4,1:2:0:0: -256,192,206751,12,0,209306,0:0:0:0: diff --git a/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs b/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs index 587853be59..3e1d0329a9 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs @@ -114,7 +114,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline } /// - /// Zoom target as a relative position in the space. + /// Zoom target as a relative position in the space. /// private float? relativeContentZoomTarget; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a99e97eabb..6967f140e8 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -1,827 +1,45 @@ - - + + - {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D} - Debug - AnyCPU + net461 Library - Properties - osu.Game - osu.Game - 3CF060CD28877D0E3112948951A64B2A7CEEC909 - codesigning.pfx - false - false - false - - - 3.5 - - - OnOutputUpdated - false - LocalIntranet - v4.6.1 - true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 2 - 1.0.0.%2a - false - true - 12.0.0 - 2.0 - - - - - - - true - full - false - bin\Debug\ - TRACE;DEBUG - prompt - 0 - true - false AnyCPU true - false - false - false - - - 6 - - - none - true - bin\Release\ - - - prompt - 4 - true - false - AnyCPU - true - false - false - - - - - - - - true - bin\Debug\ - TRACE;DEBUG - true - 0 - true - full - AnyCPU - false - 6 - prompt - --tests - false + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game + click the circles. to the beat. + osu.Game - - $(SolutionDir)\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll - True - - - $(SolutionDir)\packages\Microsoft.Data.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.Data.Sqlite.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.Design.2.0.0\lib\net461\Microsoft.EntityFrameworkCore.Design.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.Relational.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Sqlite.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Caching.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Caching.Memory.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Configuration.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.DependencyInjection.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Logging.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Logging.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Options.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Primitives.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll - - - - - $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - True - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll - True - - - $(SolutionDir)\packages\Remotion.Linq.2.1.2\lib\net45\Remotion.Linq.dll - - - $(SolutionDir)\packages\SharpCompress.0.18.1\lib\net45\SharpCompress.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_green.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_v2.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.core.1.1.8\lib\net45\SQLitePCLRaw.core.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.8\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll - True - - - - $(SolutionDir)\packages\System.Collections.Immutable.1.4.0\lib\netstandard2.0\System.Collections.Immutable.dll - - - $(SolutionDir)\packages\System.ComponentModel.Annotations.4.4.0\lib\net461\System.ComponentModel.Annotations.dll - - - - - - $(SolutionDir)\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll - - - $(SolutionDir)\packages\System.Interactive.Async.3.1.1\lib\net46\System.Interactive.Async.dll - - - $(SolutionDir)\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - - $(SolutionDir)\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll - True - + + + + + + osu.licenseheader - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - false - + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + - - {c76bf5b3-985e-4d39-95fe-97c9c879b83a} - osu.Framework - - - {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} - osu.Game.Resources - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 20171019041408_InitialCreate.cs - - - - 20171025071459_AddMissingIndexRules.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 98deb1f21543ac99a6d0247183f46446efc36e8d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 30 Oct 2017 22:53:27 +0900 Subject: [PATCH 004/282] Fix up VisualTests build config --- osu.sln | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.sln b/osu.sln index b1341051f9..9898f05ba4 100644 --- a/osu.sln +++ b/osu.sln @@ -34,8 +34,8 @@ Global {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Debug|Any CPU.Build.0 = Debug|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.ActiveCfg = Release|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.Build.0 = Release|Any CPU - {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.ActiveCfg = VisualTests|Any CPU - {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.Build.0 = VisualTests|Any CPU + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.Build.0 = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release|Any CPU.ActiveCfg = Release|Any CPU From 9b1ec83eb4e49328017e401689b1efea41ee8517 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 31 Oct 2017 16:55:44 +0900 Subject: [PATCH 005/282] Propagate sqlite build assets to parent projects --- osu.Game/osu.Game.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6967f140e8..635bd70bc2 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -38,8 +38,8 @@ - - + + \ No newline at end of file From 3462fdcad911fc3cbe42f3b700a2b834a359a933 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 31 Oct 2017 16:57:01 +0900 Subject: [PATCH 006/282] Remove some apparently unneeded references from osu.Game --- osu.Game/osu.Game.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 635bd70bc2..bb9d3b0afd 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -16,10 +16,6 @@ - - - - osu.licenseheader From c2f39711882817a40a46942ad3c194242625dbaf Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 10 Nov 2017 03:01:11 +0300 Subject: [PATCH 007/282] Extend Beatmap Set Response --- .../Visual/TestCaseBeatmapSetOverlay.cs | 12 +--- osu.Game/Beatmaps/BeatmapOnlineInfo.cs | 11 ---- osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs | 13 ++--- .../API/Requests/GetBeatmapSetsResponse.cs | 56 +++++++++++++++++++ osu.Game/Overlays/BeatmapSet/BasicStats.cs | 6 +- osu.Game/Overlays/BeatmapSet/Header.cs | 24 ++------ 6 files changed, 72 insertions(+), 50 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs index 1ade0be626..2226dbf9e9 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs @@ -53,6 +53,7 @@ namespace osu.Game.Tests.Visual Submitted = new DateTime(2016, 2, 10), Ranked = new DateTime(2016, 6, 19), BPM = 236, + HasVideo = true, Covers = new BeatmapSetOnlineCovers { Cover = @"https://assets.ppy.sh/beatmaps/415886/covers/cover.jpg?1465651778", @@ -75,7 +76,6 @@ namespace osu.Game.Tests.Visual OnlineInfo = new BeatmapOnlineInfo { Length = 115000, - HasVideo = false, CircleCount = 265, SliderCount = 71, PlayCount = 47906, @@ -103,7 +103,6 @@ namespace osu.Game.Tests.Visual OnlineInfo = new BeatmapOnlineInfo { Length = 118000, - HasVideo = true, CircleCount = 592, SliderCount = 62, PlayCount = 162021, @@ -131,7 +130,6 @@ namespace osu.Game.Tests.Visual OnlineInfo = new BeatmapOnlineInfo { Length = 118000, - HasVideo = false, CircleCount = 1042, SliderCount = 79, PlayCount = 225178, @@ -159,7 +157,6 @@ namespace osu.Game.Tests.Visual OnlineInfo = new BeatmapOnlineInfo { Length = 118000, - HasVideo = false, CircleCount = 1352, SliderCount = 69, PlayCount = 131545, @@ -187,7 +184,6 @@ namespace osu.Game.Tests.Visual OnlineInfo = new BeatmapOnlineInfo { Length = 118000, - HasVideo = false, CircleCount = 1730, SliderCount = 115, PlayCount = 117673, @@ -227,6 +223,7 @@ namespace osu.Game.Tests.Visual Submitted = new DateTime(2016, 6, 11), Ranked = new DateTime(2016, 7, 12), BPM = 160, + HasVideo = false, Covers = new BeatmapSetOnlineCovers { Cover = @"https://assets.ppy.sh/beatmaps/625493/covers/cover.jpg?1499167472", @@ -249,7 +246,6 @@ namespace osu.Game.Tests.Visual OnlineInfo = new BeatmapOnlineInfo { Length = 193000, - HasVideo = false, CircleCount = 262, SliderCount = 0, PlayCount = 3952, @@ -277,7 +273,6 @@ namespace osu.Game.Tests.Visual OnlineInfo = new BeatmapOnlineInfo { Length = 193000, - HasVideo = false, CircleCount = 464, SliderCount = 0, PlayCount = 4833, @@ -305,7 +300,6 @@ namespace osu.Game.Tests.Visual OnlineInfo = new BeatmapOnlineInfo { Length = 193000, - HasVideo = false, CircleCount = 712, SliderCount = 0, PlayCount = 4405, @@ -333,7 +327,6 @@ namespace osu.Game.Tests.Visual OnlineInfo = new BeatmapOnlineInfo { Length = 193000, - HasVideo = false, CircleCount = 943, SliderCount = 0, PlayCount = 3950, @@ -361,7 +354,6 @@ namespace osu.Game.Tests.Visual OnlineInfo = new BeatmapOnlineInfo { Length = 193000, - HasVideo = false, CircleCount = 1068, SliderCount = 0, PlayCount = 5856, diff --git a/osu.Game/Beatmaps/BeatmapOnlineInfo.cs b/osu.Game/Beatmaps/BeatmapOnlineInfo.cs index 399cabda99..6a988036c5 100644 --- a/osu.Game/Beatmaps/BeatmapOnlineInfo.cs +++ b/osu.Game/Beatmaps/BeatmapOnlineInfo.cs @@ -1,8 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using Newtonsoft.Json; - namespace osu.Game.Beatmaps { /// @@ -15,33 +13,24 @@ namespace osu.Game.Beatmaps /// public double Length { get; set; } - /// - /// Whether or not this beatmap has a background video. - /// - public bool HasVideo { get; set; } - /// /// The amount of circles in this beatmap. /// - [JsonProperty(@"count_circles")] public int CircleCount { get; set; } /// /// The amount of sliders in this beatmap. /// - [JsonProperty(@"count_sliders")] public int SliderCount { get; set; } /// /// The amount of plays this beatmap has. /// - [JsonProperty(@"playcount")] public int PlayCount { get; set; } /// /// The amount of passes this beatmap has. /// - [JsonProperty(@"passcount")] public int PassCount { get; set; } } } diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs b/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs index 27d1f057ca..0518526f29 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using Newtonsoft.Json; namespace osu.Game.Beatmaps { @@ -25,17 +24,20 @@ namespace osu.Game.Beatmaps /// The date this beatmap set was last updated. /// public DateTimeOffset? LastUpdated { get; set; } + + /// + /// Whether or not this beatmap set has a background video. + /// + public bool HasVideo { get; set; } /// /// The different sizes of cover art for this beatmap set. /// - [JsonProperty(@"covers")] public BeatmapSetOnlineCovers Covers { get; set; } /// /// A small sample clip of this beatmap set's song. /// - [JsonProperty(@"previewUrl")] public string Preview { get; set; } /// @@ -46,13 +48,11 @@ namespace osu.Game.Beatmaps /// /// The amount of plays this beatmap set has. /// - [JsonProperty(@"play_count")] public int PlayCount { get; set; } /// /// The amount of people who have favourited this beatmap set. /// - [JsonProperty(@"favourite_count")] public int FavouriteCount { get; set; } } @@ -60,17 +60,14 @@ namespace osu.Game.Beatmaps { public string CoverLowRes { get; set; } - [JsonProperty(@"cover@2x")] public string Cover { get; set; } public string CardLowRes { get; set; } - [JsonProperty(@"card@2x")] public string Card { get; set; } public string ListLowRes { get; set; } - [JsonProperty(@"list@2x")] public string List { get; set; } } } diff --git a/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs b/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs index f2ca0c1a2f..45f6d84784 100644 --- a/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs +++ b/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs @@ -6,6 +6,7 @@ using System.Linq; using Newtonsoft.Json; using osu.Game.Beatmaps; using osu.Game.Rulesets; +using System; namespace osu.Game.Online.API.Requests { @@ -23,6 +24,21 @@ namespace osu.Game.Online.API.Requests [JsonProperty(@"favourite_count")] private int favouriteCount { get; set; } + [JsonProperty(@"bpm")] + private double bpm { get; set; } + + [JsonProperty(@"video")] + private bool hasVideo { get; set; } + + [JsonProperty(@"submitted_date")] + private DateTimeOffset submitted { get; set; } + + [JsonProperty(@"ranked_date")] + private DateTimeOffset ranked { get; set; } + + [JsonProperty(@"last_updated")] + private DateTimeOffset lastUpdated { get; set; } + [JsonProperty(@"user_id")] private long creatorId { set { Author.Id = value; } @@ -43,6 +59,11 @@ namespace osu.Game.Online.API.Requests Preview = preview, PlayCount = playCount, FavouriteCount = favouriteCount, + BPM = bpm, + HasVideo = hasVideo, + Submitted = submitted, + Ranked = ranked, + LastUpdated = lastUpdated, }, Beatmaps = beatmaps.Select(b => b.ToBeatmap(rulesets)).ToList(), }; @@ -62,6 +83,30 @@ namespace osu.Game.Online.API.Requests [JsonProperty(@"difficulty_rating")] private double starDifficulty { get; set; } + [JsonProperty(@"drain")] + private float drainRate { get; set; } + + [JsonProperty(@"cs")] + private float circleSize { get; set; } + + [JsonProperty(@"ar")] + private float approachRate { get; set; } + + [JsonProperty(@"accuracy")] + private float overallDifficulty { get; set; } + + [JsonProperty(@"total_length")] + private double length { get; set; } + + [JsonProperty(@"count_circles")] + private int circleCount { get; set; } + + [JsonProperty(@"count_sliders")] + private int sliderCount { get; set; } + + [JsonProperty(@"version")] + private string version { get; set; } + public BeatmapInfo ToBeatmap(RulesetStore rulesets) { return new BeatmapInfo @@ -69,10 +114,21 @@ namespace osu.Game.Online.API.Requests Metadata = this, Ruleset = rulesets.GetRuleset(ruleset), StarDifficulty = starDifficulty, + Version = version, + BaseDifficulty = new BeatmapDifficulty + { + DrainRate = drainRate, + CircleSize = circleSize, + ApproachRate = approachRate, + OverallDifficulty = overallDifficulty, + }, OnlineInfo = new BeatmapOnlineInfo { PlayCount = playCount, PassCount = passCount, + Length = length, + CircleCount = circleCount, + SliderCount = sliderCount, }, }; } diff --git a/osu.Game/Overlays/BeatmapSet/BasicStats.cs b/osu.Game/Overlays/BeatmapSet/BasicStats.cs index 885f9cc219..3ecff85bee 100644 --- a/osu.Game/Overlays/BeatmapSet/BasicStats.cs +++ b/osu.Game/Overlays/BeatmapSet/BasicStats.cs @@ -39,9 +39,9 @@ namespace osu.Game.Overlays.BeatmapSet if (value == beatmap) return; beatmap = value; - length.Value = TimeSpan.FromMilliseconds(beatmap.OnlineInfo.Length).ToString(@"m\:ss"); - circleCount.Value = beatmap.OnlineInfo.CircleCount.ToString("N0"); - sliderCount.Value = beatmap.OnlineInfo.SliderCount.ToString("N0"); + length.Value = TimeSpan.FromSeconds(beatmap.OnlineInfo.Length).ToString(@"m\:ss"); + circleCount.Value = beatmap.OnlineInfo.CircleCount.ToString(); + sliderCount.Value = beatmap.OnlineInfo.SliderCount.ToString(); } } diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index d4514cbaed..96bb613f9f 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -26,6 +26,8 @@ namespace osu.Game.Overlays.BeatmapSet private readonly Box tabsBg; private readonly Container coverContainer; private readonly OsuSpriteText title, artist; + private readonly Container noVideoButtons; + private readonly FillFlowContainer videoButtons; private readonly AuthorInfo author; public Details Details; @@ -46,6 +48,9 @@ namespace osu.Game.Overlays.BeatmapSet title.Text = BeatmapSet.Metadata.Title; artist.Text = BeatmapSet.Metadata.Artist; + noVideoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 0 : 1, transition_duration); + videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); + cover?.FadeOut(400, Easing.Out); coverContainer.Add(cover = new DelayedLoadWrapper(new BeatmapSetCover(BeatmapSet) { @@ -77,9 +82,6 @@ namespace osu.Game.Overlays.BeatmapSet Radius = 3, Offset = new Vector2(0f, 1f), }; - - Container noVideoButtons; - FillFlowContainer videoButtons; Children = new Drawable[] { new Container @@ -202,21 +204,7 @@ namespace osu.Game.Overlays.BeatmapSet }, }; - Picker.Beatmap.ValueChanged += b => - { - Details.Beatmap = b; - - if (b.OnlineInfo.HasVideo) - { - noVideoButtons.FadeOut(transition_duration); - videoButtons.FadeIn(transition_duration); - } - else - { - noVideoButtons.FadeIn(transition_duration); - videoButtons.FadeOut(transition_duration); - } - }; + Picker.Beatmap.ValueChanged += b => Details.Beatmap = b; } [BackgroundDependencyLoader] From 7280f77a02621decb74bd0c08e84cc79de2ad35e Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 10 Nov 2017 03:06:21 +0300 Subject: [PATCH 008/282] Trim whitespace --- osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs b/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs index 0518526f29..2b9418d6ae 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs @@ -24,7 +24,7 @@ namespace osu.Game.Beatmaps /// The date this beatmap set was last updated. /// public DateTimeOffset? LastUpdated { get; set; } - + /// /// Whether or not this beatmap set has a background video. /// From 6def49d6a42f81bc2987fe87607a62e19fe334ca Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 11 Nov 2017 01:51:42 +0300 Subject: [PATCH 009/282] Allow beatmap set response get online id --- osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs b/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs index f2ca0c1a2f..7a6b1132b5 100644 --- a/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs +++ b/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs @@ -50,6 +50,9 @@ namespace osu.Game.Online.API.Requests private class GetBeatmapSetsBeatmapResponse : BeatmapMetadata { + [JsonProperty(@"id")] + private int onlineBeatmapID { get; set; } + [JsonProperty(@"playcount")] private int playCount { get; set; } @@ -69,6 +72,7 @@ namespace osu.Game.Online.API.Requests Metadata = this, Ruleset = rulesets.GetRuleset(ruleset), StarDifficulty = starDifficulty, + OnlineBeatmapID = onlineBeatmapID, OnlineInfo = new BeatmapOnlineInfo { PlayCount = playCount, From 3261af5200e51c9ba2ec2238fbbd43318dfd0024 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 11 Nov 2017 03:46:06 +0300 Subject: [PATCH 010/282] Add scores container --- .../BeatmapSet/Scores/DrawableScore.cs | 157 ++++++++++++++++++ .../BeatmapSet/Scores/ScoresContainer.cs | 73 ++++++++ osu.Game/Overlays/BeatmapSetOverlay.cs | 5 +- .../Profile/Sections/Ranks/DrawableScore.cs | 16 +- .../Sections/Ranks/ScoreModsContainer.cs | 21 +++ osu.Game/osu.Game.csproj | 3 + 6 files changed, 261 insertions(+), 14 deletions(-) create mode 100644 osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs create mode 100644 osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs create mode 100644 osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs new file mode 100644 index 0000000000..457454d423 --- /dev/null +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -0,0 +1,157 @@ +// 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.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Input; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osu.Game.Online.API.Requests; +using osu.Game.Overlays.Profile.Sections.Ranks; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.UI; +using osu.Game.Screens.Select.Leaderboards; +using osu.Game.Users; + +namespace osu.Game.Overlays.BeatmapSet.Scores +{ + public class DrawableScore : Container + { + private const int fade_duration = 100; + private const int height = 30; + + private readonly Box background; + private readonly ScoreModsContainer modsContainer; + + public DrawableScore(int index, OnlineScore score) + { + RelativeSizeAxes = Axes.X; + Height = height; + CornerRadius = 3; + Masking = true; + Children = new Drawable[] + { + background = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + }, + new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Text = $"#{index + 1}", + Font = @"Exo2.0-RegularItalic", + RelativePositionAxes = Axes.X, + X = 0.02f + }, + new DrawableFlag(score.User.Country?.FlagName) + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Width = 30, + Height = 20, + RelativePositionAxes = Axes.X, + X = 0.06f + }, + new ClickableUsername(score.User.Username) + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + RelativePositionAxes = Axes.X, + X = 0.1f + }, + modsContainer = new ScoreModsContainer + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + AutoSizeAxes = Axes.Y, + Width = 60, + RelativePositionAxes = Axes.X, + X = 0.45f + }, + new DrawableRank(score.Rank) + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Width = 30, + Height = 20, + FillMode = FillMode.Fit, + RelativePositionAxes = Axes.X, + X = 0.55f + }, + new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreRight, + Text = score.TotalScore.ToString(), + Font = @"Exo2.0-MediumItalic", + RelativePositionAxes = Axes.X, + X = 0.7f + }, + new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreRight, + Text = $@"{score.Accuracy:P2}", + Font = @"Exo2.0-RegularItalic", + RelativePositionAxes = Axes.X, + X = 0.8f + }, + new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreRight, + Text = $"{score.Statistics["300"]}/{score.Statistics["100"]}/{score.Statistics["50"]}", + Font = @"Exo2.0-RegularItalic", + RelativePositionAxes = Axes.X, + X = 0.98f + }, + }; + + foreach (Mod mod in score.Mods) + modsContainer.Add(new ModIcon(mod) + { + AutoSizeAxes = Axes.Both, + Scale = new Vector2(0.35f), + }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + background.Colour = colours.Gray4; + } + + protected override bool OnHover(InputState state) + { + background.FadeIn(fade_duration, Easing.OutQuint); + return base.OnHover(state); + } + + protected override void OnHoverLost(InputState state) + { + background.FadeOut(fade_duration, Easing.OutQuint); + base.OnHoverLost(state); + } + + protected override bool OnClick(InputState state) => true; + + private class ClickableUsername : OsuHoverContainer + { + public ClickableUsername(string username) + { + AutoSizeAxes = Axes.Both; + Child = new OsuSpriteText + { + Text = username, + Font = @"Exo2.0-BoldItalic", + }; + } + } + } +} diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs new file mode 100644 index 0000000000..61f9d5a634 --- /dev/null +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -0,0 +1,73 @@ +// 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.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps; +using osu.Game.Graphics.Sprites; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; +using System.Linq; + +namespace osu.Game.Overlays.BeatmapSet.Scores +{ + public class ScoresContainer : Container + { + private readonly FillFlowContainer flow; + private APIAccess api; + + private BeatmapInfo beatmap; + public BeatmapInfo Beatmap + { + set + { + if (beatmap == value) return; + beatmap = value; + + getScores(); + } + get { return beatmap; } + } + + public ScoresContainer() + { + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + Child = flow = new FillFlowContainer + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Width = 0.95f, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 1), + }; + } + + [BackgroundDependencyLoader] + private void load(APIAccess api) + { + this.api = api; + } + + private void getScores() + { + flow.Clear(); + + var req = new GetScoresRequest(beatmap); + req.Success += scores => + { + int i = 0; + foreach(var s in scores.Scores) + { + flow.Add(new DrawableScore(i, s)); + i++; + } + }; + api.Queue(req); + } + } +} diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index ddd146bcb6..7ce7d86cd5 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -16,6 +16,7 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays.BeatmapSet; using osu.Game.Rulesets; +using osu.Game.Overlays.BeatmapSet.Scores; namespace osu.Game.Overlays { @@ -26,6 +27,7 @@ namespace osu.Game.Overlays private readonly Header header; private readonly Info info; + private readonly ScoresContainer scores; private APIAccess api; private RulesetStore rulesets; @@ -74,12 +76,13 @@ namespace osu.Game.Overlays { header = new Header(), info = new Info(), + scores = new ScoresContainer(), }, }, }, }; - header.Picker.Beatmap.ValueChanged += b => info.Beatmap = b; + header.Picker.Beatmap.ValueChanged += b => info.Beatmap = scores.Beatmap = b; } [BackgroundDependencyLoader] diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs index 91f5650b92..2c8cb06c4a 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs @@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks { protected readonly FillFlowContainer Stats; private readonly FillFlowContainer metadata; - private readonly ModContainer modContainer; + private readonly ScoreModsContainer modsContainer; protected readonly Score Score; protected DrawableScore(Score score) @@ -61,7 +61,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Depth = -1, }, }, - modContainer = new ModContainer + modsContainer = new ScoreModsContainer { AutoSizeAxes = Axes.Y, Anchor = Anchor.CentreRight, @@ -119,21 +119,11 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks }); foreach (Mod mod in Score.Mods) - modContainer.Add(new ModIcon(mod) + modsContainer.Add(new ModIcon(mod) { AutoSizeAxes = Axes.Both, Scale = new Vector2(0.5f), }); } - - private class ModContainer : FlowContainer - { - protected override IEnumerable ComputeLayoutPositions() - { - int count = FlowingChildren.Count(); - for (int i = 0; i < count; i++) - yield return new Vector2(DrawWidth * i * (count == 1 ? 0 : 1f / (count - 1)), 0); - } - } } } diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs new file mode 100644 index 0000000000..6f050750e4 --- /dev/null +++ b/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.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 OpenTK; +using osu.Framework.Graphics.Containers; +using osu.Game.Rulesets.UI; +using System.Collections.Generic; +using System.Linq; + +namespace osu.Game.Overlays.Profile.Sections.Ranks +{ + public class ScoreModsContainer : FlowContainer + { + protected override IEnumerable ComputeLayoutPositions() + { + int count = FlowingChildren.Count(); + for (int i = 0; i < count; i++) + yield return new Vector2(DrawWidth * i * (count == 1 ? 0 : 1f / (count - 1)), 0); + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 23a9a07ae7..93083134ba 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -279,9 +279,12 @@ + + + From 5bf756c3c603db0faa1291b35849d3fb5c2f853a Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 11 Nov 2017 06:54:52 +0300 Subject: [PATCH 011/282] Add DrawableTopScore --- .../BeatmapSet/Scores/ClickableUsername.cs | 64 +++++ .../BeatmapSet/Scores/DrawableScore.cs | 17 +- .../BeatmapSet/Scores/DrawableTopScore.cs | 254 ++++++++++++++++++ .../BeatmapSet/Scores/ScoresContainer.cs | 117 ++++++-- .../Profile/Sections/Ranks/DrawableScore.cs | 2 - .../Select/Leaderboards/DrawableRank.cs | 22 +- osu.Game/osu.Game.csproj | 2 + 7 files changed, 436 insertions(+), 42 deletions(-) create mode 100644 osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs create mode 100644 osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs new file mode 100644 index 0000000000..0aa1fae12f --- /dev/null +++ b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs @@ -0,0 +1,64 @@ +// 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.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osu.Game.Users; +using System; +using osu.Framework.Input; + +namespace osu.Game.Overlays.BeatmapSet.Scores +{ + public class ClickableUsername : OsuHoverContainer + { + private readonly OsuSpriteText text; + private Action clickAction; + private UserProfileOverlay profile; + + private User user; + public User User + { + set + { + if (user == value) return; + user = value; + + text.Text = user.Username; + } + get { return user; } + } + + public float TextSize + { + set + { + if (text.TextSize == value) return; + text.TextSize = value; + } + get { return text.TextSize; } + } + + public ClickableUsername() + { + AutoSizeAxes = Axes.Both; + Child = text = new OsuSpriteText + { + Font = @"Exo2.0-BoldItalic", + }; + } + + [BackgroundDependencyLoader] + private void load(UserProfileOverlay profile) + { + this.profile = profile; + } + + protected override bool OnClick(InputState state) + { + profile.ShowUser(user); + return base.OnClick(state); + } + } +} diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs index 457454d423..ae40b4205d 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -8,7 +8,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Input; using osu.Game.Graphics; -using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Online.API.Requests; using osu.Game.Overlays.Profile.Sections.Ranks; @@ -58,10 +57,11 @@ namespace osu.Game.Overlays.BeatmapSet.Scores RelativePositionAxes = Axes.X, X = 0.06f }, - new ClickableUsername(score.User.Username) + new ClickableUsername { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, + User = score.User, RelativePositionAxes = Axes.X, X = 0.1f }, @@ -140,18 +140,5 @@ namespace osu.Game.Overlays.BeatmapSet.Scores } protected override bool OnClick(InputState state) => true; - - private class ClickableUsername : OsuHoverContainer - { - public ClickableUsername(string username) - { - AutoSizeAxes = Axes.Both; - Child = new OsuSpriteText - { - Text = username, - Font = @"Exo2.0-BoldItalic", - }; - } - } } } diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs new file mode 100644 index 0000000000..f9ad72bd2c --- /dev/null +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs @@ -0,0 +1,254 @@ +// 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.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Input; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Online.API.Requests; +using osu.Game.Overlays.Profile.Sections.Ranks; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.UI; +using osu.Game.Screens.Select.Leaderboards; +using osu.Game.Users; + +namespace osu.Game.Overlays.BeatmapSet.Scores +{ + public class DrawableTopScore : Container + { + private const int fade_duration = 100; + private const int height = 200; + private const int avatar_size = 80; + private const int margin = 10; + + private readonly Box background; + private readonly Box bottomBackground; + private readonly Box middleLine; + private readonly UpdateableAvatar avatar; + private readonly DrawableFlag flag; + private readonly ClickableUsername username; + private readonly OsuSpriteText rankText; + private readonly OsuSpriteText date; + private readonly DrawableRank rank; + private readonly InfoColumn totalScore; + private readonly InfoColumn accuracy; + private readonly InfoColumn statistics; + private readonly ScoreModsContainer modsContainer; + + private OnlineScore score; + public OnlineScore Score + { + set + { + if (score == value) return; + score = value; + + setScore(); + } + get { return score; } + } + + public DrawableTopScore() + { + RelativeSizeAxes = Axes.X; + Height = height; + CornerRadius = 5; + BorderThickness = 4; + Masking = true; + Children = new Drawable[] + { + background = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true, //used for correct border representation + }, + avatar = new UpdateableAvatar + { + Size = new Vector2(avatar_size), + Masking = true, + CornerRadius = 5, + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Shadow, + Colour = Color4.Black.Opacity(0.25f), + Offset = new Vector2(0, 2), + Radius = 1, + }, + Margin = new MarginPadding { Top = margin, Left = margin } + }, + flag = new DrawableFlag + { + Width = 30, + Height = 20, + Y = height / 4, + X = height / 2, + }, + username = new ClickableUsername + { + Origin = Anchor.BottomLeft, + TextSize = 30, + Y = height / 4, + X = height / 2, + Margin = new MarginPadding { Bottom = 4 }, + }, + rankText = new OsuSpriteText + { + Anchor = Anchor.TopRight, + Origin = Anchor.BottomRight, + Text = "#1", + TextSize = 40, + Font = @"Exo2.0-BoldItalic", + Y = height / 4, + Margin = new MarginPadding { Right = margin } + }, + date = new OsuSpriteText + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Y = height / 4, + Margin = new MarginPadding { Right = margin } + }, + new Container + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + RelativeSizeAxes = Axes.Both, + Height = 0.5f, + Children = new Drawable[] + { + bottomBackground = new Box { RelativeSizeAxes = Axes.Both }, + middleLine = new Box + { + RelativeSizeAxes = Axes.X, + Height = 1, + }, + rank = new DrawableRank(ScoreRank.F) + { + Origin = Anchor.BottomLeft, + Width = avatar_size, + Height = 40, + FillMode = FillMode.Fit, + Y = height / 4, + Margin = new MarginPadding { Left = margin } + }, + new FillFlowContainer + { + Origin = Anchor.BottomLeft, + AutoSizeAxes = Axes.Both, + X = height / 2, + Y = height / 4, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(15, 0), + Children = new[] + { + totalScore = new InfoColumn("Score"), + accuracy = new InfoColumn("Accuracy"), + statistics = new InfoColumn("300/100/50"), + }, + }, + modsContainer = new ScoreModsContainer + { + AutoSizeAxes = Axes.Y, + Width = 80, + X = height / 2, + Y = height / 4, + } + } + }, + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + background.Colour = bottomBackground.Colour = colours.Gray4; + middleLine.Colour = colours.Gray2; + date.Colour = colours.Gray9; + BorderColour = rankText.Colour = colours.Yellow; + } + + private void setScore() + { + avatar.User = username.User = score.User; + flag.FlagName = score.User.Country?.FlagName; + date.Text = $"achieved {score.Date:MMM d, yyyy}"; + rank.UpdateRank(score.Rank); + + totalScore.Value = score.TotalScore.ToString(); + accuracy.Value = $@"{score.Accuracy:P2}"; + statistics.Value = $"{score.Statistics["300"]}/{score.Statistics["100"]}/{score.Statistics["50"]}"; + + modsContainer.Clear(); + foreach (Mod mod in score.Mods) + modsContainer.Add(new ModIcon(mod) + { + AutoSizeAxes = Axes.Both, + Scale = new Vector2(0.45f), + }); + } + + protected override bool OnHover(InputState state) + { + background.FadeIn(fade_duration, Easing.OutQuint); + return base.OnHover(state); + } + + protected override void OnHoverLost(InputState state) + { + background.FadeOut(fade_duration, Easing.OutQuint); + base.OnHoverLost(state); + } + + private class InfoColumn : FillFlowContainer + { + private readonly OsuSpriteText headerText; + private readonly OsuSpriteText valueText; + + public string Value + { + set + { + if (valueText.Text == value) + return; + valueText.Text = value; + } + get { return valueText.Text; } + } + + public InfoColumn(string header) + { + AutoSizeAxes = Axes.Both; + Direction = FillDirection.Vertical; + Spacing = new Vector2(0, 3); + Children = new Drawable[] + { + headerText = new OsuSpriteText + { + TextSize = 14, + Text = header, + Font = @"Exo2.0-Bold", + }, + valueText = new OsuSpriteText + { + TextSize = 25, + Font = @"Exo2.0-RegularItalic", + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + headerText.Colour = colours.Gray9; + } + } + } +} diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 61f9d5a634..0f25021cf5 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -2,11 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; +using OpenTK.Graphics; using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Game.Beatmaps; -using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using System.Linq; @@ -15,9 +18,25 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { public class ScoresContainer : Container { + private const int spacing = 15; + private const int fade_duration = 200; + private readonly FillFlowContainer flow; + private readonly DrawableTopScore topScore; + private readonly LoadingAnimation loadingAnimation; + private readonly Box foreground; + private GetScoresRequest request; private APIAccess api; + private bool isLoading + { + set + { + foreground.FadeTo(value ? 1 : 0, fade_duration); + loadingAnimation.FadeTo(value ? 1 : 0, fade_duration); + } + } + private BeatmapInfo beatmap; public BeatmapInfo Beatmap { @@ -26,7 +45,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores if (beatmap == value) return; beatmap = value; - getScores(); + updateScores(); } get { return beatmap; } } @@ -35,15 +54,44 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - Child = flow = new FillFlowContainer + Children = new Drawable[] { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Width = 0.95f, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 1), + new FillFlowContainer + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Width = 0.95f, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, spacing), + Margin = new MarginPadding { Top = spacing }, + Children = new Drawable[] + { + topScore = new DrawableTopScore(), + flow = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 1), + }, + } + }, + foreground = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black.Opacity(0.7f), + Alpha = 0, + }, + loadingAnimation = new LoadingAnimation + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Size = new Vector2(20), + Margin = new MarginPadding { Top = 10 }, + Alpha = 0, + }, }; } @@ -53,21 +101,52 @@ namespace osu.Game.Overlays.BeatmapSet.Scores this.api = api; } - private void getScores() + private void updateScores() { - flow.Clear(); + request?.Cancel(); - var req = new GetScoresRequest(beatmap); - req.Success += scores => + if (beatmap == null) { - int i = 0; - foreach(var s in scores.Scores) + clearAllScores(); + return; + } + + isLoading = true; + + request = new GetScoresRequest(beatmap); + request.Success += scores => + { + var scoresAmount = scores.Scores.Count(); + if (scoresAmount == 0) { - flow.Add(new DrawableScore(i, s)); - i++; + clearAllScores(); + return; } + + topScore.Score = scores.Scores.FirstOrDefault(); + topScore.Show(); + + flow.Clear(); + + if (scoresAmount < 2) + { + isLoading = false; + return; + } + + for (int i = 1; i < scoresAmount; i++) + flow.Add(new DrawableScore(i, scores.Scores.ElementAt(i))); + + isLoading = false; }; - api.Queue(req); + api.Queue(request); + } + + private void clearAllScores() + { + topScore.Hide(); + flow.Clear(); + isLoading = false; } } } diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs index 2c8cb06c4a..6ce438baed 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using OpenTK; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -11,7 +10,6 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; using osu.Game.Screens.Select.Leaderboards; -using System.Linq; using osu.Framework.Localisation; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; diff --git a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs index 6329729687..5bd78d5971 100644 --- a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs +++ b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs @@ -14,15 +14,10 @@ namespace osu.Game.Screens.Select.Leaderboards public class DrawableRank : Container { private readonly Sprite rankSprite; + private TextureStore textures; public ScoreRank Rank { get; private set; } - [BackgroundDependencyLoader] - private void load(TextureStore textures) - { - rankSprite.Texture = textures.Get($@"Grades/{Rank.GetDescription()}"); - } - public DrawableRank(ScoreRank rank) { Rank = rank; @@ -38,5 +33,20 @@ namespace osu.Game.Screens.Select.Leaderboards }, }; } + + [BackgroundDependencyLoader] + private void load(TextureStore textures) + { + this.textures = textures; + updateTexture(); + } + + private void updateTexture() => rankSprite.Texture = textures.Get($@"Grades/{Rank.GetDescription()}"); + + public void UpdateRank(ScoreRank newRank) + { + Rank = newRank; + updateTexture(); + } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 93083134ba..c062391af6 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -279,7 +279,9 @@ + + From 944bdc1c25b17217589fa6b164b5baf986ffd934 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 11 Nov 2017 07:07:41 +0300 Subject: [PATCH 012/282] CI fixes --- osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs | 7 ++++--- .../Overlays/BeatmapSet/Scores/DrawableTopScore.cs | 12 ++++++------ osu.Game/Overlays/BeatmapSetOverlay.cs | 3 ++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs index ae40b4205d..8aba88c639 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -21,13 +21,14 @@ namespace osu.Game.Overlays.BeatmapSet.Scores public class DrawableScore : Container { private const int fade_duration = 100; - private const int height = 30; + private const float height = 30; private readonly Box background; - private readonly ScoreModsContainer modsContainer; public DrawableScore(int index, OnlineScore score) { + ScoreModsContainer modsContainer; + RelativeSizeAxes = Axes.X; Height = height; CornerRadius = 3; @@ -88,7 +89,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreRight, - Text = score.TotalScore.ToString(), + Text = $@"{score.TotalScore}", Font = @"Exo2.0-MediumItalic", RelativePositionAxes = Axes.X, X = 0.7f diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs index f9ad72bd2c..665a563e6e 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs @@ -23,10 +23,10 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { public class DrawableTopScore : Container { - private const int fade_duration = 100; - private const int height = 200; - private const int avatar_size = 80; - private const int margin = 10; + private const float fade_duration = 100; + private const float height = 200; + private const float avatar_size = 80; + private const float margin = 10; private readonly Box background; private readonly Box bottomBackground; @@ -179,10 +179,10 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { avatar.User = username.User = score.User; flag.FlagName = score.User.Country?.FlagName; - date.Text = $"achieved {score.Date:MMM d, yyyy}"; + date.Text = $@"achieved {score.Date:MMM d, yyyy}"; rank.UpdateRank(score.Rank); - totalScore.Value = score.TotalScore.ToString(); + totalScore.Value = $@"{score.TotalScore}"; accuracy.Value = $@"{score.Accuracy:P2}"; statistics.Value = $"{score.Statistics["300"]}/{score.Statistics["100"]}/{score.Statistics["50"]}"; diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 7ce7d86cd5..db01d02c79 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -27,7 +27,6 @@ namespace osu.Game.Overlays private readonly Header header; private readonly Info info; - private readonly ScoresContainer scores; private APIAccess api; private RulesetStore rulesets; @@ -37,6 +36,8 @@ namespace osu.Game.Overlays public BeatmapSetOverlay() { + ScoresContainer scores; + FirstWaveColour = OsuColour.Gray(0.4f); SecondWaveColour = OsuColour.Gray(0.3f); ThirdWaveColour = OsuColour.Gray(0.2f); From 057ada018337fc3dceec16a872a132831b7f8301 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 11 Nov 2017 07:50:40 +0300 Subject: [PATCH 013/282] Fix nulls --- osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs | 2 +- osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs index 0aa1fae12f..762e3f0105 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs @@ -49,7 +49,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores }; } - [BackgroundDependencyLoader] + [BackgroundDependencyLoader(true)] private void load(UserProfileOverlay profile) { this.profile = profile; diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 0f25021cf5..164823f105 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -105,7 +105,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { request?.Cancel(); - if (beatmap == null) + if (!beatmap?.OnlineBeatmapID.HasValue ?? false) { clearAllScores(); return; From 74bcc61a67cd265e10af95bdbe6df5d3d5b714fd Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 11 Nov 2017 07:51:07 +0300 Subject: [PATCH 014/282] Fix possible overlapping --- osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs index 8aba88c639..6d20082383 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -83,7 +83,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Height = 20, FillMode = FillMode.Fit, RelativePositionAxes = Axes.X, - X = 0.55f + X = 0.57f }, new OsuSpriteText { From 36ac002820c05e1729cbce47af510a85dfcdcc86 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 11 Nov 2017 18:25:16 +0300 Subject: [PATCH 015/282] Fix incorrect null check --- osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 164823f105..1134d43f53 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -105,7 +105,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { request?.Cancel(); - if (!beatmap?.OnlineBeatmapID.HasValue ?? false) + if (!beatmap?.OnlineBeatmapID.HasValue ?? true) { clearAllScores(); return; From 569780d37b0b664d1281ae40354cc6d5430f233f Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 12 Nov 2017 07:05:50 +0300 Subject: [PATCH 016/282] Move Api request outside the scores container itself --- .../BeatmapSet/Scores/ClickableUsername.cs | 3 +- .../BeatmapSet/Scores/ScoresContainer.cs | 84 ++++++++----------- osu.Game/Overlays/BeatmapSetOverlay.cs | 28 ++++++- 3 files changed, 60 insertions(+), 55 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs index 762e3f0105..bc5595587b 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs @@ -14,7 +14,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores public class ClickableUsername : OsuHoverContainer { private readonly OsuSpriteText text; - private Action clickAction; private UserProfileOverlay profile; private User user; @@ -57,7 +56,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores protected override bool OnClick(InputState state) { - profile.ShowUser(user); + profile?.ShowUser(user); return base.OnClick(state); } } diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 1134d43f53..41773cf18d 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -3,15 +3,13 @@ using OpenTK; using OpenTK.Graphics; -using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Game.Beatmaps; using osu.Game.Graphics.UserInterface; -using osu.Game.Online.API; using osu.Game.Online.API.Requests; +using System.Collections.Generic; using System.Linq; namespace osu.Game.Overlays.BeatmapSet.Scores @@ -25,29 +23,36 @@ namespace osu.Game.Overlays.BeatmapSet.Scores private readonly DrawableTopScore topScore; private readonly LoadingAnimation loadingAnimation; private readonly Box foreground; - private GetScoresRequest request; - private APIAccess api; - private bool isLoading + private bool isLoading; + public bool IsLoading { set { - foreground.FadeTo(value ? 1 : 0, fade_duration); - loadingAnimation.FadeTo(value ? 1 : 0, fade_duration); + if (isLoading == value) return; + isLoading = value; + + foreground.FadeTo(isLoading ? 1 : 0, fade_duration); + loadingAnimation.FadeTo(isLoading ? 1 : 0, fade_duration); } + get { return isLoading; } } - private BeatmapInfo beatmap; - public BeatmapInfo Beatmap + private IEnumerable scores; + public IEnumerable Scores { set { - if (beatmap == value) return; - beatmap = value; + if (scores == value) + { + IsLoading = false; + return; + } + scores = value; updateScores(); } - get { return beatmap; } + get { return scores; } } public ScoresContainer() @@ -95,58 +100,37 @@ namespace osu.Game.Overlays.BeatmapSet.Scores }; } - [BackgroundDependencyLoader] - private void load(APIAccess api) - { - this.api = api; - } - private void updateScores() { - request?.Cancel(); - - if (!beatmap?.OnlineBeatmapID.HasValue ?? true) + var scoresAmount = scores.Count(); + if (scoresAmount == 0) { - clearAllScores(); + CleanAllScores(); return; } - isLoading = true; + topScore.Score = scores.FirstOrDefault(); + topScore.Show(); - request = new GetScoresRequest(beatmap); - request.Success += scores => + flow.Clear(); + + if (scoresAmount < 2) { - var scoresAmount = scores.Scores.Count(); - if (scoresAmount == 0) - { - clearAllScores(); - return; - } + IsLoading = false; + return; + } - topScore.Score = scores.Scores.FirstOrDefault(); - topScore.Show(); + for (int i = 1; i < scoresAmount; i++) + flow.Add(new DrawableScore(i, scores.ElementAt(i))); - flow.Clear(); - - if (scoresAmount < 2) - { - isLoading = false; - return; - } - - for (int i = 1; i < scoresAmount; i++) - flow.Add(new DrawableScore(i, scores.Scores.ElementAt(i))); - - isLoading = false; - }; - api.Queue(request); + IsLoading = false; } - private void clearAllScores() + public void CleanAllScores() { topScore.Hide(); flow.Clear(); - isLoading = false; + IsLoading = false; } } } diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index db01d02c79..480808ee54 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -27,17 +27,17 @@ namespace osu.Game.Overlays private readonly Header header; private readonly Info info; + private readonly ScoresContainer scores; private APIAccess api; private RulesetStore rulesets; + private GetScoresRequest getScoresRequest; // receive input outside our bounds so we can trigger a close event on ourselves. public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; public BeatmapSetOverlay() { - ScoresContainer scores; - FirstWaveColour = OsuColour.Gray(0.4f); SecondWaveColour = OsuColour.Gray(0.3f); ThirdWaveColour = OsuColour.Gray(0.2f); @@ -83,7 +83,29 @@ namespace osu.Game.Overlays }, }; - header.Picker.Beatmap.ValueChanged += b => info.Beatmap = scores.Beatmap = b; + header.Picker.Beatmap.ValueChanged += b => + { + info.Beatmap = b; + updateScores(b); + }; + } + + private void updateScores(BeatmapInfo beatmap) + { + scores.IsLoading = true; + + getScoresRequest?.Cancel(); + + if (!beatmap.OnlineBeatmapID.HasValue) + { + scores.CleanAllScores(); + return; + } + + getScoresRequest = new GetScoresRequest(beatmap); + getScoresRequest.Success += r => scores.Scores = r.Scores; + + api.Queue(getScoresRequest); } [BackgroundDependencyLoader] From 7c0b13f9efa4b247ded6b3128ff73523a923ef8f Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 12 Nov 2017 07:31:08 +0300 Subject: [PATCH 017/282] CI fixes and minor visual improvements --- .../BeatmapSet/Scores/ClickableUsername.cs | 1 - .../BeatmapSet/Scores/DrawableScore.cs | 20 +++++++++---------- .../BeatmapSet/Scores/ScoresContainer.cs | 10 ++-------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs index bc5595587b..ab828cf0eb 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Users; -using System; using osu.Framework.Input; namespace osu.Game.Overlays.BeatmapSet.Scores diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs index 6d20082383..f7655e54a9 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -22,6 +22,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { private const int fade_duration = 100; private const float height = 30; + private const float side_margin = 20; + private const float flag_margin = 60; + private const float username_margin = 100; private readonly Box background; @@ -46,8 +49,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Origin = Anchor.CentreLeft, Text = $"#{index + 1}", Font = @"Exo2.0-RegularItalic", - RelativePositionAxes = Axes.X, - X = 0.02f + Margin = new MarginPadding { Left = side_margin } }, new DrawableFlag(score.User.Country?.FlagName) { @@ -55,23 +57,22 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Origin = Anchor.CentreLeft, Width = 30, Height = 20, - RelativePositionAxes = Axes.X, - X = 0.06f + Margin = new MarginPadding { Left = flag_margin } }, new ClickableUsername { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, User = score.User, - RelativePositionAxes = Axes.X, - X = 0.1f + Margin = new MarginPadding { Left = username_margin } }, modsContainer = new ScoreModsContainer { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Y, - Width = 60, + RelativeSizeAxes = Axes.X, + Width = 0.05f, RelativePositionAxes = Axes.X, X = 0.45f }, @@ -105,12 +106,11 @@ namespace osu.Game.Overlays.BeatmapSet.Scores }, new OsuSpriteText { - Anchor = Anchor.CentreLeft, + Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Text = $"{score.Statistics["300"]}/{score.Statistics["100"]}/{score.Statistics["50"]}", Font = @"Exo2.0-RegularItalic", - RelativePositionAxes = Axes.X, - X = 0.98f + Margin = new MarginPadding { Right = side_margin } }, }; diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 41773cf18d..5bc2d0e1c4 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -43,13 +43,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { set { - if (scores == value) - { - IsLoading = false; - return; - } scores = value; - updateScores(); } get { return scores; } @@ -92,9 +86,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores loadingAnimation = new LoadingAnimation { Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, + Origin = Anchor.Centre, Size = new Vector2(20), - Margin = new MarginPadding { Top = 10 }, + Margin = new MarginPadding { Top = 115 }, Alpha = 0, }, }; From 1792075cf9292350670dc83878eaf78554663e32 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 12 Nov 2017 07:50:01 +0300 Subject: [PATCH 018/282] Loading animation fix --- osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 5bc2d0e1c4..c3281985ca 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -86,9 +86,8 @@ namespace osu.Game.Overlays.BeatmapSet.Scores loadingAnimation = new LoadingAnimation { Anchor = Anchor.TopCentre, - Origin = Anchor.Centre, - Size = new Vector2(20), - Margin = new MarginPadding { Top = 115 }, + Origin = Anchor.TopCentre, + Margin = new MarginPadding { Top = 105 }, Alpha = 0, }, }; From 96e99d996b04dd5c1cc1f94efdddea8a7e68a309 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 12 Nov 2017 09:01:13 +0300 Subject: [PATCH 019/282] Add TestCase --- .../Visual/TestCaseBeatmapScoresContainer.cs | 314 ++++++++++++++++++ osu.Game.Tests/osu.Game.Tests.csproj | 1 + .../BeatmapSet/Scores/DrawableScore.cs | 2 +- .../BeatmapSet/Scores/ScoresContainer.cs | 5 +- 4 files changed, 317 insertions(+), 5 deletions(-) create mode 100644 osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs new file mode 100644 index 0000000000..274cee8d3a --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs @@ -0,0 +1,314 @@ +// 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.Framework.Graphics.Shapes; +using osu.Framework.MathUtils; +using osu.Game.Graphics; +using osu.Game.Online.API.Requests; +using osu.Game.Overlays.BeatmapSet.Scores; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu.Mods; +using osu.Game.Rulesets.Scoring; +using osu.Game.Users; +using System.Collections.Generic; + +namespace osu.Game.Tests.Visual +{ + public class TestCaseBeatmapScoresContainer : OsuTestCase + { + public override string Description => "BeatmapOverlay scores container"; + + private readonly IEnumerable scores; + private readonly IEnumerable anotherScores; + private readonly OnlineScore topScore; + private readonly Box background; + private readonly Container container; + + public TestCaseBeatmapScoresContainer() + { + ScoresContainer scoresContainer; + + Child = container = new Container + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Width = 0.8f, + Children = new Drawable[] + { + background = new Box { RelativeSizeAxes = Axes.Both }, + scoresContainer = new ScoresContainer(), + } + }; + + AddStep("scores pack 1", () => scoresContainer.Scores = scores); + AddStep("scores pack 2", () => scoresContainer.Scores = anotherScores); + AddStep("only top score", () => scoresContainer.Scores = new OnlineScore[] { topScore }); + AddStep("remove scores", scoresContainer.CleanAllScores); + AddStep("turn on loading", () => scoresContainer.IsLoading = true); + AddStep("turn off loading", () => scoresContainer.IsLoading = false); + AddStep("resize to big", () => container.ResizeWidthTo(1, 300)); + AddStep("resize to normal", () => container.ResizeWidthTo(0.8f, 300)); + + scores = new OnlineScore[] + { + new OnlineScore + { + User = new User + { + Id = 6602580, + Username = @"waaiiru", + Country = new Country + { + FullName = @"Spain", + FlagName = @"ES", + }, + }, + Mods = new Mod[] + { + new OsuModDoubleTime(), + new OsuModHidden(), + new OsuModFlashlight(), + new OsuModHardRock(), + }, + Rank = ScoreRank.XH, + TotalScore = 1234567890, + Accuracy = 1, + }, + new OnlineScore + { + User = new User + { + Id = 4608074, + Username = @"Skycries", + Country = new Country + { + FullName = @"Brazil", + FlagName = @"BR", + }, + }, + Mods = new Mod[] + { + new OsuModDoubleTime(), + new OsuModHidden(), + new OsuModFlashlight(), + }, + Rank = ScoreRank.S, + TotalScore = 1234789, + Accuracy = 0.9997, + }, + new OnlineScore + { + User = new User + { + Id = 1014222, + Username = @"eLy", + Country = new Country + { + FullName = @"Japan", + FlagName = @"JP", + }, + }, + Mods = new Mod[] + { + new OsuModDoubleTime(), + new OsuModHidden(), + }, + Rank = ScoreRank.B, + TotalScore = 12345678, + Accuracy = 0.9854, + }, + new OnlineScore + { + User = new User + { + Id = 1541390, + Username = @"Toukai", + Country = new Country + { + FullName = @"Canada", + FlagName = @"CA", + }, + }, + Mods = new Mod[] + { + new OsuModDoubleTime(), + }, + Rank = ScoreRank.C, + TotalScore = 1234567, + Accuracy = 0.8765, + }, + new OnlineScore + { + User = new User + { + Id = 7151382, + Username = @"Mayuri Hana", + Country = new Country + { + FullName = @"Thailand", + FlagName = @"TH", + }, + }, + Rank = ScoreRank.F, + TotalScore = 123456, + Accuracy = 0.6543, + }, + }; + foreach(var s in scores) + { + s.Statistics.Add("300", RNG.Next(2000)); + s.Statistics.Add("100", RNG.Next(2000)); + s.Statistics.Add("50", RNG.Next(2000)); + } + + anotherScores = new OnlineScore[] + { + new OnlineScore + { + User = new User + { + Id = 4608074, + Username = @"Skycries", + Country = new Country + { + FullName = @"Brazil", + FlagName = @"BR", + }, + }, + Mods = new Mod[] + { + new OsuModDoubleTime(), + new OsuModHidden(), + new OsuModFlashlight(), + }, + Rank = ScoreRank.S, + TotalScore = 1234789, + Accuracy = 0.9997, + }, + new OnlineScore + { + User = new User + { + Id = 6602580, + Username = @"waaiiru", + Country = new Country + { + FullName = @"Spain", + FlagName = @"ES", + }, + }, + Mods = new Mod[] + { + new OsuModDoubleTime(), + new OsuModHidden(), + new OsuModFlashlight(), + new OsuModHardRock(), + }, + Rank = ScoreRank.XH, + TotalScore = 1234567890, + Accuracy = 1, + }, + new OnlineScore + { + User = new User + { + Id = 7151382, + Username = @"Mayuri Hana", + Country = new Country + { + FullName = @"Thailand", + FlagName = @"TH", + }, + }, + Rank = ScoreRank.F, + TotalScore = 123456, + Accuracy = 0.6543, + }, + new OnlineScore + { + User = new User + { + Id = 1014222, + Username = @"eLy", + Country = new Country + { + FullName = @"Japan", + FlagName = @"JP", + }, + }, + Mods = new Mod[] + { + new OsuModDoubleTime(), + new OsuModHidden(), + }, + Rank = ScoreRank.B, + TotalScore = 12345678, + Accuracy = 0.9854, + }, + new OnlineScore + { + User = new User + { + Id = 1541390, + Username = @"Toukai", + Country = new Country + { + FullName = @"Canada", + FlagName = @"CA", + }, + }, + Mods = new Mod[] + { + new OsuModDoubleTime(), + }, + Rank = ScoreRank.C, + TotalScore = 1234567, + Accuracy = 0.8765, + }, + }; + foreach (var s in anotherScores) + { + s.Statistics.Add("300", RNG.Next(2000)); + s.Statistics.Add("100", RNG.Next(2000)); + s.Statistics.Add("50", RNG.Next(2000)); + } + + topScore = new OnlineScore + { + User = new User + { + Id = 2705430, + Username = @"Mooha", + Country = new Country + { + FullName = @"France", + FlagName = @"FR", + }, + }, + Mods = new Mod[] + { + new OsuModDoubleTime(), + new OsuModFlashlight(), + new OsuModHardRock(), + }, + Rank = ScoreRank.B, + TotalScore = 987654321, + Accuracy = 0.8487, + }; + topScore.Statistics.Add("300", RNG.Next(2000)); + topScore.Statistics.Add("100", RNG.Next(2000)); + topScore.Statistics.Add("50", RNG.Next(2000)); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + background.Colour = colours.Gray2; + } + } +} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index b1081890c8..974bde9319 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -93,6 +93,7 @@ + diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs index f7655e54a9..2b1cdf5c25 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -84,7 +84,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Height = 20, FillMode = FillMode.Fit, RelativePositionAxes = Axes.X, - X = 0.57f + X = 0.55f }, new OsuSpriteText { diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index c3281985ca..679e36971c 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -64,7 +64,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Width = 0.95f, Direction = FillDirection.Vertical, Spacing = new Vector2(0, spacing), - Margin = new MarginPadding { Top = spacing }, + Margin = new MarginPadding { Vertical = spacing }, Children = new Drawable[] { topScore = new DrawableTopScore(), @@ -85,9 +85,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores }, loadingAnimation = new LoadingAnimation { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Margin = new MarginPadding { Top = 105 }, Alpha = 0, }, }; From f5e510cdf2d510fa0995f903a0af33cc0b64c73b Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 12 Nov 2017 09:09:54 +0300 Subject: [PATCH 020/282] CI fixes --- osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs index 274cee8d3a..8cae3feae2 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs @@ -25,10 +25,10 @@ namespace osu.Game.Tests.Visual private readonly IEnumerable anotherScores; private readonly OnlineScore topScore; private readonly Box background; - private readonly Container container; public TestCaseBeatmapScoresContainer() { + Container container; ScoresContainer scoresContainer; Child = container = new Container @@ -47,14 +47,14 @@ namespace osu.Game.Tests.Visual AddStep("scores pack 1", () => scoresContainer.Scores = scores); AddStep("scores pack 2", () => scoresContainer.Scores = anotherScores); - AddStep("only top score", () => scoresContainer.Scores = new OnlineScore[] { topScore }); + AddStep("only top score", () => scoresContainer.Scores = new[] { topScore }); AddStep("remove scores", scoresContainer.CleanAllScores); AddStep("turn on loading", () => scoresContainer.IsLoading = true); AddStep("turn off loading", () => scoresContainer.IsLoading = false); AddStep("resize to big", () => container.ResizeWidthTo(1, 300)); AddStep("resize to normal", () => container.ResizeWidthTo(0.8f, 300)); - scores = new OnlineScore[] + scores = new[] { new OnlineScore { @@ -166,7 +166,7 @@ namespace osu.Game.Tests.Visual s.Statistics.Add("50", RNG.Next(2000)); } - anotherScores = new OnlineScore[] + anotherScores = new[] { new OnlineScore { From 16e48ed187073b9f77799016005356a3a166e38d Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 5 Nov 2017 16:33:58 +0530 Subject: [PATCH 021/282] Hook up download logic with BeatmapSetOverlay download buttons. - Add noVideo option to DownloadBeatmapSetRequest - Make Download fire an event with new download instead of returning it --- osu.Game/Beatmaps/BeatmapManager.cs | 27 +++++++++---- .../API/Requests/DownloadBeatmapSetRequest.cs | 7 +++- osu.Game/Overlays/BeatmapSet/Header.cs | 40 ++++++++++++++++--- osu.Game/Overlays/BeatmapSetOverlay.cs | 14 ++++++- osu.Game/Overlays/Direct/DirectPanel.cs | 20 +++------- 5 files changed, 78 insertions(+), 30 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index f02a9a176c..e610073300 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -18,6 +18,7 @@ using osu.Framework.Platform; using osu.Game.Beatmaps.Formats; using osu.Game.Beatmaps.IO; using osu.Game.Database; +using osu.Game.Graphics; using osu.Game.IO; using osu.Game.IPC; using osu.Game.Online.API; @@ -52,6 +53,11 @@ namespace osu.Game.Beatmaps /// public event Action BeatmapRestored; + /// + /// Fired when a beatmap download begins. + /// + public event Action BeatmapDownloadBegan; + /// /// A default representation of a WorkingBeatmap to use when no beatmap is available. /// @@ -221,21 +227,29 @@ namespace osu.Game.Beatmaps /// Downloads a beatmap. /// /// The to be downloaded. - /// A new , or an existing one if a download is already in progress. - public DownloadBeatmapSetRequest Download(BeatmapSetInfo beatmapSetInfo) + /// Whether the beatmap should be downloaded without video. Defaults to false. + public void Download(BeatmapSetInfo beatmapSetInfo, bool noVideo = false) { var existing = GetExistingDownload(beatmapSetInfo); - if (existing != null) return existing; + if (existing != null || api == null) return; - if (api == null) return null; + if (!api.LocalUser.Value.IsSupporter) + { + PostNotification?.Invoke(new SimpleNotification + { + Icon = FontAwesome.fa_superpowers, + Text = "You gotta be a supporter to download for now 'yo" + }); + return; + } ProgressNotification downloadNotification = new ProgressNotification { Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}", }; - var request = new DownloadBeatmapSetRequest(beatmapSetInfo); + var request = new DownloadBeatmapSetRequest(beatmapSetInfo, noVideo); request.DownloadProgressed += progress => { @@ -280,8 +294,7 @@ namespace osu.Game.Beatmaps // don't run in the main api queue as this is a long-running task. Task.Factory.StartNew(() => request.Perform(api), TaskCreationOptions.LongRunning); - - return request; + BeatmapDownloadBegan?.Invoke(request); } /// diff --git a/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs b/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs index 5a9f609bca..cdcc06a65c 100644 --- a/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs +++ b/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs @@ -12,13 +12,16 @@ namespace osu.Game.Online.API.Requests public Action DownloadProgressed; - public DownloadBeatmapSetRequest(BeatmapSetInfo set) + private readonly bool noVideo; + + public DownloadBeatmapSetRequest(BeatmapSetInfo set, bool noVideo) { + this.noVideo = noVideo; BeatmapSet = set; Progress += (current, total) => DownloadProgressed?.Invoke((float) current / total); } - protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download"; + protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download{(noVideo ? "?noVideo=1" : "")}"; } } diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index d4514cbaed..a9802c8155 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -27,12 +27,17 @@ namespace osu.Game.Overlays.BeatmapSet private readonly Container coverContainer; private readonly OsuSpriteText title, artist; private readonly AuthorInfo author; + private readonly Container downloadButtonsContainer; public Details Details; + private BeatmapManager beatmaps; + private DelayedLoadWrapper cover; public readonly BeatmapPicker Picker; + private bool isDownloading => beatmaps.GetExistingDownload(BeatmapSet) != null; + private BeatmapSetInfo beatmapSet; public BeatmapSetInfo BeatmapSet { @@ -162,7 +167,7 @@ namespace osu.Game.Overlays.BeatmapSet Children = new Drawable[] { new FavouriteButton(), - new Container + downloadButtonsContainer = new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = buttons_height + buttons_spacing }, @@ -172,7 +177,10 @@ namespace osu.Game.Overlays.BeatmapSet { RelativeSizeAxes = Axes.Both, Alpha = 0f, - Child = new DownloadButton("Download", @""), + Child = new DownloadButton("Download", @"") + { + Action = () => download(false), + }, }, videoButtons = new FillFlowContainer { @@ -181,8 +189,14 @@ namespace osu.Game.Overlays.BeatmapSet Alpha = 0f, Children = new[] { - new DownloadButton("Download", "with Video"), - new DownloadButton("Download", "without Video"), + new DownloadButton("Download", "with Video") + { + Action = () => download(false), + }, + new DownloadButton("Download", "without Video") + { + Action = () => download(true), + }, }, }, }, @@ -220,9 +234,25 @@ namespace osu.Game.Overlays.BeatmapSet } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, BeatmapManager beatmaps) { tabsBg.Colour = colours.Gray3; + this.beatmaps = beatmaps; + } + + private void download(bool video) + { + if (beatmaps.GetExistingDownload(BeatmapSet) != null) + { + downloadButtonsContainer.MoveToX(-5, 50, Easing.OutSine).Then() + .MoveToX(5, 100, Easing.InOutSine).Then() + .MoveToX(-5, 100, Easing.InOutSine).Then() + .MoveToX(0, 50, Easing.InSine).Then(); + + return; + } + + beatmaps.Download(BeatmapSet); } } } diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index ddd146bcb6..7e80f427de 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -24,11 +24,14 @@ namespace osu.Game.Overlays public const float X_PADDING = 40; public const float RIGHT_WIDTH = 275; + private BeatmapSetInfo currentBeatmap; + private readonly Header header; private readonly Info info; private APIAccess api; private RulesetStore rulesets; + private BeatmapManager manager; // receive input outside our bounds so we can trigger a close event on ourselves. public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; @@ -83,10 +86,17 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(APIAccess api, RulesetStore rulesets) + private void load(APIAccess api, RulesetStore rulesets, BeatmapManager manager) { this.api = api; this.rulesets = rulesets; + this.manager = manager; + + manager.BeatmapSetAdded += beatmap => + { + if (beatmap.OnlineBeatmapSetID == currentBeatmap.OnlineBeatmapSetID) + Hide(); + }; } protected override void PopIn() @@ -118,7 +128,7 @@ namespace osu.Game.Overlays public void ShowBeatmapSet(BeatmapSetInfo set) { - header.BeatmapSet = info.BeatmapSet = set; + currentBeatmap = header.BeatmapSet = info.BeatmapSet = set; Show(); } } diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index ef89c0022b..702aef7417 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -18,7 +18,6 @@ using osu.Framework.Input; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using osu.Framework.Logging; -using osu.Game.Overlays.Notifications; using osu.Game.Online.API.Requests; using osu.Framework.Configuration; using osu.Framework.Audio.Track; @@ -109,6 +108,8 @@ namespace osu.Game.Overlays.Direct if (downloadRequest != null) attachDownload(downloadRequest); + + beatmaps.BeatmapDownloadBegan += attachDownload; } protected override void Update() @@ -151,16 +152,6 @@ namespace osu.Game.Overlays.Direct protected void StartDownload() { - if (!api.LocalUser.Value.IsSupporter) - { - notifications.Post(new SimpleNotification - { - Icon = FontAwesome.fa_superpowers, - Text = "You gotta be a supporter to download for now 'yo" - }); - return; - } - if (beatmaps.GetExistingDownload(SetInfo) != null) { // we already have an active download running. @@ -172,13 +163,14 @@ namespace osu.Game.Overlays.Direct return; } - var request = beatmaps.Download(SetInfo); - - attachDownload(request); + beatmaps.Download(SetInfo); } private void attachDownload(DownloadBeatmapSetRequest request) { + if (request.BeatmapSet.OnlineBeatmapSetID != SetInfo.OnlineBeatmapSetID) + return; + progressBar.FadeIn(400, Easing.OutQuint); progressBar.ResizeHeightTo(4, 400, Easing.OutQuint); From fa6d3f97929d871a5f442cc1072c7909f515d552 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 13 Nov 2017 18:49:10 +0300 Subject: [PATCH 022/282] Reduce isLoading calls --- .../Overlays/BeatmapSet/Scores/ScoresContainer.cs | 6 ------ osu.Game/Overlays/BeatmapSetOverlay.cs | 11 +++++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 679e36971c..2bbfa0f56a 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -105,22 +105,16 @@ namespace osu.Game.Overlays.BeatmapSet.Scores flow.Clear(); if (scoresAmount < 2) - { - IsLoading = false; return; - } for (int i = 1; i < scoresAmount; i++) flow.Add(new DrawableScore(i, scores.ElementAt(i))); - - IsLoading = false; } public void CleanAllScores() { topScore.Hide(); flow.Clear(); - IsLoading = false; } } } diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 480808ee54..51be30b120 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -92,8 +92,6 @@ namespace osu.Game.Overlays private void updateScores(BeatmapInfo beatmap) { - scores.IsLoading = true; - getScoresRequest?.Cancel(); if (!beatmap.OnlineBeatmapID.HasValue) @@ -102,9 +100,14 @@ namespace osu.Game.Overlays return; } - getScoresRequest = new GetScoresRequest(beatmap); - getScoresRequest.Success += r => scores.Scores = r.Scores; + scores.IsLoading = true; + getScoresRequest = new GetScoresRequest(beatmap); + getScoresRequest.Success += r => + { + scores.Scores = r.Scores; + scores.IsLoading = false; + }; api.Queue(getScoresRequest); } From f6cbde95e2374a5ab5e918d5bd3a7819c388580e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 14 Nov 2017 13:06:40 +0900 Subject: [PATCH 023/282] Remove unused files --- osu.Game/Resources/Resource.cs | 20 - .../Soleily - Renatus (Gamu) [Insane].osu | 1002 ----------------- 2 files changed, 1022 deletions(-) delete mode 100644 osu.Game/Resources/Resource.cs delete mode 100644 osu.Game/Resources/Soleily - Renatus (Gamu) [Insane].osu diff --git a/osu.Game/Resources/Resource.cs b/osu.Game/Resources/Resource.cs deleted file mode 100644 index 6c66b6818b..0000000000 --- a/osu.Game/Resources/Resource.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -namespace osu.Game.Tests.Resources -{ - public static class Resource - { - public static Stream OpenResource(string name) - { - var localPath = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path)); - - return Assembly.GetExecutingAssembly().GetManifestResourceStream($@"osu.Game.Tests.Resources.{name}") ?? - Assembly.LoadFrom(Path.Combine(localPath, @"osu.Game.Resources.dll")).GetManifestResourceStream($@"osu.Game.Resources.{name}"); - } - } -} \ No newline at end of file diff --git a/osu.Game/Resources/Soleily - Renatus (Gamu) [Insane].osu b/osu.Game/Resources/Soleily - Renatus (Gamu) [Insane].osu deleted file mode 100644 index 3e44dc0af8..0000000000 --- a/osu.Game/Resources/Soleily - Renatus (Gamu) [Insane].osu +++ /dev/null @@ -1,1002 +0,0 @@ -osu file format v14 - -[General] -AudioFilename: 03. Renatus - Soleily 192kbps.mp3 -AudioLeadIn: 0 -PreviewTime: 164471 -Countdown: 0 -SampleSet: Soft -StackLeniency: 0.7 -Mode: 0 -LetterboxInBreaks: 0 -WidescreenStoryboard: 0 - -[Editor] -Bookmarks: 11505,22054,32604,43153,53703,64252,74802,85351,95901,106450,116999,119637,130186,140735,151285,161834,164471,175020,185570,196119,206669,209306 -DistanceSpacing: 1.8 -BeatDivisor: 4 -GridSize: 4 -TimelineZoom: 2 - -[Metadata] -Title:Renatus -TitleUnicode:Renatus -Artist:Soleily -ArtistUnicode:Soleily -Creator:Gamu -Version:Insane -Source: -Tags:MBC7 Unisphere 地球ヤバイEP Chikyu Yabai -BeatmapID:557821 -BeatmapSetID:241526 - -[Difficulty] -HPDrainRate:6.5 -CircleSize:4 -OverallDifficulty:8 -ApproachRate:9 -SliderMultiplier:1.8 -SliderTickRate:2 - -[Events] -//Background and Video events -0,0,"machinetop_background.jpg",0,0 -//Break Periods -2,122474,140135 -//Storyboard Layer 0 (Background) -//Storyboard Layer 1 (Fail) -//Storyboard Layer 2 (Pass) -//Storyboard Layer 3 (Foreground) -//Storyboard Sound Samples - -[TimingPoints] -956,329.67032967033,4,2,0,60,1,0 -20736,-100,4,2,0,65,0,0 -22054,-100,4,2,0,70,0,0 -43153,-100,4,2,0,60,0,0 -48428,-100,4,2,0,50,0,0 -52879,-100,4,2,0,50,0,0 -53373,-100,4,2,0,60,0,0 -53703,-100,4,2,0,70,0,1 -74719,-100,4,2,0,70,0,0 -74802,-100,4,2,0,70,0,1 -95901,-100,4,2,0,70,0,0 -116999,-133.333333333333,4,2,0,50,0,0 -117164,-133.333333333333,4,2,0,30,0,0 -117329,-79.9999999999999,4,2,0,50,0,0 -117659,-100,4,2,0,50,0,0 -118977,-100,4,2,0,60,0,0 -119307,-100,4,2,0,70,0,0 -119637,659.340659340659,4,2,0,80,1,0 -119966,-100,4,2,0,70,0,0 -120296,-100,4,2,0,60,0,0 -120626,-100,4,2,0,50,0,0 -120955,-100,4,2,0,40,0,0 -121285,-100,4,2,0,30,0,0 -121615,-100,4,2,0,20,0,0 -121944,-100,4,2,0,10,0,0 -122274,-100,4,2,0,5,0,0 -140735,-100,4,2,0,50,0,0 -151285,-80,4,2,0,60,0,0 -161834,329.67032967033,4,2,0,65,1,0 -164141,-100,4,2,0,70,0,0 -164471,-100,4,2,0,70,0,1 -185487,-100,4,2,0,70,0,0 -185570,-100,4,2,0,70,0,1 -206669,659.340659340659,4,2,0,80,1,0 -206998,-100,4,2,0,70,0,0 -207328,-100,4,2,0,60,0,0 -207658,-100,4,2,0,50,0,0 -207987,-100,4,2,0,40,0,0 -208317,-100,4,2,0,30,0,0 -208647,-100,4,2,0,20,0,0 -208976,-100,4,2,0,10,0,0 -209306,-100,4,2,0,5,0,0 - - -[Colours] -Combo1 : 142,199,255 -Combo2 : 255,128,128 -Combo3 : 128,255,255 -Combo4 : 128,255,128 -Combo5 : 255,187,255 -Combo6 : 255,177,140 - -[HitObjects] -192,168,956,6,0,P|184:128|200:80,1,90,4|0,1:2|0:0,0:0:0:0: -304,56,1285,1,8,0:0:0:0: -244,236,1450,2,0,P|204:252|156:244,1,90,2|0,0:0|0:0,0:0:0:0: -276,156,1780,2,0,P|310:181|329:226,1,90,2|8,1:2|0:0,0:0:0:0: -300,328,2109,1,2,0:0:0:0: -192,332,2274,6,0,L|144:340,2,45,0|0|0,1:0|0:0|0:0,0:0:0:0: -388,300,2604,1,8,0:0:0:0: -244,236,2769,1,0,1:0:0:0: -232,208,2851,1,0,0:0:0:0: -224,176,2934,1,0,0:0:0:0: -228,144,3016,1,0,0:0:0:0: -244,116,3098,1,0,1:0:0:0: -332,52,3263,2,0,P|376:48|424:56,1,90,8|0,0:0|0:0,0:0:0:0: -488,228,3593,5,0,1:0:0:0: -460,240,3675,1,0,0:0:0:0: -428,236,3758,1,0,0:0:0:0: -292,160,3923,2,0,P|288:204|300:252,1,90,8|0,0:0|0:0,0:0:0:0: -316,276,4170,1,0,0:0:0:0: -344,292,4252,2,0,L|388:300,1,45,0|0,0:0|0:0,0:0:0:0: -288,356,4417,2,0,L|244:364,1,45,0|0,1:0|0:0,0:0:0:0: -168,328,4582,2,0,P|124:324|72:332,1,90,8|0,0:0|0:0,0:0:0:0: -24,188,4912,5,0,1:0:0:0: -56,192,4994,1,0,0:0:0:0: -88,196,5076,1,0,0:0:0:0: -148,108,5241,1,8,0:0:0:0: -188,240,5406,1,0,1:0:0:0: -188,240,5488,1,0,0:0:0:0: -188,240,5571,2,0,L|168:328,1,90,0|0,0:0|1:0,0:0:0:0: -260,216,5901,2,0,P|236:180|188:164,1,90,8|0,0:0|0:0,0:0:0:0: -248,296,6230,6,0,L|348:292,1,90,0|0,1:0|0:0,0:0:0:0: -504,232,6560,1,8,0:0:0:0: -400,204,6725,1,0,0:0:0:0: -392,176,6807,1,0,0:0:0:0: -384,144,6890,1,0,0:0:0:0: -376,116,6972,1,0,0:0:0:0: -368,88,7054,1,0,1:0:0:0: -188,48,7219,2,0,L|208:140,1,90,8|0,0:0|0:0,0:0:0:0: -248,296,7549,5,0,1:0:0:0: -207,135,7714,1,0,0:0:0:0: -156,232,7879,1,8,0:0:0:0: -316,191,8043,1,0,1:0:0:0: -316,191,8126,1,0,0:0:0:0: -316,191,8208,2,0,L|372:200,1,45,0|0,0:0|0:0,0:0:0:0: -492,200,8373,2,0,L|447:207,1,45,0|0,1:0|0:0,0:0:0:0: -408,136,8538,2,0,P|396:92|400:48,1,90,8|0,0:0|0:0,0:0:0:0: -260,32,8868,5,0,1:0:0:0: -252,64,8950,1,0,0:0:0:0: -236,92,9032,2,0,P|204:116|148:128,1,90,0|8,0:0|0:0,0:0:0:0: -28,188,9362,1,0,0:0:0:0: -60,196,9445,1,0,0:0:0:0: -88,212,9527,2,0,P|112:244|124:300,1,90,0|0,0:0|1:0,0:0:0:0: -112,128,9857,2,0,P|152:156|184:196,1,90,8|0,0:0|0:0,0:0:0:0: -216,288,10186,5,0,1:0:0:0: -216,288,10269,1,0,0:0:0:0: -216,288,10351,1,0,0:0:0:0: -268,192,10516,1,8,0:0:0:0: -356,128,10681,1,0,1:0:0:0: -388,120,10763,1,0,0:0:0:0: -420,128,10846,2,0,P|440:168|436:220,1,90,0|0,0:0|1:0,0:0:0:0: -332,328,11175,2,0,L|280:332,1,45,8|8,0:0|0:0,0:0:0:0: -216,288,11340,2,0,L|164:292,1,45,0|0,1:0|0:0,1:0:0:0: -100,248,11505,5,4,1:2:0:0: -148,116,11670,1,2,0:0:0:0: -268,192,11835,1,10,0:0:0:0: -136,328,11999,2,0,L|44:336,1,90,2|0,0:0|0:0,0:0:0:0: -216,288,12329,1,2,1:2:0:0: -148,116,12494,1,10,0:0:0:0: -100,248,12659,1,2,0:0:0:0: -268,192,12824,5,0,1:0:0:0: -268,192,12906,1,0,0:0:0:0: -268,192,12988,1,0,0:0:0:0: -340,272,13153,2,0,P|384:276|432:264,1,90,8|0,0:0|1:0,0:0:0:0: -452,244,13401,1,0,0:0:0:0: -468,216,13483,2,0,L|476:124,1,90,0|0,0:0|1:0,0:0:0:0: -368,32,13813,2,0,L|360:121,1,90,8|0,0:0|0:0,0:0:0:0: -340,272,14142,6,0,L|316:316,2,45,0|0|0,1:0|0:0|0:0,0:0:0:0: -452,244,14472,1,8,0:0:0:0: -268,192,14637,1,0,0:0:0:0: -236,188,14719,1,0,0:0:0:0: -204,192,14802,2,0,P|172:228|160:272,1,90,0|0,0:0|1:0,0:0:0:0: -128,140,15131,2,0,P|160:104|172:60,1,90,8|0,0:0|0:0,0:0:0:0: -64,52,15461,6,0,L|20:68,2,45,0|0|0,1:0|0:0|0:0,0:0:0:0: -171,64,15791,1,8,0:0:0:0: -264,8,15956,2,0,L|356:12,1,90,0|0,1:0|0:0,0:0:0:0: -452,56,16285,1,0,1:0:0:0: -296,140,16450,2,0,L|206:136,1,90,8|0,0:0|0:0,0:0:0:0: -108,184,16780,6,0,P|92:224|96:272,1,90,0|0,1:0|0:0,0:0:0:0: -200,244,17109,1,8,0:0:0:0: -108,108,17274,2,0,L|12:116,1,90,0|0,0:0|0:0,0:0:0:0: -200,244,17604,1,0,1:0:0:0: -296,140,17769,2,0,L|385:132,1,90,8|0,0:0|0:0,0:0:0:0: -480,184,18098,5,0,1:0:0:0: -488,216,18181,1,0,0:0:0:0: -496,248,18263,2,0,L|492:340,1,90,0|8,0:0|0:0,0:0:0:0: -404,224,18593,2,0,L|396:176,2,45,0|0|0,1:0|0:0|0:0,0:0:0:0: -304,264,18923,1,0,1:0:0:0: -200,244,19087,2,0,P|156:240|108:248,1,90,8|0,0:0|0:0,0:0:0:0: -296,140,19417,6,0,P|340:144|388:136,1,90,0|0,1:0|0:0,0:0:0:0: -440,44,19747,1,8,0:0:0:0: -404,224,19912,1,0,0:0:0:0: -404,224,19994,1,0,0:0:0:0: -404,224,20076,2,0,L|412:320,1,90,0|0,0:0|1:0,0:0:0:0: -200,244,20406,2,0,L|192:154,1,90,8|0,0:0|0:0,0:0:0:0: -184,44,20736,5,4,1:2:0:0: -152,40,20818,1,0,0:0:0:0: -120,48,20901,1,0,0:0:0:0: -96,68,20983,1,0,0:0:0:0: -76,92,21065,1,2,0:3:0:0: -64,120,21148,1,0,0:0:0:0: -60,152,21230,1,0,1:0:0:0: -64,184,21313,1,0,0:0:0:0: -76,212,21395,2,0,L|96:252,3,45,0|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -144,316,21725,2,0,L|188:324,3,45,0|0|2|0,0:0|0:0|0:3|0:0,0:0:0:0: -268,340,22054,6,0,L|364:336,1,90,4|0,1:2|0:0,0:0:0:0: -452,280,22384,1,8,0:0:0:0: -512,188,22549,2,0,P|516:144|504:96,1,90,2|0,0:0|0:0,0:0:0:0: -340,24,22879,2,0,P|336:68|348:116,1,90,2|8,1:2|0:0,0:0:0:0: -420,192,23208,1,2,0:0:0:0: -328,252,23373,6,0,L|232:240,1,90,0|0,1:0|0:0,0:0:0:0: -64,256,23703,1,8,0:0:0:0: -144,184,23868,2,0,P|148:140|136:88,1,90,0|0,1:0|0:0,0:0:0:0: -40,52,24197,1,2,1:2:0:0: -139,95,24362,1,8,0:0:0:0: -216,20,24527,1,0,0:0:0:0: -315,63,24692,6,0,P|360:72|408:68,1,90,2|0,1:2|0:0,0:0:0:0: -492,132,25021,1,8,0:0:0:0: -412,204,25186,2,0,P|403:249|407:297,1,90,2|0,0:0|0:0,0:0:0:0: -268,328,25516,2,0,P|277:283|273:235,1,90,2|8,1:2|0:0,0:0:0:0: -232,140,25846,2,0,P|187:131|139:135,1,90,2|0,0:0|1:0,0:0:0:0: -64,208,26175,5,2,0:0:0:0: -44,316,26340,1,8,0:0:0:0: -148,280,26505,1,2,1:2:0:0: -456,208,26835,1,2,1:2:0:0: -476,316,26999,1,10,0:0:0:0: -372,280,27164,1,2,0:0:0:0: -356,172,27329,6,0,L|380:80,1,90,0|0,1:0|0:0,0:0:0:0: -456,208,27659,1,8,0:0:0:0: -300,236,27824,1,2,0:0:0:0: -300,236,27906,1,0,0:0:0:0: -300,236,27988,2,0,L|208:228,1,90,0|2,0:0|1:2,0:0:0:0: -140,312,28318,1,8,0:0:0:0: -372,280,28483,2,0,L|464:272,1,90,2|0,0:0|1:0,0:0:0:0: -500,136,28813,5,2,0:0:0:0: -432,56,28977,1,8,0:0:0:0: -328,24,29142,2,0,P|284:24|236:28,1,90,2|0,1:2|0:0,0:0:0:0: -80,144,29472,1,2,1:2:0:0: -116,44,29637,1,10,0:0:0:0: -184,128,29802,1,2,0:0:0:0: -20,88,29966,6,0,P|1:164|73:227,1,180,2|10,1:2|0:0,0:0:0:0: -184,128,30461,2,0,P|227:120|276:124,1,90,2|0,0:0|0:0,0:0:0:0: -392,188,30791,1,2,1:2:0:0: -272,260,30956,1,8,0:0:0:0: -396,328,31120,1,0,0:0:0:0: -256,348,31285,5,2,1:2:0:0: -224,344,31368,1,0,1:0:0:0: -192,340,31450,2,0,L|172:248,1,90,2|0,1:2|1:0,0:0:0:0: -8,136,31780,2,0,L|27:223,1,90,2|0,1:2|0:0,0:0:0:0: -56,328,32109,1,2,1:2:0:0: -108,192,32274,1,2,1:2:0:0: -100,160,32357,1,0,1:0:0:0: -92,132,32439,1,2,1:2:0:0: -84,104,32521,1,0,1:0:0:0: -76,72,32604,6,0,P|100:112|148:136,1,90,4|0,1:2|0:0,0:0:0:0: -240,168,32934,1,8,0:0:0:0: -336,124,33098,2,0,L|344:80,2,45,2|0|0,0:0|0:0|0:0,0:0:0:0: -264,248,33428,2,0,P|220:248|176:220,1,90,2|8,1:2|0:0,0:0:0:0: -260,84,33758,1,2,0:0:0:0: -344,212,33923,5,0,1:0:0:0: -344,212,34005,1,0,0:0:0:0: -344,212,34087,1,0,0:0:0:0: -440,160,34252,1,8,0:0:0:0: -312,320,34417,2,0,P|272:336|220:324,1,90,0|0,1:0|0:0,0:0:0:0: -156,176,34747,2,0,P|196:160|248:172,2,90,2|8|0,1:2|0:0|0:0,0:0:0:0: -132,280,35241,5,2,1:2:0:0: -132,280,35324,1,0,0:0:0:0: -132,280,35406,2,0,L|120:376,1,90,0|8,0:0|0:0,0:0:0:0: -312,320,35736,2,0,L|300:230,1,90,2|0,0:0|0:0,0:0:0:0: -316,124,36065,1,2,1:2:0:0: -400,192,36230,1,8,0:0:0:0: -300,230,36395,2,0,P|255:231|211:224,1,90,2|0,0:0|1:0,0:0:0:0: -24,132,36725,5,0,0:0:0:0: -132,152,36890,1,8,0:0:0:0: -60,232,37054,1,2,1:2:0:0: -60,232,37137,1,0,0:0:0:0: -60,232,37219,1,0,0:0:0:0: -92,56,37384,2,0,L|184:44,1,90,2|10,1:2|0:0,0:0:0:0: -316,124,37714,2,0,L|226:135,1,90,2|0,0:0|1:0,0:0:0:0: -60,232,38043,6,0,P|52:276|64:328,1,90,0|8,0:0|0:0,0:0:0:0: -220,152,38373,2,0,P|176:144|124:156,1,90,2|0,0:0|0:0,0:0:0:0: -176,252,38703,1,2,1:2:0:0: -323,213,38868,2,0,L|316:124,1,90,8|2,0:0|0:0,0:0:0:0: -332,320,39197,5,0,1:0:0:0: -424,260,39362,1,2,0:0:0:0: -260,272,39527,2,0,P|246:313|256:360,1,90,8|2,0:0|1:2,0:0:0:0: -408,336,39857,1,0,0:0:0:0: -176,252,40021,2,0,L|80:260,2,90,2|10|2,1:2|0:0|0:0,0:0:0:0: -324,212,40516,5,2,1:2:0:0: -324,212,40598,1,0,1:0:0:0: -324,212,40681,1,0,1:0:0:0: -200,336,40846,1,2,1:2:0:0: -236,188,41010,1,2,1:2:0:0: -236,188,41093,1,0,1:0:0:0: -236,188,41175,1,0,1:0:0:0: -281,357,41340,1,2,1:2:0:0: -176,252,41505,1,2,1:2:0:0: -176,252,41587,1,0,1:0:0:0: -176,252,41670,1,0,1:0:0:0: -344,297,41835,5,2,1:2:0:0: -432,232,41999,1,2,1:2:0:0: -444,204,42082,1,0,1:0:0:0: -448,172,42164,1,0,1:0:0:0: -444,140,42247,1,0,1:0:0:0: -432,112,42329,2,0,L|440:64,2,45,2|0|0,1:2|1:0|1:0,0:0:0:0: -236,188,42659,1,0,0:0:0:0: -340,172,42824,1,2,0:3:0:0: -272,88,42988,1,0,0:0:0:0: -132,160,43153,6,0,P|148:248|220:296,1,180,4|8,1:2|0:0,0:0:0:0: -324,320,43648,2,0,L|336:364,2,45,0|0|0,0:0|0:0|0:0,0:0:0:0: -292,216,43977,1,0,1:0:0:0: -396,240,44142,2,0,P|440:244|488:232,1,90,8|0,0:0|0:0,0:0:0:0: -328,124,44472,6,0,P|284:120|236:132,1,90,0|0,1:0|0:0,0:0:0:0: -168,212,44802,1,8,0:0:0:0: -192,316,44966,1,0,1:0:0:0: -140,220,45131,1,0,0:0:0:0: -83,310,45296,1,0,1:0:0:0: -114,205,45461,1,8,0:0:0:0: -10,229,45626,1,0,0:0:0:0: -106,176,45791,6,0,P|113:133|108:85,1,90,0|0,1:0|0:0,0:0:0:0: -204,136,46120,1,8,0:0:0:0: -256,40,46285,1,0,0:0:0:0: -256,40,46368,1,0,0:0:0:0: -256,40,46450,2,0,L|356:44,1,90,0|0,0:0|1:0,0:0:0:0: -501,124,46780,2,0,L|412:128,1,90,8|0,0:0|0:0,0:0:0:0: -324,192,47109,5,0,1:0:0:0: -356,296,47274,1,0,0:0:0:0: -284,216,47439,1,8,0:0:0:0: -269,323,47604,1,0,1:0:0:0: -237,220,47769,1,0,0:0:0:0: -178,311,47934,1,0,1:0:0:0: -191,203,48098,1,8,0:0:0:0: -99,261,48263,1,0,0:0:0:0: -156,168,48428,6,0,B|176:112|136:64|136:64|200:96,1,180,4|8,1:2|0:0,0:0:0:0: -300,124,48923,2,0,L|392:120,1,90,0|0,0:0|0:0,0:0:0:0: -468,48,49252,1,0,1:0:0:0: -390,120,49417,2,0,P|390:164|406:208,1,90,8|0,0:0|0:0,0:0:0:0: -352,344,49747,6,0,P|352:300|336:256,1,90,4|0,1:2|0:0,0:0:0:0: -240,208,50076,1,8,0:0:0:0: -163,320,50241,2,0,P|207:324|252:316,1,90,0|0,1:0|0:0,0:0:0:0: -240,208,50571,1,0,1:0:0:0: -76,296,50736,2,0,P|76:340|92:384,1,90,8|0,0:0|0:0,0:0:0:0: -312,164,51065,6,0,P|236:124|160:184,1,180,4|8,1:2|0:0,0:0:0:0: -247,297,51560,2,0,L|240:208,1,90,0|0,0:0|0:0,0:0:0:0: -224,48,51890,1,0,1:0:0:0: -332,56,52054,2,0,L|366:58,5,30,8|0|0|0|0|0,0:0|0:0|0:0|0:0|0:0|0:0,0:0:0:0: -408,64,52384,6,0,P|420:108|416:156,1,90,0|0,1:0|0:0,0:0:0:0: -360,260,52714,1,8,0:0:0:0: -247,297,52879,2,0,B|203:281|159:297|159:297|115:313|71:297,1,180,0|0,1:0|1:0,0:0:0:0: -116,196,53373,1,8,0:0:0:0: -120,164,53456,1,0,0:0:0:0: -124,132,53538,1,0,0:0:0:0: -128,100,53620,1,0,0:0:0:0: -132,68,53703,5,4,1:2:0:0: -40,136,53868,1,0,0:0:0:0: -204,160,54032,2,0,L|304:152,1,90,8|0,0:0|0:0,0:0:0:0: -408,64,54362,1,0,0:0:0:0: -408,64,54445,1,0,0:0:0:0: -408,64,54527,2,0,P|404:112|416:160,1,90,0|8,1:0|0:0,0:0:0:0: -484,236,54857,1,0,0:0:0:0: -428,328,55021,5,0,1:0:0:0: -328,296,55186,1,0,0:0:0:0: -328,296,55269,1,0,0:0:0:0: -328,296,55351,1,8,0:0:0:0: -416,300,55516,1,0,1:0:0:0: -472,208,55681,1,0,0:0:0:0: -316,268,55846,1,0,1:0:0:0: -460,180,56010,1,8,0:0:0:0: -304,240,56175,1,0,0:0:0:0: -404,272,56340,5,0,1:0:0:0: -448,152,56505,1,0,0:0:0:0: -448,152,56587,1,0,0:0:0:0: -448,152,56670,2,0,P|456:112|448:60,1,90,8|0,0:0|0:0,0:0:0:0: -268,28,56999,2,0,P|260:68|268:120,1,90,0|0,0:0|1:0,0:0:0:0: -404,272,57329,2,0,P|444:280|496:272,2,90,8|0|0,0:0|0:0|1:0,0:0:0:0: -304,240,57824,5,0,0:0:0:0: -252,336,57988,1,8,0:0:0:0: -196,244,58153,1,0,1:0:0:0: -24,256,58318,1,0,0:0:0:0: -116,200,58483,1,0,1:0:0:0: -136,60,58648,1,8,0:0:0:0: -192,152,58813,1,0,0:0:0:0: -304,240,58977,6,0,P|348:252|396:248,1,90,0|0,1:0|0:0,0:0:0:0: -456,116,59307,2,0,P|412:104|364:108,1,90,8|0,0:0|0:0,0:0:0:0: -273,161,59637,1,0,0:0:0:0: -136,60,59802,1,0,1:0:0:0: -192,152,59966,1,8,0:0:0:0: -23,177,60131,1,0,0:0:0:0: -129,203,60296,5,0,1:0:0:0: -88,304,60461,2,0,P|132:311|176:303,1,90,0|8,0:0|0:0,0:0:0:0: -304,240,60791,1,0,1:0:0:0: -304,240,60873,1,0,0:0:0:0: -304,240,60956,2,0,L|312:288,3,45,0|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -384,256,61285,2,0,L|392:304,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -464,272,61615,5,2,1:2:0:0: -488,168,61780,1,2,0:0:0:0: -428,80,61945,1,10,0:0:0:0: -332,32,62109,2,0,P|288:28|240:36,1,90,2|0,0:0|0:0,0:0:0:0: -28,216,62439,1,2,1:2:0:0: -88,304,62604,1,10,0:0:0:0: -184,352,62769,2,0,P|228:356|276:348,1,90,2|0,0:0|1:0,0:0:0:0: -384,256,63098,6,0,P|409:219|426:174,1,90,2|8,0:0|0:0,0:0:0:0: -428,80,63428,2,0,L|420:36,2,45,2|0|0,1:2|0:0|0:0,0:0:0:0: -456,288,63758,1,2,1:2:0:0: -324,200,63923,1,10,1:2:0:0: -292,204,64005,1,0,1:0:0:0: -260,208,64087,1,2,1:2:0:0: -228,212,64170,1,0,1:0:0:0: -196,216,64252,5,4,1:2:0:0: -104,160,64417,1,0,0:0:0:0: -228,296,64582,2,0,L|320:284,1,90,8|0,0:0|0:0,0:0:0:0: -344,112,64912,1,0,0:0:0:0: -344,112,64994,1,0,0:0:0:0: -344,112,65076,2,0,L|254:123,1,90,0|8,1:0|0:0,0:0:0:0: -144,284,65406,2,0,P|148:328|176:364,1,90,0|0,0:0|1:0,0:0:0:0: -196,216,65736,5,0,0:0:0:0: -196,216,65818,1,0,0:0:0:0: -196,216,65901,2,0,P|155:198|110:205,1,90,8|0,0:0|1:0,0:0:0:0: -36,284,66230,1,0,0:0:0:0: -4,180,66395,1,0,1:0:0:0: -132,24,66560,1,8,0:0:0:0: -100,128,66725,1,0,0:0:0:0: -24,48,66890,5,0,1:0:0:0: -212,108,67054,1,0,0:0:0:0: -212,108,67137,1,0,0:0:0:0: -212,108,67219,2,0,L|300:92,1,90,8|0,0:0|0:0,0:0:0:0: -472,144,67549,2,0,L|384:160,1,90,0|0,0:0|1:0,0:0:0:0: -196,216,67879,2,0,P|240:216|288:240,1,90,8|0,0:0|0:0,0:0:0:0: -324,336,68208,5,0,1:0:0:0: -144,288,68373,1,0,0:0:0:0: -58,170,68538,1,8,0:0:0:0: -196,215,68703,1,0,1:0:0:0: -58,260,68868,1,0,0:0:0:0: -144,142,69032,2,0,L|138:108,2,30,0|0|0,1:0|0:0|0:0,0:0:0:0: -144,142,69197,2,0,P|184:124|232:132,1,90,8|0,0:0|0:0,0:0:0:0: -312,248,69527,6,0,L|324:338,1,90,0|0,1:0|0:0,0:0:0:0: -436,248,69857,1,8,0:0:0:0: -432,216,69939,1,0,0:0:0:0: -428,184,70021,1,0,0:0:0:0: -328,120,70186,1,0,0:0:0:0: -324,152,70269,1,0,0:0:0:0: -320,184,70351,1,0,1:0:0:0: -316,216,70434,1,0,0:0:0:0: -312,248,70516,2,0,L|320:300,1,45,8|0,0:0|0:0,0:0:0:0: -244,340,70681,2,0,L|237:295,1,45,0|0,0:0|0:0,0:0:0:0: -216,224,70846,6,0,P|168:216|124:224,1,90,0|0,1:0|0:0,0:0:0:0: -40,288,71175,1,8,0:0:0:0: -2,95,71340,2,0,P|-4:139|4:184,1,90,0|0,1:0|0:0,0:0:0:0: -164,304,71670,1,0,1:0:0:0: -312,248,71835,1,8,0:0:0:0: -244,340,71999,1,0,0:0:0:0: -216,224,72164,6,0,L|228:132,1,90,0|0,1:0|0:0,0:0:0:0: -332,148,72494,2,0,L|344:56,1,90,8|0,0:0|0:0,0:0:0:0: -312,248,72824,1,0,0:0:0:0: -164,304,72988,1,0,1:0:0:0: -332,336,73153,1,8,0:0:0:0: -360,324,73236,1,0,0:0:0:0: -384,304,73318,1,0,0:0:0:0: -399,276,73401,1,0,0:0:0:0: -403,244,73483,6,0,L|396:200,3,45,4|0|2|0,1:2|0:0|0:0|1:0,0:0:0:0: -420,112,73813,2,0,L|427:68,3,45,2|0|2|0,1:2|0:0|1:2|0:0,0:0:0:0: -352,16,74142,2,0,L|345:60,3,45,0|0|2|0,0:0|1:0|1:2|0:0,0:0:0:0: -332,148,74472,1,2,1:2:0:0: -332,148,74554,1,0,1:0:0:0: -332,148,74637,1,2,1:2:0:0: -332,148,74719,1,0,1:0:0:0: -332,148,74802,6,0,P|360:216|320:312,1,180,4|2,1:2|0:3,0:0:0:0: -190,310,75296,2,0,P|151:231|180:148,1,180,4|0,1:2|0:0,0:0:0:0: -256,56,75791,1,0,0:0:0:0: -332,148,75956,1,2,0:3:0:0: -179,148,76120,5,4,1:2:0:0: -336,64,76285,1,4,1:2:0:0: -256,224,76450,1,2,0:3:0:0: -176,64,76615,1,4,1:2:0:0: -256,140,76780,2,0,L|256:324,1,180,2|0,0:0|0:0,0:0:0:0: -364,300,77274,1,2,0:3:0:0: -148,300,77439,6,0,P|104:316|76:356,1,90,4|0,1:2|0:0,0:0:0:0: -24,252,77769,2,0,L|16:208,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -96,212,78098,2,0,L|104:168,3,45,0|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -32,128,78428,2,0,L|24:84,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -104,88,78758,5,2,1:2:0:0: -204,132,78923,1,0,0:0:0:0: -236,124,79005,1,0,0:0:0:0: -268,116,79087,2,0,L|280:68,3,45,8|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -348,100,79417,2,0,L|360:52,3,45,0|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -428,84,79747,1,8,1:2:0:0: -460,76,79829,1,0,1:0:0:0: -492,68,79912,1,0,1:0:0:0: -492,260,80076,6,0,P|400:248|328:296,1,180,4|2,1:2|0:3,0:0:0:0: -144,236,80571,2,0,P|236:248|308:200,1,180,4|0,1:2|0:0,0:0:0:0: -348,100,81065,2,0,P|348:56|336:8,1,90,0|2,0:0|0:3,0:0:0:0: -140,48,81395,5,4,1:2:0:0: -244,68,81560,1,4,1:2:0:0: -144,236,81725,1,2,0:3:0:0: -176,133,81890,1,4,1:2:0:0: -184,304,82054,2,0,P|100:300|68:220,1,180,2|0,0:0|0:0,0:0:0:0: -100,116,82549,1,2,0:3:0:0: -264,244,82714,6,0,L|272:340,1,90,4|0,1:2|0:0,0:0:0:0: -380,316,83043,1,8,0:0:0:0: -396,288,83126,1,0,0:0:0:0: -400,256,83208,1,0,0:0:0:0: -396,224,83291,1,0,0:0:0:0: -380,196,83373,2,0,L|336:176,3,45,0|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -272,148,83703,1,8,0:0:0:0: -256,120,83785,1,0,0:0:0:0: -252,88,83868,1,0,0:0:0:0: -256,56,83950,1,0,0:0:0:0: -272,28,84032,6,0,L|316:8,3,45,2|0|0|0,1:2|0:0|0:0|0:0,0:0:0:0: -360,72,84362,2,0,L|408:72,3,45,8|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -421,149,84692,2,0,L|464:169,3,45,2|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -443,244,85021,2,0,L|473:281,3,45,8|0|0|0,1:2|1:0|0:0|0:0,0:0:0:0: -422,339,85351,6,0,L|240:348,1,180,4|2,1:2|0:3,0:0:0:0: -76,172,85846,2,0,L|255:163,1,180,4|0,1:2|0:0,0:0:0:0: -421,149,86340,2,0,P|435:107|428:56,1,90,0|2,0:0|0:3,0:0:0:0: -228,56,86670,5,4,1:2:0:0: -280,192,86835,1,4,1:2:0:0: -328,96,86999,1,2,0:3:0:0: -180,152,87164,1,4,1:2:0:0: -28,100,87330,2,0,P|16:56|20:8,1,90,2|0,0:0|0:0,0:0:0:0: -0,180,87659,1,0,0:0:0:0: -28,284,87824,1,2,0:3:0:0: -108,352,87988,6,0,P|152:360|196:356,1,90,4|0,1:2|0:0,0:0:0:0: -276,284,88318,1,8,0:0:0:0: -304,272,88401,1,0,0:0:0:0: -336,268,88483,1,0,0:0:0:0: -368,272,88565,1,0,0:0:0:0: -396,284,88648,2,0,L|432:312,1,45,0|0,0:0|0:0,0:0:0:0: -488,252,88813,2,0,L|452:224,1,45,0|0,1:0|0:0,0:0:0:0: -400,164,88977,2,0,L|396:116,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -316,64,89307,6,0,L|320:160,1,90,2|0,1:2|0:0,0:0:0:0: -276,284,89637,1,8,0:0:0:0: -248,296,89719,1,0,0:0:0:0: -216,300,89802,1,0,1:0:0:0: -184,296,89884,1,0,0:0:0:0: -156,284,89966,2,0,L|120:256,1,45,0|0,0:0|0:0,0:0:0:0: -176,200,90131,2,0,L|140:172,1,45,0|0,1:0|0:0,0:0:0:0: -196,116,90296,2,0,L|160:88,3,45,8|0|0|0,1:2|1:0|1:0|0:0,0:0:0:0: -92,44,90626,6,0,P|48:44|24:160,1,180,4|2,1:2|0:3,0:0:0:0: -156,284,91120,2,0,B|200:300|244:284|244:284|288:268|332:284,1,180,4|0,1:2|0:0,0:0:0:0: -176,200,91615,2,0,P|176:156|196:116,1,90,0|2,0:0|0:3,0:0:0:0: -264,28,91945,6,0,L|353:39,1,90,4|0,1:2|1:0,0:0:0:0: -453,159,92274,2,0,L|364:148,1,90,2|4,0:3|1:2,0:0:0:0: -268,196,92604,2,0,P|260:268|328:348,1,180,2|0,0:0|0:0,0:0:0:0: -364,248,93098,1,2,0:3:0:0: -176,200,93263,5,4,1:2:0:0: -72,228,93428,1,0,1:0:0:0: -152,92,93593,1,0,1:0:0:0: -256,64,93758,1,0,1:0:0:0: -336,200,93923,5,0,1:0:0:0: -440,228,94087,1,0,1:0:0:0: -360,92,94252,1,0,1:0:0:0: -256,64,94417,1,0,1:0:0:0: -176,200,94582,5,2,1:2:0:0: -168,228,94664,1,0,1:0:0:0: -168,260,94747,1,0,1:0:0:0: -172,292,94829,1,0,1:0:0:0: -192,316,94912,1,0,1:0:0:0: -220,328,94994,1,0,1:0:0:0: -252,332,95076,1,0,1:0:0:0: -280,320,95159,1,0,1:0:0:0: -300,296,95241,2,0,L|308:248,3,45,2|0|0|0,1:2|1:0|1:0|1:0,0:0:0:0: -312,172,95571,2,0,L|304:127,3,45,0|0|0|0,1:0|1:0|1:0|1:0,0:0:0:0: -256,64,95901,6,0,P|208:56|164:60,1,90,4|0,1:2|0:0,0:0:0:0: -76,116,96230,1,8,0:0:0:0: -60,224,96395,1,0,0:0:0:0: -60,224,96477,1,0,0:0:0:0: -160,184,96642,1,0,0:0:0:0: -160,184,96725,1,0,1:0:0:0: -63,26,96890,2,0,L|76:116,1,90,8|0,0:0|0:0,0:0:0:0: -136,272,97219,5,0,1:0:0:0: -168,268,97302,1,0,0:0:0:0: -200,264,97384,1,0,0:0:0:0: -232,260,97466,1,0,0:0:0:0: -264,256,97549,1,8,0:0:0:0: -384,136,97714,1,0,1:0:0:0: -376,168,97796,1,0,0:0:0:0: -380,200,97879,1,0,0:0:0:0: -392,228,97961,1,0,0:0:0:0: -416,248,98043,2,0,P|464:260|512:260,2,90,0|8|0,1:0|0:0|0:0,0:0:0:0: -231,105,98538,6,0,L|188:116,2,45,0|0|0,1:0|0:0|0:0,0:0:0:0: -376,56,98868,2,0,L|420:64,1,45,8|0,0:0|0:0,0:0:0:0: -384,136,99032,1,0,0:0:0:0: -384,136,99115,2,0,P|340:128|304:92,1,90,0|0,0:0|0:0,0:0:0:0: -303,18,99362,2,0,L|207:26,2,90,0|8|0,1:0|0:0|0:0,0:0:0:0: -452,88,99857,5,0,1:0:0:0: -465,116,99939,1,0,0:0:0:0: -466,147,100021,1,0,0:0:0:0: -456,177,100104,1,0,0:0:0:0: -436,201,100186,2,0,P|416:213|389:216,3,45,8|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -320,188,100516,2,0,P|300:176|273:173,3,45,0|0|0|0,0:0|1:0|1:0|0:0,0:0:0:0: -204,200,100846,2,0,P|192:220|189:247,3,45,8|0|0|0,0:0|0:0|1:0|0:0,0:0:0:0: -188,320,101175,6,0,P|143:322|100:310,1,90,0|0,1:0|0:0,0:0:0:0: -76,292,101423,1,0,0:0:0:0: -76,292,101505,1,8,0:0:0:0: -76,292,101587,2,0,L|72:248,1,45 -12,68,101835,2,0,L|6:24,2,45,0|0|0,0:0|0:0|1:0,0:0:0:0: -104,140,102164,2,0,L|171:132,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -224,124,102494,6,0,P|236:164|232:216,1,90,0|0,1:0|0:0,0:0:0:0: -288,296,102824,1,8,0:0:0:0: -288,296,102906,1,0,0:0:0:0: -288,296,102988,2,0,P|328:284|380:288,1,90,0|0,1:0|0:0,0:0:0:0: -404,304,103236,1,0,0:0:0:0: -424,328,103318,1,0,1:0:0:0: -448,188,103483,2,0,L|440:140,3,45,8|0|0|0,0:0|0:0|0:0|0:0,0:0:0:0: -424,72,103813,5,0,1:0:0:0: -324,112,103977,1,0,0:0:0:0: -324,112,104060,1,0,0:0:0:0: -324,112,104142,2,0,P|280:116|232:104,1,90,8|0,0:0|0:0,0:0:0:0: -160,28,104472,1,0,0:0:0:0: -216,208,104637,1,0,1:0:0:0: -216,208,104719,1,0,0:0:0:0: -216,208,104802,1,8,0:0:0:0: -352,240,104966,1,0,0:0:0:0: -384,244,105049,1,0,0:0:0:0: -416,248,105131,6,0,L|460:240,4,45,0|0|0|0|8,1:0|0:0|0:0|0:0|0:0,0:0:0:0: -272,288,105626,1,0,1:0:0:0: -264,320,105708,1,0,0:0:0:0: -256,352,105791,2,0,L|204:356,5,30,0|0|0|0|0|0,0:0|0:0|0:0|1:0|0:0|0:0,0:0:0:0: -156,332,106120,2,0,L|104:336,5,30,8|0|0|0|0|0,0:0|0:0|0:0|1:0|0:0|0:0,0:0:0:0: -56,312,106450,5,4,1:2:0:0: -4,188,106615,1,0,0:0:0:0: -168,220,106780,2,0,P|127:232|79:228,1,90,8|0,0:0|0:0,0:0:0:0: -112,124,107109,1,0,0:0:0:0: -272,216,107274,2,0,L|264:316,1,90,0|8,1:0|0:0,0:0:0:0: -400,268,107604,1,0,0:0:0:0: -428,132,107769,5,0,1:0:0:0: -428,132,107851,1,0,0:0:0:0: -428,132,107934,1,0,0:0:0:0: -428,132,108016,1,0,0:0:0:0: -428,132,108098,1,8,0:0:0:0: -332,84,108263,2,0,P|288:80|232:88,1,90,0|0,1:0|0:0,0:0:0:0: -112,124,108593,1,0,1:0:0:0: -148,264,108758,1,8,0:0:0:0: -16,236,108923,1,0,0:0:0:0: -264,126,109087,6,0,L|272:216,1,90,0|0,1:0|0:0,0:0:0:0: -452,224,109417,2,0,L|460:320,1,90,8|0,0:0|0:0,0:0:0:0: -360,232,109747,1,0,0:0:0:0: -348,56,109912,1,0,1:0:0:0: -416,140,110076,1,8,0:0:0:0: -256,112,110241,2,0,P|212:120|160:112,1,90,0|0,0:0|1:0,0:0:0:0: -348,56,110571,6,0,L|331:150,1,90,0|8,0:0|0:0,0:0:0:0: -208,328,110901,2,0,L|191:239,1,90,0|0,1:0|0:0,0:0:0:0: -184,216,111148,1,0,1:0:0:0: -178,194,111230,1,0,1:0:0:0: -68,272,111395,1,8,0:0:0:0: -56,136,111560,1,0,1:0:0:0: -178,194,111725,6,0,P|219:203|267:199,1,90,4|0,1:2|0:0,0:0:0:0: -364,148,112054,1,8,0:0:0:0: -384,256,112219,2,0,P|406:291|443:322,1,90,0|0,0:0|0:0,0:0:0:0: -488,224,112549,1,0,1:0:0:0: -304,232,112714,2,0,L|208:224,2,90,8|0|0,0:0|0:0|1:0,0:0:0:0: -208,328,113208,6,0,L|112:320,1,90,0|8,0:0|0:0,0:0:0:0: -26,184,113538,2,0,L|116:192,1,90,0|0,1:0|0:0,0:0:0:0: -304,232,113868,1,0,1:0:0:0: -116,192,114032,1,8,0:0:0:0: -224,132,114197,1,0,0:0:0:0: -208,328,114362,6,0,B|272:360|320:312|320:312|340:368,1,180,4|8,1:2|0:0,0:0:0:0: -304,232,114857,2,0,P|300:184|308:140,1,90,0|0,0:0|0:0,0:0:0:0: -384,64,115186,1,0,1:0:0:0: -307,143,115351,1,8,0:0:0:0: -256,48,115516,1,0,0:0:0:0: -456,24,115681,6,0,B|482:101|420:136|420:136|440:184,1,180,4|8,1:2|0:0,0:0:0:0: -384,64,116175,2,0,P|340:56|296:64,1,90,0|0,1:0|0:0,0:0:0:0: -211,171,116505,1,0,1:0:0:0: -439,181,116670,2,0,L|448:84,1,90,8|0,0:0|0:0,0:0:0:0: -372,296,116999,6,2,L|304:292,1,67.5000025749208,2|0,0:1|0:0,0:0:0:0: -136,252,117329,6,2,P|196:260|212:172,1,168.75,0|0,0:0|0:0,0:0:0:0: -192,148,117659,1,2,0:3:0:0: -164,132,117741,1,2,0:3:0:0: -132,124,117824,1,2,1:3:0:0: -100,132,117906,1,2,0:3:0:0: -72,148,117988,2,0,L|52:56,1,90,2|8,0:3|0:0,0:0:0:0: -36,244,118318,5,0,1:0:0:0: -76,344,118483,1,0,1:0:0:0: -184,352,118648,1,0,1:0:0:0: -244,264,118813,1,0,1:0:0:0: -244,264,118895,1,0,1:0:0:0: -244,264,118977,2,0,L|288:260,3,45,2|0|2|0,1:2|0:0|0:0|0:0,0:0:0:0: -332,328,119307,2,0,L|376:324,3,45,2|0|2|0,1:2|0:0|0:0|0:0,0:0:0:0: -412,252,119637,5,4,1:2:0:0: -256,192,119719,12,0,122274,0:0:0:0: -256,192,140735,6,0,L|228:156,1,45,4|0,1:2|0:0,0:0:0:0: -152,132,141065,2,0,P|129:129|104:136,1,45 -48,192,141395,2,0,P|40:236|52:280,1,90,8|8,0:0|0:0,0:0:0:0: -196,352,142054,6,0,L|308:340,1,90,8|8,0:0|1:2,0:0:0:0: -336,280,142549,1,0,0:0:0:0: -404,324,142713,1,8,0:0:0:0: -404,324,142878,1,8,0:0:0:0: -292,120,143373,5,0,1:0:0:0: -212,104,143538,1,0,0:0:0:0: -140,140,143702,1,0,0:0:0:0: -120,220,143867,1,0,0:0:0:0: -144,296,144032,2,0,P|184:320|228:316,1,90,10|8,0:0|0:0,0:0:0:0: -372,212,144691,6,0,P|327:209|290:232,1,90,10|8,0:0|1:2,0:0:0:0: -348,288,145186,1,0,0:0:0:0: -452,220,145351,1,10,0:0:0:0: -452,220,145516,1,8,0:0:0:0: -328,36,146010,5,2,1:2:0:0: -264,88,146175,1,0,0:0:0:0: -184,108,146340,1,0,0:0:0:0: -104,88,146505,1,0,0:0:0:0: -44,36,146669,1,8,0:0:0:0: -44,36,146999,1,8,0:0:0:0: -44,36,147329,6,0,L|24:84,1,45,8|0,0:0|0:0,0:0:0:0: -52,156,147658,2,0,L|71:204,1,45,8|0,1:2|0:0,0:0:0:0: -144,236,147988,1,8,0:0:0:0: -144,236,148153,1,8,0:0:0:0: -316,64,148647,5,0,1:0:0:0: -380,116,148812,1,0,0:0:0:0: -408,192,148977,1,0,0:0:0:0: -380,268,149142,1,0,0:0:0:0: -316,320,149307,2,0,L|224:316,1,90,10|8,0:0|0:0,0:0:0:0: -64,248,149966,5,10,0:0:0:0: -144,236,150131,1,0,0:0:0:0: -188,168,150296,1,8,1:2:0:0: -192,88,150461,1,0,0:0:0:0: -140,24,150626,2,0,P|120:16|96:20,1,45,10|0,0:0|0:0,0:0:0:0: -260,132,150955,2,0,P|280:140|304:136,1,45,2|0,0:0|0:0,0:0:0:0: -476,48,151285,6,0,L|484:160,1,112.5,4|0,1:2|0:0,0:0:0:0: -464,236,151779,1,0,0:0:0:0: -436,308,151944,2,0,P|380:320|324:308,1,112.5,8|8,0:0|0:0,0:0:0:0: -76,308,152604,6,0,P|132:320|188:308,1,112.5,8|8,0:0|1:2,0:0:0:0: -256,88,153263,1,8,0:0:0:0: -256,168,153428,1,8,0:0:0:0: -256,168,153922,5,4,1:2:0:0: -256,248,154087,1,0,0:0:0:0: -324,128,154252,1,0,0:0:0:0: -188,128,154417,1,0,0:0:0:0: -332,212,154582,2,0,L|388:204,1,56.25,10|0,0:0|0:0,0:0:0:0: -492,152,154911,2,0,L|436:144,1,56.25,8|0,0:0|0:0,0:0:0:0: -324,128,155241,5,10,0:0:0:0: -180,212,155406,1,0,0:0:0:0: -332,212,155571,1,8,1:2:0:0: -188,128,155735,1,0,0:0:0:0: -256,248,155900,1,10,0:0:0:0: -256,248,156065,2,0,L|256:304,2,56.25,0|0|0,0:0|0:0|0:0,0:0:0:0: -180,212,156560,6,0,L|124:204,1,56.25,4|0,1:2|0:0,0:0:0:0: -20,152,156889,2,0,L|76:144,1,56.25,0|0,0:0|0:0,0:0:0:0: -188,128,157219,2,0,P|212:72|192:16,1,112.5,8|8,0:0|0:0,0:0:0:0: -132,72,157713,1,0,0:0:0:0: -180,212,157878,6,0,L|236:208,1,56.25,8|0,0:0|0:0,0:0:0:0: -360,252,158208,2,8,L|304:248,1,56.25,8|0,1:2|0:0,0:0:0:0: -168,292,158538,2,0,L|160:356,2,56.25,8|8|0,0:0|0:0|0:0,0:0:0:0: -180,212,159032,1,0,0:0:0:0: -144,140,159197,6,0,P|104:128|36:148,1,112.5,2|0,1:2|0:0,0:0:0:0: -12,220,159691,1,0,0:0:0:0: -36,296,159856,2,0,P|60:316|92:324,1,56.25,8|0,0:0|0:0,0:0:0:0: -215,264,160186,2,0,P|189:273|168:292,1,56.25,8|0,0:0|0:0,0:0:0:0: -228,344,160516,6,0,L|284:340,1,56.25,10|0,0:0|0:0,0:0:0:0: -328,276,160845,2,0,L|384:272,1,56.25,8|0,1:2|0:0,0:0:0:0: -428,208,161175,1,8,0:0:0:0: -440,128,161340,1,8,0:0:0:0: -400,60,161505,1,2,0:0:0:0: -328,28,161669,1,0,0:0:0:0: -212,76,161834,6,0,P|200:120|208:164,1,90,2|0,1:2|1:0,0:0:0:0: -300,308,162163,2,0,P|312:264|304:220,1,90,2|0,1:2|1:0,0:0:0:0: -140,236,162493,2,0,P|184:248|228:240,1,90,2|0,1:2|1:0,0:0:0:0: -372,148,162823,2,0,P|328:136|284:144,1,90,2|0,1:2|1:0,0:0:0:0: -104,316,163152,5,2,1:2:0:0: -78,297,163235,1,0,1:0:0:0: -60,270,163317,1,0,1:0:0:0: -54,239,163399,1,0,1:0:0:0: -58,207,163482,1,2,1:2:0:0: -74,180,163564,1,0,1:0:0:0: -98,159,163647,1,0,1:0:0:0: -127,149,163729,1,0,1:0:0:0: -158,150,163812,2,0,L|208:160,1,45,2|0,1:2|1:0,0:0:0:0: -344,184,163976,2,0,L|294:194,1,45,0|0,1:0|1:0,0:0:0:0: -140,236,164141,1,4,1:2:0:0: -140,236,164471,6,0,L|232:252,1,90,4|0,1:2|0:0,0:0:0:0: -344,184,164801,1,8,0:0:0:0: -380,284,164965,1,0,0:0:0:0: -368,104,165130,2,0,P|324:104|284:128,1,90,0|0,0:0|1:0,0:0:0:0: -356,360,165460,2,0,P|400:360|440:336,1,90,8|0,0:0|0:0,0:0:0:0: -432,208,165790,5,0,1:0:0:0: -292,260,165954,1,0,0:0:0:0: -344,184,166119,1,8,0:0:0:0: -204,236,166284,1,0,1:0:0:0: -204,236,166366,1,0,0:0:0:0: -204,236,166449,2,0,L|216:328,1,90,0|0,0:0|1:0,0:0:0:0: -120,208,166779,2,0,L|131:118,1,90,8|0,0:0|0:0,0:0:0:0: -204,236,167108,5,0,1:0:0:0: -32,216,167273,1,0,0:0:0:0: -130,118,167438,1,8,0:0:0:0: -110,298,167603,1,0,0:0:0:0: -110,298,167685,1,0,0:0:0:0: -110,298,167768,2,0,L|121:208,1,90,0|0,0:0|1:0,0:0:0:0: -304,40,168097,2,0,L|315:130,1,90,8|0,0:0|0:0,0:0:0:0: -328,236,168427,5,0,1:0:0:0: -184,148,168592,1,0,0:0:0:0: -314,129,168757,1,8,0:0:0:0: -197,254,168921,1,0,1:0:0:0: -197,254,169004,1,0,0:0:0:0: -197,254,169086,2,0,P|220:292|260:312,1,90,0|0,0:0|1:0,0:0:0:0: -409,210,169416,2,0,P|365:211|328:236,1,90,8|0,0:0|0:0,0:0:0:0: -488,232,169746,6,0,P|487:192|464:149,1,90,0|0,1:0|0:0,0:0:0:0: -314,129,170075,1,8,0:0:0:0: -409,210,170240,1,0,0:0:0:0: -332,40,170405,2,0,L|240:36,1,90,0|0,0:0|1:0,0:0:0:0: -68,144,170735,2,0,L|157:140,1,90,8|0,0:0|0:0,0:0:0:0: -314,129,171064,5,0,1:0:0:0: -332,40,171229,1,0,0:0:0:0: -324,216,171394,1,8,0:0:0:0: -306,305,171559,1,0,1:0:0:0: -257,178,171724,1,0,0:0:0:0: -168,160,171888,1,0,1:0:0:0: -384,164,172053,1,8,0:0:0:0: -473,182,172218,1,0,0:0:0:0: -306,305,172383,6,0,L|216:312,1,90,0|0,1:0|0:0,0:0:0:0: -60,172,172713,1,8,0:0:0:0: -120,260,172877,1,0,0:0:0:0: -168,160,173042,2,0,L|172:68,1,90,0|0,0:0|1:0,0:0:0:0: -309,216,173372,2,0,L|306:306,1,90,8|0,0:0|0:0,0:0:0:0: -120,260,173702,5,0,1:0:0:0: -152,256,173784,1,0,1:0:0:0: -184,252,173866,1,0,1:0:0:0: -309,216,174031,1,8,0:0:0:0: -103,168,174196,1,0,1:0:0:0: -135,164,174279,1,0,1:0:0:0: -167,160,174361,1,0,1:0:0:0: -292,124,174526,1,0,1:0:0:0: -87,76,174691,1,8,1:2:0:0: -119,72,174773,1,0,1:0:0:0: -151,68,174855,1,0,1:0:0:0: -276,32,175020,6,0,L|368:40,1,90,0|0,1:0|0:0,0:0:0:0: -448,108,175350,1,8,0:0:0:0: -292,124,175515,1,0,0:0:0:0: -292,124,175597,1,0,0:0:0:0: -292,124,175680,2,0,L|308:216,1,90,0|0,0:0|1:0,0:0:0:0: -328,320,176009,1,8,0:0:0:0: -408,248,176174,1,0,0:0:0:0: -220,300,176339,6,0,P|176:304|128:292,1,90,0|0,1:0|0:0,0:0:0:0: -16,120,176669,1,8,0:0:0:0: -120,152,176834,1,0,1:0:0:0: -120,152,176916,1,0,0:0:0:0: -120,152,176998,2,0,L|124:200,1,45 -212,176,177163,2,0,L|239:215,1,45,0|0,1:0|0:0,0:0:0:0: -292,124,177328,2,0,P|302:79|283:30,1,90,8|0,0:0|0:0,0:0:0:0: -344,192,177658,6,0,P|372:156|376:104,1,90,0|0,1:0|0:0,0:0:0:0: -212,88,177987,1,8,0:0:0:0: -272,228,178152,1,0,0:0:0:0: -272,228,178235,1,0,0:0:0:0: -272,228,178317,1,0,0:0:0:0: -292,124,178482,1,0,1:0:0:0: -180,180,178647,1,8,0:0:0:0: -200,284,178812,1,0,0:0:0:0: -292,124,178976,5,0,1:0:0:0: -288,92,179059,1,0,0:0:0:0: -280,60,179141,2,0,P|248:24|208:14,1,90,0|8,0:0|0:0,0:0:0:0: -22,65,179471,2,0,P|67:71|112:68,1,90,0|0,1:0|0:0,0:0:0:0: -212,88,179801,1,0,1:0:0:0: -22,65,179965,1,8,0:0:0:0: -180,180,180130,5,0,0:0:0:0: -180,180,180213,1,0,0:0:0:0: -180,180,180295,2,0,P|184:224|172:272,1,90,0|0,1:0|0:0,0:0:0:0: -76,216,180625,2,0,P|72:172|84:124,1,90,8|0,0:0|0:0,0:0:0:0: -380,240,180954,2,0,P|384:284|372:332,1,90,0|0,0:0|1:0,0:0:0:0: -276,276,181284,2,0,P|272:232|284:184,1,90,8|0,0:0|0:0,0:0:0:0: -374,129,181614,5,0,1:0:0:0: -300,352,181779,2,0,L|204:348,2,90,0|8|0,0:0|0:0|1:0,0:0:0:0: -448,180,182273,1,2,0:0:0:0: -448,180,182438,1,2,1:2:0:0: -276,276,182603,1,10,0:0:0:0: -276,276,182768,1,2,0:0:0:0: -96,200,182932,6,0,L|88:108,1,90,0|0,1:0|0:0,0:0:0:0: -96,200,183262,1,8,0:0:0:0: -12,68,183427,2,0,P|72:24|164:68,1,180,0|0,0:0|1:0,0:0:0:0: -140,272,183921,2,0,P|92:284|52:271,1,90,8|0,0:0|0:0,0:0:0:0: -176,156,184251,5,0,1:0:0:0: -208,152,184334,1,0,1:0:0:0: -240,148,184416,1,0,1:0:0:0: -308,64,184581,1,8,0:0:0:0: -296,240,184746,1,0,1:0:0:0: -312,268,184828,1,0,1:0:0:0: -336,284,184910,1,0,1:0:0:0: -368,292,184993,1,0,1:0:0:0: -400,288,185075,1,0,1:0:0:0: -464,184,185240,1,8,0:0:0:0: -468,152,185323,1,0,0:0:0:0: -472,120,185405,2,0,L|464:76,1,45,0|0,1:0|1:0,0:0:0:0: -388,96,185570,6,0,P|360:132|316:148,1,90,4|0,1:2|0:0,0:0:0:0: -224,46,185899,2,0,P|268:43|308:63,1,90,8|0,0:0|0:0,0:0:0:0: -296,240,186229,1,0,0:0:0:0: -308,64,186394,1,0,1:0:0:0: -296,240,186559,2,0,L|312:332,1,90,8|0,0:0|0:0,0:0:0:0: -464,184,186888,6,0,P|420:180|372:188,1,90,0|0,1:0|0:0,0:0:0:0: -296,240,187218,1,8,0:0:0:0: -136,292,187383,2,0,P|94:277|54:249,1,90,0|0,1:0|0:0,0:0:0:0: -21,159,187713,1,0,1:0:0:0: -104,8,187877,2,0,L|124:96,1,90,10|0,0:0|0:0,0:0:0:0: -124,96,188207,6,0,P|152:132|196:148,1,90,0|0,1:0|0:0,0:0:0:0: -287,46,188537,2,0,P|243:43|204:63,1,90,8|0,0:0|0:0,0:0:0:0: -216,240,188866,1,2,0:0:0:0: -204,64,189031,1,0,1:0:0:0: -216,240,189196,2,0,L|200:332,1,90,8|0,0:0|0:0,0:0:0:0: -40,240,189526,5,2,1:2:0:0: -128,192,189691,1,0,0:0:0:0: -216,240,189855,1,8,0:0:0:0: -304,192,190020,1,0,1:0:0:0: -392,240,190185,2,0,L|400:332,1,90,2|0,0:0|1:0,0:0:0:0: -464,168,190515,2,0,L|456:76,1,90,8|0,0:0|0:0,0:0:0:0: -392,240,190844,6,0,P|364:272|312:292,1,90,2|0,1:2|0:0,0:0:0:0: -220,140,191174,2,0,P|248:108|296:92,1,90,8|0,0:0|0:0,0:0:0:0: -324,96,191421,1,0,0:0:0:0: -356,104,191504,2,0,L|340:16,1,90,0|0,0:0|1:0,0:0:0:0: -256,276,191834,2,0,L|272:364,1,90,8|0,0:0|0:0,0:0:0:0: -392,240,192163,5,0,1:0:0:0: -356,104,192328,1,0,0:0:0:0: -220,140,192493,1,8,0:0:0:0: -256,276,192658,1,0,1:0:0:0: -305,191,192823,1,0,0:0:0:0: -212,56,192987,1,0,1:0:0:0: -200,220,193152,1,10,0:0:0:0: -200,220,193482,6,0,P|156:228|108:220,1,90,0|0,1:0|0:0,0:0:0:0: -88,116,193812,1,8,0:0:0:0: -16,192,193976,1,0,0:0:0:0: -16,192,194059,1,0,0:0:0:0: -16,192,194141,2,0,L|28:288,1,90,2|0,0:0|1:0,0:0:0:0: -188,309,194471,2,0,L|200:220,1,90,8|0,0:0|0:0,0:0:0:0: -216,112,194801,5,2,1:2:0:0: -216,112,194883,1,0,1:0:0:0: -216,112,194965,1,0,1:0:0:0: -361,25,195130,1,8,0:0:0:0: -294,180,195295,1,0,1:0:0:0: -294,180,195377,1,0,1:0:0:0: -294,180,195460,1,2,0:0:0:0: -256,16,195625,1,0,1:0:0:0: -384,127,195790,1,10,1:2:0:0: -416,132,195872,1,0,1:0:0:0: -448,140,195954,2,0,L|452:84,1,45,0|0,1:0|1:0,0:0:0:0: -416,216,196119,6,0,P|412:264|432:312,1,90,4|0,1:2|0:0,0:0:0:0: -304,268,196449,2,0,P|308:220|288:172,1,90,8|0,0:0|0:0,0:0:0:0: -216,112,196779,2,0,L|120:104,1,90,0|0,0:0|1:0,0:0:0:0: -52,248,197108,2,0,L|141:255,1,90,8|0,0:0|0:0,0:0:0:0: -304,268,197438,5,0,1:0:0:0: -416,216,197603,1,0,0:0:0:0: -408,340,197768,1,8,0:0:0:0: -332,180,197932,1,0,1:0:0:0: -332,180,198015,1,0,0:0:0:0: -332,180,198097,2,0,P|360:140|400:120,1,90,0|0,0:0|1:0,0:0:0:0: -484,284,198427,1,10,0:0:0:0: -304,268,198592,1,2,0:0:0:0: -416,216,198757,6,0,P|428:172|420:124,1,90,2|0,1:2|0:0,0:0:0:0: -344,52,199086,1,8,0:0:0:0: -332,180,199251,1,0,0:0:0:0: -164,236,199416,2,0,P|152:192|160:144,1,90,0|0,0:0|1:0,0:0:0:0: -236,72,199746,1,8,0:0:0:0: -248,200,199910,1,0,0:0:0:0: -156,328,200075,6,0,L|56:320,1,90,2|0,1:2|0:0,0:0:0:0: -164,236,200405,1,8,0:0:0:0: -256,292,200570,2,0,P|300:296|344:284,1,90,0|0,1:0|0:0,0:0:0:0: -432,220,200899,2,0,L|460:308,2,90,0|8|0,1:0|0:0|0:0,0:0:0:0: -392,120,201394,5,4,1:2:0:0: -396,32,201559,1,0,1:0:0:0: -316,72,201724,1,0,1:0:0:0: -256,6,201888,1,0,1:0:0:0: -228,91,202053,1,0,1:0:0:0: -139,87,202218,1,0,1:0:0:0: -179,166,202383,1,0,1:0:0:0: -113,226,202548,1,0,1:0:0:0: -197,253,202713,5,4,1:2:0:0: -193,342,202877,1,0,1:0:0:0: -272,302,203042,1,0,1:0:0:0: -332,367,203207,1,0,1:0:0:0: -359,283,203372,1,2,1:2:0:0: -448,287,203537,1,2,1:2:0:0: -407,208,203702,1,2,1:2:0:0: -472,147,203866,1,2,1:2:0:0: -387,121,204031,5,4,1:2:0:0: -360,100,204114,1,0,1:0:0:0: -344,72,204196,1,0,1:0:0:0: -336,40,204279,1,0,1:0:0:0: -340,8,204361,1,0,1:0:0:0: -316,28,204443,1,0,1:0:0:0: -284,32,204526,1,0,1:0:0:0: -252,28,204608,1,0,1:0:0:0: -228,8,204691,2,0,L|184:20,7,45,4|0|0|0|0|0|0|0,1:2|1:0|1:0|1:0|1:0|1:0|1:0|1:0,0:0:0:0: -112,56,205350,5,4,1:2:0:0: -100,84,205432,1,0,1:0:0:0: -96,116,205515,1,0,1:0:0:0: -100,148,205597,1,0,1:0:0:0: -112,176,205680,1,0,1:0:0:0: -124,204,205762,1,0,1:0:0:0: -128,236,205844,1,0,1:0:0:0: -124,268,205927,1,0,1:0:0:0: -112,296,206009,2,0,L|71:313,3,45,2|0|2|0,1:2|0:0|0:0|0:0,0:0:0:0: -192,312,206339,2,0,L|175:353,3,45,2|0|2|0,1:2|0:0|0:0|0:0,0:0:0:0: -256,264,206669,5,4,1:2:0:0: -256,192,206751,12,0,209306,0:0:0:0: From 08ce2705c6bc8ba9ad2bdd244b6f5b1e927bcd1a Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 14 Nov 2017 08:26:44 +0300 Subject: [PATCH 024/282] Add pending and graveyarded beatmapsets to profile page --- osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs | 4 +++- .../Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs | 3 +-- osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs | 6 ++++-- osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs index 66b2cae892..a66799f404 100644 --- a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs @@ -26,6 +26,8 @@ namespace osu.Game.Online.API.Requests { MostPlayed, Favourite, - RankedAndApproved + RankedAndApproved, + Unranked, + Graveyard } } diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 2607585573..0a86b15504 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps private DirectPanel playing; - public PaginatedBeatmapContainer(BeatmapSetType type, Bindable user, string header, string missing) + public PaginatedBeatmapContainer(BeatmapSetType type, Bindable user, string header, string missing = "None... yet.") : base(user, header, missing) { this.type = type; @@ -27,7 +27,6 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps ItemsPerPage = 6; ItemsContainer.Spacing = new Vector2(panel_padding); - ItemsContainer.Margin = new MarginPadding { Bottom = panel_padding }; } protected override void ShowMore() diff --git a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs index f55de9b83f..3e88795b77 100644 --- a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs +++ b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs @@ -16,8 +16,10 @@ namespace osu.Game.Overlays.Profile.Sections { Children = new[] { - new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps", "None... yet."), - new PaginatedBeatmapContainer(BeatmapSetType.RankedAndApproved, User, "Ranked & Approved Beatmaps", "None... yet."), + new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps"), + new PaginatedBeatmapContainer(BeatmapSetType.RankedAndApproved, User, "Ranked & Approved Beatmaps"), + new PaginatedBeatmapContainer(BeatmapSetType.Unranked, User, "Pending Beatmaps"), + new PaginatedBeatmapContainer(BeatmapSetType.Graveyard, User, "Graveyarded Beatmaps"), }; } } diff --git a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs index b75d1bc4d6..1d4045c379 100644 --- a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs @@ -51,6 +51,7 @@ namespace osu.Game.Overlays.Profile.Sections { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, + Margin = new MarginPadding { Bottom = 10 } }, ShowMoreButton = new OsuHoverContainer { From bd7a6a90f5a4f938727effbebbf253a9f3452445 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 14 Nov 2017 17:43:19 +0900 Subject: [PATCH 025/282] Remove unused fields --- osu.Game/Screens/Menu/Intro.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 0cb343c1ac..d78227920d 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -21,8 +21,6 @@ namespace osu.Game.Screens.Menu { public class Intro : OsuScreen { - private readonly IntroSequence introSequence; - private const string menu_music_beatmap_hash = "3c8b1fcc9434dbb29e2fb613d3b9eada9d7bb6c125ceb32396c3b53437280c83"; /// @@ -43,7 +41,6 @@ namespace osu.Game.Screens.Menu private Bindable menuVoice; private Bindable menuMusic; private Track track; - private readonly ParallaxContainer parallax; [BackgroundDependencyLoader] private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game) From 9344502b7114b8b39bb09013dd381a1245360472 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 14 Nov 2017 18:05:07 +0900 Subject: [PATCH 026/282] More warning fixes --- osu.Desktop/Overlays/VersionManager.cs | 3 ++- osu.Game/Screens/Menu/Intro.cs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index e7c3370354..8c17e18ed8 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -233,7 +233,8 @@ namespace osu.Desktop.Overlays Text = @"Update ready to install. Click to restart!", Activated = () => { - UpdateManager.RestartAppWhenExited(); + // Squirrel returns execution to us after the update process is started, so it's safe to use Wait() here + UpdateManager.RestartAppWhenExited().Wait(); game.GracefullyExit(); return true; } diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index d78227920d..987e29d6d6 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -12,7 +12,6 @@ using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.IO; using osu.Game.Configuration; -using osu.Game.Graphics.Containers; using osu.Game.Screens.Backgrounds; using OpenTK; using OpenTK.Graphics; From 160b988735de65d71a6b5d360bb947dfee8055fe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 Nov 2017 18:51:41 +0900 Subject: [PATCH 027/282] Reduce number of rqeuests to display beatmaps in profile Comes at the cost of losing some information which should be loaded. This will be fixed at the osu-web end. --- .../Beatmaps/PaginatedBeatmapContainer.cs | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 2607585573..aec345e4d8 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -52,24 +52,18 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps if (!s.OnlineBeatmapSetID.HasValue) continue; - var subReq = new GetBeatmapSetRequest(s.OnlineBeatmapSetID.Value); - subReq.Success += b => + var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets)) { Width = 400 }; + ItemsContainer.Add(panel); + + panel.PreviewPlaying.ValueChanged += newValue => { - var panel = new DirectGridPanel(b.ToBeatmapSet(Rulesets)) { Width = 400 }; - ItemsContainer.Add(panel); - - panel.PreviewPlaying.ValueChanged += newValue => + if (newValue) { - if (newValue) - { - if (playing != null && playing != panel) - playing.PreviewPlaying.Value = false; - playing = panel; - } - }; + if (playing != null && playing != panel) + playing.PreviewPlaying.Value = false; + playing = panel; + } }; - - Api.Queue(subReq); } }; From f96f7e696d73f507ea87ad8b952defe5c79bf4cd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 Nov 2017 18:53:09 +0900 Subject: [PATCH 028/282] Tidy up variables a bit --- .../Beatmaps/PaginatedBeatmapContainer.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index aec345e4d8..4840341f2f 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps private readonly BeatmapSetType type; - private DirectPanel playing; + private DirectPanel currentlyPlaying; public PaginatedBeatmapContainer(BeatmapSetType type, Bindable user, string header, string missing) : base(user, header, missing) @@ -55,14 +55,14 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets)) { Width = 400 }; ItemsContainer.Add(panel); - panel.PreviewPlaying.ValueChanged += newValue => + panel.PreviewPlaying.ValueChanged += isPlaying => { - if (newValue) - { - if (playing != null && playing != panel) - playing.PreviewPlaying.Value = false; - playing = panel; - } + if (!isPlaying) return; + + if (currentlyPlaying != null && currentlyPlaying != panel) + currentlyPlaying.PreviewPlaying.Value = false; + + currentlyPlaying = panel; }; } }; From 44671ad9cbfaa1d6ca0d81e83f06a9ecb8608b4d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 Nov 2017 19:03:50 +0900 Subject: [PATCH 029/282] Move common width definition to base class --- osu.Game/Overlays/Direct/DirectGridPanel.cs | 1 + osu.Game/Overlays/DirectOverlay.cs | 2 +- .../Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Direct/DirectGridPanel.cs b/osu.Game/Overlays/Direct/DirectGridPanel.cs index e863f78e3f..a40f20850e 100644 --- a/osu.Game/Overlays/Direct/DirectGridPanel.cs +++ b/osu.Game/Overlays/Direct/DirectGridPanel.cs @@ -29,6 +29,7 @@ namespace osu.Game.Overlays.Direct public DirectGridPanel(BeatmapSetInfo beatmap) : base(beatmap) { + Width = 400; Height = 140 + vertical_padding; //full height of all the elements plus vertical padding (autosize uses the image) } diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index d11f2342cd..6f7fabb910 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -222,7 +222,7 @@ namespace osu.Game.Overlays switch (displayStyle) { case PanelDisplayStyle.Grid: - return new DirectGridPanel(b) { Width = 400 }; + return new DirectGridPanel(b); default: return new DirectListPanel(b); } diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 4840341f2f..983ef004d0 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -52,7 +52,7 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps if (!s.OnlineBeatmapSetID.HasValue) continue; - var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets)) { Width = 400 }; + var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets)); ItemsContainer.Add(panel); panel.PreviewPlaying.ValueChanged += isPlaying => From 6933a41b7504404785625f22be86fad35bf402f1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2017 13:26:02 +0900 Subject: [PATCH 030/282] Add back high resolution cover regressions --- osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs b/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs index 2b9418d6ae..b38f74b3f7 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using Newtonsoft.Json; namespace osu.Game.Beatmaps { @@ -60,14 +61,17 @@ namespace osu.Game.Beatmaps { public string CoverLowRes { get; set; } + [JsonProperty(@"cover@2x")] public string Cover { get; set; } public string CardLowRes { get; set; } + [JsonProperty(@"card@2x")] public string Card { get; set; } public string ListLowRes { get; set; } + [JsonProperty(@"list@2x")] public string List { get; set; } } } From a30cf27506687abc7cf8a7ad2deacbfd2f6f2cc5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2017 13:15:20 +0900 Subject: [PATCH 031/282] Fix incorrect json mapping for preview urls --- osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs b/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs index 45f6d84784..fa053d6418 100644 --- a/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs +++ b/osu.Game/Online/API/Requests/GetBeatmapSetsResponse.cs @@ -15,7 +15,7 @@ namespace osu.Game.Online.API.Requests [JsonProperty(@"covers")] private BeatmapSetOnlineCovers covers { get; set; } - [JsonProperty(@"previewUrl")] + [JsonProperty(@"preview_url")] private string preview { get; set; } [JsonProperty(@"play_count")] From ea2fa5fa00d4c467a0a3d2e34ea35f765ea1a2e3 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 15 Nov 2017 09:48:40 +0300 Subject: [PATCH 032/282] Fix wrong ratings calculations --- .../Visual/TestCaseBeatmapDetails.cs | 4 ++-- .../Visual/TestCaseBeatmapSetOverlay.cs | 20 +++++++++---------- .../Screens/Select/Details/UserRatings.cs | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs index 5306121a92..b31eded9a0 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs @@ -39,7 +39,7 @@ namespace osu.Game.Tests.Visual StarDifficulty = 5.3f, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, @@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual StarDifficulty = 4.8f, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), }, }); diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs index 2226dbf9e9..c2de4ec05d 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs @@ -83,7 +83,7 @@ namespace osu.Game.Tests.Visual }, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, @@ -110,7 +110,7 @@ namespace osu.Game.Tests.Visual }, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, @@ -137,7 +137,7 @@ namespace osu.Game.Tests.Visual }, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, @@ -164,7 +164,7 @@ namespace osu.Game.Tests.Visual }, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, @@ -191,7 +191,7 @@ namespace osu.Game.Tests.Visual }, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, @@ -253,7 +253,7 @@ namespace osu.Game.Tests.Visual }, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, @@ -280,7 +280,7 @@ namespace osu.Game.Tests.Visual }, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, @@ -307,7 +307,7 @@ namespace osu.Game.Tests.Visual }, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, @@ -334,7 +334,7 @@ namespace osu.Game.Tests.Visual }, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, @@ -361,7 +361,7 @@ namespace osu.Game.Tests.Visual }, Metrics = new BeatmapMetrics { - Ratings = Enumerable.Range(0, 10), + Ratings = Enumerable.Range(0, 11), Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6), }, diff --git a/osu.Game/Screens/Select/Details/UserRatings.cs b/osu.Game/Screens/Select/Details/UserRatings.cs index db6d932464..2153eb150c 100644 --- a/osu.Game/Screens/Select/Details/UserRatings.cs +++ b/osu.Game/Screens/Select/Details/UserRatings.cs @@ -30,9 +30,9 @@ namespace osu.Game.Screens.Select.Details metrics = value; var ratings = Metrics.Ratings.ToList(); - negativeRatings.Text = ratings.GetRange(0, ratings.Count / 2).Sum().ToString(); - positiveRatings.Text = ratings.GetRange(ratings.Count / 2, ratings.Count / 2).Sum().ToString(); - ratingsBar.Length = (float)ratings.GetRange(0, ratings.Count / 2).Sum() / ratings.Sum(); + negativeRatings.Text = ratings.GetRange(0, ratings.Count / 2 + 1).Sum().ToString(); + positiveRatings.Text = ratings.GetRange(ratings.Count / 2 + 1, ratings.Count / 2).Sum().ToString(); + ratingsBar.Length = (float)ratings.GetRange(0, ratings.Count / 2 + 1).Sum() / ratings.Sum(); graph.Values = Metrics.Ratings.Select(r => (float)r); } } From 093ebb8b17114302ae4cd3e716557b7aac0da8f0 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 15 Nov 2017 10:21:07 +0300 Subject: [PATCH 033/282] Apply suggested changes --- .../BeatmapSet/Scores/ClickableUsername.cs | 4 +- .../BeatmapSet/Scores/DrawableScore.cs | 28 ++++----- .../BeatmapSet/Scores/DrawableTopScore.cs | 58 ++++++++----------- .../BeatmapSet/Scores/ScoresContainer.cs | 43 ++++++-------- 4 files changed, 56 insertions(+), 77 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs index ab828cf0eb..bbb4ef767c 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs @@ -18,6 +18,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores private User user; public User User { + get { return user; } set { if (user == value) return; @@ -25,7 +26,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores text.Text = user.Username; } - get { return user; } } public float TextSize @@ -56,7 +56,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores protected override bool OnClick(InputState state) { profile?.ShowUser(user); - return base.OnClick(state); + return true; } } } diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs index 2b1cdf5c25..5a3aba7b43 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -21,10 +21,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores public class DrawableScore : Container { private const int fade_duration = 100; - private const float height = 30; private const float side_margin = 20; - private const float flag_margin = 60; - private const float username_margin = 100; private readonly Box background; @@ -33,7 +30,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores ScoreModsContainer modsContainer; RelativeSizeAxes = Axes.X; - Height = height; + Height = 30; CornerRadius = 3; Masking = true; Children = new Drawable[] @@ -55,16 +52,15 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Width = 30, - Height = 20, - Margin = new MarginPadding { Left = flag_margin } + Size = new Vector2(30, 20), + Margin = new MarginPadding { Left = 60 } }, new ClickableUsername { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, User = score.User, - Margin = new MarginPadding { Left = username_margin } + Margin = new MarginPadding { Left = 100 } }, modsContainer = new ScoreModsContainer { @@ -72,16 +68,15 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Width = 0.05f, + Width = 0.06f, RelativePositionAxes = Axes.X, - X = 0.45f + X = 0.42f }, new DrawableRank(score.Rank) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Width = 30, - Height = 20, + Size = new Vector2(30, 20), FillMode = FillMode.Fit, RelativePositionAxes = Axes.X, X = 0.55f @@ -90,10 +85,11 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreRight, - Text = $@"{score.TotalScore}", - Font = @"Exo2.0-MediumItalic", + Text = $@"{score.TotalScore:N0}", + Font = @"Venera", RelativePositionAxes = Axes.X, - X = 0.7f + X = 0.75f, + FixedWidth = true, }, new OsuSpriteText { @@ -102,7 +98,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Text = $@"{score.Accuracy:P2}", Font = @"Exo2.0-RegularItalic", RelativePositionAxes = Axes.X, - X = 0.8f + X = 0.85f }, new OsuSpriteText { diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs index 665a563e6e..e3a0a9d613 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs @@ -45,14 +45,29 @@ namespace osu.Game.Overlays.BeatmapSet.Scores private OnlineScore score; public OnlineScore Score { + get { return score; } set { if (score == value) return; score = value; - setScore(); + avatar.User = username.User = score.User; + flag.FlagName = score.User.Country?.FlagName; + date.Text = $@"achieved {score.Date:MMM d, yyyy}"; + rank.UpdateRank(score.Rank); + + totalScore.Value = $@"{score.TotalScore:N0}"; + accuracy.Value = $@"{score.Accuracy:P2}"; + statistics.Value = $"{score.Statistics["300"]}/{score.Statistics["100"]}/{score.Statistics["50"]}"; + + modsContainer.Clear(); + foreach (Mod mod in score.Mods) + modsContainer.Add(new ModIcon(mod) + { + AutoSizeAxes = Axes.Both, + Scale = new Vector2(0.45f), + }); } - get { return score; } } public DrawableTopScore() @@ -86,18 +101,14 @@ namespace osu.Game.Overlays.BeatmapSet.Scores }, flag = new DrawableFlag { - Width = 30, - Height = 20, - Y = height / 4, - X = height / 2, + Size = new Vector2(30, 20), + Position = new Vector2(height / 2, height / 4), }, username = new ClickableUsername { Origin = Anchor.BottomLeft, TextSize = 30, - Y = height / 4, - X = height / 2, - Margin = new MarginPadding { Bottom = 4 }, + Position = new Vector2(height / 2, avatar_size / 2), }, rankText = new OsuSpriteText { @@ -133,8 +144,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores rank = new DrawableRank(ScoreRank.F) { Origin = Anchor.BottomLeft, - Width = avatar_size, - Height = 40, + Size = new Vector2(avatar_size, 40), FillMode = FillMode.Fit, Y = height / 4, Margin = new MarginPadding { Left = margin } @@ -143,8 +153,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { Origin = Anchor.BottomLeft, AutoSizeAxes = Axes.Both, - X = height / 2, - Y = height / 4, + Position = new Vector2(height / 2, height / 4), Direction = FillDirection.Horizontal, Spacing = new Vector2(15, 0), Children = new[] @@ -158,8 +167,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { AutoSizeAxes = Axes.Y, Width = 80, - X = height / 2, - Y = height / 4, + Position = new Vector2(height / 2, height / 4), } } }, @@ -175,26 +183,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores BorderColour = rankText.Colour = colours.Yellow; } - private void setScore() - { - avatar.User = username.User = score.User; - flag.FlagName = score.User.Country?.FlagName; - date.Text = $@"achieved {score.Date:MMM d, yyyy}"; - rank.UpdateRank(score.Rank); - - totalScore.Value = $@"{score.TotalScore}"; - accuracy.Value = $@"{score.Accuracy:P2}"; - statistics.Value = $"{score.Statistics["300"]}/{score.Statistics["100"]}/{score.Statistics["50"]}"; - - modsContainer.Clear(); - foreach (Mod mod in score.Mods) - modsContainer.Add(new ModIcon(mod) - { - AutoSizeAxes = Axes.Both, - Scale = new Vector2(0.45f), - }); - } - protected override bool OnHover(InputState state) { background.FadeIn(fade_duration, Easing.OutQuint); diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 2bbfa0f56a..4b496ed118 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -27,6 +27,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores private bool isLoading; public bool IsLoading { + get { return isLoading; } set { if (isLoading == value) return; @@ -35,18 +36,33 @@ namespace osu.Game.Overlays.BeatmapSet.Scores foreground.FadeTo(isLoading ? 1 : 0, fade_duration); loadingAnimation.FadeTo(isLoading ? 1 : 0, fade_duration); } - get { return isLoading; } } private IEnumerable scores; public IEnumerable Scores { + get { return scores; } set { scores = value; - updateScores(); + var scoresAmount = scores.Count(); + if (scoresAmount == 0) + { + CleanAllScores(); + return; + } + + topScore.Score = scores.FirstOrDefault(); + topScore.Show(); + + flow.Clear(); + + if (scoresAmount < 2) + return; + + for (int i = 1; i < scoresAmount; i++) + flow.Add(new DrawableScore(i, scores.ElementAt(i))); } - get { return scores; } } public ScoresContainer() @@ -90,27 +106,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores }; } - private void updateScores() - { - var scoresAmount = scores.Count(); - if (scoresAmount == 0) - { - CleanAllScores(); - return; - } - - topScore.Score = scores.FirstOrDefault(); - topScore.Show(); - - flow.Clear(); - - if (scoresAmount < 2) - return; - - for (int i = 1; i < scoresAmount; i++) - flow.Add(new DrawableScore(i, scores.ElementAt(i))); - } - public void CleanAllScores() { topScore.Hide(); From 60a2d84e09fedab1bd2c969242950e1e63d69f19 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 15 Nov 2017 10:43:32 +0300 Subject: [PATCH 034/282] Make the x position depends on the avatar size --- osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs index e3a0a9d613..833ed94c0f 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs @@ -102,13 +102,14 @@ namespace osu.Game.Overlays.BeatmapSet.Scores flag = new DrawableFlag { Size = new Vector2(30, 20), - Position = new Vector2(height / 2, height / 4), + Position = new Vector2(margin * 2 + avatar_size, height / 4), }, username = new ClickableUsername { Origin = Anchor.BottomLeft, TextSize = 30, - Position = new Vector2(height / 2, avatar_size / 2), + Position = new Vector2(margin * 2 + avatar_size, height / 4), + Margin = new MarginPadding { Bottom = 4 } }, rankText = new OsuSpriteText { From 8a407a68b3e94f438cc8fea88a319b8db326370f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2017 18:48:37 +0900 Subject: [PATCH 035/282] Ensure only one information overlay is open at once --- osu.Game/OsuGame.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index fc5b607810..e603375e9c 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -255,6 +255,22 @@ namespace osu.Game }; } + // eventually informational overlays should be displayed in a stack, but for now let's only allow one to stay open at a time. + var informationalOverlays = new OverlayContainer[] { beatmapSetOverlay, userProfile }; + foreach (var overlay in informationalOverlays) + { + overlay.StateChanged += state => + { + if (state == Visibility.Hidden) return; + + foreach (var c in informationalOverlays) + { + if (c == overlay) continue; + c.State = Visibility.Hidden; + } + }; + } + settings.StateChanged += delegate { switch (settings.State) From af03d883f168fbc3244fe7f51a4ad24307dbc4bb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2017 19:01:30 +0900 Subject: [PATCH 036/282] Ensure overlay containers scroll to top when new information is presented --- osu.Game/Graphics/Containers/SectionsContainer.cs | 2 ++ osu.Game/Overlays/BeatmapSetOverlay.cs | 5 ++++- osu.Game/Overlays/UserProfileOverlay.cs | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/SectionsContainer.cs b/osu.Game/Graphics/Containers/SectionsContainer.cs index 6e5c3c8183..1e2826189b 100644 --- a/osu.Game/Graphics/Containers/SectionsContainer.cs +++ b/osu.Game/Graphics/Containers/SectionsContainer.cs @@ -139,6 +139,8 @@ namespace osu.Game.Graphics.Containers public void ScrollTo(Drawable section) => scrollContainer.ScrollTo(scrollContainer.GetChildPosInContent(section) - (FixedHeader?.BoundingBox.Height ?? 0)); + public void ScrollToTop() => scrollContainer.ScrollTo(0); + private float lastKnownScroll; protected override void UpdateAfterChildren() { diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index ddd146bcb6..940ac433fc 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -30,6 +30,8 @@ namespace osu.Game.Overlays private APIAccess api; private RulesetStore rulesets; + private readonly ScrollContainer scroll; + // receive input outside our bounds so we can trigger a close event on ourselves. public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; @@ -61,7 +63,7 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.2f) }, - new ScrollContainer + scroll = new ScrollContainer { RelativeSizeAxes = Axes.Both, ScrollbarVisible = false, @@ -120,6 +122,7 @@ namespace osu.Game.Overlays { header.BeatmapSet = info.BeatmapSet = set; Show(); + scroll.ScrollTo(0); } } } diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index ce35f7e547..dd31a43290 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -164,6 +164,7 @@ namespace osu.Game.Overlays } Show(); + sectionsContainer.ScrollToTop(); } private void userLoadComplete(User user) From fda810eb8fc288b085670a18f2091da812c3122f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2017 19:02:56 +0900 Subject: [PATCH 037/282] Remove scrollability from sub-areas in beatmap overaly The areas that are scrollable inside the beatmap overlay make for a very frustrating experience. Let's disable them for now. --- osu.Game/Overlays/BeatmapSet/Info.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs index 4a59591a72..bd108a193b 100644 --- a/osu.Game/Overlays/BeatmapSet/Info.cs +++ b/osu.Game/Overlays/BeatmapSet/Info.cs @@ -74,20 +74,18 @@ namespace osu.Game.Overlays.BeatmapSet { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Right = metadata_width + BeatmapSetOverlay.RIGHT_WIDTH + spacing * 2 }, - Child = new ScrollContainer + Child = new Container { RelativeSizeAxes = Axes.Both, - ScrollbarVisible = false, Child = description = new MetadataSection("Description"), }, }, - new ScrollContainer + new Container { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Y, Width = metadata_width, - ScrollbarVisible = false, Padding = new MarginPadding { Horizontal = 10 }, Margin = new MarginPadding { Right = BeatmapSetOverlay.RIGHT_WIDTH + spacing }, Child = new FillFlowContainer From 801104854092a5677e4531e7fb514b98801ee8c1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2017 20:03:18 +0900 Subject: [PATCH 038/282] Fix hard crash when clicking play button with no map selected Resolves #1507. --- osu.Game/Screens/Play/Player.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 675d20fe63..3e57e18963 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -231,6 +231,8 @@ namespace osu.Game.Screens.Play private void applyRateFromMods() { + if (adjustableSourceClock == null) return; + adjustableSourceClock.Rate = 1; foreach (var mod in Beatmap.Value.Mods.Value.OfType()) mod.ApplyToClock(adjustableSourceClock); From bbe555dc3cd2a19ede0a58a80e171ed4cca22fd8 Mon Sep 17 00:00:00 2001 From: naoey Date: Wed, 15 Nov 2017 17:49:41 +0530 Subject: [PATCH 039/282] Pass noVideo flag on... --- osu.Game/Overlays/BeatmapSet/Header.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 0cfa7be81a..f9998dcca2 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -228,7 +228,7 @@ namespace osu.Game.Overlays.BeatmapSet this.beatmaps = beatmaps; } - private void download(bool video) + private void download(bool noVideo) { if (beatmaps.GetExistingDownload(BeatmapSet) != null) { @@ -240,7 +240,7 @@ namespace osu.Game.Overlays.BeatmapSet return; } - beatmaps.Download(BeatmapSet); + beatmaps.Download(BeatmapSet, noVideo); } } } From df53b884eabe7025b8e46b879ce76274a6f28b43 Mon Sep 17 00:00:00 2001 From: naoey Date: Wed, 15 Nov 2017 17:58:02 +0530 Subject: [PATCH 040/282] Removed unused stuff. --- osu.Game/Overlays/BeatmapSet/Header.cs | 2 -- osu.Game/Overlays/BeatmapSetOverlay.cs | 2 -- osu.Game/Overlays/Direct/DirectPanel.cs | 7 +------ 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index f9998dcca2..ed72cf0cc9 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -38,8 +38,6 @@ namespace osu.Game.Overlays.BeatmapSet public readonly BeatmapPicker Picker; - private bool isDownloading => beatmaps.GetExistingDownload(BeatmapSet) != null; - private BeatmapSetInfo beatmapSet; public BeatmapSetInfo BeatmapSet { diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 1173390d57..7ae2d323b8 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -31,7 +31,6 @@ namespace osu.Game.Overlays private APIAccess api; private RulesetStore rulesets; - private BeatmapManager manager; private readonly ScrollContainer scroll; @@ -92,7 +91,6 @@ namespace osu.Game.Overlays { this.api = api; this.rulesets = rulesets; - this.manager = manager; manager.BeatmapSetAdded += beatmap => { diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 702aef7417..d4f4067fca 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -16,7 +16,6 @@ using osu.Game.Graphics.Sprites; using OpenTK.Graphics; using osu.Framework.Input; using osu.Game.Graphics.UserInterface; -using osu.Game.Online.API; using osu.Framework.Logging; using osu.Game.Online.API.Requests; using osu.Framework.Configuration; @@ -34,10 +33,8 @@ namespace osu.Game.Overlays.Direct private Container content; - private APIAccess api; private ProgressBar progressBar; private BeatmapManager beatmaps; - private NotificationOverlay notifications; private BeatmapSetOverlay beatmapSetOverlay; public Track Preview => PlayButton.Preview; @@ -70,11 +67,9 @@ namespace osu.Game.Overlays.Direct [BackgroundDependencyLoader(permitNulls: true)] - private void load(APIAccess api, BeatmapManager beatmaps, OsuColour colours, NotificationOverlay notifications, BeatmapSetOverlay beatmapSetOverlay) + private void load(BeatmapManager beatmaps, OsuColour colours, BeatmapSetOverlay beatmapSetOverlay) { - this.api = api; this.beatmaps = beatmaps; - this.notifications = notifications; this.beatmapSetOverlay = beatmapSetOverlay; AddInternal(content = new Container From f912744acce1aae5f70ed77e5576f0008aafe081 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 16 Nov 2017 00:15:27 +0900 Subject: [PATCH 041/282] Fix sizing of ModIcon --- osu.Game/Overlays/Mods/ModButton.cs | 3 --- .../Profile/Sections/Ranks/DrawableScore.cs | 6 +----- osu.Game/Rulesets/UI/ModIcon.cs | 14 ++++++++------ osu.Game/Screens/Play/HUD/ModDisplay.cs | 6 +----- .../Select/Leaderboards/LeaderboardScore.cs | 6 +----- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index 6bfe70d873..0ead4ea019 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -207,14 +207,12 @@ namespace osu.Game.Overlays.Mods { Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, - AutoSizeAxes = Axes.Both, Position = new Vector2(1.5f), }, foregroundIcon = new ModIcon(Mods[0]) { Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, - AutoSizeAxes = Axes.Both, Position = new Vector2(-1.5f), }, }); @@ -225,7 +223,6 @@ namespace osu.Game.Overlays.Mods { Origin = Anchor.Centre, Anchor = Anchor.Centre, - AutoSizeAxes = Axes.Both, }); } } diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs index 5088fe5f67..35f4778047 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs @@ -163,11 +163,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks }); foreach (Mod mod in Score.Mods) - modsContainer.Add(new ModIcon(mod) - { - AutoSizeAxes = Axes.Both, - Scale = new Vector2(0.5f), - }); + modsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.5f) }); } protected override bool OnClick(InputState state) => true; diff --git a/osu.Game/Rulesets/UI/ModIcon.cs b/osu.Game/Rulesets/UI/ModIcon.cs index 7f7068d341..5ca3d9521b 100644 --- a/osu.Game/Rulesets/UI/ModIcon.cs +++ b/osu.Game/Rulesets/UI/ModIcon.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.UI private readonly SpriteIcon modIcon; private readonly SpriteIcon background; - private const float background_size = 80; + private const float size = 80; public FontAwesome Icon { @@ -38,23 +38,25 @@ namespace osu.Game.Rulesets.UI TooltipText = mod.Name; + Size = new Vector2(size); + Children = new Drawable[] { background = new SpriteIcon { Origin = Anchor.Centre, Anchor = Anchor.Centre, - Size = new Vector2(background_size), + Size = new Vector2(size), Icon = FontAwesome.fa_osu_mod_bg, + Y = -6.5f, Shadow = true, }, modIcon = new SpriteIcon { - Origin = Anchor.TopCentre, - Anchor = Anchor.TopCentre, + Origin = Anchor.Centre, + Anchor = Anchor.Centre, Colour = OsuColour.Gray(84), - Size = new Vector2(background_size - 35), - Y = 25, + Size = new Vector2(size - 35), Icon = mod.Icon }, }; diff --git a/osu.Game/Screens/Play/HUD/ModDisplay.cs b/osu.Game/Screens/Play/HUD/ModDisplay.cs index 18a3096d7c..fd0e71ece8 100644 --- a/osu.Game/Screens/Play/HUD/ModDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ModDisplay.cs @@ -55,11 +55,7 @@ namespace osu.Game.Screens.Play.HUD iconsContainer.Clear(); foreach (Mod mod in mods) { - iconsContainer.Add(new ModIcon(mod) - { - AutoSizeAxes = Axes.Both, - Scale = new Vector2(0.6f), - }); + iconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) }); } if (IsLoaded) diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index de381cd2dc..9044938a75 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -264,11 +264,7 @@ namespace osu.Game.Screens.Select.Leaderboards foreach (Mod mod in Score.Mods) { - modsContainer.Add(new ModIcon(mod) - { - AutoSizeAxes = Axes.Both, - Scale = new Vector2(0.375f) - }); + modsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.375f) }); } } From f461f03b0857ac2a7fd5e3e92abb67fd5a3916b7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 16 Nov 2017 14:51:31 +0900 Subject: [PATCH 042/282] Make osu! compile with framework changes --- osu-framework | 2 +- osu.Desktop/OsuGameDesktop.cs | 4 ++-- osu.Desktop/osu.Desktop.csproj | 3 +-- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 3 +-- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 3 +-- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 3 +-- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 3 +-- osu.Game.Tests/osu.Game.Tests.csproj | 3 +-- osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarUserArea.cs | 1 + osu.Game/osu.Game.csproj | 3 +-- 11 files changed, 12 insertions(+), 18 deletions(-) diff --git a/osu-framework b/osu-framework index c95b9350ed..aa7fb2f83c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit c95b9350edb6305cfefdf08f902f6f73d336736b +Subproject commit aa7fb2f83c5883a23eca0f5799905669fa6cead3 diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 3393bbf7fb..60d70e1ece 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -100,7 +100,7 @@ namespace osu.Desktop { desktopWindow.CursorState |= CursorState.Hidden; - desktopWindow.Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico")); + // desktopWindow.Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico")); desktopWindow.Title = Name; desktopWindow.FileDrop += fileDrop; @@ -109,7 +109,7 @@ namespace osu.Desktop private void fileDrop(object sender, FileDropEventArgs e) { - var filePaths = new [] { e.FileName }; + var filePaths = new[] { e.FileName }; if (filePaths.All(f => Path.GetExtension(f) == @".osz")) Task.Factory.StartNew(() => BeatmapManager.Import(filePaths), TaskCreationOptions.LongRunning); diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 91c0da6f65..dd328858e0 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -136,8 +136,7 @@ $(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\NuGet.Squirrel.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index a666984b95..0c61a5b312 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -37,8 +37,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 6f45a64d92..edc77f5c7b 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -37,8 +37,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 3c90749777..3939b3f108 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -38,8 +38,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index bf627d205a..868460e3d6 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -37,8 +37,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 974bde9319..3d134f79bf 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -34,8 +34,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 56b9a55398..4e7712936a 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -18,7 +18,7 @@ using System.ComponentModel; using osu.Game.Graphics; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; - +using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; using Container = osu.Framework.Graphics.Containers.Container; namespace osu.Game.Overlays.Settings.Sections.General diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs index 95a25fcb86..7683406b49 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using OpenTK; +using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; namespace osu.Game.Overlays.Toolbar { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ac1498c9d9..6ef8f6570d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -143,8 +143,7 @@ $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True - - $(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll + True From 97c5956083779edfcb8d5c8ac9b5b6e4b5b2bdee Mon Sep 17 00:00:00 2001 From: naoey Date: Thu, 16 Nov 2017 15:36:22 +0530 Subject: [PATCH 043/282] Make download buttons disappear instead of closing overlay. - Also unbind event handlers - Remove unused field --- osu.Game/Overlays/BeatmapSet/Header.cs | 15 +++++++++++++++ osu.Game/Overlays/BeatmapSetOverlay.cs | 12 ++---------- osu.Game/Overlays/Direct/DirectPanel.cs | 6 ++++++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index ed72cf0cc9..27ef6208be 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -51,6 +51,7 @@ namespace osu.Game.Overlays.BeatmapSet title.Text = BeatmapSet.Metadata.Title; artist.Text = BeatmapSet.Metadata.Artist; + downloadButtonsContainer.FadeIn(); noVideoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 0 : 1, transition_duration); videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); @@ -224,6 +225,20 @@ namespace osu.Game.Overlays.BeatmapSet { tabsBg.Colour = colours.Gray3; this.beatmaps = beatmaps; + + beatmaps.BeatmapSetAdded += handleBeatmapAdd; + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + beatmaps.BeatmapSetAdded -= handleBeatmapAdd; + } + + private void handleBeatmapAdd(BeatmapSetInfo beatmap) + { + if (beatmap.OnlineBeatmapSetID == BeatmapSet.OnlineBeatmapSetID) + downloadButtonsContainer.FadeOut(transition_duration); } private void download(bool noVideo) diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 7ae2d323b8..940ac433fc 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -24,8 +24,6 @@ namespace osu.Game.Overlays public const float X_PADDING = 40; public const float RIGHT_WIDTH = 275; - private BeatmapSetInfo currentBeatmap; - private readonly Header header; private readonly Info info; @@ -87,16 +85,10 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(APIAccess api, RulesetStore rulesets, BeatmapManager manager) + private void load(APIAccess api, RulesetStore rulesets) { this.api = api; this.rulesets = rulesets; - - manager.BeatmapSetAdded += beatmap => - { - if (beatmap.OnlineBeatmapSetID == currentBeatmap.OnlineBeatmapSetID) - Hide(); - }; } protected override void PopIn() @@ -128,7 +120,7 @@ namespace osu.Game.Overlays public void ShowBeatmapSet(BeatmapSetInfo set) { - currentBeatmap = header.BeatmapSet = info.BeatmapSet = set; + header.BeatmapSet = info.BeatmapSet = set; Show(); scroll.ScrollTo(0); } diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index d4f4067fca..b8a8528962 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -107,6 +107,12 @@ namespace osu.Game.Overlays.Direct beatmaps.BeatmapDownloadBegan += attachDownload; } + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + beatmaps.BeatmapDownloadBegan -= attachDownload; + } + protected override void Update() { base.Update(); From 6c40cf08cce811707cadc5c8e68c6e7d4fe3bc60 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 16 Nov 2017 21:29:07 +0900 Subject: [PATCH 044/282] Optimise leaderboard display Adds async loading support and cleans up the code quite a bit in the process. --- .../Graphics/Containers/OsuScrollContainer.cs | 2 +- .../Select/Leaderboards/Leaderboard.cs | 62 +++++---- .../Select/Leaderboards/LeaderboardScore.cs | 130 +++++++----------- 3 files changed, 87 insertions(+), 107 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuScrollContainer.cs b/osu.Game/Graphics/Containers/OsuScrollContainer.cs index e395f1b7bd..3fc9f439fa 100644 --- a/osu.Game/Graphics/Containers/OsuScrollContainer.cs +++ b/osu.Game/Graphics/Containers/OsuScrollContainer.cs @@ -7,7 +7,7 @@ using OpenTK.Input; namespace osu.Game.Graphics.Containers { - internal class OsuScrollContainer : ScrollContainer + public class OsuScrollContainer : ScrollContainer { /// /// Allows controlling the scroll bar from any position in the container using the right mouse button. diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 7d65b8b648..4b1070f236 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -17,19 +17,21 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Scoring; using osu.Game.Online.API; using osu.Game.Online.API.Requests; +using System.Linq; namespace osu.Game.Screens.Select.Leaderboards { public class Leaderboard : Container { private readonly ScrollContainer scrollContainer; - private readonly FillFlowContainer scrollFlow; + private FillFlowContainer scrollFlow; public Action ScoreSelected; private readonly LoadingAnimation loading; private IEnumerable scores; + public IEnumerable Scores { get { return scores; } @@ -41,33 +43,43 @@ namespace osu.Game.Screens.Select.Leaderboards int i = 150; if (scores == null) { - foreach (var c in scrollFlow.Children) - c.FadeOut(i += 10); + if (scrollFlow != null) + { + foreach (var c in scrollFlow.Children) + c.FadeOut(i += 10); - foreach (var c in scrollFlow.Children) - c.LifetimeEnd = Time.Current + i; + foreach (var c in scrollFlow.Children) + c.LifetimeEnd = Time.Current + i; + } return; } - scrollFlow.Clear(); - - i = 0; - foreach (var s in scores) + // schedule because we may not be loaded yet (LoadComponentAsync complains). + Schedule(() => { - var ls = new LeaderboardScore(s, 1 + i) + LoadComponentAsync(new FillFlowContainer { - AlwaysPresent = true, - Action = () => ScoreSelected?.Invoke(s), - State = Visibility.Hidden, - }; - scrollFlow.Add(ls); + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Spacing = new Vector2(0f, 5f), + Padding = new MarginPadding { Top = 10, Bottom = 5 }, + ChildrenEnumerable = scores.Select(s => new LeaderboardScore(s, 1 + i) { Action = () => ScoreSelected?.Invoke(s) }) + }, f => + { + scrollFlow?.Expire(); + scrollContainer.Add(scrollFlow = f); - using (BeginDelayedSequence(i++ * 50, true)) - ls.Show(); - } + i = 0; + foreach (var s in f.Children) + { + using (s.BeginDelayedSequence(i++ * 50, true)) + s.Show(); + } - scrollContainer.ScrollTo(0f, false); + scrollContainer.ScrollTo(0f, false); + }); + }); } } @@ -79,16 +91,6 @@ namespace osu.Game.Screens.Select.Leaderboards { RelativeSizeAxes = Axes.Both, ScrollbarVisible = false, - Children = new Drawable[] - { - scrollFlow = new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Spacing = new Vector2(0f, 5f), - Padding = new MarginPadding { Top = 10, Bottom = 5 }, - }, - }, }, loading = new LoadingAnimation() }; @@ -152,6 +154,8 @@ namespace osu.Game.Screens.Select.Leaderboards if (!scrollContainer.IsScrolledToEnd()) fadeStart -= LeaderboardScore.HEIGHT; + if (scrollFlow == null) return; + foreach (var c in scrollFlow.Children) { var topY = c.ToSpaceOfOtherDrawable(Vector2.Zero, scrollFlow).Y; diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 9044938a75..e9de3fb672 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -2,9 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; using OpenTK; using OpenTK.Graphics; -using osu.Framework; +using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -13,14 +14,13 @@ using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; -using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Users; namespace osu.Game.Screens.Select.Leaderboards { - public class LeaderboardScore : OsuClickableContainer, IStateful + public class LeaderboardScore : OsuClickableContainer { public static readonly float HEIGHT = 60; @@ -34,72 +34,16 @@ namespace osu.Game.Screens.Select.Leaderboards private const float background_alpha = 0.25f; private const float rank_width = 30; - private readonly Box background; - private readonly Container content; - private readonly Container avatar; - private readonly DrawableRank scoreRank; - private readonly OsuSpriteText nameLabel; - private readonly GlowingSpriteText scoreLabel; - private readonly ScoreComponentLabel maxCombo; - private readonly ScoreComponentLabel accuracy; - private readonly Container flagBadgeContainer; - private readonly FillFlowContainer modsContainer; - - private Visibility state; - - public Visibility State - { - get { return state; } - set - { - if (state == value) - return; - state = value; - - switch (state) - { - case Visibility.Hidden: - foreach (var d in new Drawable[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer }) - d.FadeOut(); - - Alpha = 0; - - content.MoveToY(75); - avatar.MoveToX(75); - nameLabel.MoveToX(150); - break; - case Visibility.Visible: - this.FadeIn(200); - content.MoveToY(0, 800, Easing.OutQuint); - - using (BeginDelayedSequence(100, true)) - { - avatar.FadeIn(300, Easing.OutQuint); - nameLabel.FadeIn(350, Easing.OutQuint); - - avatar.MoveToX(0, 300, Easing.OutQuint); - nameLabel.MoveToX(0, 350, Easing.OutQuint); - - using (BeginDelayedSequence(250, true)) - { - scoreLabel.FadeIn(200); - scoreRank.FadeIn(200); - - using (BeginDelayedSequence(50, true)) - { - var drawables = new Drawable[] { flagBadgeContainer, maxCombo, accuracy, modsContainer, }; - for (int i = 0; i < drawables.Length; i++) - drawables[i].FadeIn(100 + i * 50); - } - } - } - - break; - } - - StateChanged?.Invoke(State); - } - } + private Box background; + private Container content; + private Container avatar; + private DrawableRank scoreRank; + private OsuSpriteText nameLabel; + private GlowingSpriteText scoreLabel; + private ScoreComponentLabel maxCombo; + private ScoreComponentLabel accuracy; + private Container flagBadgeContainer; + private FillFlowContainer modsContainer; public LeaderboardScore(Score score, int rank) { @@ -108,7 +52,11 @@ namespace osu.Game.Screens.Select.Leaderboards RelativeSizeAxes = Axes.X; Height = HEIGHT; + } + [BackgroundDependencyLoader] + private void load() + { Children = new Drawable[] { new Container @@ -255,23 +203,51 @@ namespace osu.Game.Screens.Select.Leaderboards Origin = Anchor.BottomRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, + ChildrenEnumerable = Score.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.375f) }) }, }, }, }, }, }; - - foreach (Mod mod in Score.Mods) - { - modsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.375f) }); - } } - public void ToggleVisibility() => State = State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible; + public override void Show() + { + foreach (var d in new Drawable[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer }) + d.FadeOut(); - public override void Hide() => State = Visibility.Hidden; - public override void Show() => State = Visibility.Visible; + Alpha = 0; + + content.MoveToY(75); + avatar.MoveToX(75); + nameLabel.MoveToX(150); + + this.FadeIn(200); + content.MoveToY(0, 800, Easing.OutQuint); + + using (BeginDelayedSequence(100, true)) + { + avatar.FadeIn(300, Easing.OutQuint); + nameLabel.FadeIn(350, Easing.OutQuint); + + avatar.MoveToX(0, 300, Easing.OutQuint); + nameLabel.MoveToX(0, 350, Easing.OutQuint); + + using (BeginDelayedSequence(250, true)) + { + scoreLabel.FadeIn(200); + scoreRank.FadeIn(200); + + using (BeginDelayedSequence(50, true)) + { + var drawables = new Drawable[] { flagBadgeContainer, maxCombo, accuracy, modsContainer, }; + for (int i = 0; i < drawables.Length; i++) + drawables[i].FadeIn(100 + i * 50); + } + } + } + } protected override bool OnHover(InputState state) { From d301ad143596349036fd26ca4f74c48ad1fac2f8 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 16 Nov 2017 20:06:49 +0300 Subject: [PATCH 045/282] Add supporter icon to the user panel --- osu.Game.Tests/Visual/TestCaseUserPanel.cs | 3 +- osu.Game/Users/UserPanel.cs | 70 ++++++++++++++++++---- 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseUserPanel.cs b/osu.Game.Tests/Visual/TestCaseUserPanel.cs index 60932f8424..8523a754f8 100644 --- a/osu.Game.Tests/Visual/TestCaseUserPanel.cs +++ b/osu.Game.Tests/Visual/TestCaseUserPanel.cs @@ -36,7 +36,8 @@ namespace osu.Game.Tests.Visual Username = @"peppy", Id = 2, Country = new Country { FlagName = @"AU" }, - CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg" + CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg", + IsSupporter = true, }) { Width = 300 }, }, }); diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 706ad86bfc..ab4d55027d 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -16,6 +16,7 @@ using osu.Game.Overlays; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; using osu.Framework.Graphics.Cursor; +using osu.Game.Graphics.Backgrounds; namespace osu.Game.Users { @@ -43,6 +44,8 @@ namespace osu.Game.Users this.user = user; + FillFlowContainer infoContainer; + Height = height - status_height; Masking = true; CornerRadius = 5; @@ -100,7 +103,7 @@ namespace osu.Game.Users TextSize = 18, Font = @"Exo2.0-SemiBoldItalic", }, - new FillFlowContainer + infoContainer = new FillFlowContainer { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, @@ -115,16 +118,6 @@ namespace osu.Game.Users Width = 30f, RelativeSizeAxes = Axes.Y, }, - new Container - { - Width = 40f, - RelativeSizeAxes = Axes.Y, - }, - new CircularContainer - { - Width = 20f, - RelativeSizeAxes = Axes.Y, - }, }, }, }, @@ -171,6 +164,13 @@ namespace osu.Game.Users }, }, }; + + if (user.IsSupporter) + infoContainer.Add(new SupporterIcon + { + RelativeSizeAxes = Axes.Y, + Width = 20f, + }); } [BackgroundDependencyLoader(permitNulls: true)] @@ -219,5 +219,53 @@ namespace osu.Game.Users { new OsuMenuItem("View Profile", MenuItemType.Highlighted, ViewProfile), }; + + private class SupporterIcon : CircularContainer + { + private readonly Box background; + + public SupporterIcon() + { + Masking = true; + Children = new Drawable[] + { + new Box { RelativeSizeAxes = Axes.Both }, + new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Scale = new Vector2(0.8f), + Masking = true, + Children = new Drawable[] + { + background = new Box { RelativeSizeAxes = Axes.Both }, + new Triangles + { + TriangleScale = 0.2f, + ColourLight = OsuColour.FromHex(@"ff7db7"), + ColourDark = OsuColour.FromHex(@"de5b95"), + RelativeSizeAxes = Axes.Both, + Velocity = 0.3f, + }, + } + }, + new SpriteIcon + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Icon = FontAwesome.fa_heart, + Scale = new Vector2(0.45f), + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + background.Colour = colours.Pink; + } + } } } From 62155e6dd53820d2d5454150ba51f7a6566a9f21 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 16 Nov 2017 20:06:32 +0900 Subject: [PATCH 046/282] Make DifficultyCalculator support mod applications Fixes https://github.com/ppy/osu/issues/476. --- .../CatchDifficultyCalculator.cs | 7 +--- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 +- .../ManiaDifficultyCalculator.cs | 5 +-- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- .../OsuDifficulty/OsuDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Osu/OsuRuleset.cs | 3 +- .../TaikoDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 37 +++++++++++-------- osu.Game/Beatmaps/DummyWorkingBeatmap.cs | 2 +- osu.Game/Rulesets/Ruleset.cs | 3 +- 11 files changed, 35 insertions(+), 32 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs index 3c6cc4b1a3..127fde74ef 100644 --- a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs @@ -14,11 +14,8 @@ namespace osu.Game.Rulesets.Catch { } - protected override double CalculateInternal(Dictionary categoryDifficulty) - { - return 0; - } + public override double Calculate(Dictionary categoryDifficulty) => 0; protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 1a9b034cf2..1d5fc0545e 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -95,7 +95,7 @@ namespace osu.Game.Rulesets.Catch public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_fruits_o }; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new CatchDifficultyCalculator(beatmap); + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new CatchDifficultyCalculator(beatmap); public override int LegacyID => 2; diff --git a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs index 784df1f293..d5c6d21131 100644 --- a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs @@ -16,10 +16,7 @@ namespace osu.Game.Rulesets.Mania { } - protected override double CalculateInternal(Dictionary categoryDifficulty) - { - return 0; - } + public override double Calculate(Dictionary categoryDifficulty) => 0; protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(true, (int)Math.Max(1, Math.Round(Beatmap.BeatmapInfo.BaseDifficulty.CircleSize))); } diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index c0996cadf9..4eea884891 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -107,7 +107,7 @@ namespace osu.Game.Rulesets.Mania public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_mania_o }; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new ManiaDifficultyCalculator(beatmap); + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new ManiaDifficultyCalculator(beatmap); public override int LegacyID => 3; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 457466fd86..6ed45e1f03 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty (h as Slider)?.Curve?.Calculate(); } - protected override double CalculateInternal(Dictionary categoryDifficulty) + public override double Calculate(Dictionary categoryDifficulty) { OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Objects); Skill[] skills = diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 7650a91d7a..a4828319d1 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -14,6 +14,7 @@ using System.Linq; using osu.Framework.Graphics; using osu.Game.Overlays.Settings; using osu.Framework.Input.Bindings; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu { @@ -112,7 +113,7 @@ namespace osu.Game.Rulesets.Osu public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_osu_o }; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new OsuDifficultyCalculator(beatmap); + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new OsuDifficultyCalculator(beatmap); public override string Description => "osu!"; diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index de97658e35..57986cd198 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Taiko { } - protected override double CalculateInternal(Dictionary categoryDifficulty) + public override double Calculate(Dictionary categoryDifficulty) { // Fill our custom DifficultyHitObject class, that carries additional information difficultyHitObjects.Clear(); diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index ea0f0eae1a..99ae36967a 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -97,7 +97,7 @@ namespace osu.Game.Rulesets.Taiko public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_taiko_o }; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new TaikoDifficultyCalculator(beatmap); + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new TaikoDifficultyCalculator(beatmap); public override int LegacyID => 1; diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index bb6a292d9d..f6cc535aca 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -3,6 +3,10 @@ using osu.Game.Rulesets.Objects; using System.Collections.Generic; +using osu.Game.Rulesets.Mods; +using osu.Framework.Timing; +using System.Linq; +using osu.Framework.Extensions.IEnumerableExtensions; namespace osu.Game.Beatmaps { @@ -10,41 +14,44 @@ namespace osu.Game.Beatmaps { protected double TimeRate = 1; - protected abstract double CalculateInternal(Dictionary categoryDifficulty); - - private void loadTiming() - { - // TODO: Handle mods - const int audio_rate = 100; - TimeRate = audio_rate / 100.0; - } - - public double Calculate(Dictionary categoryDifficulty = null) - { - loadTiming(); - double difficulty = CalculateInternal(categoryDifficulty); - return difficulty; - } + public abstract double Calculate(Dictionary categoryDifficulty = null); } public abstract class DifficultyCalculator : DifficultyCalculator where T : HitObject { protected readonly Beatmap Beatmap; + protected readonly Mod[] Mods; protected List Objects; protected DifficultyCalculator(Beatmap beatmap) + : this(beatmap, null) + { + } + + protected DifficultyCalculator(Beatmap beatmap, Mod[] mods) { Beatmap = beatmap; + Mods = mods ?? new Mod[0]; Objects = CreateBeatmapConverter().Convert(beatmap).HitObjects; foreach (var h in Objects) h.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty); + ApplyMods(mods); + PreprocessHitObjects(); } + protected virtual void ApplyMods(Mod[] mods) + { + var clock = new StopwatchClock(); + mods.OfType().ForEach(m => m.ApplyToClock(clock)); + + TimeRate = clock.Rate; + } + protected virtual void PreprocessHitObjects() { } diff --git a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs index b9376849c1..c15d585eb2 100644 --- a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs +++ b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs @@ -59,7 +59,7 @@ namespace osu.Game.Beatmaps throw new NotImplementedException(); } - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => null; + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => null; public override string Description => "dummy"; diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 587c2fc659..e8919c4bda 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -10,6 +10,7 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets @@ -47,7 +48,7 @@ namespace osu.Game.Rulesets /// public abstract RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset); - public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap); + public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null); public virtual Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_question_circle }; From 18f2e92a48b4ba9e044143d04972470980666fc4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 16 Nov 2017 20:35:57 +0900 Subject: [PATCH 047/282] Rework mod applications to hitobject/rulesetcontainer for DifficultyCalculator --- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 6 ++--- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 27 ++++++++++++------- osu.Game/Beatmaps/DifficultyCalculator.cs | 4 +++ osu.Game/Rulesets/Mods/IApplicableMod.cs | 22 --------------- .../Rulesets/Mods/IApplicableToHitObject.cs | 20 ++++++++++++++ .../Mods/IApplicableToRulesetContainer.cs | 21 +++++++++++++++ osu.Game/Rulesets/Mods/ModAutoplay.cs | 4 +-- osu.Game/Rulesets/UI/RulesetContainer.cs | 6 ++++- osu.Game/osu.Game.csproj | 3 ++- 9 files changed, 74 insertions(+), 39 deletions(-) delete mode 100644 osu.Game/Rulesets/Mods/IApplicableMod.cs create mode 100644 osu.Game/Rulesets/Mods/IApplicableToHitObject.cs create mode 100644 osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index 037c3bd567..164309c227 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -86,18 +86,17 @@ namespace osu.Game.Rulesets.Mania.Mods public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) }; } - public class ManiaModRandom : Mod, IApplicableMod + public class ManiaModRandom : Mod, IApplicableToRulesetContainer { public override string Name => "Random"; public override string ShortenedName => "RD"; - public override FontAwesome Icon => FontAwesome.fa_osu_dice; + public override FontAwesome Icon => FontAwesome.fa_osu_dice; public override string Description => @"Shuffle around the notes!"; public override double ScoreMultiplier => 1; public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) { int availableColumns = ((ManiaRulesetContainer)rulesetContainer).AvailableColumns; - var shuffledColumns = Enumerable.Range(0, availableColumns).OrderBy(item => RNG.Next()).ToList(); rulesetContainer.Objects.OfType().ForEach(h => h.Column = shuffledColumns[h.Column]); @@ -188,6 +187,7 @@ namespace osu.Game.Rulesets.Mania.Mods base.ApplyToRulesetContainer(rulesetContainer); } + protected override Score CreateReplayScore(Beatmap beatmap) => new Score { User = new User { Username = "osu!topus!" }, diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index 2970055bff..596fe27504 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -33,22 +33,29 @@ namespace osu.Game.Rulesets.Osu.Mods public override double ScoreMultiplier => 1.06; } - public class OsuModHardRock : ModHardRock, IApplicableMod + public class OsuModHardRock : ModHardRock, IApplicableToHitObject { public override double ScoreMultiplier => 1.06; public override bool Ranked => true; - public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) + public void ApplyToHitObject(OsuHitObject hitObject) + { + hitObject.Position = new Vector2(hitObject.Position.X, OsuPlayfield.BASE_SIZE.Y - hitObject.Y); + + var slider = hitObject as Slider; + if (slider == null) + return; + + var newControlPoints = new List(); + slider.ControlPoints.ForEach(c => newControlPoints.Add(new Vector2(c.X, OsuPlayfield.BASE_SIZE.Y - c.Y))); + + slider.ControlPoints = newControlPoints; + slider.Curve?.Calculate(); // Recalculate the slider curve + } + + public void ApplyToHitObjects(RulesetContainer rulesetContainer) { - rulesetContainer.Objects.OfType().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Y)); - rulesetContainer.Objects.OfType().ForEach(s => - { - var newControlPoints = new List(); - s.ControlPoints.ForEach(c => newControlPoints.Add(new Vector2(c.X, OsuPlayfield.BASE_SIZE.Y - c.Y))); - s.ControlPoints = newControlPoints; - s.Curve?.Calculate(); // Recalculate the slider curve - }); } } diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index f6cc535aca..54dab07b31 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -49,6 +49,10 @@ namespace osu.Game.Beatmaps var clock = new StopwatchClock(); mods.OfType().ForEach(m => m.ApplyToClock(clock)); + foreach (var mod in mods.OfType>()) + foreach (var obj in Objects) + mod.ApplyToHitObject(obj); + TimeRate = clock.Rate; } diff --git a/osu.Game/Rulesets/Mods/IApplicableMod.cs b/osu.Game/Rulesets/Mods/IApplicableMod.cs deleted file mode 100644 index 1957952720..0000000000 --- a/osu.Game/Rulesets/Mods/IApplicableMod.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Rulesets.Objects; -using osu.Game.Rulesets.UI; - -namespace osu.Game.Rulesets.Mods -{ - /// - /// An interface for mods that are applied to a RulesetContainer. - /// - /// The type of HitObject the RulesetContainer contains. - public interface IApplicableMod - where TObject : HitObject - { - /// - /// Applies the mod to a RulesetContainer. - /// - /// The RulesetContainer to apply the mod to. - void ApplyToRulesetContainer(RulesetContainer rulesetContainer); - } -} diff --git a/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs new file mode 100644 index 0000000000..099234d9c1 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Objects; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// An interface for s that can be applied to s. + /// + public interface IApplicableToHitObject + where TObject : HitObject + { + /// + /// Applies this to a . + /// + /// The to apply to. + void ApplyToHitObject(TObject hitObject); + } +} diff --git a/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs b/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs new file mode 100644 index 0000000000..9b23dd58f9 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.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.Game.Rulesets.Objects; +using osu.Game.Rulesets.UI; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// An interface for s that can be applied to s. + /// + public interface IApplicableToRulesetContainer + where TObject : HitObject + { + /// + /// Applies this to a . + /// + /// The to apply to. + void ApplyToRulesetContainer(RulesetContainer rulesetContainer); + } +} diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index ece0deba84..d94d4ba0db 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -10,7 +10,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mods { - public abstract class ModAutoplay : ModAutoplay, IApplicableMod + public abstract class ModAutoplay : ModAutoplay, IApplicableToRulesetContainer where T : HitObject { protected abstract Score CreateReplayScore(Beatmap beatmap); @@ -30,4 +30,4 @@ namespace osu.Game.Rulesets.Mods public override double ScoreMultiplier => 0; public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) }; } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 278814ea7e..6726d94995 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -212,7 +212,11 @@ namespace osu.Game.Rulesets.UI if (mods == null) return; - foreach (var mod in mods.OfType>()) + foreach (var mod in mods.OfType>()) + foreach (var obj in Beatmap.HitObjects) + mod.ApplyToHitObject(obj); + + foreach (var mod in mods.OfType>()) mod.ApplyToRulesetContainer(this); } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ac1498c9d9..7b479bdba2 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -549,9 +549,10 @@ - + + From 5781b45b3903393570025c567a7071446b08f9f5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 16 Nov 2017 20:41:26 +0900 Subject: [PATCH 048/282] Set TimeRate after mod application --- osu.Game/Beatmaps/DifficultyCalculator.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 54dab07b31..f101cfbfb8 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -48,12 +48,11 @@ namespace osu.Game.Beatmaps { var clock = new StopwatchClock(); mods.OfType().ForEach(m => m.ApplyToClock(clock)); + TimeRate = clock.Rate; foreach (var mod in mods.OfType>()) foreach (var obj in Objects) mod.ApplyToHitObject(obj); - - TimeRate = clock.Rate; } protected virtual void PreprocessHitObjects() From cc1720241e8d63fb3d9d56333eb348d89933eafb Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 12:35:03 +0900 Subject: [PATCH 049/282] Fix DifficultyCalculator using incorrect mods --- osu.Game/Beatmaps/DifficultyCalculator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index f101cfbfb8..34c6bb95ff 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -39,7 +39,7 @@ namespace osu.Game.Beatmaps foreach (var h in Objects) h.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty); - ApplyMods(mods); + ApplyMods(Mods); PreprocessHitObjects(); } From 7892eefd6899bf6c0a64d397f300d77bc3576e92 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 14:23:52 +0900 Subject: [PATCH 050/282] Fix up mod application + beatmap/hitobject references --- .../OsuDifficulty/OsuDifficultyCalculator.cs | 13 ++++++++++--- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- .../TaikoDifficultyCalculator.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 18 +++++++++--------- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 6ed45e1f03..9f279ccae4 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Beatmaps; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing; @@ -16,19 +17,25 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty private const int section_length = 400; private const double difficulty_multiplier = 0.0675; - public OsuDifficultyCalculator(Beatmap beatmap) : base(beatmap) + public OsuDifficultyCalculator(Beatmap beatmap) + : base(beatmap) + { + } + + public OsuDifficultyCalculator(Beatmap beatmap, Mod[] mods) + : base(beatmap, mods) { } protected override void PreprocessHitObjects() { - foreach (OsuHitObject h in Objects) + foreach (OsuHitObject h in Beatmap.HitObjects) (h as Slider)?.Curve?.Calculate(); } public override double Calculate(Dictionary categoryDifficulty) { - OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Objects); + OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Beatmap.HitObjects); Skill[] skills = { new Aim(), diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index a4828319d1..8b7a014ea8 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -113,7 +113,7 @@ namespace osu.Game.Rulesets.Osu public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_osu_o }; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new OsuDifficultyCalculator(beatmap); + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new OsuDifficultyCalculator(beatmap, mods); public override string Description => "osu!"; diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index 57986cd198..adb7ace5f9 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Taiko // Fill our custom DifficultyHitObject class, that carries additional information difficultyHitObjects.Clear(); - foreach (var hitObject in Objects) + foreach (var hitObject in Beatmap.HitObjects) difficultyHitObjects.Add(new TaikoHitObjectDifficulty(hitObject)); // Sort DifficultyHitObjects by StartTime of the HitObjects - just to make sure. diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 34c6bb95ff..3c32b718bc 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -19,11 +19,9 @@ namespace osu.Game.Beatmaps public abstract class DifficultyCalculator : DifficultyCalculator where T : HitObject { - protected readonly Beatmap Beatmap; + protected readonly Beatmap Beatmap; protected readonly Mod[] Mods; - protected List Objects; - protected DifficultyCalculator(Beatmap beatmap) : this(beatmap, null) { @@ -31,13 +29,9 @@ namespace osu.Game.Beatmaps protected DifficultyCalculator(Beatmap beatmap, Mod[] mods) { - Beatmap = beatmap; + Beatmap = CreateBeatmapConverter().Convert(beatmap); Mods = mods ?? new Mod[0]; - Objects = CreateBeatmapConverter().Convert(beatmap).HitObjects; - - foreach (var h in Objects) - h.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty); ApplyMods(Mods); @@ -50,9 +44,15 @@ namespace osu.Game.Beatmaps mods.OfType().ForEach(m => m.ApplyToClock(clock)); TimeRate = clock.Rate; + foreach (var mod in Mods.OfType()) + mod.ApplyToDifficulty(Beatmap.BeatmapInfo.BaseDifficulty); + foreach (var mod in mods.OfType>()) - foreach (var obj in Objects) + foreach (var obj in Beatmap.HitObjects) mod.ApplyToHitObject(obj); + + foreach (var h in Beatmap.HitObjects) + h.ApplyDefaults(Beatmap.ControlPointInfo, Beatmap.BeatmapInfo.BaseDifficulty); } protected virtual void PreprocessHitObjects() From ac6213d1fadd8362580b482de0b1355981a25c8e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 14:26:33 +0900 Subject: [PATCH 051/282] CI fixes --- osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 1 - osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Osu/OsuRuleset.cs | 1 - osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableToHitObject.cs | 2 +- osu.Game/Rulesets/Ruleset.cs | 1 - 9 files changed, 6 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs index 127fde74ef..db88e04dd0 100644 --- a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Catch { } - public override double Calculate(Dictionary categoryDifficulty) => 0; + public override double Calculate(Dictionary categoryDifficulty = null) => 0; protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); } diff --git a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs index d5c6d21131..070fc2b4dd 100644 --- a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Mania { } - public override double Calculate(Dictionary categoryDifficulty) => 0; + public override double Calculate(Dictionary categoryDifficulty = null) => 0; protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(true, (int)Math.Max(1, Math.Round(Beatmap.BeatmapInfo.BaseDifficulty.CircleSize))); } diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index 596fe27504..71349285b3 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -9,7 +9,6 @@ using osu.Game.Rulesets.Osu.Objects; using System; using System.Collections.Generic; using System.Linq; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 9f279ccae4..f7909f8335 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty (h as Slider)?.Curve?.Calculate(); } - public override double Calculate(Dictionary categoryDifficulty) + public override double Calculate(Dictionary categoryDifficulty = null) { OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Beatmap.HitObjects); Skill[] skills = diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 8b7a014ea8..9c11474f97 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -14,7 +14,6 @@ using System.Linq; using osu.Framework.Graphics; using osu.Game.Overlays.Settings; using osu.Framework.Input.Bindings; -using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu { diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index adb7ace5f9..e06582500f 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Taiko { } - public override double Calculate(Dictionary categoryDifficulty) + public override double Calculate(Dictionary categoryDifficulty = null) { // Fill our custom DifficultyHitObject class, that carries additional information difficultyHitObjects.Clear(); diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 3c32b718bc..351154623e 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -27,7 +27,7 @@ namespace osu.Game.Beatmaps { } - protected DifficultyCalculator(Beatmap beatmap, Mod[] mods) + protected DifficultyCalculator(Beatmap beatmap, Mod[] mods = null) { Beatmap = CreateBeatmapConverter().Convert(beatmap); Mods = mods ?? new Mod[0]; diff --git a/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs index 099234d9c1..7f39def343 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs @@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Mods /// /// An interface for s that can be applied to s. /// - public interface IApplicableToHitObject + public interface IApplicableToHitObject where TObject : HitObject { /// diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index e8919c4bda..ed2fdf4157 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -10,7 +10,6 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets From 95fd323c6b122cd768a31a889eaa464319390212 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 14:37:06 +0900 Subject: [PATCH 052/282] Fix ManiaDifficultyCalculator possibly failing due to nullref --- osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs | 2 +- .../OsuDifficulty/OsuDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 9 ++------- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs index db88e04dd0..b77be9d1f0 100644 --- a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs @@ -16,6 +16,6 @@ namespace osu.Game.Rulesets.Catch public override double Calculate(Dictionary categoryDifficulty = null) => 0; - protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new CatchBeatmapConverter(); } } diff --git a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs index 070fc2b4dd..67bc347535 100644 --- a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs @@ -18,6 +18,6 @@ namespace osu.Game.Rulesets.Mania public override double Calculate(Dictionary categoryDifficulty = null) => 0; - protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(true, (int)Math.Max(1, Math.Round(Beatmap.BeatmapInfo.BaseDifficulty.CircleSize))); + protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new ManiaBeatmapConverter(true, (int)Math.Max(1, Math.Round(beatmap.BeatmapInfo.BaseDifficulty.CircleSize))); } } diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index f7909f8335..537874f643 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -74,6 +74,6 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty return starRating; } - protected override BeatmapConverter CreateBeatmapConverter() => new OsuBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new OsuBeatmapConverter(); } } diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index e06582500f..e881942fbf 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -134,6 +134,6 @@ namespace osu.Game.Rulesets.Taiko return difficulty; } - protected override BeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(true); + protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new TaikoBeatmapConverter(true); } } diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 351154623e..f58f433cb2 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -22,14 +22,9 @@ namespace osu.Game.Beatmaps protected readonly Beatmap Beatmap; protected readonly Mod[] Mods; - protected DifficultyCalculator(Beatmap beatmap) - : this(beatmap, null) - { - } - protected DifficultyCalculator(Beatmap beatmap, Mod[] mods = null) { - Beatmap = CreateBeatmapConverter().Convert(beatmap); + Beatmap = CreateBeatmapConverter(beatmap).Convert(beatmap); Mods = mods ?? new Mod[0]; @@ -59,6 +54,6 @@ namespace osu.Game.Beatmaps { } - protected abstract BeatmapConverter CreateBeatmapConverter(); + protected abstract BeatmapConverter CreateBeatmapConverter(Beatmap beatmap); } } From 38fe95d94aa1d27f12a12c5f46de7cfb72ccfcfe Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 16 Nov 2017 17:35:10 +0900 Subject: [PATCH 053/282] Add basic display for pp in TestCasePerformancePoints --- .../Tests/TestCasePerformancePoints.cs | 13 ++ .../osu.Game.Rulesets.Catch.csproj | 1 + .../Tests/TestCasePerformancePoints.cs | 13 ++ .../osu.Game.Rulesets.Mania.csproj | 1 + .../Tests/TestCasePerformancePoints.cs | 13 ++ .../osu.Game.Rulesets.Osu.csproj | 1 + .../Tests/TestCasePerformancePoints.cs | 13 ++ .../osu.Game.Rulesets.Taiko.csproj | 1 + .../Tests/Visual/TestCasePerformancePoints.cs | 214 ++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 10 files changed, 271 insertions(+) create mode 100644 osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs create mode 100644 osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs create mode 100644 osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs create mode 100644 osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs create mode 100644 osu.Game/Tests/Visual/TestCasePerformancePoints.cs diff --git a/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs new file mode 100644 index 0000000000..071367b305 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Catch.Tests +{ + public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints + { + public TestCasePerformancePoints() + : base(new CatchRuleset(new RulesetInfo())) + { + } + } +} diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index a666984b95..6822643fb5 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -65,6 +65,7 @@ + diff --git a/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs new file mode 100644 index 0000000000..420465c045 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Tests +{ + public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints + { + public TestCasePerformancePoints() + : base(new ManiaRuleset(new RulesetInfo())) + { + } + } +} diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 6f45a64d92..7c97ff05a7 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -82,6 +82,7 @@ + diff --git a/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs new file mode 100644 index 0000000000..b430803907 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Osu.Tests +{ + public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints + { + public TestCasePerformancePoints() + : base(new OsuRuleset(new RulesetInfo())) + { + } + } +} diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 3c90749777..97ddf7d46f 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -85,6 +85,7 @@ + diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs new file mode 100644 index 0000000000..a60c79fc6a --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Taiko.Tests +{ + public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints + { + public TestCasePerformancePoints() + : base(new TaikoRuleset(new RulesetInfo())) + { + } + } +} diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index bf627d205a..0b4e6e43f2 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -83,6 +83,7 @@ + diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs new file mode 100644 index 0000000000..d3a6071fb8 --- /dev/null +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -0,0 +1,214 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using System.Linq; +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Allocation; +using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Input; +using osu.Game.Beatmaps; +using osu.Game.Graphics.Sprites; +using osu.Game.Overlays; +using osu.Game.Overlays.Music; +using osu.Game.Rulesets; + +namespace osu.Game.Tests.Visual +{ + public abstract class TestCasePerformancePoints : OsuTestCase + { + public TestCasePerformancePoints(Ruleset ruleset) + { + Children = new Drawable[] + { + new Container + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + RelativeSizeAxes = Axes.Y, + Width = 300, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.5f, + }, + new ScrollContainer(Direction.Vertical) + { + RelativeSizeAxes = Axes.Both, + Child = new BeatmapList(ruleset) + } + } + }, + new PpDisplay(ruleset) + }; + } + + private class BeatmapList : CompositeDrawable + { + private readonly Container beatmapDisplays; + private readonly Ruleset ruleset; + + public BeatmapList(Ruleset ruleset) + { + this.ruleset = ruleset; + + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + InternalChild = beatmapDisplays = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 4) + }; + } + + [BackgroundDependencyLoader] + private void load(OsuGameBase osuGame, BeatmapManager beatmaps) + { + var sets = beatmaps.GetAllUsableBeatmapSets(); + var allBeatmaps = sets.SelectMany(s => s.Beatmaps).Where(b => ruleset.LegacyID < 0 || b.RulesetID == ruleset.LegacyID); + + allBeatmaps.ForEach(b => beatmapDisplays.Add(new BeatmapDisplay(b))); + } + + private class BeatmapDisplay : CompositeDrawable + { + private readonly OsuSpriteText text; + private readonly BeatmapInfo beatmap; + + private BeatmapManager beatmaps; + private OsuGameBase osuGame; + + private bool isSelected; + + public BeatmapDisplay(BeatmapInfo beatmap) + { + this.beatmap = beatmap; + + AutoSizeAxes = Axes.Both; + InternalChild = text = new OsuSpriteText(); + } + + protected override bool OnClick(InputState state) + { + if (osuGame.Beatmap.Value.BeatmapInfo.ID == beatmap.ID) + return false; + + osuGame.Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap); + isSelected = true; + return true; + } + + protected override bool OnHover(InputState state) + { + if (isSelected) + return false; + this.FadeColour(Color4.Yellow, 100); + return true; + } + + protected override void OnHoverLost(InputState state) + { + if (isSelected) + return; + this.FadeColour(Color4.White, 100); + } + + [BackgroundDependencyLoader] + private void load(OsuGameBase osuGame, BeatmapManager beatmaps) + { + this.osuGame = osuGame; + this.beatmaps = beatmaps; + + var working = beatmaps.GetWorkingBeatmap(beatmap); + text.Text = $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title} ({beatmap.Metadata.AuthorString}) [{beatmap.Version}]"; + + osuGame.Beatmap.ValueChanged += beatmapChanged; + } + + private void beatmapChanged(WorkingBeatmap newBeatmap) + { + if (isSelected) + this.FadeColour(Color4.White, 100); + isSelected = false; + } + } + } + + private class PpDisplay : CompositeDrawable + { + private readonly Container strainsContainer; + private readonly OsuSpriteText totalPp; + + private readonly Ruleset ruleset; + + public PpDisplay(Ruleset ruleset) + { + this.ruleset = ruleset; + + RelativeSizeAxes = Axes.Y; + Width = 400; + + InternalChildren = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.2f + }, + totalPp = new OsuSpriteText { TextSize = 18 }, + new Container + { + AutoSizeAxes = Axes.Both, + Y = 26, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.2f, + }, + strainsContainer = new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 5) + } + } + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuGameBase osuGame) + { + osuGame.Beatmap.ValueChanged += beatmapChanged; + } + + private void beatmapChanged(WorkingBeatmap beatmap) + { + var diffCalculator = ruleset.CreateDifficultyCalculator(beatmap.Beatmap); + + var strains = new Dictionary(); + double pp = diffCalculator.Calculate(strains); + + totalPp.Text = $"Total PP: {pp.ToString("n2")}"; + + strainsContainer.Clear(); + foreach (var kvp in strains) + strainsContainer.Add(new OsuSpriteText { Text = $"{kvp.Key} : {kvp.Value}" }); + } + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7b479bdba2..8f0ce14305 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -775,6 +775,7 @@ + From 1e023f04195009f0551d19d43f0ccdb68a3350dc Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 12:35:23 +0900 Subject: [PATCH 054/282] Implement PerformanceCalculator testcase --- osu.Game.Rulesets.Osu/OsuRuleset.cs | 3 + .../Scoring/OsuPerformanceCalculator.cs | 189 ++++++++++++++++++ .../osu.Game.Rulesets.Osu.csproj | 1 + osu.Game/Rulesets/Ruleset.cs | 2 + .../Rulesets/Scoring/PerformanceCalculator.cs | 35 ++++ .../Tests/Visual/TestCasePerformancePoints.cs | 172 +++++++++------- osu.Game/osu.Game.csproj | 1 + 7 files changed, 336 insertions(+), 67 deletions(-) create mode 100644 osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs create mode 100644 osu.Game/Rulesets/Scoring/PerformanceCalculator.cs diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 9c11474f97..4a0a5ce0c9 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -14,6 +14,7 @@ using System.Linq; using osu.Framework.Graphics; using osu.Game.Overlays.Settings; using osu.Framework.Input.Bindings; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu { @@ -114,6 +115,8 @@ namespace osu.Game.Rulesets.Osu public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new OsuDifficultyCalculator(beatmap, mods); + public override PerformanceCalculator CreatePerformanceCalculator(Beatmap beatmap, Score score) => new OsuPerformanceCalculator(this, beatmap, score); + public override string Description => "osu!"; public override SettingsSubsection CreateSettings() => new OsuSettings(); diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs new file mode 100644 index 0000000000..32469b1bf7 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs @@ -0,0 +1,189 @@ +// 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.Linq; +using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu.Beatmaps; +using osu.Game.Rulesets.Osu.Mods; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Osu.Scoring +{ + public class OsuPerformanceCalculator : PerformanceCalculator + { + private readonly int countHitCircles; + private readonly int beatmapMaxCombo; + + private Mod[] mods; + private double accuracy; + private int scoreMaxCombo; + private int count300; + private int count100; + private int count50; + private int countMiss; + + public OsuPerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score) + : base(ruleset, beatmap, score) + { + countHitCircles = Beatmap.HitObjects.Count(h => h is HitCircle); + + beatmapMaxCombo = Beatmap.HitObjects.Count(); + beatmapMaxCombo += Beatmap.HitObjects.OfType().Sum(s => s.RepeatCount + s.Ticks.Count()); + } + + public override double Calculate(Dictionary categoryRatings = null) + { + mods = Score.Mods; + accuracy = Score.Accuracy; + scoreMaxCombo = Score.MaxCombo; + count300 = Convert.ToInt32(Score.Statistics["300"]); + count100 = Convert.ToInt32(Score.Statistics["100"]); + count50 = Convert.ToInt32(Score.Statistics["50"]); + countMiss = Convert.ToInt32(Score.Statistics["x"]); + + // Don't count scores made with supposedly unranked mods + if (mods.Any(m => m is OsuModRelax || m is OsuModAutopilot || m is OsuModAutoplay)) + return 0; + + // Custom multipliers for NoFail and SpunOut. + double multiplier = 1.12f; // This is being adjusted to keep the final pp value scaled around what it used to be when changing things + + if (mods.Any(m => m is OsuModNoFail)) + multiplier *= 0.90f; + + if (mods.Any(m => m is OsuModSpunOut)) + multiplier *= 0.95f; + + double aimValue = computeAimValue(); + double speedValue = computeSpeedValue(); + double accuracyValue = computeAccuracyValue(); + double totalValue = + Math.Pow( + Math.Pow(aimValue, 1.1f) + + Math.Pow(speedValue, 1.1f) + + Math.Pow(accuracyValue, 1.1f), 1.0f / 1.1f + ) * multiplier; + + if (categoryRatings != null) + { + categoryRatings.Add("Aim", aimValue.ToString("0.00")); + categoryRatings.Add("Speed", speedValue.ToString("0.00")); + categoryRatings.Add("Accuracy", accuracyValue.ToString("0.00")); + } + + return totalValue; + } + + private double computeAimValue() + { + double aimValue = Math.Pow(5.0f * Math.Max(1.0f, double.Parse(Attributes["Aim"]) / 0.0675f) - 4.0f, 3.0f) / 100000.0f; + + // Longer maps are worth more + double LengthBonus = 0.95f + 0.4f * Math.Min(1.0f, totalHits / 2000.0f) + + (totalHits > 2000 ? Math.Log10(totalHits / 2000.0f) * 0.5f : 0.0f); + + aimValue *= LengthBonus; + + // Penalize misses exponentially. This mainly fixes tag4 maps and the likes until a per-hitobject solution is available + aimValue *= Math.Pow(0.97f, countMiss); + + // Combo scaling + if (beatmapMaxCombo > 0) + aimValue *= Math.Min(Math.Pow(scoreMaxCombo, 0.8f) / Math.Pow(beatmapMaxCombo, 0.8f), 1.0f); + + double approachRate = Beatmap.BeatmapInfo.BaseDifficulty.ApproachRate; + double approachRateFactor = 1.0f; + if (approachRate > 10.33f) + approachRateFactor += 0.45f * (approachRate - 10.33f); + else if (approachRate < 8.0f) + { + // HD is worth more with lower ar! + if (mods.Any(h => h is OsuModHidden)) + approachRateFactor += 0.02f * (8.0f - approachRate); + else + approachRateFactor += 0.01f * (8.0f - approachRate); + } + + aimValue *= approachRateFactor; + + if (mods.Any(h => h is OsuModHidden)) + aimValue *= 1.18f; + + if (mods.Any(h => h is OsuModFlashlight)) + { + // Apply length bonus again if flashlight is on simply because it becomes a lot harder on longer maps. + aimValue *= 1.45f * LengthBonus; + } + + // Scale the aim value with accuracy _slightly_ + aimValue *= 0.5f + accuracy / 2.0f; + // It is important to also consider accuracy difficulty when doing that + aimValue *= 0.98f + (Math.Pow(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, 2) / 2500); + + return aimValue; + } + + private double computeSpeedValue() + { + double speedValue = Math.Pow(5.0f * Math.Max(1.0f, double.Parse(Attributes["Speed"]) / 0.0675f) - 4.0f, 3.0f) / 100000.0f; + + // Longer maps are worth more + speedValue *= 0.95f + 0.4f * Math.Min(1.0f, totalHits / 2000.0f) + + (totalHits > 2000 ? Math.Log10(totalHits / 2000.0f) * 0.5f : 0.0f); + + // Penalize misses exponentially. This mainly fixes tag4 maps and the likes until a per-hitobject solution is available + speedValue *= Math.Pow(0.97f, countMiss); + + // Combo scaling + if (beatmapMaxCombo > 0) + speedValue *= Math.Min(Math.Pow(scoreMaxCombo, 0.8f) / Math.Pow(beatmapMaxCombo, 0.8f), 1.0f); + + // Scale the speed value with accuracy _slightly_ + speedValue *= 0.5f + accuracy / 2.0f; + // It is important to also consider accuracy difficulty when doing that + speedValue *= 0.98f + (Math.Pow(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, 2) / 2500); + + return speedValue; + } + + private double computeAccuracyValue() + { + // This percentage only considers HitCircles of any value - in this part of the calculation we focus on hitting the timing hit window + double betterAccuracyPercentage = 0; + int amountHitObjectsWithAccuracy = countHitCircles; + + if (amountHitObjectsWithAccuracy > 0) + betterAccuracyPercentage = ((count300 - (totalHits - amountHitObjectsWithAccuracy)) * 6 + count100 * 2 + count50) / (amountHitObjectsWithAccuracy * 6); + else + betterAccuracyPercentage = 0; + + // It is possible to reach a negative accuracy with this formula. Cap it at zero - zero points + if (betterAccuracyPercentage < 0) + betterAccuracyPercentage = 0; + + // Lots of arbitrary values from testing. + // Considering to use derivation from perfect accuracy in a probabilistic manner - assume normal distribution + double accuracyValue = Math.Pow(1.52163f, Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty) * Math.Pow(betterAccuracyPercentage, 24) * 2.83f; + + // Bonus for many hitcircles - it's harder to keep good accuracy up for longer + accuracyValue *= Math.Min(1.15f, Math.Pow(amountHitObjectsWithAccuracy / 1000.0f, 0.3f)); + + if (mods.Any(m => m is OsuModHidden)) + accuracyValue *= 1.02f; + if (mods.Any(m => m is OsuModFlashlight)) + accuracyValue *= 1.02f; + + return accuracyValue; + } + + private double totalHits => count300 + count100 + count50 + countMiss; + private double totalSuccessfulHits => count300 + count100 + count50; + + protected override BeatmapConverter CreateBeatmapConverter() => new OsuBeatmapConverter(); + } +} diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 97ddf7d46f..2be057de40 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -89,6 +89,7 @@ + diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index ed2fdf4157..226a897126 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -49,6 +49,8 @@ namespace osu.Game.Rulesets public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null); + public virtual PerformanceCalculator CreatePerformanceCalculator(Beatmap beatmap, Score score) => null; + public virtual Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_question_circle }; public abstract string Description { get; } diff --git a/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs b/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs new file mode 100644 index 0000000000..49b7ac54c6 --- /dev/null +++ b/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs @@ -0,0 +1,35 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Objects; + +namespace osu.Game.Rulesets.Scoring +{ + public abstract class PerformanceCalculator + { + public abstract double Calculate(Dictionary categoryDifficulty = null); + } + + public abstract class PerformanceCalculator : PerformanceCalculator + where TObject : HitObject + { + private readonly Dictionary attributes = new Dictionary(); + protected IDictionary Attributes => attributes; + + protected readonly Beatmap Beatmap; + protected readonly Score Score; + + public PerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score) + { + Beatmap = CreateBeatmapConverter().Convert(beatmap); + Score = score; + + var diffCalc = ruleset.CreateDifficultyCalculator(beatmap); + diffCalc.Calculate(attributes); + } + + protected abstract BeatmapConverter CreateBeatmapConverter(); + } +} diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index d3a6071fb8..7e8b9de954 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -14,9 +14,12 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Game.Beatmaps; using osu.Game.Graphics.Sprites; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; using osu.Game.Overlays; using osu.Game.Overlays.Music; using osu.Game.Rulesets; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Tests.Visual { @@ -24,30 +27,51 @@ namespace osu.Game.Tests.Visual { public TestCasePerformancePoints(Ruleset ruleset) { - Children = new Drawable[] + Child = new FillFlowContainer { - new Container + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Children = new Drawable[] { - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - RelativeSizeAxes = Axes.Y, - Width = 300, - Children = new Drawable[] + new Container { - new Box + RelativeSizeAxes = Axes.Both, + Width = 0.25f, + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = 0.5f, - }, - new ScrollContainer(Direction.Vertical) - { - RelativeSizeAxes = Axes.Both, - Child = new BeatmapList(ruleset) + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.5f, + }, + new ScrollContainer(Direction.Vertical) + { + RelativeSizeAxes = Axes.Both, + Child = new BeatmapList(ruleset) + } } - } - }, - new PpDisplay(ruleset) + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Width = 0.75f, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.5f, + }, + new ScrollContainer(Direction.Vertical) + { + RelativeSizeAxes = Axes.Both, + Child = new ScoreList { RelativeSizeAxes = Axes.Both } + } + } + }, + } }; } @@ -144,70 +168,84 @@ namespace osu.Game.Tests.Visual } } - private class PpDisplay : CompositeDrawable + private class ScoreList : CompositeDrawable { - private readonly Container strainsContainer; - private readonly OsuSpriteText totalPp; + private readonly FillFlowContainer scores; + private APIAccess api; - private readonly Ruleset ruleset; - - public PpDisplay(Ruleset ruleset) + public ScoreList() { - this.ruleset = ruleset; - - RelativeSizeAxes = Axes.Y; - Width = 400; - - InternalChildren = new Drawable[] + InternalChild = scores = new FillFlowContainer { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = 0.2f - }, - totalPp = new OsuSpriteText { TextSize = 18 }, - new Container - { - AutoSizeAxes = Axes.Both, - Y = 26, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = 0.2f, - }, - strainsContainer = new FillFlowContainer - { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 5) - } - } - } + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 4) }; } [BackgroundDependencyLoader] - private void load(OsuGameBase osuGame) + private void load(OsuGameBase osuGame, APIAccess api) { + this.api = api; osuGame.Beatmap.ValueChanged += beatmapChanged; } - private void beatmapChanged(WorkingBeatmap beatmap) + private GetScoresRequest lastRequest; + private void beatmapChanged(WorkingBeatmap newBeatmap) { - var diffCalculator = ruleset.CreateDifficultyCalculator(beatmap.Beatmap); + lastRequest?.Cancel(); + scores.Clear(); - var strains = new Dictionary(); - double pp = diffCalculator.Calculate(strains); + lastRequest = new GetScoresRequest(newBeatmap.BeatmapInfo); + lastRequest.Success += res => res.Scores.ForEach(s => scores.Add(new ScoreDisplay(s, newBeatmap.Beatmap))); + api.Queue(lastRequest); + } - totalPp.Text = $"Total PP: {pp.ToString("n2")}"; + private class ScoreDisplay : CompositeDrawable + { + private readonly OsuSpriteText playerName; + private readonly GridContainer attributeGrid; - strainsContainer.Clear(); - foreach (var kvp in strains) - strainsContainer.Add(new OsuSpriteText { Text = $"{kvp.Key} : {kvp.Value}" }); + private readonly Score score; + private readonly Beatmap beatmap; + + public ScoreDisplay(Score score, Beatmap beatmap) + { + this.score = score; + this.beatmap = beatmap; + + RelativeSizeAxes = Axes.X; + Height = 16; + InternalChild = new GridContainer + { + RelativeSizeAxes = Axes.Both, + Content = new[] + { + new Drawable[] { playerName = new OsuSpriteText() }, + new Drawable[] { attributeGrid = new GridContainer { RelativeSizeAxes = Axes.Both } } + }, + RowDimensions = new[] + { + new Dimension(GridSizeMode.Relative, 0.75f), + new Dimension(GridSizeMode.Relative, 0.25f) + } + }; + } + + [BackgroundDependencyLoader] + private void load() + { + var ruleset = beatmap.BeatmapInfo.Ruleset.CreateInstance(); + var calculator = ruleset.CreatePerformanceCalculator(beatmap, score); + if (calculator == null) + return; + + var attributes = new Dictionary(); + double performance = calculator.Calculate(attributes); + + playerName.Text = $"{score.PP} | {performance.ToString("0.00")} | {score.PP / performance}"; + // var attributeRow = + } } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 8f0ce14305..a7f79b1ecd 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -620,6 +620,7 @@ + From 1ed2ce324fa5766d6c6c5b766902b7e09ebd5201 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 14:23:15 +0900 Subject: [PATCH 055/282] Further improvements to TestCasePerformancePoints --- .../Tests/Visual/TestCasePerformancePoints.cs | 255 +++++++++++++----- 1 file changed, 193 insertions(+), 62 deletions(-) diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index 7e8b9de954..3a1fc20060 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -6,19 +6,23 @@ using System.Linq; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; +using osu.Framework.Caching; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Game.Beatmaps; using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays; using osu.Game.Overlays.Music; using osu.Game.Rulesets; +using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; namespace osu.Game.Tests.Visual @@ -27,50 +31,77 @@ namespace osu.Game.Tests.Visual { public TestCasePerformancePoints(Ruleset ruleset) { - Child = new FillFlowContainer + Child = new GridContainer { RelativeSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Children = new Drawable[] + Content = new[] { - new Container + new Drawable[] { - RelativeSizeAxes = Axes.Both, - Width = 0.25f, - Children = new Drawable[] + new Container { - new Box + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = 0.5f, - }, - new ScrollContainer(Direction.Vertical) - { - RelativeSizeAxes = Axes.Both, - Child = new BeatmapList(ruleset) + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.5f, + }, + new ScrollContainer(Direction.Vertical) + { + RelativeSizeAxes = Axes.Both, + Child = new BeatmapList(ruleset) + } } - } - }, - new Container - { - RelativeSizeAxes = Axes.Both, - Width = 0.75f, - Children = new Drawable[] + }, + null, + new Container { - new Box + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = 0.5f, - }, - new ScrollContainer(Direction.Vertical) - { - RelativeSizeAxes = Axes.Both, - Child = new ScoreList { RelativeSizeAxes = Axes.Both } + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.5f, + }, + new ScrollContainer(Direction.Vertical) + { + RelativeSizeAxes = Axes.Both, + Child = new StarRatingGrid() + } } - } - }, + }, + null, + new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.5f, + }, + new ScrollContainer(Direction.Vertical) + { + RelativeSizeAxes = Axes.Both, + Child = new PerformanceList() + } + } + }, + } + }, + ColumnDimensions = new[] + { + new Dimension(), + new Dimension(GridSizeMode.Absolute, 20), + new Dimension(), + new Dimension(GridSizeMode.Absolute, 20) } }; } @@ -104,7 +135,7 @@ namespace osu.Game.Tests.Visual allBeatmaps.ForEach(b => beatmapDisplays.Add(new BeatmapDisplay(b))); } - private class BeatmapDisplay : CompositeDrawable + private class BeatmapDisplay : CompositeDrawable, IHasTooltip { private readonly OsuSpriteText text; private readonly BeatmapInfo beatmap; @@ -114,6 +145,8 @@ namespace osu.Game.Tests.Visual private bool isSelected; + public string TooltipText => text.Text; + public BeatmapDisplay(BeatmapInfo beatmap) { this.beatmap = beatmap; @@ -168,16 +201,19 @@ namespace osu.Game.Tests.Visual } } - private class ScoreList : CompositeDrawable + private class PerformanceList : CompositeDrawable { - private readonly FillFlowContainer scores; + private readonly FillFlowContainer scores; private APIAccess api; - public ScoreList() + public PerformanceList() { - InternalChild = scores = new FillFlowContainer + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + InternalChild = scores = new FillFlowContainer { - RelativeSizeAxes = Axes.Both, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 4) }; @@ -197,39 +233,25 @@ namespace osu.Game.Tests.Visual scores.Clear(); lastRequest = new GetScoresRequest(newBeatmap.BeatmapInfo); - lastRequest.Success += res => res.Scores.ForEach(s => scores.Add(new ScoreDisplay(s, newBeatmap.Beatmap))); + lastRequest.Success += res => res.Scores.ForEach(s => scores.Add(new PerformanceDisplay(s, newBeatmap.Beatmap))); api.Queue(lastRequest); } - private class ScoreDisplay : CompositeDrawable + private class PerformanceDisplay : CompositeDrawable { - private readonly OsuSpriteText playerName; - private readonly GridContainer attributeGrid; + private readonly OsuSpriteText text; private readonly Score score; private readonly Beatmap beatmap; - public ScoreDisplay(Score score, Beatmap beatmap) + public PerformanceDisplay(Score score, Beatmap beatmap) { this.score = score; this.beatmap = beatmap; RelativeSizeAxes = Axes.X; - Height = 16; - InternalChild = new GridContainer - { - RelativeSizeAxes = Axes.Both, - Content = new[] - { - new Drawable[] { playerName = new OsuSpriteText() }, - new Drawable[] { attributeGrid = new GridContainer { RelativeSizeAxes = Axes.Both } } - }, - RowDimensions = new[] - { - new Dimension(GridSizeMode.Relative, 0.75f), - new Dimension(GridSizeMode.Relative, 0.25f) - } - }; + AutoSizeAxes = Axes.Y; + InternalChild = text = new OsuSpriteText(); } [BackgroundDependencyLoader] @@ -243,8 +265,117 @@ namespace osu.Game.Tests.Visual var attributes = new Dictionary(); double performance = calculator.Calculate(attributes); - playerName.Text = $"{score.PP} | {performance.ToString("0.00")} | {score.PP / performance}"; - // var attributeRow = + text.Text = $"{score.User.Username} -> online: {score.PP:n2}pp | local: {performance:n2}pp"; + } + } + } + + private class StarRatingGrid : CompositeDrawable + { + private readonly FillFlowContainer modFlow; + private readonly OsuSpriteText totalText; + private readonly FillFlowContainer categoryTexts; + + public StarRatingGrid() + { + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + InternalChild = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new Drawable[] + { + modFlow = new FillFlowContainer + { + Name = "Checkbox flow", + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Spacing = new Vector2(4, 4) + }, + new FillFlowContainer + { + Name = "Information display", + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Spacing = new Vector2(0, 4), + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + totalText = new OsuSpriteText { TextSize = 24 }, + categoryTexts = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical + } + } + } + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuGameBase osuGame) + { + osuGame.Beatmap.ValueChanged += beatmapChanged; + } + + private Cached informationCache = new Cached(); + + private Ruleset ruleset; + private WorkingBeatmap beatmap; + + private void beatmapChanged(WorkingBeatmap newBeatmap) + { + beatmap = newBeatmap; + + modFlow.Clear(); + + ruleset = newBeatmap.BeatmapInfo.Ruleset.CreateInstance(); + foreach (var mod in ruleset.GetAllMods()) + { + var checkBox = new OsuCheckbox + { + RelativeSizeAxes = Axes.None, + Width = 50, + LabelText = mod.ShortenedName + }; + + checkBox.Current.ValueChanged += v => informationCache.Invalidate(); + modFlow.Add(checkBox); + } + + informationCache.Invalidate(); + } + + protected override void Update() + { + base.Update(); + + if (ruleset == null) + return; + + if (!informationCache.IsValid) + { + totalText.Text = string.Empty; + categoryTexts.Clear(); + + var allMods = ruleset.GetAllMods().ToList(); + Mod[] activeMods = modFlow.Where(c => c.Current.Value).Select(c => allMods.First(m => m.ShortenedName == c.LabelText)).ToArray(); + + var diffCalc = ruleset.CreateDifficultyCalculator(beatmap.Beatmap, activeMods); + if (diffCalc != null) + { + var categories = new Dictionary(); + double totalSr = diffCalc.Calculate(categories); + + totalText.Text = $"Star rating: {totalSr:n2}"; + foreach (var kvp in categories) + categoryTexts.Add(new OsuSpriteText { Text = $"{kvp.Key}: {kvp.Value:n2}" }); + } + + informationCache.Validate(); } } } From 825aa6570ee766028a50492575ba5e12212c7f31 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 14:29:19 +0900 Subject: [PATCH 056/282] Fix rebase issues --- osu.Game.Rulesets.Osu/OsuRuleset.cs | 1 + osu.Game/Rulesets/Ruleset.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 4a0a5ce0c9..de2e8233de 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -15,6 +15,7 @@ using osu.Framework.Graphics; using osu.Game.Overlays.Settings; using osu.Framework.Input.Bindings; using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Osu.Scoring; namespace osu.Game.Rulesets.Osu { diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 226a897126..d787da6a0a 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -10,6 +10,7 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets From bf44b3d0efd0ddc8da9d2016de75b756c5127484 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 16:54:50 +0900 Subject: [PATCH 057/282] Cleanups --- .../Tests/TestCasePerformancePoints.cs | 2 +- .../Tests/TestCasePerformancePoints.cs | 2 +- .../OsuDifficulty/OsuDifficultyCalculator.cs | 2 +- .../OsuDifficulty/Skills/Skill.cs | 4 ++-- .../Scoring/OsuPerformanceCalculator.cs | 15 +++++++-------- .../Tests/TestCasePerformancePoints.cs | 2 +- .../Tests/TestCasePerformancePoints.cs | 2 +- .../Rulesets/Scoring/PerformanceCalculator.cs | 2 +- .../Tests/Visual/TestCasePerformancePoints.cs | 16 ++++++---------- 9 files changed, 21 insertions(+), 26 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs index 071367b305..6643316f15 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs @@ -3,7 +3,7 @@ namespace osu.Game.Rulesets.Catch.Tests { - public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints + public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() : base(new CatchRuleset(new RulesetInfo())) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs index 420465c045..e60808b1a6 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs @@ -3,7 +3,7 @@ namespace osu.Game.Rulesets.Mania.Tests { - public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints + public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() : base(new ManiaRuleset(new RulesetInfo())) diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 537874f643..3ab1a60443 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty } foreach (Skill s in skills) - s.Process(h); + s.Process(h, TimeRate); } double aimRating = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs index b9632e18e2..ae75a4449b 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs @@ -38,9 +38,9 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Skills /// /// Process an and update current strain values accordingly. /// - public void Process(OsuDifficultyHitObject current) + public void Process(OsuDifficultyHitObject current, double timeRate) { - currentStrain *= strainDecay(current.DeltaTime); + currentStrain *= strainDecay(current.DeltaTime / timeRate); if (!(current.BaseObject is Spinner)) currentStrain += StrainValueOf(current) * SkillMultiplier; diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs index 32469b1bf7..93003925ef 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Linq; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Beatmaps; @@ -32,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Scoring { countHitCircles = Beatmap.HitObjects.Count(h => h is HitCircle); - beatmapMaxCombo = Beatmap.HitObjects.Count(); + beatmapMaxCombo = Beatmap.HitObjects.Count; beatmapMaxCombo += Beatmap.HitObjects.OfType().Sum(s => s.RepeatCount + s.Ticks.Count()); } @@ -84,10 +83,10 @@ namespace osu.Game.Rulesets.Osu.Scoring double aimValue = Math.Pow(5.0f * Math.Max(1.0f, double.Parse(Attributes["Aim"]) / 0.0675f) - 4.0f, 3.0f) / 100000.0f; // Longer maps are worth more - double LengthBonus = 0.95f + 0.4f * Math.Min(1.0f, totalHits / 2000.0f) + + double lengthBonus = 0.95f + 0.4f * Math.Min(1.0f, totalHits / 2000.0f) + (totalHits > 2000 ? Math.Log10(totalHits / 2000.0f) * 0.5f : 0.0f); - aimValue *= LengthBonus; + aimValue *= lengthBonus; // Penalize misses exponentially. This mainly fixes tag4 maps and the likes until a per-hitobject solution is available aimValue *= Math.Pow(0.97f, countMiss); @@ -117,13 +116,13 @@ namespace osu.Game.Rulesets.Osu.Scoring if (mods.Any(h => h is OsuModFlashlight)) { // Apply length bonus again if flashlight is on simply because it becomes a lot harder on longer maps. - aimValue *= 1.45f * LengthBonus; + aimValue *= 1.45f * lengthBonus; } // Scale the aim value with accuracy _slightly_ aimValue *= 0.5f + accuracy / 2.0f; // It is important to also consider accuracy difficulty when doing that - aimValue *= 0.98f + (Math.Pow(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, 2) / 2500); + aimValue *= 0.98f + Math.Pow(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, 2) / 2500; return aimValue; } @@ -146,7 +145,7 @@ namespace osu.Game.Rulesets.Osu.Scoring // Scale the speed value with accuracy _slightly_ speedValue *= 0.5f + accuracy / 2.0f; // It is important to also consider accuracy difficulty when doing that - speedValue *= 0.98f + (Math.Pow(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, 2) / 2500); + speedValue *= 0.98f + Math.Pow(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, 2) / 2500; return speedValue; } @@ -154,7 +153,7 @@ namespace osu.Game.Rulesets.Osu.Scoring private double computeAccuracyValue() { // This percentage only considers HitCircles of any value - in this part of the calculation we focus on hitting the timing hit window - double betterAccuracyPercentage = 0; + double betterAccuracyPercentage; int amountHitObjectsWithAccuracy = countHitCircles; if (amountHitObjectsWithAccuracy > 0) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs index b430803907..36590b484f 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs @@ -3,7 +3,7 @@ namespace osu.Game.Rulesets.Osu.Tests { - public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints + public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() : base(new OsuRuleset(new RulesetInfo())) diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs index a60c79fc6a..269aca2cd9 100644 --- a/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs @@ -3,7 +3,7 @@ namespace osu.Game.Rulesets.Taiko.Tests { - public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints + public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() : base(new TaikoRuleset(new RulesetInfo())) diff --git a/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs b/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs index 49b7ac54c6..359d6589ed 100644 --- a/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs +++ b/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs @@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Scoring protected readonly Beatmap Beatmap; protected readonly Score Score; - public PerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score) + protected PerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score) { Beatmap = CreateBeatmapConverter().Convert(beatmap); Score = score; diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index 3a1fc20060..cd1005593e 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -12,15 +12,12 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Game.Beatmaps; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using osu.Game.Online.API.Requests; -using osu.Game.Overlays; -using osu.Game.Overlays.Music; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; @@ -29,7 +26,7 @@ namespace osu.Game.Tests.Visual { public abstract class TestCasePerformancePoints : OsuTestCase { - public TestCasePerformancePoints(Ruleset ruleset) + protected TestCasePerformancePoints(Ruleset ruleset) { Child = new GridContainer { @@ -49,7 +46,7 @@ namespace osu.Game.Tests.Visual Colour = Color4.Black, Alpha = 0.5f, }, - new ScrollContainer(Direction.Vertical) + new ScrollContainer { RelativeSizeAxes = Axes.Both, Child = new BeatmapList(ruleset) @@ -68,7 +65,7 @@ namespace osu.Game.Tests.Visual Colour = Color4.Black, Alpha = 0.5f, }, - new ScrollContainer(Direction.Vertical) + new ScrollContainer { RelativeSizeAxes = Axes.Both, Child = new StarRatingGrid() @@ -87,7 +84,7 @@ namespace osu.Game.Tests.Visual Colour = Color4.Black, Alpha = 0.5f, }, - new ScrollContainer(Direction.Vertical) + new ScrollContainer { RelativeSizeAxes = Axes.Both, Child = new PerformanceList() @@ -127,7 +124,7 @@ namespace osu.Game.Tests.Visual } [BackgroundDependencyLoader] - private void load(OsuGameBase osuGame, BeatmapManager beatmaps) + private void load(BeatmapManager beatmaps) { var sets = beatmaps.GetAllUsableBeatmapSets(); var allBeatmaps = sets.SelectMany(s => s.Beatmaps).Where(b => ruleset.LegacyID < 0 || b.RulesetID == ruleset.LegacyID); @@ -186,7 +183,6 @@ namespace osu.Game.Tests.Visual this.osuGame = osuGame; this.beatmaps = beatmaps; - var working = beatmaps.GetWorkingBeatmap(beatmap); text.Text = $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title} ({beatmap.Metadata.AuthorString}) [{beatmap.Version}]"; osuGame.Beatmap.ValueChanged += beatmapChanged; @@ -372,7 +368,7 @@ namespace osu.Game.Tests.Visual totalText.Text = $"Star rating: {totalSr:n2}"; foreach (var kvp in categories) - categoryTexts.Add(new OsuSpriteText { Text = $"{kvp.Key}: {kvp.Value:n2}" }); + categoryTexts.Add(new OsuSpriteText { Text = $"{kvp.Key}: {kvp.Value}" }); } informationCache.Validate(); From 5d753427f6edf05ee9a788c39d273d86146a403a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 17:28:22 +0900 Subject: [PATCH 058/282] Fix up DT not affecting hitobject densities --- .../OsuDifficulty/OsuDifficultyCalculator.cs | 4 ++-- .../OsuDifficulty/Preprocessing/OsuDifficultyBeatmap.cs | 8 ++++---- .../OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs | 8 ++++++-- osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs | 4 ++-- osu.Game/Tests/Visual/TestCasePerformancePoints.cs | 3 ++- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 3ab1a60443..4f41d3b8e2 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty public override double Calculate(Dictionary categoryDifficulty = null) { - OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Beatmap.HitObjects); + OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Beatmap.HitObjects, TimeRate); Skill[] skills = { new Aim(), @@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty } foreach (Skill s in skills) - s.Process(h, TimeRate); + s.Process(h); } double aimRating = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyBeatmap.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyBeatmap.cs index c6ecc3a506..f8e9423e29 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyBeatmap.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyBeatmap.cs @@ -20,12 +20,12 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing /// Creates an enumerator, which preprocesses a list of s recieved as input, wrapping them as /// which contains extra data required for difficulty calculation. /// - public OsuDifficultyBeatmap(List objects) + public OsuDifficultyBeatmap(List objects, double timeRate) { // Sort OsuHitObjects by StartTime - they are not correctly ordered in some cases. // This should probably happen before the objects reach the difficulty calculator. objects.Sort((a, b) => a.StartTime.CompareTo(b.StartTime)); - difficultyObjects = createDifficultyObjectEnumerator(objects); + difficultyObjects = createDifficultyObjectEnumerator(objects, timeRate); } /// @@ -67,7 +67,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - private IEnumerator createDifficultyObjectEnumerator(List objects) + private IEnumerator createDifficultyObjectEnumerator(List objects, double timeRate) { // We will process OsuHitObjects in groups of three to form a triangle, so we can calculate an angle for each object. OsuHitObject[] triangle = new OsuHitObject[3]; @@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing triangle[1] = triangle[0]; triangle[0] = objects[i]; - yield return new OsuDifficultyHitObject(triangle); + yield return new OsuDifficultyHitObject(triangle, timeRate); } } } diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs index bdeb62df3e..17d95990d5 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -33,13 +33,17 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing private const int normalized_radius = 52; + private readonly double timeRate; + private readonly OsuHitObject[] t; /// /// Initializes the object calculating extra data required for difficulty calculation. /// - public OsuDifficultyHitObject(OsuHitObject[] triangle) + public OsuDifficultyHitObject(OsuHitObject[] triangle, double timeRate) { + this.timeRate = timeRate; + t = triangle; BaseObject = t[0]; setDistances(); @@ -63,7 +67,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing private void setTimingValues() { // Every timing inverval is hard capped at the equivalent of 375 BPM streaming speed as a safety measure. - DeltaTime = Math.Max(40, t[0].StartTime - t[1].StartTime); + DeltaTime = Math.Max(40, t[0].StartTime - t[1].StartTime) / timeRate; TimeUntilHit = 450; // BaseObject.PreEmpt; } } diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs index ae75a4449b..b9632e18e2 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs @@ -38,9 +38,9 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Skills /// /// Process an and update current strain values accordingly. /// - public void Process(OsuDifficultyHitObject current, double timeRate) + public void Process(OsuDifficultyHitObject current) { - currentStrain *= strainDecay(current.DeltaTime / timeRate); + currentStrain *= strainDecay(current.DeltaTime); if (!(current.BaseObject is Spinner)) currentStrain += StrainValueOf(current) * SkillMultiplier; diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index cd1005593e..6b2ab6433b 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -183,7 +183,8 @@ namespace osu.Game.Tests.Visual this.osuGame = osuGame; this.beatmaps = beatmaps; - text.Text = $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title} ({beatmap.Metadata.AuthorString}) [{beatmap.Version}]"; + var working = beatmaps.GetWorkingBeatmap(beatmap); + text.Text = $"{working.Metadata.Artist} - {working.Metadata.Title} ({working.Metadata.AuthorString}) [{working.BeatmapInfo.Version}]"; osuGame.Beatmap.ValueChanged += beatmapChanged; } From 8bd59ff0b3614f1a39e33e8e0309246e7ca6c0b4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2017 17:40:10 +0900 Subject: [PATCH 059/282] Fix osu! logo occasionally being in the wrong state on entering the main menu --- osu.Game/Screens/Menu/ButtonSystem.cs | 60 +++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index af16fbd71c..ac597cd9d7 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -55,6 +55,8 @@ namespace osu.Game.Screens.Menu // osuLogo.SizeForFlow relies on loading to be complete. buttonFlow.Position = new Vector2(WEDGE_WIDTH * 2 - (BUTTON_WIDTH + this.logo.SizeForFlow / 4), 0); + + updateLogoState(); } } @@ -217,6 +219,8 @@ namespace osu.Game.Screens.Menu if (state == MenuState.TopLevel) buttonArea.FinishTransforms(true); + updateLogoState(lastState); + using (buttonArea.BeginDelayedSequence(lastState == MenuState.Initial ? 150 : 0, true)) { switch (state) @@ -320,6 +324,62 @@ namespace osu.Game.Screens.Menu } } + private void updateLogoState(MenuState lastState = MenuState.Initial) + { + switch (state) + { + case MenuState.Exit: + case MenuState.Initial: + trackingPosition = false; + + logo?.Delay(150) + .Schedule(() => + { + toolbar?.Hide(); + + logo.ClearTransforms(targetMember: nameof(Position)); + logo.RelativePositionAxes = Axes.Both; + + logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); + logo.ScaleTo(1, 800, Easing.OutExpo); + }); + + break; + case MenuState.TopLevel: + case MenuState.Play: + logo.ClearTransforms(targetMember: nameof(Position)); + logo.RelativePositionAxes = Axes.None; + + trackingPosition = true; + + switch (lastState) + { + case MenuState.Initial: + logo.ScaleTo(0.5f, 200, Easing.In); + + trackingPosition = false; + + logo + .MoveTo(iconTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) + .OnComplete(o => + { + trackingPosition = true; + + o.Impact(); + toolbar?.Show(); + }); + break; + default: + logo.ScaleTo(0.5f, 200, Easing.OutQuint); + break; + } + break; + case MenuState.EnteringMode: + trackingPosition = true; + break; + } + } + private Vector2 iconTrackingPosition => logo.Parent.ToLocalSpace(iconFacade.ScreenSpaceDrawQuad.Centre); private bool trackingPosition; From d62da4334eae5a8b710f189bdee3862d6563dfbf Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 17 Nov 2017 12:26:13 +0300 Subject: [PATCH 060/282] Add and place all the bottom bar objects --- .../Edit/Components/BottomBarContainer.cs | 44 +++++++++ .../Edit/Components/PlaybackContainer.cs | 9 ++ .../Edit/Components/TimeInfoContainer.cs | 9 ++ .../Timelines/Summary/SummaryTimeline.cs | 98 ++++++++----------- osu.Game/Screens/Edit/Editor.cs | 40 +++++--- osu.Game/osu.Game.csproj | 3 + 6 files changed, 130 insertions(+), 73 deletions(-) create mode 100644 osu.Game/Screens/Edit/Components/BottomBarContainer.cs create mode 100644 osu.Game/Screens/Edit/Components/PlaybackContainer.cs create mode 100644 osu.Game/Screens/Edit/Components/TimeInfoContainer.cs diff --git a/osu.Game/Screens/Edit/Components/BottomBarContainer.cs b/osu.Game/Screens/Edit/Components/BottomBarContainer.cs new file mode 100644 index 0000000000..d1813a9c7b --- /dev/null +++ b/osu.Game/Screens/Edit/Components/BottomBarContainer.cs @@ -0,0 +1,44 @@ +// 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.Framework.Graphics.Shapes; +using osu.Game.Graphics; + +namespace osu.Game.Screens.Edit.Components +{ + public class BottomBarContainer : Container + { + private const float corner_radius = 5; + private const float contents_padding = 15; + + private readonly Drawable background; + private readonly Container content; + + protected override Container Content => content; + + public BottomBarContainer() + { + Masking = true; + CornerRadius = corner_radius; + + InternalChildren = new[] + { + background = new Box { RelativeSizeAxes = Axes.Both }, + content = new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Horizontal = contents_padding }, + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + background.Colour = colours.Gray1; + } + } +} diff --git a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs new file mode 100644 index 0000000000..aeed10357b --- /dev/null +++ b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs @@ -0,0 +1,9 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Screens.Edit.Components +{ + public class PlaybackContainer : BottomBarContainer + { + } +} diff --git a/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs b/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs new file mode 100644 index 0000000000..739a67219d --- /dev/null +++ b/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs @@ -0,0 +1,9 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Screens.Edit.Components +{ + public class TimeInfoContainer : BottomBarContainer + { + } +} diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs index 4d925f7584..4543679363 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs @@ -16,83 +16,66 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary /// /// The timeline that sits at the bottom of the editor. /// - public class SummaryTimeline : CompositeDrawable + public class SummaryTimeline : BottomBarContainer { - private const float corner_radius = 5; - private const float contents_padding = 15; - public Bindable Beatmap = new Bindable(); - private readonly Drawable background; - private readonly Drawable timelineBar; public SummaryTimeline() { - Masking = true; - CornerRadius = corner_radius; - TimelinePart markerPart, controlPointPart, bookmarkPart, breakPart; - InternalChildren = new[] + Children = new[] { - background = new Box { RelativeSizeAxes = Axes.Both }, - new Container + markerPart = new MarkerPart { RelativeSizeAxes = Axes.Both }, + controlPointPart = new ControlPointPart + { + Anchor = Anchor.Centre, + Origin = Anchor.BottomCentre, + RelativeSizeAxes = Axes.Both, + Height = 0.35f + }, + bookmarkPart = new BookmarkPart + { + Anchor = Anchor.Centre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.Both, + Height = 0.35f + }, + timelineBar = new Container { RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Left = contents_padding, Right = contents_padding }, - Children = new[] + Children = new Drawable[] { - markerPart = new MarkerPart { RelativeSizeAxes = Axes.Both }, - controlPointPart = new ControlPointPart + new Circle { - Anchor = Anchor.Centre, - Origin = Anchor.BottomCentre, - RelativeSizeAxes = Axes.Both, - Height = 0.35f + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreRight, + Size = new Vector2(5) }, - bookmarkPart = new BookmarkPart + new Box { - Anchor = Anchor.Centre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.Both, - Height = 0.35f + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + RelativeSizeAxes = Axes.X, + Height = 1, + EdgeSmoothness = new Vector2(0, 1), }, - timelineBar = new Container + new Circle { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - new Circle - { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreRight, - Size = new Vector2(5) - }, - new Box - { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - RelativeSizeAxes = Axes.X, - Height = 1, - EdgeSmoothness = new Vector2(0, 1), - }, - new Circle - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreLeft, - Size = new Vector2(5) - }, - } + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreLeft, + Size = new Vector2(5) }, - breakPart = new BreakPart - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Height = 0.25f - } } + }, + breakPart = new BreakPart + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Height = 0.25f } }; @@ -105,7 +88,6 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary [BackgroundDependencyLoader] private void load(OsuColour colours) { - background.Colour = colours.Gray1; timelineBar.Colour = colours.Gray5; } } diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 74e55e58ad..2aef9b11e2 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -17,6 +17,7 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Edit.Screens; using osu.Game.Screens.Edit.Screens.Compose; using osu.Game.Screens.Edit.Screens.Design; +using osu.Game.Screens.Edit.Components; namespace osu.Game.Screens.Edit { @@ -34,7 +35,9 @@ namespace osu.Game.Screens.Edit public Editor() { EditorMenuBar menuBar; + TimeInfoContainer timeInfo; SummaryTimeline timeline; + PlaybackContainer playback; Children = new[] { @@ -84,23 +87,30 @@ namespace osu.Game.Screens.Edit new Container { RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 10 }, - Child = new FillFlowContainer + Padding = new MarginPadding { Vertical = 5, Horizontal = 10 }, + Children = new Drawable[] { - Name = "Bottom bar", - RelativeSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Spacing = new Vector2(10, 0), - Children = new[] + timeInfo = new TimeInfoContainer { - timeline = new SummaryTimeline - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Width = 0.65f - } - } + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + RelativeSizeAxes = Axes.Both, + Width = 0.17f + }, + timeline = new SummaryTimeline + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Width = 0.65f + }, + playback = new PlaybackContainer + { + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + RelativeSizeAxes = Axes.Both, + Width = 0.17f + }, } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7b479bdba2..63dbb06491 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -294,6 +294,9 @@ + + + From d75e3d8e818e68f8b6e2f6024fcc41a4f37dca32 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2017 18:35:54 +0900 Subject: [PATCH 061/282] Use lazy for WorkingBeatmap component loading --- osu.Game/Beatmaps/WorkingBeatmap.cs | 129 +++++++++++----------------- 1 file changed, 50 insertions(+), 79 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 959e71d48d..9ae87bc0a7 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -28,16 +28,10 @@ namespace osu.Game.Beatmaps Metadata = beatmapInfo.Metadata ?? BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); Mods.ValueChanged += mods => applyRateAdjustments(); - } - private void applyRateAdjustments() - { - var t = track; - if (t == null) return; - - t.ResetSpeedAdjustments(); - foreach (var mod in Mods.Value.OfType()) - mod.ApplyToClock(t); + beatmap = new Lazy(populateBeatmap); + background = new Lazy(populateBackground); + track = new Lazy(populateTrack); } protected abstract Beatmap GetBeatmap(); @@ -45,98 +39,75 @@ namespace osu.Game.Beatmaps protected abstract Track GetTrack(); protected virtual Waveform GetWaveform() => new Waveform(); - private Beatmap beatmap; - private readonly object beatmapLock = new object(); - public Beatmap Beatmap + public bool BeatmapLoaded => beatmap.IsValueCreated; + public Beatmap Beatmap => beatmap.Value; + private readonly Lazy beatmap; + + private Beatmap populateBeatmap() { - get - { - lock (beatmapLock) - { - if (beatmap != null) return beatmap; + var b = GetBeatmap() ?? new Beatmap(); - beatmap = GetBeatmap() ?? new Beatmap(); + // use the database-backed info. + b.BeatmapInfo = BeatmapInfo; - // use the database-backed info. - beatmap.BeatmapInfo = BeatmapInfo; - - return beatmap; - } - } + return b; } - private readonly object backgroundLock = new object(); - private Texture background; - public Texture Background + public bool BackgroundLoaded => background.IsValueCreated; + public Texture Background => background.Value; + private Lazy background; + + private Texture populateBackground() => GetBackground(); + + public bool TrackLoaded => track.IsValueCreated; + public Track Track => track.Value; + private Lazy track; + + private Track populateTrack() { - get - { - lock (backgroundLock) - { - return background ?? (background = GetBackground()); - } - } + // we want to ensure that we always have a track, even if it's a fake one. + var t = GetTrack() ?? new TrackVirtual(); + applyRateAdjustments(t); + return t; } - private Track track; - private readonly object trackLock = new object(); - public Track Track - { - get - { - lock (trackLock) - { - if (track != null) return track; + public bool WaveformLoaded => waveform.IsValueCreated; + public Waveform Waveform => waveform.Value; + private Lazy waveform; - // we want to ensure that we always have a track, even if it's a fake one. - track = GetTrack() ?? new TrackVirtual(); - - applyRateAdjustments(); - return track; - } - } - } - - private Waveform waveform; - private readonly object waveformLock = new object(); - public Waveform Waveform - { - get - { - lock (waveformLock) - return waveform ?? (waveform = GetWaveform()); - } - } - - public bool TrackLoaded => track != null; + private Waveform populateWaveform() => GetWaveform(); public void TransferTo(WorkingBeatmap other) { - lock (trackLock) - { - if (track != null && BeatmapInfo.AudioEquals(other.BeatmapInfo)) - other.track = track; - } + if (track.IsValueCreated && track.Value != null && BeatmapInfo.AudioEquals(other.BeatmapInfo)) + other.track = track; - if (background != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo)) + if (background.IsValueCreated && background.Value != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo)) other.background = background; } public virtual void Dispose() { - background?.Dispose(); - background = null; - - waveform?.Dispose(); + if (BackgroundLoaded) Background.Dispose(); + if (WaveformLoaded) Waveform.Dispose(); } public void DisposeTrack() { - lock (trackLock) - { - track?.Dispose(); - track = null; - } + if (!track.IsValueCreated) return; + + track.Value?.Dispose(); + track = null; + } + + private void applyRateAdjustments(Track t = null) + { + if (t == null && track.IsValueCreated) t = track.Value; + if (t == null) return; + + t.ResetSpeedAdjustments(); + foreach (var mod in Mods.Value.OfType()) + mod.ApplyToClock(t); } } } From b3aae2340b7dcd4816efe7c860b7ac7725c5f054 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2017 18:36:24 +0900 Subject: [PATCH 062/282] Avoid accessing beatmaps from BeatSyncedContainer until they are loaded --- osu.Game/Graphics/Containers/BeatSyncedContainer.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Containers/BeatSyncedContainer.cs b/osu.Game/Graphics/Containers/BeatSyncedContainer.cs index 123ef0662d..fb85af12cb 100644 --- a/osu.Game/Graphics/Containers/BeatSyncedContainer.cs +++ b/osu.Game/Graphics/Containers/BeatSyncedContainer.cs @@ -35,9 +35,12 @@ namespace osu.Game.Graphics.Containers protected override void Update() { - var track = Beatmap.Value.Track; + if (!Beatmap.Value.TrackLoaded || !Beatmap.Value.BeatmapLoaded) return; - if (track == null) + var track = Beatmap.Value.Track; + var beatmap = Beatmap.Value.Beatmap; + + if (track == null || beatmap == null) return; double currentTrackTime = track.Length > 0 ? track.CurrentTime + EarlyActivationMilliseconds : Clock.CurrentTime; From 6b591ac77f4d4f2c4c173fcf41248f18ef76c183 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2017 19:12:30 +0900 Subject: [PATCH 063/282] Add missing initialisation --- osu.Game/Beatmaps/WorkingBeatmap.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 9ae87bc0a7..c9acbefd87 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -32,6 +32,7 @@ namespace osu.Game.Beatmaps beatmap = new Lazy(populateBeatmap); background = new Lazy(populateBackground); track = new Lazy(populateTrack); + waveform = new Lazy(populateWaveform); } protected abstract Beatmap GetBeatmap(); @@ -73,7 +74,7 @@ namespace osu.Game.Beatmaps public bool WaveformLoaded => waveform.IsValueCreated; public Waveform Waveform => waveform.Value; - private Lazy waveform; + private readonly Lazy waveform; private Waveform populateWaveform() => GetWaveform(); From cc04d5bc616f32046d930bf42dca434fdd097c51 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 17 Nov 2017 13:35:41 +0300 Subject: [PATCH 064/282] Add all the objects to the PlaybackContainer --- .../Edit/Components/BottomBarContainer.cs | 4 + .../Edit/Components/PlaybackContainer.cs | 161 ++++++++++++++++++ .../Timelines/Summary/SummaryTimeline.cs | 4 - osu.Game/Screens/Edit/Editor.cs | 2 + 4 files changed, 167 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Edit/Components/BottomBarContainer.cs b/osu.Game/Screens/Edit/Components/BottomBarContainer.cs index d1813a9c7b..b230032937 100644 --- a/osu.Game/Screens/Edit/Components/BottomBarContainer.cs +++ b/osu.Game/Screens/Edit/Components/BottomBarContainer.cs @@ -2,9 +2,11 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Game.Beatmaps; using osu.Game.Graphics; namespace osu.Game.Screens.Edit.Components @@ -14,6 +16,8 @@ namespace osu.Game.Screens.Edit.Components private const float corner_radius = 5; private const float contents_padding = 15; + public Bindable Beatmap = new Bindable(); + private readonly Drawable background; private readonly Container content; diff --git a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs index aeed10357b..23484464bf 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs @@ -1,9 +1,170 @@ // 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.Allocation; +using osu.Framework.Audio.Track; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.UserInterface; +using osu.Framework.Input; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; + namespace osu.Game.Screens.Edit.Components { public class PlaybackContainer : BottomBarContainer { + private readonly IconButton playButton; + + private bool lastTrackState; + private Track track => Beatmap.Value.Track; + + public PlaybackContainer() + { + PlaybackTabControl tabs; + + Children = new Drawable[] + { + playButton = new IconButton + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.Centre, + Scale = new Vector2(1.4f), + IconScale = new Vector2(1.4f), + Icon = FontAwesome.fa_play_circle_o, + Action = play, + Padding = new MarginPadding { Left = 20 } + }, + new OsuSpriteText + { + Origin = Anchor.BottomLeft, + Text = "Playback Speed", + RelativePositionAxes = Axes.Y, + Y = 0.5f, + Padding = new MarginPadding { Left = 45 } + }, + new Container + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + RelativeSizeAxes = Axes.Both, + Height = 0.5f, + Padding = new MarginPadding { Left = 45 }, + Child = tabs = new PlaybackTabControl(), + } + }; + + tabs.AddItem(0.25); + tabs.AddItem(0.75); + tabs.AddItem(1); + + tabs.Current.ValueChanged += newValue => track.Tempo.Value = newValue; + } + + private void play() + { + if (track.IsRunning) + track.Stop(); + else + track.Start(); + } + + protected override void Update() + { + base.Update(); + + var currentTrackState = track.IsRunning; + if (currentTrackState == lastTrackState) + return; + + playButton.Icon = currentTrackState ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o; + + lastTrackState = currentTrackState; + } + + private class PlaybackTabControl : OsuTabControl + { + protected override TabItem CreateTabItem(double value) => new PlaybackTabItem(value); + + protected override Dropdown CreateDropdown() => null; + + public PlaybackTabControl() + { + RelativeSizeAxes = Axes.Both; + TabContainer.Spacing = new Vector2(20, 0); + } + + public class PlaybackTabItem : TabItem + { + private const float fade_duration = 100; + + private readonly OsuSpriteText text; + private readonly OsuSpriteText textBold; + + public PlaybackTabItem(double value) : base(value) + { + AutoSizeAxes = Axes.X; + RelativeSizeAxes = Axes.Y; + + Children = new Drawable[] + { + text = new OsuSpriteText + { + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Text = $"{value:P0}", + TextSize = 14, + }, + textBold = new OsuSpriteText + { + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Text = $"{value:P0}", + TextSize = 14, + Font = @"Exo2.0-Bold", + Alpha = 0, + AlwaysPresent = true, + }, + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + text.Colour = colours.Gray5; + } + + protected override bool OnHover(InputState state) + { + if (!Active) + toBold(); + return true; + } + + protected override void OnHoverLost(InputState state) + { + if (!Active) + toNormal(); + } + + private void toBold() + { + text.FadeOut(fade_duration); + textBold.FadeIn(fade_duration); + } + + private void toNormal() + { + text.FadeIn(fade_duration); + textBold.FadeOut(fade_duration); + } + + protected override void OnActivated() => toBold(); + + protected override void OnDeactivated() => toNormal(); + } + } } } diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs index 4543679363..a63d02a0a5 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs @@ -3,11 +3,9 @@ using OpenTK; using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts; @@ -18,8 +16,6 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary /// public class SummaryTimeline : BottomBarContainer { - public Bindable Beatmap = new Bindable(); - private readonly Drawable timelineBar; public SummaryTimeline() diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 2aef9b11e2..51af6e2f5e 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -117,7 +117,9 @@ namespace osu.Game.Screens.Edit }, }; + timeInfo.Beatmap.BindTo(Beatmap); timeline.Beatmap.BindTo(Beatmap); + playback.Beatmap.BindTo(Beatmap); menuBar.Mode.ValueChanged += onModeChanged; } From 1680c0905fb06f5201561cd8c37dadbb821048a4 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 17 Nov 2017 14:02:07 +0300 Subject: [PATCH 065/282] Fix track tempo could be less than 1 on exiting the editor --- osu.Game/Screens/Edit/Editor.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 51af6e2f5e..6865debd27 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -166,6 +166,7 @@ namespace osu.Game.Screens.Edit protected override bool OnExiting(Screen next) { Background.FadeColour(Color4.White, 500); + Beatmap.Value.Track.Tempo.Value = 1; Beatmap.Value.Track?.Start(); return base.OnExiting(next); } From 07e0aba01c1aafa7f70c0ba91caba80d9a480e52 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 17 Nov 2017 14:10:13 +0300 Subject: [PATCH 066/282] Remove using --- osu.Game/Screens/Edit/Editor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 6865debd27..fd85db595a 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Screens.Edit.Menus; using osu.Game.Screens.Edit.Components.Timelines.Summary; -using OpenTK; using osu.Framework.Allocation; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; From 433f4f03a108f80e12776ef24af3d198ba7e6838 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 20:19:49 +0900 Subject: [PATCH 067/282] Actually initialise DifficultyCalculator with mods --- osu.Game/Rulesets/Scoring/PerformanceCalculator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs b/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs index 359d6589ed..000e279d11 100644 --- a/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs +++ b/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Scoring Beatmap = CreateBeatmapConverter().Convert(beatmap); Score = score; - var diffCalc = ruleset.CreateDifficultyCalculator(beatmap); + var diffCalc = ruleset.CreateDifficultyCalculator(beatmap, score.Mods); diffCalc.Calculate(attributes); } From c7ffe6fe5873c5d489e123b7b7e3d11162d9d074 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 20:27:44 +0900 Subject: [PATCH 068/282] Fix timeRate dividing incorrectly --- .../OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs index 17d95990d5..05738f1a7d 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -67,7 +67,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing private void setTimingValues() { // Every timing inverval is hard capped at the equivalent of 375 BPM streaming speed as a safety measure. - DeltaTime = Math.Max(40, t[0].StartTime - t[1].StartTime) / timeRate; + DeltaTime = Math.Max(40, (t[0].StartTime - t[1].StartTime) / timeRate); TimeUntilHit = 450; // BaseObject.PreEmpt; } } From c221cfd30c0cb2d7ecca73461b028e5b2dee34b9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 20:28:41 +0900 Subject: [PATCH 069/282] Fix slider cursor positions not being taken into account --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 6 ++++ .../Preprocessing/OsuDifficultyHitObject.cs | 36 ++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 112fcb1a30..2f6b5c7e68 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -45,6 +45,12 @@ namespace osu.Game.Rulesets.Osu.Objects set { Curve.Distance = value; } } + /// + /// The position of the cursor at the point of completion of this . + /// This is set and used by difficulty calculation. + /// + internal Vector2? CursorPosition; + public List RepeatSamples { get; set; } = new List(); public int RepeatCount { get; set; } = 1; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs index 05738f1a7d..48f9bcce32 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -2,6 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; +using OpenTK; using osu.Game.Rulesets.Osu.Objects; namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing @@ -61,7 +63,39 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing scalingFactor *= 1 + smallCircleBonus; } - Distance = (t[0].StackedPosition - t[1].StackedPosition).Length * scalingFactor; + Vector2 lastCursorPosition = t[1].StackedPosition; + + var lastSlider = t[1] as Slider; + if (lastSlider != null) + { + if (lastSlider.CursorPosition == null) + { + float approxFollowCircleRadius = (float)(lastSlider.Radius * scalingFactor * 3); + + var computeVertex = new Action(t => + { + var diff = lastSlider.PositionAt(t) - lastCursorPosition; + float dist = diff.Length; + + if (dist > approxFollowCircleRadius) + { + // The cursor would be outside the follow circle, we need to move it + diff.Normalize(); // Obtain direction of diff + dist -= approxFollowCircleRadius; + lastCursorPosition += diff * dist; + } + }); + + var scoringTimes = lastSlider.Ticks.Select(t => t.StartTime).Concat(lastSlider.RepeatPoints.Select(r => r.StartTime)).OrderBy(t => t); + foreach (var time in scoringTimes) + computeVertex(time); + computeVertex(lastSlider.EndTime); + + lastSlider.CursorPosition = lastCursorPosition; + } + } + + Distance = (BaseObject.StackedPosition - lastCursorPosition).Length * scalingFactor; } private void setTimingValues() From 9260f5b64e85267cd1c2db349a86cf7e46f1116a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 20:57:45 +0900 Subject: [PATCH 070/282] Rework to avoid access to modified closures --- .../Preprocessing/OsuDifficultyHitObject.cs | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs index 48f9bcce32..fd58ca9e6b 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -68,31 +68,8 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing var lastSlider = t[1] as Slider; if (lastSlider != null) { - if (lastSlider.CursorPosition == null) - { - float approxFollowCircleRadius = (float)(lastSlider.Radius * scalingFactor * 3); - - var computeVertex = new Action(t => - { - var diff = lastSlider.PositionAt(t) - lastCursorPosition; - float dist = diff.Length; - - if (dist > approxFollowCircleRadius) - { - // The cursor would be outside the follow circle, we need to move it - diff.Normalize(); // Obtain direction of diff - dist -= approxFollowCircleRadius; - lastCursorPosition += diff * dist; - } - }); - - var scoringTimes = lastSlider.Ticks.Select(t => t.StartTime).Concat(lastSlider.RepeatPoints.Select(r => r.StartTime)).OrderBy(t => t); - foreach (var time in scoringTimes) - computeVertex(time); - computeVertex(lastSlider.EndTime); - - lastSlider.CursorPosition = lastCursorPosition; - } + computeSliderCursorPosition(lastSlider); + lastCursorPosition = lastSlider.CursorPosition ?? lastCursorPosition; } Distance = (BaseObject.StackedPosition - lastCursorPosition).Length * scalingFactor; @@ -104,5 +81,32 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing DeltaTime = Math.Max(40, (t[0].StartTime - t[1].StartTime) / timeRate); TimeUntilHit = 450; // BaseObject.PreEmpt; } + + private void computeSliderCursorPosition(Slider slider) + { + if (slider.CursorPosition != null) + return; + slider.CursorPosition = slider.StackedPosition; + + float approxFollowCircleRadius = (float)(slider.Radius * 3); + var computeVertex = new Action(t => + { + var diff = slider.PositionAt(t) - slider.CursorPosition.Value; + float dist = diff.Length; + + if (dist > approxFollowCircleRadius) + { + // The cursor would be outside the follow circle, we need to move it + diff.Normalize(); // Obtain direction of diff + dist -= approxFollowCircleRadius; + slider.CursorPosition += diff * dist; + } + }); + + var scoringTimes = slider.Ticks.Select(t => t.StartTime).Concat(slider.RepeatPoints.Select(r => r.StartTime)).OrderBy(t => t); + foreach (var time in scoringTimes) + computeVertex(time); + computeVertex(slider.EndTime); + } } } From eb03b0db302236fbbbd18538ffafdf683620944c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 21:28:59 +0900 Subject: [PATCH 071/282] Consider slider lengths as part of Distance --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 12 +++++++++--- .../Preprocessing/OsuDifficultyHitObject.cs | 15 +++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 2f6b5c7e68..39ec753fe1 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -46,10 +46,16 @@ namespace osu.Game.Rulesets.Osu.Objects } /// - /// The position of the cursor at the point of completion of this . - /// This is set and used by difficulty calculation. + /// The position of the cursor at the point of completion of this if it was hit + /// with as few movements as possible. This is set and used by difficulty calculation. /// - internal Vector2? CursorPosition; + internal Vector2? LazyEndPosition; + + /// + /// The distance travelled by the cursor upon completion of this if it was hit + /// with as few movements as possible. This is set and used by difficulty calculation. + /// + internal float LazyTravelDistance; public List RepeatSamples { get; set; } = new List(); public int RepeatCount { get; set; } = 1; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs index fd58ca9e6b..972677a6f1 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -64,15 +64,17 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing } Vector2 lastCursorPosition = t[1].StackedPosition; + float lastTravelDistance = 0; var lastSlider = t[1] as Slider; if (lastSlider != null) { computeSliderCursorPosition(lastSlider); - lastCursorPosition = lastSlider.CursorPosition ?? lastCursorPosition; + lastCursorPosition = lastSlider.LazyEndPosition ?? lastCursorPosition; + lastTravelDistance = lastSlider.LazyTravelDistance; } - Distance = (BaseObject.StackedPosition - lastCursorPosition).Length * scalingFactor; + Distance = (lastTravelDistance + (BaseObject.StackedPosition - lastCursorPosition).Length) * scalingFactor; } private void setTimingValues() @@ -84,14 +86,14 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing private void computeSliderCursorPosition(Slider slider) { - if (slider.CursorPosition != null) + if (slider.LazyEndPosition != null) return; - slider.CursorPosition = slider.StackedPosition; + slider.LazyEndPosition = slider.StackedPosition; float approxFollowCircleRadius = (float)(slider.Radius * 3); var computeVertex = new Action(t => { - var diff = slider.PositionAt(t) - slider.CursorPosition.Value; + var diff = slider.PositionAt(t) - slider.LazyEndPosition.Value; float dist = diff.Length; if (dist > approxFollowCircleRadius) @@ -99,7 +101,8 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing // The cursor would be outside the follow circle, we need to move it diff.Normalize(); // Obtain direction of diff dist -= approxFollowCircleRadius; - slider.CursorPosition += diff * dist; + slider.LazyEndPosition += diff * dist; + slider.LazyTravelDistance += dist; } }); From 1a6b0f5b3f235ef02340a072fdc717d5101587bf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 21:46:43 +0900 Subject: [PATCH 072/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index c95b9350ed..887db793c7 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit c95b9350edb6305cfefdf08f902f6f73d336736b +Subproject commit 887db793c705b45071aea5e0c1cc931a7887165f From 4ced1b64906507ae871753cc55f63542e4970671 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 22:10:24 +0900 Subject: [PATCH 073/282] Use more of the properties --- osu.Game/Beatmaps/WorkingBeatmap.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index c9acbefd87..cd080b7bbe 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -80,10 +80,10 @@ namespace osu.Game.Beatmaps public void TransferTo(WorkingBeatmap other) { - if (track.IsValueCreated && track.Value != null && BeatmapInfo.AudioEquals(other.BeatmapInfo)) + if (track.IsValueCreated && Track != null && BeatmapInfo.AudioEquals(other.BeatmapInfo)) other.track = track; - if (background.IsValueCreated && background.Value != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo)) + if (background.IsValueCreated && Background != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo)) other.background = background; } @@ -95,15 +95,12 @@ namespace osu.Game.Beatmaps public void DisposeTrack() { - if (!track.IsValueCreated) return; - - track.Value?.Dispose(); - track = null; + if (TrackLoaded) Track.Dispose(); } private void applyRateAdjustments(Track t = null) { - if (t == null && track.IsValueCreated) t = track.Value; + if (t == null && track.IsValueCreated) t = Track; if (t == null) return; t.ResetSpeedAdjustments(); From ddf402d9486bc4632bdee6b21216ad9262c6b1dd Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 22:14:28 +0900 Subject: [PATCH 074/282] Add nullchecks in Disposal where population methods return nulls --- osu.Game/Beatmaps/WorkingBeatmap.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index cd080b7bbe..1d4ed75688 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -89,13 +89,13 @@ namespace osu.Game.Beatmaps public virtual void Dispose() { - if (BackgroundLoaded) Background.Dispose(); - if (WaveformLoaded) Waveform.Dispose(); + if (BackgroundLoaded) Background?.Dispose(); + if (WaveformLoaded) Waveform?.Dispose(); } public void DisposeTrack() { - if (TrackLoaded) Track.Dispose(); + if (TrackLoaded) Track?.Dispose(); } private void applyRateAdjustments(Track t = null) From 7492ab6495204cac230cb7225dbc98bcf4e6327b Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 01:48:50 +0300 Subject: [PATCH 075/282] Use GridContainer to place the bottom bar objects --- osu.Game/Screens/Edit/Editor.cs | 48 +++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index fd85db595a..c94da8c5c5 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -87,30 +87,38 @@ namespace osu.Game.Screens.Edit { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Vertical = 5, Horizontal = 10 }, - Children = new Drawable[] + Child = new GridContainer { - timeInfo = new TimeInfoContainer + RelativeSizeAxes = Axes.Both, + ColumnDimensions = new Dimension[] { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - RelativeSizeAxes = Axes.Both, - Width = 0.17f + new Dimension(GridSizeMode.Auto), + new Dimension(GridSizeMode.Relative, 0.67f), + new Dimension(GridSizeMode.Auto), }, - timeline = new SummaryTimeline + Content = new Drawable[][] { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Width = 0.65f - }, - playback = new PlaybackContainer - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - RelativeSizeAxes = Axes.Both, - Width = 0.17f - }, - } + new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Right = 10 }, + Child = timeInfo = new TimeInfoContainer { RelativeSizeAxes = Axes.Both }, + }, + timeline = new SummaryTimeline + { + RelativeSizeAxes = Axes.Both, + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Left = 10 }, + Child = playback = new PlaybackContainer { RelativeSizeAxes = Axes.Both }, + } + }, + } + }, } } }, From 0b8fed4e5a8e2d1d5b59b77b45a0d0abe7001f3c Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 01:51:23 +0300 Subject: [PATCH 076/282] Remove useless Dimention params --- osu.Game/Screens/Edit/Editor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index c94da8c5c5..be6a168982 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -92,9 +92,9 @@ namespace osu.Game.Screens.Edit RelativeSizeAxes = Axes.Both, ColumnDimensions = new Dimension[] { - new Dimension(GridSizeMode.Auto), + new Dimension(), new Dimension(GridSizeMode.Relative, 0.67f), - new Dimension(GridSizeMode.Auto), + new Dimension(), }, Content = new Drawable[][] { From 58e72631087b491fb04e6dc641568cccb3b8b53f Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 03:09:09 +0300 Subject: [PATCH 077/282] CI fixes --- osu.Game/Screens/Edit/Editor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index be6a168982..9093bf5629 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -90,13 +90,13 @@ namespace osu.Game.Screens.Edit Child = new GridContainer { RelativeSizeAxes = Axes.Both, - ColumnDimensions = new Dimension[] + ColumnDimensions = new[] { new Dimension(), new Dimension(GridSizeMode.Relative, 0.67f), new Dimension(), }, - Content = new Drawable[][] + Content = new[] { new Drawable[] { @@ -105,7 +105,7 @@ namespace osu.Game.Screens.Edit RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Right = 10 }, Child = timeInfo = new TimeInfoContainer { RelativeSizeAxes = Axes.Both }, - }, + }, timeline = new SummaryTimeline { RelativeSizeAxes = Axes.Both, From f6ea5b0590a6033ce15ce10e4a374eadf2e31463 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 Nov 2017 10:34:17 +0900 Subject: [PATCH 078/282] Remove duplicated code --- osu.Game/Screens/Menu/ButtonSystem.cs | 43 --------------------------- 1 file changed, 43 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index ac597cd9d7..2a0666ade5 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -227,23 +227,9 @@ namespace osu.Game.Screens.Menu { case MenuState.Exit: case MenuState.Initial: - trackingPosition = false; - buttonAreaBackground.ScaleTo(Vector2.One, 500, Easing.Out); buttonArea.FadeOut(300); - logo?.Delay(150) - .Schedule(() => - { - toolbar?.Hide(); - - logo.ClearTransforms(targetMember: nameof(Position)); - logo.RelativePositionAxes = Axes.Both; - - logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); - logo.ScaleTo(1, 800, Easing.OutExpo); - }); - foreach (Button b in buttonsTopLevel) b.State = ButtonState.Contracted; @@ -256,33 +242,6 @@ namespace osu.Game.Screens.Menu case MenuState.TopLevel: buttonAreaBackground.ScaleTo(Vector2.One, 200, Easing.Out); - logo.ClearTransforms(targetMember: nameof(Position)); - logo.RelativePositionAxes = Axes.None; - - trackingPosition = true; - - switch (lastState) - { - case MenuState.Initial: - logo.ScaleTo(0.5f, 200, Easing.In); - - trackingPosition = false; - - logo - .MoveTo(iconTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) - .OnComplete(o => - { - trackingPosition = true; - - o.Impact(); - toolbar?.Show(); - }); - break; - default: - logo.ScaleTo(0.5f, 200, Easing.OutQuint); - break; - } - buttonArea.FadeIn(300); foreach (Button b in buttonsTopLevel) @@ -301,8 +260,6 @@ namespace osu.Game.Screens.Menu case MenuState.EnteringMode: buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, Easing.InSine); - trackingPosition = true; - buttonsTopLevel.ForEach(b => b.ContractStyle = 1); buttonsPlay.ForEach(b => b.ContractStyle = 1); backButton.ContractStyle = 1; From 322dd1bd05ac899c4210969dc8c5c699456ae698 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 Nov 2017 10:35:17 +0900 Subject: [PATCH 079/282] Rename variables to make more sense --- osu.Game/Screens/Menu/ButtonSystem.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 2a0666ade5..1b2b6a4d11 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -287,7 +287,7 @@ namespace osu.Game.Screens.Menu { case MenuState.Exit: case MenuState.Initial: - trackingPosition = false; + logoTracking = false; logo?.Delay(150) .Schedule(() => @@ -307,20 +307,20 @@ namespace osu.Game.Screens.Menu logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.None; - trackingPosition = true; + logoTracking = true; switch (lastState) { case MenuState.Initial: logo.ScaleTo(0.5f, 200, Easing.In); - trackingPosition = false; + logoTracking = false; logo - .MoveTo(iconTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) + .MoveTo(logoTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) .OnComplete(o => { - trackingPosition = true; + logoTracking = true; o.Impact(); toolbar?.Show(); @@ -332,14 +332,14 @@ namespace osu.Game.Screens.Menu } break; case MenuState.EnteringMode: - trackingPosition = true; + logoTracking = true; break; } } - private Vector2 iconTrackingPosition => logo.Parent.ToLocalSpace(iconFacade.ScreenSpaceDrawQuad.Centre); + private Vector2 logoTrackingPosition => logo.Parent.ToLocalSpace(iconFacade.ScreenSpaceDrawQuad.Centre); - private bool trackingPosition; + private bool logoTracking; protected override void Update() { @@ -350,8 +350,8 @@ namespace osu.Game.Screens.Menu if (logo != null) { - if (trackingPosition) - logo.Position = iconTrackingPosition; + if (logoTracking) + logo.Position = logoTrackingPosition; iconFacade.Width = logo.SizeForFlow * 0.5f; } From a741d6cea72bed93900cdc5e585ce032a7f97a01 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 04:46:02 +0300 Subject: [PATCH 080/282] Fix incorrect score indexes in leaderboard --- osu.Game/Screens/Select/Leaderboards/Leaderboard.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 4b1070f236..6b421ed433 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -64,7 +64,7 @@ namespace osu.Game.Screens.Select.Leaderboards AutoSizeAxes = Axes.Y, Spacing = new Vector2(0f, 5f), Padding = new MarginPadding { Top = 10, Bottom = 5 }, - ChildrenEnumerable = scores.Select(s => new LeaderboardScore(s, 1 + i) { Action = () => ScoreSelected?.Invoke(s) }) + ChildrenEnumerable = scores.Select((s, index) => new LeaderboardScore(s, index + 1) { Action = () => ScoreSelected?.Invoke(s) }) }, f => { scrollFlow?.Expire(); From c2d1de34fccff8b98bff003662a907c89df99796 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 Nov 2017 11:19:15 +0900 Subject: [PATCH 081/282] Fix logo not always returning to the correct state when rapidly changing menus Fixes #1005 for real --- osu.Game/Screens/Menu/ButtonSystem.cs | 44 +++++++++++++++------------ 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 1b2b6a4d11..844b1e1819 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -17,6 +17,7 @@ using OpenTK.Graphics; using OpenTK.Input; using osu.Framework.Audio.Sample; using osu.Framework.Audio; +using osu.Framework.Threading; namespace osu.Game.Screens.Menu { @@ -281,25 +282,30 @@ namespace osu.Game.Screens.Menu } } + private ScheduledDelegate logoDelayedAction; + private void updateLogoState(MenuState lastState = MenuState.Initial) { + if (logo == null) return; + + logoDelayedAction?.Cancel(); + switch (state) { case MenuState.Exit: case MenuState.Initial: logoTracking = false; - logo?.Delay(150) - .Schedule(() => - { - toolbar?.Hide(); + logoDelayedAction = Scheduler.AddDelayed(() => + { + toolbar?.Hide(); - logo.ClearTransforms(targetMember: nameof(Position)); - logo.RelativePositionAxes = Axes.Both; + logo.ClearTransforms(targetMember: nameof(Position)); + logo.RelativePositionAxes = Axes.Both; - logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); - logo.ScaleTo(1, 800, Easing.OutExpo); - }); + logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); + logo.ScaleTo(1, 800, Easing.OutExpo); + }, 150); break; case MenuState.TopLevel: @@ -307,26 +313,24 @@ namespace osu.Game.Screens.Menu logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.None; - logoTracking = true; - switch (lastState) { case MenuState.Initial: + logoTracking = false; logo.ScaleTo(0.5f, 200, Easing.In); - logoTracking = false; + logo.MoveTo(logoTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In); - logo - .MoveTo(logoTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) - .OnComplete(o => - { - logoTracking = true; + logoDelayedAction = Scheduler.AddDelayed(() => + { + logoTracking = true; - o.Impact(); - toolbar?.Show(); - }); + logo.Impact(); + toolbar?.Show(); + }, 200); break; default: + logoTracking = true; logo.ScaleTo(0.5f, 200, Easing.OutQuint); break; } From 68d4e420dde4b189a0d00a7c458f1a2c8c672c13 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 Nov 2017 12:18:55 +0900 Subject: [PATCH 082/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 887db793c7..f27e36d405 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 887db793c705b45071aea5e0c1cc931a7887165f +Subproject commit f27e36d405dd3f041e19defd59ecbb389ba84617 From 34d8f94f99178ac14c34f7aff5618edcd00bb822 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 08:24:09 +0300 Subject: [PATCH 083/282] Add track timer --- .../Edit/Components/BottomBarContainer.cs | 2 ++ .../Edit/Components/PlaybackContainer.cs | 11 +++--- .../Edit/Components/TimeInfoContainer.cs | 36 +++++++++++++++++++ 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Edit/Components/BottomBarContainer.cs b/osu.Game/Screens/Edit/Components/BottomBarContainer.cs index b230032937..d65355b5f4 100644 --- a/osu.Game/Screens/Edit/Components/BottomBarContainer.cs +++ b/osu.Game/Screens/Edit/Components/BottomBarContainer.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; +using osu.Framework.Audio.Track; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -17,6 +18,7 @@ namespace osu.Game.Screens.Edit.Components private const float contents_padding = 15; public Bindable Beatmap = new Bindable(); + protected Track Track => Beatmap.Value.Track; private readonly Drawable background; private readonly Container content; diff --git a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs index 23484464bf..9640d91615 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs @@ -19,7 +19,6 @@ namespace osu.Game.Screens.Edit.Components private readonly IconButton playButton; private bool lastTrackState; - private Track track => Beatmap.Value.Track; public PlaybackContainer() { @@ -60,22 +59,22 @@ namespace osu.Game.Screens.Edit.Components tabs.AddItem(0.75); tabs.AddItem(1); - tabs.Current.ValueChanged += newValue => track.Tempo.Value = newValue; + tabs.Current.ValueChanged += newValue => Track.Tempo.Value = newValue; } private void play() { - if (track.IsRunning) - track.Stop(); + if (Track.IsRunning) + Track.Stop(); else - track.Start(); + Track.Start(); } protected override void Update() { base.Update(); - var currentTrackState = track.IsRunning; + var currentTrackState = Track.IsRunning; if (currentTrackState == lastTrackState) return; diff --git a/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs b/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs index 739a67219d..4a07ab4434 100644 --- a/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs +++ b/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs @@ -1,9 +1,45 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Graphics; +using osu.Game.Graphics.Sprites; +using System; + namespace osu.Game.Screens.Edit.Components { public class TimeInfoContainer : BottomBarContainer { + private const int count_duration = 150; + + private readonly OsuSpriteText trackTimer; + private double savedTime; + + public TimeInfoContainer() + { + Children = new Drawable[] + { + trackTimer = new OsuSpriteText + { + Origin = Anchor.BottomLeft, + RelativePositionAxes = Axes.Y, + TextSize = 22, + FixedWidth = true, + Y = 0.5f, + } + }; + } + + protected override void Update() + { + base.Update(); + + var currentTime = Track.CurrentTime; + + if (savedTime == currentTime) + return; + + trackTimer.Text = TimeSpan.FromMilliseconds(currentTime).ToString(@"mm\:ss\:fff"); + savedTime = currentTime; + } } } From 4ee3a89c129fb4bf64c6cd716e45abe17af7745f Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 08:35:00 +0300 Subject: [PATCH 084/282] Remove using --- osu.Game/Screens/Edit/Components/PlaybackContainer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs index 9640d91615..a88983e3e4 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs @@ -3,7 +3,6 @@ using OpenTK; using osu.Framework.Allocation; -using osu.Framework.Audio.Track; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; From de4d8eb1965a82d5d59c8bc0d87476cdec03d539 Mon Sep 17 00:00:00 2001 From: Brayzure Date: Sat, 18 Nov 2017 01:28:09 -0500 Subject: [PATCH 085/282] Implement Sudden Death and Perfect - Two additional fail conditions --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 23 ++++++++++++++++++--- osu.Game/Screens/Play/Player.cs | 6 ++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 4dd88600b2..f579b94c69 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -66,6 +66,8 @@ namespace osu.Game.Rulesets.Scoring /// protected virtual bool HasCompleted => false; + public int strictFail = 0; + /// /// Whether this ScoreProcessor has already triggered the failed state. /// @@ -76,6 +78,16 @@ namespace osu.Game.Rulesets.Scoring /// protected virtual bool FailCondition => Health.Value == Health.MinValue; + /// + /// The conditions for failing if the Sudden Death mod is enabled. + /// + protected virtual bool SuddenDeathFailCondition => Combo.Value != HighestCombo.Value; + + /// + /// The conditions for failing if the Perfect mod is enabled. + /// + protected virtual bool PerfectFailCondition => Accuracy.Value != 1; + protected ScoreProcessor() { Combo.ValueChanged += delegate { HighestCombo.Value = Math.Max(HighestCombo.Value, Combo.Value); }; @@ -121,11 +133,16 @@ namespace osu.Game.Rulesets.Scoring /// protected void UpdateFailed() { - if (HasFailed || !FailCondition) + if (HasFailed) return; - if (Failed?.Invoke() != false) - HasFailed = true; + if(FailCondition || + (strictFail==1 && SuddenDeathFailCondition) || + (strictFail==2 && PerfectFailCondition)) + { + if (Failed?.Invoke() != false) + HasFailed = true; + } } /// diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 3e57e18963..2603fee769 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -227,6 +227,12 @@ namespace osu.Game.Screens.Play // Bind ScoreProcessor to ourselves scoreProcessor.AllJudged += onCompletion; scoreProcessor.Failed += onFail; + + if (Beatmap.Value.Mods.Value.Any(m => m.Name == "Sudden Death")) + scoreProcessor.strictFail = 1; + + if (Beatmap.Value.Mods.Value.Any(m => m.Name == "Perfect")) + scoreProcessor.strictFail = 2; } private void applyRateFromMods() From 60778593c34ec95f7432d924e218daf91ccf1437 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 Nov 2017 22:24:42 +0900 Subject: [PATCH 086/282] Make pressing space twice at main menu a bit smoother --- osu.Game/Screens/Menu/ButtonSystem.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 844b1e1819..c3bd7c1f37 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -315,6 +315,7 @@ namespace osu.Game.Screens.Menu switch (lastState) { + case MenuState.TopLevel: // coming from toplevel to play case MenuState.Initial: logoTracking = false; logo.ScaleTo(0.5f, 200, Easing.In); From 87f13688692bce3d25ff9f52e8778b56546103a6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 18:19:35 +0300 Subject: [PATCH 087/282] Add KudosuInfo container in the kudosu section --- .../Profile/Sections/Kudosu/KudosuInfo.cs | 146 ++++++++++++++++++ .../Profile/Sections/KudosuSection.cs | 10 ++ osu.Game/Overlays/UserProfileOverlay.cs | 2 +- osu.Game/osu.Game.csproj | 1 + 4 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs new file mode 100644 index 0000000000..14d2ef39f8 --- /dev/null +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -0,0 +1,146 @@ +// 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.Configuration; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Input; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Users; + +namespace osu.Game.Overlays.Profile.Sections.Kudosu +{ + public class KudosuInfo : Container + { + private const int content_text_size = 19; + + protected readonly Bindable User = new Bindable(); + + public KudosuInfo(Bindable user) + { + User.BindTo(user); + + SubSection total; + SubSection avaliable; + + RelativeSizeAxes = Axes.X; + Height = 130; + Masking = true; + CornerRadius = 3; + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Shadow, + Offset = new Vector2(0f, 1f), + Radius = 2.5f, + Colour = Color4.Black.Opacity(0.2f), + }; + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.2f) + }, + new GridContainer + { + RelativeSizeAxes = Axes.Both, + Content = new[] + { + new Drawable[] + { + total = new SubSection("Total Kudosu Earned"), + avaliable = new SubSection("Kudosu Avaliable"), + } + } + } + }; + + total.TextFlow.Text = "Based on how much of a contribution the user has made to " + + "beatmap moderation. See this link for more information."; + + avaliable.TextFlow.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get " + + "more attention. This is the number of kudosu you haven't traded in yet."; + + User.ValueChanged += newUser => + { + total.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Total; + avaliable.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Available; + }; + } + + protected override bool OnClick(InputState state) => true; + + private class SubSection : Container + { + public readonly TextFlowContainer TextFlow; + + private readonly OsuSpriteText valueText; + + private int kudosuValue; + public int KudosuValue + { + get { return kudosuValue; } + set + { + if (kudosuValue == value) + return; + kudosuValue = value; + + valueText.Text = kudosuValue.ToString(); + } + } + + public SubSection(string header) + { + RelativeSizeAxes = Axes.Both; + Padding = new MarginPadding { Horizontal = 10, Top = 10 }; + Child = new FillFlowContainer + { + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 5), + Children = new Drawable[] + { + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(5, 0), + Children = new Drawable[] + { + new OsuSpriteText + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Text = header + ":", + TextSize = 20, + Font = @"Exo2.0-RegularItalic", + }, + valueText = new OsuSpriteText + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Text = "0", + TextSize = 40, + UseFullGlyphHeight = false, + Font = @"Exo2.0-RegularItalic" + } + } + }, + TextFlow = new TextFlowContainer(t => { t.TextSize = 19; }) + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + } + } + }; + } + } + } +} diff --git a/osu.Game/Overlays/Profile/Sections/KudosuSection.cs b/osu.Game/Overlays/Profile/Sections/KudosuSection.cs index 3c36368fd7..907c26e5e8 100644 --- a/osu.Game/Overlays/Profile/Sections/KudosuSection.cs +++ b/osu.Game/Overlays/Profile/Sections/KudosuSection.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Overlays.Profile.Sections.Kudosu; + namespace osu.Game.Overlays.Profile.Sections { public class KudosuSection : ProfileSection @@ -8,5 +10,13 @@ namespace osu.Game.Overlays.Profile.Sections public override string Title => "Kudosu!"; public override string Identifier => "kudosu"; + + public KudosuSection() + { + Children = new[] + { + new KudosuInfo(User), + }; + } } } diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index dd31a43290..7374a9aa44 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -97,7 +97,7 @@ namespace osu.Game.Overlays //new MedalsSection(), new HistoricalSection(), new BeatmapsSection(), - //new KudosuSection() + new KudosuSection() }; tabs = new ProfileTabControl { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7b479bdba2..b9d8e36ff3 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -288,6 +288,7 @@ + From 915ccf3c84b8229b73d2068eecaf39324f348ba6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 18:41:00 +0300 Subject: [PATCH 088/282] Fix some layout issues --- .../Profile/Sections/Kudosu/KudosuInfo.cs | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 14d2ef39f8..3fe0bfd9e2 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -17,26 +17,24 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu { public class KudosuInfo : Container { - private const int content_text_size = 19; - - protected readonly Bindable User = new Bindable(); + private readonly Bindable user = new Bindable(); public KudosuInfo(Bindable user) { - User.BindTo(user); + this.user.BindTo(user); SubSection total; SubSection avaliable; RelativeSizeAxes = Axes.X; - Height = 130; + AutoSizeAxes = Axes.Y; Masking = true; CornerRadius = 3; EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Offset = new Vector2(0f, 1f), - Radius = 2.5f, + Radius = 3f, Colour = Color4.Black.Opacity(0.2f), }; Children = new Drawable[] @@ -46,18 +44,12 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.2f) }, - new GridContainer + total = new SubSection("Total Kudosu Earned"), + avaliable = new SubSection("Kudosu Avaliable") { - RelativeSizeAxes = Axes.Both, - Content = new[] - { - new Drawable[] - { - total = new SubSection("Total Kudosu Earned"), - avaliable = new SubSection("Kudosu Avaliable"), - } - } - } + RelativePositionAxes = Axes.X, + X = 0.5f, + }, }; total.TextFlow.Text = "Based on how much of a contribution the user has made to " + @@ -66,7 +58,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu avaliable.TextFlow.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get " + "more attention. This is the number of kudosu you haven't traded in yet."; - User.ValueChanged += newUser => + this.user.ValueChanged += newUser => { total.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Total; avaliable.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Available; @@ -97,8 +89,10 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu public SubSection(string header) { - RelativeSizeAxes = Axes.Both; - Padding = new MarginPadding { Horizontal = 10, Top = 10 }; + RelativeSizeAxes = Axes.X; + Width = 0.5f; + AutoSizeAxes = Axes.Y; + Padding = new MarginPadding { Horizontal = 10, Top = 10, Bottom = 20 }; Child = new FillFlowContainer { AutoSizeAxes = Axes.Y, From 2ff88c86eafc4509b7b0c1d430a34e1f52fd3c09 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 18:53:21 +0300 Subject: [PATCH 089/282] CI fixes --- osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 3fe0bfd9e2..1982059065 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -57,11 +57,11 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu avaliable.TextFlow.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get " + "more attention. This is the number of kudosu you haven't traded in yet."; - + this.user.ValueChanged += newUser => { - total.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Total; - avaliable.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Available; + total.KudosuValue = newUser?.Kudosu.Total ?? 0; + avaliable.KudosuValue = newUser?.Kudosu.Available ?? 0; }; } From 9325730f5da306916c4270a9eea14f1f975732b1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 19 Nov 2017 00:53:59 +0900 Subject: [PATCH 090/282] Fix leaderboard fadeout causing constant flow changes Also cleans up logic significantly. --- .../Select/Leaderboards/Leaderboard.cs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 6b421ed433..d896da5319 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -40,20 +40,12 @@ namespace osu.Game.Screens.Select.Leaderboards scores = value; getScoresRequest?.Cancel(); - int i = 150; + scrollFlow?.FadeOut(200); + scrollFlow?.Expire(); + scrollFlow = null; + if (scores == null) - { - if (scrollFlow != null) - { - foreach (var c in scrollFlow.Children) - c.FadeOut(i += 10); - - foreach (var c in scrollFlow.Children) - c.LifetimeEnd = Time.Current + i; - } - return; - } // schedule because we may not be loaded yet (LoadComponentAsync complains). Schedule(() => @@ -67,10 +59,9 @@ namespace osu.Game.Screens.Select.Leaderboards ChildrenEnumerable = scores.Select((s, index) => new LeaderboardScore(s, index + 1) { Action = () => ScoreSelected?.Invoke(s) }) }, f => { - scrollFlow?.Expire(); scrollContainer.Add(scrollFlow = f); - i = 0; + int i = 0; foreach (var s in f.Children) { using (s.BeginDelayedSequence(i++ * 50, true)) From 7d2bbc50a365ba8f864443bbdec238fb69d6bf27 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 19 Nov 2017 01:42:13 +0900 Subject: [PATCH 091/282] Add unique constraint on OnlineBeatmapID --- osu.Game/Database/OsuDbContext.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index 928c355696..9c1413b93b 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -78,6 +78,7 @@ namespace osu.Game.Database { base.OnModelCreating(modelBuilder); + modelBuilder.Entity().HasIndex(b => b.OnlineBeatmapID).IsUnique(); modelBuilder.Entity().HasIndex(b => b.MD5Hash).IsUnique(); modelBuilder.Entity().HasIndex(b => b.Hash).IsUnique(); From d704e9cf7e12d784a23adb72b50ff4ce64004b98 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 19 Nov 2017 01:45:07 +0900 Subject: [PATCH 092/282] Ensure we correctly handle importing beatmaps/sets when the onlineID already exists locally --- osu.Game/Beatmaps/BeatmapManager.cs | 39 ++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index ff0abd3d78..2e74adbf45 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -483,14 +483,20 @@ namespace osu.Game.Beatmaps using (var stream = new StreamReader(reader.GetStream(mapName))) metadata = BeatmapDecoder.GetDecoder(stream).Decode(stream).Metadata; - beatmapSet = new BeatmapSetInfo + // check if a set already exists with the same online id. + beatmapSet = beatmaps.BeatmapSets.FirstOrDefault(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID); + + if (beatmapSet == null) { - OnlineBeatmapSetID = metadata.OnlineBeatmapSetID, - Beatmaps = new List(), - Hash = hash, - Files = fileInfos, - Metadata = metadata - }; + beatmapSet = new BeatmapSetInfo + { + OnlineBeatmapSetID = metadata.OnlineBeatmapSetID, + Beatmaps = new List(), + Hash = hash, + Files = fileInfos, + Metadata = metadata + }; + } var mapNames = reader.Filenames.Where(f => f.EndsWith(".osu")); @@ -510,16 +516,21 @@ namespace osu.Game.Beatmaps beatmap.BeatmapInfo.Hash = ms.ComputeSHA2Hash(); beatmap.BeatmapInfo.MD5Hash = ms.ComputeMD5Hash(); - // TODO: Diff beatmap metadata with set metadata and leave it here if necessary - beatmap.BeatmapInfo.Metadata = null; + var existing = beatmaps.Beatmaps.FirstOrDefault(b => b.Hash == beatmap.BeatmapInfo.Hash || b.OnlineBeatmapID == beatmap.BeatmapInfo.OnlineBeatmapID); - RulesetInfo ruleset = rulesets.GetRuleset(beatmap.BeatmapInfo.RulesetID); + if (existing == null) + { + // TODO: Diff beatmap metadata with set metadata and leave it here if necessary + beatmap.BeatmapInfo.Metadata = null; - // TODO: this should be done in a better place once we actually need to dynamically update it. - beatmap.BeatmapInfo.Ruleset = ruleset; - beatmap.BeatmapInfo.StarDifficulty = ruleset?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0; + RulesetInfo ruleset = rulesets.GetRuleset(beatmap.BeatmapInfo.RulesetID); - beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo); + // TODO: this should be done in a better place once we actually need to dynamically update it. + beatmap.BeatmapInfo.Ruleset = ruleset; + beatmap.BeatmapInfo.StarDifficulty = ruleset?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0; + + beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo); + } } } From 42646413038e1c19b1ed489b5bf2ac35c28f9192 Mon Sep 17 00:00:00 2001 From: jorolf Date: Sat, 18 Nov 2017 18:27:30 +0100 Subject: [PATCH 093/282] fix missing text appearing when request returns nothing but beatmaps are already there --- .../Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 834328ca0e..4bfb8107b4 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps ShowMoreButton.FadeTo(sets.Count == ItemsPerPage ? 1 : 0); ShowMoreLoading.Hide(); - if (!sets.Any()) + if (!sets.Any() && VisiblePages == 1) { MissingText.Show(); return; From 9aaefb5e97b95689c22377f0d478d41a7de993e7 Mon Sep 17 00:00:00 2001 From: jorolf Date: Sat, 18 Nov 2017 20:09:31 +0100 Subject: [PATCH 094/282] same for PaginatedScoreContainer --- .../Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs index bb383cac0d..dc30934990 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs @@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks ShowMoreButton.FadeTo(scores.Count == ItemsPerPage ? 1 : 0); ShowMoreLoading.Hide(); - if (!scores.Any()) + if (!scores.Any() && VisiblePages == 1) { MissingText.Show(); return; From 0b5614e4ee27dff86a9b5bfe7950495cedd14990 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 18 Nov 2017 22:12:15 +0100 Subject: [PATCH 095/282] fix result screen not showing name of mapper --- osu.Game/Screens/Ranking/ResultsPageScore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index b01410cff5..9104473b82 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -324,7 +324,7 @@ namespace osu.Game.Screens.Ranking title.Colour = artist.Colour = colours.BlueDarker; versionMapper.Colour = colours.Gray8; - versionMapper.Text = $"{beatmap.Version} - mapped by {beatmap.Metadata.Author}"; + versionMapper.Text = $"{beatmap.Version} - mapped by {beatmap.Metadata.Author.Username}"; title.Current = localisation.GetUnicodePreference(beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title); artist.Current = localisation.GetUnicodePreference(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist); } From d2ab0621f32b2f1b2a9b09e894316d8c762afee8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 13:46:51 +0900 Subject: [PATCH 096/282] Make osu.Game + rulesets compile with netstandard --- LangVer.props | 6 + OpenTK.props | 9 + osu-framework | 2 +- osu-resources | 2 +- osu.Desktop/OsuGameDesktop.cs | 2 - osu.Game.Rulesets.Catch/OpenTK.dll.config | 25 - .../Properties/AssemblyInfo.cs | 28 - osu.Game.Rulesets.Catch/app.config | 19 - .../osu.Game.Rulesets.Catch.csproj | 115 +-- osu.Game.Rulesets.Mania/OpenTK.dll.config | 25 - .../Properties/AssemblyInfo.cs | 28 - osu.Game.Rulesets.Mania/app.config | 19 - .../osu.Game.Rulesets.Mania.csproj | 138 +-- osu.Game.Rulesets.Osu/OpenTK.dll.config | 25 - .../Properties/AssemblyInfo.cs | 28 - osu.Game.Rulesets.Osu/app.config | 19 - .../osu.Game.Rulesets.Osu.csproj | 146 +-- osu.Game.Rulesets.Taiko/OpenTK.dll.config | 25 - .../Properties/AssemblyInfo.cs | 28 - osu.Game.Rulesets.Taiko/app.config | 19 - .../osu.Game.Rulesets.Taiko.csproj | 137 +-- osu.Game.props | 8 + osu.Game/Beatmaps/BeatmapManager.cs | 4 +- osu.Game/Beatmaps/IO/OszArchiveReader.cs | 14 +- osu.Game/IO/Legacy/SerializationReader.cs | 3 +- osu.Game/IO/Legacy/SerializationWriter.cs | 4 +- .../20171019041408_InitialCreate.cs | 2 - .../20171025071459_AddMissingIndexRules.cs | 2 - .../Migrations/OsuDbContextModelSnapshot.cs | 4 - osu.Game/OpenTK.dll.config | 25 - .../Sections/General/LoginSettings.cs | 1 - osu.Game/Overlays/Toolbar/ToolbarUserArea.cs | 1 - osu.Game/Properties/AssemblyInfo.cs | 28 - osu.Game/Utils/ZipUtils.cs | 33 + osu.Game/app.config | 19 - osu.Game/osu.Game.csproj | 836 +----------------- osu.sln | 14 +- 37 files changed, 169 insertions(+), 1674 deletions(-) create mode 100644 LangVer.props create mode 100644 OpenTK.props delete mode 100644 osu.Game.Rulesets.Catch/OpenTK.dll.config delete mode 100644 osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs delete mode 100644 osu.Game.Rulesets.Catch/app.config delete mode 100644 osu.Game.Rulesets.Mania/OpenTK.dll.config delete mode 100644 osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs delete mode 100644 osu.Game.Rulesets.Mania/app.config delete mode 100644 osu.Game.Rulesets.Osu/OpenTK.dll.config delete mode 100644 osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs delete mode 100644 osu.Game.Rulesets.Osu/app.config delete mode 100644 osu.Game.Rulesets.Taiko/OpenTK.dll.config delete mode 100644 osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs delete mode 100644 osu.Game.Rulesets.Taiko/app.config create mode 100644 osu.Game.props delete mode 100644 osu.Game/OpenTK.dll.config delete mode 100644 osu.Game/Properties/AssemblyInfo.cs create mode 100644 osu.Game/Utils/ZipUtils.cs delete mode 100644 osu.Game/app.config diff --git a/LangVer.props b/LangVer.props new file mode 100644 index 0000000000..6b1d1dae73 --- /dev/null +++ b/LangVer.props @@ -0,0 +1,6 @@ + + + + 6 + + \ No newline at end of file diff --git a/OpenTK.props b/OpenTK.props new file mode 100644 index 0000000000..0876c52b66 --- /dev/null +++ b/OpenTK.props @@ -0,0 +1,9 @@ + + + + + + PreserveNewest + + + \ No newline at end of file diff --git a/osu-framework b/osu-framework index aa7fb2f83c..7d5df64338 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit aa7fb2f83c5883a23eca0f5799905669fa6cead3 +Subproject commit 7d5df64338e3b3be7bdf3509e9c47a3e9b930430 diff --git a/osu-resources b/osu-resources index 1750ab8f67..c3def1cf00 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 1750ab8f6761ab35592fd46da71fbe0c141bfd93 +Subproject commit c3def1cf0038c5a8bcbe35a56914ffeebb25b10b diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 60d70e1ece..3eaa23f4c7 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -2,10 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Drawing; using System.IO; using System.Linq; -using System.Reflection; using System.Threading.Tasks; using Microsoft.Win32; using osu.Desktop.Overlays; diff --git a/osu.Game.Rulesets.Catch/OpenTK.dll.config b/osu.Game.Rulesets.Catch/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game.Rulesets.Catch/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs deleted file mode 100644 index dd2006c60c..0000000000 --- a/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// 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.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.Game.Rulesets.Catch")] -[assembly: AssemblyDescription("catch the fruit. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game.Rulesets.Catch")] -[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("58f6c80c-1253-4a0e-a465-b8c85ebeadf3")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game.Rulesets.Catch/app.config b/osu.Game.Rulesets.Catch/app.config deleted file mode 100644 index c9d4e44b1a..0000000000 --- a/osu.Game.Rulesets.Catch/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 0c61a5b312..76396f1815 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -1,102 +1,23 @@ - - - - - Debug - AnyCPU - {58F6C80C-1253-4A0E-A465-B8C85EBEADF3} + + + + + netstandard2.0;net461 Library - Properties - osu.Game.Rulesets.Catch - osu.Game.Rulesets.Catch - v4.6.1 - 512 + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game.Rulesets.Catch + catch the fruit. to the beat. + osu.Game.Rulesets.Catch - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - 6 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - osu.licenseheader - - - - - - - - {C76BF5B3-985E-4D39-95FE-97C9C879B83A} - osu.Framework - True - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - True - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/OpenTK.dll.config b/osu.Game.Rulesets.Mania/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game.Rulesets.Mania/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs deleted file mode 100644 index 85a8f95b14..0000000000 --- a/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// 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.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.Game.Rulesets.Mania")] -[assembly: AssemblyDescription("smash the keys. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game.Rulesets.Mania")] -[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("48f4582b-7687-4621-9cbe-5c24197cb536")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game.Rulesets.Mania/app.config b/osu.Game.Rulesets.Mania/app.config deleted file mode 100644 index c9d4e44b1a..0000000000 --- a/osu.Game.Rulesets.Mania/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index edc77f5c7b..ba9176c853 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -1,125 +1,23 @@ - - - - - Debug - AnyCPU - {48F4582B-7687-4621-9CBE-5C24197CB536} + + + + + netstandard2.0;net461 Library - Properties - osu.Game.Rulesets.Mania - osu.Game.Rulesets.Mania - v4.6.1 - 512 + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game.Rulests.Mania + smash the keys. to the beat. + osu.Game.Rulests.Mania - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - 6 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - osu.licenseheader - - - - - - - - {C76BF5B3-985E-4D39-95FE-97C9C879B83A} - osu.Framework - True - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - True - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/OpenTK.dll.config b/osu.Game.Rulesets.Osu/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game.Rulesets.Osu/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs deleted file mode 100644 index b6cf47071a..0000000000 --- a/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// 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.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.Game.Mode.Osu")] -[assembly: AssemblyDescription("click the circles. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game.Mode.Osu")] -[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("c92a607b-1fdd-4954-9f92-03ff547d9080")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game.Rulesets.Osu/app.config b/osu.Game.Rulesets.Osu/app.config deleted file mode 100644 index c9d4e44b1a..0000000000 --- a/osu.Game.Rulesets.Osu/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 3939b3f108..a28ee218b5 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -1,133 +1,23 @@ - - - - - Debug - AnyCPU - {C92A607B-1FDD-4954-9F92-03FF547D9080} + + + + + netstandard2.0;net461 Library - Properties - osu.Game.Rulesets.Osu - osu.Game.Rulesets.Osu - v4.6.1 - 512 - + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game.Rulesets.Osu + click the circles. to the beat. + osu.Game.Rulesets.Osu - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - 6 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - osu.licenseheader - - - - - - - - {C76BF5B3-985E-4D39-95FE-97C9C879B83A} - osu.Framework - True - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - True - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/OpenTK.dll.config b/osu.Game.Rulesets.Taiko/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game.Rulesets.Taiko/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs deleted file mode 100644 index f6a9c8f101..0000000000 --- a/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// 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.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.Game.Rulesets.Taiko")] -[assembly: AssemblyDescription("bash the drum. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game.Rulesets.Taiko")] -[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("f167e17a-7de6-4af5-b920-a5112296c695")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game.Rulesets.Taiko/app.config b/osu.Game.Rulesets.Taiko/app.config deleted file mode 100644 index c9d4e44b1a..0000000000 --- a/osu.Game.Rulesets.Taiko/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 868460e3d6..c4899d3c5c 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -1,124 +1,23 @@ - - - - - Debug - AnyCPU - {F167E17A-7DE6-4AF5-B920-A5112296C695} + + + + + netstandard2.0;net461 Library - Properties - osu.Game.Rulesets.Taiko - osu.Game.Rulesets.Taiko - v4.6.1 - 512 + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game.Rulesets.Taiko + bash the drum. to the beat. + osu.Game.Rulesets.Taiko - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - 6 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - osu.licenseheader - - - - - - - - {C76BF5B3-985E-4D39-95FE-97C9C879B83A} - osu.Framework - True - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - True - - - - \ No newline at end of file diff --git a/osu.Game.props b/osu.Game.props new file mode 100644 index 0000000000..c352fa2b06 --- /dev/null +++ b/osu.Game.props @@ -0,0 +1,8 @@ + + + + + osu.licenseheader + + + \ No newline at end of file diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index ff0abd3d78..4bce2a96da 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -7,7 +7,6 @@ using System.IO; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; -using Ionic.Zip; using Microsoft.EntityFrameworkCore; using osu.Framework.Audio.Track; using osu.Framework.Extensions; @@ -24,6 +23,7 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays.Notifications; using osu.Game.Rulesets; +using osu.Game.Utils; namespace osu.Game.Beatmaps { @@ -418,7 +418,7 @@ namespace osu.Game.Beatmaps /// A reader giving access to the beatmap's content. private ArchiveReader getReaderFrom(string path) { - if (ZipFile.IsZipFile(path)) + if (ZipUtils.IsZipArchive(path)) // ReSharper disable once InconsistentlySynchronizedField return new OszArchiveReader(storage.GetStream(path)); return new LegacyFilesystemReader(path); diff --git a/osu.Game/Beatmaps/IO/OszArchiveReader.cs b/osu.Game/Beatmaps/IO/OszArchiveReader.cs index 4e0c40d28e..491bd06487 100644 --- a/osu.Game/Beatmaps/IO/OszArchiveReader.cs +++ b/osu.Game/Beatmaps/IO/OszArchiveReader.cs @@ -4,31 +4,31 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using Ionic.Zip; +using SharpCompress.Archives.Zip; namespace osu.Game.Beatmaps.IO { public sealed class OszArchiveReader : ArchiveReader { private readonly Stream archiveStream; - private readonly ZipFile archive; + private readonly ZipArchive archive; public OszArchiveReader(Stream archiveStream) { this.archiveStream = archiveStream; - archive = ZipFile.Read(archiveStream); + archive = ZipArchive.Open(archiveStream); } public override Stream GetStream(string name) { - ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name); + ZipArchiveEntry entry = archive.Entries.SingleOrDefault(e => e.Key == name); if (entry == null) throw new FileNotFoundException(); // allow seeking MemoryStream copy = new MemoryStream(); - using (Stream s = entry.OpenReader()) + using (Stream s = entry.OpenEntryStream()) s.CopyTo(copy); copy.Position = 0; @@ -42,8 +42,8 @@ namespace osu.Game.Beatmaps.IO archiveStream.Dispose(); } - public override IEnumerable Filenames => archive.Entries.Select(e => e.FileName).ToArray(); + public override IEnumerable Filenames => archive.Entries.Select(e => e.Key).ToArray(); public override Stream GetUnderlyingStream() => archiveStream; } -} \ No newline at end of file +} diff --git a/osu.Game/IO/Legacy/SerializationReader.cs b/osu.Game/IO/Legacy/SerializationReader.cs index c7ea884821..e79eef4e2b 100644 --- a/osu.Game/IO/Legacy/SerializationReader.cs +++ b/osu.Game/IO/Legacy/SerializationReader.cs @@ -7,7 +7,6 @@ using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; using System.Runtime.Serialization.Formatters.Binary; using System.Text; @@ -175,7 +174,7 @@ namespace osu.Game.IO.Legacy versionBinder = new VersionConfigToNamespaceAssemblyObjectBinder(); formatter = new BinaryFormatter { - AssemblyFormat = FormatterAssemblyStyle.Simple, +// AssemblyFormat = FormatterAssemblyStyle.Simple, Binder = versionBinder }; } diff --git a/osu.Game/IO/Legacy/SerializationWriter.cs b/osu.Game/IO/Legacy/SerializationWriter.cs index 7325129128..c8af66fd8a 100644 --- a/osu.Game/IO/Legacy/SerializationWriter.cs +++ b/osu.Game/IO/Legacy/SerializationWriter.cs @@ -219,7 +219,7 @@ namespace osu.Game.IO.Legacy Write((byte)ObjType.otherType); BinaryFormatter b = new BinaryFormatter { - AssemblyFormat = FormatterAssemblyStyle.Simple, +// AssemblyFormat = FormatterAssemblyStyle.Simple, TypeFormat = FormatterTypeStyle.TypesWhenNeeded }; b.Serialize(BaseStream, obj); @@ -259,4 +259,4 @@ namespace osu.Game.IO.Legacy WriteRawBytes(Encoding.UTF8.GetBytes(str)); } } -} \ No newline at end of file +} diff --git a/osu.Game/Migrations/20171019041408_InitialCreate.cs b/osu.Game/Migrations/20171019041408_InitialCreate.cs index 23e5b6f8bb..922aa85f18 100644 --- a/osu.Game/Migrations/20171019041408_InitialCreate.cs +++ b/osu.Game/Migrations/20171019041408_InitialCreate.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace osu.Game.Migrations { diff --git a/osu.Game/Migrations/20171025071459_AddMissingIndexRules.cs b/osu.Game/Migrations/20171025071459_AddMissingIndexRules.cs index a20652eedc..ad8884a4bf 100644 --- a/osu.Game/Migrations/20171025071459_AddMissingIndexRules.cs +++ b/osu.Game/Migrations/20171025071459_AddMissingIndexRules.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace osu.Game.Migrations { diff --git a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs index 7029dcdcd5..025607bbd9 100644 --- a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs +++ b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs @@ -1,11 +1,7 @@ // using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; using osu.Game.Database; -using System; namespace osu.Game.Migrations { diff --git a/osu.Game/OpenTK.dll.config b/osu.Game/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 4e7712936a..9e962a64a6 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -5,7 +5,6 @@ using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs index 7683406b49..3a0abf0232 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using OpenTK; using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; diff --git a/osu.Game/Properties/AssemblyInfo.cs b/osu.Game/Properties/AssemblyInfo.cs deleted file mode 100644 index e28f8a3873..0000000000 --- a/osu.Game/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// 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.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.Game")] -[assembly: AssemblyDescription("click the circles. to the beat.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ppy Pty Ltd")] -[assembly: AssemblyProduct("osu.Game")] -[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("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Game/Utils/ZipUtils.cs b/osu.Game/Utils/ZipUtils.cs new file mode 100644 index 0000000000..c1e0d75a7b --- /dev/null +++ b/osu.Game/Utils/ZipUtils.cs @@ -0,0 +1,33 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System; +using SharpCompress.Archives.Zip; + +namespace osu.Game.Utils +{ + public static class ZipUtils + { + public static bool IsZipArchive(string path) + { + try + { + using (var arc = ZipArchive.Open(path)) + { + foreach (var entry in arc.Entries) + { + using (entry.OpenEntryStream()) + { + } + } + } + + return true; + } + catch (Exception) + { + return false; + } + } + } +} diff --git a/osu.Game/app.config b/osu.Game/app.config deleted file mode 100644 index 7f2ad68041..0000000000 --- a/osu.Game/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6ef8f6570d..f995fc76e1 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -1,823 +1,27 @@ - - - - {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D} - Debug - AnyCPU + + + + + netstandard2.0;net461 Library - Properties - osu.Game - osu.Game - 3CF060CD28877D0E3112948951A64B2A7CEEC909 - codesigning.pfx - false - false - false - - - 3.5 - - - OnOutputUpdated - false - LocalIntranet - v4.6.1 - true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 2 - 1.0.0.%2a - false - true - 12.0.0 - 2.0 - - - - - - - true - full - false - bin\Debug\ - TRACE;DEBUG - prompt - 0 - true - false AnyCPU true - false - false - false - - - 6 + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game + click the circles. to the beat. + osu.Game - - none - true - bin\Release\ - - - prompt - 4 - true - false - AnyCPU - true - false - false - - - - - - - - - $(SolutionDir)\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll - True - - - $(SolutionDir)\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll - - - $(SolutionDir)\packages\Microsoft.Data.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.Data.Sqlite.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.Design.2.0.0\lib\net461\Microsoft.EntityFrameworkCore.Design.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.Relational.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll - - - $(SolutionDir)\packages\Microsoft.EntityFrameworkCore.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Sqlite.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Caching.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Caching.Memory.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Configuration.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.DependencyInjection.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Logging.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Logging.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Options.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll - - - $(SolutionDir)\packages\Microsoft.Extensions.Primitives.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll - - - - - $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - True - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - $(SolutionDir)\packages\Remotion.Linq.2.1.2\lib\net45\Remotion.Linq.dll - - - $(SolutionDir)\packages\SharpCompress.0.18.1\lib\net45\SharpCompress.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_green.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_v2.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.core.1.1.8\lib\net45\SQLitePCLRaw.core.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.8\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll - True - - - - $(SolutionDir)\packages\System.Collections.Immutable.1.4.0\lib\netstandard2.0\System.Collections.Immutable.dll - - - $(SolutionDir)\packages\System.ComponentModel.Annotations.4.4.0\lib\net461\System.ComponentModel.Annotations.dll - - - - - - $(SolutionDir)\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll - - - $(SolutionDir)\packages\System.Interactive.Async.3.1.1\lib\net46\System.Interactive.Async.dll - - - $(SolutionDir)\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - - $(SolutionDir)\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll - True - + + + - - - osu.licenseheader - - - - - + + + + + + - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - false - - - - - {c76bf5b3-985e-4d39-95fe-97c9c879b83a} - osu.Framework - - - {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} - osu.Game.Resources - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 20171019041408_InitialCreate.cs - - - - 20171025071459_AddMissingIndexRules.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.sln b/osu.sln index 356ec4cc7b..86a0e4818b 100644 --- a/osu.sln +++ b/osu.sln @@ -3,19 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27004.2006 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game", "osu.Game\osu.Game.csproj", "{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game", "osu.Game\osu.Game.csproj", "{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework", "osu-framework\osu.Framework\osu.Framework.csproj", "{C76BF5B3-985E-4D39-95FE-97C9C879B83A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Framework", "osu-framework\osu.Framework\osu.Framework.csproj", "{C76BF5B3-985E-4D39-95FE-97C9C879B83A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Resources", "osu-resources\osu.Game.Resources\osu.Game.Resources.csproj", "{D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Resources", "osu-resources\osu.Game.Resources\osu.Game.Resources.csproj", "{D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Osu", "osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj", "{C92A607B-1FDD-4954-9F92-03FF547D9080}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Osu", "osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj", "{C92A607B-1FDD-4954-9F92-03FF547D9080}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Catch", "osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj", "{58F6C80C-1253-4A0E-A465-B8C85EBEADF3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Catch", "osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj", "{58F6C80C-1253-4A0E-A465-B8C85EBEADF3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Taiko", "osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj", "{F167E17A-7DE6-4AF5-B920-A5112296C695}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Taiko", "osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj", "{F167E17A-7DE6-4AF5-B920-A5112296C695}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Mania", "osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj", "{48F4582B-7687-4621-9CBE-5C24197CB536}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Mania", "osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj", "{48F4582B-7687-4621-9CBE-5C24197CB536}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Deploy", "osu.Desktop.Deploy\osu.Desktop.Deploy.csproj", "{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}" EndProject From 440c1a9f83fca54efc8db58cc7bec66e964f5aba Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 14:30:56 +0900 Subject: [PATCH 097/282] Make osu.Desktop and osu.Game.Tests compile under net461+netstandard --- osu.Desktop/OpenTK.dll.config | 25 -- osu.Desktop/OsuGameDesktop.cs | 2 + osu.Desktop/Overlays/VersionManager.cs | 13 ++ osu.Desktop/Properties/AssemblyInfo.cs | 28 --- osu.Desktop/Properties/app.manifest | 57 ----- osu.Desktop/app.config | 44 ---- osu.Desktop/osu.Desktop.csproj | 303 ++----------------------- osu.Game.Tests/osu.Game.Tests.csproj | 166 ++------------ osu.sln | 4 +- 9 files changed, 64 insertions(+), 578 deletions(-) delete mode 100644 osu.Desktop/OpenTK.dll.config delete mode 100644 osu.Desktop/Properties/AssemblyInfo.cs delete mode 100644 osu.Desktop/Properties/app.manifest delete mode 100644 osu.Desktop/app.config diff --git a/osu.Desktop/OpenTK.dll.config b/osu.Desktop/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Desktop/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 3eaa23f4c7..b8eeeb1a5b 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -47,6 +47,7 @@ namespace osu.Desktop string stableInstallPath; +#if NET461 try { using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu")) @@ -58,6 +59,7 @@ namespace osu.Desktop catch { } +#endif stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); if (checkExists(stableInstallPath)) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 8c17e18ed8..8bb9d596d1 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -21,13 +21,19 @@ using osu.Game.Overlays; using osu.Game.Overlays.Notifications; using OpenTK; using OpenTK.Graphics; + +#if NET461 using Squirrel; +#endif namespace osu.Desktop.Overlays { public class VersionManager : OverlayContainer { +#if NET461 private UpdateManager updateManager; +#endif + private NotificationOverlay notificationOverlay; private OsuConfigManager config; private OsuGameBase game; @@ -138,11 +144,15 @@ namespace osu.Desktop.Overlays protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); + +#if NET461 updateManager?.Dispose(); +#endif } private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null) { +#if NET461 //should we schedule a retry on completion of this check? bool scheduleRetry = true; @@ -213,6 +223,7 @@ namespace osu.Desktop.Overlays notification.State = ProgressNotificationState.Cancelled; } } +#endif } protected override void PopIn() @@ -234,7 +245,9 @@ namespace osu.Desktop.Overlays Activated = () => { // Squirrel returns execution to us after the update process is started, so it's safe to use Wait() here +#if NET461 UpdateManager.RestartAppWhenExited().Wait(); +#endif game.GracefullyExit(); return true; } diff --git a/osu.Desktop/Properties/AssemblyInfo.cs b/osu.Desktop/Properties/AssemblyInfo.cs deleted file mode 100644 index 2ed304ebd7..0000000000 --- a/osu.Desktop/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// 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.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("b0cb1d48-e4c2-4612-a347-beea7b1a71e7")] - -[assembly: AssemblyVersion("0.0.0")] -[assembly: AssemblyFileVersion("0.0.0")] diff --git a/osu.Desktop/Properties/app.manifest b/osu.Desktop/Properties/app.manifest deleted file mode 100644 index 555db8513d..0000000000 --- a/osu.Desktop/Properties/app.manifest +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - diff --git a/osu.Desktop/app.config b/osu.Desktop/app.config deleted file mode 100644 index ea1576b3d8..0000000000 --- a/osu.Desktop/app.config +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index dd328858e0..fd0644bc5d 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -1,287 +1,32 @@ - - - - {419659FD-72EA-4678-9EB8-B22A746CED70} - Debug - AnyCPU - WinExe - Properties - osu.Desktop - osu! - 3CF060CD28877D0E3112948951A64B2A7CEEC909 - codesigning.pfx - false - false - false - - - 3.5 - - - osu.Desktop.Program - OnOutputUpdated - false - LocalIntranet - v4.6.1 - true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 2 - 1.0.0.%2a - false - true - 12.0.0 - 2.0 - - - - - - - true - full - false - bin\Debug\ - DEBUG - prompt - 0 - true - false + + + + + netcoreapp2.0;net461 + Exe AnyCPU true - false - false - false - - - 6 + ppy Pty Ltd + 0.0.0.0 + click the circles. to the beat. + ppy Pty Ltd 2007-2017 + osu!lazer + osu!lazer - - none - true - bin\Release\ - CuttingEdge NoUpdate - prompt - 4 - true - false - AnyCPU - true - false - false - - - - - - - lazer.ico - - - Properties\app.manifest - - - true - bin\Debug\ - DEBUG - true - 0 - true - full - AnyCPU - false - 6 - prompt - --tests - - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll - True - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll - True - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll - True - - - - $(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\NuGet.Squirrel.dll - True - - - True - - - $(SolutionDir)\packages\SharpCompress.0.18.1\lib\net45\SharpCompress.dll - True - - - $(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll - True - - - $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_green.dll - - - $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_v2.dll - - - $(SolutionDir)\packages\SQLitePCLRaw.core.1.1.8\lib\net45\SQLitePCLRaw.core.dll - - - $(SolutionDir)\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.8\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll - - - $(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\Squirrel.dll - True - - - - - - $(SolutionDir)\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll - True - - + + + + + + + + - - - osu.licenseheader - - - - - - + + + - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - false - - - - - - - - - - + - - - {c76bf5b3-985e-4d39-95fe-97c9c879b83a} - osu.Framework - - - {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} - osu.Game.Resources - - - {58f6c80c-1253-4a0e-a465-b8c85ebeadf3} - osu.Game.Rulesets.Catch - - - {48f4582b-7687-4621-9cbe-5c24197cb536} - osu.Game.Rulesets.Mania - - - {c92a607b-1fdd-4954-9f92-03ff547d9080} - osu.Game.Rulesets.Osu - - - {f167e17a-7de6-4af5-b920-a5112296c695} - osu.Game.Rulesets.Taiko - - - {54377672-20b1-40af-8087-5cf73bf3953a} - osu.Game.Tests - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - \ No newline at end of file diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 3d134f79bf..e34fb4638f 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,150 +1,30 @@ - - - - Debug - AnyCPU - {54377672-20B1-40AF-8087-5CF73BF3953A} + + + + + netstandard2.0;net461 Library - osu.Game.Tests - osu.Game.Tests - v4.6.1 + AnyCPU + true + ppy Pty Ltd + 1.0.0.0 + ppy Pty Ltd 2007-2017 + osu.Game.Tests + osu.Game.Tests - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - false - 6 - - - true - bin\Release - prompt - 4 - false - false - - - - $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - True - - - - $(SolutionDir)\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll - True - + + + + + + + + - - - osu.licenseheader - - - - + + - - - {c76bf5b3-985e-4d39-95fe-97c9c879b83a} - osu.Framework - - - {c92a607b-1fdd-4954-9f92-03ff547d9080} - osu.Game.Rulesets.Osu - - - {58f6c80c-1253-4a0e-a465-b8c85ebeadf3} - osu.Game.Rulesets.Catch - - - {48f4582b-7687-4621-9cbe-5c24197cb536} - osu.Game.Rulesets.Mania - - - {f167e17a-7de6-4af5-b920-a5112296c695} - osu.Game.Rulesets.Taiko - - - {2a66dd92-adb1-4994-89e2-c94e04acda0d} - osu.Game - - - {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58} - osu.Game.Resources - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - \ No newline at end of file diff --git a/osu.sln b/osu.sln index 86a0e4818b..c75ff78f2d 100644 --- a/osu.sln +++ b/osu.sln @@ -19,9 +19,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Mania", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Deploy", "osu.Desktop.Deploy\osu.Desktop.Deploy.csproj", "{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tests", "osu.Game.Tests\osu.Game.Tests.csproj", "{54377672-20B1-40AF-8087-5CF73BF3953A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Tests", "osu.Game.Tests\osu.Game.Tests.csproj", "{54377672-20B1-40AF-8087-5CF73BF3953A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop", "osu.Desktop\osu.Desktop.csproj", "{419659FD-72EA-4678-9EB8-B22A746CED70}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Desktop", "osu.Desktop\osu.Desktop.csproj", "{419659FD-72EA-4678-9EB8-B22A746CED70}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From db4c912e1e8fd93443790a57a905ef1647b461af Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 14:46:51 +0900 Subject: [PATCH 098/282] Fix up assembly name --- osu.Desktop/osu.Desktop.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index fd0644bc5d..e1ab0e1476 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -10,7 +10,8 @@ 0.0.0.0 click the circles. to the beat. ppy Pty Ltd 2007-2017 - osu!lazer + osu! + osu!lazer osu!lazer From 492120e88cf9ae2b43dc535c19b6c2f19a895b53 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 19 Nov 2017 16:02:08 +0900 Subject: [PATCH 099/282] Add migration for unique constraint on online id --- ...eatmapOnlineIDUniqueConstraint.Designer.cs | 302 ++++++++++++++++++ ...5731_AddBeatmapOnlineIDUniqueConstraint.cs | 25 ++ .../Migrations/OsuDbContextModelSnapshot.cs | 3 + osu.Game/osu.Game.csproj | 4 + 4 files changed, 334 insertions(+) create mode 100644 osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.Designer.cs create mode 100644 osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs diff --git a/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.Designer.cs b/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.Designer.cs new file mode 100644 index 0000000000..b2f81a729a --- /dev/null +++ b/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.Designer.cs @@ -0,0 +1,302 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using osu.Game.Database; +using System; + +namespace osu.Game.Migrations +{ + [DbContext(typeof(OsuDbContext))] + [Migration("20171119065731_AddBeatmapOnlineIDUniqueConstraint")] + partial class AddBeatmapOnlineIDUniqueConstraint + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapDifficulty", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ApproachRate"); + + b.Property("CircleSize"); + + b.Property("DrainRate"); + + b.Property("OverallDifficulty"); + + b.Property("SliderMultiplier"); + + b.Property("SliderTickRate"); + + b.HasKey("ID"); + + b.ToTable("BeatmapDifficulty"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("AudioLeadIn"); + + b.Property("BaseDifficultyID"); + + b.Property("BeatDivisor"); + + b.Property("BeatmapSetInfoID"); + + b.Property("Countdown"); + + b.Property("DistanceSpacing"); + + b.Property("GridSize"); + + b.Property("Hash"); + + b.Property("Hidden"); + + b.Property("LetterboxInBreaks"); + + b.Property("MD5Hash"); + + b.Property("MetadataID"); + + b.Property("OnlineBeatmapID"); + + b.Property("Path"); + + b.Property("RulesetID"); + + b.Property("SpecialStyle"); + + b.Property("StackLeniency"); + + b.Property("StarDifficulty"); + + b.Property("StoredBookmarks"); + + b.Property("TimelineZoom"); + + b.Property("Version"); + + b.Property("WidescreenStoryboard"); + + b.HasKey("ID"); + + b.HasIndex("BaseDifficultyID"); + + b.HasIndex("BeatmapSetInfoID"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("MD5Hash") + .IsUnique(); + + b.HasIndex("MetadataID"); + + b.HasIndex("OnlineBeatmapID") + .IsUnique(); + + b.HasIndex("RulesetID"); + + b.ToTable("BeatmapInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Artist"); + + b.Property("ArtistUnicode"); + + b.Property("AudioFile"); + + b.Property("AuthorString") + .HasColumnName("Author"); + + b.Property("BackgroundFile"); + + b.Property("PreviewTime"); + + b.Property("Source"); + + b.Property("Tags"); + + b.Property("Title"); + + b.Property("TitleUnicode"); + + b.HasKey("ID"); + + b.ToTable("BeatmapMetadata"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("BeatmapSetInfoID"); + + b.Property("FileInfoID"); + + b.Property("Filename") + .IsRequired(); + + b.HasKey("ID"); + + b.HasIndex("BeatmapSetInfoID"); + + b.HasIndex("FileInfoID"); + + b.ToTable("BeatmapSetFileInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("DeletePending"); + + b.Property("Hash"); + + b.Property("MetadataID"); + + b.Property("OnlineBeatmapSetID"); + + b.Property("Protected"); + + b.HasKey("ID"); + + b.HasIndex("DeletePending"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("MetadataID"); + + b.HasIndex("OnlineBeatmapSetID") + .IsUnique(); + + b.ToTable("BeatmapSetInfo"); + }); + + modelBuilder.Entity("osu.Game.Input.Bindings.DatabasedKeyBinding", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("IntAction") + .HasColumnName("Action"); + + b.Property("KeysString") + .HasColumnName("Keys"); + + b.Property("RulesetID"); + + b.Property("Variant"); + + b.HasKey("ID"); + + b.HasIndex("IntAction"); + + b.HasIndex("Variant"); + + b.ToTable("KeyBinding"); + }); + + modelBuilder.Entity("osu.Game.IO.FileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Hash"); + + b.Property("ReferenceCount"); + + b.HasKey("ID"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("ReferenceCount"); + + b.ToTable("FileInfo"); + }); + + modelBuilder.Entity("osu.Game.Rulesets.RulesetInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Available"); + + b.Property("InstantiationInfo"); + + b.Property("Name"); + + b.HasKey("ID"); + + b.HasIndex("Available"); + + b.ToTable("RulesetInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapDifficulty", "BaseDifficulty") + .WithMany() + .HasForeignKey("BaseDifficultyID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo", "BeatmapSet") + .WithMany("Beatmaps") + .HasForeignKey("BeatmapSetInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata") + .WithMany("Beatmaps") + .HasForeignKey("MetadataID"); + + b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset") + .WithMany() + .HasForeignKey("RulesetID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo") + .WithMany("Files") + .HasForeignKey("BeatmapSetInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.IO.FileInfo", "FileInfo") + .WithMany() + .HasForeignKey("FileInfoID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata") + .WithMany("BeatmapSets") + .HasForeignKey("MetadataID"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs b/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs new file mode 100644 index 0000000000..d3830ec0f5 --- /dev/null +++ b/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using System; +using System.Collections.Generic; + +namespace osu.Game.Migrations +{ + public partial class AddBeatmapOnlineIDUniqueConstraint : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateIndex( + name: "IX_BeatmapInfo_OnlineBeatmapID", + table: "BeatmapInfo", + column: "OnlineBeatmapID", + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_BeatmapInfo_OnlineBeatmapID", + table: "BeatmapInfo"); + } + } +} diff --git a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs index 7029dcdcd5..e3f1cf798b 100644 --- a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs +++ b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs @@ -103,6 +103,9 @@ namespace osu.Game.Migrations b.HasIndex("MetadataID"); + b.HasIndex("OnlineBeatmapID") + .IsUnique(); + b.HasIndex("RulesetID"); b.ToTable("BeatmapInfo"); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7b479bdba2..3b4434d1f4 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -279,6 +279,10 @@ 20171025071459_AddMissingIndexRules.cs + + + 20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs + From 5fd16c62682f2b6c8f84b752f52758315339a1d1 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 16:30:41 +0900 Subject: [PATCH 100/282] Make osu.Desktop.Deploy work --- osu.Desktop.Deploy/App.config | 19 --- osu.Desktop.Deploy/Program.cs | 23 ++- osu.Desktop.Deploy/Properties/AssemblyInfo.cs | 38 ----- osu.Desktop.Deploy/osu.Desktop.Deploy.csproj | 146 +++--------------- osu.Desktop/osu.Desktop.csproj | 3 +- osu.sln | 5 +- 6 files changed, 41 insertions(+), 193 deletions(-) delete mode 100644 osu.Desktop.Deploy/Properties/AssemblyInfo.cs diff --git a/osu.Desktop.Deploy/App.config b/osu.Desktop.Deploy/App.config index 2fae7a5e1c..42b2d34097 100644 --- a/osu.Desktop.Deploy/App.config +++ b/osu.Desktop.Deploy/App.config @@ -18,23 +18,4 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index 54fb50d0f8..e13b63f602 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -299,18 +299,27 @@ namespace osu.Desktop.Deploy private static void updateAssemblyInfo(string version) { - string file = Path.Combine(ProjectName, "Properties", "AssemblyInfo.cs"); + var toUpdate = new[] { "", "" }; + string file = Path.Combine(ProjectName, $"{ProjectName}.csproj"); 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); + string line = l; + + foreach (var tag in toUpdate) + { + int startIndex = l.IndexOf(tag); + if (startIndex == -1) + continue; + startIndex += tag.Length; + + int endIndex = l.IndexOf("<", startIndex); + line = $"{l.Substring(0, startIndex)}{version}{l.Substring(endIndex)}"; + } + + l2.Add(line); } File.WriteAllLines(file, l2); diff --git a/osu.Desktop.Deploy/Properties/AssemblyInfo.cs b/osu.Desktop.Deploy/Properties/AssemblyInfo.cs deleted file mode 100644 index 5841c1b082..0000000000 --- a/osu.Desktop.Deploy/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,38 +0,0 @@ -// 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.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 index 6727a86a91..ccbf351bda 100644 --- a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj +++ b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj @@ -1,127 +1,21 @@ - - - - - Debug - AnyCPU - {BAEA2F74-0315-4667-84E0-ACAC0B4BF785} - Exe - Properties - osu.Desktop.Deploy - osu.Desktop.Deploy - v4.6.1 - 512 - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 6 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - osu.Desktop.Deploy.Program - - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll - True - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll - True - - - $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll - True - - - $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - True - - - $(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\NuGet.Squirrel.dll - True - - - $(SolutionDir)\packages\SharpCompress.0.18.1\lib\net45\SharpCompress.dll - True - - - $(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll - True - - - $(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\Squirrel.dll - True - - - - - - - - - - - - - - - - - - - - osu.licenseheader - - - PreserveNewest - - - - - - {C76BF5B3-985E-4D39-95FE-97C9C879B83A} - osu.Framework - - - - + + + + net461 + Exe + AnyCPU + true + ppy Pty Ltd + ppy Pty Ltd 2007-2017 + osu.Desktop.Deploy + osu.Desktop.Deploy + + + + + + + + + \ No newline at end of file diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index e1ab0e1476..34da4fe5a9 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -7,12 +7,13 @@ AnyCPU true ppy Pty Ltd - 0.0.0.0 click the circles. to the beat. ppy Pty Ltd 2007-2017 osu! osu!lazer osu!lazer + 0.0.0.0 + 0.0.0.0 diff --git a/osu.sln b/osu.sln index c75ff78f2d..934ea874d1 100644 --- a/osu.sln +++ b/osu.sln @@ -17,7 +17,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Taiko", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Mania", "osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj", "{48F4582B-7687-4621-9CBE-5C24197CB536}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Deploy", "osu.Desktop.Deploy\osu.Desktop.Deploy.csproj", "{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Desktop.Deploy", "osu.Desktop.Deploy\osu.Desktop.Deploy.csproj", "{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Tests", "osu.Game.Tests\osu.Game.Tests.csproj", "{54377672-20B1-40AF-8087-5CF73BF3953A}" EndProject @@ -71,8 +71,9 @@ Global {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.ActiveCfg = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.Build.0 = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.Build.0 = Debug|Any CPU + {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.Build.0 = Debug|Any CPUı {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.Build.0 = Debug|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release|Any CPU.ActiveCfg = Release|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU From 7f757123e51324c77f703b4f6ff3acc402fcfd27 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 17:24:32 +0900 Subject: [PATCH 101/282] Update vscode launch configurations --- .vscode/launch.json | 86 ++++++++++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 24 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 506915f462..6c0a8929f7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,13 +1,10 @@ { "version": "0.2.0", "configurations": [{ - "name": "osu! VisualTests (Debug)", - "windows": { - "type": "clr" - }, - "type": "mono", + "name": "osu! VisualTests (Debug, .NETFramework)", "request": "launch", - "program": "${workspaceRoot}/osu.Desktop/bin/Debug/osu!.exe", + "type": "clr", + "program": "${workspaceRoot}/osu.Desktop/bin/Debug/net461/osu!.exe", "args": [ "--tests" ], @@ -18,13 +15,24 @@ "console": "internalConsole" }, { - "name": "osu! VisualTests (Release)", - "windows": { - "type": "clr" - }, - "type": "mono", + "name": "osu! VisualTests (Debug, .NETCore)", "request": "launch", - "program": "${workspaceRoot}/osu.Desktop/bin/Release/osu!.exe", + "type": "coreclr", + "program": "${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll", + "args": [ + "--tests" + ], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Debug)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "osu! VisualTests (Release, .NETFramework)", + "request": "launch", + "type": "clr", + "program": "${workspaceRoot}/osu.Desktop/bin/Release/net461/osu!.exe", "args": [ "--tests" ], @@ -35,13 +43,24 @@ "console": "internalConsole" }, { - "name": "osu! (Debug)", - "windows": { - "type": "clr" - }, - "type": "mono", + "name": "osu! VisualTests (Release, .NETCore)", "request": "launch", - "program": "${workspaceRoot}/osu.Desktop/bin/Debug/osu!.exe", + "type": "coreclr", + "program": "${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll", + "args": [ + "--tests" + ], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Release)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "osu! (Debug, .NETFramework)", + "request": "launch", + "type": "clr", + "program": "${workspaceRoot}/osu.Desktop/bin/Debug/net461/osu!.exe", "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Debug)", "runtimeExecutable": null, @@ -49,13 +68,32 @@ "console": "internalConsole" }, { - "name": "osu! (Release)", - "windows": { - "type": "clr" - }, - "type": "mono", + "name": "osu! (Debug, .NETCore)", "request": "launch", - "program": "${workspaceRoot}/osu.Desktop/bin/Release/osu!.exe", + "type": "coreclr", + "program": "${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll", + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Debug)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "osu! (Release, .NETFramework)", + "request": "launch", + "type": "clr", + "program": "${workspaceRoot}/osu.Desktop/bin/Release/net461/osu!.exe", + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Release)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "osu! (Release, .NETCore)", + "request": "launch", + "type": "coreclr", + "program": "${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll", "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release)", "runtimeExecutable": null, From 067c018422abc5f4e7ad1a72e8b2c730c28a430d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 19 Nov 2017 17:31:35 +0900 Subject: [PATCH 102/282] Cleanups --- osu-framework | 2 +- osu.Desktop.Deploy/packages.config | 14 ---- osu.Desktop/packages.config | 20 ------ osu.Game.Rulesets.Catch/packages.config | 5 -- osu.Game.Rulesets.Mania/packages.config | 5 -- osu.Game.Rulesets.Osu/packages.config | 5 -- osu.Game.Rulesets.Taiko/packages.config | 5 -- osu.Game.Tests/OpenTK.dll.config | 25 ------- osu.Game.Tests/app.config | 15 ---- osu.Game.Tests/packages.config | 10 --- osu.Game/packages.config | 95 ------------------------- 11 files changed, 1 insertion(+), 200 deletions(-) delete mode 100644 osu.Desktop.Deploy/packages.config delete mode 100644 osu.Desktop/packages.config delete mode 100644 osu.Game.Rulesets.Catch/packages.config delete mode 100644 osu.Game.Rulesets.Mania/packages.config delete mode 100644 osu.Game.Rulesets.Osu/packages.config delete mode 100644 osu.Game.Rulesets.Taiko/packages.config delete mode 100644 osu.Game.Tests/OpenTK.dll.config delete mode 100644 osu.Game.Tests/app.config delete mode 100644 osu.Game.Tests/packages.config delete mode 100644 osu.Game/packages.config diff --git a/osu-framework b/osu-framework index 7d5df64338..90dbacf0c4 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 7d5df64338e3b3be7bdf3509e9c47a3e9b930430 +Subproject commit 90dbacf0c4f54a2076f1a0be98f8606b627cf947 diff --git a/osu.Desktop.Deploy/packages.config b/osu.Desktop.Deploy/packages.config deleted file mode 100644 index 7725be5f5e..0000000000 --- a/osu.Desktop.Deploy/packages.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Desktop/packages.config b/osu.Desktop/packages.config deleted file mode 100644 index 6b6361b578..0000000000 --- a/osu.Desktop/packages.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Catch/packages.config b/osu.Game.Rulesets.Catch/packages.config deleted file mode 100644 index cde428acea..0000000000 --- a/osu.Game.Rulesets.Catch/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/packages.config b/osu.Game.Rulesets.Mania/packages.config deleted file mode 100644 index cde428acea..0000000000 --- a/osu.Game.Rulesets.Mania/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/packages.config b/osu.Game.Rulesets.Osu/packages.config deleted file mode 100644 index cde428acea..0000000000 --- a/osu.Game.Rulesets.Osu/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/packages.config b/osu.Game.Rulesets.Taiko/packages.config deleted file mode 100644 index cde428acea..0000000000 --- a/osu.Game.Rulesets.Taiko/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/osu.Game.Tests/OpenTK.dll.config b/osu.Game.Tests/OpenTK.dll.config deleted file mode 100644 index 5620e3d9e2..0000000000 --- a/osu.Game.Tests/OpenTK.dll.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osu.Game.Tests/app.config b/osu.Game.Tests/app.config deleted file mode 100644 index 2f5b13a89d..0000000000 --- a/osu.Game.Tests/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config deleted file mode 100644 index ecc44f0c70..0000000000 --- a/osu.Game.Tests/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/osu.Game/packages.config b/osu.Game/packages.config deleted file mode 100644 index 02ace918de..0000000000 --- a/osu.Game/packages.config +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 756f6f2d163b5b0f54ead7af7d1eda50c816ff2e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 10:10:28 +0900 Subject: [PATCH 103/282] Remove net461 targets --- osu-framework | 2 +- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 2 +- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 2 +- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 2 +- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game/osu.Game.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu-framework b/osu-framework index 90dbacf0c4..56ca2152f3 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 90dbacf0c4f54a2076f1a0be98f8606b627cf947 +Subproject commit 56ca2152f3096217cd327721519cd1eb7e57fbee diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 76396f1815..ce07b8c7ff 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index ba9176c853..90d2ad05d4 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index a28ee218b5..8cce2de1b4 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index c4899d3c5c..f4672b913e 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index e34fb4638f..adc96ae3cd 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f995fc76e1..dd591bcba8 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -2,7 +2,7 @@ - netstandard2.0;net461 + netstandard2.0 Library AnyCPU true From 8919e98d13adcdbef4a51609a10701b221d1009c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 20 Nov 2017 11:32:20 +0900 Subject: [PATCH 104/282] Fix CI issue --- osu.Game/Beatmaps/BeatmapManager.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 2e74adbf45..006269f186 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -484,19 +484,14 @@ namespace osu.Game.Beatmaps metadata = BeatmapDecoder.GetDecoder(stream).Decode(stream).Metadata; // check if a set already exists with the same online id. - beatmapSet = beatmaps.BeatmapSets.FirstOrDefault(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID); - - if (beatmapSet == null) + beatmapSet = beatmaps.BeatmapSets.FirstOrDefault(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID) ?? new BeatmapSetInfo { - beatmapSet = new BeatmapSetInfo - { - OnlineBeatmapSetID = metadata.OnlineBeatmapSetID, - Beatmaps = new List(), - Hash = hash, - Files = fileInfos, - Metadata = metadata - }; - } + OnlineBeatmapSetID = metadata.OnlineBeatmapSetID, + Beatmaps = new List(), + Hash = hash, + Files = fileInfos, + Metadata = metadata + }; var mapNames = reader.Filenames.Where(f => f.EndsWith(".osu")); From ecc2877be6457420e3a978428ffff5949ee5d815 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 20 Nov 2017 09:29:26 +0300 Subject: [PATCH 105/282] Fix possible null and adjust timeline width --- osu.Game/Screens/Edit/Editor.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 9093bf5629..52baadd442 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -93,8 +93,7 @@ namespace osu.Game.Screens.Edit ColumnDimensions = new[] { new Dimension(), - new Dimension(GridSizeMode.Relative, 0.67f), - new Dimension(), + new Dimension(GridSizeMode.Relative, 0.65f), }, Content = new[] { @@ -173,8 +172,11 @@ namespace osu.Game.Screens.Edit protected override bool OnExiting(Screen next) { Background.FadeColour(Color4.White, 500); - Beatmap.Value.Track.Tempo.Value = 1; - Beatmap.Value.Track?.Start(); + if (Beatmap.Value.Track != null) + { + Beatmap.Value.Track.Tempo.Value = 1; + Beatmap.Value.Track.Start(); + } return base.OnExiting(next); } } From e608d2841bc4808ad932769ab978b357fedd0c93 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 16:10:34 +0900 Subject: [PATCH 106/282] Prefer net461 --- osu.Desktop/osu.Desktop.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 34da4fe5a9..3b08715d2d 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -2,7 +2,7 @@ - netcoreapp2.0;net461 + net461;netcoreapp2.0 Exe AnyCPU true From da30d76f9b08b1435db366b5b0004cb704fd5f94 Mon Sep 17 00:00:00 2001 From: Brayzure Date: Mon, 20 Nov 2017 02:15:29 -0500 Subject: [PATCH 107/282] Implement Score Processor Mod Interface - Add a delegate whenever we want to register an additional fail condition --- .../Mods/IApplicableToScoreProcessor.cs | 15 +++++++ osu.Game/Rulesets/Mods/ModPerfect.cs | 16 ++++++- osu.Game/Rulesets/Mods/ModSuddenDeath.cs | 15 ++++++- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 43 ++++++++++--------- osu.Game/Screens/Play/Player.cs | 12 ++++-- osu.Game/osu.Game.csproj | 1 + 6 files changed, 74 insertions(+), 28 deletions(-) create mode 100644 osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs diff --git a/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs b/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs new file mode 100644 index 0000000000..db9b713c59 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// An interface for mods that make general adjustments to score processor. + /// + public interface IApplicableToScoreProcessor + { + void ApplyToScoreProcessor(ScoreProcessor scoreProcessor); + } +} diff --git a/osu.Game/Rulesets/Mods/ModPerfect.cs b/osu.Game/Rulesets/Mods/ModPerfect.cs index 082370ea5d..7b79493d65 100644 --- a/osu.Game/Rulesets/Mods/ModPerfect.cs +++ b/osu.Game/Rulesets/Mods/ModPerfect.cs @@ -1,12 +1,24 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Rulesets.Scoring; + namespace osu.Game.Rulesets.Mods { - public abstract class ModPerfect : ModSuddenDeath + public abstract class ModPerfect : ModSuddenDeath, IApplicableToScoreProcessor { public override string Name => "Perfect"; public override string ShortenedName => "PF"; public override string Description => "SS or quit."; + + public bool onFailCheck(ScoreProcessor scoreProcessor) + { + return scoreProcessor.Accuracy.Value != 1; + } + + public virtual void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) + { + scoreProcessor.FailChecker += onFailCheck; + } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs index 999cb40f89..c71442fa28 100644 --- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs +++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs @@ -3,10 +3,11 @@ using System; using osu.Game.Graphics; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mods { - public abstract class ModSuddenDeath : Mod + public abstract class ModSuddenDeath : Mod, IApplicableToScoreProcessor { public override string Name => "Sudden Death"; public override string ShortenedName => "SD"; @@ -16,5 +17,15 @@ namespace osu.Game.Rulesets.Mods public override double ScoreMultiplier => 1; public override bool Ranked => true; public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay) }; + + public bool onFailCheck(ScoreProcessor scoreProcessor) + { + return scoreProcessor.Combo.Value != scoreProcessor.HighestCombo.Value; + } + + public virtual void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) + { + scoreProcessor.FailChecker += onFailCheck; + } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index f579b94c69..997dfc2a58 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; +using System.Collections.Generic; using osu.Framework.Configuration; using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; @@ -31,6 +32,11 @@ namespace osu.Game.Rulesets.Scoring /// public event Action NewJudgement; + /// + /// Invoked when we want to check if a failure condition has been fulfilled + /// + public event Func FailChecker; + /// /// The current total score. /// @@ -66,8 +72,6 @@ namespace osu.Game.Rulesets.Scoring /// protected virtual bool HasCompleted => false; - public int strictFail = 0; - /// /// Whether this ScoreProcessor has already triggered the failed state. /// @@ -78,16 +82,6 @@ namespace osu.Game.Rulesets.Scoring /// protected virtual bool FailCondition => Health.Value == Health.MinValue; - /// - /// The conditions for failing if the Sudden Death mod is enabled. - /// - protected virtual bool SuddenDeathFailCondition => Combo.Value != HighestCombo.Value; - - /// - /// The conditions for failing if the Perfect mod is enabled. - /// - protected virtual bool PerfectFailCondition => Accuracy.Value != 1; - protected ScoreProcessor() { Combo.ValueChanged += delegate { HighestCombo.Value = Math.Max(HighestCombo.Value, Combo.Value); }; @@ -133,16 +127,11 @@ namespace osu.Game.Rulesets.Scoring /// protected void UpdateFailed() { - if (HasFailed) + if (HasFailed || !FailCondition) return; - if(FailCondition || - (strictFail==1 && SuddenDeathFailCondition) || - (strictFail==2 && PerfectFailCondition)) - { - if (Failed?.Invoke() != false) - HasFailed = true; - } + if (Failed?.Invoke() != false) + HasFailed = true; } /// @@ -157,6 +146,18 @@ namespace osu.Game.Rulesets.Scoring AllJudged?.Invoke(); } + protected void CheckAlternateFailConditions() + { + if (HasFailed) + return; + + if (FailChecker?.Invoke(this) == true) + { + if (Failed?.Invoke() != false) + HasFailed = true; + } + } + /// /// Retrieve a score populated with data for the current play this processor is responsible for. /// @@ -233,6 +234,8 @@ namespace osu.Game.Rulesets.Scoring OnNewJudgement(judgement); updateScore(); + CheckAlternateFailConditions(); + NotifyNewJudgement(judgement); UpdateFailed(); } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 2603fee769..0bff13a46a 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -228,11 +228,15 @@ namespace osu.Game.Screens.Play scoreProcessor.AllJudged += onCompletion; scoreProcessor.Failed += onFail; - if (Beatmap.Value.Mods.Value.Any(m => m.Name == "Sudden Death")) - scoreProcessor.strictFail = 1; + applyAlternateFailConditions(); + } - if (Beatmap.Value.Mods.Value.Any(m => m.Name == "Perfect")) - scoreProcessor.strictFail = 2; + private void applyAlternateFailConditions() + { + foreach(var mod in Beatmap.Value.Mods.Value.OfType()) + { + mod.ApplyToScoreProcessor(scoreProcessor); + } } private void applyRateFromMods() diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7b479bdba2..5306f0df4a 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -294,6 +294,7 @@ + From 6df18ffb7accaeeb96254af4818350e1859235b1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 20 Nov 2017 18:14:30 +0900 Subject: [PATCH 108/282] FocusedTextBox should not handle repeated escapes --- osu.Game/Graphics/UserInterface/FocusedTextBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs index fe060f70f0..206c7a839d 100644 --- a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs +++ b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs @@ -38,7 +38,7 @@ namespace osu.Game.Graphics.UserInterface protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { - if (args.Key == Key.Escape) + if (!args.Repeat && args.Key == Key.Escape) { if (Text.Length > 0) Text = string.Empty; From f0966a2e1264712f5d4c983342685b09db838b21 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 18:40:00 +0900 Subject: [PATCH 109/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 56ca2152f3..b77ceb37e6 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 56ca2152f3096217cd327721519cd1eb7e57fbee +Subproject commit b77ceb37e6186cbf6f5b8a72959d753fbb56f9a5 From aac41d2de63f154aa98dfa16f24cb3bcb6fa5466 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 18:55:48 +0900 Subject: [PATCH 110/282] Disable resharper inspections on case-by-case basis --- osu.Desktop.Deploy/Program.cs | 4 ++-- osu.Desktop/OsuGameDesktop.cs | 11 +++++++++-- osu.Desktop/Overlays/VersionManager.cs | 12 +++++++----- osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs | 1 + osu.Game/Beatmaps/BeatmapManager.cs | 1 + osu.Game/Graphics/Cursor/MenuCursor.cs | 1 + osu.Game/IO/Legacy/SerializationReader.cs | 1 + osu.Game/Online/API/OAuth.cs | 1 + .../Online/API/Requests/GetUserBeatmapsRequest.cs | 1 + .../Online/API/Requests/GetUserScoresRequest.cs | 3 ++- .../API/Requests/SearchBeatmapSetsRequest.cs | 1 + osu.Game/Online/Chat/Message.cs | 1 + osu.Game/Overlays/ChatOverlay.cs | 2 ++ osu.Game/Overlays/MusicController.cs | 1 + .../Rulesets/Timing/MultiplierControlPoint.cs | 1 + osu.Game/Rulesets/UI/RulesetContainer.cs | 1 + osu.Game/Rulesets/UI/ScrollingPlayfield.cs | 1 + .../Select/Leaderboards/LeaderboardScore.cs | 1 + osu.Game/Screens/Tournament/Drawings.cs | 1 + .../Screens/Tournament/ScrollingTeamContainer.cs | 15 +++++++++------ .../Tournament/Teams/StorageBackedTeamList.cs | 1 + 21 files changed, 46 insertions(+), 16 deletions(-) diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index e13b63f602..3c1d532c0f 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -310,12 +310,12 @@ namespace osu.Desktop.Deploy foreach (var tag in toUpdate) { - int startIndex = l.IndexOf(tag); + int startIndex = l.IndexOf(tag, StringComparison.InvariantCulture); if (startIndex == -1) continue; startIndex += tag.Length; - int endIndex = l.IndexOf("<", startIndex); + int endIndex = l.IndexOf("<", startIndex, StringComparison.InvariantCulture); line = $"{l.Substring(0, startIndex)}{version}{l.Substring(endIndex)}"; } diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index b8eeeb1a5b..ff4b37a8fb 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -5,13 +5,16 @@ using System; using System.IO; using System.Linq; using System.Threading.Tasks; -using Microsoft.Win32; using osu.Desktop.Overlays; using osu.Framework.Graphics.Containers; using osu.Framework.Platform; using osu.Game; using OpenTK.Input; +#if NET461 +using Microsoft.Win32; +#endif + namespace osu.Desktop { internal class OsuGameDesktop : OsuGame @@ -45,9 +48,9 @@ namespace osu.Desktop { Func checkExists = p => Directory.Exists(Path.Combine(p, "Songs")); +#if NET461 string stableInstallPath; -#if NET461 try { using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu")) @@ -61,7 +64,11 @@ namespace osu.Desktop } #endif +#if NET461 stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); +#else + var stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); +#endif if (checkExists(stableInstallPath)) return stableInstallPath; diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 8bb9d596d1..fef7e6d52a 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -1,9 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Diagnostics; -using System.Net.Http; using osu.Framework.Allocation; using osu.Framework.Development; using osu.Framework.Graphics; @@ -12,7 +10,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Framework.Logging; using osu.Game; using osu.Game.Configuration; using osu.Game.Graphics; @@ -23,6 +20,9 @@ using OpenTK; using OpenTK.Graphics; #if NET461 +using System; +using System.Net.Http; +using osu.Framework.Logging; using Squirrel; #endif @@ -101,8 +101,10 @@ namespace osu.Desktop.Overlays } }; +#if NET461 if (game.IsDeployedBuild) checkForUpdateAsync(); +#endif } protected override void LoadComplete() @@ -150,9 +152,9 @@ namespace osu.Desktop.Overlays #endif } +#if NET461 private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null) { -#if NET461 //should we schedule a retry on completion of this check? bool scheduleRetry = true; @@ -223,8 +225,8 @@ namespace osu.Desktop.Overlays notification.State = ProgressNotificationState.Cancelled; } } -#endif } +#endif protected override void PopIn() { diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs index a5be6a7952..793a9b73ad 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs @@ -128,6 +128,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor { Trace.Assert(lastPosition.HasValue); + // ReSharper disable once PossibleInvalidOperationException Vector2 pos1 = lastPosition.Value; Vector2 diff = pos2 - pos1; float distance = diff.Length; diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 4bce2a96da..13cefc6a73 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -307,6 +307,7 @@ namespace osu.Game.Beatmaps context.ChangeTracker.AutoDetectChangesEnabled = false; // re-fetch the beatmap set on the import context. + // ReSharper disable once AccessToModifiedClosure beatmapSet = context.BeatmapSetInfo.Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == beatmapSet.ID); // create local stores so we can isolate and thread safely, and share a context/transaction. diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index da117a94c1..451422038f 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -33,6 +33,7 @@ namespace osu.Game.Graphics.Cursor // don't start rotating until we're moved a minimum distance away from the mouse down location, // else it can have an annoying effect. + // ReSharper disable once PossibleInvalidOperationException startRotation |= Vector2Extensions.Distance(state.Mouse.Position, state.Mouse.PositionMouseDown.Value) > 30; if (startRotation) diff --git a/osu.Game/IO/Legacy/SerializationReader.cs b/osu.Game/IO/Legacy/SerializationReader.cs index e79eef4e2b..393a13448e 100644 --- a/osu.Game/IO/Legacy/SerializationReader.cs +++ b/osu.Game/IO/Legacy/SerializationReader.cs @@ -186,6 +186,7 @@ namespace osu.Game.IO.Legacy Debug.Assert(formatter != null, "formatter != null"); + // ReSharper disable once PossibleNullReferenceException return formatter.Deserialize(stream); } diff --git a/osu.Game/Online/API/OAuth.cs b/osu.Game/Online/API/OAuth.cs index ca38f72904..198c71f0c1 100644 --- a/osu.Game/Online/API/OAuth.cs +++ b/osu.Game/Online/API/OAuth.cs @@ -96,6 +96,7 @@ namespace osu.Game.Online.API // if not, let's try using our refresh token to request a new access token. if (!string.IsNullOrEmpty(Token?.RefreshToken)) + // ReSharper disable once PossibleNullReferenceException AuthenticateWithRefresh(Token.RefreshToken); return accessTokenValid; diff --git a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs index a66799f404..923ae0e269 100644 --- a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs @@ -19,6 +19,7 @@ namespace osu.Game.Online.API.Requests this.type = type; } + // ReSharper disable once ImpureMethodCallOnReadonlyValueField protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().Underscore()}?offset={offset}"; } diff --git a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs index 98db234196..e30a449978 100644 --- a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs @@ -18,6 +18,7 @@ namespace osu.Game.Online.API.Requests this.offset = offset; } + // ReSharper disable once ImpureMethodCallOnReadonlyValueField protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLower()}?offset={offset}"; } @@ -27,4 +28,4 @@ namespace osu.Game.Online.API.Requests Firsts, Recent } -} \ No newline at end of file +} diff --git a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs index 56858b3d56..b949bf35f0 100644 --- a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs +++ b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs @@ -27,6 +27,7 @@ namespace osu.Game.Online.API.Requests this.direction = direction; } + // ReSharper disable once ImpureMethodCallOnReadonlyValueField protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)rankStatus}&sort={sortCriteria.ToString().ToLower()}_{directionString}"; } } diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 79b5c4fc1a..972e4755c9 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -57,6 +57,7 @@ namespace osu.Game.Online.Chat public virtual bool Equals(Message other) => Id == other?.Id; + // ReSharper disable once ImpureMethodCallOnReadonlyValueField public override int GetHashCode() => Id.GetHashCode(); } diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 24fc322199..ef514c95fd 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -207,6 +207,7 @@ namespace osu.Game.Overlays { Trace.Assert(state.Mouse.PositionMouseDown != null); + // ReSharper disable once PossibleInvalidOperationException double targetChatHeight = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y; // If the channel selection screen is shown, mind its minimum height @@ -380,6 +381,7 @@ namespace osu.Game.Overlays { if (channel == null) return; + // ReSharper disable once AccessToModifiedClosure var existing = careChannels.Find(c => c.Id == channel.Id); if (existing != null) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index a99ce89a36..cf8946e399 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -71,6 +71,7 @@ namespace osu.Game.Overlays { Trace.Assert(state.Mouse.PositionMouseDown != null, "state.Mouse.PositionMouseDown != null"); + // ReSharper disable once PossibleInvalidOperationException Vector2 change = state.Mouse.Position - state.Mouse.PositionMouseDown.Value; // Diminish the drag distance as we go further to simulate "rubber band" feeling. diff --git a/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs b/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs index 4f1a85cf2d..ba0e66e04c 100644 --- a/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs +++ b/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs @@ -60,6 +60,7 @@ namespace osu.Game.Rulesets.Timing DifficultyPoint = other.DifficultyPoint; } + // ReSharper disable once ImpureMethodCallOnReadonlyValueField public int CompareTo(MultiplierControlPoint other) => StartTime.CompareTo(other?.StartTime); } } diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 278814ea7e..b627db8aff 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -157,6 +157,7 @@ namespace osu.Game.Rulesets.UI WorkingBeatmap = workingBeatmap; IsForCurrentRuleset = isForCurrentRuleset; + // ReSharper disable once PossibleNullReferenceException Mods = workingBeatmap.Mods.Value; RelativeSizeAxes = Axes.Both; diff --git a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs index 395248b2fd..cff3a029e6 100644 --- a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs @@ -255,6 +255,7 @@ namespace osu.Game.Rulesets.UI var sX = (SpeedAdjustmentContainer)x; var sY = (SpeedAdjustmentContainer)y; + // ReSharper disable once ImpureMethodCallOnReadonlyValueField int result = sY.ControlPoint.StartTime.CompareTo(sX.ControlPoint.StartTime); if (result != 0) return result; diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 9044938a75..6ddafe085e 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -123,6 +123,7 @@ namespace osu.Game.Screens.Select.Leaderboards Origin = Anchor.CentreLeft, Font = @"Exo2.0-MediumItalic", TextSize = 22, + // ReSharper disable once ImpureMethodCallOnReadonlyValueField Text = RankPosition.ToString(), }, }, diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index e540782fc1..269b206a78 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -326,6 +326,7 @@ namespace osu.Game.Screens.Tournament if (line.ToUpper().StartsWith("GROUP")) continue; + // ReSharper disable once AccessToModifiedClosure DrawingsTeam teamToAdd = allTeams.FirstOrDefault(t => t.FullName == line); if (teamToAdd == null) diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index 2eb0dacec3..5bae30458e 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -13,9 +13,9 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Threading; +using osu.Game.Screens.Tournament.Teams; using OpenTK; using OpenTK.Graphics; -using osu.Game.Screens.Tournament.Teams; namespace osu.Game.Screens.Tournament { @@ -118,16 +118,18 @@ namespace osu.Game.Screens.Tournament if (!Children.Any()) break; - Drawable closest = null; + ScrollingTeam closest = null; foreach (var c in Children) { - if (!(c is ScrollingTeam)) + var stc = c as ScrollingTeam; + + if (stc == null) continue; if (closest == null) { - closest = c; + closest = stc; continue; } @@ -135,14 +137,15 @@ namespace osu.Game.Screens.Tournament float lastOffset = Math.Abs(closest.Position.X + closest.DrawWidth / 2f - DrawWidth / 2f); if (o < lastOffset) - closest = c; + closest = stc; } Trace.Assert(closest != null, "closest != null"); + // ReSharper disable once PossibleNullReferenceException offset += DrawWidth / 2f - (closest.Position.X + closest.DrawWidth / 2f); - ScrollingTeam st = closest as ScrollingTeam; + ScrollingTeam st = closest; availableTeams.RemoveAll(at => at == st.Team); diff --git a/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs b/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs index 1b2d84a666..ce3b5ed941 100644 --- a/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs +++ b/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs @@ -38,6 +38,7 @@ namespace osu.Game.Screens.Tournament.Teams if (string.IsNullOrEmpty(line)) continue; + // ReSharper disable once PossibleNullReferenceException string[] split = line.Split(':'); if (split.Length < 2) From 7cfca866e20793efa0aae16cafefba4b8154b8d3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 19:43:46 +0900 Subject: [PATCH 111/282] Don't compile osu.Desktop.Deploy now --- osu.sln | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.sln b/osu.sln index 934ea874d1..3093c19868 100644 --- a/osu.sln +++ b/osu.sln @@ -73,7 +73,6 @@ Global {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.Build.0 = Debug|Any CPUı {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.Build.0 = Debug|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release|Any CPU.ActiveCfg = Release|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU From e98d9e8a8cd90b0b2e7c62917e516876453a8fac Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Nov 2017 19:44:06 +0900 Subject: [PATCH 112/282] Explicitly define constant --- osu-framework | 2 +- osu.Desktop/OsuGameDesktop.cs | 6 +++--- osu.Desktop/Overlays/VersionManager.cs | 12 ++++++------ osu.Desktop/osu.Desktop.csproj | 3 +++ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/osu-framework b/osu-framework index b77ceb37e6..6b305b3332 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit b77ceb37e6186cbf6f5b8a72959d753fbb56f9a5 +Subproject commit 6b305b3332cdc424ef7fc3c9499c21e174f9eec5 diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index ff4b37a8fb..d356fcf53d 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -11,7 +11,7 @@ using osu.Framework.Platform; using osu.Game; using OpenTK.Input; -#if NET461 +#if NET_FRAMEWORK using Microsoft.Win32; #endif @@ -48,7 +48,7 @@ namespace osu.Desktop { Func checkExists = p => Directory.Exists(Path.Combine(p, "Songs")); -#if NET461 +#if NET_FRAMEWORK string stableInstallPath; try @@ -64,7 +64,7 @@ namespace osu.Desktop } #endif -#if NET461 +#if NET_FRAMEWORK stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); #else var stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index fef7e6d52a..3db7297385 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -19,7 +19,7 @@ using osu.Game.Overlays.Notifications; using OpenTK; using OpenTK.Graphics; -#if NET461 +#if NET_FRAMEWORK using System; using System.Net.Http; using osu.Framework.Logging; @@ -30,7 +30,7 @@ namespace osu.Desktop.Overlays { public class VersionManager : OverlayContainer { -#if NET461 +#if NET_FRAMEWORK private UpdateManager updateManager; #endif @@ -101,7 +101,7 @@ namespace osu.Desktop.Overlays } }; -#if NET461 +#if NET_FRAMEWORK if (game.IsDeployedBuild) checkForUpdateAsync(); #endif @@ -147,12 +147,12 @@ namespace osu.Desktop.Overlays { base.Dispose(isDisposing); -#if NET461 +#if NET_FRAMEWORK updateManager?.Dispose(); #endif } -#if NET461 +#if NET_FRAMEWORK private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null) { //should we schedule a retry on completion of this check? @@ -247,7 +247,7 @@ namespace osu.Desktop.Overlays Activated = () => { // Squirrel returns execution to us after the update process is started, so it's safe to use Wait() here -#if NET461 +#if NET_FRAMEWORK UpdateManager.RestartAppWhenExited().Wait(); #endif game.GracefullyExit(); diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 3b08715d2d..9fed566703 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -15,6 +15,9 @@ 0.0.0.0 0.0.0.0 + + $(DefineConstants);NET_FRAMEWORK + From 165ac8cdec031195c565a4dfbad2d26a8ba218b0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 20 Nov 2017 21:21:34 +0900 Subject: [PATCH 113/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index f27e36d405..14eb531c00 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit f27e36d405dd3f041e19defd59ecbb389ba84617 +Subproject commit 14eb531c0056b8569f21b3571890383ffbea768e From 6d74fd254c389d71fe2af0c712e3307f2ad92518 Mon Sep 17 00:00:00 2001 From: Brayzure Date: Mon, 20 Nov 2017 20:25:14 -0500 Subject: [PATCH 114/282] Remove Extraneous Using Statement - System.Collections.Generic was leftover from a previous attempt --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 997dfc2a58..c3ae887a9f 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; -using System.Collections.Generic; using osu.Framework.Configuration; using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; From 2b0295ed86660cd9729abfe616e3ad6a24e282c8 Mon Sep 17 00:00:00 2001 From: Brayzure Date: Mon, 20 Nov 2017 20:49:31 -0500 Subject: [PATCH 115/282] Proper Public Method Case - onFailCheck to OnFailCheck --- osu.Game/Rulesets/Mods/ModPerfect.cs | 4 ++-- osu.Game/Rulesets/Mods/ModSuddenDeath.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModPerfect.cs b/osu.Game/Rulesets/Mods/ModPerfect.cs index 7b79493d65..cf7bf141c3 100644 --- a/osu.Game/Rulesets/Mods/ModPerfect.cs +++ b/osu.Game/Rulesets/Mods/ModPerfect.cs @@ -11,14 +11,14 @@ namespace osu.Game.Rulesets.Mods public override string ShortenedName => "PF"; public override string Description => "SS or quit."; - public bool onFailCheck(ScoreProcessor scoreProcessor) + public bool OnFailCheck(ScoreProcessor scoreProcessor) { return scoreProcessor.Accuracy.Value != 1; } public virtual void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) { - scoreProcessor.FailChecker += onFailCheck; + scoreProcessor.FailChecker += OnFailCheck; } } } diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs index c71442fa28..6675c41bd4 100644 --- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs +++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs @@ -18,14 +18,14 @@ namespace osu.Game.Rulesets.Mods public override bool Ranked => true; public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay) }; - public bool onFailCheck(ScoreProcessor scoreProcessor) + public bool OnFailCheck(ScoreProcessor scoreProcessor) { return scoreProcessor.Combo.Value != scoreProcessor.HighestCombo.Value; } public virtual void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) { - scoreProcessor.FailChecker += onFailCheck; + scoreProcessor.FailChecker += OnFailCheck; } } } From 4f6263ef868e64a473c5189531d3f19e6cbe9005 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 11:49:42 +0900 Subject: [PATCH 116/282] Make many internal classes and methods public This is important when using dynamic compiling to rapidly iterate. Until we actually split projects out into pieces (like the abstract ruleset project we have talked about) there is no advantage to using internal in the osu! game code. --- osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs | 2 +- osu.Game/Beatmaps/DummyWorkingBeatmap.cs | 2 +- osu.Game/Graphics/UserInterface/DialogButton.cs | 2 +- osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs | 4 ++-- .../Graphics/UserInterface/Volume/VolumeControlReceptor.cs | 2 +- osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs | 4 ++-- osu.Game/Online/API/OAuth.cs | 2 +- osu.Game/Online/API/OAuthToken.cs | 2 +- osu.Game/Online/Multiplayer/GameType.cs | 2 +- osu.Game/Overlays/ChatOverlay.cs | 2 +- osu.Game/Overlays/KeyBinding/KeyBindingRow.cs | 2 +- osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs | 2 +- osu.Game/Overlays/LoginOverlay.cs | 2 +- osu.Game/Overlays/Music/FilterControl.cs | 2 +- osu.Game/Overlays/Music/PlaylistItem.cs | 2 +- osu.Game/Overlays/Music/PlaylistList.cs | 2 +- osu.Game/Overlays/Settings/SettingsItem.cs | 6 +++--- osu.Game/Overlays/Settings/SettingsLabel.cs | 2 +- osu.Game/Overlays/Settings/Sidebar.cs | 6 +++--- osu.Game/Overlays/SettingsOverlay.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarChatButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarUserArea.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 2 +- osu.Game/Rulesets/Judgements/Judgement.cs | 6 +++--- .../Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs | 2 +- .../Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs | 2 +- .../Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs | 2 +- .../Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs | 2 +- osu.Game/Rulesets/Timing/LinearScrollingContainer.cs | 2 +- osu.Game/Rulesets/UI/Playfield.cs | 2 +- osu.Game/Rulesets/UI/RulesetContainer.cs | 2 +- osu.Game/Screens/Charts/ChartInfo.cs | 2 +- osu.Game/Screens/Charts/ChartListing.cs | 2 +- osu.Game/Screens/Direct/OnlineListing.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/BreakPart.cs | 2 +- .../Components/Timelines/Summary/Parts/ControlPointPart.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/MarkerPart.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/TimelinePart.cs | 2 +- .../Summary/Visualisations/DurationVisualisation.cs | 2 +- .../Timelines/Summary/Visualisations/PointVisualisation.cs | 2 +- osu.Game/Screens/Edit/Screens/Design/Design.cs | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 6 +++--- osu.Game/Screens/Menu/Intro.cs | 2 +- osu.Game/Screens/Menu/OsuLogo.cs | 2 +- osu.Game/Screens/Multiplayer/Lobby.cs | 2 +- osu.Game/Screens/Multiplayer/Match.cs | 2 +- osu.Game/Screens/Multiplayer/MatchCreate.cs | 2 +- osu.Game/Screens/Ranking/ResultsPage.cs | 2 +- osu.Game/Screens/Ranking/ResultsPageRanking.cs | 4 ++-- osu.Game/Screens/Ranking/ResultsPageScore.cs | 2 +- osu.Game/Screens/Select/BeatmapCarousel.cs | 4 ++-- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- .../Screens/Tournament/Components/VisualiserContainer.cs | 2 +- 62 files changed, 81 insertions(+), 81 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs b/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs index 0ac8d12591..e4904786c7 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics.Sprites; namespace osu.Game.Beatmaps.Drawables { - internal class BeatmapBackgroundSprite : Sprite + public class BeatmapBackgroundSprite : Sprite { private readonly WorkingBeatmap working; diff --git a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs index c15d585eb2..c187aa592a 100644 --- a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs +++ b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs @@ -11,7 +11,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Beatmaps { - internal class DummyWorkingBeatmap : WorkingBeatmap + public class DummyWorkingBeatmap : WorkingBeatmap { private readonly OsuGameBase game; diff --git a/osu.Game/Graphics/UserInterface/DialogButton.cs b/osu.Game/Graphics/UserInterface/DialogButton.cs index 289ccbf5cd..bb62815a7b 100644 --- a/osu.Game/Graphics/UserInterface/DialogButton.cs +++ b/osu.Game/Graphics/UserInterface/DialogButton.cs @@ -66,7 +66,7 @@ namespace osu.Game.Graphics.UserInterface } private float textSize = 28; - internal float TextSize + public float TextSize { get { diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 8c777f491b..273a2279bf 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -11,7 +11,7 @@ using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface.Volume { - internal class VolumeControl : OverlayContainer + public class VolumeControl : OverlayContainer { private readonly VolumeMeter volumeMeterMaster; @@ -119,4 +119,4 @@ namespace osu.Game.Graphics.UserInterface.Volume this.Delay(1000).Schedule(Hide, out popOutDelegate); } } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs index c222fecb5d..7c740f16ce 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs @@ -8,7 +8,7 @@ using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface.Volume { - internal class VolumeControlReceptor : Container, IKeyBindingHandler + public class VolumeControlReceptor : Container, IKeyBindingHandler { public Func ActionRequested; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index 81c4fa9bae..d55b16563d 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -13,7 +13,7 @@ using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface.Volume { - internal class VolumeMeter : Container, IKeyBindingHandler + public class VolumeMeter : Container, IKeyBindingHandler { private readonly Box meterFill; public BindableDouble Bindable { get; } = new BindableDouble(); @@ -108,4 +108,4 @@ namespace osu.Game.Graphics.UserInterface.Volume public bool OnReleased(GlobalAction action) => false; } -} \ No newline at end of file +} diff --git a/osu.Game/Online/API/OAuth.cs b/osu.Game/Online/API/OAuth.cs index ca38f72904..322688ced9 100644 --- a/osu.Game/Online/API/OAuth.cs +++ b/osu.Game/Online/API/OAuth.cs @@ -6,7 +6,7 @@ using osu.Framework.IO.Network; namespace osu.Game.Online.API { - internal class OAuth + public class OAuth { private readonly string clientId; private readonly string clientSecret; diff --git a/osu.Game/Online/API/OAuthToken.cs b/osu.Game/Online/API/OAuthToken.cs index 2abd7b6c1f..0c9dc26b59 100644 --- a/osu.Game/Online/API/OAuthToken.cs +++ b/osu.Game/Online/API/OAuthToken.cs @@ -8,7 +8,7 @@ using Newtonsoft.Json; namespace osu.Game.Online.API { [Serializable] - internal class OAuthToken + public class OAuthToken { /// /// OAuth 2.0 access token. diff --git a/osu.Game/Online/Multiplayer/GameType.cs b/osu.Game/Online/Multiplayer/GameType.cs index c94b409d1b..7bec0e94bb 100644 --- a/osu.Game/Online/Multiplayer/GameType.cs +++ b/osu.Game/Online/Multiplayer/GameType.cs @@ -100,7 +100,7 @@ namespace osu.Game.Online.Multiplayer } } - internal class VersusRow : FillFlowContainer + public class VersusRow : FillFlowContainer { public VersusRow(Color4 first, Color4 second, float size) { diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 24fc322199..c5ffc5a2f1 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -58,7 +58,7 @@ namespace osu.Game.Overlays private readonly Box chatBackground; private readonly Box tabBackground; - public Bindable ChatHeight { get; internal set; } + public Bindable ChatHeight { get; public set; } private readonly Container channelSelectionContainer; private readonly ChannelSelectionOverlay channelSelection; diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs index 4141a502a0..509a4f3856 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs @@ -19,7 +19,7 @@ using OpenTK.Input; namespace osu.Game.Overlays.KeyBinding { - internal class KeyBindingRow : Container, IFilterable + public class KeyBindingRow : Container, IFilterable { private readonly object action; private readonly IEnumerable bindings; diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs b/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs index 2ff5d7b81f..30ff0ab026 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.KeyBinding } } - internal class ResetButton : OsuButton + public class ResetButton : OsuButton { [BackgroundDependencyLoader] private void load(OsuColour colours) diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs index 0a47637589..fe3a846eb2 100644 --- a/osu.Game/Overlays/LoginOverlay.cs +++ b/osu.Game/Overlays/LoginOverlay.cs @@ -13,7 +13,7 @@ using osu.Game.Graphics.Cursor; namespace osu.Game.Overlays { - internal class LoginOverlay : OsuFocusedOverlayContainer + public class LoginOverlay : OsuFocusedOverlayContainer { private LoginSettings settingsSection; diff --git a/osu.Game/Overlays/Music/FilterControl.cs b/osu.Game/Overlays/Music/FilterControl.cs index 56cd6e864b..52d311e501 100644 --- a/osu.Game/Overlays/Music/FilterControl.cs +++ b/osu.Game/Overlays/Music/FilterControl.cs @@ -13,7 +13,7 @@ using System; namespace osu.Game.Overlays.Music { - internal class FilterControl : Container + public class FilterControl : Container { public readonly FilterTextBox Search; diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index 723b3f4e96..8168929f9c 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -17,7 +17,7 @@ using OpenTK; namespace osu.Game.Overlays.Music { - internal class PlaylistItem : Container, IFilterable, IDraggable + public class PlaylistItem : Container, IFilterable, IDraggable { private const float fade_duration = 100; diff --git a/osu.Game/Overlays/Music/PlaylistList.cs b/osu.Game/Overlays/Music/PlaylistList.cs index 6f1eaded7f..af01cdc451 100644 --- a/osu.Game/Overlays/Music/PlaylistList.cs +++ b/osu.Game/Overlays/Music/PlaylistList.cs @@ -14,7 +14,7 @@ using OpenTK; namespace osu.Game.Overlays.Music { - internal class PlaylistList : CompositeDrawable + public class PlaylistList : CompositeDrawable { public Action OnSelect; diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index a3933b775e..d9aac58c54 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -135,7 +135,7 @@ namespace osu.Game.Overlays.Settings private class RestoreDefaultValueButton : Box, IHasTooltip { private Bindable bindable; - internal Bindable Bindable + public Bindable Bindable { get { return bindable; } set @@ -185,13 +185,13 @@ namespace osu.Game.Overlays.Settings UpdateState(); } - internal void SetButtonColour(Color4 buttonColour) + public void SetButtonColour(Color4 buttonColour) { this.buttonColour = buttonColour; UpdateState(); } - internal void UpdateState() + public void UpdateState() { if (bindable == null) return; diff --git a/osu.Game/Overlays/Settings/SettingsLabel.cs b/osu.Game/Overlays/Settings/SettingsLabel.cs index 7d1364ef41..6a1d3ae72c 100644 --- a/osu.Game/Overlays/Settings/SettingsLabel.cs +++ b/osu.Game/Overlays/Settings/SettingsLabel.cs @@ -7,7 +7,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Settings { - internal class SettingsLabel : SettingsItem + public class SettingsLabel : SettingsItem { protected override Drawable CreateControl() => null; diff --git a/osu.Game/Overlays/Settings/Sidebar.cs b/osu.Game/Overlays/Settings/Sidebar.cs index 55167188a3..4e51ae3a2e 100644 --- a/osu.Game/Overlays/Settings/Sidebar.cs +++ b/osu.Game/Overlays/Settings/Sidebar.cs @@ -18,8 +18,8 @@ namespace osu.Game.Overlays.Settings public class Sidebar : Container, IStateful { private readonly FillFlowContainer content; - internal const float DEFAULT_WIDTH = ToolbarButton.WIDTH; - internal const int EXPANDED_WIDTH = 200; + public const float DEFAULT_WIDTH = ToolbarButton.WIDTH; + public const int EXPANDED_WIDTH = 200; public event Action StateChanged; @@ -137,4 +137,4 @@ namespace osu.Game.Overlays.Settings Contracted, Expanded, } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index ddef5d1001..798fa00032 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays { public abstract class SettingsOverlay : OsuFocusedOverlayContainer { - internal const float CONTENT_MARGINS = 10; + public const float CONTENT_MARGINS = 10; public const float TRANSITION_LENGTH = 600; diff --git a/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs b/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs index 2e2786851c..ed206e7e1d 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarChatButton : ToolbarOverlayToggleButton + public class ToolbarChatButton : ToolbarOverlayToggleButton { public ToolbarChatButton() { @@ -19,4 +19,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = chat; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs b/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs index dacb6d67b8..7d25440e2c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarDirectButton : ToolbarOverlayToggleButton + public class ToolbarDirectButton : ToolbarOverlayToggleButton { public ToolbarDirectButton() { @@ -19,4 +19,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = direct; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs b/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs index 431cc73887..9f020cada5 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs @@ -5,7 +5,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarHomeButton : ToolbarButton + public class ToolbarHomeButton : ToolbarButton { public ToolbarHomeButton() { @@ -14,4 +14,4 @@ namespace osu.Game.Overlays.Toolbar TooltipSub = "Return to the main menu"; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index da72ae0347..319dd63bc9 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -14,7 +14,7 @@ using osu.Game.Rulesets; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarModeSelector : Container + public class ToolbarModeSelector : Container { private const float padding = 10; diff --git a/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs b/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs index 82599b9a0d..d150aacdf9 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarMusicButton : ToolbarOverlayToggleButton + public class ToolbarMusicButton : ToolbarOverlayToggleButton { public ToolbarMusicButton() { @@ -19,4 +19,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = music; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs b/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs index dcadc4bf56..e11a22d675 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs @@ -7,7 +7,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarNotificationButton : ToolbarOverlayToggleButton + public class ToolbarNotificationButton : ToolbarOverlayToggleButton { protected override Anchor TooltipAnchor => Anchor.TopRight; @@ -24,4 +24,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = notificationOverlay; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs index 28ecf6ad03..69fdd27d5d 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarOverlayToggleButton : ToolbarButton + public class ToolbarOverlayToggleButton : ToolbarButton { private readonly Box stateBackground; diff --git a/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs b/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs index 2eb8c15dcf..cf4f664e81 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarSettingsButton : ToolbarOverlayToggleButton + public class ToolbarSettingsButton : ToolbarOverlayToggleButton { public ToolbarSettingsButton() { @@ -21,4 +21,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = settings; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs b/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs index ed36fd8f9e..234d6f0f9a 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarSocialButton : ToolbarOverlayToggleButton + public class ToolbarSocialButton : ToolbarOverlayToggleButton { public ToolbarSocialButton() { @@ -19,4 +19,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = chat; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs index 95a25fcb86..4562464dfe 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs @@ -9,7 +9,7 @@ using OpenTK; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarUserArea : Container + public class ToolbarUserArea : Container { public LoginOverlay LoginOverlay; private ToolbarUserButton button; diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index deacfbb9ec..3714094924 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -12,7 +12,7 @@ using OpenTK.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarUserButton : ToolbarButton, IOnlineComponent + public class ToolbarUserButton : ToolbarButton, IOnlineComponent { private readonly UpdateableAvatar avatar; diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index 2b5c4aae95..5ad18e67ee 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -20,12 +20,12 @@ namespace osu.Game.Rulesets.Judgements /// /// The combo prior to this judgement occurring. /// - internal int ComboAtJudgement; + public int ComboAtJudgement; /// /// The highest combo achieved prior to this judgement occurring. /// - internal int HighestComboAtJudgement; + public int HighestComboAtJudgement; /// /// Whether a successful hit occurred. @@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Judgements /// The offset from a perfect hit at which this judgement occurred. /// Populated when added via . /// - public double TimeOffset { get; internal set; } + public double TimeOffset { get; public set; } /// /// Whether the should affect the combo portion of the score. diff --git a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs index c7f7802191..667f921e04 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch /// /// A HitObjectParser to parse legacy osu!catch Beatmaps. /// - internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser + public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) { diff --git a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs index 7141876b8b..86dd40b06e 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania /// /// A HitObjectParser to parse legacy osu!mania Beatmaps. /// - internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser + public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) { diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs index 00fe171f0f..24c205db13 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu /// /// A HitObjectParser to parse legacy osu! Beatmaps. /// - internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser + public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) { diff --git a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs index 5929c5a907..0554cfd97d 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko /// /// A HitObjectParser to parse legacy osu!taiko Beatmaps. /// - internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser + public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) { diff --git a/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs b/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs index f8e87bc022..b093cf3303 100644 --- a/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs +++ b/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs @@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Timing /// /// A which scrolls linearly relative to the start time. /// - internal class LinearScrollingContainer : ScrollingContainer + public class LinearScrollingContainer : ScrollingContainer { private readonly MultiplierControlPoint controlPoint; diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 0270751946..b4a26344d5 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.UI /// public HitObjectContainer HitObjects { get; protected set; } - internal Container ScaledContent; + public Container ScaledContent; /// /// Whether we are currently providing the local user a gameplay cursor. diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 6726d94995..a5ac9c201a 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.UI /// A visual representation of a . /// /// The ruleset being repesented. - internal RulesetContainer(Ruleset ruleset) + public RulesetContainer(Ruleset ruleset) { Ruleset = ruleset; } diff --git a/osu.Game/Screens/Charts/ChartInfo.cs b/osu.Game/Screens/Charts/ChartInfo.cs index b5ac5e4945..32577f3e05 100644 --- a/osu.Game/Screens/Charts/ChartInfo.cs +++ b/osu.Game/Screens/Charts/ChartInfo.cs @@ -3,7 +3,7 @@ namespace osu.Game.Screens.Charts { - internal class ChartInfo : ScreenWhiteBox + public class ChartInfo : ScreenWhiteBox { } } diff --git a/osu.Game/Screens/Charts/ChartListing.cs b/osu.Game/Screens/Charts/ChartListing.cs index 7bc6f0fa03..41c2a01600 100644 --- a/osu.Game/Screens/Charts/ChartListing.cs +++ b/osu.Game/Screens/Charts/ChartListing.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace osu.Game.Screens.Charts { - internal class ChartListing : ScreenWhiteBox + public class ChartListing : ScreenWhiteBox { protected override IEnumerable PossibleChildren => new[] { typeof(ChartInfo) diff --git a/osu.Game/Screens/Direct/OnlineListing.cs b/osu.Game/Screens/Direct/OnlineListing.cs index 9ce23c2863..ff6c599e6f 100644 --- a/osu.Game/Screens/Direct/OnlineListing.cs +++ b/osu.Game/Screens/Direct/OnlineListing.cs @@ -3,7 +3,7 @@ namespace osu.Game.Screens.Direct { - internal class OnlineListing : ScreenWhiteBox + public class OnlineListing : ScreenWhiteBox { } } diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs index 1793cb4334..cdb2985473 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs @@ -11,7 +11,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// The part of the timeline that displays bookmarks. /// - internal class BookmarkPart : TimelinePart + public class BookmarkPart : TimelinePart { protected override void LoadBeatmap(WorkingBeatmap beatmap) { diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs index 004491d489..380f8e2c7b 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs @@ -12,7 +12,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// The part of the timeline that displays breaks in the song. /// - internal class BreakPart : TimelinePart + public class BreakPart : TimelinePart { protected override void LoadBeatmap(WorkingBeatmap beatmap) { diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs index d230578e13..405befb80a 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs @@ -14,7 +14,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// The part of the timeline that displays the control points. /// - internal class ControlPointPart : TimelinePart + public class ControlPointPart : TimelinePart { protected override void LoadBeatmap(WorkingBeatmap beatmap) { diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs index 0bdd081907..367cf4337d 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs @@ -15,7 +15,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// The part of the timeline that displays the current position of the song. /// - internal class MarkerPart : TimelinePart + public class MarkerPart : TimelinePart { private readonly Drawable marker; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs index 378ce78c67..229d06ef09 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs @@ -13,7 +13,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// Represents a part of the summary timeline.. /// - internal abstract class TimelinePart : CompositeDrawable + public abstract class TimelinePart : CompositeDrawable { public Bindable Beatmap = new Bindable(); diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs index aee8e250c3..91f5e9b222 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs @@ -10,7 +10,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations /// /// Represents a spanning point on a timeline part. /// - internal class DurationVisualisation : Container + public class DurationVisualisation : Container { protected DurationVisualisation(double startTime, double endTime) { diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs index 9d7272808b..4719db37d1 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs @@ -10,7 +10,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations /// /// Represents a singular point on a timeline part. /// - internal class PointVisualisation : Box + public class PointVisualisation : Box { protected PointVisualisation(double startTime) { diff --git a/osu.Game/Screens/Edit/Screens/Design/Design.cs b/osu.Game/Screens/Edit/Screens/Design/Design.cs index e527d7dad9..edd5ae1a1e 100644 --- a/osu.Game/Screens/Edit/Screens/Design/Design.cs +++ b/osu.Game/Screens/Edit/Screens/Design/Design.cs @@ -9,7 +9,7 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Edit.Screens.Design { - internal class Design : EditorScreen + public class Design : EditorScreen { public Design() { diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index c3bd7c1f37..5a4a5f07b5 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -39,10 +39,10 @@ namespace osu.Game.Screens.Menu private readonly FlowContainerWithOrigin buttonFlow; //todo: make these non-internal somehow. - internal const float BUTTON_AREA_HEIGHT = 100; + public const float BUTTON_AREA_HEIGHT = 100; - internal const float BUTTON_WIDTH = 140f; - internal const float WEDGE_WIDTH = 20; + public const float BUTTON_WIDTH = 140f; + public const float WEDGE_WIDTH = 20; private OsuLogo logo; diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 987e29d6d6..d7beb34a2f 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -25,7 +25,7 @@ namespace osu.Game.Screens.Menu /// /// Whether we have loaded the menu previously. /// - internal bool DidLoadMenu; + public bool DidLoadMenu; private MainMenu mainMenu; private SampleChannel welcome; diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index fb8e755b61..252f2d37b5 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -226,7 +226,7 @@ namespace osu.Game.Screens.Menu /// /// The animation to be performed /// If true, the new animation is delayed until all previous transforms finish. If false, existing transformed are cleared. - internal void AppendAnimatingAction(Action action, bool waitForPrevious) + public void AppendAnimatingAction(Action action, bool waitForPrevious) { Action runnableAction = () => { diff --git a/osu.Game/Screens/Multiplayer/Lobby.cs b/osu.Game/Screens/Multiplayer/Lobby.cs index d34da46ec3..b297835ca9 100644 --- a/osu.Game/Screens/Multiplayer/Lobby.cs +++ b/osu.Game/Screens/Multiplayer/Lobby.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace osu.Game.Screens.Multiplayer { - internal class Lobby : ScreenWhiteBox + public class Lobby : ScreenWhiteBox { protected override IEnumerable PossibleChildren => new[] { typeof(MatchCreate), diff --git a/osu.Game/Screens/Multiplayer/Match.cs b/osu.Game/Screens/Multiplayer/Match.cs index a0843bfcae..e50a7199a4 100644 --- a/osu.Game/Screens/Multiplayer/Match.cs +++ b/osu.Game/Screens/Multiplayer/Match.cs @@ -12,7 +12,7 @@ using osu.Framework.Graphics; namespace osu.Game.Screens.Multiplayer { - internal class Match : ScreenWhiteBox + public class Match : ScreenWhiteBox { protected override IEnumerable PossibleChildren => new[] { typeof(MatchSongSelect), diff --git a/osu.Game/Screens/Multiplayer/MatchCreate.cs b/osu.Game/Screens/Multiplayer/MatchCreate.cs index f28261fa7f..c232c38d08 100644 --- a/osu.Game/Screens/Multiplayer/MatchCreate.cs +++ b/osu.Game/Screens/Multiplayer/MatchCreate.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace osu.Game.Screens.Multiplayer { - internal class MatchCreate : ScreenWhiteBox + public class MatchCreate : ScreenWhiteBox { protected override IEnumerable PossibleChildren => new[] { typeof(Match) diff --git a/osu.Game/Screens/Ranking/ResultsPage.cs b/osu.Game/Screens/Ranking/ResultsPage.cs index 7f381ebf99..037d5ada09 100644 --- a/osu.Game/Screens/Ranking/ResultsPage.cs +++ b/osu.Game/Screens/Ranking/ResultsPage.cs @@ -14,7 +14,7 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Ranking { - internal class ResultsPage : Container + public class ResultsPage : Container { protected readonly Score Score; protected readonly WorkingBeatmap Beatmap; diff --git a/osu.Game/Screens/Ranking/ResultsPageRanking.cs b/osu.Game/Screens/Ranking/ResultsPageRanking.cs index d316dc7fb4..c9d1061bd1 100644 --- a/osu.Game/Screens/Ranking/ResultsPageRanking.cs +++ b/osu.Game/Screens/Ranking/ResultsPageRanking.cs @@ -12,7 +12,7 @@ using osu.Framework.Graphics.Shapes; namespace osu.Game.Screens.Ranking { - internal class ResultsPageRanking : ResultsPage + public class ResultsPageRanking : ResultsPage { public ResultsPageRanking(Score score, WorkingBeatmap beatmap = null) : base(score, beatmap) { @@ -39,4 +39,4 @@ namespace osu.Game.Screens.Ranking }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 9104473b82..911b688669 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -26,7 +26,7 @@ using osu.Framework.Graphics.Shapes; namespace osu.Game.Screens.Ranking { - internal class ResultsPageScore : ResultsPage + public class ResultsPageScore : ResultsPage { private ScoreCounter scoreCounter; diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index f4dcf9a69e..452f8c484c 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -23,7 +23,7 @@ using osu.Game.Graphics.Cursor; namespace osu.Game.Screens.Select { - internal class BeatmapCarousel : OsuScrollContainer + public class BeatmapCarousel : OsuScrollContainer { public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap; @@ -116,7 +116,7 @@ namespace osu.Game.Screens.Select Schedule(() => removeGroup(groups.Find(b => b.BeatmapSet.ID == beatmapSet.ID))); } - internal void UpdateBeatmap(BeatmapInfo beatmap) + public void UpdateBeatmap(BeatmapInfo beatmap) { // todo: this method should not run more than once for the same BeatmapSetInfo. var set = manager.QueryBeatmapSet(s => s.ID == beatmap.BeatmapSetInfoID); diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index dc3b012328..22cb718d0a 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -22,7 +22,7 @@ using osu.Framework.Graphics.Shapes; namespace osu.Game.Screens.Select { - internal class BeatmapInfoWedge : OverlayContainer + public class BeatmapInfoWedge : OverlayContainer { private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0); diff --git a/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs b/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs index 3dd7207607..d2b2feb68d 100644 --- a/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs +++ b/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs @@ -12,7 +12,7 @@ using System.Linq; namespace osu.Game.Screens.Tournament.Components { - internal class VisualiserContainer : Container + public class VisualiserContainer : Container { /// /// Number of lines in the visualiser. From 2610cadd3cf4dfedda929a26f4abc91a047a65e7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 12:11:29 +0900 Subject: [PATCH 117/282] CI fixes --- osu.Game/Overlays/ChatOverlay.cs | 2 +- osu.Game/Rulesets/Judgements/Judgement.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 2 +- osu.Game/Rulesets/UI/RulesetContainer.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index c5ffc5a2f1..9f40a08ad2 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -58,7 +58,7 @@ namespace osu.Game.Overlays private readonly Box chatBackground; private readonly Box tabBackground; - public Bindable ChatHeight { get; public set; } + public Bindable ChatHeight { get; set; } private readonly Container channelSelectionContainer; private readonly ChannelSelectionOverlay channelSelection; diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index 5ad18e67ee..d804111a7f 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Judgements /// The offset from a perfect hit at which this judgement occurred. /// Populated when added via . /// - public double TimeOffset { get; public set; } + public double TimeOffset { get; set; } /// /// Whether the should affect the combo portion of the score. diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index b5e3f837fc..d4f9c7191a 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Objects.Legacy /// /// A HitObjectParser to parse legacy Beatmaps. /// - internal abstract class ConvertHitObjectParser : HitObjectParser + public abstract class ConvertHitObjectParser : HitObjectParser { public override HitObject Parse(string text) { diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index a5ac9c201a..ec26f6f310 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.UI /// A visual representation of a . /// /// The ruleset being repesented. - public RulesetContainer(Ruleset ruleset) + protected RulesetContainer(Ruleset ruleset) { Ruleset = ruleset; } From 5db2d383ed750e8d273f4dc514ae71e9a5c40d37 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 11:48:27 +0900 Subject: [PATCH 118/282] Remove temporary variable in beatmap background update --- osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index 29a422892f..7ae3f6931e 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -32,9 +32,7 @@ namespace osu.Game.Screens.Backgrounds Schedule(() => { - var newBackground = new BeatmapBackground(beatmap); - - LoadComponentAsync(newBackground, delegate + LoadComponentAsync(new BeatmapBackground(beatmap), b => { float newDepth = 0; if (background != null) @@ -45,8 +43,8 @@ namespace osu.Game.Screens.Backgrounds background.Expire(); } - newBackground.Depth = newDepth; - Add(background = newBackground); + b.Depth = newDepth; + Add(background = b); background.BlurSigma = blurTarget; }); }); From e7654254d2bad68e5423b5ddb00f75d21f3d7ce2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 11:48:49 +0900 Subject: [PATCH 119/282] Remove unused code --- osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index e9de3fb672..7b50d36b44 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Linq; using OpenTK; using OpenTK.Graphics; @@ -24,8 +23,6 @@ namespace osu.Game.Screens.Select.Leaderboards { public static readonly float HEIGHT = 60; - public event Action StateChanged; - public readonly int RankPosition; public readonly Score Score; From be9c99ade3dc676d6389a2260dc71cfa5a6ef4f9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 11:49:21 +0900 Subject: [PATCH 120/282] Remove AsyncLoadWrapper dependence --- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 126 ++++++++++---------- 1 file changed, 66 insertions(+), 60 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 22cb718d0a..c4176be4d9 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -26,7 +26,7 @@ namespace osu.Game.Screens.Select { private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0); - private Drawable beatmapInfoContainer; + private Drawable info; public BeatmapInfoWedge() { @@ -65,29 +65,34 @@ namespace osu.Game.Screens.Select public void UpdateBeatmap(WorkingBeatmap beatmap) { - var lastContainer = beatmapInfoContainer; - float newDepth = lastContainer?.Depth + 1 ?? 0; - - Add(beatmapInfoContainer = new AsyncLoadWrapper( - new BufferedWedgeInfo(beatmap) - { - Shear = -Shear, - OnLoadComplete = d => - { - this.FadeIn(250); - - lastContainer?.FadeOut(250); - lastContainer?.Expire(); - } - }) + LoadComponentAsync(new BufferedWedgeInfo(beatmap) { - Depth = newDepth, + Shear = -Shear, + Depth = info?.Depth + 1 ?? 0, + }, newInfo => + { + // ensure we ourselves are visible if not already. + if (!IsPresent) + this.FadeIn(250); + + info?.FadeOut(250); + info?.Expire(); + + Add(info = newInfo); }); } public class BufferedWedgeInfo : BufferedContainer { + private readonly WorkingBeatmap beatmap; + public BufferedWedgeInfo(WorkingBeatmap beatmap) + { + this.beatmap = beatmap; + } + + [BackgroundDependencyLoader] + private void load() { BeatmapInfo beatmapInfo = beatmap.BeatmapInfo; BeatmapMetadata metadata = beatmapInfo.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); @@ -206,13 +211,13 @@ namespace osu.Game.Screens.Select Font = @"Exo2.0-Medium", Text = "mapped by ", TextSize = 15, - }, + }, new OsuSpriteText { Font = @"Exo2.0-Bold", Text = metadata.Author.Username, TextSize = 15, - }, + }, } }, new FillFlowContainer @@ -244,38 +249,39 @@ namespace osu.Game.Screens.Select AutoSizeAxes = Axes.Both; Children = new Drawable[] { - new SpriteIcon - { - Icon = FontAwesome.fa_square, - Origin = Anchor.Centre, - Colour = new Color4(68, 17, 136, 255), - Rotation = 45, - Size = new Vector2(20), - }, - new SpriteIcon - { - Icon = statistic.Icon, - Origin = Anchor.Centre, - Colour = new Color4(255, 221, 85, 255), - Scale = new Vector2(0.8f), - Size = new Vector2(20), - }, - new OsuSpriteText - { - Margin = new MarginPadding { Left = 13 }, - Font = @"Exo2.0-Bold", - Colour = new Color4(255, 221, 85, 255), - Text = statistic.Content, - TextSize = 17, - Origin = Anchor.CentreLeft - }, + new SpriteIcon + { + Icon = FontAwesome.fa_square, + Origin = Anchor.Centre, + Colour = new Color4(68, 17, 136, 255), + Rotation = 45, + Size = new Vector2(20), + }, + new SpriteIcon + { + Icon = statistic.Icon, + Origin = Anchor.Centre, + Colour = new Color4(255, 221, 85, 255), + Scale = new Vector2(0.8f), + Size = new Vector2(20), + }, + new OsuSpriteText + { + Margin = new MarginPadding { Left = 13 }, + Font = @"Exo2.0-Bold", + Colour = new Color4(255, 221, 85, 255), + Text = statistic.Content, + TextSize = 17, + Origin = Anchor.CentreLeft + }, }; } } private class DifficultyColourBar : DifficultyColouredContainer { - public DifficultyColourBar(BeatmapInfo beatmap) : base(beatmap) + public DifficultyColourBar(BeatmapInfo beatmap) + : base(beatmap) { } @@ -286,21 +292,21 @@ namespace osu.Game.Screens.Select Children = new Drawable[] { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = AccentColour, - Width = full_opacity_ratio, - }, - new Box - { - RelativeSizeAxes = Axes.Both, - RelativePositionAxes = Axes.Both, - Colour = AccentColour, - Alpha = 0.5f, - X = full_opacity_ratio, - Width = 1 - full_opacity_ratio, - } + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = AccentColour, + Width = full_opacity_ratio, + }, + new Box + { + RelativeSizeAxes = Axes.Both, + RelativePositionAxes = Axes.Both, + Colour = AccentColour, + Alpha = 0.5f, + X = full_opacity_ratio, + Width = 1 - full_opacity_ratio, + } }; } } From bd616c13070bd2a850b23168a2e4d00b6b8350e6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 12:29:46 +0900 Subject: [PATCH 121/282] Simplify some property access --- .../Containers/BeatSyncedContainer.cs | 6 ++--- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 25 ++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/osu.Game/Graphics/Containers/BeatSyncedContainer.cs b/osu.Game/Graphics/Containers/BeatSyncedContainer.cs index fb85af12cb..d5d75c9e29 100644 --- a/osu.Game/Graphics/Containers/BeatSyncedContainer.cs +++ b/osu.Game/Graphics/Containers/BeatSyncedContainer.cs @@ -45,8 +45,8 @@ namespace osu.Game.Graphics.Containers double currentTrackTime = track.Length > 0 ? track.CurrentTime + EarlyActivationMilliseconds : Clock.CurrentTime; - TimingControlPoint timingPoint = Beatmap.Value.Beatmap.ControlPointInfo.TimingPointAt(currentTrackTime); - EffectControlPoint effectPoint = Beatmap.Value.Beatmap.ControlPointInfo.EffectPointAt(currentTrackTime); + TimingControlPoint timingPoint = beatmap.ControlPointInfo.TimingPointAt(currentTrackTime); + EffectControlPoint effectPoint = beatmap.ControlPointInfo.EffectPointAt(currentTrackTime); if (timingPoint.BeatLength == 0) return; @@ -67,7 +67,7 @@ namespace osu.Game.Graphics.Containers return; using (BeginDelayedSequence(-TimeSinceLastBeat, true)) - OnNewBeat(beatIndex, timingPoint, effectPoint, Beatmap.Value.Track.CurrentAmplitudes); + OnNewBeat(beatIndex, timingPoint, effectPoint, track.CurrentAmplitudes); lastBeat = beatIndex; lastTimingPoint = timingPoint; diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index c4176be4d9..391cfc20db 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -84,42 +84,43 @@ namespace osu.Game.Screens.Select public class BufferedWedgeInfo : BufferedContainer { - private readonly WorkingBeatmap beatmap; + private readonly WorkingBeatmap working; - public BufferedWedgeInfo(WorkingBeatmap beatmap) + public BufferedWedgeInfo(WorkingBeatmap working) { - this.beatmap = beatmap; + this.working = working; } [BackgroundDependencyLoader] private void load() { - BeatmapInfo beatmapInfo = beatmap.BeatmapInfo; - BeatmapMetadata metadata = beatmapInfo.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); + BeatmapInfo beatmapInfo = working.BeatmapInfo; + BeatmapMetadata metadata = beatmapInfo.Metadata ?? working.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); + Beatmap beatmap = working.Beatmap; List labels = new List(); - if (beatmap.Beatmap != null) + if (beatmap != null) { - HitObject lastObject = beatmap.Beatmap.HitObjects.LastOrDefault(); + HitObject lastObject = beatmap.HitObjects.LastOrDefault(); double endTime = (lastObject as IHasEndTime)?.EndTime ?? lastObject?.StartTime ?? 0; labels.Add(new InfoLabel(new BeatmapStatistic { Name = "Length", Icon = FontAwesome.fa_clock_o, - Content = beatmap.Beatmap.HitObjects.Count == 0 ? "-" : TimeSpan.FromMilliseconds(endTime - beatmap.Beatmap.HitObjects.First().StartTime).ToString(@"m\:ss"), + Content = beatmap.HitObjects.Count == 0 ? "-" : TimeSpan.FromMilliseconds(endTime - beatmap.HitObjects.First().StartTime).ToString(@"m\:ss"), })); labels.Add(new InfoLabel(new BeatmapStatistic { Name = "BPM", Icon = FontAwesome.fa_circle, - Content = getBPMRange(beatmap.Beatmap), + Content = getBPMRange(beatmap), })); //get statistics from the current ruleset. - labels.AddRange(beatmapInfo.Ruleset.CreateInstance().GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s))); + labels.AddRange(beatmapInfo.Ruleset.CreateInstance().GetBeatmapStatistics(working).Select(s => new InfoLabel(s))); } PixelSnapping = true; @@ -145,7 +146,7 @@ namespace osu.Game.Screens.Select Children = new[] { // Zoomed-in and cropped beatmap background - new BeatmapBackgroundSprite(beatmap) + new BeatmapBackgroundSprite(working) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, @@ -154,7 +155,7 @@ namespace osu.Game.Screens.Select }, }, }, - new DifficultyColourBar(beatmap.BeatmapInfo) + new DifficultyColourBar(beatmapInfo) { RelativeSizeAxes = Axes.Y, Width = 20, From a2fc5b67eca47975c54d5682eac93d6946d21c14 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 12:30:06 +0900 Subject: [PATCH 122/282] Formatting fix --- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 9c11474f97..c87328d87c 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Osu }; public override IEnumerable GetBeatmapStatistics(WorkingBeatmap beatmap) => new[] - { + { new BeatmapStatistic { Name = @"Circle count", From 66f72baa39aa9d9eb8baf9d2293c601f5edf4706 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 12:40:05 +0900 Subject: [PATCH 123/282] Avoid LogoVisualisation accessing the track before it's loaded --- osu.Game/Screens/Menu/LogoVisualisation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index 3e7662a441..7c1b914bf5 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -85,7 +85,7 @@ namespace osu.Game.Screens.Menu private void updateAmplitudes() { - var track = beatmap.Value.Track; + var track = beatmap.Value.TrackLoaded ? beatmap.Value.Track : null; float[] temporalAmplitudes = track?.CurrentAmplitudes.FrequencyAmplitudes ?? new float[256]; From 553a7947d7a927efca806feca47c29798c6734ef Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 12:40:19 +0900 Subject: [PATCH 124/282] Remove AsyncLoadWrapper dependence in MusicController --- osu.Game/Overlays/MusicController.cs | 42 +++++++++++++--------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index a99ce89a36..4f57ea1bcd 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -37,7 +37,7 @@ namespace osu.Game.Overlays private const float bottom_black_area_height = 55; - private Drawable currentBackground; + private Drawable background; private ProgressBar progressBar; private IconButton prevButton; @@ -120,7 +120,7 @@ namespace osu.Game.Overlays }, Children = new[] { - currentBackground = new Background(), + background = new Background(), title = new OsuSpriteText { Origin = Anchor.BottomCentre, @@ -334,6 +334,7 @@ namespace osu.Game.Overlays pendingBeatmapSwitch = Schedule(delegate { + // todo: this can likely be replaced with WorkingBeatmap.GetBeatmapAsync() Task.Run(() => { if (beatmap?.Beatmap == null) //this is not needed if a placeholder exists @@ -352,29 +353,26 @@ namespace osu.Game.Overlays } }); - playerContainer.Add(new AsyncLoadWrapper(new Background(beatmap) + LoadComponentAsync(new Background(beatmap) { Depth = float.MaxValue }, newBackground => { - OnLoadComplete = newBackground => + switch (direction) { - switch (direction) - { - case TransformDirection.Next: - newBackground.Position = new Vector2(400, 0); - newBackground.MoveToX(0, 500, Easing.OutCubic); - currentBackground.MoveToX(-400, 500, Easing.OutCubic); - break; - case TransformDirection.Prev: - newBackground.Position = new Vector2(-400, 0); - newBackground.MoveToX(0, 500, Easing.OutCubic); - currentBackground.MoveToX(400, 500, Easing.OutCubic); - break; - } - currentBackground.Expire(); - currentBackground = newBackground; + case TransformDirection.Next: + newBackground.Position = new Vector2(400, 0); + newBackground.MoveToX(0, 500, Easing.OutCubic); + background.MoveToX(-400, 500, Easing.OutCubic); + break; + case TransformDirection.Prev: + newBackground.Position = new Vector2(-400, 0); + newBackground.MoveToX(0, 500, Easing.OutCubic); + background.MoveToX(400, 500, Easing.OutCubic); + break; } - }) - { - Depth = float.MaxValue, + + background.Expire(); + background = newBackground; + + playerContainer.Add(newBackground); }); }); } From 8e63a7dd8dd6478eba9089024e39456f89716fb9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 14:42:49 +0900 Subject: [PATCH 125/282] Handle more exceptions when checking for updates Should resolve #849. --- osu.Desktop/Overlays/VersionManager.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 8c17e18ed8..3d66e6754c 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -198,10 +198,9 @@ namespace osu.Desktop.Overlays } } } - catch (HttpRequestException) + catch (Exception) { - //likely have no internet connection. - //we'll ignore this and retry later. + // we'll ignore this and retry later. can be triggered by no internet connection or thread abortion. } finally { From 62dcc316e265063c9e8e386a9a2a4d7ff7ce7607 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 15:02:16 +0900 Subject: [PATCH 126/282] Remove unnecessary using --- osu.Desktop/Overlays/VersionManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 3d66e6754c..9e13003c3f 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; -using System.Net.Http; using osu.Framework.Allocation; using osu.Framework.Development; using osu.Framework.Graphics; From 538acadd230154db7390dbb01d6454fc7ff77b21 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 15:29:15 +0900 Subject: [PATCH 127/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 6b305b3332..0c40800ad4 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 6b305b3332cdc424ef7fc3c9499c21e174f9eec5 +Subproject commit 0c40800ad40e2119ae9e68a815d677814490d55c From a66edea6dc281f6a24d21fa8943e13ea785d43ec Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 15:33:05 +0900 Subject: [PATCH 128/282] Move sqlite batteries to osu.Desktop Fixes e_sqlite.dll not being copied to output on Windows --- osu.Desktop/Program.cs | 3 +++ osu.Desktop/osu.Desktop.csproj | 1 + osu.Game/Database/OsuDbContext.cs | 6 ------ osu.Game/osu.Game.csproj | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 720b38144c..b7ecefe1ce 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -15,6 +15,9 @@ namespace osu.Desktop [STAThread] public static int Main(string[] args) { + // required to initialise native SQLite libraries on some platforms. + SQLitePCL.Batteries_V2.Init(); + // Back up the cwd before DesktopGameHost changes it var cwd = Environment.CurrentDirectory; diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 9fed566703..56a455e6b7 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -28,6 +28,7 @@ + diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index 928c355696..4208bad2d3 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -29,12 +29,6 @@ namespace osu.Game.Database private static readonly Lazy logger = new Lazy(() => new OsuDbLoggerFactory()); - static OsuDbContext() - { - // required to initialise native SQLite libraries on some platforms. - SQLitePCL.Batteries_V2.Init(); - } - /// /// Create a new in-memory OsuDbContext instance. /// diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index dd591bcba8..b8c1e0551c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -19,7 +19,7 @@ - + From 465531116520191f45505190597f096fe7e46d02 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 16:38:23 +0900 Subject: [PATCH 129/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 0c40800ad4..ec7d5532b1 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 0c40800ad40e2119ae9e68a815d677814490d55c +Subproject commit ec7d5532b16acf25d2e23a03324b6d99c77cbe01 From 44168b1654757b47aa80f997413ee1a5fcf2764b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 16:42:54 +0900 Subject: [PATCH 130/282] Fix incorrect license --- osu.Game/Utils/ZipUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Utils/ZipUtils.cs b/osu.Game/Utils/ZipUtils.cs index c1e0d75a7b..c9a16eb84b 100644 --- a/osu.Game/Utils/ZipUtils.cs +++ b/osu.Game/Utils/ZipUtils.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 System; using SharpCompress.Archives.Zip; From 1b27ce6198eaa525deb2560ee75f76d7e3d9570d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 17:09:22 +0900 Subject: [PATCH 131/282] Cleanup + renaming --- .../Scoring/TaikoScoreProcessor.cs | 2 +- osu.Game/Rulesets/Mods/ModPerfect.cs | 10 +--------- osu.Game/Rulesets/Mods/ModSuddenDeath.cs | 9 +++------ osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 12 ++++++------ 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 0e5df329d8..0048566b15 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring /// /// Taiko fails at the end of the map if the player has not half-filled their HP bar. /// - protected override bool FailCondition => Hits == MaxHits && Health.Value <= 0.5; + protected override bool DefaultFailCondition => Hits == MaxHits && Health.Value <= 0.5; private double hpIncreaseTick; private double hpIncreaseGreat; diff --git a/osu.Game/Rulesets/Mods/ModPerfect.cs b/osu.Game/Rulesets/Mods/ModPerfect.cs index cf7bf141c3..e7887c8fc4 100644 --- a/osu.Game/Rulesets/Mods/ModPerfect.cs +++ b/osu.Game/Rulesets/Mods/ModPerfect.cs @@ -11,14 +11,6 @@ namespace osu.Game.Rulesets.Mods public override string ShortenedName => "PF"; public override string Description => "SS or quit."; - public bool OnFailCheck(ScoreProcessor scoreProcessor) - { - return scoreProcessor.Accuracy.Value != 1; - } - - public virtual void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) - { - scoreProcessor.FailChecker += OnFailCheck; - } + protected override bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Accuracy.Value != 1; } } diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs index 6675c41bd4..17350fdaa4 100644 --- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs +++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs @@ -18,14 +18,11 @@ namespace osu.Game.Rulesets.Mods public override bool Ranked => true; public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay) }; - public bool OnFailCheck(ScoreProcessor scoreProcessor) + public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) { - return scoreProcessor.Combo.Value != scoreProcessor.HighestCombo.Value; + scoreProcessor.FailConditions += FailCondition; } - public virtual void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) - { - scoreProcessor.FailChecker += OnFailCheck; - } + protected virtual bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Combo.Value != scoreProcessor.HighestCombo.Value; } } diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index c3ae887a9f..de8a510590 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -32,9 +32,9 @@ namespace osu.Game.Rulesets.Scoring public event Action NewJudgement; /// - /// Invoked when we want to check if a failure condition has been fulfilled + /// Additional conditions on top of that cause a failing state. /// - public event Func FailChecker; + public event Func FailConditions; /// /// The current total score. @@ -77,9 +77,9 @@ namespace osu.Game.Rulesets.Scoring public virtual bool HasFailed { get; private set; } /// - /// The conditions for failing. + /// The default conditions for failing. /// - protected virtual bool FailCondition => Health.Value == Health.MinValue; + protected virtual bool DefaultFailCondition => Health.Value == Health.MinValue; protected ScoreProcessor() { @@ -126,7 +126,7 @@ namespace osu.Game.Rulesets.Scoring /// protected void UpdateFailed() { - if (HasFailed || !FailCondition) + if (HasFailed || !DefaultFailCondition) return; if (Failed?.Invoke() != false) @@ -150,7 +150,7 @@ namespace osu.Game.Rulesets.Scoring if (HasFailed) return; - if (FailChecker?.Invoke(this) == true) + if (FailConditions?.Invoke(this) == true) { if (Failed?.Invoke() != false) HasFailed = true; From 18b9828c49548192048b84b74fcd35b515823c53 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 17:11:07 +0900 Subject: [PATCH 132/282] Merge UpdateFailed and CheckAlternateFailConditions --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index de8a510590..7b26e50dd8 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -126,7 +126,10 @@ namespace osu.Game.Rulesets.Scoring /// protected void UpdateFailed() { - if (HasFailed || !DefaultFailCondition) + if (HasFailed) + return; + + if (!DefaultFailCondition && FailConditions?.Invoke(this) != true) return; if (Failed?.Invoke() != false) @@ -145,18 +148,6 @@ namespace osu.Game.Rulesets.Scoring AllJudged?.Invoke(); } - protected void CheckAlternateFailConditions() - { - if (HasFailed) - return; - - if (FailConditions?.Invoke(this) == true) - { - if (Failed?.Invoke() != false) - HasFailed = true; - } - } - /// /// Retrieve a score populated with data for the current play this processor is responsible for. /// @@ -233,8 +224,6 @@ namespace osu.Game.Rulesets.Scoring OnNewJudgement(judgement); updateScore(); - CheckAlternateFailConditions(); - NotifyNewJudgement(judgement); UpdateFailed(); } From fea56322f0aadcdb1b48a82f4836a47d268cd213 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 17:28:51 +0900 Subject: [PATCH 133/282] Fix SD not failing for the first note --- osu.Game/Rulesets/Mods/ModSuddenDeath.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs index 17350fdaa4..bc42c69cbe 100644 --- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs +++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs @@ -23,6 +23,6 @@ namespace osu.Game.Rulesets.Mods scoreProcessor.FailConditions += FailCondition; } - protected virtual bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Combo.Value != scoreProcessor.HighestCombo.Value; + protected virtual bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Combo.Value == 0; } } From c30d31e03746efd290ca09ae82cd0701a3ce2e33 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 17:30:19 +0900 Subject: [PATCH 134/282] Remove extra alternateFailConditions function in Player --- osu.Game/Screens/Play/Player.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 0bff13a46a..cd2818398d 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -228,15 +228,8 @@ namespace osu.Game.Screens.Play scoreProcessor.AllJudged += onCompletion; scoreProcessor.Failed += onFail; - applyAlternateFailConditions(); - } - - private void applyAlternateFailConditions() - { - foreach(var mod in Beatmap.Value.Mods.Value.OfType()) - { - mod.ApplyToScoreProcessor(scoreProcessor); - } + foreach (var mod in Beatmap.Value.Mods.Value.OfType()) + mod.ApplyToScoreProcessor(scoreProcessor); } private void applyRateFromMods() From 0d1b5ae44f6f64529775d10fdd4adef5f5cf3d17 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 17:51:07 +0900 Subject: [PATCH 135/282] Adjust bottom bar sizing as suggested --- osu.Game/Screens/Edit/Editor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 52baadd442..e2971deb75 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -92,8 +92,9 @@ namespace osu.Game.Screens.Edit RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { + new Dimension(GridSizeMode.Absolute, 220), new Dimension(), - new Dimension(GridSizeMode.Relative, 0.65f), + new Dimension(GridSizeMode.Absolute, 220) }, Content = new[] { From 217554f587d40582ce51b2c5630c8a0e4402791d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 18:06:24 +0900 Subject: [PATCH 136/282] Remove redundant interface --- osu.Game/Rulesets/Mods/ModPerfect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModPerfect.cs b/osu.Game/Rulesets/Mods/ModPerfect.cs index e7887c8fc4..59539d2b2c 100644 --- a/osu.Game/Rulesets/Mods/ModPerfect.cs +++ b/osu.Game/Rulesets/Mods/ModPerfect.cs @@ -5,7 +5,7 @@ using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mods { - public abstract class ModPerfect : ModSuddenDeath, IApplicableToScoreProcessor + public abstract class ModPerfect : ModSuddenDeath { public override string Name => "Perfect"; public override string ShortenedName => "PF"; From 41498ffad3f6b26b8ceb17696ec970ad8aa044c6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 21 Nov 2017 12:22:19 +0300 Subject: [PATCH 137/282] Apply suggestions --- .../Screens/Edit/Components/PlaybackContainer.cs | 14 +++----------- .../Screens/Edit/Components/TimeInfoContainer.cs | 9 +-------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs index a88983e3e4..a7d1db4802 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs @@ -17,8 +17,6 @@ namespace osu.Game.Screens.Edit.Components { private readonly IconButton playButton; - private bool lastTrackState; - public PlaybackContainer() { PlaybackTabControl tabs; @@ -32,7 +30,7 @@ namespace osu.Game.Screens.Edit.Components Scale = new Vector2(1.4f), IconScale = new Vector2(1.4f), Icon = FontAwesome.fa_play_circle_o, - Action = play, + Action = playPause, Padding = new MarginPadding { Left = 20 } }, new OsuSpriteText @@ -61,7 +59,7 @@ namespace osu.Game.Screens.Edit.Components tabs.Current.ValueChanged += newValue => Track.Tempo.Value = newValue; } - private void play() + private void playPause() { if (Track.IsRunning) Track.Stop(); @@ -73,13 +71,7 @@ namespace osu.Game.Screens.Edit.Components { base.Update(); - var currentTrackState = Track.IsRunning; - if (currentTrackState == lastTrackState) - return; - - playButton.Icon = currentTrackState ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o; - - lastTrackState = currentTrackState; + playButton.Icon = Track.IsRunning ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o; } private class PlaybackTabControl : OsuTabControl diff --git a/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs b/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs index 4a07ab4434..b9b6867ea6 100644 --- a/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs +++ b/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs @@ -12,7 +12,6 @@ namespace osu.Game.Screens.Edit.Components private const int count_duration = 150; private readonly OsuSpriteText trackTimer; - private double savedTime; public TimeInfoContainer() { @@ -33,13 +32,7 @@ namespace osu.Game.Screens.Edit.Components { base.Update(); - var currentTime = Track.CurrentTime; - - if (savedTime == currentTime) - return; - - trackTimer.Text = TimeSpan.FromMilliseconds(currentTime).ToString(@"mm\:ss\:fff"); - savedTime = currentTime; + trackTimer.Text = TimeSpan.FromMilliseconds(Track.CurrentTime).ToString(@"mm\:ss\:fff"); } } } From ca1814eb190c01a703821401a65be4b2a93ab7d0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 18:38:54 +0900 Subject: [PATCH 138/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 14eb531c00..83925a8407 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 14eb531c0056b8569f21b3571890383ffbea768e +Subproject commit 83925a84072ec9da0d008c82256294b765321c0b From c2fcb2f9c7b31267acd3aadbd1cefa708107e148 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 18:45:12 +0900 Subject: [PATCH 139/282] Fix info wedge not displaying --- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 391cfc20db..5ced60a9da 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -43,12 +43,6 @@ namespace osu.Game.Screens.Select }; } - protected override void LoadComplete() - { - base.LoadComplete(); - AlwaysPresent = true; - } - protected override bool BlockPassThroughMouse => false; protected override void PopIn() From aff217cd03a47b7e8245cff3806ea21204145c1f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 19:47:12 +0900 Subject: [PATCH 140/282] Fix early access to beatmap in LogoVisualisation Missed this one.. --- osu.Game/Screens/Menu/LogoVisualisation.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index 7c1b914bf5..5b86fd6ca3 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -86,11 +86,10 @@ namespace osu.Game.Screens.Menu private void updateAmplitudes() { var track = beatmap.Value.TrackLoaded ? beatmap.Value.Track : null; + var effect = beatmap.Value.BeatmapLoaded ? beatmap.Value.Beatmap.ControlPointInfo.EffectPointAt(track?.CurrentTime ?? Time.Current) : null; float[] temporalAmplitudes = track?.CurrentAmplitudes.FrequencyAmplitudes ?? new float[256]; - var effect = beatmap.Value.Beatmap.ControlPointInfo.EffectPointAt(track?.CurrentTime ?? Time.Current); - for (int i = 0; i < bars_per_visualiser; i++) { if (track?.IsRunning ?? false) From decee415dd3b9961912a18dd0aa3ac73d57c26fe Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 19:54:08 +0900 Subject: [PATCH 141/282] Calculate real AR based on PreEmpt time --- .../Scoring/OsuPerformanceCalculator.cs | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs index 93003925ef..0b6bb1c4af 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs @@ -49,6 +49,17 @@ namespace osu.Game.Rulesets.Osu.Scoring if (mods.Any(m => m is OsuModRelax || m is OsuModAutopilot || m is OsuModAutoplay)) return 0; + // Todo: In the future we should apply changes to PreEmpt/AR at an OsuHitObject/BaseDifficulty level, but this is done + // locally for now as doing so would modify animations and other things unexpectedly + // DO NOT MODIFY THIS + double ar = Beatmap.BeatmapInfo.BaseDifficulty.ApproachRate; + if (mods.Any(m => m is OsuModHardRock)) + ar = Math.Min(10, ar * 1.4); + if (mods.Any(m => m is OsuModEasy)) + ar = Math.Max(0, ar / 2); + double preEmpt = BeatmapDifficulty.DifficultyRange(ar, 1800, 1200, 450); + realApproachRate = preEmpt > 1200 ? (1800 - preEmpt) / 120 : (1200 - preEmpt) / 150 + 5; + // Custom multipliers for NoFail and SpunOut. double multiplier = 1.12f; // This is being adjusted to keep the final pp value scaled around what it used to be when changing things @@ -95,17 +106,16 @@ namespace osu.Game.Rulesets.Osu.Scoring if (beatmapMaxCombo > 0) aimValue *= Math.Min(Math.Pow(scoreMaxCombo, 0.8f) / Math.Pow(beatmapMaxCombo, 0.8f), 1.0f); - double approachRate = Beatmap.BeatmapInfo.BaseDifficulty.ApproachRate; double approachRateFactor = 1.0f; - if (approachRate > 10.33f) - approachRateFactor += 0.45f * (approachRate - 10.33f); - else if (approachRate < 8.0f) + if (realApproachRate > 10.33f) + approachRateFactor += 0.45f * (realApproachRate - 10.33f); + else if (realApproachRate < 8.0f) { // HD is worth more with lower ar! if (mods.Any(h => h is OsuModHidden)) - approachRateFactor += 0.02f * (8.0f - approachRate); + approachRateFactor += 0.02f * (8.0f - realApproachRate); else - approachRateFactor += 0.01f * (8.0f - approachRate); + approachRateFactor += 0.01f * (8.0f - realApproachRate); } aimValue *= approachRateFactor; From f9ad4b6acbc122bf505e55a9f351ed24f9df586a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Nov 2017 19:54:53 +0900 Subject: [PATCH 142/282] Make categoryDifficulties return doubles to improve decimal accuracy --- .../CatchDifficultyCalculator.cs | 2 +- .../ManiaDifficultyCalculator.cs | 2 +- .../OsuDifficulty/OsuDifficultyCalculator.cs | 6 +++--- .../Scoring/OsuPerformanceCalculator.cs | 13 +++++++------ .../TaikoDifficultyCalculator.cs | 6 +++--- osu.Game/Beatmaps/DifficultyCalculator.cs | 2 +- osu.Game/Rulesets/Scoring/PerformanceCalculator.cs | 6 +++--- osu.Game/Tests/Visual/TestCasePerformancePoints.cs | 6 +++--- 8 files changed, 22 insertions(+), 21 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs index b77be9d1f0..369290fcbd 100644 --- a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Catch { } - public override double Calculate(Dictionary categoryDifficulty = null) => 0; + public override double Calculate(Dictionary categoryDifficulty = null) => 0; protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new CatchBeatmapConverter(); } diff --git a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs index 67bc347535..e0763284a6 100644 --- a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Mania { } - public override double Calculate(Dictionary categoryDifficulty = null) => 0; + public override double Calculate(Dictionary categoryDifficulty = null) => 0; protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new ManiaBeatmapConverter(true, (int)Math.Max(1, Math.Round(beatmap.BeatmapInfo.BaseDifficulty.CircleSize))); } diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 4f41d3b8e2..3d185ab694 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty (h as Slider)?.Curve?.Calculate(); } - public override double Calculate(Dictionary categoryDifficulty = null) + public override double Calculate(Dictionary categoryDifficulty = null) { OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Beatmap.HitObjects, TimeRate); Skill[] skills = @@ -67,8 +67,8 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty if (categoryDifficulty != null) { - categoryDifficulty.Add("Aim", aimRating.ToString("0.00")); - categoryDifficulty.Add("Speed", speedRating.ToString("0.00")); + categoryDifficulty.Add("Aim", aimRating); + categoryDifficulty.Add("Speed", speedRating); } return starRating; diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs index 0b6bb1c4af..cc5abb36b5 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs @@ -19,6 +19,7 @@ namespace osu.Game.Rulesets.Osu.Scoring private readonly int beatmapMaxCombo; private Mod[] mods; + private double realApproachRate; private double accuracy; private int scoreMaxCombo; private int count300; @@ -35,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Scoring beatmapMaxCombo += Beatmap.HitObjects.OfType().Sum(s => s.RepeatCount + s.Ticks.Count()); } - public override double Calculate(Dictionary categoryRatings = null) + public override double Calculate(Dictionary categoryRatings = null) { mods = Score.Mods; accuracy = Score.Accuracy; @@ -81,9 +82,9 @@ namespace osu.Game.Rulesets.Osu.Scoring if (categoryRatings != null) { - categoryRatings.Add("Aim", aimValue.ToString("0.00")); - categoryRatings.Add("Speed", speedValue.ToString("0.00")); - categoryRatings.Add("Accuracy", accuracyValue.ToString("0.00")); + categoryRatings.Add("Aim", aimValue); + categoryRatings.Add("Speed", speedValue); + categoryRatings.Add("Accuracy", accuracyValue); } return totalValue; @@ -91,7 +92,7 @@ namespace osu.Game.Rulesets.Osu.Scoring private double computeAimValue() { - double aimValue = Math.Pow(5.0f * Math.Max(1.0f, double.Parse(Attributes["Aim"]) / 0.0675f) - 4.0f, 3.0f) / 100000.0f; + double aimValue = Math.Pow(5.0f * Math.Max(1.0f, Attributes["Aim"] / 0.0675f) - 4.0f, 3.0f) / 100000.0f; // Longer maps are worth more double lengthBonus = 0.95f + 0.4f * Math.Min(1.0f, totalHits / 2000.0f) + @@ -139,7 +140,7 @@ namespace osu.Game.Rulesets.Osu.Scoring private double computeSpeedValue() { - double speedValue = Math.Pow(5.0f * Math.Max(1.0f, double.Parse(Attributes["Speed"]) / 0.0675f) - 4.0f, 3.0f) / 100000.0f; + double speedValue = Math.Pow(5.0f * Math.Max(1.0f, Attributes["Speed"] / 0.0675f) - 4.0f, 3.0f) / 100000.0f; // Longer maps are worth more speedValue *= 0.95f + 0.4f * Math.Min(1.0f, totalHits / 2000.0f) + diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index e881942fbf..394036df39 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Taiko { } - public override double Calculate(Dictionary categoryDifficulty = null) + public override double Calculate(Dictionary categoryDifficulty = null) { // Fill our custom DifficultyHitObject class, that carries additional information difficultyHitObjects.Clear(); @@ -53,8 +53,8 @@ namespace osu.Game.Rulesets.Taiko if (categoryDifficulty != null) { - categoryDifficulty.Add("Strain", starRating.ToString("0.00", CultureInfo.InvariantCulture)); - categoryDifficulty.Add("Hit window 300", (35 /*HitObjectManager.HitWindow300*/ / TimeRate).ToString("0.00", CultureInfo.InvariantCulture)); + categoryDifficulty.Add("Strain", starRating); + categoryDifficulty.Add("Hit window 300", (35 /*HitObjectManager.HitWindow300*/ / TimeRate)); } return starRating; diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index f58f433cb2..687e1b2177 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -14,7 +14,7 @@ namespace osu.Game.Beatmaps { protected double TimeRate = 1; - public abstract double Calculate(Dictionary categoryDifficulty = null); + public abstract double Calculate(Dictionary categoryDifficulty = null); } public abstract class DifficultyCalculator : DifficultyCalculator where T : HitObject diff --git a/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs b/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs index 000e279d11..4f603049db 100644 --- a/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs +++ b/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs @@ -9,14 +9,14 @@ namespace osu.Game.Rulesets.Scoring { public abstract class PerformanceCalculator { - public abstract double Calculate(Dictionary categoryDifficulty = null); + public abstract double Calculate(Dictionary categoryDifficulty = null); } public abstract class PerformanceCalculator : PerformanceCalculator where TObject : HitObject { - private readonly Dictionary attributes = new Dictionary(); - protected IDictionary Attributes => attributes; + private readonly Dictionary attributes = new Dictionary(); + protected IDictionary Attributes => attributes; protected readonly Beatmap Beatmap; protected readonly Score Score; diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index 6b2ab6433b..80167e5e1f 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -259,7 +259,7 @@ namespace osu.Game.Tests.Visual if (calculator == null) return; - var attributes = new Dictionary(); + var attributes = new Dictionary(); double performance = calculator.Calculate(attributes); text.Text = $"{score.User.Username} -> online: {score.PP:n2}pp | local: {performance:n2}pp"; @@ -364,12 +364,12 @@ namespace osu.Game.Tests.Visual var diffCalc = ruleset.CreateDifficultyCalculator(beatmap.Beatmap, activeMods); if (diffCalc != null) { - var categories = new Dictionary(); + var categories = new Dictionary(); double totalSr = diffCalc.Calculate(categories); totalText.Text = $"Star rating: {totalSr:n2}"; foreach (var kvp in categories) - categoryTexts.Add(new OsuSpriteText { Text = $"{kvp.Key}: {kvp.Value}" }); + categoryTexts.Add(new OsuSpriteText { Text = $"{kvp.Key}: {kvp.Value:n2}" }); } informationCache.Validate(); From 2603219350db896caf0b0a6b312df6394da3dba7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 22:27:56 +0900 Subject: [PATCH 143/282] Load beatmap carousel panels asynchronously --- .../Beatmaps/Drawables/BeatmapSetHeader.cs | 54 +++++++++---------- osu.Game/Screens/Select/BeatmapCarousel.cs | 13 ++++- 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 8a589ccd30..917376969b 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -11,7 +11,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; -using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Game.Graphics.Sprites; using osu.Framework.Graphics.Shapes; @@ -28,10 +27,8 @@ namespace osu.Game.Beatmaps.Drawables public Action RestoreHiddenRequested; - private readonly SpriteText title; - private readonly SpriteText artist; - private readonly WorkingBeatmap beatmap; + private readonly FillFlowContainer difficultyIcons; public BeatmapSetHeader(WorkingBeatmap beatmap) @@ -41,6 +38,25 @@ namespace osu.Game.Beatmaps.Drawables this.beatmap = beatmap; + difficultyIcons = new FillFlowContainer + { + Margin = new MarginPadding { Top = 5 }, + AutoSizeAxes = Axes.Both, + }; + } + + protected override void Selected() + { + base.Selected(); + GainedSelection?.Invoke(this); + } + + [BackgroundDependencyLoader] + private void load(LocalisationEngine localisation) + { + if (localisation == null) + throw new ArgumentNullException(nameof(localisation)); + Children = new Drawable[] { new DelayedLoadWrapper( @@ -60,44 +76,26 @@ namespace osu.Game.Beatmaps.Drawables AutoSizeAxes = Axes.Both, Children = new Drawable[] { - title = new OsuSpriteText + new OsuSpriteText { Font = @"Exo2.0-BoldItalic", + Current = localisation.GetUnicodePreference(beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title), TextSize = 22, Shadow = true, }, - artist = new OsuSpriteText + new OsuSpriteText { Font = @"Exo2.0-SemiBoldItalic", + Current = localisation.GetUnicodePreference(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist), TextSize = 17, Shadow = true, }, - difficultyIcons = new FillFlowContainer - { - Margin = new MarginPadding { Top = 5 }, - AutoSizeAxes = Axes.Both, - } + difficultyIcons } } }; } - protected override void Selected() - { - base.Selected(); - GainedSelection?.Invoke(this); - } - - [BackgroundDependencyLoader] - private void load(LocalisationEngine localisation) - { - if (localisation == null) - throw new ArgumentNullException(nameof(localisation)); - - title.Current = localisation.GetUnicodePreference(beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title); - artist.Current = localisation.GetUnicodePreference(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist); - } - private class PanelBackground : BufferedContainer { public PanelBackground(WorkingBeatmap working) @@ -185,4 +183,4 @@ namespace osu.Game.Beatmaps.Drawables } } } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 452f8c484c..b0a636dfb3 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -572,7 +572,18 @@ namespace osu.Game.Screens.Select // Makes sure headers are always _below_ panels, // and depth flows downward. panel.Depth = i + (panel is BeatmapSetHeader ? panels.Count : 0); - scrollableContent.Add(panel); + + switch (panel.LoadState) + { + case LoadState.NotLoaded: + LoadComponentAsync(panel); + break; + case LoadState.Loading: + break; + default: + scrollableContent.Add(panel); + break; + } } } From 5e70b7a9f7633a8dfa3bbb48fa3936560d25db48 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 11:50:24 +0900 Subject: [PATCH 144/282] Add async load methods for WorkingBeatmap properties --- osu.Game/Beatmaps/WorkingBeatmap.cs | 38 ++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 1d4ed75688..2a8178882e 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -8,6 +8,7 @@ using osu.Game.Rulesets.Mods; using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; namespace osu.Game.Beatmaps { @@ -29,10 +30,10 @@ namespace osu.Game.Beatmaps Mods.ValueChanged += mods => applyRateAdjustments(); - beatmap = new Lazy(populateBeatmap); - background = new Lazy(populateBackground); - track = new Lazy(populateTrack); - waveform = new Lazy(populateWaveform); + beatmap = new AsyncLazy(populateBeatmap); + background = new AsyncLazy(populateBackground); + track = new AsyncLazy(populateTrack); + waveform = new AsyncLazy(populateWaveform); } protected abstract Beatmap GetBeatmap(); @@ -41,8 +42,10 @@ namespace osu.Game.Beatmaps protected virtual Waveform GetWaveform() => new Waveform(); public bool BeatmapLoaded => beatmap.IsValueCreated; - public Beatmap Beatmap => beatmap.Value; - private readonly Lazy beatmap; + public Beatmap Beatmap => beatmap.Value.Result; + public async Task GetBeatmapAsync() => await beatmap.Value; + + private readonly AsyncLazy beatmap; private Beatmap populateBeatmap() { @@ -55,14 +58,16 @@ namespace osu.Game.Beatmaps } public bool BackgroundLoaded => background.IsValueCreated; - public Texture Background => background.Value; - private Lazy background; + public Texture Background => background.Value.Result; + public async Task GetBackgroundAsync() => await background.Value; + private AsyncLazy background; private Texture populateBackground() => GetBackground(); public bool TrackLoaded => track.IsValueCreated; - public Track Track => track.Value; - private Lazy track; + public Track Track => track.Value.Result; + public async Task GetTrackAsync() => await track.Value; + private AsyncLazy track; private Track populateTrack() { @@ -73,8 +78,9 @@ namespace osu.Game.Beatmaps } public bool WaveformLoaded => waveform.IsValueCreated; - public Waveform Waveform => waveform.Value; - private readonly Lazy waveform; + public Waveform Waveform => waveform.Value.Result; + public async Task GetWaveformAsync() => await waveform.Value; + private readonly AsyncLazy waveform; private Waveform populateWaveform() => GetWaveform(); @@ -107,5 +113,13 @@ namespace osu.Game.Beatmaps foreach (var mod in Mods.Value.OfType()) mod.ApplyToClock(t); } + + public class AsyncLazy : Lazy> + { + public AsyncLazy(Func valueFactory) + : base(() => Task.Run(valueFactory)) + { + } + } } } From b3b1f2018e46a0123ce932be3c765e4ac55ce0dd Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 21 Nov 2017 15:13:00 +0100 Subject: [PATCH 145/282] Fix osu crashing if a invalid gamerule is given in the game.ini --- osu.Game/OsuGame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index e603375e9c..4745733bd9 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -109,7 +109,7 @@ namespace osu.Game dependencies.Cache(this); configRuleset = LocalConfig.GetBindable(OsuSetting.Ruleset); - Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value); + Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First(); Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; } From a033eb46d3361e321aaccf24e7569adfdaa988c5 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 16:12:23 +0100 Subject: [PATCH 146/282] Changed to LoadComponentAsync call instead of adding an AsyncLoadWrapper instance. --- osu.Game/Overlays/Direct/PlayButton.cs | 11 ++++----- osu.Game/Overlays/Profile/ProfileHeader.cs | 10 ++++---- osu.Game/Screens/Multiplayer/DrawableRoom.cs | 21 +++++++++-------- osu.Game/Screens/Multiplayer/RoomInspector.cs | 23 +++++++++++-------- osu.Game/Screens/Play/Player.cs | 3 ++- 5 files changed, 37 insertions(+), 31 deletions(-) diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index 9317bc06cf..7fff2821e3 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -146,18 +146,17 @@ namespace osu.Game.Overlays.Direct loading = true; - Add(new AsyncLoadWrapper(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3") - { - OnLoadComplete = d => + LoadComponentAsync(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3"), + d => { - // we may have been replaced by another loader + // We may have been replaced by another loader if (trackLoader != d) return; Preview = (d as TrackLoader)?.Preview; Playing.TriggerChange(); loading = false; - }, - })); + Add(trackLoader); + }); } private class TrackLoader : Drawable diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 22e34be34c..6a9247e73b 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -316,18 +316,18 @@ namespace osu.Game.Overlays.Profile private void loadUser() { - coverContainer.Add(new AsyncLoadWrapper(new UserCoverBackground(user) + LoadComponentAsync(new UserCoverBackground(user) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(200) - }) + }, + ucb => { - Masking = true, - RelativeSizeAxes = Axes.Both, - Depth = float.MaxValue + ucb.Depth = float.MaxValue; + coverContainer.Add(ucb); }); if (user.IsSupporter) supporterTag.Show(); diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index d2f88224c2..dd69ec9db1 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -228,16 +228,19 @@ namespace osu.Game.Screens.Multiplayer if (value != null) { coverContainer.FadeIn(transition_duration); - coverContainer.Children = new[] + + LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet) { - new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }) { RelativeSizeAxes = Axes.Both }, - }; + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + FillMode = FillMode.Fill, + OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), + }, + bsc => + { + bsc.RelativeSizeAxes = Axes.Both; + coverContainer.Add(bsc); + }); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index 66ce51b428..fec35d3d7e 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -329,17 +329,20 @@ namespace osu.Game.Screens.Multiplayer if (value != null) { coverContainer.FadeIn(transition_duration); - coverContainer.Children = new[] + + LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet) { - new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet) - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }) { RelativeSizeAxes = Axes.Both }, - }; + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + FillMode = FillMode.Fill, + OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), + }, + bsc => + { + bsc.RelativeSizeAxes = Axes.Both; + coverContainer.Add(bsc); + }); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index cd2818398d..5f7ef03218 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -248,7 +248,8 @@ namespace osu.Game.Screens.Play storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value); storyboard.Masking = true; - storyboardContainer.Add(asyncLoad ? new AsyncLoadWrapper(storyboard) { RelativeSizeAxes = Axes.Both } : (Drawable)storyboard); + if (asyncLoad) LoadComponentAsync(storyboard, s => storyboardContainer.Add(s)); + else storyboardContainer.Add((Drawable)storyboard); } public void Restart() From 870807c26588b0e967d94174bbc54104a1be58b0 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 16:17:33 +0100 Subject: [PATCH 147/282] Switched over to the new LoadWrapper class for all delayed loading. --- osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 4 ++-- osu.Game/Overlays/BeatmapSet/Header.cs | 4 ++-- osu.Game/Overlays/Direct/DirectPanel.cs | 2 +- osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 2 +- osu.Game/Users/UpdateableAvatar.cs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 8a589ccd30..3644c1b26f 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -43,7 +43,7 @@ namespace osu.Game.Beatmaps.Drawables Children = new Drawable[] { - new DelayedLoadWrapper( + new LoadWrapper( new PanelBackground(beatmap) { RelativeSizeAxes = Axes.Both, @@ -185,4 +185,4 @@ namespace osu.Game.Beatmaps.Drawables } } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 96bb613f9f..3c7266bb57 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -31,7 +31,7 @@ namespace osu.Game.Overlays.BeatmapSet private readonly AuthorInfo author; public Details Details; - private DelayedLoadWrapper cover; + private LoadWrapper cover; public readonly BeatmapPicker Picker; @@ -52,7 +52,7 @@ namespace osu.Game.Overlays.BeatmapSet videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); cover?.FadeOut(400, Easing.Out); - coverContainer.Add(cover = new DelayedLoadWrapper(new BeatmapSetCover(BeatmapSet) + coverContainer.Add(cover = new LoadWrapper(new BeatmapSetCover(BeatmapSet) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index ef89c0022b..692e561435 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -219,7 +219,7 @@ namespace osu.Game.Overlays.Direct return icons; } - protected Drawable CreateBackground() => new DelayedLoadWrapper(new BeatmapSetCover(SetInfo) + protected Drawable CreateBackground() => new LoadWrapper(new BeatmapSetCover(SetInfo) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 7b50d36b44..92fc6aef2b 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -99,7 +99,7 @@ namespace osu.Game.Screens.Select.Leaderboards Padding = new MarginPadding(edge_margin), Children = new Drawable[] { - avatar = new DelayedLoadWrapper( + avatar = new LoadWrapper( new Avatar(Score.User) { RelativeSizeAxes = Axes.Both, diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 7c020fce91..12a189f18f 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -40,7 +40,7 @@ namespace osu.Game.Users { displayedAvatar?.FadeOut(300); displayedAvatar?.Expire(); - Add(displayedAvatar = new DelayedLoadWrapper(new Avatar(user) + Add(displayedAvatar = new LoadWrapper(new Avatar(user) { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(200), From fd7ac9b6fcdb1a476499d5f89714565f62dfa132 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 16:18:32 +0100 Subject: [PATCH 148/282] Switched to the new LoadWrapper class for asynchronous loading (LoadComponentAsync not used here since it's not possible to call that method on a component that has not finished loading, and we're in the constructor where it would be called) --- osu.Game/Users/UserPanel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index ab4d55027d..e4fdcb4c1b 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -58,7 +58,7 @@ namespace osu.Game.Users Children = new Drawable[] { - new AsyncLoadWrapper(new UserCoverBackground(user) + new LoadWrapper(new UserCoverBackground(user) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, From 2203a8430000b00d539bbfc29000556a789d0a54 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 19:16:44 +0100 Subject: [PATCH 149/282] Small fixes and style corrections --- osu.Game/Overlays/BeatmapSet/Header.cs | 21 +++++++++-------- osu.Game/Overlays/Direct/DirectPanel.cs | 23 ++++++++++--------- osu.Game/Screens/Multiplayer/DrawableRoom.cs | 7 ++---- osu.Game/Screens/Multiplayer/RoomInspector.cs | 6 +---- osu.Game/Users/UpdateableAvatar.cs | 12 ++++++---- 5 files changed, 33 insertions(+), 36 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 3c7266bb57..5fed0c096a 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -52,17 +52,18 @@ namespace osu.Game.Overlays.BeatmapSet videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); cover?.FadeOut(400, Easing.Out); - coverContainer.Add(cover = new LoadWrapper(new BeatmapSetCover(BeatmapSet) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - FillMode = FillMode.Fill, - OnLoadComplete = d => + coverContainer.Add(cover = new LoadWrapper( + new BeatmapSetCover(BeatmapSet) { - d.FadeInFromZero(400, Easing.Out); - }, - }) + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + FillMode = FillMode.Fill, + OnLoadComplete = d => + { + d.FadeInFromZero(400, Easing.Out); + }, + }) { RelativeSizeAxes = Axes.Both, TimeBeforeLoad = 300 diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 692e561435..98aa5ef0cb 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -219,18 +219,19 @@ namespace osu.Game.Overlays.Direct return icons; } - protected Drawable CreateBackground() => new LoadWrapper(new BeatmapSetCover(SetInfo) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - FillMode = FillMode.Fill, - OnLoadComplete = d => + protected Drawable CreateBackground() => new LoadWrapper( + new BeatmapSetCover(SetInfo) { - d.FadeInFromZero(400, Easing.Out); - BlackBackground.Delay(400).FadeOut(); - }, - }) + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + FillMode = FillMode.Fill, + OnLoadComplete = d => + { + d.FadeInFromZero(400, Easing.Out); + BlackBackground.Delay(400).FadeOut(); + }, + }) { RelativeSizeAxes = Axes.Both, TimeBeforeLoad = 300 diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index dd69ec9db1..77e32752e4 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -229,6 +229,7 @@ namespace osu.Game.Screens.Multiplayer { coverContainer.FadeIn(transition_duration); + LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet) { Anchor = Anchor.Centre, @@ -236,11 +237,7 @@ namespace osu.Game.Screens.Multiplayer FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }, - bsc => - { - bsc.RelativeSizeAxes = Axes.Both; - coverContainer.Add(bsc); - }); + bsc => coverContainer.Add(bsc)); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index fec35d3d7e..30c2aa8505 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -338,11 +338,7 @@ namespace osu.Game.Screens.Multiplayer FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }, - bsc => - { - bsc.RelativeSizeAxes = Axes.Both; - coverContainer.Add(bsc); - }); + bsc => coverContainer.Add(bsc)); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 12a189f18f..02018ee1f4 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -40,11 +40,13 @@ namespace osu.Game.Users { displayedAvatar?.FadeOut(300); displayedAvatar?.Expire(); - Add(displayedAvatar = new LoadWrapper(new Avatar(user) - { - RelativeSizeAxes = Axes.Both, - OnLoadComplete = d => d.FadeInFromZero(200), - })); + Add(displayedAvatar = new LoadWrapper( + new Avatar(user) + { + RelativeSizeAxes = Axes.Both, + OnLoadComplete = d => d.FadeInFromZero(200), + }) + ); } } } From bf0184c06dc1cbef794c3e617bdb97caa7145bf1 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 19:34:01 +0100 Subject: [PATCH 150/282] One more small style fix --- osu.Game/Overlays/BeatmapSet/Header.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 5fed0c096a..b9d04e7b55 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -59,10 +59,7 @@ namespace osu.Game.Overlays.BeatmapSet Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, - OnLoadComplete = d => - { - d.FadeInFromZero(400, Easing.Out); - }, + OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }) { RelativeSizeAxes = Axes.Both, From 1d41e7cc8a8ea5a750004bbfe8ad1cd4936521da Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 20:15:42 +0100 Subject: [PATCH 151/282] Removed newline at end --- osu.Game/Screens/Multiplayer/DrawableRoom.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index 77e32752e4..60a0bd7a82 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -229,7 +229,7 @@ namespace osu.Game.Screens.Multiplayer { coverContainer.FadeIn(transition_duration); - + LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet) { Anchor = Anchor.Centre, @@ -260,4 +260,4 @@ namespace osu.Game.Screens.Multiplayer participantInfo.Participants = value; } } -} +} \ No newline at end of file From 63d366ea4b77941e61dc90abb0aa1748e7dd7e7c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 10:54:33 +0900 Subject: [PATCH 152/282] Bindables should be readonly --- osu.Game/Screens/Edit/Components/BottomBarContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Components/BottomBarContainer.cs b/osu.Game/Screens/Edit/Components/BottomBarContainer.cs index d65355b5f4..0e57407928 100644 --- a/osu.Game/Screens/Edit/Components/BottomBarContainer.cs +++ b/osu.Game/Screens/Edit/Components/BottomBarContainer.cs @@ -17,7 +17,7 @@ namespace osu.Game.Screens.Edit.Components private const float corner_radius = 5; private const float contents_padding = 15; - public Bindable Beatmap = new Bindable(); + public readonly Bindable Beatmap = new Bindable(); protected Track Track => Beatmap.Value.Track; private readonly Drawable background; From 461c8e8be0805956eaa4a98c5f8f28512780c394 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 10:55:06 +0900 Subject: [PATCH 153/282] Clean up state change logic --- .../Edit/Components/PlaybackContainer.cs | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs index a7d1db4802..67478dd94c 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs @@ -128,32 +128,25 @@ namespace osu.Game.Screens.Edit.Components protected override bool OnHover(InputState state) { - if (!Active) - toBold(); + updateState(); return true; } protected override void OnHoverLost(InputState state) { - if (!Active) - toNormal(); + updateState(); } - private void toBold() + + private void updateState() { - text.FadeOut(fade_duration); - textBold.FadeIn(fade_duration); + text.FadeTo(Active || IsHovered ? 0 : 1, fade_duration); + textBold.FadeTo(Active || IsHovered ? 1 : 0, fade_duration); } - private void toNormal() - { - text.FadeIn(fade_duration); - textBold.FadeOut(fade_duration); - } + protected override void OnActivated() => updateState(); - protected override void OnActivated() => toBold(); - - protected override void OnDeactivated() => toNormal(); + protected override void OnDeactivated() => updateState(); } } } From c06d6d0bbb86bce8c116d6bf291f61d8b72a6dad Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 10:59:31 +0900 Subject: [PATCH 154/282] Rename weird method --- osu.Game/Screens/Edit/Components/PlaybackContainer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs index 67478dd94c..a133c88c84 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs @@ -30,7 +30,7 @@ namespace osu.Game.Screens.Edit.Components Scale = new Vector2(1.4f), IconScale = new Vector2(1.4f), Icon = FontAwesome.fa_play_circle_o, - Action = playPause, + Action = togglePause, Padding = new MarginPadding { Left = 20 } }, new OsuSpriteText @@ -59,7 +59,7 @@ namespace osu.Game.Screens.Edit.Components tabs.Current.ValueChanged += newValue => Track.Tempo.Value = newValue; } - private void playPause() + private void togglePause() { if (Track.IsRunning) Track.Stop(); From 855acc9401c1ae3a36c3fbbe27b7f0d6d054b16e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 11:17:10 +0900 Subject: [PATCH 155/282] Fix leading space before percent sign --- osu.Game/Screens/Edit/Components/PlaybackContainer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs index a133c88c84..0698d874a1 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs @@ -104,14 +104,14 @@ namespace osu.Game.Screens.Edit.Components { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, - Text = $"{value:P0}", + Text = $"{value:0%}", TextSize = 14, }, textBold = new OsuSpriteText { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, - Text = $"{value:P0}", + Text = $"{value:0%}", TextSize = 14, Font = @"Exo2.0-Bold", Alpha = 0, From ff5404e57f2489d7419ab6b8556796632d838773 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 11:21:48 +0900 Subject: [PATCH 156/282] Remove need for AlwaysPresent Also self-contains the tab options inside the tab control. --- .../Edit/Components/PlaybackContainer.cs | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs index 0698d874a1..746052f2c2 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackContainer.cs @@ -1,12 +1,16 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Globalization; +using System.Linq; using OpenTK; using osu.Framework.Allocation; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; +using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -52,10 +56,6 @@ namespace osu.Game.Screens.Edit.Components } }; - tabs.AddItem(0.25); - tabs.AddItem(0.75); - tabs.AddItem(1); - tabs.Current.ValueChanged += newValue => Track.Tempo.Value = newValue; } @@ -76,6 +76,8 @@ namespace osu.Game.Screens.Edit.Components private class PlaybackTabControl : OsuTabControl { + private static double[] tempo_values = new [] { 0.5, 0.75, 1 }; + protected override TabItem CreateTabItem(double value) => new PlaybackTabItem(value); protected override Dropdown CreateDropdown() => null; @@ -83,7 +85,9 @@ namespace osu.Game.Screens.Edit.Components public PlaybackTabControl() { RelativeSizeAxes = Axes.Both; - TabContainer.Spacing = new Vector2(20, 0); + TabContainer.Spacing = Vector2.Zero; + + tempo_values.ForEach(AddItem); } public class PlaybackTabItem : TabItem @@ -95,8 +99,9 @@ namespace osu.Game.Screens.Edit.Components public PlaybackTabItem(double value) : base(value) { - AutoSizeAxes = Axes.X; - RelativeSizeAxes = Axes.Y; + RelativeSizeAxes = Axes.Both; + + Width = 1f / tempo_values.Length; Children = new Drawable[] { @@ -115,7 +120,6 @@ namespace osu.Game.Screens.Edit.Components TextSize = 14, Font = @"Exo2.0-Bold", Alpha = 0, - AlwaysPresent = true, }, }; } From 0f8499c58027d5e675d85d4e47e487d6bffbd5c6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 11:22:46 +0900 Subject: [PATCH 157/282] Rename to PlaybackControl and add a TestCase --- .../Visual/TestCasePlaybackControl.cs | 27 +++++++++++++++++++ osu.Game.Tests/osu.Game.Tests.csproj | 1 + ...laybackContainer.cs => PlaybackControl.cs} | 4 +-- osu.Game/Screens/Edit/Editor.cs | 4 +-- osu.Game/osu.Game.csproj | 2 +- 5 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 osu.Game.Tests/Visual/TestCasePlaybackControl.cs rename osu.Game/Screens/Edit/Components/{PlaybackContainer.cs => PlaybackControl.cs} (95%) diff --git a/osu.Game.Tests/Visual/TestCasePlaybackControl.cs b/osu.Game.Tests/Visual/TestCasePlaybackControl.cs new file mode 100644 index 0000000000..f5fb4b6032 --- /dev/null +++ b/osu.Game.Tests/Visual/TestCasePlaybackControl.cs @@ -0,0 +1,27 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using osu.Framework.Graphics; +using osu.Game.Beatmaps; +using osu.Game.Screens.Edit.Components; +using osu.Game.Tests.Beatmaps; +using OpenTK; + +namespace osu.Game.Tests.Visual +{ + public class TestCasePlaybackControl : OsuTestCase + { + public TestCasePlaybackControl() + { + var playback = new PlaybackControl() + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Size = new Vector2(200,100) + }; + playback.Beatmap.Value = new TestWorkingBeatmap(new Beatmap()); + + Add(playback); + } + } +} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 974bde9319..9bba09b1a7 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -124,6 +124,7 @@ + diff --git a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs b/osu.Game/Screens/Edit/Components/PlaybackControl.cs similarity index 95% rename from osu.Game/Screens/Edit/Components/PlaybackContainer.cs rename to osu.Game/Screens/Edit/Components/PlaybackControl.cs index 746052f2c2..5017d9e1a4 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackContainer.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackControl.cs @@ -17,11 +17,11 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Edit.Components { - public class PlaybackContainer : BottomBarContainer + public class PlaybackControl : BottomBarContainer { private readonly IconButton playButton; - public PlaybackContainer() + public PlaybackControl() { PlaybackTabControl tabs; diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index e2971deb75..607ff792d8 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -36,7 +36,7 @@ namespace osu.Game.Screens.Edit EditorMenuBar menuBar; TimeInfoContainer timeInfo; SummaryTimeline timeline; - PlaybackContainer playback; + PlaybackControl playback; Children = new[] { @@ -114,7 +114,7 @@ namespace osu.Game.Screens.Edit { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = 10 }, - Child = playback = new PlaybackContainer { RelativeSizeAxes = Axes.Both }, + Child = playback = new PlaybackControl { RelativeSizeAxes = Axes.Both }, } }, } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 048735358e..0752b31495 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -299,7 +299,7 @@ - + From 27fb5983525c73415a116b93d25cb0dac446ab12 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 11:34:54 +0900 Subject: [PATCH 158/282] Update colours to match design --- .../Screens/Edit/Components/PlaybackControl.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Edit/Components/PlaybackControl.cs b/osu.Game/Screens/Edit/Components/PlaybackControl.cs index 5017d9e1a4..56fca6bf9e 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackControl.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackControl.cs @@ -4,6 +4,7 @@ using System.Globalization; using System.Linq; using OpenTK; +using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; @@ -92,7 +93,7 @@ namespace osu.Game.Screens.Edit.Components public class PlaybackTabItem : TabItem { - private const float fade_duration = 100; + private const float fade_duration = 200; private readonly OsuSpriteText text; private readonly OsuSpriteText textBold; @@ -124,10 +125,14 @@ namespace osu.Game.Screens.Edit.Components }; } + private Color4 hoveredColour; + private Color4 normalColour; + [BackgroundDependencyLoader] private void load(OsuColour colours) { - text.Colour = colours.Gray5; + text.Colour = normalColour = colours.YellowDarker; + textBold.Colour = hoveredColour = colours.Yellow; } protected override bool OnHover(InputState state) @@ -144,8 +149,9 @@ namespace osu.Game.Screens.Edit.Components private void updateState() { - text.FadeTo(Active || IsHovered ? 0 : 1, fade_duration); - textBold.FadeTo(Active || IsHovered ? 1 : 0, fade_duration); + text.FadeColour(Active || IsHovered ? hoveredColour : normalColour, fade_duration, Easing.OutQuint); + text.FadeTo(Active ? 0 : 1, fade_duration, Easing.OutQuint); + textBold.FadeTo(Active ? 1 : 0, fade_duration, Easing.OutQuint); } protected override void OnActivated() => updateState(); From e3c5a599b6eba4057385397ba8beb3ff10abafad Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 11:36:29 +0900 Subject: [PATCH 159/282] Tidy some regressions --- osu.Game.Tests/Visual/TestCasePlaybackControl.cs | 2 +- osu.Game/Screens/Edit/Components/PlaybackControl.cs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCasePlaybackControl.cs b/osu.Game.Tests/Visual/TestCasePlaybackControl.cs index f5fb4b6032..bd2b011dbc 100644 --- a/osu.Game.Tests/Visual/TestCasePlaybackControl.cs +++ b/osu.Game.Tests/Visual/TestCasePlaybackControl.cs @@ -13,7 +13,7 @@ namespace osu.Game.Tests.Visual { public TestCasePlaybackControl() { - var playback = new PlaybackControl() + var playback = new PlaybackControl { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game/Screens/Edit/Components/PlaybackControl.cs b/osu.Game/Screens/Edit/Components/PlaybackControl.cs index 56fca6bf9e..bb814a0423 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackControl.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackControl.cs @@ -1,8 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; -using System.Linq; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; @@ -11,7 +9,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; -using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -77,7 +74,7 @@ namespace osu.Game.Screens.Edit.Components private class PlaybackTabControl : OsuTabControl { - private static double[] tempo_values = new [] { 0.5, 0.75, 1 }; + private static readonly double[] tempo_values = { 0.5, 0.75, 1 }; protected override TabItem CreateTabItem(double value) => new PlaybackTabItem(value); From 36d45f633d65e38a0929ed577c8b28ec2786b4f3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 11:57:09 +0900 Subject: [PATCH 160/282] Reorder methods --- osu.Game/Screens/Edit/Components/PlaybackControl.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Edit/Components/PlaybackControl.cs b/osu.Game/Screens/Edit/Components/PlaybackControl.cs index bb814a0423..5ffa66c43e 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackControl.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackControl.cs @@ -138,11 +138,9 @@ namespace osu.Game.Screens.Edit.Components return true; } - protected override void OnHoverLost(InputState state) - { - updateState(); - } - + protected override void OnHoverLost(InputState state) => updateState(); + protected override void OnActivated() => updateState(); + protected override void OnDeactivated() => updateState(); private void updateState() { @@ -150,10 +148,6 @@ namespace osu.Game.Screens.Edit.Components text.FadeTo(Active ? 0 : 1, fade_duration, Easing.OutQuint); textBold.FadeTo(Active ? 1 : 0, fade_duration, Easing.OutQuint); } - - protected override void OnActivated() => updateState(); - - protected override void OnDeactivated() => updateState(); } } } From 757bb6911e6e7db4e4cbadaec7bb58858afc9780 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 12:06:31 +0900 Subject: [PATCH 161/282] Fix license header from wrong project --- osu.Game.Tests/Visual/TestCasePlaybackControl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCasePlaybackControl.cs b/osu.Game.Tests/Visual/TestCasePlaybackControl.cs index bd2b011dbc..ff59bb7bfd 100644 --- a/osu.Game.Tests/Visual/TestCasePlaybackControl.cs +++ b/osu.Game.Tests/Visual/TestCasePlaybackControl.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.Game.Beatmaps; From 782a739370fbe9f02a0ad389397248caaab8bed9 Mon Sep 17 00:00:00 2001 From: Brayzure Date: Tue, 21 Nov 2017 23:00:00 -0500 Subject: [PATCH 162/282] Fix Results Screen After Failing Last Note Fixes a bug where if you failed on the last hitobject, the AllJudged event will have already been invoked. --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 7b26e50dd8..e129a81116 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -224,8 +224,8 @@ namespace osu.Game.Rulesets.Scoring OnNewJudgement(judgement); updateScore(); - NotifyNewJudgement(judgement); UpdateFailed(); + NotifyNewJudgement(judgement); } protected void RemoveJudgement(Judgement judgement) From 36027f8700f3c9ae9aab3026640c5119a32b477b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 13:54:38 +0900 Subject: [PATCH 163/282] Update readme to mention using visualtests always forever --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ad56178132..ce77e840f6 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ This is still heavily under development and is not intended for end-user use. Th We welcome all contributions, but keep in mind that we already have a lot of the UI designed. If you wish to work on something with the intention on having it included in the official distribution, please open an issue for discussion and we will give you what you need from a design perspective to proceed. If you want to make *changes* to the design, we recommend you open an issue with your intentions before spending too much time, to ensure no effort is wasted. +Please make sure you are familiar with the [development and testing](https://github.com/ppy/osu-framework/wiki/Development-and-Testing) procedure we have setup. New component development, and where possible, bug fixing and debugging existing components **should always be done under VisualTests**. + Contributions can be made via pull requests to this repository. We hope to credit and reward larger contributions via a [bounty system](https://www.bountysource.com/teams/ppy). If you're unsure of what you can help with, check out the [list of open issues](https://github.com/ppy/osu-framework/issues). Note that while we already have certain standards in place, nothing is set in stone. If you have an issue with the way code is structured; with any libraries we are using; with any processes involved with contributing, *please* bring it up. I welcome all feedback so we can make contributing to this project as pain-free as possible. From 5646ba4b2442c587e5f7e9070b6862d3f50c3175 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 14:04:32 +0900 Subject: [PATCH 164/282] Fix incorrect issues link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce77e840f6..484807d94d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ We welcome all contributions, but keep in mind that we already have a lot of the Please make sure you are familiar with the [development and testing](https://github.com/ppy/osu-framework/wiki/Development-and-Testing) procedure we have setup. New component development, and where possible, bug fixing and debugging existing components **should always be done under VisualTests**. -Contributions can be made via pull requests to this repository. We hope to credit and reward larger contributions via a [bounty system](https://www.bountysource.com/teams/ppy). If you're unsure of what you can help with, check out the [list of open issues](https://github.com/ppy/osu-framework/issues). +Contributions can be made via pull requests to this repository. We hope to credit and reward larger contributions via a [bounty system](https://www.bountysource.com/teams/ppy). If you're unsure of what you can help with, check out the [list of open issues](https://github.com/ppy/osu/issues). Note that while we already have certain standards in place, nothing is set in stone. If you have an issue with the way code is structured; with any libraries we are using; with any processes involved with contributing, *please* bring it up. I welcome all feedback so we can make contributing to this project as pain-free as possible. From 7de10a5877ac5a6636475a9389ea02d41577a513 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Wed, 22 Nov 2017 18:14:40 +0900 Subject: [PATCH 165/282] Fix invalid cast from noun to verb --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 484807d94d..856536d22d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This is still heavily under development and is not intended for end-user use. Th We welcome all contributions, but keep in mind that we already have a lot of the UI designed. If you wish to work on something with the intention on having it included in the official distribution, please open an issue for discussion and we will give you what you need from a design perspective to proceed. If you want to make *changes* to the design, we recommend you open an issue with your intentions before spending too much time, to ensure no effort is wasted. -Please make sure you are familiar with the [development and testing](https://github.com/ppy/osu-framework/wiki/Development-and-Testing) procedure we have setup. New component development, and where possible, bug fixing and debugging existing components **should always be done under VisualTests**. +Please make sure you are familiar with the [development and testing](https://github.com/ppy/osu-framework/wiki/Development-and-Testing) procedure we have set up. New component development, and where possible, bug fixing and debugging existing components **should always be done under VisualTests**. Contributions can be made via pull requests to this repository. We hope to credit and reward larger contributions via a [bounty system](https://www.bountysource.com/teams/ppy). If you're unsure of what you can help with, check out the [list of open issues](https://github.com/ppy/osu/issues). From e5dfe4ff2e3f75da2bc0a878ced26c7d23c4737d Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 22 Nov 2017 11:35:25 +0100 Subject: [PATCH 166/282] Make error more verbose when beatmap import fails (#1537) Add name of beatmap set to error message if import fails --- osu.Game/Beatmaps/BeatmapManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 006269f186..f461317ce1 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -165,7 +165,7 @@ namespace osu.Game.Beatmaps catch (Exception e) { e = e.InnerException ?? e; - Logger.Error(e, @"Could not import beatmap set"); + Logger.Error(e, $@"Could not import beatmap set ({Path.GetFileName(path)})"); } } From 0af3aea716cddafb248f3802852fe4c9a95d8e20 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Nov 2017 19:38:12 +0900 Subject: [PATCH 167/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 83925a8407..c6fd291492 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 83925a84072ec9da0d008c82256294b765321c0b +Subproject commit c6fd2914926f2a6df23eda536c0310f072581b1b From 05aa6faf5eb3a340b7d71b7acea3db98938d0a4b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 22 Nov 2017 19:46:52 +0900 Subject: [PATCH 168/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index ec7d5532b1..f6926e465d 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit ec7d5532b16acf25d2e23a03324b6d99c77cbe01 +Subproject commit f6926e465dfecc99f7b11013c7e2428b736bfea2 From d364603e4550faa77b295a0142d765b080d1f51f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 22 Nov 2017 20:02:31 +0900 Subject: [PATCH 169/282] Make registry checking work again --- osu-framework | 2 +- osu.Desktop/OsuGameDesktop.cs | 9 --------- osu.Desktop/osu.Desktop.csproj | 1 + 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/osu-framework b/osu-framework index f6926e465d..a4cbd332c4 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit f6926e465dfecc99f7b11013c7e2428b736bfea2 +Subproject commit a4cbd332c4fcdd682252f5a89d8c01052b405e86 diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index d356fcf53d..f2906f043c 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -10,10 +10,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Platform; using osu.Game; using OpenTK.Input; - -#if NET_FRAMEWORK using Microsoft.Win32; -#endif namespace osu.Desktop { @@ -48,7 +45,6 @@ namespace osu.Desktop { Func checkExists = p => Directory.Exists(Path.Combine(p, "Songs")); -#if NET_FRAMEWORK string stableInstallPath; try @@ -62,13 +58,8 @@ namespace osu.Desktop catch { } -#endif -#if NET_FRAMEWORK stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); -#else - var stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); -#endif if (checkExists(stableInstallPath)) return stableInstallPath; diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 56a455e6b7..a8f1a86a7a 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -26,6 +26,7 @@ + From 1456f98aff503040eaa563e4c1f282c11f065495 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 22 Nov 2017 21:04:14 +0900 Subject: [PATCH 170/282] Ensure that osu.Desktop.Deploy works Closes https://github.com/ppy/osu/issues/1545. --- osu.Desktop.Deploy/.vscode/launch.json | 29 ++++++++++++ osu.Desktop.Deploy/.vscode/tasks.json | 64 ++++++++++++++++++++++++++ osu.Desktop.Deploy/Program.cs | 10 ++-- 3 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 osu.Desktop.Deploy/.vscode/launch.json create mode 100644 osu.Desktop.Deploy/.vscode/tasks.json diff --git a/osu.Desktop.Deploy/.vscode/launch.json b/osu.Desktop.Deploy/.vscode/launch.json new file mode 100644 index 0000000000..82cd6b4c13 --- /dev/null +++ b/osu.Desktop.Deploy/.vscode/launch.json @@ -0,0 +1,29 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [{ + "name": "Deploy (Debug)", + "request": "launch", + "type": "mono", + "program": "${workspaceRoot}/bin/Debug/net461/osu.Desktop.Deploy.exe", + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Debug)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "Deploy (Release)", + "request": "launch", + "type": "clr", + "program": "${workspaceRoot}/bin/Release/net461/osu.Desktop.Deploy.exe", + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Release)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + } + ] +} \ No newline at end of file diff --git a/osu.Desktop.Deploy/.vscode/tasks.json b/osu.Desktop.Deploy/.vscode/tasks.json new file mode 100644 index 0000000000..35bf9e7a0e --- /dev/null +++ b/osu.Desktop.Deploy/.vscode/tasks.json @@ -0,0 +1,64 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "command": "msbuild", + "type": "shell", + "suppressTaskName": true, + "args": [ + "/property:GenerateFullPaths=true", + "/property:DebugType=portable", + "/verbosity:minimal", + "/m" //parallel compiling support. + ], + "tasks": [{ + "taskName": "Build (Debug)", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Build (Release)", + "group": "build", + "args": [ + "/property:Configuration=Release" + ], + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Clean (Debug)", + "args": [ + "/target:Clean" + ], + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Clean (Release)", + "args": [ + "/target:Clean", + "/property:Configuration=Release" + ], + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Clean All", + "dependsOn": [ + "Clean (Debug)", + "Clean (Release)" + ], + "problemMatcher": [ + "$msCompile" + ] + } + ] +} \ No newline at end of file diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index 3c1d532c0f..1be4bdeb0c 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -96,7 +96,7 @@ namespace osu.Desktop.Deploy runCommand(nuget_path, "restore " + solutionPath); write("Updating AssemblyInfo..."); - updateAssemblyInfo(version); + updateCsprojVersion(version); write("Running build process..."); foreach (string targetName in TargetNames.Split(',')) @@ -123,7 +123,7 @@ namespace osu.Desktop.Deploy uploadBuild(version); //reset assemblyinfo. - updateAssemblyInfo("0.0.0"); + updateCsprojVersion("0.0.0"); write("Done!", ConsoleColor.White); Console.ReadLine(); @@ -297,7 +297,7 @@ namespace osu.Desktop.Deploy Directory.CreateDirectory(directory); } - private static void updateAssemblyInfo(string version) + private static void updateCsprojVersion(string version) { var toUpdate = new[] { "", "" }; string file = Path.Combine(ProjectName, $"{ProjectName}.csproj"); @@ -336,8 +336,8 @@ namespace osu.Desktop.Deploy path = Environment.CurrentDirectory; while (!File.Exists(Path.Combine(path, $"{SolutionName}.sln"))) - path = path.Remove(path.LastIndexOf('\\')); - path += "\\"; + path = path.Remove(path.LastIndexOf(Path.DirectorySeparatorChar)); + path += Path.DirectorySeparatorChar; Environment.CurrentDirectory = path; } From 6003282e663c31b51173e1f5a024502073a76bb6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 22 Nov 2017 22:07:55 +0900 Subject: [PATCH 171/282] Give osu!lazer an application icon again Fixes https://github.com/ppy/osu/issues/1548. --- osu.Desktop/osu.Desktop.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index a8f1a86a7a..ca2b1c2bbe 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -12,6 +12,7 @@ osu! osu!lazer osu!lazer + lazer.ico 0.0.0.0 0.0.0.0 From 7d428875b8c0a4537ef3bde6531393ca3edc0459 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 22 Nov 2017 15:46:04 +0100 Subject: [PATCH 172/282] Changed LoadWrapper back to DelayedLoadWrapper and fixed the implementation (dependent on framework change, delay now in ctor) --- osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 10 ++++------ osu.Game/Overlays/BeatmapSet/Header.cs | 8 ++++---- osu.Game/Overlays/Direct/DirectPanel.cs | 6 +++--- .../Screens/Select/Leaderboards/LeaderboardScore.cs | 6 +++--- osu.Game/Users/UpdateableAvatar.cs | 5 +++-- osu.Game/Users/UserPanel.cs | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 3644c1b26f..ec39f86c5c 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -43,16 +43,14 @@ namespace osu.Game.Beatmaps.Drawables Children = new Drawable[] { - new LoadWrapper( + new DelayedLoadWrapper( new PanelBackground(beatmap) { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - } - ) - { - TimeBeforeLoad = 300, - }, + }, + 300 + ), new FillFlowContainer { Direction = FillDirection.Vertical, diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index b9d04e7b55..9bf14e1f90 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -31,7 +31,7 @@ namespace osu.Game.Overlays.BeatmapSet private readonly AuthorInfo author; public Details Details; - private LoadWrapper cover; + private DelayedLoadWrapper cover; public readonly BeatmapPicker Picker; @@ -52,7 +52,7 @@ namespace osu.Game.Overlays.BeatmapSet videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); cover?.FadeOut(400, Easing.Out); - coverContainer.Add(cover = new LoadWrapper( + coverContainer.Add(cover = new DelayedLoadWrapper( new BeatmapSetCover(BeatmapSet) { Anchor = Anchor.Centre, @@ -60,10 +60,10 @@ namespace osu.Game.Overlays.BeatmapSet RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }) + }, + 300) { RelativeSizeAxes = Axes.Both, - TimeBeforeLoad = 300 }); } } diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 98aa5ef0cb..bef8697552 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -219,7 +219,7 @@ namespace osu.Game.Overlays.Direct return icons; } - protected Drawable CreateBackground() => new LoadWrapper( + protected Drawable CreateBackground() => new DelayedLoadWrapper( new BeatmapSetCover(SetInfo) { Anchor = Anchor.Centre, @@ -231,10 +231,10 @@ namespace osu.Game.Overlays.Direct d.FadeInFromZero(400, Easing.Out); BlackBackground.Delay(400).FadeOut(); }, - }) + }, + 300) { RelativeSizeAxes = Axes.Both, - TimeBeforeLoad = 300 }; public class Statistic : FillFlowContainer diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 92fc6aef2b..14cd7e6f07 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -99,7 +99,7 @@ namespace osu.Game.Screens.Select.Leaderboards Padding = new MarginPadding(edge_margin), Children = new Drawable[] { - avatar = new LoadWrapper( + avatar = new DelayedLoadWrapper( new Avatar(Score.User) { RelativeSizeAxes = Axes.Both, @@ -112,9 +112,9 @@ namespace osu.Game.Screens.Select.Leaderboards Radius = 1, Colour = Color4.Black.Opacity(0.2f), }, - }) + }, + 500) { - TimeBeforeLoad = 500, RelativeSizeAxes = Axes.None, Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), }, diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 02018ee1f4..1700046653 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -40,12 +40,13 @@ namespace osu.Game.Users { displayedAvatar?.FadeOut(300); displayedAvatar?.Expire(); - Add(displayedAvatar = new LoadWrapper( + Add(displayedAvatar = new DelayedLoadWrapper( new Avatar(user) { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(200), - }) + }, + 500) ); } } diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index e4fdcb4c1b..923c62f8ef 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -58,7 +58,7 @@ namespace osu.Game.Users Children = new Drawable[] { - new LoadWrapper(new UserCoverBackground(user) + new DelayedLoadWrapper(new UserCoverBackground(user) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, From 18b0b77f0ae27c1dddd976a6ae7e7405463e1656 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 22 Nov 2017 21:41:50 +0100 Subject: [PATCH 173/282] Added requested changes. Mainly changing lambdas to direct function references. --- osu.Game/Overlays/Profile/ProfileHeader.cs | 9 +++------ osu.Game/Screens/Multiplayer/DrawableRoom.cs | 4 ++-- osu.Game/Screens/Multiplayer/RoomInspector.cs | 2 +- osu.Game/Screens/Play/Player.cs | 6 ++++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 6a9247e73b..c7bc5c1d93 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -322,13 +322,10 @@ namespace osu.Game.Overlays.Profile Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(200) + OnLoadComplete = d => d.FadeInFromZero(200), + Depth = float.MaxValue, }, - ucb => - { - ucb.Depth = float.MaxValue; - coverContainer.Add(ucb); - }); + coverContainer.Add); if (user.IsSupporter) supporterTag.Show(); diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index 60a0bd7a82..0ba4aaa364 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -237,7 +237,7 @@ namespace osu.Game.Screens.Multiplayer FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }, - bsc => coverContainer.Add(bsc)); + coverContainer.Add); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; @@ -260,4 +260,4 @@ namespace osu.Game.Screens.Multiplayer participantInfo.Participants = value; } } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index 30c2aa8505..8d7401500f 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -338,7 +338,7 @@ namespace osu.Game.Screens.Multiplayer FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }, - bsc => coverContainer.Add(bsc)); + coverContainer.Add); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 5f7ef03218..1e1b7bac93 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -248,8 +248,10 @@ namespace osu.Game.Screens.Play storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value); storyboard.Masking = true; - if (asyncLoad) LoadComponentAsync(storyboard, s => storyboardContainer.Add(s)); - else storyboardContainer.Add((Drawable)storyboard); + if (asyncLoad) + LoadComponentAsync(storyboard, storyboardContainer.Add); + else + storyboardContainer.Add(storyboard); } public void Restart() From 288c21dfece72710df16f641119f59e6b661f881 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 16:00:33 +0900 Subject: [PATCH 174/282] Move TestCase descriptions to attributes Depends on https://github.com/ppy/osu-framework/pull/1186. --- osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs | 2 -- osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs | 2 -- osu.Game.Tests/Visual/TestCaseAllPlayers.cs | 1 - osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs | 2 -- osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs | 5 ++--- osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs | 5 ++--- osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs | 2 -- osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs | 2 -- osu.Game.Tests/Visual/TestCaseBreakOverlay.cs | 4 +--- osu.Game.Tests/Visual/TestCaseChatDisplay.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseContextMenu.cs | 2 -- osu.Game.Tests/Visual/TestCaseDialogOverlay.cs | 2 -- osu.Game.Tests/Visual/TestCaseDirect.cs | 2 -- osu.Game.Tests/Visual/TestCaseDrawableRoom.cs | 2 -- osu.Game.Tests/Visual/TestCaseDrawings.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseGamefield.cs | 2 -- osu.Game.Tests/Visual/TestCaseGraph.cs | 4 +--- osu.Game.Tests/Visual/TestCaseIconButton.cs | 2 -- osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs | 2 -- osu.Game.Tests/Visual/TestCaseKeyCounter.cs | 2 -- osu.Game.Tests/Visual/TestCaseLeaderboard.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseMedalOverlay.cs | 2 -- osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseMenuOverlays.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseMods.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseMusicController.cs | 2 -- osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs | 2 -- osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs | 2 -- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs | 2 -- osu.Game.Tests/Visual/TestCaseReplay.cs | 2 -- osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs | 2 -- osu.Game.Tests/Visual/TestCaseResults.cs | 2 -- osu.Game.Tests/Visual/TestCaseRoomInspector.cs | 2 -- osu.Game.Tests/Visual/TestCaseScoreCounter.cs | 2 -- osu.Game.Tests/Visual/TestCaseSettings.cs | 2 -- osu.Game.Tests/Visual/TestCaseSkipButton.cs | 2 -- osu.Game.Tests/Visual/TestCaseSocial.cs | 2 -- osu.Game.Tests/Visual/TestCaseSongProgress.cs | 2 -- osu.Game.Tests/Visual/TestCaseStoryboard.cs | 2 -- osu.Game.Tests/Visual/TestCaseTabControl.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseTextAwesome.cs | 2 -- osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseUserPanel.cs | 2 -- osu.Game.Tests/Visual/TestCaseUserProfile.cs | 2 -- osu.Game.Tests/Visual/TestCaseUserRanks.cs | 2 -- osu.Game/Tests/Visual/TestCasePlayer.cs | 2 -- 48 files changed, 26 insertions(+), 99 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index 802d4cc99d..aab784f177 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -26,8 +26,6 @@ namespace osu.Game.Rulesets.Mania.Tests private const double start_time = 500; private const double duration = 500; - public override string Description => @"Mania playfield"; - protected override double TimePerAction => 200; private RulesetInfo maniaRuleset; diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs index 059d297401..555f9bb0da 100644 --- a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs @@ -30,8 +30,6 @@ namespace osu.Game.Rulesets.Taiko.Tests private const double default_duration = 1000; private const float scroll_time = 1000; - public override string Description => "Taiko playfield"; - protected override double TimePerAction => default_duration * 2; private readonly Random rng = new Random(1337); diff --git a/osu.Game.Tests/Visual/TestCaseAllPlayers.cs b/osu.Game.Tests/Visual/TestCaseAllPlayers.cs index 8c63e1a274..62b99487a9 100644 --- a/osu.Game.Tests/Visual/TestCaseAllPlayers.cs +++ b/osu.Game.Tests/Visual/TestCaseAllPlayers.cs @@ -5,6 +5,5 @@ namespace osu.Game.Tests.Visual { public class TestCaseAllPlayers : TestCasePlayer { - public override string Description => @"Showing everything to play the game."; } } diff --git a/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs index a5156c155b..18555574ba 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs @@ -19,8 +19,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseBeatSyncedContainer : OsuTestCase { - public override string Description => @"Tests beat synced containers."; - private readonly MusicController mc; public TestCaseBeatSyncedContainer() diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs index 7dffa6d590..215d1ee5b1 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs @@ -9,10 +9,9 @@ using OpenTK; namespace osu.Game.Tests.Visual { [TestFixture] + [Description("PlaySongSelect leaderboard/details area")] internal class TestCaseBeatmapDetailArea : OsuTestCase { - public override string Description => @"Beatmap details in song select"; - public TestCaseBeatmapDetailArea() { Add(new BeatmapDetailArea @@ -23,4 +22,4 @@ namespace osu.Game.Tests.Visual }); } } -} \ No newline at end of file +} diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs index b31eded9a0..248ec6d43d 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetails.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 System.ComponentModel; using System.Linq; using osu.Framework.Graphics; using osu.Game.Beatmaps; @@ -8,10 +9,9 @@ using osu.Game.Screens.Select; namespace osu.Game.Tests.Visual { + [Description("PlaySongSelect beatmap details")] internal class TestCaseBeatmapDetails : OsuTestCase { - public override string Description => "BeatmapDetails tab of BeatmapDetailArea"; - public TestCaseBeatmapDetails() { BeatmapDetails details; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs index bdc2e0e105..e114fac96e 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.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 System.ComponentModel; using osu.Game.Graphics; using osu.Game.Screens.Select.Options; using OpenTK.Graphics; @@ -8,10 +9,9 @@ using OpenTK.Input; namespace osu.Game.Tests.Visual { + [Description("bottom beatmap details")] internal class TestCaseBeatmapOptionsOverlay : OsuTestCase { - public override string Description => @"Beatmap options in song select"; - public TestCaseBeatmapOptionsOverlay() { var overlay = new BeatmapOptionsOverlay(); diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs index 8cae3feae2..cef8797f20 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.MathUtils; using osu.Game.Graphics; @@ -14,13 +13,13 @@ using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Users; using System.Collections.Generic; +using osu.Framework.Graphics.Containers; namespace osu.Game.Tests.Visual { + [System.ComponentModel.Description("in BeatmapOverlay")] public class TestCaseBeatmapScoresContainer : OsuTestCase { - public override string Description => "BeatmapOverlay scores container"; - private readonly IEnumerable scores; private readonly IEnumerable anotherScores; private readonly OnlineScore topScore; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs index c2de4ec05d..c24e13b7fb 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs @@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseBeatmapSetOverlay : OsuTestCase { - public override string Description => @"view online beatmap sets"; - private readonly BeatmapSetOverlay overlay; public TestCaseBeatmapSetOverlay() diff --git a/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs b/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs index 97c343f8ac..50abd11e79 100644 --- a/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs +++ b/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs @@ -8,8 +8,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseBreadcrumbs : OsuTestCase { - public override string Description => @"breadcrumb > control"; - public TestCaseBreadcrumbs() { BreadcrumbControl c; diff --git a/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs b/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs index 206ca308cf..dcb3b74654 100644 --- a/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseBreakOverlay : OsuTestCase { - public override string Description => @"Tests breaks behavior"; - private readonly BreakOverlay breakOverlay; public TestCaseBreakOverlay() @@ -88,4 +86,4 @@ namespace osu.Game.Tests.Visual }; } } -} \ No newline at end of file +} diff --git a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs index 847593fcec..85ee224a5e 100644 --- a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs @@ -1,15 +1,15 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Framework.Graphics.Containers; using osu.Game.Overlays; namespace osu.Game.Tests.Visual { + [Description("Testing chat api and overlay")] internal class TestCaseChatDisplay : OsuTestCase { - public override string Description => @"Testing chat api and overlay"; - public TestCaseChatDisplay() { Add(new ChatOverlay diff --git a/osu.Game.Tests/Visual/TestCaseContextMenu.cs b/osu.Game.Tests/Visual/TestCaseContextMenu.cs index 91a766f8c7..6f5cb398d7 100644 --- a/osu.Game.Tests/Visual/TestCaseContextMenu.cs +++ b/osu.Game.Tests/Visual/TestCaseContextMenu.cs @@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseContextMenu : OsuTestCase { - public override string Description => @"Menu visible on right click"; - private const int start_time = 0; private const int duration = 1000; diff --git a/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs b/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs index a031125b3a..f1aba908f0 100644 --- a/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs @@ -9,8 +9,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseDialogOverlay : OsuTestCase { - public override string Description => @"Display dialogs"; - public TestCaseDialogOverlay() { DialogOverlay overlay; diff --git a/osu.Game.Tests/Visual/TestCaseDirect.cs b/osu.Game.Tests/Visual/TestCaseDirect.cs index 2d8677c391..ede17fa775 100644 --- a/osu.Game.Tests/Visual/TestCaseDirect.cs +++ b/osu.Game.Tests/Visual/TestCaseDirect.cs @@ -11,8 +11,6 @@ namespace osu.Game.Tests.Visual { public class TestCaseDirect : OsuTestCase { - public override string Description => @"osu!direct overlay"; - private DirectOverlay direct; private RulesetStore rulesets; diff --git a/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs b/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs index 7113bcbff5..a51cf8ca95 100644 --- a/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs +++ b/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs @@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseDrawableRoom : OsuTestCase { - public override string Description => @"Select your favourite room"; - private RulesetStore rulesets; protected override void LoadComplete() diff --git a/osu.Game.Tests/Visual/TestCaseDrawings.cs b/osu.Game.Tests/Visual/TestCaseDrawings.cs index c805d88cb4..e5692b29de 100644 --- a/osu.Game.Tests/Visual/TestCaseDrawings.cs +++ b/osu.Game.Tests/Visual/TestCaseDrawings.cs @@ -2,15 +2,15 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.ComponentModel; using osu.Game.Screens.Tournament; using osu.Game.Screens.Tournament.Teams; namespace osu.Game.Tests.Visual { + [Description("for tournament use")] internal class TestCaseDrawings : OsuTestCase { - public override string Description => "Tournament drawings"; - public TestCaseDrawings() { Add(new Drawings diff --git a/osu.Game.Tests/Visual/TestCaseGamefield.cs b/osu.Game.Tests/Visual/TestCaseGamefield.cs index af86b6ec06..0d8f4cb5f7 100644 --- a/osu.Game.Tests/Visual/TestCaseGamefield.cs +++ b/osu.Game.Tests/Visual/TestCaseGamefield.cs @@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseGamefield : OsuTestCase { - public override string Description => @"Showing hitobjects and what not."; - protected override void LoadComplete() { base.LoadComplete(); diff --git a/osu.Game.Tests/Visual/TestCaseGraph.cs b/osu.Game.Tests/Visual/TestCaseGraph.cs index 714f284879..fb1a3ef3f6 100644 --- a/osu.Game.Tests/Visual/TestCaseGraph.cs +++ b/osu.Game.Tests/Visual/TestCaseGraph.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseGraph : OsuTestCase { - public override string Description => "graph"; - public TestCaseGraph() { BarGraph graph; @@ -36,4 +34,4 @@ namespace osu.Game.Tests.Visual AddStep("Right to left", () => graph.Direction = BarDirection.RightToLeft); } } -} \ No newline at end of file +} diff --git a/osu.Game.Tests/Visual/TestCaseIconButton.cs b/osu.Game.Tests/Visual/TestCaseIconButton.cs index acde9df4a9..345316708e 100644 --- a/osu.Game.Tests/Visual/TestCaseIconButton.cs +++ b/osu.Game.Tests/Visual/TestCaseIconButton.cs @@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual { public class TestCaseIconButton : OsuTestCase { - public override string Description => "Various display modes of icon buttons"; - public TestCaseIconButton() { Child = new FillFlowContainer diff --git a/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs b/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs index e473ce8778..d39ac12a60 100644 --- a/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs +++ b/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs @@ -9,8 +9,6 @@ namespace osu.Game.Tests.Visual { private readonly KeyBindingOverlay overlay; - public override string Description => @"Key configuration"; - public TestCaseKeyConfiguration() { Child = overlay = new KeyBindingOverlay(); diff --git a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs index 622fb15f4f..df122b7132 100644 --- a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs +++ b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseKeyCounter : OsuTestCase { - public override string Description => @"Tests key counter"; - public TestCaseKeyCounter() { KeyCounterCollection kc = new KeyCounterCollection diff --git a/osu.Game.Tests/Visual/TestCaseLeaderboard.cs b/osu.Game.Tests/Visual/TestCaseLeaderboard.cs index 832003e6ab..9d6fb3a4ec 100644 --- a/osu.Game.Tests/Visual/TestCaseLeaderboard.cs +++ b/osu.Game.Tests/Visual/TestCaseLeaderboard.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 System.ComponentModel; using osu.Framework.Graphics; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Select.Leaderboards; @@ -9,10 +10,9 @@ using OpenTK; namespace osu.Game.Tests.Visual { + [Description("PlaySongSelect leaderboard")] internal class TestCaseLeaderboard : OsuTestCase { - public override string Description => @"From song select"; - private readonly Leaderboard leaderboard; private void newScores() diff --git a/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs b/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs index 9a26eefd63..fbee27668c 100644 --- a/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs @@ -11,8 +11,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseMedalOverlay : OsuTestCase { - public override string Description => @"medal get!"; - public override IReadOnlyList RequiredTypes => new[] { typeof(MedalOverlay), diff --git a/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs b/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs index 0b50c9cf47..b5310f0fb0 100644 --- a/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs +++ b/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.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 System.ComponentModel; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Shapes; using osu.Game.Screens.Menu; @@ -8,10 +9,9 @@ using OpenTK.Graphics; namespace osu.Game.Tests.Visual { + [Description("main menu")] internal class TestCaseMenuButtonSystem : OsuTestCase { - public override string Description => @"Main menu button system"; - public TestCaseMenuButtonSystem() { Add(new Box diff --git a/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs b/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs index e27de96bee..94a69f0029 100644 --- a/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs +++ b/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs @@ -1,16 +1,16 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Framework.Graphics.Containers; using osu.Framework.Logging; using osu.Game.Screens.Play; namespace osu.Game.Tests.Visual { + [Description("player pause/fail screens")] internal class TestCaseMenuOverlays : OsuTestCase { - public override string Description => @"Tests pause and fail overlays"; - public TestCaseMenuOverlays() { FailOverlay failOverlay; diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs index 0447d6582d..5270ac0dc9 100644 --- a/osu.Game.Tests/Visual/TestCaseMods.cs +++ b/osu.Game.Tests/Visual/TestCaseMods.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 System.ComponentModel; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Overlays.Mods; @@ -10,10 +11,9 @@ using OpenTK; namespace osu.Game.Tests.Visual { + [Description("mod select and icon display")] internal class TestCaseMods : OsuTestCase { - public override string Description => @"Mod select overlay and in-game display"; - private ModSelectOverlay modSelect; private ModDisplay modDisplay; diff --git a/osu.Game.Tests/Visual/TestCaseMusicController.cs b/osu.Game.Tests/Visual/TestCaseMusicController.cs index 323c32bf10..3c544bb968 100644 --- a/osu.Game.Tests/Visual/TestCaseMusicController.cs +++ b/osu.Game.Tests/Visual/TestCaseMusicController.cs @@ -13,8 +13,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseMusicController : OsuTestCase { - public override string Description => @"Tests music controller ui."; - private readonly Bindable beatmapBacking = new Bindable(); public TestCaseMusicController() diff --git a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs index ed331076b2..3dca860909 100644 --- a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs @@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual [TestFixture] internal class TestCaseNotificationOverlay : OsuTestCase { - public override string Description => @"I handle notifications"; - private readonly NotificationOverlay manager; public TestCaseNotificationOverlay() diff --git a/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs b/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs index 8749d240f8..c3a755f3ca 100644 --- a/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs @@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual private FrameworkConfigManager config; private Bindable frameSyncMode; - public override string Description => @"Make it easier to see setting changes"; - protected override void LoadComplete() { base.LoadComplete(); diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index 37dd60a25c..7c070fd3df 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -22,8 +22,6 @@ namespace osu.Game.Tests.Visual { private BeatmapManager manager; - public override string Description => @"with fake data"; - private RulesetStore rulesets; private DependencyContainer dependencies; diff --git a/osu.Game.Tests/Visual/TestCaseReplay.cs b/osu.Game.Tests/Visual/TestCaseReplay.cs index 2e56daccfc..62c8a64916 100644 --- a/osu.Game.Tests/Visual/TestCaseReplay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplay.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseReplay : TestCasePlayer { - public override string Description => @"Testing replay playback."; - protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) { beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() }); diff --git a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs index 3105a7d588..22a2d717e4 100644 --- a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseReplaySettingsOverlay : OsuTestCase { - public override string Description => @"Settings visible in replay/auto"; - public TestCaseReplaySettingsOverlay() { ExampleContainer container; diff --git a/osu.Game.Tests/Visual/TestCaseResults.cs b/osu.Game.Tests/Visual/TestCaseResults.cs index 62154a535a..f1bbb8fed6 100644 --- a/osu.Game.Tests/Visual/TestCaseResults.cs +++ b/osu.Game.Tests/Visual/TestCaseResults.cs @@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual { private BeatmapManager beatmaps; - public override string Description => @"Results after playing."; - [BackgroundDependencyLoader] private void load(BeatmapManager beatmaps) { diff --git a/osu.Game.Tests/Visual/TestCaseRoomInspector.cs b/osu.Game.Tests/Visual/TestCaseRoomInspector.cs index e6b57c970b..51b6ae8e50 100644 --- a/osu.Game.Tests/Visual/TestCaseRoomInspector.cs +++ b/osu.Game.Tests/Visual/TestCaseRoomInspector.cs @@ -13,8 +13,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseRoomInspector : OsuTestCase { - public override string Description => @"from the multiplayer lobby"; - private RulesetStore rulesets; protected override void LoadComplete() diff --git a/osu.Game.Tests/Visual/TestCaseScoreCounter.cs b/osu.Game.Tests/Visual/TestCaseScoreCounter.cs index 543ff12fcb..5a04000900 100644 --- a/osu.Game.Tests/Visual/TestCaseScoreCounter.cs +++ b/osu.Game.Tests/Visual/TestCaseScoreCounter.cs @@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseScoreCounter : OsuTestCase { - public override string Description => @"Tests multiple counters"; - public TestCaseScoreCounter() { int numerator = 0, denominator = 0; diff --git a/osu.Game.Tests/Visual/TestCaseSettings.cs b/osu.Game.Tests/Visual/TestCaseSettings.cs index dfc0b66e21..63d798cd53 100644 --- a/osu.Game.Tests/Visual/TestCaseSettings.cs +++ b/osu.Game.Tests/Visual/TestCaseSettings.cs @@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseSettings : OsuTestCase { - public override string Description => @"Tests the settings overlay"; - private readonly SettingsOverlay settings; public TestCaseSettings() diff --git a/osu.Game.Tests/Visual/TestCaseSkipButton.cs b/osu.Game.Tests/Visual/TestCaseSkipButton.cs index 49be015adf..40c8baaac8 100644 --- a/osu.Game.Tests/Visual/TestCaseSkipButton.cs +++ b/osu.Game.Tests/Visual/TestCaseSkipButton.cs @@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseSkipButton : OsuTestCase { - public override string Description => @"Skip skip skippediskip"; - protected override void LoadComplete() { base.LoadComplete(); diff --git a/osu.Game.Tests/Visual/TestCaseSocial.cs b/osu.Game.Tests/Visual/TestCaseSocial.cs index 4f90e4ceff..ff0707c8ab 100644 --- a/osu.Game.Tests/Visual/TestCaseSocial.cs +++ b/osu.Game.Tests/Visual/TestCaseSocial.cs @@ -8,8 +8,6 @@ namespace osu.Game.Tests.Visual { public class TestCaseSocial : OsuTestCase { - public override string Description => @"social browser overlay"; - public TestCaseSocial() { SocialOverlay s = new SocialOverlay diff --git a/osu.Game.Tests/Visual/TestCaseSongProgress.cs b/osu.Game.Tests/Visual/TestCaseSongProgress.cs index 96ff76e9c6..1e6886cda9 100644 --- a/osu.Game.Tests/Visual/TestCaseSongProgress.cs +++ b/osu.Game.Tests/Visual/TestCaseSongProgress.cs @@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseSongProgress : OsuTestCase { - public override string Description => @"With fake data"; - private readonly SongProgress progress; private readonly SongProgressGraph graph; diff --git a/osu.Game.Tests/Visual/TestCaseStoryboard.cs b/osu.Game.Tests/Visual/TestCaseStoryboard.cs index c6ef3f4ecf..1dad106cbe 100644 --- a/osu.Game.Tests/Visual/TestCaseStoryboard.cs +++ b/osu.Game.Tests/Visual/TestCaseStoryboard.cs @@ -16,8 +16,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseStoryboard : OsuTestCase { - public override string Description => @"Tests storyboards."; - private readonly Bindable beatmapBacking = new Bindable(); private readonly Container storyboardContainer; diff --git a/osu.Game.Tests/Visual/TestCaseTabControl.cs b/osu.Game.Tests/Visual/TestCaseTabControl.cs index 6db74f2cfb..44a1732e16 100644 --- a/osu.Game.Tests/Visual/TestCaseTabControl.cs +++ b/osu.Game.Tests/Visual/TestCaseTabControl.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 System.ComponentModel; using osu.Framework.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -9,10 +10,9 @@ using OpenTK; namespace osu.Game.Tests.Visual { + [Description("SongSelect filter control")] public class TestCaseTabControl : OsuTestCase { - public override string Description => @"Filter for song select"; - public TestCaseTabControl() { OsuSpriteText text; diff --git a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs index beec5ab271..37905a1883 100644 --- a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs +++ b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs @@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseTextAwesome : OsuTestCase { - public override string Description => @"Tests display of icons"; - public TestCaseTextAwesome() { FillFlowContainer flow; diff --git a/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs b/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs index 83e0e4b442..bd5c10d147 100644 --- a/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs +++ b/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs @@ -1,14 +1,14 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Game.Graphics.UserInterface; namespace osu.Game.Tests.Visual { + [Description("mostly back button")] internal class TestCaseTwoLayerButton : OsuTestCase { - public override string Description => @"Mostly back button"; - public TestCaseTwoLayerButton() { Add(new BackButton()); diff --git a/osu.Game.Tests/Visual/TestCaseUserPanel.cs b/osu.Game.Tests/Visual/TestCaseUserPanel.cs index 8523a754f8..8d94a0c90f 100644 --- a/osu.Game.Tests/Visual/TestCaseUserPanel.cs +++ b/osu.Game.Tests/Visual/TestCaseUserPanel.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseUserPanel : OsuTestCase { - public override string Description => @"Panels for displaying a user's status"; - public TestCaseUserPanel() { UserPanel flyte; diff --git a/osu.Game.Tests/Visual/TestCaseUserProfile.cs b/osu.Game.Tests/Visual/TestCaseUserProfile.cs index f5fced2915..90daf1e996 100644 --- a/osu.Game.Tests/Visual/TestCaseUserProfile.cs +++ b/osu.Game.Tests/Visual/TestCaseUserProfile.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseUserProfile : OsuTestCase { - public override string Description => "Tests user's profile page."; - public TestCaseUserProfile() { var profile = new UserProfileOverlay(); diff --git a/osu.Game.Tests/Visual/TestCaseUserRanks.cs b/osu.Game.Tests/Visual/TestCaseUserRanks.cs index e17f0e1a46..eb0678203c 100644 --- a/osu.Game.Tests/Visual/TestCaseUserRanks.cs +++ b/osu.Game.Tests/Visual/TestCaseUserRanks.cs @@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseUserRanks : OsuTestCase { - public override string Description => "showing your latest achievements"; - public override IReadOnlyList RequiredTypes => new[] { typeof(DrawableScore), typeof(RanksSection) }; public TestCaseUserRanks() diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs index 5965be9717..cef85b65f1 100644 --- a/osu.Game/Tests/Visual/TestCasePlayer.cs +++ b/osu.Game/Tests/Visual/TestCasePlayer.cs @@ -23,8 +23,6 @@ namespace osu.Game.Tests.Visual protected Player Player; - public override string Description => @"Showing everything to play the game."; - /// /// Create a TestCase which runs through the Player screen. /// From f3a84a01dac463f17e287fdcd43a715f3eba1948 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 16:20:50 +0900 Subject: [PATCH 175/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index c6fd291492..eea84aaefc 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit c6fd2914926f2a6df23eda536c0310f072581b1b +Subproject commit eea84aaefcc7a1a6732d105ba319272dd9744901 From 182454032526775db3f92fb71cf474cbcb40370d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 11:15:21 +0900 Subject: [PATCH 176/282] Schedule calls to correct thread These could be fired from an async worker thread (for instance, maintenance operations). --- osu.Game/Screens/Select/SongSelect.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 5500d06136..24a7b3db90 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -203,8 +203,8 @@ namespace osu.Game.Screens.Select Push(new Editor()); } - private void onBeatmapRestored(BeatmapInfo b) => carousel.UpdateBeatmap(b); - private void onBeatmapHidden(BeatmapInfo b) => carousel.UpdateBeatmap(b); + private void onBeatmapRestored(BeatmapInfo b) => Schedule(() => carousel.UpdateBeatmap(b)); + private void onBeatmapHidden(BeatmapInfo b) => Schedule(() => carousel.UpdateBeatmap(b)); private void carouselBeatmapsLoaded() { From 85827f83eb6d54ea119260e120013f02e9904af2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 17:03:56 +0900 Subject: [PATCH 177/282] Perform a reload on objects when Refreshing them Previously, it was possible for an object to be "refreshed" with a stale cached state from the current thread's context. This ensures a check against the database is performed as well. Resolves #1562. --- osu.Game/Database/DatabaseBackedStore.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Database/DatabaseBackedStore.cs b/osu.Game/Database/DatabaseBackedStore.cs index bc1b7132eb..d8c3ce6694 100644 --- a/osu.Game/Database/DatabaseBackedStore.cs +++ b/osu.Game/Database/DatabaseBackedStore.cs @@ -35,6 +35,7 @@ namespace osu.Game.Database var id = obj.ID; obj = lookupSource?.SingleOrDefault(t => t.ID == id) ?? context.Find(id); + context.Entry(obj).Reload(); } /// From d6f532171b83a9c58c19ef99843643233430e05b Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 23 Nov 2017 09:11:52 +0100 Subject: [PATCH 178/282] Implementation fix (since the default delay is now 500 and not 0 this is necessary to ensure the same functionality) --- osu.Game/Users/UserPanel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 923c62f8ef..1f235e3893 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -65,7 +65,7 @@ namespace osu.Game.Users Origin = Anchor.Centre, FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(200), - }) { RelativeSizeAxes = Axes.Both }, + }, 0) { RelativeSizeAxes = Axes.Both }, new Box { RelativeSizeAxes = Axes.Both, From 2cc2323791b59fa615db3371b89cc3f5dd64ff9a Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 23 Nov 2017 09:12:23 +0100 Subject: [PATCH 179/282] Style changes (removing newline from before second constructor parameter) --- osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 4 +--- osu.Game/Overlays/BeatmapSet/Header.cs | 3 +-- osu.Game/Overlays/Direct/DirectPanel.cs | 3 +-- osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 3 +-- osu.Game/Users/UpdateableAvatar.cs | 3 +-- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index ec39f86c5c..5b84fa7c6e 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -48,9 +48,7 @@ namespace osu.Game.Beatmaps.Drawables { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }, - 300 - ), + }, 300), new FillFlowContainer { Direction = FillDirection.Vertical, diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 9bf14e1f90..195ff63ca5 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -60,8 +60,7 @@ namespace osu.Game.Overlays.BeatmapSet RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }, - 300) + }, 300) { RelativeSizeAxes = Axes.Both, }); diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index bef8697552..2e842af614 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -231,8 +231,7 @@ namespace osu.Game.Overlays.Direct d.FadeInFromZero(400, Easing.Out); BlackBackground.Delay(400).FadeOut(); }, - }, - 300) + }, 300) { RelativeSizeAxes = Axes.Both, }; diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 14cd7e6f07..0d898ad7d2 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -112,8 +112,7 @@ namespace osu.Game.Screens.Select.Leaderboards Radius = 1, Colour = Color4.Black.Opacity(0.2f), }, - }, - 500) + }, 500) { RelativeSizeAxes = Axes.None, Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 1700046653..895407064c 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -45,8 +45,7 @@ namespace osu.Game.Users { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(200), - }, - 500) + }, 500) ); } } From 2ff21bbc6c1caabf2e0e6ad95375d2586fc5ed05 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 17:29:20 +0900 Subject: [PATCH 180/282] Move descriptions to constructor --- .../Profile/Sections/Kudosu/KudosuInfo.cs | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 1982059065..975a09fe18 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -23,8 +23,8 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu { this.user.BindTo(user); - SubSection total; - SubSection avaliable; + CountSection total; + CountSection avaliable; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; @@ -44,20 +44,20 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.2f) }, - total = new SubSection("Total Kudosu Earned"), - avaliable = new SubSection("Kudosu Avaliable") + total = new CountSection( + "Total Kudosu Earned", + "Based on how much of a contribution the user has made to beatmap moderation. See this link for more information." + ), + avaliable = new CountSection( + "Kudosu Avaliable", + "Kudosu can be traded for kudosu stars, which will help your beatmap get more attention. This is the number of kudosu you haven't traded in yet." + ) { RelativePositionAxes = Axes.X, X = 0.5f, }, }; - total.TextFlow.Text = "Based on how much of a contribution the user has made to " + - "beatmap moderation. See this link for more information."; - - avaliable.TextFlow.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get " + - "more attention. This is the number of kudosu you haven't traded in yet."; - this.user.ValueChanged += newUser => { total.KudosuValue = newUser?.Kudosu.Total ?? 0; @@ -67,7 +67,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu protected override bool OnClick(InputState state) => true; - private class SubSection : Container + private class CountSection : Container { public readonly TextFlowContainer TextFlow; @@ -87,7 +87,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu } } - public SubSection(string header) + public CountSection(string header, string description) { RelativeSizeAxes = Axes.X; Width = 0.5f; @@ -131,6 +131,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, + Text = description } } }; From 6d9951d9afdc664dab13bc348296d62aa271b740 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 17:31:43 +0900 Subject: [PATCH 181/282] Use FillFlow rather than manually specifying positions --- .../Profile/Sections/Kudosu/KudosuInfo.cs | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 975a09fe18..2639bd7686 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -44,18 +44,22 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.2f) }, - total = new CountSection( - "Total Kudosu Earned", - "Based on how much of a contribution the user has made to beatmap moderation. See this link for more information." - ), - avaliable = new CountSection( - "Kudosu Avaliable", - "Kudosu can be traded for kudosu stars, which will help your beatmap get more attention. This is the number of kudosu you haven't traded in yet." - ) + new FillFlowContainer { - RelativePositionAxes = Axes.X, - X = 0.5f, - }, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new[] + { + total = new CountSection( + "Total Kudosu Earned", + "Based on how much of a contribution the user has made to beatmap moderation. See this link for more information." + ), + avaliable = new CountSection( + "Kudosu Avaliable", + "Kudosu can be traded for kudosu stars, which will help your beatmap get more attention. This is the number of kudosu you haven't traded in yet." + ), + } + } }; this.user.ValueChanged += newUser => From cf4fc05be3567c9233a78735986b02ad6be3aa86 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 17:33:46 +0900 Subject: [PATCH 182/282] Fix nullref on disposing BeatmapSetOverlay before load Only affects VisualTests --- osu.Game/Overlays/BeatmapSet/Header.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 27ef6208be..b02df76996 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -232,7 +232,7 @@ namespace osu.Game.Overlays.BeatmapSet protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); - beatmaps.BeatmapSetAdded -= handleBeatmapAdd; + if (beatmaps != null) beatmaps.BeatmapSetAdded -= handleBeatmapAdd; } private void handleBeatmapAdd(BeatmapSetInfo beatmap) From 30db2ce18a1f96a728d1591eaf5ef980ae9477e8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 17:37:02 +0900 Subject: [PATCH 183/282] Rename KudosuValue to count and remove pointless local storage --- .../Profile/Sections/Kudosu/KudosuInfo.cs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 2639bd7686..4520abdd6d 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -64,8 +64,8 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu this.user.ValueChanged += newUser => { - total.KudosuValue = newUser?.Kudosu.Total ?? 0; - avaliable.KudosuValue = newUser?.Kudosu.Available ?? 0; + total.Count = newUser?.Kudosu.Total ?? 0; + avaliable.Count = newUser?.Kudosu.Available ?? 0; }; } @@ -77,18 +77,9 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu private readonly OsuSpriteText valueText; - private int kudosuValue; - public int KudosuValue + public int Count { - get { return kudosuValue; } - set - { - if (kudosuValue == value) - return; - kudosuValue = value; - - valueText.Text = kudosuValue.ToString(); - } + set { valueText.Text = value.ToString(); } } public CountSection(string header, string description) From d93911ae9745ac56692e90f6ad9c63f6c7b907f3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 18:09:42 +0900 Subject: [PATCH 184/282] Improve user ratings calculations to make more sense Closes #1552. --- osu.Game/Beatmaps/BeatmapMetrics.cs | 2 +- osu.Game/Graphics/UserInterface/Bar.cs | 3 ++- osu.Game/Screens/Select/Details/UserRatings.cs | 16 +++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapMetrics.cs b/osu.Game/Beatmaps/BeatmapMetrics.cs index 730cf635da..e0cd5f10e7 100644 --- a/osu.Game/Beatmaps/BeatmapMetrics.cs +++ b/osu.Game/Beatmaps/BeatmapMetrics.cs @@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps public class BeatmapMetrics { /// - /// Total vote counts of user ratings on a scale of 0..length. + /// Total vote counts of user ratings on a scale of 0..10 where 0 is unused (probably will be fixed at API?). /// public IEnumerable Ratings { get; set; } diff --git a/osu.Game/Graphics/UserInterface/Bar.cs b/osu.Game/Graphics/UserInterface/Bar.cs index 20df553142..c25a9bf5e9 100644 --- a/osu.Game/Graphics/UserInterface/Bar.cs +++ b/osu.Game/Graphics/UserInterface/Bar.cs @@ -20,6 +20,7 @@ namespace osu.Game.Graphics.UserInterface private const Easing easing = Easing.InOutCubic; private float length; + /// /// Length of the bar, ranges from 0 to 1 /// @@ -134,4 +135,4 @@ namespace osu.Game.Graphics.UserInterface Vertical = TopToBottom | BottomToTop, Horizontal = LeftToRight | RightToLeft, } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Select/Details/UserRatings.cs b/osu.Game/Screens/Select/Details/UserRatings.cs index 2153eb150c..0741407049 100644 --- a/osu.Game/Screens/Select/Details/UserRatings.cs +++ b/osu.Game/Screens/Select/Details/UserRatings.cs @@ -29,11 +29,17 @@ namespace osu.Game.Screens.Select.Details if (value == metrics) return; metrics = value; - var ratings = Metrics.Ratings.ToList(); - negativeRatings.Text = ratings.GetRange(0, ratings.Count / 2 + 1).Sum().ToString(); - positiveRatings.Text = ratings.GetRange(ratings.Count / 2 + 1, ratings.Count / 2).Sum().ToString(); - ratingsBar.Length = (float)ratings.GetRange(0, ratings.Count / 2 + 1).Sum() / ratings.Sum(); - graph.Values = Metrics.Ratings.Select(r => (float)r); + const int rating_range = 10; + + var ratings = Metrics.Ratings.ToList().GetRange(1, rating_range); // adjust for API returning weird empty data at 0. + + var negativeCount = ratings.GetRange(0, rating_range / 2).Sum(); + var totalCount = ratings.Sum(); + + negativeRatings.Text = negativeCount.ToString(); + positiveRatings.Text = (totalCount - negativeCount).ToString(); + ratingsBar.Length = (float)negativeCount / totalCount; + graph.Values = ratings.GetRange(0, rating_range).Select(r => (float)r); } } From 38f5c55f80d18239ba80dca2dd558b78dcb00d61 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 18:11:35 +0900 Subject: [PATCH 185/282] Remove not-accessed field --- osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 4520abdd6d..8a835634b8 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -73,8 +73,6 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu private class CountSection : Container { - public readonly TextFlowContainer TextFlow; - private readonly OsuSpriteText valueText; public int Count @@ -122,7 +120,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu } } }, - TextFlow = new TextFlowContainer(t => { t.TextSize = 19; }) + new TextFlowContainer(t => { t.TextSize = 19; }) { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, From 52c971cd75abacac52ef2b153b948ece5bc336f0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 18:58:25 +0900 Subject: [PATCH 186/282] Fix using incorrect Description attribute --- osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs index 215d1ee5b1..1a64994d0e 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs @@ -9,7 +9,7 @@ using OpenTK; namespace osu.Game.Tests.Visual { [TestFixture] - [Description("PlaySongSelect leaderboard/details area")] + [System.ComponentModel.Description("PlaySongSelect leaderboard/details area")] internal class TestCaseBeatmapDetailArea : OsuTestCase { public TestCaseBeatmapDetailArea() From 6d88396139f3f88695f1aa877f2b844954a89917 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 20:22:15 +0900 Subject: [PATCH 187/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index eea84aaefc..d87dab204b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit eea84aaefcc7a1a6732d105ba319272dd9744901 +Subproject commit d87dab204b3df50f62e6070b1970c135ea647d78 From 9db6ef6657c70d8f49809c6f04a1fba23b3988df Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 20:23:47 +0900 Subject: [PATCH 188/282] Fix unfixed regressions --- osu.Game/Overlays/Direct/PlayButton.cs | 2 +- osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 8 ++++---- osu.Game/Users/UpdateableAvatar.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index 7fff2821e3..75a3358d51 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -152,7 +152,7 @@ namespace osu.Game.Overlays.Direct // We may have been replaced by another loader if (trackLoader != d) return; - Preview = (d as TrackLoader)?.Preview; + Preview = d?.Preview; Playing.TriggerChange(); loading = false; Add(trackLoader); diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 0d898ad7d2..03466439ad 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Select.Leaderboards private Box background; private Container content; - private Container avatar; + private Drawable avatar; private DrawableRank scoreRank; private OsuSpriteText nameLabel; private GlowingSpriteText scoreLabel; @@ -97,7 +97,7 @@ namespace osu.Game.Screens.Select.Leaderboards { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(edge_margin), - Children = new Drawable[] + Children = new[] { avatar = new DelayedLoadWrapper( new Avatar(Score.User) @@ -112,7 +112,7 @@ namespace osu.Game.Screens.Select.Leaderboards Radius = 1, Colour = Color4.Black.Opacity(0.2f), }, - }, 500) + }) { RelativeSizeAxes = Axes.None, Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), @@ -210,7 +210,7 @@ namespace osu.Game.Screens.Select.Leaderboards public override void Show() { - foreach (var d in new Drawable[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer }) + foreach (var d in new[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer }) d.FadeOut(); Alpha = 0; diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 895407064c..d55c0caad7 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -11,7 +11,7 @@ namespace osu.Game.Users /// public class UpdateableAvatar : Container { - private Container displayedAvatar; + private Drawable displayedAvatar; private User user; @@ -45,7 +45,7 @@ namespace osu.Game.Users { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(200), - }, 500) + }) ); } } From a60e53c3828c6077e0803b93d0223ccda39e21ad Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 23 Nov 2017 12:31:18 +0100 Subject: [PATCH 189/282] Changed the text updates into a scheduled (async) operation, and implemented this in the updateStatistics and clearStats methods --- osu.Game/Screens/Select/BeatmapDetails.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index d7c509d979..6eaed67534 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.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 System; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; @@ -187,9 +188,7 @@ namespace osu.Game.Screens.Select ratingsContainer.FadeIn(transition_duration); advanced.Beatmap = Beatmap; - description.Text = Beatmap.Version; - source.Text = Beatmap.Metadata.Source; - tags.Text = Beatmap.Metadata.Tags; + loadDetailsAsync(Beatmap); var requestedBeatmap = Beatmap; if (requestedBeatmap.Metrics == null) @@ -213,6 +212,19 @@ namespace osu.Game.Screens.Select displayMetrics(requestedBeatmap.Metrics, false); } + private void loadDetailsAsync(BeatmapInfo beatmap) + { + if (description == null || source == null || tags == null) + throw new InvalidOperationException($@"Requires all {nameof(MetadataSection)} elements to be non-null."); + + Schedule(() => + { + description.Text = Beatmap?.Version; + source.Text = Beatmap?.Metadata?.Source; + tags.Text = Beatmap?.Metadata?.Tags; + }); + } + private void displayMetrics(BeatmapMetrics metrics, bool failOnMissing = true) { var hasRatings = metrics?.Ratings?.Any() ?? false; @@ -258,9 +270,7 @@ namespace osu.Game.Screens.Select private void clearStats() { - description.Text = null; - source.Text = null; - tags.Text = null; + loadDetailsAsync(null); advanced.Beatmap = new BeatmapInfo { StarDifficulty = 0, From 9565a9c352524645895c66771af64086c9d53951 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 20:42:07 +0900 Subject: [PATCH 190/282] Fix TestCasePlayer not working as expected --- osu.Game/Screens/Play/Player.cs | 6 ++- osu.Game/Tests/Visual/ScreenTestCase.cs | 52 +++++++++++++++++++++++++ osu.Game/Tests/Visual/TestCasePlayer.cs | 17 ++++---- osu.Game/osu.Game.csproj | 1 + 4 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 osu.Game/Tests/Visual/ScreenTestCase.cs diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 1e1b7bac93..a19305778c 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -46,6 +46,8 @@ namespace osu.Game.Screens.Play public bool HasFailed { get; private set; } + public bool AllowPause { get; set; } = true; + public int RestartCount; private IAdjustableClock adjustableSourceClock; @@ -158,7 +160,7 @@ namespace osu.Game.Screens.Play FramedClock = offsetClock, OnRetry = Restart, OnQuit = Exit, - CheckCanPause = () => ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded, + CheckCanPause = () => AllowPause && ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded, Retries = RestartCount, OnPause = () => { hudOverlay.KeyCounter.IsCounting = pauseContainer.IsPaused; @@ -355,7 +357,7 @@ namespace osu.Game.Screens.Play protected override bool OnExiting(Screen next) { - if (HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false) + if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false) { // In the case of replays, we may have changed the playback rate. applyRateFromMods(); diff --git a/osu.Game/Tests/Visual/ScreenTestCase.cs b/osu.Game/Tests/Visual/ScreenTestCase.cs new file mode 100644 index 0000000000..11ff97cbf8 --- /dev/null +++ b/osu.Game/Tests/Visual/ScreenTestCase.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Screens; +using osu.Game.Screens; + +namespace osu.Game.Tests.Visual +{ + /// + /// A test case which can be used to test a screen (that relies on OnEntering being called to execute startup instructions). + /// + public abstract class ScreenTestCase : OsuTestCase + { + private readonly TestOsuScreen baseScreen; + + protected ScreenTestCase() + { + Add(baseScreen = new TestOsuScreen()); + } + + protected void LoadScreen(OsuScreen screen) => baseScreen.LoadScreen(screen); + + public class TestOsuScreen : OsuScreen + { + public TestOsuScreen() + { + } + + private OsuScreen nextScreen; + + public void LoadScreen(OsuScreen screen) => Schedule(() => + { + nextScreen = screen; + + if (IsCurrentScreen) + { + Push(screen); + nextScreen = null; + } + else + MakeCurrent(); + }); + + protected override void OnResuming(Screen last) + { + base.OnResuming(last); + if (nextScreen != null) + LoadScreen(nextScreen); + } + } + } +} diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs index cef85b65f1..f3a6d1efc3 100644 --- a/osu.Game/Tests/Visual/TestCasePlayer.cs +++ b/osu.Game/Tests/Visual/TestCasePlayer.cs @@ -17,7 +17,7 @@ using OpenTK.Graphics; namespace osu.Game.Tests.Visual { - public abstract class TestCasePlayer : OsuTestCase + public abstract class TestCasePlayer : ScreenTestCase { private readonly Type ruleset; @@ -44,6 +44,7 @@ namespace osu.Game.Tests.Visual { RelativeSizeAxes = Framework.Graphics.Axes.Both, Colour = Color4.Black, + Depth = int.MaxValue }); string instantiation = ruleset?.AssemblyQualifiedName; @@ -77,19 +78,17 @@ namespace osu.Game.Tests.Visual if (Player != null) Remove(Player); - Add(Player = CreatePlayer(working, instance)); + LoadScreen(CreatePlayer(working, instance)); } - protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) + protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) => new Player { - return new Player - { - InitialBeatmap = beatmap - }; - } + InitialBeatmap = beatmap, + AllowPause = false + }; private const string test_beatmap_data = -@"osu file format v14 + @"osu file format v14 [General] AudioLeadIn: 500 diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 87c8275512..2aefde2916 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -784,6 +784,7 @@ + From 4e96c5aea25a91f72154322fcffefcb67d7658fc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 19:27:25 +0900 Subject: [PATCH 191/282] Fix TestCaseButtonSystem not working Was missing an osu! logo --- osu.Game.Tests/Visual/TestCaseButtonSystem.cs | 33 +++++++++++++++++++ .../Visual/TestCaseMenuButtonSystem.cs | 25 -------------- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- 3 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 osu.Game.Tests/Visual/TestCaseButtonSystem.cs delete mode 100644 osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs diff --git a/osu.Game.Tests/Visual/TestCaseButtonSystem.cs b/osu.Game.Tests/Visual/TestCaseButtonSystem.cs new file mode 100644 index 0000000000..d260de69f1 --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseButtonSystem.cs @@ -0,0 +1,33 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.Shapes; +using osu.Game.Screens.Menu; +using OpenTK.Graphics; + +namespace osu.Game.Tests.Visual +{ + internal class TestCaseButtonSystem : OsuTestCase + { + public TestCaseButtonSystem() + { + OsuLogo logo; + ButtonSystem buttons; + + Children = new Drawable[] + { + new Box + { + Colour = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke), + RelativeSizeAxes = Axes.Both, + }, + buttons = new ButtonSystem(), + logo = new OsuLogo() + }; + + buttons.SetOsuLogo(logo); + } + } +} diff --git a/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs b/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs deleted file mode 100644 index b5310f0fb0..0000000000 --- a/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.ComponentModel; -using osu.Framework.Graphics.Colour; -using osu.Framework.Graphics.Shapes; -using osu.Game.Screens.Menu; -using OpenTK.Graphics; - -namespace osu.Game.Tests.Visual -{ - [Description("main menu")] - internal class TestCaseMenuButtonSystem : OsuTestCase - { - public TestCaseMenuButtonSystem() - { - Add(new Box - { - Colour = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke), - RelativeSizeAxes = Framework.Graphics.Axes.Both, - }); - Add(new ButtonSystem()); - } - } -} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 9bba09b1a7..312a564f71 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -116,7 +116,7 @@ - + From dbb03bcff28ead54b2d0239b2847aba012c5a411 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 23:30:57 +0900 Subject: [PATCH 192/282] Handle the case where a map hasn't been rated yet --- osu.Game/Screens/Select/Details/UserRatings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Details/UserRatings.cs b/osu.Game/Screens/Select/Details/UserRatings.cs index 0741407049..997e0baec3 100644 --- a/osu.Game/Screens/Select/Details/UserRatings.cs +++ b/osu.Game/Screens/Select/Details/UserRatings.cs @@ -38,7 +38,7 @@ namespace osu.Game.Screens.Select.Details negativeRatings.Text = negativeCount.ToString(); positiveRatings.Text = (totalCount - negativeCount).ToString(); - ratingsBar.Length = (float)negativeCount / totalCount; + ratingsBar.Length = totalCount == 0 ? 0 : (float)negativeCount / totalCount; graph.Values = ratings.GetRange(0, rating_range).Select(r => (float)r); } } From 95fbe6a4a2852e162f0fd1173f3603ea79c652a3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 23:42:43 +0900 Subject: [PATCH 193/282] Update framework --- osu-framework | 2 +- osu.Game/Tests/Visual/ScreenTestCase.cs | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/osu-framework b/osu-framework index d87dab204b..fe49ccb3c8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit d87dab204b3df50f62e6070b1970c135ea647d78 +Subproject commit fe49ccb3c8f8661d653752d225ae1dc183944bb4 diff --git a/osu.Game/Tests/Visual/ScreenTestCase.cs b/osu.Game/Tests/Visual/ScreenTestCase.cs index 11ff97cbf8..2f0831d84a 100644 --- a/osu.Game/Tests/Visual/ScreenTestCase.cs +++ b/osu.Game/Tests/Visual/ScreenTestCase.cs @@ -22,10 +22,6 @@ namespace osu.Game.Tests.Visual public class TestOsuScreen : OsuScreen { - public TestOsuScreen() - { - } - private OsuScreen nextScreen; public void LoadScreen(OsuScreen screen) => Schedule(() => From 11d406aa0c2d3acaf6137538af20f9de85d41639 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 24 Nov 2017 11:49:10 +0900 Subject: [PATCH 194/282] Fix osu!catch conversion expecting full positional data, rather than just X. Closes #1367. --- osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs index 0e4935aa7a..7126b6586d 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps protected override IEnumerable ConvertHitObject(HitObject obj, Beatmap beatmap) { var curveData = obj as IHasCurve; - var positionData = obj as IHasPosition; + var positionData = obj as IHasXPosition; var comboData = obj as IHasCombo; if (positionData == null) From 7ff39d62a1e52170c43026bd98cc94554878493d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 24 Nov 2017 12:46:15 +0900 Subject: [PATCH 195/282] Fix SpriteIcon potentially not updating texture during a load race condition Better fix for #1577. --- osu.Game/Graphics/SpriteIcon.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/SpriteIcon.cs b/osu.Game/Graphics/SpriteIcon.cs index ca108bfa7a..e752b1d91a 100644 --- a/osu.Game/Graphics/SpriteIcon.cs +++ b/osu.Game/Graphics/SpriteIcon.cs @@ -57,19 +57,31 @@ namespace osu.Game.Graphics private void load(FontStore store) { this.store = store; - updateTexture(); } + protected override void LoadComplete() + { + base.LoadComplete(); + updateTexture(); + } + + private FontAwesome loadedIcon; private void updateTexture() { - var texture = store?.Get(((char)icon).ToString()); + var loadableIcon = icon; + + if (loadableIcon == loadedIcon) return; + + var texture = store?.Get(((char)loadableIcon).ToString()); spriteMain.Texture = texture; spriteShadow.Texture = texture; if (Size == Vector2.Zero) Size = new Vector2(texture?.DisplayWidth ?? 0, texture?.DisplayHeight ?? 0); + + loadedIcon = loadableIcon; } public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) From a4b67b2559741f61b57859304ffff02372843c66 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Fri, 24 Nov 2017 12:56:52 +0900 Subject: [PATCH 196/282] Fix CI --- osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index 394036df39..e74c12fa5d 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -5,7 +5,6 @@ using osu.Game.Beatmaps; using osu.Game.Rulesets.Taiko.Beatmaps; using osu.Game.Rulesets.Taiko.Objects; using System.Collections.Generic; -using System.Globalization; using System; namespace osu.Game.Rulesets.Taiko @@ -54,7 +53,7 @@ namespace osu.Game.Rulesets.Taiko if (categoryDifficulty != null) { categoryDifficulty.Add("Strain", starRating); - categoryDifficulty.Add("Hit window 300", (35 /*HitObjectManager.HitWindow300*/ / TimeRate)); + categoryDifficulty.Add("Hit window 300", 35 /*HitObjectManager.HitWindow300*/ / TimeRate); } return starRating; From 09facdc83810ecd90275a8a46b6582576b2e7b7e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 24 Nov 2017 18:34:20 +0900 Subject: [PATCH 197/282] Add a setting to toggle showing converted beatmaps --- osu.Game/Configuration/OsuConfigManager.cs | 4 +++- .../Sections/Gameplay/SongSelectSettings.cs | 7 ++++++- osu.Game/Screens/Select/FilterControl.cs | 15 ++++++++++++--- osu.Game/Screens/Select/FilterCriteria.cs | 3 ++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index b3e99fce06..c087a5afb7 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -16,6 +16,7 @@ namespace osu.Game.Configuration Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); + Set(OsuSetting.ShowConvertedBeatmaps, true); Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1); Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10, 0.1); @@ -112,6 +113,7 @@ namespace osu.Game.Configuration SnakingOutSliders, ShowFpsDisplay, ChatDisplayHeight, - Version + Version, + ShowConvertedBeatmaps } } diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs index 07a8e7464a..9875ee8004 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs @@ -17,6 +17,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay { Children = new Drawable[] { + new SettingsCheckbox + { + LabelText = "Show converted beatmaps", + Bindable = config.GetBindable(OsuSetting.ShowConvertedBeatmaps), + }, new SettingsSlider { LabelText = "Display beatmaps from", @@ -33,7 +38,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay { LabelText = "Random beatmap selection", Bindable = config.GetBindable(OsuSetting.SelectionRandomType), - }, + } }; } diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index e83613125b..1b86cec613 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -15,6 +15,7 @@ using osu.Game.Screens.Select.Filter; using Container = osu.Framework.Graphics.Containers.Container; using osu.Framework.Input; using osu.Framework.Graphics.Shapes; +using osu.Game.Configuration; using osu.Game.Rulesets; namespace osu.Game.Screens.Select @@ -60,6 +61,7 @@ namespace osu.Game.Screens.Select Group = group, Sort = sort, SearchText = searchTextBox.Text, + AllowConvertedBeatmaps = showConverted, Ruleset = ruleset }; @@ -163,17 +165,24 @@ namespace osu.Game.Screens.Select private readonly Bindable ruleset = new Bindable(); + private Bindable showConverted; + [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuColour colours, OsuGame osu) + private void load(OsuColour colours, OsuGame osu, OsuConfigManager config) { sortTabs.AccentColour = colours.GreenLight; + showConverted = config.GetBindable(OsuSetting.ShowConvertedBeatmaps); + showConverted.ValueChanged += val => updateCriteria(); + if (osu != null) ruleset.BindTo(osu.Ruleset); - ruleset.ValueChanged += val => FilterChanged?.Invoke(CreateCriteria()); + ruleset.ValueChanged += val => updateCriteria(); ruleset.TriggerChange(); } + private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria()); + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; protected override bool OnMouseMove(InputState state) => true; @@ -182,4 +191,4 @@ namespace osu.Game.Screens.Select protected override bool OnDragStart(InputState state) => true; } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Select/FilterCriteria.cs b/osu.Game/Screens/Select/FilterCriteria.cs index 6c1fb1703d..c1355bfa63 100644 --- a/osu.Game/Screens/Select/FilterCriteria.cs +++ b/osu.Game/Screens/Select/FilterCriteria.cs @@ -16,6 +16,7 @@ namespace osu.Game.Screens.Select public SortMode Sort; public string SearchText; public RulesetInfo Ruleset; + public bool AllowConvertedBeatmaps; public void Filter(List groups) { @@ -23,7 +24,7 @@ namespace osu.Game.Screens.Select { var set = g.BeatmapSet; - bool hasCurrentMode = set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0)); + bool hasCurrentMode = AllowConvertedBeatmaps || set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0)); bool match = hasCurrentMode; From d955229ee5cff6ce146e1ce2184e90ea429fb602 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Sat, 25 Nov 2017 21:29:23 +0800 Subject: [PATCH 198/282] Handle user rating metrics when no maps by using more linq. --- osu.Game/Screens/Select/Details/UserRatings.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/Details/UserRatings.cs b/osu.Game/Screens/Select/Details/UserRatings.cs index 997e0baec3..19bcad367e 100644 --- a/osu.Game/Screens/Select/Details/UserRatings.cs +++ b/osu.Game/Screens/Select/Details/UserRatings.cs @@ -31,15 +31,15 @@ namespace osu.Game.Screens.Select.Details const int rating_range = 10; - var ratings = Metrics.Ratings.ToList().GetRange(1, rating_range); // adjust for API returning weird empty data at 0. + var ratings = Metrics.Ratings.Skip(1).Take(rating_range); // adjust for API returning weird empty data at 0. - var negativeCount = ratings.GetRange(0, rating_range / 2).Sum(); + var negativeCount = ratings.Take(rating_range / 2).Sum(); var totalCount = ratings.Sum(); negativeRatings.Text = negativeCount.ToString(); positiveRatings.Text = (totalCount - negativeCount).ToString(); ratingsBar.Length = totalCount == 0 ? 0 : (float)negativeCount / totalCount; - graph.Values = ratings.GetRange(0, rating_range).Select(r => (float)r); + graph.Values = ratings.Take(rating_range).Select(r => (float)r); } } From f6a33b3ea2c4a78c899303ef51911bf507937090 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 25 Nov 2017 14:45:57 +0100 Subject: [PATCH 199/282] fix osu!direct download reloading all panels This fixes the recreation of all panels when a download completes. Also fixes NullReference when you download without ever opening the details of one Set. --- osu.Game/Overlays/BeatmapSet/Header.cs | 2 +- osu.Game/Overlays/DirectOverlay.cs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index af59b21713..4135aef268 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -234,7 +234,7 @@ namespace osu.Game.Overlays.BeatmapSet private void handleBeatmapAdd(BeatmapSetInfo beatmap) { - if (beatmap.OnlineBeatmapSetID == BeatmapSet.OnlineBeatmapSetID) + if (beatmap.OnlineBeatmapSetID == BeatmapSet?.OnlineBeatmapSetID) downloadButtonsContainer.FadeOut(transition_duration); } diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index 6f7fabb910..11dd9dd976 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -65,8 +65,6 @@ namespace osu.Game.Overlays } ResultAmounts = new ResultCounts(distinctCount(artists), distinctCount(songs), distinctCount(tags)); - - recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); } } @@ -282,7 +280,11 @@ namespace osu.Game.Overlays var sets = response.Select(r => r.ToBeatmapSet(rulesets)).Where(b => !presentOnlineIds.Contains(b.OnlineBeatmapSetID)).ToList(); // may not need scheduling; loads async internally. - Schedule(() => BeatmapSets = sets); + Schedule(() => + { + BeatmapSets = sets; + recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); + }); }); }; From 7be55df7904df2c8d75367577afa6e34f7cf76d9 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 25 Nov 2017 19:09:05 +0100 Subject: [PATCH 200/282] fix being stuck in gameplay if exit is pressed too fast The reliance on `pauseOverlay.Alpha == 1` created a race condition that, when you pressed Exit while the pauseoverlay is still fading in, could get you stuck in gameplay. The game wants to show the pause overlay but also thinks it's already paused and returns early. --- osu.Game/Screens/Play/PauseContainer.cs | 2 -- osu.Game/Screens/Play/Player.cs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/PauseContainer.cs b/osu.Game/Screens/Play/PauseContainer.cs index eed5cd1c20..5f5eeb63a0 100644 --- a/osu.Game/Screens/Play/PauseContainer.cs +++ b/osu.Game/Screens/Play/PauseContainer.cs @@ -22,8 +22,6 @@ namespace osu.Game.Screens.Play { public bool IsPaused { get; private set; } - public bool AllowExit => IsPaused && pauseOverlay.Alpha == 1; - public Func CheckCanPause; private const double pause_cooldown = 1000; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a19305778c..55eee5ce7d 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -357,7 +357,7 @@ namespace osu.Game.Screens.Play protected override bool OnExiting(Screen next) { - if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false) + if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.IsPaused != false || RulesetContainer?.HasReplayLoaded != false) { // In the case of replays, we may have changed the playback rate. applyRateFromMods(); From 69e388dd52a5ab0d25ce62b7397caf14811c51bf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 05:08:20 +0900 Subject: [PATCH 201/282] Adjust background blur rate --- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a19305778c..e27b76e458 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -310,7 +310,7 @@ namespace osu.Game.Screens.Play if (!loadedSuccessfully) return; - (Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1500, Easing.OutQuint); + (Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1000, Easing.OutQuint); dimLevel.ValueChanged += dimLevel_ValueChanged; showStoryboard.ValueChanged += showStoryboard_ValueChanged; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 24a7b3db90..68437180ac 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -413,7 +413,7 @@ namespace osu.Game.Screens.Select if (backgroundModeBeatmap != null) { backgroundModeBeatmap.Beatmap = beatmap; - backgroundModeBeatmap.BlurTo(background_blur, 1000); + backgroundModeBeatmap.BlurTo(background_blur, 750, Easing.OutQuint); backgroundModeBeatmap.FadeTo(1, 250); } From df16a019ed13e07e1de9ed0c480be55a90717e8b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 17:07:35 +0900 Subject: [PATCH 202/282] Add a global reduction of audio track volume Music is overpowering compared to our current game samples. We will need to do further adjustments on this, but for now let's reduce the track volume globally. --- osu.Game/OsuGameBase.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 50639e3427..8eaa20f781 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -5,6 +5,7 @@ using System; using System.Diagnostics; using System.Reflection; using osu.Framework.Allocation; +using osu.Framework.Audio; using osu.Framework.Configuration; using osu.Framework.Development; using osu.Framework.Graphics; @@ -137,6 +138,10 @@ namespace osu.Game Beatmap = new NonNullableBindable(defaultBeatmap); BeatmapManager.DefaultBeatmap = defaultBeatmap; + // tracks play so loud our samples can't keep up. + // this adds a global reduction of track volume for the time being. + Audio.Track.AddAdjustment(AdjustableProperty.Volume, new BindableDouble(0.8)); + Beatmap.ValueChanged += b => { var trackLoaded = lastBeatmap?.TrackLoaded ?? false; From 7cdb8305304969e7d1ae741400428e71c24a5b8f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 25 Nov 2017 23:05:28 +0900 Subject: [PATCH 203/282] Fix broken app.config default --- osu.Desktop.Deploy/App.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop.Deploy/App.config b/osu.Desktop.Deploy/App.config index 2fae7a5e1c..2fbea810f6 100644 --- a/osu.Desktop.Deploy/App.config +++ b/osu.Desktop.Deploy/App.config @@ -13,7 +13,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - + From 22075ac7c9cf2b1f46f133a983eaf5a4bde06d72 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 25 Nov 2017 23:05:46 +0900 Subject: [PATCH 204/282] Ensure deploy script can work without a github token --- osu.Desktop.Deploy/Program.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index 54fb50d0f8..e90fb1e567 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -145,6 +145,8 @@ namespace osu.Desktop.Deploy /// private static void checkReleaseFiles() { + if (!canGitHub) return; + var releaseLines = getReleaseLines(); //ensure we have all files necessary @@ -157,6 +159,8 @@ namespace osu.Desktop.Deploy private static void pruneReleases() { + if (!canGitHub) return; + write("Pruning RELEASES..."); var releaseLines = getReleaseLines().ToList(); @@ -190,7 +194,7 @@ namespace osu.Desktop.Deploy private static void uploadBuild(string version) { - if (string.IsNullOrEmpty(GitHubAccessToken) || string.IsNullOrEmpty(codeSigningCertPath)) + if (!canGitHub || string.IsNullOrEmpty(CodeSigningCertificate)) return; write("Publishing to GitHub..."); @@ -228,8 +232,12 @@ namespace osu.Desktop.Deploy private static void openGitHubReleasePage() => Process.Start(GitHubReleasePage); + private static bool canGitHub => !string.IsNullOrEmpty(GitHubAccessToken); + private static void checkGitHubReleases() { + if (!canGitHub) return; + write("Checking GitHub releases..."); var req = new JsonWebRequest>($"{GitHubApiEndpoint}"); req.AuthenticatedBlockingPerform(); From 4067b6129b8e8b557e478a8a20f280f63299e1c8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 04:16:36 +0900 Subject: [PATCH 205/282] Add visual highlighting on song select panel hover Prerequisite for adding hover sound effects. Didn't feel right without this change. --- osu.Game/Beatmaps/Drawables/Panel.cs | 52 ++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/Panel.cs b/osu.Game/Beatmaps/Drawables/Panel.cs index d6ed306b39..5fbc858b00 100644 --- a/osu.Game/Beatmaps/Drawables/Panel.cs +++ b/osu.Game/Beatmaps/Drawables/Panel.cs @@ -3,12 +3,15 @@ using System; using osu.Framework; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; using OpenTK; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; namespace osu.Game.Beatmaps.Drawables { @@ -22,6 +25,10 @@ namespace osu.Game.Beatmaps.Drawables private readonly Container nestedContainer; + private readonly Container borderContainer; + + private readonly Box hoverLayer; + protected override Container Content => nestedContainer; protected Panel() @@ -29,20 +36,53 @@ namespace osu.Game.Beatmaps.Drawables Height = MAX_HEIGHT; RelativeSizeAxes = Axes.X; - AddInternal(nestedContainer = new Container + AddInternal(borderContainer = new Container { RelativeSizeAxes = Axes.Both, Masking = true, CornerRadius = 10, BorderColour = new Color4(221, 255, 255, 255), + Children = new Drawable[] + { + nestedContainer = new Container + { + RelativeSizeAxes = Axes.Both, + }, + hoverLayer = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + Blending = new BlendingParameters { Mode = BlendingMode.Additive }, + }, + } }); Alpha = 0; } + + protected override bool OnHover(InputState state) + { + hoverLayer.FadeIn(100, Easing.OutQuint); + + return base.OnHover(state); + } + + protected override void OnHoverLost(InputState state) + { + hoverLayer.FadeOut(1000, Easing.OutQuint); + base.OnHoverLost(state); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + hoverLayer.Colour = colours.Blue.Opacity(0.1f); + } + public void SetMultiplicativeAlpha(float alpha) { - nestedContainer.Alpha = alpha; + borderContainer.Alpha = alpha; } protected override void LoadComplete() @@ -94,8 +134,8 @@ namespace osu.Game.Beatmaps.Drawables protected virtual void Selected() { - nestedContainer.BorderThickness = 2.5f; - nestedContainer.EdgeEffect = new EdgeEffectParameters + borderContainer.BorderThickness = 2.5f; + borderContainer.EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow, Colour = new Color4(130, 204, 255, 150), @@ -106,8 +146,8 @@ namespace osu.Game.Beatmaps.Drawables protected virtual void Deselected() { - nestedContainer.BorderThickness = 0; - nestedContainer.EdgeEffect = new EdgeEffectParameters + borderContainer.BorderThickness = 0; + borderContainer.EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Offset = new Vector2(1), From 07d6a700286e489685cbe389993d237309dfbfe1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 25 Nov 2017 23:11:18 +0900 Subject: [PATCH 206/282] New sound effects with better names --- .../Graphics/Containers/OsuClickableContainer.cs | 2 +- .../Containers/OsuFocusedOverlayContainer.cs | 4 ++-- osu.Game/Graphics/UserInterface/OsuButton.cs | 2 +- osu.Game/Graphics/UserInterface/OsuMenu.cs | 2 +- osu.Game/Screens/Menu/Button.cs | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 14 +++++++------- osu.Game/Screens/Menu/OsuLogo.cs | 4 ++-- osu.Game/Screens/OsuScreen.cs | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuClickableContainer.cs b/osu.Game/Graphics/Containers/OsuClickableContainer.cs index 11c049ed3e..ce3780cf78 100644 --- a/osu.Game/Graphics/Containers/OsuClickableContainer.cs +++ b/osu.Game/Graphics/Containers/OsuClickableContainer.cs @@ -17,7 +17,7 @@ namespace osu.Game.Graphics.Containers private void load(AudioManager audio) { SampleHover = audio.Sample.Get(@"UI/generic-hover"); - SampleClick = audio.Sample.Get(@"UI/generic-click"); + SampleClick = audio.Sample.Get(@"UI/generic-select"); } protected override bool OnHover(InputState state) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index 4ea4f4cdc3..c788df3066 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -16,8 +16,8 @@ namespace osu.Game.Graphics.Containers [BackgroundDependencyLoader] private void load(AudioManager audio) { - samplePopIn = audio.Sample.Get(@"UI/melodic-5"); - samplePopOut = audio.Sample.Get(@"UI/melodic-4"); + samplePopIn = audio.Sample.Get(@"UI/overlay-pop-in"); + samplePopOut = audio.Sample.Get(@"UI/overlay-pop-out"); StateChanged += onStateChanged; } diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index ccc23e3ff6..5bbfab97e5 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -70,7 +70,7 @@ namespace osu.Game.Graphics.UserInterface }, }); - sampleClick = audio.Sample.Get(@"UI/generic-click"); + sampleClick = audio.Sample.Get(@"UI/generic-select"); sampleHover = audio.Sample.Get(@"UI/generic-hover"); Enabled.ValueChanged += enabled_ValueChanged; diff --git a/osu.Game/Graphics/UserInterface/OsuMenu.cs b/osu.Game/Graphics/UserInterface/OsuMenu.cs index 3fd5481152..7f16d73613 100644 --- a/osu.Game/Graphics/UserInterface/OsuMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuMenu.cs @@ -72,7 +72,7 @@ namespace osu.Game.Graphics.UserInterface private void load(AudioManager audio) { sampleHover = audio.Sample.Get(@"UI/generic-hover"); - sampleClick = audio.Sample.Get(@"UI/generic-click"); + sampleClick = audio.Sample.Get(@"UI/generic-select"); BackgroundColour = Color4.Transparent; BackgroundColourHover = OsuColour.FromHex(@"172023"); diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index ccd61643ce..5e55166c19 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -174,7 +174,7 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(AudioManager audio) { - sampleHover = audio.Sample.Get(@"Menu/hover"); + sampleHover = audio.Sample.Get(@"Menu/button-hover"); if (!string.IsNullOrEmpty(sampleName)) sampleClick = audio.Sample.Get($@"Menu/{sampleName}"); } diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 5a4a5f07b5..af5df2f8ec 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -117,13 +117,13 @@ namespace osu.Game.Screens.Menu }, }; - buttonsPlay.Add(new Button(@"solo", @"select-6", FontAwesome.fa_user, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P)); - buttonsPlay.Add(new Button(@"multi", @"select-5", FontAwesome.fa_users, new Color4(94, 63, 186, 255), () => OnMulti?.Invoke(), 0, Key.M)); - buttonsPlay.Add(new Button(@"chart", @"select-5", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), () => OnChart?.Invoke())); + buttonsPlay.Add(new Button(@"solo", @"button-solo-select", FontAwesome.fa_user, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P)); + buttonsPlay.Add(new Button(@"multi", @"button-generic-select", FontAwesome.fa_users, new Color4(94, 63, 186, 255), () => OnMulti?.Invoke(), 0, Key.M)); + buttonsPlay.Add(new Button(@"chart", @"button-generic-select", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), () => OnChart?.Invoke())); - buttonsTopLevel.Add(new Button(@"play", @"select-1", FontAwesome.fa_osu_logo, new Color4(102, 68, 204, 255), onPlay, WEDGE_WIDTH, Key.P)); - buttonsTopLevel.Add(new Button(@"osu!editor", @"select-5", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), () => OnEdit?.Invoke(), 0, Key.E)); - buttonsTopLevel.Add(new Button(@"osu!direct", string.Empty, FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D)); + buttonsTopLevel.Add(new Button(@"play", @"button-play-select", FontAwesome.fa_osu_logo, new Color4(102, 68, 204, 255), onPlay, WEDGE_WIDTH, Key.P)); + buttonsTopLevel.Add(new Button(@"osu!editor", @"button-generic-select", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), () => OnEdit?.Invoke(), 0, Key.E)); + buttonsTopLevel.Add(new Button(@"osu!direct", @"button-direct-select", FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D)); buttonsTopLevel.Add(new Button(@"exit", string.Empty, FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q)); buttonFlow.AddRange(buttonsPlay); @@ -134,7 +134,7 @@ namespace osu.Game.Screens.Menu private void load(AudioManager audio, OsuGame game = null) { toolbar = game?.Toolbar; - sampleBack = audio.Sample.Get(@"Menu/select-4"); + sampleBack = audio.Sample.Get(@"Menu/button-back-select"); } protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 252f2d37b5..2679368099 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -248,8 +248,8 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(TextureStore textures, AudioManager audio) { - sampleClick = audio.Sample.Get(@"Menu/select-2"); - sampleBeat = audio.Sample.Get(@"Menu/heartbeat"); + sampleClick = audio.Sample.Get(@"Menu/osu-logo-select"); + sampleBeat = audio.Sample.Get(@"Menu/osu-logo-heartbeat"); logo.Texture = textures.Get(@"Menu/logo"); ripple.Texture = textures.Get(@"Menu/logo"); diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index f5ff9ea036..76ee4a607e 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -70,7 +70,7 @@ namespace osu.Game.Screens if (osuGame != null) Ruleset.BindTo(osuGame.Ruleset); - sampleExit = audio.Sample.Get(@"UI/melodic-1"); + sampleExit = audio.Sample.Get(@"UI/screen-back"); } protected override void OnResuming(Screen last) From ae48b858276d75c0f8b69e784505a0a85598a649 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 25 Nov 2017 23:29:08 +0900 Subject: [PATCH 207/282] Don't play logo select sample when actions are playing their own --- osu.Game/Screens/Menu/ButtonSystem.cs | 10 ++++++---- osu.Game/Screens/Menu/OsuLogo.cs | 10 ++++++---- osu.Game/Screens/Select/SongSelect.cs | 6 +++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index af5df2f8ec..ce7856c5a9 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -180,19 +180,21 @@ namespace osu.Game.Screens.Menu State = MenuState.TopLevel; } - private void onOsuLogo() + private bool onOsuLogo() { switch (state) { + default: + return true; case MenuState.Initial: State = MenuState.TopLevel; - return; + return true; case MenuState.TopLevel: buttonsTopLevel.First().TriggerOnClick(); - return; + return false; case MenuState.Play: buttonsPlay.First().TriggerOnClick(); - return; + return false; } } diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 2679368099..9ca12702e5 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -48,7 +48,10 @@ namespace osu.Game.Screens.Menu private readonly Triangles triangles; - public Action Action; + /// + /// Return value decides whether the logo should play its own sample for the click action. + /// + public Func Action; public float SizeForFlow => logo == null ? 0 : logo.DrawSize.X * logo.Scale.X * logoBounceContainer.Scale.X * logoHoverContainer.Scale.X * 0.74f; @@ -354,13 +357,12 @@ namespace osu.Game.Screens.Menu { if (!interactive) return false; - sampleClick.Play(); + if (Action?.Invoke() ?? true) + sampleClick.Play(); flashLayer.ClearTransforms(); flashLayer.Alpha = 0.4f; flashLayer.FadeOut(1500, Easing.OutExpo); - - Action?.Invoke(); return true; } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 24a7b3db90..fcf459182f 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -332,7 +332,11 @@ namespace osu.Game.Screens.Select logo.FadeIn(logo_transition, Easing.OutQuint); logo.ScaleTo(0.4f, logo_transition, Easing.OutQuint); - logo.Action = () => carouselRaisedStart(); + logo.Action = () => + { + carouselRaisedStart(); + return true; + }; } protected override void LogoExiting(OsuLogo logo) From af499df6ddfdb7fdee0fa836a00614d37104f080 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 01:52:52 +0900 Subject: [PATCH 208/282] Make a base OsuButton class to handle default samples --- .../Visual/TestCaseReplaySettingsOverlay.cs | 2 +- osu.Game/Graphics/UserInterface/OsuButton.cs | 103 ++-------------- .../Graphics/UserInterface/TriangleButton.cs | 111 ++++++++++++++++++ .../KeyBinding/KeyBindingsSubsection.cs | 2 +- .../Sections/Maintenance/GeneralSettings.cs | 6 +- osu.Game/Overlays/Settings/SettingsButton.cs | 2 +- osu.Game/Screens/Tournament/Drawings.cs | 8 +- osu.Game/osu.Game.csproj | 3 +- 8 files changed, 131 insertions(+), 106 deletions(-) create mode 100644 osu.Game/Graphics/UserInterface/TriangleButton.cs diff --git a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs index 22a2d717e4..badb98e6b7 100644 --- a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs @@ -22,7 +22,7 @@ namespace osu.Game.Tests.Visual Add(container = new ExampleContainer()); - AddStep(@"Add button", () => container.Add(new OsuButton + AddStep(@"Add button", () => container.Add(new TriangleButton { RelativeSizeAxes = Axes.X, Text = @"Button", diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index 5bbfab97e5..884a3037a5 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -1,87 +1,22 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; -using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; -using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; -using osu.Game.Graphics.Backgrounds; -using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics.UserInterface { - public class OsuButton : Button, IFilterable + /// + /// A button with added default sound effects. + /// + public class OsuButton : Button { - private Box hover; - private SampleChannel sampleClick; private SampleChannel sampleHover; - protected Triangles Triangles; - - public OsuButton() - { - Height = 40; - } - - protected override SpriteText CreateText() => new OsuSpriteText - { - Depth = -1, - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - Font = @"Exo2.0-Bold", - }; - - public override bool HandleInput => Action != null; - - [BackgroundDependencyLoader] - private void load(OsuColour colours, AudioManager audio) - { - if (Action == null) - Colour = OsuColour.Gray(0.5f); - - BackgroundColour = colours.BlueDark; - - Content.Masking = true; - Content.CornerRadius = 5; - - AddRange(new Drawable[] - { - Triangles = new Triangles - { - RelativeSizeAxes = Axes.Both, - ColourDark = colours.BlueDarker, - ColourLight = colours.Blue, - }, - hover = new Box - { - RelativeSizeAxes = Axes.Both, - Blending = BlendingMode.Additive, - Colour = Color4.White.Opacity(0.1f), - Alpha = 0, - }, - }); - - sampleClick = audio.Sample.Get(@"UI/generic-select"); - sampleHover = audio.Sample.Get(@"UI/generic-hover"); - - Enabled.ValueChanged += enabled_ValueChanged; - Enabled.TriggerChange(); - } - - private void enabled_ValueChanged(bool enabled) - { - this.FadeColour(enabled ? Color4.White : Color4.Gray, 200, Easing.OutQuint); - } - protected override bool OnClick(InputState state) { sampleClick?.Play(); @@ -91,36 +26,14 @@ namespace osu.Game.Graphics.UserInterface protected override bool OnHover(InputState state) { sampleHover?.Play(); - hover.FadeIn(200); return base.OnHover(state); } - protected override void OnHoverLost(InputState state) + [BackgroundDependencyLoader] + private void load(OsuColour colours, AudioManager audio) { - hover.FadeOut(200); - base.OnHoverLost(state); - } - - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) - { - Content.ScaleTo(0.9f, 4000, Easing.OutQuint); - return base.OnMouseDown(state, args); - } - - protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) - { - Content.ScaleTo(1, 1000, Easing.OutElastic); - return base.OnMouseUp(state, args); - } - - public IEnumerable FilterTerms => new[] { Text }; - - public bool MatchingFilter - { - set - { - this.FadeTo(value ? 1 : 0); - } + sampleClick = audio.Sample.Get(@"UI/generic-select"); + sampleHover = audio.Sample.Get(@"UI/generic-hover"); } } } diff --git a/osu.Game/Graphics/UserInterface/TriangleButton.cs b/osu.Game/Graphics/UserInterface/TriangleButton.cs new file mode 100644 index 0000000000..33a8a8f99b --- /dev/null +++ b/osu.Game/Graphics/UserInterface/TriangleButton.cs @@ -0,0 +1,111 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using OpenTK.Graphics; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Input; +using osu.Game.Graphics.Backgrounds; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Graphics.UserInterface +{ + public class TriangleButton : OsuButton, IFilterable + { + private Box hover; + + protected Triangles Triangles; + + public TriangleButton() + { + Height = 40; + } + + protected override SpriteText CreateText() => new OsuSpriteText + { + Depth = -1, + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + Font = @"Exo2.0-Bold", + }; + + public override bool HandleInput => Action != null; + + [BackgroundDependencyLoader] + private void load(OsuColour colours, AudioManager audio) + { + if (Action == null) + Colour = OsuColour.Gray(0.5f); + + BackgroundColour = colours.BlueDark; + + Content.Masking = true; + Content.CornerRadius = 5; + + AddRange(new Drawable[] + { + Triangles = new Triangles + { + RelativeSizeAxes = Axes.Both, + ColourDark = colours.BlueDarker, + ColourLight = colours.Blue, + }, + hover = new Box + { + RelativeSizeAxes = Axes.Both, + Blending = BlendingMode.Additive, + Colour = Color4.White.Opacity(0.1f), + Alpha = 0, + }, + }); + + Enabled.ValueChanged += enabled_ValueChanged; + Enabled.TriggerChange(); + } + + private void enabled_ValueChanged(bool enabled) + { + this.FadeColour(enabled ? Color4.White : Color4.Gray, 200, Easing.OutQuint); + } + + protected override bool OnHover(InputState state) + { + hover.FadeIn(200); + return base.OnHover(state); + } + + protected override void OnHoverLost(InputState state) + { + hover.FadeOut(200); + base.OnHoverLost(state); + } + + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) + { + Content.ScaleTo(0.9f, 4000, Easing.OutQuint); + return base.OnMouseDown(state, args); + } + + protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) + { + Content.ScaleTo(1, 1000, Easing.OutElastic); + return base.OnMouseUp(state, args); + } + + public IEnumerable FilterTerms => new[] { Text }; + + public bool MatchingFilter + { + set + { + this.FadeTo(value ? 1 : 0); + } + } + } +} diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs b/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs index 30ff0ab026..c670cc0153 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.KeyBinding } } - public class ResetButton : OsuButton + public class ResetButton : TriangleButton { [BackgroundDependencyLoader] private void load(OsuColour colours) diff --git a/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs index 4c82a9ae4b..4f4f381ae1 100644 --- a/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs @@ -12,9 +12,9 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance { public class GeneralSettings : SettingsSubsection { - private OsuButton importButton; - private OsuButton deleteButton; - private OsuButton restoreButton; + private TriangleButton importButton; + private TriangleButton deleteButton; + private TriangleButton restoreButton; protected override string Header => "General"; diff --git a/osu.Game/Overlays/Settings/SettingsButton.cs b/osu.Game/Overlays/Settings/SettingsButton.cs index 5320cef850..19493f6c70 100644 --- a/osu.Game/Overlays/Settings/SettingsButton.cs +++ b/osu.Game/Overlays/Settings/SettingsButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { - public class SettingsButton : OsuButton + public class SettingsButton : TriangleButton { public SettingsButton() { diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index e540782fc1..3e7ab56c99 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -193,21 +193,21 @@ namespace osu.Game.Screens.Tournament Children = new Drawable[] { - new OsuButton + new TriangleButton { RelativeSizeAxes = Axes.X, Text = "Begin random", Action = teamsContainer.StartScrolling, }, - new OsuButton + new TriangleButton { RelativeSizeAxes = Axes.X, Text = "Stop random", Action = teamsContainer.StopScrolling, }, - new OsuButton + new TriangleButton { RelativeSizeAxes = Axes.X, @@ -232,7 +232,7 @@ namespace osu.Game.Screens.Tournament Children = new Drawable[] { - new OsuButton + new TriangleButton { RelativeSizeAxes = Axes.X, diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2aefde2916..a26ad963cf 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -271,6 +271,7 @@ + 20171019041408_InitialCreate.cs @@ -366,7 +367,7 @@ - + From 8d7c891882532151187f8b600d9281736cc5bb08 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 01:53:03 +0900 Subject: [PATCH 209/282] Add hover and click sound effects to settings sidebar buttons --- osu.Game/Overlays/Settings/SidebarButton.cs | 28 +++++++++------------ 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/osu.Game/Overlays/Settings/SidebarButton.cs b/osu.Game/Overlays/Settings/SidebarButton.cs index b39c8ab7cf..4b8366f0fc 100644 --- a/osu.Game/Overlays/Settings/SidebarButton.cs +++ b/osu.Game/Overlays/Settings/SidebarButton.cs @@ -12,14 +12,14 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { - public class SidebarButton : Container + public class SidebarButton : OsuButton { private readonly SpriteIcon drawableIcon; private readonly SpriteText headerText; - private readonly Box backgroundBox; private readonly Box selectionIndicator; private readonly Container text; public Action Action; @@ -61,17 +61,14 @@ namespace osu.Game.Overlays.Settings public SidebarButton() { + BackgroundColour = OsuColour.Gray(60); + Background.Alpha = 0; + Height = Sidebar.DEFAULT_WIDTH; RelativeSizeAxes = Axes.X; - Children = new Drawable[] + + AddRange(new Drawable[] { - backgroundBox = new Box - { - RelativeSizeAxes = Axes.Both, - Blending = BlendingMode.Additive, - Colour = OsuColour.Gray(60), - Alpha = 0, - }, text = new Container { Width = Sidebar.DEFAULT_WIDTH, @@ -101,7 +98,7 @@ namespace osu.Game.Overlays.Settings Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, } - }; + }); } [BackgroundDependencyLoader] @@ -113,20 +110,19 @@ namespace osu.Game.Overlays.Settings protected override bool OnClick(InputState state) { Action?.Invoke(section); - backgroundBox.FlashColour(Color4.White, 400); - return true; + return base.OnClick(state); } protected override bool OnHover(InputState state) { - backgroundBox.FadeTo(0.4f, 200); + Background.FadeTo(0.4f, 200); return base.OnHover(state); } protected override void OnHoverLost(InputState state) { - backgroundBox.FadeTo(0, 200); + Background.FadeTo(0, 200); base.OnHoverLost(state); } } -} \ No newline at end of file +} From 8f57bf2498f628b0b751390714e4554faeb7617b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 02:10:25 +0900 Subject: [PATCH 210/282] Add choices of hover sample sets --- osu.Game/Graphics/UserInterface/OsuButton.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index 884a3037a5..3b2377c06b 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -1,9 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; +using osu.Framework.Extensions; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; @@ -17,6 +19,8 @@ namespace osu.Game.Graphics.UserInterface private SampleChannel sampleClick; private SampleChannel sampleHover; + protected HoverSampleSet SampleSet = HoverSampleSet.Normal; + protected override bool OnClick(InputState state) { sampleClick?.Play(); @@ -30,10 +34,20 @@ namespace osu.Game.Graphics.UserInterface } [BackgroundDependencyLoader] - private void load(OsuColour colours, AudioManager audio) + private void load(AudioManager audio) { - sampleClick = audio.Sample.Get(@"UI/generic-select"); - sampleHover = audio.Sample.Get(@"UI/generic-hover"); + sampleClick = audio.Sample.Get($@"UI/generic-select{SampleSet.GetDescription()}"); + sampleHover = audio.Sample.Get($@"UI/generic-hover{SampleSet.GetDescription()}"); + } + + public enum HoverSampleSet + { + [Description("")] + Normal, + [Description("-soft")] + Soft, + [Description("-softer")] + Softer } } } From ac7e373f40252ef301b624418e44f36892197bb0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 02:41:18 +0900 Subject: [PATCH 211/282] Add hover/click sound effects to more stuff everywhere --- .../Containers/OsuClickableContainer.cs | 28 +++------ .../UserInterface/HoverClickSounds.cs | 62 +++++++++++++++++++ osu.Game/Graphics/UserInterface/OsuButton.cs | 39 +----------- .../Graphics/UserInterface/OsuCheckbox.cs | 3 +- .../Graphics/UserInterface/OsuDropdown.cs | 9 ++- .../Graphics/UserInterface/OsuSliderBar.cs | 3 +- .../Graphics/UserInterface/OsuTabControl.cs | 3 +- .../Graphics/UserInterface/PageTabControl.cs | 1 + osu.Game/Overlays/Chat/ChatLine.cs | 2 +- osu.Game/Overlays/Chat/ChatTabControl.cs | 3 +- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 5 +- osu.Game/Users/UserPanel.cs | 3 +- osu.Game/osu.Game.csproj | 1 + 13 files changed, 95 insertions(+), 67 deletions(-) create mode 100644 osu.Game/Graphics/UserInterface/HoverClickSounds.cs diff --git a/osu.Game/Graphics/Containers/OsuClickableContainer.cs b/osu.Game/Graphics/Containers/OsuClickableContainer.cs index ce3780cf78..c9117ed159 100644 --- a/osu.Game/Graphics/Containers/OsuClickableContainer.cs +++ b/osu.Game/Graphics/Containers/OsuClickableContainer.cs @@ -2,34 +2,24 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Audio; -using osu.Framework.Audio.Sample; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Graphics.Containers { public class OsuClickableContainer : ClickableContainer { - protected SampleChannel SampleClick, SampleHover; + private readonly HoverSampleSet sampleSet; + + public OsuClickableContainer(HoverSampleSet sampleSet = HoverSampleSet.Normal) + { + this.sampleSet = sampleSet; + } [BackgroundDependencyLoader] - private void load(AudioManager audio) + private void load() { - SampleHover = audio.Sample.Get(@"UI/generic-hover"); - SampleClick = audio.Sample.Get(@"UI/generic-select"); - } - - protected override bool OnHover(InputState state) - { - SampleHover?.Play(); - return base.OnHover(state); - } - - protected override bool OnClick(InputState state) - { - SampleClick?.Play(); - return base.OnClick(state); + AddInternal(new HoverClickSounds(sampleSet)); } } } diff --git a/osu.Game/Graphics/UserInterface/HoverClickSounds.cs b/osu.Game/Graphics/UserInterface/HoverClickSounds.cs new file mode 100644 index 0000000000..eace307610 --- /dev/null +++ b/osu.Game/Graphics/UserInterface/HoverClickSounds.cs @@ -0,0 +1,62 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.ComponentModel; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; +using osu.Framework.Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Input; + +namespace osu.Game.Graphics.UserInterface +{ + /// + /// Adds hover and click sounds to a drawable. + /// Does not draw anything. + /// + public class HoverClickSounds : CompositeDrawable + { + private SampleChannel sampleClick; + private SampleChannel sampleHover; + + protected readonly HoverSampleSet SampleSet; + + public HoverClickSounds(HoverSampleSet sampleSet = HoverSampleSet.Normal) + { + SampleSet = sampleSet; + RelativeSizeAxes = Axes.Both; + AlwaysPresent = true; + } + + protected override bool OnClick(InputState state) + { + sampleClick?.Play(); + return base.OnClick(state); + } + + protected override bool OnHover(InputState state) + { + sampleHover?.Play(); + return base.OnHover(state); + } + + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + sampleClick = audio.Sample.Get($@"UI/generic-select{SampleSet.GetDescription()}"); + sampleHover = audio.Sample.Get($@"UI/generic-hover{SampleSet.GetDescription()}"); + } + } + + public enum HoverSampleSet + { + [Description("")] + Loud, + [Description("-soft")] + Normal, + [Description("-softer")] + Soft + } +} diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index 3b2377c06b..081e59d3a7 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -1,13 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.ComponentModel; -using osu.Framework.Allocation; -using osu.Framework.Audio; -using osu.Framework.Audio.Sample; -using osu.Framework.Extensions; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; namespace osu.Game.Graphics.UserInterface { @@ -16,38 +10,9 @@ namespace osu.Game.Graphics.UserInterface /// public class OsuButton : Button { - private SampleChannel sampleClick; - private SampleChannel sampleHover; - - protected HoverSampleSet SampleSet = HoverSampleSet.Normal; - - protected override bool OnClick(InputState state) + public OsuButton() { - sampleClick?.Play(); - return base.OnClick(state); - } - - protected override bool OnHover(InputState state) - { - sampleHover?.Play(); - return base.OnHover(state); - } - - [BackgroundDependencyLoader] - private void load(AudioManager audio) - { - sampleClick = audio.Sample.Get($@"UI/generic-select{SampleSet.GetDescription()}"); - sampleHover = audio.Sample.Get($@"UI/generic-hover{SampleSet.GetDescription()}"); - } - - public enum HoverSampleSet - { - [Description("")] - Normal, - [Description("-soft")] - Soft, - [Description("-softer")] - Softer + Add(new HoverClickSounds(HoverSampleSet.Loud)); } } } diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index 68ff99e593..40ff1243dc 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -70,7 +70,8 @@ namespace osu.Game.Graphics.UserInterface Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Margin = new MarginPadding { Right = 5 }, - } + }, + new HoverClickSounds() }; Nub.Current.BindTo(Current); diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index f605804aaa..4401b509fd 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -33,7 +33,6 @@ namespace osu.Game.Graphics.UserInterface if (accentColour == default(Color4)) accentColour = colours.PinkDarker; updateAccentColour(); - } private void updateAccentColour() @@ -137,6 +136,8 @@ namespace osu.Game.Graphics.UserInterface nonAccentHoverColour = colours.PinkDarker; nonAccentSelectedColour = Color4.Black.Opacity(0.5f); updateColours(); + + AddInternal(new HoverClickSounds(HoverSampleSet.Soft)); } protected override void UpdateForegroundColour() @@ -183,7 +184,7 @@ namespace osu.Game.Graphics.UserInterface { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - } + }, }; } } @@ -237,8 +238,10 @@ namespace osu.Game.Graphics.UserInterface Origin = Anchor.CentreRight, Margin = new MarginPadding { Right = 4 }, Size = new Vector2(20), - } + }, }; + + AddInternal(new HoverClickSounds()); } [BackgroundDependencyLoader] diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 3dd3596c30..fd75269610 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -88,7 +88,8 @@ namespace osu.Game.Graphics.UserInterface { Origin = Anchor.TopCentre, Expanded = true, - } + }, + new HoverClickSounds() }; Current.DisabledChanged += disabled => diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index b053195030..decbf57ad1 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -131,7 +131,8 @@ namespace osu.Game.Graphics.UserInterface Colour = Color4.White, Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, - } + }, + new HoverClickSounds() }; } diff --git a/osu.Game/Graphics/UserInterface/PageTabControl.cs b/osu.Game/Graphics/UserInterface/PageTabControl.cs index 6b97e54ecd..c69857a5c4 100644 --- a/osu.Game/Graphics/UserInterface/PageTabControl.cs +++ b/osu.Game/Graphics/UserInterface/PageTabControl.cs @@ -57,6 +57,7 @@ namespace osu.Game.Graphics.UserInterface Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, }, + new HoverClickSounds() }; } diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 4db6bdf5e4..32f933ff42 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -222,7 +222,7 @@ namespace osu.Game.Overlays.Chat } - private class MessageSender : ClickableContainer, IHasContextMenu + private class MessageSender : OsuClickableContainer, IHasContextMenu { private readonly User sender; diff --git a/osu.Game/Overlays/Chat/ChatTabControl.cs b/osu.Game/Overlays/Chat/ChatTabControl.cs index 9f1028c168..f58ee8f819 100644 --- a/osu.Game/Overlays/Chat/ChatTabControl.cs +++ b/osu.Game/Overlays/Chat/ChatTabControl.cs @@ -17,6 +17,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Configuration; using System; +using osu.Game.Graphics.Containers; namespace osu.Game.Overlays.Chat { @@ -259,7 +260,7 @@ namespace osu.Game.Overlays.Chat }; } - public class CloseButton : ClickableContainer + public class CloseButton : OsuClickableContainer { private readonly SpriteIcon icon; diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index cb17216679..c039f9d311 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -13,6 +13,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics.Containers; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Toolbar { @@ -74,7 +75,7 @@ namespace osu.Game.Overlays.Toolbar private readonly SpriteText tooltip2; protected FillFlowContainer Flow; - public ToolbarButton() + public ToolbarButton() : base(HoverSampleSet.Loud) { Width = WIDTH; RelativeSizeAxes = Axes.Y; @@ -195,4 +196,4 @@ namespace osu.Game.Overlays.Toolbar }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 1f235e3893..d056afcf54 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -17,10 +17,11 @@ using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; using osu.Framework.Graphics.Cursor; using osu.Game.Graphics.Backgrounds; +using osu.Game.Graphics.Containers; namespace osu.Game.Users { - public class UserPanel : ClickableContainer, IHasContextMenu + public class UserPanel : OsuClickableContainer, IHasContextMenu { private readonly User user; private const float height = 100; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a26ad963cf..415286f9a8 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -271,6 +271,7 @@ + From 0c6a1257777136f23696e270d7a65ebc7c64814b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 02:52:55 +0900 Subject: [PATCH 212/282] Remove custom colour handling --- osu.Game/Graphics/UserInterface/TriangleButton.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/TriangleButton.cs b/osu.Game/Graphics/UserInterface/TriangleButton.cs index 33a8a8f99b..9fbdf6832f 100644 --- a/osu.Game/Graphics/UserInterface/TriangleButton.cs +++ b/osu.Game/Graphics/UserInterface/TriangleButton.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using OpenTK.Graphics; using osu.Framework.Allocation; -using osu.Framework.Audio; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -38,11 +37,8 @@ namespace osu.Game.Graphics.UserInterface public override bool HandleInput => Action != null; [BackgroundDependencyLoader] - private void load(OsuColour colours, AudioManager audio) + private void load(OsuColour colours) { - if (Action == null) - Colour = OsuColour.Gray(0.5f); - BackgroundColour = colours.BlueDark; Content.Masking = true; From 880418fd0d83c5005145b68e3c7d8ca5e4aaa2db Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 03:27:16 +0900 Subject: [PATCH 213/282] Split out click and hover sound layers --- .../UserInterface/HoverClickSounds.cs | 30 +---------- .../Graphics/UserInterface/HoverSounds.cs | 54 +++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 3 files changed, 57 insertions(+), 28 deletions(-) create mode 100644 osu.Game/Graphics/UserInterface/HoverSounds.cs diff --git a/osu.Game/Graphics/UserInterface/HoverClickSounds.cs b/osu.Game/Graphics/UserInterface/HoverClickSounds.cs index eace307610..0fac1c8092 100644 --- a/osu.Game/Graphics/UserInterface/HoverClickSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverClickSounds.cs @@ -1,13 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.ComponentModel; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Extensions; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Input; namespace osu.Game.Graphics.UserInterface @@ -16,18 +13,12 @@ namespace osu.Game.Graphics.UserInterface /// Adds hover and click sounds to a drawable. /// Does not draw anything. /// - public class HoverClickSounds : CompositeDrawable + public class HoverClickSounds : HoverSounds { private SampleChannel sampleClick; - private SampleChannel sampleHover; - protected readonly HoverSampleSet SampleSet; - - public HoverClickSounds(HoverSampleSet sampleSet = HoverSampleSet.Normal) + public HoverClickSounds(HoverSampleSet sampleSet = HoverSampleSet.Normal) : base(sampleSet) { - SampleSet = sampleSet; - RelativeSizeAxes = Axes.Both; - AlwaysPresent = true; } protected override bool OnClick(InputState state) @@ -36,27 +27,10 @@ namespace osu.Game.Graphics.UserInterface return base.OnClick(state); } - protected override bool OnHover(InputState state) - { - sampleHover?.Play(); - return base.OnHover(state); - } - [BackgroundDependencyLoader] private void load(AudioManager audio) { sampleClick = audio.Sample.Get($@"UI/generic-select{SampleSet.GetDescription()}"); - sampleHover = audio.Sample.Get($@"UI/generic-hover{SampleSet.GetDescription()}"); } } - - public enum HoverSampleSet - { - [Description("")] - Loud, - [Description("-soft")] - Normal, - [Description("-softer")] - Soft - } } diff --git a/osu.Game/Graphics/UserInterface/HoverSounds.cs b/osu.Game/Graphics/UserInterface/HoverSounds.cs new file mode 100644 index 0000000000..d26ad35c49 --- /dev/null +++ b/osu.Game/Graphics/UserInterface/HoverSounds.cs @@ -0,0 +1,54 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.ComponentModel; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; +using osu.Framework.Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Input; + +namespace osu.Game.Graphics.UserInterface +{ + /// + /// Adds hover sounds to a drawable. + /// Does not draw anything. + /// + public class HoverSounds : CompositeDrawable + { + private SampleChannel sampleHover; + + protected readonly HoverSampleSet SampleSet; + + public HoverSounds(HoverSampleSet sampleSet = HoverSampleSet.Normal) + { + SampleSet = sampleSet; + RelativeSizeAxes = Axes.Both; + AlwaysPresent = true; + } + + protected override bool OnHover(InputState state) + { + sampleHover?.Play(); + return base.OnHover(state); + } + + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + sampleHover = audio.Sample.Get($@"UI/generic-hover{SampleSet.GetDescription()}"); + } + } + + public enum HoverSampleSet + { + [Description("")] + Loud, + [Description("-soft")] + Normal, + [Description("-softer")] + Soft + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 415286f9a8..ce9e8eff9c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -272,6 +272,7 @@ + From c5aacb75c63f43c6c2a185640f0ddba26c2dd237 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 03:28:11 +0900 Subject: [PATCH 214/282] Add hover sounds to mod buttons --- osu.Game/Overlays/Mods/ModButton.cs | 6 ++++-- osu.Game/Overlays/Mods/ModButtonEmpty.cs | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index 0ead4ea019..f2a3da4145 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -17,6 +17,7 @@ using osu.Game.Rulesets.UI; using System; using System.Linq; using osu.Framework.Graphics.Cursor; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Mods { @@ -31,7 +32,7 @@ namespace osu.Game.Overlays.Mods private readonly Container iconsContainer; private SampleChannel sampleOn, sampleOff; - public Action Action; // Passed the selected mod or null if none + public new Action Action; // Passed the selected mod or null if none public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty; @@ -148,7 +149,7 @@ namespace osu.Game.Overlays.Mods // the mods from Mod, only multiple if Mod is a MultiMod - public override Mod SelectedMod => Mods.ElementAtOrDefault(SelectedIndex); + public virtual Mod SelectedMod => Mods.ElementAtOrDefault(SelectedIndex); [BackgroundDependencyLoader] private void load(AudioManager audio) @@ -253,6 +254,7 @@ namespace osu.Game.Overlays.Mods Anchor = Anchor.TopCentre, TextSize = 18, }, + new HoverClickSounds() }; Mod = mod; diff --git a/osu.Game/Overlays/Mods/ModButtonEmpty.cs b/osu.Game/Overlays/Mods/ModButtonEmpty.cs index 638c2a0e47..f776c174d2 100644 --- a/osu.Game/Overlays/Mods/ModButtonEmpty.cs +++ b/osu.Game/Overlays/Mods/ModButtonEmpty.cs @@ -3,7 +3,6 @@ using OpenTK; using osu.Framework.Graphics.Containers; -using osu.Game.Rulesets.Mods; namespace osu.Game.Overlays.Mods { @@ -12,8 +11,6 @@ namespace osu.Game.Overlays.Mods /// public class ModButtonEmpty : Container { - public virtual Mod SelectedMod => null; - public ModButtonEmpty() { Size = new Vector2(100f); From 5aa6615107756963ac9c5b03dceb3acf53c311f4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 03:30:05 +0900 Subject: [PATCH 215/282] Add confirm-selection sound in song select --- osu.Game/Screens/Select/PlaySongSelect.cs | 10 +++++++++- osu.Game/Screens/Select/SongSelect.cs | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index e0a3693371..992bfa52ee 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -4,6 +4,8 @@ using System.Linq; using OpenTK.Input; using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; @@ -42,9 +44,13 @@ namespace osu.Game.Screens.Select beatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s)); } + private SampleChannel sampleConfirm; + [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, AudioManager audio) { + sampleConfirm = audio.Sample.Get($@"SongSelect/confirm-selection"); + Footer.AddButton(@"mods", colours.Yellow, modSelect, Key.F1, float.MaxValue); BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1); @@ -128,6 +134,8 @@ namespace osu.Game.Screens.Select Beatmap.Value.Track.Looping = false; Beatmap.Disabled = true; + sampleConfirm?.Play(); + LoadComponentAsync(player = new PlayerLoader(new Player()), l => Push(player)); } } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index fcf459182f..b232f2edad 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -335,7 +335,7 @@ namespace osu.Game.Screens.Select logo.Action = () => { carouselRaisedStart(); - return true; + return false; }; } From 9c90d9ca457c57e1ef0fb4d63021ad2b5d6510a0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 04:16:36 +0900 Subject: [PATCH 216/282] Add panel hover effects --- osu.Game/Beatmaps/Drawables/Panel.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/Panel.cs b/osu.Game/Beatmaps/Drawables/Panel.cs index d6ed306b39..32c1a31de6 100644 --- a/osu.Game/Beatmaps/Drawables/Panel.cs +++ b/osu.Game/Beatmaps/Drawables/Panel.cs @@ -3,12 +3,15 @@ using System; using osu.Framework; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; using OpenTK; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.MathUtils; namespace osu.Game.Beatmaps.Drawables { @@ -40,6 +43,20 @@ namespace osu.Game.Beatmaps.Drawables Alpha = 0; } + private SampleChannel sampleHover; + + protected override bool OnHover(InputState state) + { + sampleHover?.Play(); + return base.OnHover(state); + } + + [BackgroundDependencyLoader] + private void load(AudioManager audio, OsuColour colours) + { + sampleHover = audio.Sample.Get($@"SongSelect/song-ping-variation-{RNG.Next(1, 5)}"); + } + public void SetMultiplicativeAlpha(float alpha) { nestedContainer.Alpha = alpha; From 671b3d01ff83d9550fcf1b65cfcccdf5d352181d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Nov 2017 04:59:55 +0900 Subject: [PATCH 217/282] Fix OsuClickableContainer's local content geting overwritten --- .../Containers/OsuClickableContainer.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/OsuClickableContainer.cs b/osu.Game/Graphics/Containers/OsuClickableContainer.cs index c9117ed159..8df533ad6e 100644 --- a/osu.Game/Graphics/Containers/OsuClickableContainer.cs +++ b/osu.Game/Graphics/Containers/OsuClickableContainer.cs @@ -2,6 +2,7 @@ // 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.UserInterface; @@ -11,6 +12,10 @@ namespace osu.Game.Graphics.Containers { private readonly HoverSampleSet sampleSet; + private readonly Container content = new Container { RelativeSizeAxes = Axes.Both }; + + protected override Container Content => content; + public OsuClickableContainer(HoverSampleSet sampleSet = HoverSampleSet.Normal) { this.sampleSet = sampleSet; @@ -19,7 +24,17 @@ namespace osu.Game.Graphics.Containers [BackgroundDependencyLoader] private void load() { - AddInternal(new HoverClickSounds(sampleSet)); + if (AutoSizeAxes != Axes.None) + { + content.RelativeSizeAxes = RelativeSizeAxes; + content.AutoSizeAxes = AutoSizeAxes; + } + + InternalChildren = new Drawable[] + { + content, + new HoverClickSounds(sampleSet) + }; } } } From ba0b16dc0b49a2f852f46eadbf321b1509356126 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sun, 26 Nov 2017 19:00:30 +0100 Subject: [PATCH 218/282] setting BeatmapSets as list to prevent endless LINQ query chain --- osu.Game/Overlays/DirectOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index 11dd9dd976..b49ac269a9 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -50,7 +50,7 @@ namespace osu.Game.Overlays { if (beatmapSets?.Equals(value) ?? false) return; - beatmapSets = value; + beatmapSets = value?.ToList(); if (beatmapSets == null) return; From f189de437a38450c4a1d568a51c3e013d54ced8b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Nov 2017 10:01:44 +0900 Subject: [PATCH 219/282] Simplify blending assignment --- osu.Game/Beatmaps/Drawables/Panel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Drawables/Panel.cs b/osu.Game/Beatmaps/Drawables/Panel.cs index 5fbc858b00..e4b7e55012 100644 --- a/osu.Game/Beatmaps/Drawables/Panel.cs +++ b/osu.Game/Beatmaps/Drawables/Panel.cs @@ -52,7 +52,7 @@ namespace osu.Game.Beatmaps.Drawables { RelativeSizeAxes = Axes.Both, Alpha = 0, - Blending = new BlendingParameters { Mode = BlendingMode.Additive }, + Blending = BlendingMode.Additive, }, } }); From b34e724b8d17a1fda502683659e2d5b3e4c44d7b Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 27 Nov 2017 08:18:09 +0100 Subject: [PATCH 220/282] Changed MetadataSection so that the Text setter loads the new text in async before displaying it. --- osu.Game/Screens/Select/BeatmapDetails.cs | 24 ++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 6eaed67534..1b2108a6c8 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -316,7 +316,7 @@ namespace osu.Game.Screens.Select private class MetadataSection : Container { - private readonly TextFlowContainer textFlow; + private TextFlowContainer textFlow; public string Text { @@ -329,11 +329,29 @@ namespace osu.Game.Screens.Select } this.FadeIn(transition_duration); - textFlow.Clear(); - textFlow.AddText(value, s => s.TextSize = 14); + addTextAsync(value); } } + private void addTextAsync(string text) + { + var newTextFlow = new TextFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Colour = textFlow.Colour, + }; + + newTextFlow.AddText(text, s => s.TextSize = 14); + + LoadComponentAsync(newTextFlow, d => + { + var textContainer = (InternalChild as FillFlowContainer); + textContainer.Remove(textFlow); + textContainer.Add(textFlow = d); + }); + } + public Color4 TextColour { get { return textFlow.Colour; } From d49ee295d99e0438fd016c7e00d2bd13255f0d41 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 27 Nov 2017 08:47:36 +0100 Subject: [PATCH 221/282] Removed unnecessary schedule and null checks --- osu.Game/Screens/Select/BeatmapDetails.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 1b2108a6c8..f203f5cdc4 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -217,12 +217,9 @@ namespace osu.Game.Screens.Select if (description == null || source == null || tags == null) throw new InvalidOperationException($@"Requires all {nameof(MetadataSection)} elements to be non-null."); - Schedule(() => - { - description.Text = Beatmap?.Version; - source.Text = Beatmap?.Metadata?.Source; - tags.Text = Beatmap?.Metadata?.Tags; - }); + description.Text = beatmap.Version; + source.Text = beatmap.Metadata?.Source; + tags.Text = beatmap.Metadata?.Tags; } private void displayMetrics(BeatmapMetrics metrics, bool failOnMissing = true) From ac0942df8681714a92cddbfb1a146637c02d8b11 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 27 Nov 2017 08:48:12 +0100 Subject: [PATCH 222/282] Removed unnecessary private method to update the metadata --- osu.Game/Screens/Select/BeatmapDetails.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index f203f5cdc4..892156cc22 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -188,7 +188,9 @@ namespace osu.Game.Screens.Select ratingsContainer.FadeIn(transition_duration); advanced.Beatmap = Beatmap; - loadDetailsAsync(Beatmap); + description.Text = Beatmap.Version; + source.Text = Beatmap.Metadata.Source; + tags.Text = Beatmap.Metadata.Tags; var requestedBeatmap = Beatmap; if (requestedBeatmap.Metrics == null) @@ -212,16 +214,6 @@ namespace osu.Game.Screens.Select displayMetrics(requestedBeatmap.Metrics, false); } - private void loadDetailsAsync(BeatmapInfo beatmap) - { - if (description == null || source == null || tags == null) - throw new InvalidOperationException($@"Requires all {nameof(MetadataSection)} elements to be non-null."); - - description.Text = beatmap.Version; - source.Text = beatmap.Metadata?.Source; - tags.Text = beatmap.Metadata?.Tags; - } - private void displayMetrics(BeatmapMetrics metrics, bool failOnMissing = true) { var hasRatings = metrics?.Ratings?.Any() ?? false; @@ -267,7 +259,10 @@ namespace osu.Game.Screens.Select private void clearStats() { - loadDetailsAsync(null); + description.Text = null; + source.Text = null; + tags.Text = null; + advanced.Beatmap = new BeatmapInfo { StarDifficulty = 0, From 507da0dfb74cf97ae08199e9238a2b078508dd44 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 27 Nov 2017 08:48:47 +0100 Subject: [PATCH 223/282] Renamed addTextAsync to setTextAsync --- osu.Game/Screens/Select/BeatmapDetails.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 892156cc22..8bb7b45d7d 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -321,11 +321,11 @@ namespace osu.Game.Screens.Select } this.FadeIn(transition_duration); - addTextAsync(value); + setTextAsync(value); } } - private void addTextAsync(string text) + private void setTextAsync(string text) { var newTextFlow = new TextFlowContainer { From b4513497d68ec54e447e18c1ebe4b8ec6c264a3c Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 27 Nov 2017 08:52:26 +0100 Subject: [PATCH 224/282] Added a textContainer reference to MetadataSection so casting is no longer required for setting new text --- osu.Game/Screens/Select/BeatmapDetails.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 8bb7b45d7d..2c188319e5 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -308,6 +308,7 @@ namespace osu.Game.Screens.Select private class MetadataSection : Container { + private readonly FillFlowContainer textContainer; private TextFlowContainer textFlow; public string Text @@ -338,7 +339,6 @@ namespace osu.Game.Screens.Select LoadComponentAsync(newTextFlow, d => { - var textContainer = (InternalChild as FillFlowContainer); textContainer.Remove(textFlow); textContainer.Add(textFlow = d); }); @@ -355,7 +355,7 @@ namespace osu.Game.Screens.Select RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - InternalChild = new FillFlowContainer + InternalChild = textContainer = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, From 82a9b57277e72fa83a354de26c493af4d44c6b6d Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 27 Nov 2017 08:58:09 +0100 Subject: [PATCH 225/282] Removed unnecessary "using" statement --- osu.Game/Screens/Select/BeatmapDetails.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 2c188319e5..3cd6c3b107 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; From cbd7e1ca0de651a7067aad53053e0d01125d0012 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Nov 2017 18:01:00 +0900 Subject: [PATCH 226/282] Update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index fe49ccb3c8..d92cec7645 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit fe49ccb3c8f8661d653752d225ae1dc183944bb4 +Subproject commit d92cec764538da2e7ed95bfb566f6bc81a9667c8 diff --git a/osu-resources b/osu-resources index 1750ab8f67..4287ee8043 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 1750ab8f6761ab35592fd46da71fbe0c141bfd93 +Subproject commit 4287ee8043fb1419017359bc3a5db5dc06bc643f From 760f7d02d9f757fb47002a4ea1c2b34699ccca84 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Nov 2017 18:12:52 +0900 Subject: [PATCH 227/282] Remove AlwaysPresent (not actually required) --- osu.Game/Graphics/UserInterface/HoverSounds.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/HoverSounds.cs b/osu.Game/Graphics/UserInterface/HoverSounds.cs index d26ad35c49..24dbe37567 100644 --- a/osu.Game/Graphics/UserInterface/HoverSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverSounds.cs @@ -26,7 +26,6 @@ namespace osu.Game.Graphics.UserInterface { SampleSet = sampleSet; RelativeSizeAxes = Axes.Both; - AlwaysPresent = true; } protected override bool OnHover(InputState state) From 51372d7cdaf209a868aa92f5847308a77d4f20da Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Nov 2017 18:19:06 +0900 Subject: [PATCH 228/282] Remove HandleInput override from TriangleButton --- osu.Game/Graphics/UserInterface/TriangleButton.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/TriangleButton.cs b/osu.Game/Graphics/UserInterface/TriangleButton.cs index 9fbdf6832f..675e03aef8 100644 --- a/osu.Game/Graphics/UserInterface/TriangleButton.cs +++ b/osu.Game/Graphics/UserInterface/TriangleButton.cs @@ -34,8 +34,6 @@ namespace osu.Game.Graphics.UserInterface Font = @"Exo2.0-Bold", }; - public override bool HandleInput => Action != null; - [BackgroundDependencyLoader] private void load(OsuColour colours) { From 96d42b3e5b6a42ed5947d4485116e2d16f718902 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Nov 2017 18:20:13 +0900 Subject: [PATCH 229/282] Fix redundant string interpolation --- osu.Game/Screens/Select/PlaySongSelect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 992bfa52ee..bba6ddf577 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -49,7 +49,7 @@ namespace osu.Game.Screens.Select [BackgroundDependencyLoader] private void load(OsuColour colours, AudioManager audio) { - sampleConfirm = audio.Sample.Get($@"SongSelect/confirm-selection"); + sampleConfirm = audio.Sample.Get(@"SongSelect/confirm-selection"); Footer.AddButton(@"mods", colours.Yellow, modSelect, Key.F1, float.MaxValue); From bf5ea027efd9813dbcaf78ba54268ae3da665b8d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Nov 2017 18:26:20 +0900 Subject: [PATCH 230/282] Add xmldoc to TriangleButton --- osu.Game/Graphics/UserInterface/TriangleButton.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Graphics/UserInterface/TriangleButton.cs b/osu.Game/Graphics/UserInterface/TriangleButton.cs index 675e03aef8..61e9705064 100644 --- a/osu.Game/Graphics/UserInterface/TriangleButton.cs +++ b/osu.Game/Graphics/UserInterface/TriangleButton.cs @@ -15,6 +15,9 @@ using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics.UserInterface { + /// + /// A button with moving triangles in the background. + /// public class TriangleButton : OsuButton, IFilterable { private Box hover; From 2c53be7853145c2f699104026572eb3e36449100 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 27 Nov 2017 18:39:13 +0900 Subject: [PATCH 231/282] Fix possible invalid cast when generating mania patterns --- osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index f6d30ad3fa..d5a799b4ed 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -138,8 +138,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps Pattern newPattern = conversion.Generate(); lastPattern = newPattern; - var stairPatternGenerator = (HitObjectPatternGenerator)conversion; - lastStair = stairPatternGenerator.StairType; + var stairPatternGenerator = conversion as HitObjectPatternGenerator; + lastStair = stairPatternGenerator?.StairType ?? lastStair; return newPattern.HitObjects; } From 3a01bfc1ef88b89ef8e214fbd981c716f69dd1a1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Nov 2017 18:53:19 +0900 Subject: [PATCH 232/282] Remove unnecessary new prefix --- osu.Game/Overlays/Mods/ModButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index f2a3da4145..77b7c3add2 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Mods private readonly Container iconsContainer; private SampleChannel sampleOn, sampleOff; - public new Action Action; // Passed the selected mod or null if none + public Action Action; // Passed the selected mod or null if none public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty; From 473eba9776e1d8cfcb54ca65f9a8f7619202c168 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Nov 2017 12:09:44 +0900 Subject: [PATCH 233/282] Remove precision limitation on chat height to allow pixel-perfect dragging --- osu.Game/Configuration/OsuConfigManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index c087a5afb7..1a7d29e907 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -22,7 +22,7 @@ namespace osu.Game.Configuration Set(OsuSetting.SelectionRandomType, SelectionRandomType.RandomPermutation); - Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1, 0.01); + Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1); // Online settings Set(OsuSetting.Username, string.Empty); From 84702211ecd93318003af357324386f0267a6d5f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 28 Nov 2017 15:17:02 +0900 Subject: [PATCH 234/282] Rewrite mania auto generator to properly account for overlapping objects --- .../Replays/ManiaAutoGenerator.cs | 109 +++++------------- 1 file changed, 29 insertions(+), 80 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs index 64982532a7..35ca868d5a 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Objects; @@ -13,7 +14,7 @@ namespace osu.Game.Rulesets.Mania.Replays { internal class ManiaAutoGenerator : AutoGenerator { - private const double release_delay = 20; + public const double RELEASE_DELAY = 20; private readonly int availableColumns; @@ -32,102 +33,50 @@ namespace osu.Game.Rulesets.Mania.Replays // Todo: Realistically this shouldn't be needed, but the first frame is skipped with the way replays are currently handled Replay.Frames.Add(new ReplayFrame(-100000, null, null, ReplayButtonState.None)); - double[] holdEndTimes = new double[availableColumns]; - for (int i = 0; i < availableColumns; i++) - holdEndTimes[i] = double.NegativeInfinity; + var pointGroups = generateActionPoints().GroupBy(a => a.Time).OrderBy(g => g.First().Time); - // Notes are handled row-by-row - foreach (var objGroup in Beatmap.HitObjects.GroupBy(h => h.StartTime)) + int activeColumns = 0; + foreach (var group in pointGroups) { - double groupTime = objGroup.Key; - - int activeColumns = 0; - - // Get the previously held-down active columns - for (int i = 0; i < availableColumns; i++) + foreach (var point in group) { - if (holdEndTimes[i] > groupTime) - activeColumns |= 1 << i; + if (point is HitPoint) + activeColumns |= 1 << point.Column; + if (point is ReleasePoint) + activeColumns ^= 1 << point.Column; } - // Add on the group columns, keeping track of the held notes for the next rows - foreach (var obj in objGroup) - { - var holdNote = obj as HoldNote; - if (holdNote != null) - holdEndTimes[obj.Column] = Math.Max(holdEndTimes[obj.Column], holdNote.EndTime); - - activeColumns |= 1 << obj.Column; - } - - Replay.Frames.Add(new ReplayFrame(groupTime, activeColumns, null, ReplayButtonState.None)); - - // Add the release frames. We can't do this with the loop above because we need activeColumns to be fully populated - foreach (var obj in objGroup.GroupBy(h => (h as IHasEndTime)?.EndTime ?? h.StartTime + release_delay).OrderBy(h => h.Key)) - { - var groupEndTime = obj.Key; - - int activeColumnsAtEnd = 0; - for (int i = 0; i < availableColumns; i++) - { - if (holdEndTimes[i] > groupEndTime) - activeColumnsAtEnd |= 1 << i; - } - - Replay.Frames.Add(new ReplayFrame(groupEndTime, activeColumnsAtEnd, 0, ReplayButtonState.None)); - } + Replay.Frames.Add(new ReplayFrame(group.First().Time, activeColumns, 0, ReplayButtonState.None)); } - Replay.Frames = Replay.Frames - // Pick the maximum activeColumns for all frames at the same time - .GroupBy(f => f.Time) - .Select(g => new ReplayFrame(g.First().Time, maxMouseX(g), 0, ReplayButtonState.None)) - // The addition of release frames above maybe result in unordered frames, but we need them ordered - .OrderBy(f => f.Time) - .ToList(); - return Replay; } - /// - /// Finds the maximum by count of bits from a grouping of s. - /// - /// The grouping to search. - /// The maximum by count of bits. - private float maxMouseX(IGrouping group) + private IEnumerable generateActionPoints() { - int currentCount = -1; - int currentMax = 0; - - foreach (var val in group) + foreach (var obj in Beatmap.HitObjects) { - int newCount = countBits((int)(val.MouseX ?? 0)); - if (newCount > currentCount) - { - currentCount = newCount; - currentMax = (int)(val.MouseX ?? 0); - } + yield return new HitPoint { Time = obj.StartTime, Column = obj.Column }; + yield return new ReleasePoint { Time = ((obj as IHasEndTime)?.EndTime ?? obj.StartTime) + RELEASE_DELAY, Column = obj.Column }; } - - return currentMax; } - /// - /// Counts the number of bits set in a value. - /// - /// The value to count. - /// The number of set bits. - private int countBits(int value) + private interface IActionPoint { - int count = 0; - while (value > 0) - { - if ((value & 1) > 0) - count++; - value >>= 1; - } + double Time { get; set; } + int Column { get; set; } + } - return count; + private struct HitPoint : IActionPoint + { + public double Time { get; set; } + public int Column { get; set; } + } + + private struct ReleasePoint : IActionPoint + { + public double Time { get; set; } + public int Column { get; set; } } } } From b97cab4f29166a03a46ae9e415a60432b79d34fa Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 28 Nov 2017 15:27:20 +0900 Subject: [PATCH 235/282] Make ManiaFramedReplayInputHandler properly account for special keys These are interleaved into the playfield, so we have to use the playfield's columns' actions. --- .../Replays/ManiaFramedReplayInputHandler.cs | 16 +++++++++++++--- .../UI/ManiaRulesetContainer.cs | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs b/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs index e352997f2c..8440e4347d 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs @@ -2,29 +2,39 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Linq; using osu.Framework.Input; +using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Replays; namespace osu.Game.Rulesets.Mania.Replays { internal class ManiaFramedReplayInputHandler : FramedReplayInputHandler { - public ManiaFramedReplayInputHandler(Replay replay) + private readonly ManiaRulesetContainer container; + + public ManiaFramedReplayInputHandler(Replay replay, ManiaRulesetContainer container) : base(replay) { + this.container = container; } + protected override bool AtImportantFrame => CurrentFrame.MouseX != PreviousFrame.MouseX; + + private ManiaPlayfield playfield; public override List GetPendingStates() { var actions = new List(); - int activeColumns = (int)(CurrentFrame.MouseX ?? 0); + if (playfield == null) + playfield = (ManiaPlayfield)container.Playfield; + int activeColumns = (int)(CurrentFrame.MouseX ?? 0); int counter = 0; while (activeColumns > 0) { if ((activeColumns & 1) > 0) - actions.Add(ManiaAction.Key1 + counter); + actions.Add(playfield.Columns.ElementAt(counter).Action); counter++; activeColumns >>= 1; } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 08acd46c57..cbbcb84b31 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -124,6 +124,6 @@ namespace osu.Game.Rulesets.Mania.UI protected override SpeedAdjustmentContainer CreateSpeedAdjustmentContainer(MultiplierControlPoint controlPoint) => new ManiaSpeedAdjustmentContainer(controlPoint, ScrollingAlgorithm.Basic); - protected override FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new ManiaFramedReplayInputHandler(replay); + protected override FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new ManiaFramedReplayInputHandler(replay, this); } } From bd88df2722a589e4d7e7454a9c390937cb3d3193 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 24 Nov 2017 14:39:39 +0900 Subject: [PATCH 236/282] Add note about sequential execution of ConvertHitObject --- osu.Game/Beatmaps/BeatmapConverter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Beatmaps/BeatmapConverter.cs b/osu.Game/Beatmaps/BeatmapConverter.cs index 962c790fb2..6132322f1e 100644 --- a/osu.Game/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Beatmaps/BeatmapConverter.cs @@ -80,6 +80,7 @@ namespace osu.Game.Beatmaps /// /// Performs the conversion of a hit object. + /// This method generally executed sequentially for all objects in a beatmap. /// /// The hit object to convert. /// The un-converted Beatmap. From 2deb33ac4190a0e2e43975199e5b4039a95606de Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 24 Nov 2017 14:49:38 +0900 Subject: [PATCH 237/282] Add basic fruit scaling support --- osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs | 11 +++++++++++ .../Objects/Drawable/DrawableCatchHitObject.cs | 3 +++ 2 files changed, 14 insertions(+) diff --git a/osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs b/osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs index 2f33cf1093..aac25a1fa7 100644 --- a/osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using OpenTK.Graphics; @@ -20,5 +22,14 @@ namespace osu.Game.Rulesets.Catch.Objects /// The next fruit starts a new combo. Used for explodey. /// public virtual bool LastInCombo { get; set; } + + public float Scale { get; set; } = 1; + + public override void ApplyDefaults(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) + { + base.ApplyDefaults(controlPointInfo, difficulty); + + Scale = 1.0f - 0.7f * (difficulty.CircleSize - 5) / 5; + } } } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index e057bf3d8e..02efd81da3 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -5,6 +5,7 @@ using System; using osu.Framework.Graphics; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; +using OpenTK; namespace osu.Game.Rulesets.Catch.Objects.Drawable { @@ -17,6 +18,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable : base(hitObject) { HitObject = hitObject; + + Scale = new Vector2(HitObject.Scale); } } From 8f3fd7092e3692e31cb9e13d03fe3fe0306fd8b3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Nov 2017 18:37:41 +0900 Subject: [PATCH 238/282] CatchBaseHit -> CatchHitObject Also moves default scale to CatchHitObject. --- osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs | 4 ++-- osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs | 6 +++--- osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs | 4 ++-- .../Objects/{CatchBaseHit.cs => CatchHitObject.cs} | 4 +++- .../Objects/Drawable/DrawableCatchHitObject.cs | 8 ++++---- .../Objects/Drawable/DrawableJuiceStream.cs | 4 ++-- osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs | 2 +- osu.Game.Rulesets.Catch/Objects/Droplet.cs | 2 +- osu.Game.Rulesets.Catch/Objects/Fruit.cs | 2 +- osu.Game.Rulesets.Catch/Objects/JuiceStream.cs | 6 +++--- osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs | 6 +++--- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 2 +- osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs | 8 ++++---- osu.Game.Rulesets.Catch/UI/Catcher.cs | 2 +- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 2 +- 15 files changed, 32 insertions(+), 30 deletions(-) rename osu.Game.Rulesets.Catch/Objects/{CatchBaseHit.cs => CatchHitObject.cs} (86%) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs index 7126b6586d..6b9ec8b9a4 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -11,11 +11,11 @@ using osu.Game.Rulesets.Objects; namespace osu.Game.Rulesets.Catch.Beatmaps { - internal class CatchBeatmapConverter : BeatmapConverter + internal class CatchBeatmapConverter : BeatmapConverter { protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; - protected override IEnumerable ConvertHitObject(HitObject obj, Beatmap beatmap) + protected override IEnumerable ConvertHitObject(HitObject obj, Beatmap beatmap) { var curveData = obj as IHasCurve; var positionData = obj as IHasXPosition; diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs index 7fac19d135..b2f7fdabfc 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -6,9 +6,9 @@ using osu.Game.Rulesets.Catch.Objects; namespace osu.Game.Rulesets.Catch.Beatmaps { - internal class CatchBeatmapProcessor : BeatmapProcessor + internal class CatchBeatmapProcessor : BeatmapProcessor { - public override void PostProcess(Beatmap beatmap) + public override void PostProcess(Beatmap beatmap) { if (beatmap.ComboColors.Count == 0) return; @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps int comboIndex = 0; int colourIndex = 0; - CatchBaseHit lastObj = null; + CatchHitObject lastObj = null; foreach (var obj in beatmap.HitObjects) { diff --git a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs index b77be9d1f0..4740458dfb 100644 --- a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; namespace osu.Game.Rulesets.Catch { - public class CatchDifficultyCalculator : DifficultyCalculator + public class CatchDifficultyCalculator : DifficultyCalculator { public CatchDifficultyCalculator(Beatmap beatmap) : base(beatmap) { @@ -16,6 +16,6 @@ namespace osu.Game.Rulesets.Catch public override double Calculate(Dictionary categoryDifficulty = null) => 0; - protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new CatchBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new CatchBeatmapConverter(); } } diff --git a/osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs similarity index 86% rename from osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs rename to osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs index aac25a1fa7..cb4e6453ce 100644 --- a/osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs @@ -9,8 +9,10 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Catch.Objects { - public abstract class CatchBaseHit : HitObject, IHasXPosition, IHasCombo + public abstract class CatchHitObject : HitObject, IHasXPosition, IHasCombo { + public const double OBJECT_RADIUS = 44; + public float X { get; set; } public Color4 ComboColour { get; set; } = Color4.Gray; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index 02efd81da3..b90a06b94e 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -10,7 +10,7 @@ using OpenTK; namespace osu.Game.Rulesets.Catch.Objects.Drawable { public abstract class DrawableCatchHitObject : DrawableCatchHitObject - where TObject : CatchBaseHit + where TObject : CatchHitObject { public new TObject HitObject; @@ -23,9 +23,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable } } - public abstract class DrawableCatchHitObject : DrawableScrollingHitObject + public abstract class DrawableCatchHitObject : DrawableScrollingHitObject { - protected DrawableCatchHitObject(CatchBaseHit hitObject) + protected DrawableCatchHitObject(CatchHitObject hitObject) : base(hitObject) { RelativePositionAxes = Axes.Both; @@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable Y = (float)HitObject.StartTime; } - public Func CheckPosition; + public Func CheckPosition; protected override void CheckForJudgements(bool userTriggered, double timeOffset) { diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs index afda91d0b4..bfb674d1b4 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable RelativeChildSize = new Vector2(1, (float)HitObject.Duration) }; - foreach (CatchBaseHit tick in s.Ticks) + foreach (CatchHitObject tick in s.Ticks) { TinyDroplet tiny = tick as TinyDroplet; if (tiny != null) @@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable } } - protected override void AddNested(DrawableHitObject h) + protected override void AddNested(DrawableHitObject h) { ((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false; dropletContainer.Add(h); diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs index 00ddd365e3..2de266b3f0 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs @@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable.Pieces { public class Pulp : Circle, IHasAccentColour { - public const float PULP_SIZE = 20; + public const float PULP_SIZE = (float)CatchHitObject.OBJECT_RADIUS / 2.2f; public Pulp() { diff --git a/osu.Game.Rulesets.Catch/Objects/Droplet.cs b/osu.Game.Rulesets.Catch/Objects/Droplet.cs index b1206e0d75..a2bdf830e5 100644 --- a/osu.Game.Rulesets.Catch/Objects/Droplet.cs +++ b/osu.Game.Rulesets.Catch/Objects/Droplet.cs @@ -3,7 +3,7 @@ namespace osu.Game.Rulesets.Catch.Objects { - public class Droplet : CatchBaseHit + public class Droplet : CatchHitObject { } } diff --git a/osu.Game.Rulesets.Catch/Objects/Fruit.cs b/osu.Game.Rulesets.Catch/Objects/Fruit.cs index fc55f83969..5f1060fb51 100644 --- a/osu.Game.Rulesets.Catch/Objects/Fruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Fruit.cs @@ -3,7 +3,7 @@ namespace osu.Game.Rulesets.Catch.Objects { - public class Fruit : CatchBaseHit + public class Fruit : CatchHitObject { } } diff --git a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs index 6462f6f6a8..bf9f0bd44b 100644 --- a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs @@ -15,7 +15,7 @@ using osu.Framework.Lists; namespace osu.Game.Rulesets.Catch.Objects { - public class JuiceStream : CatchBaseHit, IHasCurve + public class JuiceStream : CatchHitObject, IHasCurve { /// /// Positional distance that results in a duration of one second, before any speed adjustments. @@ -42,11 +42,11 @@ namespace osu.Game.Rulesets.Catch.Objects TickDistance = scoringDistance / difficulty.SliderTickRate; } - public IEnumerable Ticks + public IEnumerable Ticks { get { - SortedList ticks = new SortedList((a, b) => a.StartTime.CompareTo(b.StartTime)); + SortedList ticks = new SortedList((a, b) => a.StartTime.CompareTo(b.StartTime)); if (TickDistance == 0) return ticks; diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 66a5636b74..0806c4b29d 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -10,14 +10,14 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.Scoring { - internal class CatchScoreProcessor : ScoreProcessor + internal class CatchScoreProcessor : ScoreProcessor { - public CatchScoreProcessor(RulesetContainer rulesetContainer) + public CatchScoreProcessor(RulesetContainer rulesetContainer) : base(rulesetContainer) { } - protected override void SimulateAutoplay(Beatmap beatmap) + protected override void SimulateAutoplay(Beatmap beatmap) { foreach (var obj in beatmap.HitObjects) { diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 987eef5e45..33903f649e 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -66,7 +66,7 @@ namespace osu.Game.Rulesets.Catch.UI catcher.Size = new Vector2(catcherContainer.DrawSize.Y); } - public bool CheckIfWeCanCatch(CatchBaseHit obj) => Math.Abs(catcher.Position.X - obj.X) < catcher.DrawSize.X / DrawSize.X / 2; + public bool CheckIfWeCanCatch(CatchHitObject obj) => Math.Abs(catcher.Position.X - obj.X) < catcher.DrawSize.X / DrawSize.X / 2; public override void Add(DrawableHitObject h) { diff --git a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs index 92912eb177..fda63fa977 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs @@ -13,7 +13,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.UI { - public class CatchRulesetContainer : ScrollingRulesetContainer + public class CatchRulesetContainer : ScrollingRulesetContainer { public CatchRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) @@ -22,15 +22,15 @@ namespace osu.Game.Rulesets.Catch.UI public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor(this); - protected override BeatmapProcessor CreateBeatmapProcessor() => new CatchBeatmapProcessor(); + protected override BeatmapProcessor CreateBeatmapProcessor() => new CatchBeatmapProcessor(); - protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); protected override Playfield CreatePlayfield() => new CatchPlayfield(); public override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo); - protected override DrawableHitObject GetVisualRepresentation(CatchBaseHit h) + protected override DrawableHitObject GetVisualRepresentation(CatchHitObject h) { var fruit = h as Fruit; if (fruit != null) diff --git a/osu.Game.Rulesets.Catch/UI/Catcher.cs b/osu.Game.Rulesets.Catch/UI/Catcher.cs index 87fe95ed2f..3a32b84639 100644 --- a/osu.Game.Rulesets.Catch/UI/Catcher.cs +++ b/osu.Game.Rulesets.Catch/UI/Catcher.cs @@ -157,7 +157,7 @@ namespace osu.Game.Rulesets.Catch.UI caughtFruit.Add(fruit); - if (((CatchBaseHit)fruit.HitObject).LastInCombo) + if (((CatchHitObject)fruit.HitObject).LastInCombo) explode(); } diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index a666984b95..e8763ec5d3 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -57,7 +57,7 @@ - + From b517523f4a602161708b0148319f489009d99fac Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Nov 2017 18:39:45 +0900 Subject: [PATCH 239/282] Add back CatcherArea to simplify layout --- ...tCaseCatcher.cs => TestCaseCatcherArea.cs} | 12 +- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 24 +- .../UI/CatchRulesetContainer.cs | 2 +- osu.Game.Rulesets.Catch/UI/Catcher.cs | 193 -------------- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 238 ++++++++++++++++++ .../osu.Game.Rulesets.Catch.csproj | 4 +- 6 files changed, 252 insertions(+), 221 deletions(-) rename osu.Game.Rulesets.Catch/Tests/{TestCaseCatcher.cs => TestCaseCatcherArea.cs} (71%) delete mode 100644 osu.Game.Rulesets.Catch/UI/Catcher.cs create mode 100644 osu.Game.Rulesets.Catch/UI/CatcherArea.cs diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatcher.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs similarity index 71% rename from osu.Game.Rulesets.Catch/Tests/TestCaseCatcher.cs rename to osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs index 341612b760..21c24aed93 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatcher.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs @@ -8,17 +8,16 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Rulesets.Catch.UI; using osu.Game.Tests.Visual; -using OpenTK; namespace osu.Game.Rulesets.Catch.Tests { [TestFixture] [Ignore("getting CI working")] - internal class TestCaseCatcher : OsuTestCase + internal class TestCaseCatcherArea : OsuTestCase { public override IReadOnlyList RequiredTypes => new[] { - typeof(Catcher), + typeof(CatcherArea), }; [BackgroundDependencyLoader] @@ -29,13 +28,10 @@ namespace osu.Game.Rulesets.Catch.Tests new CatchInputManager(rulesets.GetRuleset(2)) { RelativeSizeAxes = Axes.Both, - Child = new Catcher + Child = new CatcherArea() { - RelativePositionAxes = Axes.Both, - RelativeSizeAxes = Axes.Both, Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - Size = new Vector2(1, 0.2f), + Origin = Anchor.BottomLeft } }, }; diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 33903f649e..f59ba13edd 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -1,11 +1,11 @@ // 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.Graphics; using osu.Game.Rulesets.UI; using OpenTK; using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects.Drawable; using osu.Game.Rulesets.Judgements; @@ -20,10 +20,9 @@ namespace osu.Game.Rulesets.Catch.UI protected override Container Content => content; private readonly Container content; - private readonly Container catcherContainer; - private readonly Catcher catcher; + private readonly CatcherArea catcherArea; - public CatchPlayfield() + public CatchPlayfield(BeatmapDifficulty difficulty) : base(Axes.Y) { Container explodingFruitContainer; @@ -43,19 +42,11 @@ namespace osu.Game.Rulesets.Catch.UI { RelativeSizeAxes = Axes.Both, }, - catcherContainer = new Container + catcherArea = new CatcherArea(difficulty) { - RelativeSizeAxes = Axes.X, + ExplodingFruitTarget = explodingFruitContainer, Anchor = Anchor.BottomLeft, Origin = Anchor.TopLeft, - Height = 180, - Child = catcher = new Catcher - { - ExplodingFruitTarget = explodingFruitContainer, - RelativePositionAxes = Axes.Both, - Origin = Anchor.TopCentre, - X = 0.5f, - } } }; } @@ -63,10 +54,9 @@ namespace osu.Game.Rulesets.Catch.UI protected override void Update() { base.Update(); - catcher.Size = new Vector2(catcherContainer.DrawSize.Y); } - public bool CheckIfWeCanCatch(CatchHitObject obj) => Math.Abs(catcher.Position.X - obj.X) < catcher.DrawSize.X / DrawSize.X / 2; + public bool CheckIfWeCanCatch(CatchHitObject obj) => catcherArea.CanCatch(obj); public override void Add(DrawableHitObject h) { @@ -88,7 +78,7 @@ namespace osu.Game.Rulesets.Catch.UI (judgedObject.Parent as Container)?.Remove(judgedObject); (judgedObject.Parent as Container)?.Remove(judgedObject); - catcher.Add(judgedObject, screenPosition); + catcherArea.Add(judgedObject, screenPosition); } } } diff --git a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs index fda63fa977..3ed9090098 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Catch.UI protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); - protected override Playfield CreatePlayfield() => new CatchPlayfield(); + protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty); public override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo); diff --git a/osu.Game.Rulesets.Catch/UI/Catcher.cs b/osu.Game.Rulesets.Catch/UI/Catcher.cs deleted file mode 100644 index 3a32b84639..0000000000 --- a/osu.Game.Rulesets.Catch/UI/Catcher.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System; -using System.Linq; -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Textures; -using osu.Framework.Input.Bindings; -using osu.Framework.MathUtils; -using osu.Game.Rulesets.Catch.Objects; -using osu.Game.Rulesets.Objects.Drawables; -using OpenTK; - -namespace osu.Game.Rulesets.Catch.UI -{ - public class Catcher : Container, IKeyBindingHandler - { - private Texture texture; - - private Container caughtFruit; - - public Container ExplodingFruitTarget; - - [BackgroundDependencyLoader] - private void load(TextureStore textures) - { - texture = textures.Get(@"Play/Catch/fruit-catcher-idle"); - - Children = new Drawable[] - { - createCatcherSprite(), - caughtFruit = new Container - { - Anchor = Anchor.TopCentre, - Origin = Anchor.BottomCentre, - } - }; - } - - private int currentDirection; - - private bool dashing; - - protected bool Dashing - { - get { return dashing; } - set - { - if (value == dashing) return; - - dashing = value; - - if (dashing) - Schedule(addAdditiveSprite); - } - } - - private void addAdditiveSprite() - { - if (!dashing) return; - - var additive = createCatcherSprite(); - - additive.RelativePositionAxes = Axes.Both; - additive.Blending = BlendingMode.Additive; - additive.Position = Position; - additive.Scale = Scale; - - ((Container)Parent).Add(additive); - - additive.FadeTo(0.4f).FadeOut(800, Easing.OutQuint).Expire(); - - Scheduler.AddDelayed(addAdditiveSprite, 50); - } - - private Sprite createCatcherSprite() => new Sprite - { - RelativeSizeAxes = Axes.Both, - FillMode = FillMode.Fit, - Texture = texture, - OriginPosition = new Vector2(DrawWidth / 2, 10) //temporary until the sprite is aligned correctly. - }; - - public bool OnPressed(CatchAction action) - { - switch (action) - { - case CatchAction.MoveLeft: - currentDirection--; - return true; - case CatchAction.MoveRight: - currentDirection++; - return true; - case CatchAction.Dash: - Dashing = true; - return true; - } - - return false; - } - - public bool OnReleased(CatchAction action) - { - switch (action) - { - case CatchAction.MoveLeft: - currentDirection++; - return true; - case CatchAction.MoveRight: - currentDirection--; - return true; - case CatchAction.Dash: - Dashing = false; - return true; - } - - return false; - } - - /// - /// The relative space to cover in 1 millisecond. based on 1 game pixel per millisecond as in osu-stable. - /// - private const double base_speed = 1.0 / 512; - - protected override void Update() - { - base.Update(); - - if (currentDirection == 0) return; - - double dashModifier = Dashing ? 1 : 0.5; - - Scale = new Vector2(Math.Sign(currentDirection), 1); - X = (float)MathHelper.Clamp(X + Math.Sign(currentDirection) * Clock.ElapsedFrameTime * base_speed * dashModifier, 0, 1); - } - - public void Add(DrawableHitObject fruit, Vector2 absolutePosition) - { - fruit.RelativePositionAxes = Axes.None; - fruit.Position = new Vector2(ToLocalSpace(absolutePosition).X - DrawSize.X / 2, 0); - - fruit.Anchor = Anchor.TopCentre; - fruit.Origin = Anchor.BottomCentre; - fruit.Scale *= 0.7f; - fruit.LifetimeEnd = double.MaxValue; - - float distance = fruit.DrawSize.X / 2 * fruit.Scale.X; - - while (caughtFruit.Any(f => f.LifetimeEnd == double.MaxValue && Vector2Extensions.DistanceSquared(f.Position, fruit.Position) < distance * distance)) - { - fruit.X += RNG.Next(-5, 5); - fruit.Y -= RNG.Next(0, 5); - } - - caughtFruit.Add(fruit); - - if (((CatchHitObject)fruit.HitObject).LastInCombo) - explode(); - } - - private void explode() - { - var fruit = caughtFruit.ToArray(); - - foreach (var f in fruit) - { - var originalX = f.X * Scale.X; - - if (ExplodingFruitTarget != null) - { - f.Anchor = Anchor.TopLeft; - f.Position = caughtFruit.ToSpaceOfOtherDrawable(f.DrawPosition, ExplodingFruitTarget); - - caughtFruit.Remove(f); - - ExplodingFruitTarget.Add(f); - } - - f.MoveToY(f.Y - 50, 250, Easing.OutSine) - .Then() - .MoveToY(f.Y + 50, 500, Easing.InSine); - - f.MoveToX(f.X + originalX * 6, 1000); - f.FadeOut(750); - - f.Expire(); - } - } - } -} diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs new file mode 100644 index 0000000000..1cc810201f --- /dev/null +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -0,0 +1,238 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Framework.Input.Bindings; +using osu.Framework.MathUtils; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Objects.Drawables; +using OpenTK; + +namespace osu.Game.Rulesets.Catch.UI +{ + public class CatcherArea : Container + { + public const float CATCHER_SIZE = 172; + + private readonly Catcher catcher; + + public Container ExplodingFruitTarget + { + set { catcher.ExplodingFruitTarget = value; } + } + + public CatcherArea(BeatmapDifficulty difficulty = null) + { + RelativeSizeAxes = Axes.X; + Height = CATCHER_SIZE; + Child = catcher = new Catcher(difficulty) + { + AdditiveTarget = this, + }; + } + + public void Add(DrawableHitObject fruit, Vector2 absolutePosition) + { + fruit.RelativePositionAxes = Axes.None; + fruit.Position = new Vector2(catcher.ToLocalSpace(absolutePosition).X - catcher.DrawSize.X / 2, 0); + + fruit.Anchor = Anchor.TopCentre; + fruit.Origin = Anchor.BottomCentre; + fruit.Scale *= 0.7f; + fruit.LifetimeEnd = double.MaxValue; + + catcher.Add(fruit); + } + + public bool CanCatch(CatchHitObject obj) => Math.Abs(catcher.Position.X - obj.X) < catcher.DrawSize.X / DrawSize.X / 2; + + public class Catcher : Container, IKeyBindingHandler + { + private Texture texture; + + private Container caughtFruit; + + public Container ExplodingFruitTarget; + + public Container AdditiveTarget; + + public Catcher(BeatmapDifficulty difficulty = null) + { + RelativePositionAxes = Axes.X; + X = 0.5f; + + Origin = Anchor.BottomCentre; + Anchor = Anchor.BottomLeft; + + Size = new Vector2(CATCHER_SIZE); + } + + [BackgroundDependencyLoader] + private void load(TextureStore textures) + { + texture = textures.Get(@"Play/Catch/fruit-catcher-idle"); + + Children = new Drawable[] + { + createCatcherSprite(), + caughtFruit = new Container + { + Anchor = Anchor.TopCentre, + Origin = Anchor.BottomCentre, + } + }; + } + + private int currentDirection; + + private bool dashing; + + protected bool Dashing + { + get { return dashing; } + set + { + if (value == dashing) return; + + dashing = value; + + if (dashing) + Schedule(addAdditiveSprite); + } + } + + private void addAdditiveSprite() + { + if (!dashing || AdditiveTarget == null) return; + + var additive = createCatcherSprite(); + + additive.Anchor = Anchor; + additive.OriginPosition = additive.OriginPosition + new Vector2(DrawWidth / 2, DrawHeight); // also temporary to align sprite correctly. + additive.Position = Position; + additive.Scale = Scale; + additive.RelativePositionAxes = RelativePositionAxes; + additive.Blending = BlendingMode.Additive; + + AdditiveTarget.Add(additive); + + additive.FadeTo(0.4f).FadeOut(800, Easing.OutQuint).Expire(); + + Scheduler.AddDelayed(addAdditiveSprite, 50); + } + + private Sprite createCatcherSprite() => new Sprite + { + Size = new Vector2(CATCHER_SIZE), + FillMode = FillMode.Fill, + Texture = texture, + OriginPosition = new Vector2(-3, 10) // temporary until the sprite is aligned correctly. + }; + + public void Add(DrawableHitObject fruit) + { + float distance = fruit.DrawSize.X / 2 * fruit.Scale.X; + + while (caughtFruit.Any(f => f.LifetimeEnd == double.MaxValue && Vector2Extensions.DistanceSquared(f.Position, fruit.Position) < distance * distance)) + { + fruit.X += RNG.Next(-5, 5); + fruit.Y -= RNG.Next(0, 5); + } + + caughtFruit.Add(fruit); + + if (((CatchHitObject)fruit.HitObject).LastInCombo) + explode(); + } + + public bool OnPressed(CatchAction action) + { + switch (action) + { + case CatchAction.MoveLeft: + currentDirection--; + return true; + case CatchAction.MoveRight: + currentDirection++; + return true; + case CatchAction.Dash: + Dashing = true; + return true; + } + + return false; + } + + public bool OnReleased(CatchAction action) + { + switch (action) + { + case CatchAction.MoveLeft: + currentDirection++; + return true; + case CatchAction.MoveRight: + currentDirection--; + return true; + case CatchAction.Dash: + Dashing = false; + return true; + } + + return false; + } + + /// + /// The relative space to cover in 1 millisecond. based on 1 game pixel per millisecond as in osu-stable. + /// + public const double BASE_SPEED = 1.0 / 512; + + protected override void Update() + { + base.Update(); + + if (currentDirection == 0) return; + + double dashModifier = Dashing ? 1 : 0.5; + + Scale = new Vector2(Math.Sign(currentDirection), 1); + X = (float)MathHelper.Clamp(X + Math.Sign(currentDirection) * Clock.ElapsedFrameTime * BASE_SPEED * dashModifier, 0, 1); + } + + private void explode() + { + var fruit = caughtFruit.ToArray(); + + foreach (var f in fruit) + { + var originalX = f.X * Scale.X; + + if (ExplodingFruitTarget != null) + { + f.Anchor = Anchor.TopLeft; + f.Position = caughtFruit.ToSpaceOfOtherDrawable(f.DrawPosition, ExplodingFruitTarget); + + caughtFruit.Remove(f); + + ExplodingFruitTarget.Add(f); + } + + f.MoveToY(f.Y - 50, 250, Easing.OutSine) + .Then() + .MoveToY(f.Y + 50, 500, Easing.InSine); + + f.MoveToX(f.X + originalX * 6, 1000); + f.FadeOut(750); + + f.Expire(); + } + } + } + } +} diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index e8763ec5d3..bf60bc01bb 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -63,10 +63,10 @@ - + - + From 5ae9b4c79152e0e9489cf5e5c3a8e4267a6a92c4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Nov 2017 18:18:39 +0900 Subject: [PATCH 240/282] Make CatchStacker testcase more useful --- osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs index a890a8a386..4672ab5746 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs @@ -19,8 +19,8 @@ namespace osu.Game.Rulesets.Catch.Tests { var beatmap = new Beatmap(); - for (int i = 0; i < 256; i++) - beatmap.HitObjects.Add(new Fruit { X = 0.5f, StartTime = i * 100, NewCombo = i % 8 == 0 }); + for (int i = 0; i < 512; i++) + beatmap.HitObjects.Add(new Fruit { X = 0.5f + (i / 2048f * ((i % 10) - 5)), StartTime = i * 100, NewCombo = i % 8 == 0 }); return beatmap; } From b11de50df28577b7a6408219b34fbbdadfa362ff Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Nov 2017 18:42:50 +0900 Subject: [PATCH 241/282] Cleanups --- osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs | 2 +- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs index 4672ab5746..1c5f34f2e5 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Catch.Tests var beatmap = new Beatmap(); for (int i = 0; i < 512; i++) - beatmap.HitObjects.Add(new Fruit { X = 0.5f + (i / 2048f * ((i % 10) - 5)), StartTime = i * 100, NewCombo = i % 8 == 0 }); + beatmap.HitObjects.Add(new Fruit { X = 0.5f + i / 2048f * (i % 10 - 5), StartTime = i * 100, NewCombo = i % 8 == 0 }); return beatmap; } diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index f59ba13edd..6fd0793500 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -51,11 +51,6 @@ namespace osu.Game.Rulesets.Catch.UI }; } - protected override void Update() - { - base.Update(); - } - public bool CheckIfWeCanCatch(CatchHitObject obj) => catcherArea.CanCatch(obj); public override void Add(DrawableHitObject h) From f8c296877b96378506f3dab6d7698986740da380 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 28 Nov 2017 18:57:28 +0900 Subject: [PATCH 242/282] Add testcase for mania beatmap conversion (currently ignored) --- .../Tests/TestCaseBeatmapConversion.cs | 173 ++++++++++++++++++ .../osu.Game.Rulesets.Mania.csproj | 1 + 2 files changed, 174 insertions(+) create mode 100644 osu.Game.Rulesets.Mania/Tests/TestCaseBeatmapConversion.cs diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseBeatmapConversion.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseBeatmapConversion.cs new file mode 100644 index 0000000000..a8a3e9527b --- /dev/null +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseBeatmapConversion.cs @@ -0,0 +1,173 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.Replays; +using osu.Game.Tests.Visual; + +namespace osu.Game.Rulesets.Mania.Tests +{ + [Ignore("getting CI working")] + public class TestCaseAutoGeneration : OsuTestCase + { + [Test] + public void TestSingleNote() + { + // | | + // | - | + // | | + + var beatmap = new Beatmap(); + beatmap.HitObjects.Add(new Note { StartTime = 1000 }); + + var generated = new ManiaAutoGenerator(beatmap, 1).Generate(); + + Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames"); + Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time"); + Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time"); + Assert.AreEqual(1, generated.Frames[1].MouseX, "Key 0 has not been pressed"); + Assert.AreEqual(0, generated.Frames[2].MouseX, "Key 0 has not been released"); + } + + [Test] + public void TestSingleHoldNote() + { + // | | + // | * | + // | * | + // | * | + // | | + + var beatmap = new Beatmap(); + beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 }); + + var generated = new ManiaAutoGenerator(beatmap, 1).Generate(); + + Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames"); + Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time"); + Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time"); + Assert.AreEqual(1, generated.Frames[1].MouseX, "Key 0 has not been pressed"); + Assert.AreEqual(0, generated.Frames[2].MouseX, "Key 0 has not been released"); + } + + [Test] + public void TestSingleNoteChord() + { + // | | | + // | - | - | + // | | | + + var beatmap = new Beatmap(); + beatmap.HitObjects.Add(new Note { StartTime = 1000 }); + beatmap.HitObjects.Add(new Note { StartTime = 1000, Column = 1 }); + + var generated = new ManiaAutoGenerator(beatmap, 2).Generate(); + + Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames"); + Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time"); + Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time"); + Assert.AreEqual(3, generated.Frames[1].MouseX, "Keys 1 and 2 have not been pressed"); + Assert.AreEqual(0, generated.Frames[2].MouseX, "Keys 1 and 2 have not been released"); + } + + [Test] + public void TestHoldNoteChord() + { + // | | | + // | * | * | + // | * | * | + // | * | * | + // | | | + + var beatmap = new Beatmap(); + beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 }); + beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000, Column = 1 }); + + var generated = new ManiaAutoGenerator(beatmap, 2).Generate(); + + Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames"); + Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time"); + Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time"); + Assert.AreEqual(3, generated.Frames[1].MouseX, "Keys 1 and 2 have not been pressed"); + Assert.AreEqual(0, generated.Frames[2].MouseX, "Keys 1 and 2 have not been released"); + } + + [Test] + public void TestSingleNoteStair() + { + // | | | + // | | - | + // | - | | + // | | | + + var beatmap = new Beatmap(); + beatmap.HitObjects.Add(new Note { StartTime = 1000 }); + beatmap.HitObjects.Add(new Note { StartTime = 2000, Column = 1 }); + + var generated = new ManiaAutoGenerator(beatmap, 2).Generate(); + + Assert.IsTrue(generated.Frames.Count == 5, "Replay must have 5 frames"); + Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time"); + Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect first note release time"); + Assert.AreEqual(2000, generated.Frames[3].Time, "Incorrect second note hit time"); + Assert.AreEqual(2000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[4].Time, "Incorrect second note release time"); + Assert.AreEqual(1, generated.Frames[1].MouseX, "Key 1 has not been pressed"); + Assert.AreEqual(0, generated.Frames[2].MouseX, "Key 1 has not been released"); + Assert.AreEqual(2, generated.Frames[3].MouseX, "Key 2 has not been pressed"); + Assert.AreEqual(0, generated.Frames[4].MouseX, "Key 2 has not been released"); + } + + [Test] + public void TestHoldNoteStair() + { + // | | | + // | | * | + // | * | * | + // | * | * | + // | * | | + // | | | + + var beatmap = new Beatmap(); + beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 }); + beatmap.HitObjects.Add(new HoldNote { StartTime = 2000, Duration = 2000, Column = 1 }); + + var generated = new ManiaAutoGenerator(beatmap, 2).Generate(); + + Assert.IsTrue(generated.Frames.Count == 5, "Replay must have 5 frames"); + Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time"); + Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[3].Time, "Incorrect first note release time"); + Assert.AreEqual(2000, generated.Frames[2].Time, "Incorrect second note hit time"); + Assert.AreEqual(4000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[4].Time, "Incorrect second note release time"); + Assert.AreEqual(1, generated.Frames[1].MouseX, "Key 1 has not been pressed"); + Assert.AreEqual(3, generated.Frames[2].MouseX, "Keys 1 and 2 have not been pressed"); + Assert.AreEqual(2, generated.Frames[3].MouseX, "Key 1 has not been released"); + Assert.AreEqual(0, generated.Frames[4].MouseX, "Key 2 has not been released"); + } + + [Test] + public void TestHoldNoteWithReleasePress() + { + // | | | + // | * | - | + // | * | | + // | * | | + // | | | + + var beatmap = new Beatmap(); + beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 - ManiaAutoGenerator.RELEASE_DELAY }); + beatmap.HitObjects.Add(new Note { StartTime = 3000, Column = 1 }); + + var generated = new ManiaAutoGenerator(beatmap, 2).Generate(); + + Assert.IsTrue(generated.Frames.Count == 4, "Replay must have 4 frames"); + Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time"); + Assert.AreEqual(3000, generated.Frames[2].Time, "Incorrect second note press time + first note release time"); + Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[3].Time, "Incorrect second note release time"); + Assert.AreEqual(1, generated.Frames[1].MouseX, "Key 1 has not been pressed"); + Assert.AreEqual(2, generated.Frames[2].MouseX, "Key 1 has not been released or key 2 has not been pressed"); + Assert.AreEqual(0, generated.Frames[3].MouseX, "Keys 1 and 2 have not been released"); + } + } +} diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 6f45a64d92..3bd195e2f0 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -80,6 +80,7 @@ + From 567e378bbbbfb25d9919637683789e7f9fc73367 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 28 Nov 2017 19:02:39 +0900 Subject: [PATCH 243/282] CI fixes --- osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs index 35ca868d5a..2f336d834f 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs @@ -1,7 +1,6 @@ // 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.Linq; using osu.Game.Beatmaps; From eaf2b1d94df6eb7f02621243e81bb858b5953987 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 28 Nov 2017 19:06:46 +0900 Subject: [PATCH 244/282] Remove line that shouldn't have been added yet --- .../Replays/ManiaFramedReplayInputHandler.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs b/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs index 8440e4347d..12534d6eb4 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs @@ -19,8 +19,6 @@ namespace osu.Game.Rulesets.Mania.Replays this.container = container; } - protected override bool AtImportantFrame => CurrentFrame.MouseX != PreviousFrame.MouseX; - private ManiaPlayfield playfield; public override List GetPendingStates() { From cc9e06e16196710572154c111c8ee51bb9417bbd Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 28 Nov 2017 19:07:00 +0900 Subject: [PATCH 245/282] Remove unused elements --- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 14 +------------- .../Replays/ManiaAutoGenerator.cs | 6 +----- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index 164309c227..dfc9993bde 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -176,22 +176,10 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModAutoplay : ModAutoplay { - private int availableColumns; - - public override void ApplyToRulesetContainer(RulesetContainer rulesetContainer) - { - // Todo: This shouldn't be done, we should be getting a ManiaBeatmap which should store AvailableColumns - // But this is dependent on a _lot_ of refactoring - var maniaRulesetContainer = (ManiaRulesetContainer)rulesetContainer; - availableColumns = maniaRulesetContainer.AvailableColumns; - - base.ApplyToRulesetContainer(rulesetContainer); - } - protected override Score CreateReplayScore(Beatmap beatmap) => new Score { User = new User { Username = "osu!topus!" }, - Replay = new ManiaAutoGenerator(beatmap, availableColumns).Generate(), + Replay = new ManiaAutoGenerator(beatmap).Generate(), }; } } diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs index 2f336d834f..85d840ed70 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs @@ -15,13 +15,9 @@ namespace osu.Game.Rulesets.Mania.Replays { public const double RELEASE_DELAY = 20; - private readonly int availableColumns; - - public ManiaAutoGenerator(Beatmap beatmap, int availableColumns) + public ManiaAutoGenerator(Beatmap beatmap) : base(beatmap) { - this.availableColumns = availableColumns; - Replay = new Replay { User = new User { Username = @"Autoplay" } }; } From 375f2710d417eb182362ce3007224eb053c2e611 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 28 Nov 2017 19:09:17 +0900 Subject: [PATCH 246/282] Rename file --- .../{TestCaseBeatmapConversion.cs => TestCaseAutoGeneration.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename osu.Game.Rulesets.Mania/Tests/{TestCaseBeatmapConversion.cs => TestCaseAutoGeneration.cs} (100%) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseBeatmapConversion.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs similarity index 100% rename from osu.Game.Rulesets.Mania/Tests/TestCaseBeatmapConversion.cs rename to osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs From 00f9f97850cedb827118e998e85dfbf82b707af1 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 28 Nov 2017 19:13:10 +0900 Subject: [PATCH 247/282] Fix compile errors (rider didn't warn me about these) --- .../Tests/TestCaseAutoGeneration.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs index a8a3e9527b..805553eafc 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Mania.Tests var beatmap = new Beatmap(); beatmap.HitObjects.Add(new Note { StartTime = 1000 }); - var generated = new ManiaAutoGenerator(beatmap, 1).Generate(); + var generated = new ManiaAutoGenerator(beatmap).Generate(); Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames"); Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time"); @@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Mania.Tests var beatmap = new Beatmap(); beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 }); - var generated = new ManiaAutoGenerator(beatmap, 1).Generate(); + var generated = new ManiaAutoGenerator(beatmap).Generate(); Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames"); Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time"); @@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Mania.Tests beatmap.HitObjects.Add(new Note { StartTime = 1000 }); beatmap.HitObjects.Add(new Note { StartTime = 1000, Column = 1 }); - var generated = new ManiaAutoGenerator(beatmap, 2).Generate(); + var generated = new ManiaAutoGenerator(beatmap).Generate(); Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames"); Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time"); @@ -85,7 +85,7 @@ namespace osu.Game.Rulesets.Mania.Tests beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 }); beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000, Column = 1 }); - var generated = new ManiaAutoGenerator(beatmap, 2).Generate(); + var generated = new ManiaAutoGenerator(beatmap).Generate(); Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames"); Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time"); @@ -106,7 +106,7 @@ namespace osu.Game.Rulesets.Mania.Tests beatmap.HitObjects.Add(new Note { StartTime = 1000 }); beatmap.HitObjects.Add(new Note { StartTime = 2000, Column = 1 }); - var generated = new ManiaAutoGenerator(beatmap, 2).Generate(); + var generated = new ManiaAutoGenerator(beatmap).Generate(); Assert.IsTrue(generated.Frames.Count == 5, "Replay must have 5 frames"); Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time"); @@ -133,7 +133,7 @@ namespace osu.Game.Rulesets.Mania.Tests beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 }); beatmap.HitObjects.Add(new HoldNote { StartTime = 2000, Duration = 2000, Column = 1 }); - var generated = new ManiaAutoGenerator(beatmap, 2).Generate(); + var generated = new ManiaAutoGenerator(beatmap).Generate(); Assert.IsTrue(generated.Frames.Count == 5, "Replay must have 5 frames"); Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time"); @@ -159,7 +159,7 @@ namespace osu.Game.Rulesets.Mania.Tests beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 - ManiaAutoGenerator.RELEASE_DELAY }); beatmap.HitObjects.Add(new Note { StartTime = 3000, Column = 1 }); - var generated = new ManiaAutoGenerator(beatmap, 2).Generate(); + var generated = new ManiaAutoGenerator(beatmap).Generate(); Assert.IsTrue(generated.Frames.Count == 4, "Replay must have 4 frames"); Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time"); From 2bb61e51ac6f95065ab28c6f9b9febc15650180b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Nov 2017 19:43:26 +0900 Subject: [PATCH 248/282] Add catcher scale based on CircleSize --- .../Tests/TestCaseCatchStacker.cs | 14 +++++++-- .../Tests/TestCaseCatcherArea.cs | 30 ++++++++++++------- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 12 ++++---- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs index 1c5f34f2e5..586de17f15 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs @@ -11,13 +11,23 @@ namespace osu.Game.Rulesets.Catch.Tests [Ignore("getting CI working")] public class TestCaseCatchStacker : Game.Tests.Visual.TestCasePlayer { - public TestCaseCatchStacker() : base(typeof(CatchRuleset)) + public TestCaseCatchStacker() + : base(typeof(CatchRuleset)) { } protected override Beatmap CreateBeatmap() { - var beatmap = new Beatmap(); + var beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + BaseDifficulty = new BeatmapDifficulty + { + CircleSize = 6, + } + } + }; for (int i = 0; i < 512; i++) beatmap.HitObjects.Add(new Fruit { X = 0.5f + i / 2048f * (i % 10 - 5), StartTime = i * 100, NewCombo = i % 8 == 0 }); diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs index 21c24aed93..84ca08f97e 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.UI; using osu.Game.Tests.Visual; @@ -15,26 +16,35 @@ namespace osu.Game.Rulesets.Catch.Tests [Ignore("getting CI working")] internal class TestCaseCatcherArea : OsuTestCase { + private RulesetInfo catchRuleset; + public override IReadOnlyList RequiredTypes => new[] { typeof(CatcherArea), }; - [BackgroundDependencyLoader] - private void load(RulesetStore rulesets) + public TestCaseCatcherArea() { - Children = new Drawable[] + AddSliderStep("CircleSize", 0, 8, 5, craeteCatcher); + } + + private void craeteCatcher(float size) + { + Child = new CatchInputManager(catchRuleset) { - new CatchInputManager(rulesets.GetRuleset(2)) + RelativeSizeAxes = Axes.Both, + Child = new CatcherArea(new BeatmapDifficulty { CircleSize = size }) { - RelativeSizeAxes = Axes.Both, - Child = new CatcherArea() - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft - } + Anchor = Anchor.CentreLeft, + Origin = Anchor.BottomLeft }, }; } + + [BackgroundDependencyLoader] + private void load(RulesetStore rulesets) + { + catchRuleset = rulesets.GetRuleset(2); + } } } diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 1cc810201f..203db1bb8c 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Catch.UI catcher.Add(fruit); } - public bool CanCatch(CatchHitObject obj) => Math.Abs(catcher.Position.X - obj.X) < catcher.DrawSize.X / DrawSize.X / 2; + public bool CanCatch(CatchHitObject obj) => Math.Abs(catcher.Position.X - obj.X) < catcher.DrawSize.X * Math.Abs(catcher.Scale.X) / DrawSize.X / 2; public class Catcher : Container, IKeyBindingHandler { @@ -68,10 +68,12 @@ namespace osu.Game.Rulesets.Catch.UI RelativePositionAxes = Axes.X; X = 0.5f; - Origin = Anchor.BottomCentre; - Anchor = Anchor.BottomLeft; + Origin = Anchor.TopCentre; + Anchor = Anchor.TopLeft; Size = new Vector2(CATCHER_SIZE); + if (difficulty != null) + Scale = new Vector2(1.0f - 0.7f * (difficulty.CircleSize - 5) / 5); } [BackgroundDependencyLoader] @@ -115,7 +117,7 @@ namespace osu.Game.Rulesets.Catch.UI var additive = createCatcherSprite(); additive.Anchor = Anchor; - additive.OriginPosition = additive.OriginPosition + new Vector2(DrawWidth / 2, DrawHeight); // also temporary to align sprite correctly. + additive.OriginPosition = additive.OriginPosition + new Vector2(DrawWidth / 2, 0); // also temporary to align sprite correctly. additive.Position = Position; additive.Scale = Scale; additive.RelativePositionAxes = RelativePositionAxes; @@ -201,7 +203,7 @@ namespace osu.Game.Rulesets.Catch.UI double dashModifier = Dashing ? 1 : 0.5; - Scale = new Vector2(Math.Sign(currentDirection), 1); + Scale = new Vector2(Math.Abs(Scale.X) * Math.Sign(currentDirection), Scale.Y); X = (float)MathHelper.Clamp(X + Math.Sign(currentDirection) * Clock.ElapsedFrameTime * BASE_SPEED * dashModifier, 0, 1); } From 23b4d2163ca2fc5f8128fbc814aef37b7e544292 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Nov 2017 21:30:03 +0900 Subject: [PATCH 249/282] Fix spelling and grammar --- osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs | 4 ++-- osu.Game/Beatmaps/BeatmapConverter.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs index 84ca08f97e..538f6930ed 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs @@ -25,10 +25,10 @@ namespace osu.Game.Rulesets.Catch.Tests public TestCaseCatcherArea() { - AddSliderStep("CircleSize", 0, 8, 5, craeteCatcher); + AddSliderStep("CircleSize", 0, 8, 5, createCatcher); } - private void craeteCatcher(float size) + private void createCatcher(float size) { Child = new CatchInputManager(catchRuleset) { diff --git a/osu.Game/Beatmaps/BeatmapConverter.cs b/osu.Game/Beatmaps/BeatmapConverter.cs index 6132322f1e..e087eebbfe 100644 --- a/osu.Game/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Beatmaps/BeatmapConverter.cs @@ -80,7 +80,7 @@ namespace osu.Game.Beatmaps /// /// Performs the conversion of a hit object. - /// This method generally executed sequentially for all objects in a beatmap. + /// This method is generally executed sequentially for all objects in a beatmap. /// /// The hit object to convert. /// The un-converted Beatmap. From 7db7fb91ddc35c5408ac47273e2e0a3b3674526d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 28 Nov 2017 21:45:24 +0900 Subject: [PATCH 250/282] Ignore ruleset testcases from CI --- osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs | 3 +++ osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs | 3 +++ osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs | 3 +++ osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs | 3 +++ 4 files changed, 12 insertions(+) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs index 6643316f15..0d2dc14160 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs @@ -1,8 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using NUnit.Framework; + namespace osu.Game.Rulesets.Catch.Tests { + [Ignore("getting CI working")] public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() diff --git a/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs index e60808b1a6..8aa8c6b799 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs @@ -1,8 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using NUnit.Framework; + namespace osu.Game.Rulesets.Mania.Tests { + [Ignore("getting CI working")] public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() diff --git a/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs index 36590b484f..25a6110459 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs @@ -1,8 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using NUnit.Framework; + namespace osu.Game.Rulesets.Osu.Tests { + [Ignore("getting CI working")] public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs index 269aca2cd9..96d5b20b6e 100644 --- a/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs @@ -1,8 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using NUnit.Framework; + namespace osu.Game.Rulesets.Taiko.Tests { + [Ignore("getting CI working")] public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() From f807d26caecf0ce8e08c6a97f54a4b73851610a3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 28 Nov 2017 21:46:13 +0900 Subject: [PATCH 251/282] Use ranked property of mods rather than checking for individual mods --- osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs index cc5abb36b5..cd6b6c5e27 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs @@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Osu.Scoring countMiss = Convert.ToInt32(Score.Statistics["x"]); // Don't count scores made with supposedly unranked mods - if (mods.Any(m => m is OsuModRelax || m is OsuModAutopilot || m is OsuModAutoplay)) + if (mods.Any(m => !m.Ranked)) return 0; // Todo: In the future we should apply changes to PreEmpt/AR at an OsuHitObject/BaseDifficulty level, but this is done From 66fa10869623e096d82bcd0142b09341c84c1171 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Nov 2017 22:24:56 +0900 Subject: [PATCH 252/282] Vertically centre the panels in osu!direct --- osu.Game/Overlays/DirectOverlay.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index b49ac269a9..0b7a30797d 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -220,7 +220,11 @@ namespace osu.Game.Overlays switch (displayStyle) { case PanelDisplayStyle.Grid: - return new DirectGridPanel(b); + return new DirectGridPanel(b) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }; default: return new DirectListPanel(b); } From 1aa79a2d884a6daf4cba7837fe0d1f1eca8ab4ce Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 29 Nov 2017 01:26:21 +0900 Subject: [PATCH 253/282] Hide inspectcode output from appveyor console --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 9048428590..78e0e6da4e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,5 +21,5 @@ build: parallel: true verbosity: minimal after_build: - - cmd: inspectcode /o="inspectcodereport.xml" /caches-home="inspectcode" osu.sln + - cmd: inspectcode /o="inspectcodereport.xml" /caches-home="inspectcode" osu.sln > NUL - cmd: NVika parsereport "inspectcodereport.xml" --treatwarningsaserrors \ No newline at end of file From 6f5803b5eb39a2103096f83e3731c9763ff08900 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 29 Nov 2017 01:51:22 +0900 Subject: [PATCH 254/282] Shallow clone submodules --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 78e0e6da4e..ea9a1fa3bf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,7 @@ cache: - inspectcode -> appveyor.yml - packages -> **\packages.config install: - - cmd: git submodule update --init --recursive + - cmd: git submodule update --init --recursive --depth=5 - cmd: choco install resharper-clt -y - cmd: choco install nvika -y - cmd: appveyor DownloadFile https://github.com/peppy/CodeFileSanity/releases/download/v0.2.3/CodeFileSanity.exe From 8370d7694638d2de0f495e673b73b5687a654ff1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 29 Nov 2017 12:27:18 +0900 Subject: [PATCH 255/282] Quieten nuget --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ea9a1fa3bf..9cf68803a2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,11 +15,11 @@ install: - cmd: appveyor DownloadFile https://github.com/peppy/CodeFileSanity/releases/download/v0.2.3/CodeFileSanity.exe before_build: - cmd: CodeFileSanity.exe - - cmd: nuget restore + - cmd: nuget restore -verbosity quiet build: project: osu.sln parallel: true verbosity: minimal after_build: - - cmd: inspectcode /o="inspectcodereport.xml" /caches-home="inspectcode" osu.sln > NUL + - cmd: inspectcode --o="inspectcodereport.xml" --projects:osu.Game* --caches-home="inspectcode" osu.sln > NUL - cmd: NVika parsereport "inspectcodereport.xml" --treatwarningsaserrors \ No newline at end of file From d1afbf80557773f00936865a860a8714e4a7b645 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 29 Nov 2017 13:10:13 +0900 Subject: [PATCH 256/282] Load Player-based TestCases asynchronously --- osu.Game/Tests/Visual/TestCasePlayer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs index f3a6d1efc3..64da838494 100644 --- a/osu.Game/Tests/Visual/TestCasePlayer.cs +++ b/osu.Game/Tests/Visual/TestCasePlayer.cs @@ -78,7 +78,7 @@ namespace osu.Game.Tests.Visual if (Player != null) Remove(Player); - LoadScreen(CreatePlayer(working, instance)); + LoadComponentAsync(CreatePlayer(working, instance), LoadScreen); } protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) => new Player From 1136db15562454e6c44d23b7d23030d9e1d501d9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 29 Nov 2017 14:20:15 +0900 Subject: [PATCH 257/282] Fix mania replays not defining important frames Resolves https://github.com/ppy/osu/issues/1495 . --- .../Replays/ManiaAutoGenerator.cs | 9 +++++---- .../Replays/ManiaReplayFrame.cs | 17 +++++++++++++++++ .../osu.Game.Rulesets.Mania.csproj | 1 + osu.Game/Rulesets/Replays/ReplayFrame.cs | 4 ++-- 4 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs index 64982532a7..58fb43aa83 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs @@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mania.Replays public override Replay Generate() { // Todo: Realistically this shouldn't be needed, but the first frame is skipped with the way replays are currently handled - Replay.Frames.Add(new ReplayFrame(-100000, null, null, ReplayButtonState.None)); + Replay.Frames.Add(new ManiaReplayFrame(-100000, null, null, ReplayButtonState.None)); double[] holdEndTimes = new double[availableColumns]; for (int i = 0; i < availableColumns; i++) @@ -60,7 +60,7 @@ namespace osu.Game.Rulesets.Mania.Replays activeColumns |= 1 << obj.Column; } - Replay.Frames.Add(new ReplayFrame(groupTime, activeColumns, null, ReplayButtonState.None)); + Replay.Frames.Add(new ManiaReplayFrame(groupTime, activeColumns, null, ReplayButtonState.None)); // Add the release frames. We can't do this with the loop above because we need activeColumns to be fully populated foreach (var obj in objGroup.GroupBy(h => (h as IHasEndTime)?.EndTime ?? h.StartTime + release_delay).OrderBy(h => h.Key)) @@ -74,14 +74,15 @@ namespace osu.Game.Rulesets.Mania.Replays activeColumnsAtEnd |= 1 << i; } - Replay.Frames.Add(new ReplayFrame(groupEndTime, activeColumnsAtEnd, 0, ReplayButtonState.None)); + Replay.Frames.Add(new ManiaReplayFrame(groupEndTime, activeColumnsAtEnd, 0, ReplayButtonState.None)); } } Replay.Frames = Replay.Frames // Pick the maximum activeColumns for all frames at the same time .GroupBy(f => f.Time) - .Select(g => new ReplayFrame(g.First().Time, maxMouseX(g), 0, ReplayButtonState.None)) + .Select(g => new ManiaReplayFrame(g.First().Time, maxMouseX(g), 0, ReplayButtonState.None)) + .Cast() // The addition of release frames above maybe result in unordered frames, but we need them ordered .OrderBy(f => f.Time) .ToList(); diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs b/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs new file mode 100644 index 0000000000..c27ffa1875 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Replays; + +namespace osu.Game.Rulesets.Mania.Replays +{ + public class ManiaReplayFrame : ReplayFrame + { + public override bool IsImportant => MouseX > 0; + + public ManiaReplayFrame(double time, float? mouseX, float? mouseY, ReplayButtonState buttonState) + : base(time, mouseX, mouseY, buttonState) + { + } + } +} diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 6f45a64d92..22f858c2ea 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -72,6 +72,7 @@ + diff --git a/osu.Game/Rulesets/Replays/ReplayFrame.cs b/osu.Game/Rulesets/Replays/ReplayFrame.cs index b0f62e5271..02c969f648 100644 --- a/osu.Game/Rulesets/Replays/ReplayFrame.cs +++ b/osu.Game/Rulesets/Replays/ReplayFrame.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Replays { public Vector2 Position => new Vector2(MouseX ?? 0, MouseY ?? 0); - public bool IsImportant => MouseX.HasValue && MouseY.HasValue && (MouseLeft || MouseRight); + public virtual bool IsImportant => MouseX.HasValue && MouseY.HasValue && (MouseLeft || MouseRight); public float? MouseX; public float? MouseY; @@ -68,4 +68,4 @@ namespace osu.Game.Rulesets.Replays return $"{Time}\t({MouseX},{MouseY})\t{MouseLeft}\t{MouseRight}\t{MouseLeft1}\t{MouseRight1}\t{MouseLeft2}\t{MouseRight2}\t{ButtonState}"; } } -} \ No newline at end of file +} From 6fd550dc91de4557157a317de1897fd29f901184 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 29 Nov 2017 15:47:10 +0900 Subject: [PATCH 258/282] Simplify/sanitize construction of ManiaReplayFrame --- osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs | 10 +++++----- osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs index 58fb43aa83..ca80bf8413 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs @@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mania.Replays public override Replay Generate() { // Todo: Realistically this shouldn't be needed, but the first frame is skipped with the way replays are currently handled - Replay.Frames.Add(new ManiaReplayFrame(-100000, null, null, ReplayButtonState.None)); + Replay.Frames.Add(new ManiaReplayFrame(-100000, 0)); double[] holdEndTimes = new double[availableColumns]; for (int i = 0; i < availableColumns; i++) @@ -60,7 +60,7 @@ namespace osu.Game.Rulesets.Mania.Replays activeColumns |= 1 << obj.Column; } - Replay.Frames.Add(new ManiaReplayFrame(groupTime, activeColumns, null, ReplayButtonState.None)); + Replay.Frames.Add(new ManiaReplayFrame(groupTime, activeColumns)); // Add the release frames. We can't do this with the loop above because we need activeColumns to be fully populated foreach (var obj in objGroup.GroupBy(h => (h as IHasEndTime)?.EndTime ?? h.StartTime + release_delay).OrderBy(h => h.Key)) @@ -74,14 +74,14 @@ namespace osu.Game.Rulesets.Mania.Replays activeColumnsAtEnd |= 1 << i; } - Replay.Frames.Add(new ManiaReplayFrame(groupEndTime, activeColumnsAtEnd, 0, ReplayButtonState.None)); + Replay.Frames.Add(new ManiaReplayFrame(groupEndTime, activeColumnsAtEnd)); } } Replay.Frames = Replay.Frames // Pick the maximum activeColumns for all frames at the same time .GroupBy(f => f.Time) - .Select(g => new ManiaReplayFrame(g.First().Time, maxMouseX(g), 0, ReplayButtonState.None)) + .Select(g => new ManiaReplayFrame(g.First().Time, maxMouseX(g))) .Cast() // The addition of release frames above maybe result in unordered frames, but we need them ordered .OrderBy(f => f.Time) @@ -95,7 +95,7 @@ namespace osu.Game.Rulesets.Mania.Replays /// /// The grouping to search. /// The maximum by count of bits. - private float maxMouseX(IGrouping group) + private int maxMouseX(IGrouping group) { int currentCount = -1; int currentMax = 0; diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs b/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs index c27ffa1875..8473d23b89 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs @@ -9,8 +9,8 @@ namespace osu.Game.Rulesets.Mania.Replays { public override bool IsImportant => MouseX > 0; - public ManiaReplayFrame(double time, float? mouseX, float? mouseY, ReplayButtonState buttonState) - : base(time, mouseX, mouseY, buttonState) + public ManiaReplayFrame(double time, int activeColumns) + : base(time, (float)activeColumns, null, ReplayButtonState.None) { } } From 1ea089eb743c0f7b4eca26f5fc70e943a89d341f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 29 Nov 2017 15:53:41 +0900 Subject: [PATCH 259/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index d92cec7645..4fc866eee3 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit d92cec764538da2e7ed95bfb566f6bc81a9667c8 +Subproject commit 4fc866eee3803f88b155150e32e021b9c21e647f From bad970d1d1f0b0feee09c54ab3b5ee7918458d90 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 29 Nov 2017 17:25:55 +0900 Subject: [PATCH 260/282] Add wait steps to ensure the player is completely loaded before continuing --- osu.Game/Tests/Visual/TestCasePlayer.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs index 64da838494..d9951e002b 100644 --- a/osu.Game/Tests/Visual/TestCasePlayer.cs +++ b/osu.Game/Tests/Visual/TestCasePlayer.cs @@ -50,7 +50,11 @@ namespace osu.Game.Tests.Visual string instantiation = ruleset?.AssemblyQualifiedName; foreach (var r in rulesets.AvailableRulesets.Where(rs => instantiation == null || rs.InstantiationInfo == instantiation)) - AddStep(r.Name, () => loadPlayerFor(r)); + { + Player p = null; + AddStep(r.Name, () => p = loadPlayerFor(r)); + AddUntilStep(() => p.IsLoaded); + } } protected virtual Beatmap CreateBeatmap() @@ -64,7 +68,7 @@ namespace osu.Game.Tests.Visual return beatmap; } - private void loadPlayerFor(RulesetInfo r) + private Player loadPlayerFor(RulesetInfo r) { var beatmap = CreateBeatmap(); @@ -78,7 +82,11 @@ namespace osu.Game.Tests.Visual if (Player != null) Remove(Player); - LoadComponentAsync(CreatePlayer(working, instance), LoadScreen); + var player = CreatePlayer(working, instance); + + LoadComponentAsync(player, LoadScreen); + + return player; } protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) => new Player From 7cbca37e2df471b03f20232cc1eb58a074b383b4 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Wed, 29 Nov 2017 18:18:36 +0900 Subject: [PATCH 261/282] Remove redundant cast --- osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs b/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs index 8473d23b89..d1bc7da911 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs @@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Mania.Replays public override bool IsImportant => MouseX > 0; public ManiaReplayFrame(double time, int activeColumns) - : base(time, (float)activeColumns, null, ReplayButtonState.None) + : base(time, activeColumns, null, ReplayButtonState.None) { } } From d69fa0966f83887c5d26cb4f0dcb2fe17621f8d8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 29 Nov 2017 18:42:54 +0900 Subject: [PATCH 262/282] Generate ManiaReplayFrame instead of ReplayFrame --- osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs index 44297c1fb1..153fee3ab6 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs @@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Mania.Replays activeColumns ^= 1 << point.Column; } - Replay.Frames.Add(new ReplayFrame(group.First().Time, activeColumns, 0, ReplayButtonState.None)); + Replay.Frames.Add(new ManiaReplayFrame(group.First().Time, activeColumns)); } return Replay; From 801d81ecfcae0cfc2c912c233c07ce2eb98470af Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 29 Nov 2017 19:00:08 +0900 Subject: [PATCH 263/282] Add a notice when not logged in --- .../Tests/Visual/TestCasePerformancePoints.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index 80167e5e1f..6da14e9b12 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Game.Beatmaps; using osu.Game.Graphics.Sprites; @@ -220,6 +221,17 @@ namespace osu.Game.Tests.Visual private void load(OsuGameBase osuGame, APIAccess api) { this.api = api; + + if (!api.IsLoggedIn) + { + InternalChild = new SpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Text = "Please login to see online scores", + }; + } + osuGame.Beatmap.ValueChanged += beatmapChanged; } @@ -229,6 +241,9 @@ namespace osu.Game.Tests.Visual lastRequest?.Cancel(); scores.Clear(); + if (!api.IsLoggedIn) + return; + lastRequest = new GetScoresRequest(newBeatmap.BeatmapInfo); lastRequest.Success += res => res.Scores.ForEach(s => scores.Add(new PerformanceDisplay(s, newBeatmap.Beatmap))); api.Queue(lastRequest); From 6dd6f08bd05a3f14d8c262e99e17978512309c37 Mon Sep 17 00:00:00 2001 From: mattiapette Date: Wed, 29 Nov 2017 11:51:56 +0100 Subject: [PATCH 264/282] Random song selection when entering the select menu with default osu theme or invalid beatmap --- osu.Game/Screens/Select/SongSelect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index a0b788d777..6fcaff7976 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -211,7 +211,7 @@ namespace osu.Game.Screens.Select if (Beatmap.Value.BeatmapSetInfo?.DeletePending == false) carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo, false); else - carousel.SelectNext(); + carousel.SelectNextRandom(); } private void carouselRaisedStart(InputState state = null) From 2b7bf285e4bc860074058bf163aac32e9aaf78a1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 29 Nov 2017 20:07:00 +0900 Subject: [PATCH 265/282] Improve code quality --- osu.Game/Screens/Select/BeatmapDetails.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 3cd6c3b107..eb313319bd 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -320,26 +320,25 @@ namespace osu.Game.Screens.Select return; } - this.FadeIn(transition_duration); setTextAsync(value); } } private void setTextAsync(string text) { - var newTextFlow = new TextFlowContainer + LoadComponentAsync(new TextFlowContainer(s => s.TextSize = 14) { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Colour = textFlow.Colour, - }; - - newTextFlow.AddText(text, s => s.TextSize = 14); - - LoadComponentAsync(newTextFlow, d => + Text = text + }, loaded => { - textContainer.Remove(textFlow); - textContainer.Add(textFlow = d); + textFlow?.Expire(); + textContainer.Add(textFlow = loaded); + + // fade in if we haven't yet. + this.FadeIn(transition_duration); }); } From b2fc50247c053b1563f69a744664b4b407501e70 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 29 Nov 2017 20:13:00 +0900 Subject: [PATCH 266/282] Hide metadata by default to avoid initial jump when no data present --- osu.Game/Screens/Select/BeatmapDetails.cs | 65 ++++++++++++----------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index eb313319bd..a9a778fe17 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -310,6 +310,39 @@ namespace osu.Game.Screens.Select private readonly FillFlowContainer textContainer; private TextFlowContainer textFlow; + public MetadataSection(string title) + { + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + Alpha = 0; + + InternalChild = textContainer = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Spacing = new Vector2(spacing / 2), + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Child = new OsuSpriteText + { + Text = title, + Font = @"Exo2.0-Bold", + TextSize = 14, + }, + }, + textFlow = new TextFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + }, + }, + }; + } + public string Text { set @@ -347,38 +380,6 @@ namespace osu.Game.Screens.Select get { return textFlow.Colour; } set { textFlow.Colour = value; } } - - public MetadataSection(string title) - { - RelativeSizeAxes = Axes.X; - AutoSizeAxes = Axes.Y; - - InternalChild = textContainer = new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Spacing = new Vector2(spacing / 2), - Children = new Drawable[] - { - new Container - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Child = new OsuSpriteText - { - Text = title, - Font = @"Exo2.0-Bold", - TextSize = 14, - }, - }, - textFlow = new TextFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - }, - }, - }; - } } private class DimmedLoadingAnimation : VisibilityContainer From 6e50fa29147f0fd75c4d0460ab0b7431541c8caa Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 29 Nov 2017 23:47:42 +0900 Subject: [PATCH 267/282] Update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index a4cbd332c4..d830e87aaf 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit a4cbd332c4fcdd682252f5a89d8c01052b405e86 +Subproject commit d830e87aafd666aa0a42bd42351b17b05157dcaf diff --git a/osu-resources b/osu-resources index c3def1cf00..c79d917605 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit c3def1cf0038c5a8bcbe35a56914ffeebb25b10b +Subproject commit c79d917605fa792a5f046fd70d7aa75e58dc9fbc From ec04871abd756dc6fe39d23c500014f943c7e72e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 30 Nov 2017 00:02:10 +0900 Subject: [PATCH 268/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index d830e87aaf..92fd14146f 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit d830e87aafd666aa0a42bd42351b17b05157dcaf +Subproject commit 92fd14146f41c63df29032684d66be40a34fad6b From 49f0a7ff36af98b768fe866f0d5ad598c363b0b4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 30 Nov 2017 00:02:22 +0900 Subject: [PATCH 269/282] Add LangVer to osu.Game.props --- osu.Game.props | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.props b/osu.Game.props index c352fa2b06..61d5bea511 100644 --- a/osu.Game.props +++ b/osu.Game.props @@ -1,5 +1,6 @@ + osu.licenseheader From 0ec10ba32d9ecfc9fec949a38aa6a514bd817df5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 30 Nov 2017 00:11:00 +0900 Subject: [PATCH 270/282] CI fixes --- osu.Desktop/Overlays/VersionManager.cs | 1 - osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs | 4 ++-- osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs | 2 +- osu.Game/Overlays/Settings/SidebarButton.cs | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 9f2f79f1df..0780ed9cce 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -21,7 +21,6 @@ using OpenTK.Graphics; #if NET_FRAMEWORK using System; -using System.Net.Http; using osu.Framework.Logging; using Squirrel; #endif diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs index 95b691e07f..53989c8775 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs @@ -126,7 +126,7 @@ namespace osu.Game.Tests.Beatmaps.Formats var beatmap = decoder.Decode(new StreamReader(stream)); var curveData = beatmap.HitObjects[0] as IHasCurve; - var positionData = beatmap.HitObjects[0] as IHasPosition; + var positionData = (IHasPosition)beatmap.HitObjects[0]; Assert.IsNotNull(positionData); Assert.IsNotNull(curveData); @@ -134,7 +134,7 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.AreEqual(956, beatmap.HitObjects[0].StartTime); Assert.IsTrue(beatmap.HitObjects[0].Samples.Any(s => s.Name == SampleInfo.HIT_NORMAL)); - positionData = beatmap.HitObjects[1] as IHasPosition; + positionData = (IHasPosition)beatmap.HitObjects[1]; Assert.IsNotNull(positionData); Assert.AreEqual(new Vector2(304, 56), positionData.Position); diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 8a835634b8..b59df1214a 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -75,7 +75,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu { private readonly OsuSpriteText valueText; - public int Count + public new int Count { set { valueText.Text = value.ToString(); } } diff --git a/osu.Game/Overlays/Settings/SidebarButton.cs b/osu.Game/Overlays/Settings/SidebarButton.cs index 4b8366f0fc..bc5357f05a 100644 --- a/osu.Game/Overlays/Settings/SidebarButton.cs +++ b/osu.Game/Overlays/Settings/SidebarButton.cs @@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Settings private readonly SpriteText headerText; private readonly Box selectionIndicator; private readonly Container text; - public Action Action; + public new Action Action; private SettingsSection section; public SettingsSection Section From a0c33499352682b894fc8f84321badc3ca722107 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 30 Nov 2017 00:45:37 +0900 Subject: [PATCH 271/282] Add LangVer.props and osu.Game.props for common csproj properties --- LangVer.props | 6 ++++++ osu.Desktop.Deploy/osu.Desktop.Deploy.csproj | 5 +---- osu.Desktop/osu.Desktop.csproj | 6 +----- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 5 +---- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 5 +---- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 5 +---- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 5 +---- osu.Game.Tests/osu.Game.Tests.csproj | 5 +---- osu.Game.props | 9 +++++++++ osu.Game/osu.Game.csproj | 5 +---- 10 files changed, 23 insertions(+), 33 deletions(-) create mode 100644 LangVer.props create mode 100644 osu.Game.props diff --git a/LangVer.props b/LangVer.props new file mode 100644 index 0000000000..2ff5e95378 --- /dev/null +++ b/LangVer.props @@ -0,0 +1,6 @@ + + + + 6 + + \ No newline at end of file diff --git a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj index 6727a86a91..316d85db47 100644 --- a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj +++ b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj @@ -1,5 +1,6 @@  + Debug @@ -22,7 +23,6 @@ DEBUG;TRACE prompt 4 - 6 AnyCPU @@ -102,9 +102,6 @@ - - osu.licenseheader - PreserveNewest diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 91c0da6f65..bf259c48ba 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -1,5 +1,6 @@  + {419659FD-72EA-4678-9EB8-B22A746CED70} Debug @@ -62,7 +63,6 @@ false - 6 none @@ -98,7 +98,6 @@ full AnyCPU false - 6 prompt --tests @@ -174,9 +173,6 @@ - - osu.licenseheader - diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index b7916f674e..b855e6178b 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -1,5 +1,6 @@  + Debug @@ -21,7 +22,6 @@ prompt 4 false - 6 pdbonly @@ -74,9 +74,6 @@ - - osu.licenseheader - diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 19832d733e..b91f38cd3d 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -1,5 +1,6 @@  + Debug @@ -21,7 +22,6 @@ prompt 4 false - 6 pdbonly @@ -99,9 +99,6 @@ - - osu.licenseheader - diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 2be057de40..05fb71afdf 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -1,5 +1,6 @@  + Debug @@ -22,7 +23,6 @@ prompt 4 false - 6 pdbonly @@ -105,9 +105,6 @@ - - osu.licenseheader - diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 0b4e6e43f2..7b86fd921f 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -1,5 +1,6 @@  + Debug @@ -21,7 +22,6 @@ prompt 4 false - 6 pdbonly @@ -96,9 +96,6 @@ - - osu.licenseheader - diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 312a564f71..8e7bfaa166 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,5 +1,6 @@  + Debug AnyCPU @@ -19,7 +20,6 @@ 4 false false - 6 true @@ -45,9 +45,6 @@ - - osu.licenseheader - diff --git a/osu.Game.props b/osu.Game.props new file mode 100644 index 0000000000..61d5bea511 --- /dev/null +++ b/osu.Game.props @@ -0,0 +1,9 @@ + + + + + + osu.licenseheader + + + \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ccd1bd03dc..aebd250489 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -1,5 +1,6 @@  + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D} Debug @@ -61,7 +62,6 @@ false - 6 none @@ -195,9 +195,6 @@ - - osu.licenseheader - From 006d67993905fac5c22f786cabc6f61134d58326 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 30 Nov 2017 00:53:07 +0900 Subject: [PATCH 272/282] Migrate to C#7 --- LangVer.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LangVer.props b/LangVer.props index 2ff5e95378..e6a8b4b38c 100644 --- a/LangVer.props +++ b/LangVer.props @@ -1,6 +1,6 @@ - 6 + 7 \ No newline at end of file From 36be171c298d5c9aa43257d0b5b855d07b06bac9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 30 Nov 2017 02:06:03 +0900 Subject: [PATCH 273/282] Fix up/clean up csprojs for C#7 support --- LangVer.props | 4 +++- osu.Desktop.Deploy/osu.Desktop.Deploy.csproj | 3 +-- osu.Desktop/osu.Desktop.csproj | 2 +- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 1 - osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 1 - osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 1 - osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 1 - osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game.props | 2 +- osu.Game/osu.Game.csproj | 2 +- 10 files changed, 8 insertions(+), 11 deletions(-) diff --git a/LangVer.props b/LangVer.props index e6a8b4b38c..c3aee0505a 100644 --- a/LangVer.props +++ b/LangVer.props @@ -1,5 +1,7 @@ - + + + 7 diff --git a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj index 316d85db47..3bec56d322 100644 --- a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj +++ b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj @@ -1,7 +1,6 @@  - - + Debug AnyCPU diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index bf259c48ba..e4e9807754 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -1,5 +1,5 @@  - + {419659FD-72EA-4678-9EB8-B22A746CED70} diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index b855e6178b..4605a1f50e 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -1,7 +1,6 @@  - Debug AnyCPU diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index b91f38cd3d..ec6f59b5be 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -1,7 +1,6 @@  - Debug AnyCPU diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 05fb71afdf..5a0581f48b 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -1,7 +1,6 @@  - Debug AnyCPU diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 7b86fd921f..72e9e6a061 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -1,7 +1,6 @@  - Debug AnyCPU diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 8e7bfaa166..b4242052d5 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,5 +1,5 @@  - + Debug diff --git a/osu.Game.props b/osu.Game.props index 61d5bea511..4173adb509 100644 --- a/osu.Game.props +++ b/osu.Game.props @@ -1,5 +1,5 @@ - + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index aebd250489..f814cbb3d3 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -1,5 +1,5 @@  - + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D} From 7451bdaa0ee56b82f5fd22af1016b203adc5b29d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 30 Nov 2017 02:06:24 +0900 Subject: [PATCH 274/282] Update DotSettings --- osu.sln.DotSettings | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index fdfbf25144..92ef2d1021 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -34,6 +34,7 @@ HINT WARNING WARNING + HINT WARNING WARNING DO_NOT_SHOW @@ -44,13 +45,16 @@ WARNING ERROR HINT + HINT HINT WARNING WARNING + DO_NOT_SHOW DO_NOT_SHOW HINT HINT HINT + HINT WARNING WARNING WARNING @@ -149,6 +153,7 @@ WARNING WARNING WARNING + HINT WARNING WARNING HINT From edb9b1907905ac6afefd62169cdbb8634df3669b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Dec 2017 13:53:18 +0900 Subject: [PATCH 275/282] Make JoinNullCheckWithAssignment a hint --- osu.sln.DotSettings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 92ef2d1021..76929dcbb3 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -49,7 +49,7 @@ HINT WARNING WARNING - DO_NOT_SHOW + HINT DO_NOT_SHOW HINT HINT From a73dfd692bd433f47f2847bbc385a46d62f30979 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Dec 2017 13:53:32 +0900 Subject: [PATCH 276/282] Merge LangVer.props and osu.Game.props --- LangVer.props | 8 -------- osu.Game.props | 6 +++++- 2 files changed, 5 insertions(+), 9 deletions(-) delete mode 100644 LangVer.props diff --git a/LangVer.props b/LangVer.props deleted file mode 100644 index c3aee0505a..0000000000 --- a/LangVer.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - 7 - - \ No newline at end of file diff --git a/osu.Game.props b/osu.Game.props index 4173adb509..60a5e97944 100644 --- a/osu.Game.props +++ b/osu.Game.props @@ -1,6 +1,10 @@ - + + + + 7 + osu.licenseheader From 19051dd52962642c0323ce8d0355bcb529cc7845 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Dec 2017 16:44:49 +0900 Subject: [PATCH 277/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 4fc866eee3..87d68cda00 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 4fc866eee3803f88b155150e32e021b9c21e647f +Subproject commit 87d68cda0015d51dc3da56d2322fa10d399fc4ed From 0b95e36675b2131ae7eb0ca5185678f8d432a627 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Dec 2017 18:00:20 +0900 Subject: [PATCH 278/282] Fix RelativeChildSize error temporarily --- .../Edit/Components/Timelines/Summary/Parts/TimelinePart.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs index 229d06ef09..8a19784be9 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs @@ -40,7 +40,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts return; } - timeline.RelativeChildSize = new Vector2((float)Math.Max(1, Beatmap.Value.Track.Length), 1); + timeline.RelativeChildSize = Beatmap.Value.Track.Length == double.PositiveInfinity ? Vector2.One : new Vector2((float)Math.Max(1, Beatmap.Value.Track.Length), 1); } protected void Add(Drawable visualisation) => timeline.Add(visualisation); From 5be00cb0ecd9990a6c277a268725655d001775dd Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Dec 2017 18:40:55 +0900 Subject: [PATCH 279/282] Add todo --- .../Edit/Components/Timelines/Summary/Parts/TimelinePart.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs index 8a19784be9..df95a5c384 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs @@ -40,6 +40,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts return; } + // Todo: This should be handled more gracefully timeline.RelativeChildSize = Beatmap.Value.Track.Length == double.PositiveInfinity ? Vector2.One : new Vector2((float)Math.Max(1, Beatmap.Value.Track.Length), 1); } From 599a86a69a2d06460755ad45ae6356ebb0e22d23 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Dec 2017 18:50:59 +0900 Subject: [PATCH 280/282] Remove LangVer.props --- LangVer.props | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 LangVer.props diff --git a/LangVer.props b/LangVer.props deleted file mode 100644 index 6b1d1dae73..0000000000 --- a/LangVer.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - 6 - - \ No newline at end of file From 741153e1a283cdca1ded7a2d9ce1ec8510ca4de3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Dec 2017 18:51:20 +0900 Subject: [PATCH 281/282] Remove unnecessary properties --- osu.Game.props | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.props b/osu.Game.props index 60a5e97944..07abeb5539 100644 --- a/osu.Game.props +++ b/osu.Game.props @@ -1,7 +1,5 @@ - - - + 7 From 1b83f2e3d452e6790e6599c4ef503d44b245258c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Dec 2017 18:53:36 +0900 Subject: [PATCH 282/282] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 92fd14146f..19e8161046 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 92fd14146f41c63df29032684d66be40a34fad6b +Subproject commit 19e81610469455c4531e0a58574d58bca9ae4cc7