1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Merge branch 'master' into muted-notification

This commit is contained in:
Craftplacer 2019-10-01 17:26:11 +02:00 committed by GitHub
commit 4e394e0ed5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 60 additions and 38 deletions

View File

@ -62,6 +62,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.924.0" /> <PackageReference Include="ppy.osu.Framework.Android" Version="2019.930.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -107,6 +107,15 @@ namespace osu.Game.Tests.Visual.Online
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg" CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
}, api.IsLoggedIn)); }, api.IsLoggedIn));
AddStep("Show bancho", () => profile.ShowUser(new User
{
Username = @"BanchoBot",
Id = 3,
IsBot = true,
Country = new Country { FullName = @"Saint Helena", FlagName = @"SH" },
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c4.jpg"
}, api.IsLoggedIn));
AddStep("Hide", profile.Hide); AddStep("Hide", profile.Hide);
AddStep("Show without reload", profile.Show); AddStep("Show without reload", profile.Show);
} }

View File

@ -82,8 +82,8 @@ namespace osu.Game.Tests.Visual.SongSelect
private void ensureRandomFetchSuccess() => private void ensureRandomFetchSuccess() =>
AddAssert("ensure prev random fetch worked", () => selectedSets.Peek() == carousel.SelectedBeatmapSet); AddAssert("ensure prev random fetch worked", () => selectedSets.Peek() == carousel.SelectedBeatmapSet);
private void checkSelected(int set, int? diff = null) => private void waitForSelection(int set, int? diff = null) =>
AddAssert($"selected is set{set}{(diff.HasValue ? $" diff{diff.Value}" : "")}", () => AddUntilStep($"selected is set{set}{(diff.HasValue ? $" diff{diff.Value}" : "")}", () =>
{ {
if (diff != null) if (diff != null)
return carousel.SelectedBeatmap == carousel.BeatmapSets.Skip(set - 1).First().Beatmaps.Skip(diff.Value - 1).First(); return carousel.SelectedBeatmap == carousel.BeatmapSets.Skip(set - 1).First().Beatmaps.Skip(diff.Value - 1).First();
@ -168,24 +168,24 @@ namespace osu.Game.Tests.Visual.SongSelect
loadBeatmaps(); loadBeatmaps();
advanceSelection(direction: 1, diff: false); advanceSelection(direction: 1, diff: false);
checkSelected(1, 1); waitForSelection(1, 1);
advanceSelection(direction: 1, diff: true); advanceSelection(direction: 1, diff: true);
checkSelected(1, 2); waitForSelection(1, 2);
advanceSelection(direction: -1, diff: false); advanceSelection(direction: -1, diff: false);
checkSelected(set_count, 1); waitForSelection(set_count, 1);
advanceSelection(direction: -1, diff: true); advanceSelection(direction: -1, diff: true);
checkSelected(set_count - 1, 3); waitForSelection(set_count - 1, 3);
advanceSelection(diff: false); advanceSelection(diff: false);
advanceSelection(diff: false); advanceSelection(diff: false);
checkSelected(1, 2); waitForSelection(1, 2);
advanceSelection(direction: -1, diff: true); advanceSelection(direction: -1, diff: true);
advanceSelection(direction: -1, diff: true); advanceSelection(direction: -1, diff: true);
checkSelected(set_count, 3); waitForSelection(set_count, 3);
} }
/// <summary> /// <summary>
@ -203,10 +203,10 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep("Filter", () => carousel.Filter(new FilterCriteria { SearchText = "set #3!" }, false)); AddStep("Filter", () => carousel.Filter(new FilterCriteria { SearchText = "set #3!" }, false));
checkVisibleItemCount(diff: false, count: 1); checkVisibleItemCount(diff: false, count: 1);
checkVisibleItemCount(diff: true, count: 3); checkVisibleItemCount(diff: true, count: 3);
checkSelected(3, 1); waitForSelection(3, 1);
advanceSelection(diff: true, count: 4); advanceSelection(diff: true, count: 4);
checkSelected(3, 2); waitForSelection(3, 2);
AddStep("Un-filter (debounce)", () => carousel.Filter(new FilterCriteria())); AddStep("Un-filter (debounce)", () => carousel.Filter(new FilterCriteria()));
AddUntilStep("Wait for debounce", () => !carousel.PendingFilterTask); AddUntilStep("Wait for debounce", () => !carousel.PendingFilterTask);
@ -217,10 +217,10 @@ namespace osu.Game.Tests.Visual.SongSelect
setSelected(1, 2); setSelected(1, 2);
AddStep("Filter some difficulties", () => carousel.Filter(new FilterCriteria { SearchText = "Normal" }, false)); AddStep("Filter some difficulties", () => carousel.Filter(new FilterCriteria { SearchText = "Normal" }, false));
checkSelected(1, 1); waitForSelection(1, 1);
AddStep("Un-filter", () => carousel.Filter(new FilterCriteria(), false)); AddStep("Un-filter", () => carousel.Filter(new FilterCriteria(), false));
checkSelected(1, 1); waitForSelection(1, 1);
AddStep("Filter all", () => carousel.Filter(new FilterCriteria { SearchText = "Dingo" }, false)); AddStep("Filter all", () => carousel.Filter(new FilterCriteria { SearchText = "Dingo" }, false));
@ -249,7 +249,7 @@ namespace osu.Game.Tests.Visual.SongSelect
IsLowerInclusive = true IsLowerInclusive = true
} }
}, false)); }, false));
checkSelected(3, 2); waitForSelection(3, 2);
AddStep("Un-filter", () => carousel.Filter(new FilterCriteria(), false)); AddStep("Un-filter", () => carousel.Filter(new FilterCriteria(), false));
} }
@ -317,7 +317,7 @@ namespace osu.Game.Tests.Visual.SongSelect
checkVisibleItemCount(false, set_count); checkVisibleItemCount(false, set_count);
checkSelected(set_count); waitForSelection(set_count);
} }
/// <summary> /// <summary>
@ -343,11 +343,11 @@ namespace osu.Game.Tests.Visual.SongSelect
AddAssert("Selection is non-null", () => currentSelection != null); AddAssert("Selection is non-null", () => currentSelection != null);
AddStep("Remove selected", () => carousel.RemoveBeatmapSet(carousel.SelectedBeatmapSet)); AddStep("Remove selected", () => carousel.RemoveBeatmapSet(carousel.SelectedBeatmapSet));
checkSelected(2); waitForSelection(2);
AddStep("Remove first", () => carousel.RemoveBeatmapSet(carousel.BeatmapSets.First())); AddStep("Remove first", () => carousel.RemoveBeatmapSet(carousel.BeatmapSets.First()));
AddStep("Remove first", () => carousel.RemoveBeatmapSet(carousel.BeatmapSets.First())); AddStep("Remove first", () => carousel.RemoveBeatmapSet(carousel.BeatmapSets.First()));
checkSelected(1); waitForSelection(1);
AddUntilStep("Remove all", () => AddUntilStep("Remove all", () =>
{ {
@ -390,17 +390,17 @@ namespace osu.Game.Tests.Visual.SongSelect
checkVisibleItemCount(true, 2); checkVisibleItemCount(true, 2);
advanceSelection(true); advanceSelection(true);
checkSelected(1, 3); waitForSelection(1, 3);
setHidden(3); setHidden(3);
checkSelected(1, 1); waitForSelection(1, 1);
setHidden(2, false); setHidden(2, false);
advanceSelection(true); advanceSelection(true);
checkSelected(1, 2); waitForSelection(1, 2);
setHidden(1); setHidden(1);
checkSelected(1, 2); waitForSelection(1, 2);
setHidden(2); setHidden(2);
checkNoSelection(); checkNoSelection();

View File

@ -6,6 +6,7 @@ namespace osu.Game.Configuration
public enum IntroSequence public enum IntroSequence
{ {
Circles, Circles,
Triangles Triangles,
Random
} }
} }

View File

@ -75,7 +75,7 @@ namespace osu.Game.Overlays
/// <summary> /// <summary>
/// Returns whether the current beatmap track is playing. /// Returns whether the current beatmap track is playing.
/// </summary> /// </summary>
public bool IsPlaying => beatmap.Value.Track.IsRunning; public bool IsPlaying => beatmap.Value?.Track.IsRunning ?? false;
private void handleBeatmapAdded(BeatmapSetInfo set) => private void handleBeatmapAdded(BeatmapSetInfo set) =>
Schedule(() => beatmapSets.Add(set)); Schedule(() => beatmapSets.Add(set));

View File

@ -44,7 +44,8 @@ namespace osu.Game.Overlays
Clear(); Clear();
lastSection = null; lastSection = null;
sections = new ProfileSection[] sections = !user.IsBot
? new ProfileSection[]
{ {
//new AboutSection(), //new AboutSection(),
new RecentSection(), new RecentSection(),
@ -53,6 +54,10 @@ namespace osu.Game.Overlays
new HistoricalSection(), new HistoricalSection(),
new BeatmapsSection(), new BeatmapsSection(),
new KudosuSection() new KudosuSection()
}
: new ProfileSection[]
{
//new AboutSection(),
}; };
tabs = new ProfileTabControl tabs = new ProfileTabControl

View File

@ -135,9 +135,9 @@ namespace osu.Game.Rulesets
foreach (string file in files.Where(f => !Path.GetFileName(f).Contains("Tests"))) foreach (string file in files.Where(f => !Path.GetFileName(f).Contains("Tests")))
loadRulesetFromFile(file); loadRulesetFromFile(file);
} }
catch catch (Exception e)
{ {
Logger.Log($"Could not load rulesets from directory {Environment.CurrentDirectory}"); Logger.Error(e, $"Could not load rulesets from directory {Environment.CurrentDirectory}");
} }
} }

View File

@ -6,6 +6,7 @@ using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Shaders; using osu.Framework.Graphics.Shaders;
using osu.Framework.MathUtils;
using osu.Game.Screens.Menu; using osu.Game.Screens.Menu;
using osuTK; using osuTK;
using osu.Framework.Screens; using osu.Framework.Screens;
@ -59,6 +60,9 @@ namespace osu.Game.Screens
private IntroScreen getIntroSequence() private IntroScreen getIntroSequence()
{ {
if (introSequence == IntroSequence.Random)
introSequence = (IntroSequence)RNG.Next(0, (int)IntroSequence.Random);
switch (introSequence) switch (introSequence)
{ {
case IntroSequence.Circles: case IntroSequence.Circles:

View File

@ -78,6 +78,9 @@ namespace osu.Game.Users
[JsonProperty(@"is_bng")] [JsonProperty(@"is_bng")]
public bool IsBNG; public bool IsBNG;
[JsonProperty(@"is_bot")]
public bool IsBot;
[JsonProperty(@"is_active")] [JsonProperty(@"is_active")]
public bool Active; public bool Active;

View File

@ -26,7 +26,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.924.0" /> <PackageReference Include="ppy.osu.Framework" Version="2019.930.0" />
<PackageReference Include="SharpCompress" Version="0.24.0" /> <PackageReference Include="SharpCompress" Version="0.24.0" />
<PackageReference Include="NUnit" Version="3.12.0" /> <PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" /> <PackageReference Include="SharpRaven" Version="2.4.0" />

View File

@ -118,8 +118,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2019.913.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.924.0" /> <PackageReference Include="ppy.osu.Framework" Version="2019.930.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.924.0" /> <PackageReference Include="ppy.osu.Framework.iOS" Version="2019.930.0" />
<PackageReference Include="SharpCompress" Version="0.24.0" /> <PackageReference Include="SharpCompress" Version="0.24.0" />
<PackageReference Include="NUnit" Version="3.11.0" /> <PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" /> <PackageReference Include="SharpRaven" Version="2.4.0" />