mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 16:03:01 +08:00
Merge remote-tracking branch 'upstream/master' into ruleset-settings
This commit is contained in:
commit
fc28617099
@ -1 +1 @@
|
|||||||
Subproject commit 6f7528255c5d6cde72f1e92de539983bc4bce502
|
Subproject commit 428cb7fcadfdc6656ec4b0398ecfe2820e2e1bdb
|
@ -198,7 +198,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
Direction = FillDirection.Horizontal;
|
Direction = FillDirection.Horizontal;
|
||||||
Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size });
|
Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size });
|
||||||
Add(valueText = new OsuSpriteText() { TextSize = text_size });
|
Add(valueText = new OsuSpriteText { TextSize = text_size });
|
||||||
Margin = new MarginPadding(margin);
|
Margin = new MarginPadding(margin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,17 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Author = @"RLC",
|
Author = @"RLC",
|
||||||
Source = @"",
|
Source = @"",
|
||||||
},
|
},
|
||||||
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
|
{
|
||||||
|
Covers = new BeatmapSetOnlineCovers
|
||||||
|
{
|
||||||
|
Card = @"https://assets.ppy.sh/beatmaps/578332/covers/card.jpg?1494591390",
|
||||||
|
Cover = @"https://assets.ppy.sh/beatmaps/578332/covers/cover.jpg?1494591390",
|
||||||
|
},
|
||||||
|
Preview = @"https://b.ppy.sh/preview/578332.mp3",
|
||||||
|
PlayCount = 97,
|
||||||
|
FavouriteCount = 72,
|
||||||
|
},
|
||||||
Beatmaps = new List<BeatmapInfo>
|
Beatmaps = new List<BeatmapInfo>
|
||||||
{
|
{
|
||||||
new BeatmapInfo
|
new BeatmapInfo
|
||||||
@ -55,13 +66,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Ruleset = ruleset,
|
Ruleset = ruleset,
|
||||||
StarDifficulty = 5.35f,
|
StarDifficulty = 5.35f,
|
||||||
Metadata = new BeatmapMetadata(),
|
Metadata = new BeatmapMetadata(),
|
||||||
OnlineInfo = new BeatmapOnlineInfo
|
|
||||||
{
|
|
||||||
Covers = new[] { @"https://assets.ppy.sh//beatmaps/578332/covers/cover.jpg?1494591390" },
|
|
||||||
Preview = @"https://b.ppy.sh/preview/578332.mp3",
|
|
||||||
PlayCount = 97,
|
|
||||||
FavouriteCount = 72,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -74,6 +78,17 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Author = @"Sotarks",
|
Author = @"Sotarks",
|
||||||
Source = @"ぎんぎつね",
|
Source = @"ぎんぎつね",
|
||||||
},
|
},
|
||||||
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
|
{
|
||||||
|
Covers = new BeatmapSetOnlineCovers
|
||||||
|
{
|
||||||
|
Card = @"https://assets.ppy.sh/beatmaps/599627/covers/card.jpg?1494539318",
|
||||||
|
Cover = @"https://assets.ppy.sh/beatmaps/599627/covers/cover.jpg?1494539318",
|
||||||
|
},
|
||||||
|
Preview = @"https//b.ppy.sh/preview/599627.mp3",
|
||||||
|
PlayCount = 3082,
|
||||||
|
FavouriteCount = 14,
|
||||||
|
},
|
||||||
Beatmaps = new List<BeatmapInfo>
|
Beatmaps = new List<BeatmapInfo>
|
||||||
{
|
{
|
||||||
new BeatmapInfo
|
new BeatmapInfo
|
||||||
@ -81,13 +96,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Ruleset = ruleset,
|
Ruleset = ruleset,
|
||||||
StarDifficulty = 5.81f,
|
StarDifficulty = 5.81f,
|
||||||
Metadata = new BeatmapMetadata(),
|
Metadata = new BeatmapMetadata(),
|
||||||
OnlineInfo = new BeatmapOnlineInfo
|
|
||||||
{
|
|
||||||
Covers = new[] { @"https://assets.ppy.sh//beatmaps/599627/covers/cover.jpg?1494539318" },
|
|
||||||
Preview = @"https//b.ppy.sh/preview/599627.mp3",
|
|
||||||
PlayCount = 3082,
|
|
||||||
FavouriteCount = 14,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -100,6 +108,17 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Author = @"Cerulean Veyron",
|
Author = @"Cerulean Veyron",
|
||||||
Source = @"",
|
Source = @"",
|
||||||
},
|
},
|
||||||
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
|
{
|
||||||
|
Covers = new BeatmapSetOnlineCovers
|
||||||
|
{
|
||||||
|
Card = @"https://assets.ppy.sh/beatmaps/513268/covers/card.jpg?1494502863",
|
||||||
|
Cover = @"https://assets.ppy.sh/beatmaps/513268/covers/cover.jpg?1494502863",
|
||||||
|
},
|
||||||
|
Preview = @"https//b.ppy.sh/preview/513268.mp3",
|
||||||
|
PlayCount = 2762,
|
||||||
|
FavouriteCount = 15,
|
||||||
|
},
|
||||||
Beatmaps = new List<BeatmapInfo>
|
Beatmaps = new List<BeatmapInfo>
|
||||||
{
|
{
|
||||||
new BeatmapInfo
|
new BeatmapInfo
|
||||||
@ -107,13 +126,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Ruleset = ruleset,
|
Ruleset = ruleset,
|
||||||
StarDifficulty = 0.9f,
|
StarDifficulty = 0.9f,
|
||||||
Metadata = new BeatmapMetadata(),
|
Metadata = new BeatmapMetadata(),
|
||||||
OnlineInfo = new BeatmapOnlineInfo
|
|
||||||
{
|
|
||||||
Covers = new[] { @"https://assets.ppy.sh//beatmaps/513268/covers/cover.jpg?1494502863" },
|
|
||||||
Preview = @"https//b.ppy.sh/preview/513268.mp3",
|
|
||||||
PlayCount = 2762,
|
|
||||||
FavouriteCount = 15,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
new BeatmapInfo
|
new BeatmapInfo
|
||||||
{
|
{
|
||||||
@ -141,6 +153,17 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Author = @"[Kamiya]",
|
Author = @"[Kamiya]",
|
||||||
Source = @"小林さんちのメイドラゴン",
|
Source = @"小林さんちのメイドラゴン",
|
||||||
},
|
},
|
||||||
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
|
{
|
||||||
|
Covers = new BeatmapSetOnlineCovers
|
||||||
|
{
|
||||||
|
Card = @"https://assets.ppy.sh/beatmaps/586841/covers/card.jpg?1494052741",
|
||||||
|
Cover = @"https://assets.ppy.sh/beatmaps/586841/covers/cover.jpg?1494052741",
|
||||||
|
},
|
||||||
|
Preview = @"https//b.ppy.sh/preview/586841.mp3",
|
||||||
|
PlayCount = 62317,
|
||||||
|
FavouriteCount = 161,
|
||||||
|
},
|
||||||
Beatmaps = new List<BeatmapInfo>
|
Beatmaps = new List<BeatmapInfo>
|
||||||
{
|
{
|
||||||
new BeatmapInfo
|
new BeatmapInfo
|
||||||
@ -148,13 +171,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Ruleset = ruleset,
|
Ruleset = ruleset,
|
||||||
StarDifficulty = 1.26f,
|
StarDifficulty = 1.26f,
|
||||||
Metadata = new BeatmapMetadata(),
|
Metadata = new BeatmapMetadata(),
|
||||||
OnlineInfo = new BeatmapOnlineInfo
|
|
||||||
{
|
|
||||||
Covers = new[] { @"https://assets.ppy.sh//beatmaps/586841/covers/cover.jpg?1494052741" },
|
|
||||||
Preview = @"https//b.ppy.sh/preview/586841.mp3",
|
|
||||||
PlayCount = 62317,
|
|
||||||
FavouriteCount = 161,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
new BeatmapInfo
|
new BeatmapInfo
|
||||||
{
|
{
|
||||||
|
@ -76,7 +76,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
ControlPointInfo = controlPointInfo
|
ControlPointInfo = controlPointInfo
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
MaxCombo = 123,
|
MaxCombo = 123,
|
||||||
Rank = ScoreRank.A,
|
Rank = ScoreRank.A,
|
||||||
Date = DateTimeOffset.Now,
|
Date = DateTimeOffset.Now,
|
||||||
Statistics = new Dictionary<string, dynamic>()
|
Statistics = new Dictionary<string, dynamic>
|
||||||
{
|
{
|
||||||
{ "300", 50 },
|
{ "300", 50 },
|
||||||
{ "100", 20 },
|
{ "100", 20 },
|
||||||
|
@ -39,9 +39,15 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Artist = @"Maaya Sakamoto",
|
Artist = @"Maaya Sakamoto",
|
||||||
Author = @"uwutm8",
|
Author = @"uwutm8",
|
||||||
},
|
},
|
||||||
OnlineInfo = new BeatmapOnlineInfo
|
BeatmapSet = new BeatmapSetInfo
|
||||||
{
|
{
|
||||||
Covers = new[] { @"https://assets.ppy.sh//beatmaps/560573/covers/cover.jpg?1492722343" },
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
|
{
|
||||||
|
Covers = new BeatmapSetOnlineCovers
|
||||||
|
{
|
||||||
|
Cover = @"https://assets.ppy.sh/beatmaps/560573/covers/cover.jpg?1492722343",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -96,15 +102,21 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Ruleset = rulesets.GetRuleset(0),
|
Ruleset = rulesets.GetRuleset(0),
|
||||||
Metadata = new BeatmapMetadata
|
Metadata = new BeatmapMetadata
|
||||||
{
|
{
|
||||||
Title = @"xi",
|
Title = @"FREEDOM DIVE",
|
||||||
Artist = @"FREEDOM DIVE",
|
Artist = @"xi",
|
||||||
Author = @"Nakagawa-Kanon",
|
Author = @"Nakagawa-Kanon",
|
||||||
},
|
},
|
||||||
OnlineInfo = new BeatmapOnlineInfo
|
BeatmapSet = new BeatmapSetInfo
|
||||||
{
|
{
|
||||||
Covers = new[] { @"https://assets.ppy.sh//beatmaps/39804/covers/cover.jpg?1456506845" },
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
|
{
|
||||||
|
Covers = new BeatmapSetOnlineCovers
|
||||||
|
{
|
||||||
|
Cover = @"https://assets.ppy.sh/beatmaps/39804/covers/cover.jpg?1456506845",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
|
||||||
},
|
},
|
||||||
MaxParticipants = { Value = 10 },
|
MaxParticipants = { Value = 10 },
|
||||||
Participants =
|
Participants =
|
||||||
|
@ -50,7 +50,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Position = new Vector2(20, -160),
|
Position = new Vector2(20, -160),
|
||||||
Count = 5,
|
CountStars = 5,
|
||||||
};
|
};
|
||||||
Add(stars);
|
Add(stars);
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Position = new Vector2(20, -190),
|
Position = new Vector2(20, -190),
|
||||||
Text = stars.Count.ToString("0.00"),
|
Text = stars.CountStars.ToString("0.00"),
|
||||||
};
|
};
|
||||||
Add(starsLabel);
|
Add(starsLabel);
|
||||||
|
|
||||||
@ -69,8 +69,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
comboCounter.Current.Value = 0;
|
comboCounter.Current.Value = 0;
|
||||||
numerator = denominator = 0;
|
numerator = denominator = 0;
|
||||||
accuracyCounter.SetFraction(0, 0);
|
accuracyCounter.SetFraction(0, 0);
|
||||||
stars.Count = 0;
|
stars.CountStars = 0;
|
||||||
starsLabel.Text = stars.Count.ToString("0.00");
|
starsLabel.Text = stars.CountStars.ToString("0.00");
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep(@"Hit! :D", delegate
|
AddStep(@"Hit! :D", delegate
|
||||||
@ -91,8 +91,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
AddStep(@"Alter stars", delegate
|
AddStep(@"Alter stars", delegate
|
||||||
{
|
{
|
||||||
stars.Count = RNG.NextSingle() * (stars.StarCount + 1);
|
stars.CountStars = RNG.NextSingle() * (stars.StarCount + 1);
|
||||||
starsLabel.Text = stars.Count.ToString("0.00");
|
starsLabel.Text = stars.CountStars.ToString("0.00");
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep(@"Stop counters", delegate
|
AddStep(@"Stop counters", delegate
|
||||||
|
@ -55,7 +55,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
timeRangeBindable.ValueChanged += v => timeRangeText.Text = $"Visible Range: {v:#,#.#}";
|
timeRangeBindable.ValueChanged += v => timeRangeText.Text = $"Visible Range: {v:#,#.#}";
|
||||||
timeRangeBindable.ValueChanged += v => bottomLabel.Text = $"t minus {v:#,#}";
|
timeRangeBindable.ValueChanged += v => bottomLabel.Text = $"t minus {v:#,#}";
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ namespace osu.Desktop
|
|||||||
{
|
{
|
||||||
desktopWindow.CursorState |= CursorState.Hidden;
|
desktopWindow.CursorState |= CursorState.Hidden;
|
||||||
|
|
||||||
desktopWindow.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
|
desktopWindow.Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico"));
|
||||||
desktopWindow.Title = Name;
|
desktopWindow.Title = Name;
|
||||||
|
|
||||||
desktopWindow.DragEnter += dragEnter;
|
desktopWindow.DragEnter += dragEnter;
|
||||||
|
@ -186,7 +186,7 @@ namespace osu.Desktop.Overlays
|
|||||||
{
|
{
|
||||||
private OsuGame game;
|
private OsuGame game;
|
||||||
|
|
||||||
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification()
|
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification
|
||||||
{
|
{
|
||||||
Text = @"Update ready to install. Click to restart!",
|
Text = @"Update ready to install. Click to restart!",
|
||||||
Activated = () =>
|
Activated = () =>
|
||||||
@ -202,7 +202,7 @@ namespace osu.Desktop.Overlays
|
|||||||
{
|
{
|
||||||
this.game = game;
|
this.game = game;
|
||||||
|
|
||||||
IconContent.Add(new Drawable[]
|
IconContent.AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
|
@ -232,7 +232,7 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="lazer.ico" />
|
<EmbeddedResource Include="lazer.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
Height = (float)HitObject.Duration;
|
Height = (float)HitObject.Duration;
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
// For now the body piece covers the entire height of the container
|
// For now the body piece covers the entire height of the container
|
||||||
// whereas possibly in the future we don't want to extend under the head/tail.
|
// whereas possibly in the future we don't want to extend under the head/tail.
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
connectionLayer = new FollowPointRenderer
|
connectionLayer = new FollowPointRenderer
|
||||||
{
|
{
|
||||||
|
@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
EarlyActivationMilliseconds = pre_beat_transition_time;
|
EarlyActivationMilliseconds = pre_beat_transition_time;
|
||||||
|
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
background = new CircularContainer
|
background = new CircularContainer
|
||||||
{
|
{
|
||||||
|
@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
public TaikoPlayfield()
|
public TaikoPlayfield()
|
||||||
{
|
{
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new ScaleFixContainer
|
new ScaleFixContainer
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
if (time < list[0].Time)
|
if (time < list[0].Time)
|
||||||
return prePoint ?? new T();
|
return prePoint ?? new T();
|
||||||
|
|
||||||
int index = list.BinarySearch(new T() { Time = time });
|
int index = list.BinarySearch(new T { Time = time });
|
||||||
|
|
||||||
// Check if we've found an exact match (t == time)
|
// Check if we've found an exact match (t == time)
|
||||||
if (index >= 0)
|
if (index >= 0)
|
||||||
|
@ -140,7 +140,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
},
|
},
|
||||||
starCounter = new StarCounter
|
starCounter = new StarCounter
|
||||||
{
|
{
|
||||||
Count = (float)beatmap.StarDifficulty,
|
CountStars = (float)beatmap.StarDifficulty,
|
||||||
Scale = new Vector2(0.8f),
|
Scale = new Vector2(0.8f),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using SQLite.Net.Attributes;
|
using SQLite.Net.Attributes;
|
||||||
|
|
||||||
namespace osu.Game.Database
|
namespace osu.Game.Database
|
||||||
@ -17,8 +18,13 @@ namespace osu.Game.Database
|
|||||||
public string TitleUnicode { get; set; }
|
public string TitleUnicode { get; set; }
|
||||||
public string Artist { get; set; }
|
public string Artist { get; set; }
|
||||||
public string ArtistUnicode { get; set; }
|
public string ArtistUnicode { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"creator")]
|
||||||
public string Author { get; set; }
|
public string Author { get; set; }
|
||||||
|
|
||||||
public string Source { get; set; }
|
public string Source { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"tags")]
|
||||||
public string Tags { get; set; }
|
public string Tags { get; set; }
|
||||||
public int PreviewTime { get; set; }
|
public int PreviewTime { get; set; }
|
||||||
public string AudioFile { get; set; }
|
public string AudioFile { get; set; }
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace osu.Game.Database
|
namespace osu.Game.Database
|
||||||
{
|
{
|
||||||
@ -11,28 +10,16 @@ namespace osu.Game.Database
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class BeatmapOnlineInfo
|
public class BeatmapOnlineInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// The different sizes of cover art for this beatmap: cover, cover@2x, card, card@2x, list, list@2x.
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty(@"covers")]
|
|
||||||
public IEnumerable<string> Covers { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A small sample clip of this beatmap's song.
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty(@"previewUrl")]
|
|
||||||
public string Preview { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The amount of plays this beatmap has.
|
/// The amount of plays this beatmap has.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty(@"play_count")]
|
[JsonProperty(@"playcount")]
|
||||||
public int PlayCount { get; set; }
|
public int PlayCount { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The amount of people who have favourited this map.
|
/// The amount of passes this beatmap has.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty(@"favourite_count")]
|
[JsonProperty(@"passcount")]
|
||||||
public int FavouriteCount { get; set; }
|
public int PassCount { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,9 @@ namespace osu.Game.Database
|
|||||||
[OneToMany(CascadeOperations = CascadeOperation.All)]
|
[OneToMany(CascadeOperations = CascadeOperation.All)]
|
||||||
public List<BeatmapInfo> Beatmaps { get; set; }
|
public List<BeatmapInfo> Beatmaps { get; set; }
|
||||||
|
|
||||||
|
[Ignore]
|
||||||
|
public BeatmapSetOnlineInfo OnlineInfo { get; set; }
|
||||||
|
|
||||||
public double MaxStarDifficulty => Beatmaps.Max(b => b.StarDifficulty);
|
public double MaxStarDifficulty => Beatmaps.Max(b => b.StarDifficulty);
|
||||||
|
|
||||||
[Indexed]
|
[Indexed]
|
||||||
|
55
osu.Game/Database/BeatmapSetOnlineInfo.cs
Normal file
55
osu.Game/Database/BeatmapSetOnlineInfo.cs
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace osu.Game.Database
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Beatmap set info retrieved for previewing locally without having the set downloaded.
|
||||||
|
/// </summary>
|
||||||
|
public class BeatmapSetOnlineInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The different sizes of cover art for this beatmap set.
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty(@"covers")]
|
||||||
|
public BeatmapSetOnlineCovers Covers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A small sample clip of this beatmap set's song.
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty(@"previewUrl")]
|
||||||
|
public string Preview { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The amount of plays this beatmap set has.
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty(@"play_count")]
|
||||||
|
public int PlayCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The amount of people who have favourited this beatmap set.
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty(@"favourite_count")]
|
||||||
|
public int FavouriteCount { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BeatmapSetOnlineCovers
|
||||||
|
{
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
}
|
@ -1,37 +0,0 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Audio.Track;
|
|
||||||
using osu.Framework.Graphics.Textures;
|
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
|
|
||||||
namespace osu.Game.Database
|
|
||||||
{
|
|
||||||
internal class OnlineWorkingBeatmap : WorkingBeatmap
|
|
||||||
{
|
|
||||||
private readonly TextureStore textures;
|
|
||||||
private readonly TrackManager tracks;
|
|
||||||
|
|
||||||
public OnlineWorkingBeatmap(BeatmapInfo beatmapInfo, TextureStore textures, TrackManager tracks) : base(beatmapInfo)
|
|
||||||
{
|
|
||||||
this.textures = textures;
|
|
||||||
this.tracks = tracks;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Beatmap GetBeatmap()
|
|
||||||
{
|
|
||||||
return new Beatmap();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Texture GetBackground()
|
|
||||||
{
|
|
||||||
return textures.Get(BeatmapInfo.OnlineInfo.Covers.FirstOrDefault());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Track GetTrack()
|
|
||||||
{
|
|
||||||
return tracks.Get(BeatmapInfo.OnlineInfo.Preview);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -8,9 +8,10 @@ using osu.Framework.Graphics.Containers;
|
|||||||
|
|
||||||
namespace osu.Game.Graphics.Containers
|
namespace osu.Game.Graphics.Containers
|
||||||
{
|
{
|
||||||
public class ReverseDepthFillFlowContainer<T> : FillFlowContainer<T> where T : Drawable
|
public class ReverseChildIDFillFlowContainer<T> : FillFlowContainer<T> where T : Drawable
|
||||||
{
|
{
|
||||||
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
|
protected override int Compare(Drawable x, Drawable y) => CompareReverseChildID(x, y);
|
||||||
|
|
||||||
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
|
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -93,7 +93,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
sections = value.ToList();
|
sections = value.ToList();
|
||||||
if (sections.Count == 0) return;
|
if (sections.Count == 0) return;
|
||||||
|
|
||||||
sectionsContainer.Add(sections);
|
sectionsContainer.AddRange(sections);
|
||||||
SelectedSection.Value = sections[0];
|
SelectedSection.Value = sections[0];
|
||||||
lastKnownScroll = float.NaN;
|
lastKnownScroll = float.NaN;
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
public SectionsContainer()
|
public SectionsContainer()
|
||||||
{
|
{
|
||||||
Add(ScrollContainer = new ScrollContainer()
|
Add(ScrollContainer = new ScrollContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Masking = false,
|
Masking = false,
|
||||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Direction = Direction,
|
Direction = Direction,
|
||||||
});
|
});
|
||||||
//I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards
|
//I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards
|
||||||
Remove(Children.Where((bar, index) => index >= value.Count()).ToList());
|
RemoveRange(Children.Where((bar, index) => index >= value.Count()).ToList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Content.Masking = true;
|
Content.Masking = true;
|
||||||
Content.CornerRadius = 5;
|
Content.CornerRadius = 5;
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
new Triangles
|
new Triangles
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
public SearchTextBox()
|
public SearchTextBox()
|
||||||
{
|
{
|
||||||
Height = 35;
|
Height = 35;
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
new TextAwesome
|
new TextAwesome
|
||||||
{
|
{
|
||||||
|
@ -33,25 +33,25 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
private const float star_size = 20;
|
private const float star_size = 20;
|
||||||
private const float star_spacing = 4;
|
private const float star_spacing = 4;
|
||||||
|
|
||||||
private float count;
|
private float countStars;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Amount of stars represented.
|
/// Amount of stars represented.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float Count
|
public float CountStars
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return count;
|
return countStars;
|
||||||
}
|
}
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (count == value) return;
|
if (countStars == value) return;
|
||||||
|
|
||||||
if (IsLoaded)
|
if (IsLoaded)
|
||||||
transformCount(value);
|
transformCount(value);
|
||||||
count = value;
|
countStars = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,15 +94,15 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
public void ResetCount()
|
public void ResetCount()
|
||||||
{
|
{
|
||||||
count = 0;
|
countStars = 0;
|
||||||
StopAnimation();
|
StopAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReplayAnimation()
|
public void ReplayAnimation()
|
||||||
{
|
{
|
||||||
var t = count;
|
var t = countStars;
|
||||||
ResetCount();
|
ResetCount();
|
||||||
Count = t;
|
CountStars = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StopAnimation()
|
public void StopAnimation()
|
||||||
@ -111,8 +111,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
foreach (var star in stars.Children)
|
foreach (var star in stars.Children)
|
||||||
{
|
{
|
||||||
star.ClearTransforms(true);
|
star.ClearTransforms(true);
|
||||||
star.FadeTo(i < count ? 1.0f : minStarAlpha);
|
star.FadeTo(i < countStars ? 1.0f : minStarAlpha);
|
||||||
star.Icon.ScaleTo(getStarScale(i, count));
|
star.Icon.ScaleTo(getStarScale(i, countStars));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
star.ClearTransforms(true);
|
star.ClearTransforms(true);
|
||||||
|
|
||||||
var delay = (count <= newValue ? Math.Max(i - count, 0) : Math.Max(count - 1 - i, 0)) * animationDelay;
|
var delay = (countStars <= newValue ? Math.Max(i - countStars, 0) : Math.Max(countStars - 1 - i, 0)) * animationDelay;
|
||||||
|
|
||||||
using (BeginDelayedSequence(delay, true))
|
using (BeginDelayedSequence(delay, true))
|
||||||
{
|
{
|
||||||
|
97
osu.Game/Online/API/Requests/GetBeatmapSetsRequest.cs
Normal file
97
osu.Game/Online/API/Requests/GetBeatmapSetsRequest.cs
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using osu.Game.Database;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.Direct;
|
||||||
|
|
||||||
|
namespace osu.Game.Online.API.Requests
|
||||||
|
{
|
||||||
|
public class GetBeatmapSetsRequest : APIRequest<IEnumerable<GetBeatmapSetsResponse>>
|
||||||
|
{
|
||||||
|
private readonly string query;
|
||||||
|
private readonly RulesetInfo ruleset;
|
||||||
|
private readonly RankStatus rankStatus;
|
||||||
|
private readonly DirectSortCriteria sortCriteria;
|
||||||
|
private readonly SortDirection direction;
|
||||||
|
private string directionString => direction == SortDirection.Descending ? @"desc" : @"asc";
|
||||||
|
|
||||||
|
public GetBeatmapSetsRequest(string query, RulesetInfo ruleset, RankStatus rankStatus = RankStatus.Any, DirectSortCriteria sortCriteria = DirectSortCriteria.Ranked, SortDirection direction = SortDirection.Descending)
|
||||||
|
{
|
||||||
|
this.query = System.Uri.EscapeDataString(query);
|
||||||
|
this.ruleset = ruleset;
|
||||||
|
this.rankStatus = rankStatus;
|
||||||
|
this.sortCriteria = sortCriteria;
|
||||||
|
this.direction = direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)rankStatus}&sort={sortCriteria.ToString().ToLower()}_{directionString}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetBeatmapSetsResponse : BeatmapMetadata
|
||||||
|
{
|
||||||
|
[JsonProperty(@"covers")]
|
||||||
|
private BeatmapSetOnlineCovers covers { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"previewUrl")]
|
||||||
|
private string preview { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"play_count")]
|
||||||
|
private int playCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"favourite_count")]
|
||||||
|
private int favouriteCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"beatmaps")]
|
||||||
|
private IEnumerable<GetBeatmapSetsBeatmapResponse> beatmaps { get; set; }
|
||||||
|
|
||||||
|
public BeatmapSetInfo ToBeatmapSet(RulesetDatabase rulesets)
|
||||||
|
{
|
||||||
|
return new BeatmapSetInfo
|
||||||
|
{
|
||||||
|
Metadata = this,
|
||||||
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
|
{
|
||||||
|
Covers = covers,
|
||||||
|
Preview = preview,
|
||||||
|
PlayCount = playCount,
|
||||||
|
FavouriteCount = favouriteCount,
|
||||||
|
},
|
||||||
|
Beatmaps = beatmaps.Select(b => b.ToBeatmap(rulesets)).ToList(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private class GetBeatmapSetsBeatmapResponse : BeatmapMetadata
|
||||||
|
{
|
||||||
|
[JsonProperty(@"playcount")]
|
||||||
|
private int playCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"passcount")]
|
||||||
|
private int passCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"mode_int")]
|
||||||
|
private int ruleset { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"difficulty_rating")]
|
||||||
|
private double starDifficulty { get; set; }
|
||||||
|
|
||||||
|
public BeatmapInfo ToBeatmap(RulesetDatabase rulesets)
|
||||||
|
{
|
||||||
|
return new BeatmapInfo
|
||||||
|
{
|
||||||
|
Metadata = this,
|
||||||
|
Ruleset = rulesets.GetRuleset(ruleset),
|
||||||
|
StarDifficulty = starDifficulty,
|
||||||
|
OnlineInfo = new BeatmapOnlineInfo
|
||||||
|
{
|
||||||
|
PlayCount = playCount,
|
||||||
|
PassCount = passCount,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -141,7 +141,7 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Add(new Drawable[] {
|
AddRange(new Drawable[] {
|
||||||
new VolumeControlReceptor
|
new VolumeControlReceptor
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Overlays.Chat
|
|||||||
var displayMessages = newMessages.Skip(Math.Max(0, newMessages.Count() - Channel.MAX_HISTORY));
|
var displayMessages = newMessages.Skip(Math.Max(0, newMessages.Count() - Channel.MAX_HISTORY));
|
||||||
|
|
||||||
//up to last Channel.MAX_HISTORY messages
|
//up to last Channel.MAX_HISTORY messages
|
||||||
flow.Add(displayMessages.Select(m => new ChatLine(m)));
|
flow.AddRange(displayMessages.Select(m => new ChatLine(m)));
|
||||||
|
|
||||||
if (!IsLoaded) return;
|
if (!IsLoaded) return;
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Linq;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Textures;
|
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
@ -50,7 +48,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, LocalisationEngine localisation, TextureStore textures)
|
private void load(OsuColour colours, LocalisationEngine localisation)
|
||||||
{
|
{
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
@ -59,7 +57,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
},
|
},
|
||||||
GetBackground(textures),
|
CreateBackground(),
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -180,11 +178,11 @@ namespace osu.Game.Overlays.Direct
|
|||||||
Margin = new MarginPadding { Top = vertical_padding, Right = vertical_padding },
|
Margin = new MarginPadding { Top = vertical_padding, Right = vertical_padding },
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new Statistic(FontAwesome.fa_play_circle, SetInfo.Beatmaps.FirstOrDefault()?.OnlineInfo.PlayCount ?? 0)
|
new Statistic(FontAwesome.fa_play_circle, SetInfo.OnlineInfo?.PlayCount ?? 0)
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Right = 1 },
|
Margin = new MarginPadding { Right = 1 },
|
||||||
},
|
},
|
||||||
new Statistic(FontAwesome.fa_heart, SetInfo.Beatmaps.FirstOrDefault()?.OnlineInfo.FavouriteCount ?? 0),
|
new Statistic(FontAwesome.fa_heart, SetInfo.OnlineInfo?.FavouriteCount ?? 0),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -12,8 +12,6 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Graphics.Textures;
|
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -49,7 +47,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(LocalisationEngine localisation, TextureStore textures)
|
private void load(LocalisationEngine localisation)
|
||||||
{
|
{
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
@ -58,7 +56,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
},
|
},
|
||||||
GetBackground(textures),
|
CreateBackground(),
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -105,11 +103,11 @@ namespace osu.Game.Overlays.Direct
|
|||||||
Margin = new MarginPadding { Right = height - vertical_padding * 2 + vertical_padding },
|
Margin = new MarginPadding { Right = height - vertical_padding * 2 + vertical_padding },
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Statistic(FontAwesome.fa_play_circle, SetInfo.Beatmaps.FirstOrDefault()?.OnlineInfo.PlayCount ?? 0)
|
new Statistic(FontAwesome.fa_play_circle, SetInfo.OnlineInfo?.PlayCount ?? 0)
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Right = 1 },
|
Margin = new MarginPadding { Right = 1 },
|
||||||
},
|
},
|
||||||
new Statistic(FontAwesome.fa_heart, SetInfo.Beatmaps.FirstOrDefault()?.OnlineInfo.FavouriteCount ?? 0),
|
new Statistic(FontAwesome.fa_heart, SetInfo.OnlineInfo?.FavouriteCount ?? 0),
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
@ -34,21 +34,25 @@ namespace osu.Game.Overlays.Direct
|
|||||||
return icons;
|
return icons;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Drawable GetBackground(TextureStore textures)
|
protected Drawable CreateBackground() => new DelayedLoadWrapper(new BeatmapSetBackgroundSprite(SetInfo)
|
||||||
{
|
|
||||||
return new AsyncLoadWrapper(new BeatmapBackgroundSprite(new OnlineWorkingBeatmap(SetInfo.Beatmaps.FirstOrDefault(), textures, null))
|
|
||||||
{
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
||||||
}) { RelativeSizeAxes = Axes.Both };
|
})
|
||||||
}
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
TimeBeforeLoad = 300
|
||||||
|
};
|
||||||
|
|
||||||
public class Statistic : FillFlowContainer
|
public class Statistic : FillFlowContainer
|
||||||
{
|
{
|
||||||
private readonly SpriteText text;
|
private readonly SpriteText text;
|
||||||
|
|
||||||
private int value;
|
private int value;
|
||||||
|
|
||||||
public int Value
|
public int Value
|
||||||
{
|
{
|
||||||
get { return value; }
|
get { return value; }
|
||||||
@ -85,5 +89,23 @@ namespace osu.Game.Overlays.Direct
|
|||||||
Value = value;
|
Value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class BeatmapSetBackgroundSprite : Sprite
|
||||||
|
{
|
||||||
|
private readonly BeatmapSetInfo set;
|
||||||
|
public BeatmapSetBackgroundSprite(BeatmapSetInfo set)
|
||||||
|
{
|
||||||
|
this.set = set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(TextureStore textures)
|
||||||
|
{
|
||||||
|
string resource = set.OnlineInfo.Covers.Card;
|
||||||
|
|
||||||
|
if (resource != null)
|
||||||
|
Texture = textures.Get(resource);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,12 +14,13 @@ using osu.Game.Overlays.SearchableList;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Direct
|
namespace osu.Game.Overlays.Direct
|
||||||
{
|
{
|
||||||
public class FilterControl : SearchableListFilterControl<DirectSortCritera, RankStatus>
|
public class FilterControl : SearchableListFilterControl<DirectSortCriteria, RankStatus>
|
||||||
{
|
{
|
||||||
|
public readonly Bindable<RulesetInfo> Ruleset = new Bindable<RulesetInfo>();
|
||||||
private FillFlowContainer<RulesetToggleButton> modeButtons;
|
private FillFlowContainer<RulesetToggleButton> modeButtons;
|
||||||
|
|
||||||
protected override Color4 BackgroundColour => OsuColour.FromHex(@"384552");
|
protected override Color4 BackgroundColour => OsuColour.FromHex(@"384552");
|
||||||
protected override DirectSortCritera DefaultTab => DirectSortCritera.Title;
|
protected override DirectSortCriteria DefaultTab => DirectSortCriteria.Ranked;
|
||||||
protected override Drawable CreateSupplementaryControls()
|
protected override Drawable CreateSupplementaryControls()
|
||||||
{
|
{
|
||||||
modeButtons = new FillFlowContainer<RulesetToggleButton>
|
modeButtons = new FillFlowContainer<RulesetToggleButton>
|
||||||
@ -36,10 +37,10 @@ namespace osu.Game.Overlays.Direct
|
|||||||
{
|
{
|
||||||
DisplayStyleControl.Dropdown.AccentColour = colours.BlueDark;
|
DisplayStyleControl.Dropdown.AccentColour = colours.BlueDark;
|
||||||
|
|
||||||
var b = new Bindable<RulesetInfo>(); //backup bindable incase the game is null
|
Ruleset.BindTo(game?.Ruleset ?? new Bindable<RulesetInfo> { Value = rulesets.GetRuleset(0) });
|
||||||
foreach (var r in rulesets.AllRulesets)
|
foreach (var r in rulesets.AllRulesets)
|
||||||
{
|
{
|
||||||
modeButtons.Add(new RulesetToggleButton(game?.Ruleset ?? b, r));
|
modeButtons.Add(new RulesetToggleButton(Ruleset, r));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +96,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum DirectSortCritera
|
public enum DirectSortCriteria
|
||||||
{
|
{
|
||||||
Title,
|
Title,
|
||||||
Artist,
|
Artist,
|
||||||
@ -103,5 +104,6 @@ namespace osu.Game.Overlays.Direct
|
|||||||
Difficulty,
|
Difficulty,
|
||||||
Ranked,
|
Ranked,
|
||||||
Rating,
|
Rating,
|
||||||
|
Plays,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,10 +30,10 @@ namespace osu.Game.Overlays.Direct
|
|||||||
{
|
{
|
||||||
Search,
|
Search,
|
||||||
[Description("Newest Maps")]
|
[Description("Newest Maps")]
|
||||||
NewestMaps,
|
NewestMaps = DirectSortCriteria.Ranked,
|
||||||
[Description("Top Rated")]
|
[Description("Top Rated")]
|
||||||
TopRated,
|
TopRated = DirectSortCriteria.Rating,
|
||||||
[Description("Most Played")]
|
[Description("Most Played")]
|
||||||
MostPlayed
|
MostPlayed = DirectSortCriteria.Plays,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,21 +5,28 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Online.API;
|
||||||
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Overlays.Direct;
|
using osu.Game.Overlays.Direct;
|
||||||
using osu.Game.Overlays.SearchableList;
|
using osu.Game.Overlays.SearchableList;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public class DirectOverlay : SearchableListOverlay<DirectTab, DirectSortCritera, RankStatus>
|
public class DirectOverlay : SearchableListOverlay<DirectTab, DirectSortCriteria, RankStatus>
|
||||||
{
|
{
|
||||||
private const float panel_padding = 10f;
|
private const float panel_padding = 10f;
|
||||||
|
|
||||||
|
private APIAccess api;
|
||||||
|
private RulesetDatabase rulesets;
|
||||||
|
|
||||||
private readonly FillFlowContainer resultCountsContainer;
|
private readonly FillFlowContainer resultCountsContainer;
|
||||||
private readonly OsuSpriteText resultCountsText;
|
private readonly OsuSpriteText resultCountsText;
|
||||||
private readonly FillFlowContainer<DirectPanel> panels;
|
private readonly FillFlowContainer<DirectPanel> panels;
|
||||||
@ -29,7 +36,7 @@ namespace osu.Game.Overlays
|
|||||||
protected override Color4 TrianglesColourDark => OsuColour.FromHex(@"3f5265");
|
protected override Color4 TrianglesColourDark => OsuColour.FromHex(@"3f5265");
|
||||||
|
|
||||||
protected override SearchableListHeader<DirectTab> CreateHeader() => new Header();
|
protected override SearchableListHeader<DirectTab> CreateHeader() => new Header();
|
||||||
protected override SearchableListFilterControl<DirectSortCritera, RankStatus> CreateFilterControl() => new FilterControl();
|
protected override SearchableListFilterControl<DirectSortCriteria, RankStatus> CreateFilterControl() => new FilterControl();
|
||||||
|
|
||||||
private IEnumerable<BeatmapSetInfo> beatmapSets;
|
private IEnumerable<BeatmapSetInfo> beatmapSets;
|
||||||
public IEnumerable<BeatmapSetInfo> BeatmapSets
|
public IEnumerable<BeatmapSetInfo> BeatmapSets
|
||||||
@ -40,6 +47,17 @@ namespace osu.Game.Overlays
|
|||||||
if (beatmapSets?.Equals(value) ?? false) return;
|
if (beatmapSets?.Equals(value) ?? false) return;
|
||||||
beatmapSets = value;
|
beatmapSets = value;
|
||||||
|
|
||||||
|
if (BeatmapSets == null)
|
||||||
|
{
|
||||||
|
foreach (var p in panels.Children)
|
||||||
|
{
|
||||||
|
p.FadeOut(200);
|
||||||
|
p.Expire();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
|
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,22 +116,60 @@ namespace osu.Game.Overlays
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Header.Tabs.Current.ValueChanged += tab => { if (tab != DirectTab.Search) Filter.Search.Text = string.Empty; };
|
|
||||||
Filter.Search.Current.ValueChanged += text => { if (text != string.Empty) Header.Tabs.Current.Value = DirectTab.Search; };
|
Filter.Search.Current.ValueChanged += text => { if (text != string.Empty) Header.Tabs.Current.Value = DirectTab.Search; };
|
||||||
|
((FilterControl)Filter).Ruleset.ValueChanged += ruleset => Scheduler.AddOnce(updateSearch);
|
||||||
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += recreatePanels;
|
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += recreatePanels;
|
||||||
|
Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += rankStatus => Scheduler.AddOnce(updateSearch);
|
||||||
|
|
||||||
|
Header.Tabs.Current.ValueChanged += tab =>
|
||||||
|
{
|
||||||
|
if (tab != DirectTab.Search)
|
||||||
|
{
|
||||||
|
currentQuery.Value = string.Empty;
|
||||||
|
Filter.Tabs.Current.Value = (DirectSortCriteria)Header.Tabs.Current.Value;
|
||||||
|
Scheduler.AddOnce(updateSearch);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
currentQuery.ValueChanged += v =>
|
||||||
|
{
|
||||||
|
queryChangedDebounce?.Cancel();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(v))
|
||||||
|
Scheduler.AddOnce(updateSearch);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BeatmapSets = null;
|
||||||
|
ResultAmounts = null;
|
||||||
|
|
||||||
|
queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
currentQuery.BindTo(Filter.Search.Current);
|
||||||
|
|
||||||
|
Filter.Tabs.Current.ValueChanged += sortCriteria =>
|
||||||
|
{
|
||||||
|
if (Header.Tabs.Current.Value != DirectTab.Search && sortCriteria != (DirectSortCriteria)Header.Tabs.Current.Value)
|
||||||
|
Header.Tabs.Current.Value = DirectTab.Search;
|
||||||
|
|
||||||
|
Scheduler.AddOnce(updateSearch);
|
||||||
|
};
|
||||||
|
|
||||||
updateResultCounts();
|
updateResultCounts();
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours, APIAccess api, RulesetDatabase rulesets)
|
||||||
{
|
{
|
||||||
|
this.api = api;
|
||||||
|
this.rulesets = rulesets;
|
||||||
resultCountsContainer.Colour = colours.Yellow;
|
resultCountsContainer.Colour = colours.Yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateResultCounts()
|
private void updateResultCounts()
|
||||||
{
|
{
|
||||||
resultCountsContainer.FadeTo(ResultAmounts == null ? 0f : 1f, 200, EasingTypes.Out);
|
resultCountsContainer.FadeTo(ResultAmounts == null ? 0f : 1f, 200, EasingTypes.OutQuint);
|
||||||
if (ResultAmounts == null) return;
|
if (ResultAmounts == null) return;
|
||||||
|
|
||||||
resultCountsText.Text = pluralize("Artist", ResultAmounts.Artists) + ", " +
|
resultCountsText.Text = pluralize("Artist", ResultAmounts.Artists) + ", " +
|
||||||
@ -129,8 +185,67 @@ namespace osu.Game.Overlays
|
|||||||
private void recreatePanels(PanelDisplayStyle displayStyle)
|
private void recreatePanels(PanelDisplayStyle displayStyle)
|
||||||
{
|
{
|
||||||
if (BeatmapSets == null) return;
|
if (BeatmapSets == null) return;
|
||||||
panels.ChildrenEnumerable = BeatmapSets.Select(b => displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : new DirectListPanel(b));
|
|
||||||
|
panels.ChildrenEnumerable = BeatmapSets.Select<BeatmapSetInfo, DirectPanel>(b =>
|
||||||
|
{
|
||||||
|
switch (displayStyle)
|
||||||
|
{
|
||||||
|
case PanelDisplayStyle.Grid:
|
||||||
|
return new DirectGridPanel(b) { Width = 400 };
|
||||||
|
default:
|
||||||
|
return new DirectListPanel(b);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private GetBeatmapSetsRequest getSetsRequest;
|
||||||
|
|
||||||
|
private readonly Bindable<string> currentQuery = new Bindable<string>();
|
||||||
|
|
||||||
|
private ScheduledDelegate queryChangedDebounce;
|
||||||
|
|
||||||
|
private void updateSearch()
|
||||||
|
{
|
||||||
|
queryChangedDebounce?.Cancel();
|
||||||
|
|
||||||
|
if (!IsLoaded) return;
|
||||||
|
|
||||||
|
BeatmapSets = null;
|
||||||
|
ResultAmounts = null;
|
||||||
|
|
||||||
|
getSetsRequest?.Cancel();
|
||||||
|
|
||||||
|
if (api == null) return;
|
||||||
|
|
||||||
|
if (Header.Tabs.Current.Value == DirectTab.Search && (Filter.Search.Text == string.Empty || currentQuery == string.Empty)) return;
|
||||||
|
|
||||||
|
getSetsRequest = new GetBeatmapSetsRequest(currentQuery,
|
||||||
|
((FilterControl)Filter).Ruleset.Value,
|
||||||
|
Filter.DisplayStyleControl.Dropdown.Current.Value,
|
||||||
|
Filter.Tabs.Current.Value); //todo: sort direction (?)
|
||||||
|
|
||||||
|
getSetsRequest.Success += r =>
|
||||||
|
{
|
||||||
|
BeatmapSets = r?.Select(response => response.ToBeatmapSet(rulesets));
|
||||||
|
if (BeatmapSets == null) return;
|
||||||
|
|
||||||
|
var artists = new List<string>();
|
||||||
|
var songs = new List<string>();
|
||||||
|
var tags = new List<string>();
|
||||||
|
foreach (var s in BeatmapSets)
|
||||||
|
{
|
||||||
|
artists.Add(s.Metadata.Artist);
|
||||||
|
songs.Add(s.Metadata.Title);
|
||||||
|
tags.AddRange(s.Metadata.Tags.Split(' '));
|
||||||
|
}
|
||||||
|
|
||||||
|
ResultAmounts = new ResultCounts(distinctCount(artists), distinctCount(songs), distinctCount(tags));
|
||||||
|
};
|
||||||
|
|
||||||
|
api.Queue(getSetsRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int distinctCount(List<string> list) => list.Distinct().ToArray().Length;
|
||||||
|
|
||||||
public class ResultCounts
|
public class ResultCounts
|
||||||
{
|
{
|
||||||
|
@ -199,7 +199,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
iconsContainer.Clear();
|
iconsContainer.Clear();
|
||||||
if (Mods.Length > 1)
|
if (Mods.Length > 1)
|
||||||
{
|
{
|
||||||
iconsContainer.Add(new[]
|
iconsContainer.AddRange(new[]
|
||||||
{
|
{
|
||||||
backgroundIcon = new ModIcon(Mods[1])
|
backgroundIcon = new ModIcon(Mods[1])
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
Light = new NotificationLight
|
Light = new NotificationLight
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
Left = 20,
|
Left = 20,
|
||||||
};
|
};
|
||||||
|
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
|
@ -90,7 +90,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
private ProgressNotificationState state;
|
private ProgressNotificationState state;
|
||||||
|
|
||||||
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification()
|
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification
|
||||||
{
|
{
|
||||||
Activated = CompletionClickAction,
|
Activated = CompletionClickAction,
|
||||||
Text = $"Task \"{Text}\" has completed!"
|
Text = $"Task \"{Text}\" has completed!"
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public SimpleNotification()
|
public SimpleNotification()
|
||||||
{
|
{
|
||||||
IconContent.Add(new Drawable[]
|
IconContent.AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
IconBackgound = new Box
|
IconBackgound = new Box
|
||||||
{
|
{
|
||||||
|
@ -120,6 +120,7 @@ namespace osu.Game.Overlays.SearchableList
|
|||||||
{
|
{
|
||||||
protected override Color4 BackgroundUnfocused => backgroundColour;
|
protected override Color4 BackgroundUnfocused => backgroundColour;
|
||||||
protected override Color4 BackgroundFocused => backgroundColour;
|
protected override Color4 BackgroundFocused => backgroundColour;
|
||||||
|
protected override bool AllowCommit => true;
|
||||||
|
|
||||||
private Color4 backgroundColour;
|
private Color4 backgroundColour;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Overlays.SearchableList
|
|||||||
{
|
{
|
||||||
public SlimMenu()
|
public SlimMenu()
|
||||||
{
|
{
|
||||||
Background.Colour = Color4.Black.Opacity(0.25f);
|
Background.Colour = Color4.Black.Opacity(0.7f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
if (text == null)
|
if (text == null)
|
||||||
{
|
{
|
||||||
// construct lazily for cases where the label is not needed (may be provided by the Control).
|
// construct lazily for cases where the label is not needed (may be provided by the Control).
|
||||||
Add(text = new OsuSpriteText() { Depth = 1 });
|
Add(text = new OsuSpriteText { Depth = 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
text.Text = value;
|
text.Text = value;
|
||||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
const int header_size = 26;
|
const int header_size = 26;
|
||||||
const int header_margin = 25;
|
const int header_margin = 25;
|
||||||
const int border_size = 2;
|
const int border_size = 2;
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
where T : struct, IEquatable<T>
|
where T : struct, IEquatable<T>
|
||||||
where U : SliderBar<T>, new()
|
where U : SliderBar<T>, new()
|
||||||
{
|
{
|
||||||
protected override Drawable CreateControl() => new U()
|
protected override Drawable CreateControl() => new U
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
||||||
RelativeSizeAxes = Axes.X
|
RelativeSizeAxes = Axes.X
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Direction = FillDirection.Vertical;
|
Direction = FillDirection.Vertical;
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Objects
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Compares two hit objects by their start time, falling back to creation order if their start time is equal.
|
|
||||||
/// </summary>
|
|
||||||
public class HitObjectStartTimeComparer : Drawable.CreationOrderDepthComparer
|
|
||||||
{
|
|
||||||
public override int Compare(Drawable x, Drawable y)
|
|
||||||
{
|
|
||||||
var hitObjectX = x as DrawableHitObject;
|
|
||||||
var hitObjectY = y as DrawableHitObject;
|
|
||||||
|
|
||||||
// If either of the two drawables are not hit objects, fall back to the base comparer
|
|
||||||
if (hitObjectX?.HitObject == null || hitObjectY?.HitObject == null)
|
|
||||||
return base.Compare(x, y);
|
|
||||||
|
|
||||||
// Compare by start time
|
|
||||||
int i = hitObjectX.HitObject.StartTime.CompareTo(hitObjectY.HitObject.StartTime);
|
|
||||||
if (i != 0)
|
|
||||||
return i;
|
|
||||||
|
|
||||||
return base.Compare(x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Compares two hit objects by their start time, falling back to creation order if their start time is equal.
|
|
||||||
/// This will compare the two hit objects in reverse order.
|
|
||||||
/// </summary>
|
|
||||||
public class HitObjectReverseStartTimeComparer : Drawable.ReverseCreationOrderDepthComparer
|
|
||||||
{
|
|
||||||
public override int Compare(Drawable x, Drawable y)
|
|
||||||
{
|
|
||||||
var hitObjectX = x as DrawableHitObject;
|
|
||||||
var hitObjectY = y as DrawableHitObject;
|
|
||||||
|
|
||||||
// If either of the two drawables are not hit objects, fall back to the base comparer
|
|
||||||
if (hitObjectX?.HitObject == null || hitObjectY?.HitObject == null)
|
|
||||||
return base.Compare(x, y);
|
|
||||||
|
|
||||||
// Compare by start time
|
|
||||||
int i = hitObjectY.HitObject.StartTime.CompareTo(hitObjectX.HitObject.StartTime);
|
|
||||||
if (i != 0)
|
|
||||||
return i;
|
|
||||||
|
|
||||||
return base.Compare(x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +1,11 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Caching;
|
using osu.Framework.Caching;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Objects;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
@ -55,7 +53,22 @@ namespace osu.Game.Rulesets.Timing
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal MultiplierControlPoint ControlPoint;
|
internal MultiplierControlPoint ControlPoint;
|
||||||
|
|
||||||
protected override IComparer<Drawable> DepthComparer => new HitObjectReverseStartTimeComparer();
|
protected override int Compare(Drawable x, Drawable y)
|
||||||
|
{
|
||||||
|
var xHitObject = x as DrawableHitObject;
|
||||||
|
var yHitObject = y as DrawableHitObject;
|
||||||
|
|
||||||
|
// If either of the two drawables are not hit objects, fall back to the base comparer
|
||||||
|
if (xHitObject?.HitObject == null || yHitObject?.HitObject == null)
|
||||||
|
return base.Compare(x, y);
|
||||||
|
|
||||||
|
// Compare by start time
|
||||||
|
int i = yHitObject.HitObject.StartTime.CompareTo(xHitObject.HitObject.StartTime);
|
||||||
|
if (i != 0)
|
||||||
|
return i;
|
||||||
|
|
||||||
|
return base.Compare(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="DrawableTimingSection"/>.
|
/// Creates a new <see cref="DrawableTimingSection"/>.
|
||||||
|
@ -33,7 +33,20 @@ namespace osu.Game.Rulesets.Timing
|
|||||||
set { visibleTimeRange.BindTo(value); }
|
set { visibleTimeRange.BindTo(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IComparer<Drawable> DepthComparer => new SpeedAdjustmentContainerReverseStartTimeComparer();
|
protected override int Compare(Drawable x, Drawable y)
|
||||||
|
{
|
||||||
|
var xSpeedAdjust = x as SpeedAdjustmentContainer;
|
||||||
|
var ySpeedAdjust = y as SpeedAdjustmentContainer;
|
||||||
|
|
||||||
|
// If either of the two drawables are not hit objects, fall back to the base comparer
|
||||||
|
if (xSpeedAdjust?.ControlPoint == null || ySpeedAdjust?.ControlPoint == null)
|
||||||
|
return CompareReverseChildID(x, y);
|
||||||
|
|
||||||
|
// Compare by start time
|
||||||
|
int i = ySpeedAdjust.ControlPoint.StartTime.CompareTo(xSpeedAdjust.ControlPoint.StartTime);
|
||||||
|
|
||||||
|
return i != 0 ? i : CompareReverseChildID(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hit objects that are to be re-processed on the next update.
|
/// Hit objects that are to be re-processed on the next update.
|
||||||
@ -116,27 +129,5 @@ namespace osu.Game.Rulesets.Timing
|
|||||||
/// <param name="time">The time to find the active <see cref="SpeedAdjustmentContainer"/> at.</param>
|
/// <param name="time">The time to find the active <see cref="SpeedAdjustmentContainer"/> at.</param>
|
||||||
/// <returns>The <see cref="SpeedAdjustmentContainer"/> active at <paramref name="time"/>. Null if there are no speed adjustments.</returns>
|
/// <returns>The <see cref="SpeedAdjustmentContainer"/> active at <paramref name="time"/>. Null if there are no speed adjustments.</returns>
|
||||||
private SpeedAdjustmentContainer adjustmentContainerAt(double time) => Children.FirstOrDefault(c => c.CanContain(time)) ?? Children.LastOrDefault();
|
private SpeedAdjustmentContainer adjustmentContainerAt(double time) => Children.FirstOrDefault(c => c.CanContain(time)) ?? Children.LastOrDefault();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Compares two speed adjustment containers by their control point start time, falling back to creation order
|
|
||||||
// if their control point start time is equal. This will compare the two speed adjustment containers in reverse order.
|
|
||||||
/// </summary>
|
|
||||||
private class SpeedAdjustmentContainerReverseStartTimeComparer : ReverseCreationOrderDepthComparer
|
|
||||||
{
|
|
||||||
public override int Compare(Drawable x, Drawable y)
|
|
||||||
{
|
|
||||||
var speedAdjustmentX = x as SpeedAdjustmentContainer;
|
|
||||||
var speedAdjustmentY = y as SpeedAdjustmentContainer;
|
|
||||||
|
|
||||||
// If either of the two drawables are not hit objects, fall back to the base comparer
|
|
||||||
if (speedAdjustmentX?.ControlPoint == null || speedAdjustmentY?.ControlPoint == null)
|
|
||||||
return base.Compare(x, y);
|
|
||||||
|
|
||||||
// Compare by start time
|
|
||||||
int i = speedAdjustmentY.ControlPoint.StartTime.CompareTo(speedAdjustmentX.ControlPoint.StartTime);
|
|
||||||
|
|
||||||
return i != 0 ? i : base.Compare(x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,8 +114,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
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(@"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(@"exit", string.Empty, FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q));
|
buttonsTopLevel.Add(new Button(@"exit", string.Empty, FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q));
|
||||||
|
|
||||||
buttonFlow.Add(buttonsPlay);
|
buttonFlow.AddRange(buttonsPlay);
|
||||||
buttonFlow.Add(buttonsTopLevel);
|
buttonFlow.AddRange(buttonsTopLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Drawable CentreTarget;
|
public Drawable CentreTarget;
|
||||||
|
|
||||||
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
|
protected override int Compare(Drawable x, Drawable y) => CompareReverseChildID(x, y);
|
||||||
|
|
||||||
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
|
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ using osu.Framework.Graphics.Colour;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
@ -45,7 +46,6 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
|
|
||||||
private OsuColour colours;
|
private OsuColour colours;
|
||||||
private LocalisationEngine localisation;
|
private LocalisationEngine localisation;
|
||||||
private TextureStore textures;
|
|
||||||
|
|
||||||
private Room room;
|
private Room room;
|
||||||
|
|
||||||
@ -367,11 +367,10 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, LocalisationEngine localisation, TextureStore textures)
|
private void load(OsuColour colours, LocalisationEngine localisation)
|
||||||
{
|
{
|
||||||
this.localisation = localisation;
|
this.localisation = localisation;
|
||||||
this.colours = colours;
|
this.colours = colours;
|
||||||
this.textures = textures;
|
|
||||||
|
|
||||||
beatmapAuthor.Colour = levelRangeContainer.Colour = colours.Gray9;
|
beatmapAuthor.Colour = levelRangeContainer.Colour = colours.Gray9;
|
||||||
host.Colour = colours.Blue;
|
host.Colour = colours.Blue;
|
||||||
@ -436,7 +435,7 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
coverContainer.FadeIn(transition_duration);
|
coverContainer.FadeIn(transition_duration);
|
||||||
coverContainer.Children = new[]
|
coverContainer.Children = new[]
|
||||||
{
|
{
|
||||||
new AsyncLoadWrapper(new BeatmapBackgroundSprite(new OnlineWorkingBeatmap(value, textures, null))
|
new AsyncLoadWrapper(new CoverSprite(value.BeatmapSet)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -527,5 +526,22 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class CoverSprite : Sprite
|
||||||
|
{
|
||||||
|
private readonly BeatmapSetInfo set;
|
||||||
|
|
||||||
|
public CoverSprite(BeatmapSetInfo set)
|
||||||
|
{
|
||||||
|
this.set = set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(TextureStore textures)
|
||||||
|
{
|
||||||
|
if (set.OnlineInfo?.Covers?.Cover != null)
|
||||||
|
Texture = textures.Get(set.OnlineInfo.Covers.Cover);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
iconsContainer = new ReverseDepthFillFlowContainer<ModIcon>
|
iconsContainer = new ReverseChildIDFillFlowContainer<ModIcon>
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
|
@ -20,15 +20,15 @@ namespace osu.Game.Screens.Play
|
|||||||
private SpriteText countSpriteText;
|
private SpriteText countSpriteText;
|
||||||
|
|
||||||
public bool IsCounting { get; set; }
|
public bool IsCounting { get; set; }
|
||||||
private int count;
|
private int countPresses;
|
||||||
public int Count
|
public int CountPresses
|
||||||
{
|
{
|
||||||
get { return count; }
|
get { return countPresses; }
|
||||||
private set
|
private set
|
||||||
{
|
{
|
||||||
if (count != value)
|
if (countPresses != value)
|
||||||
{
|
{
|
||||||
count = value;
|
countPresses = value;
|
||||||
countSpriteText.Text = value.ToString(@"#,0");
|
countSpriteText.Text = value.ToString(@"#,0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ namespace osu.Game.Screens.Play
|
|||||||
isLit = value;
|
isLit = value;
|
||||||
updateGlowSprite(value);
|
updateGlowSprite(value);
|
||||||
if (value && IsCounting)
|
if (value && IsCounting)
|
||||||
Count++;
|
CountPresses++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ namespace osu.Game.Screens.Play
|
|||||||
},
|
},
|
||||||
countSpriteText = new OsuSpriteText
|
countSpriteText = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = Count.ToString(@"#,0"),
|
Text = CountPresses.ToString(@"#,0"),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativePositionAxes = Axes.Both,
|
RelativePositionAxes = Axes.Both,
|
||||||
@ -128,6 +128,6 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetCount() => Count = 0;
|
public void ResetCount() => CountPresses = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
scoreProcessor = HitRenderer.CreateScoreProcessor();
|
scoreProcessor = HitRenderer.CreateScoreProcessor();
|
||||||
|
|
||||||
hudOverlay.KeyCounter.Add(rulesetInstance.CreateGameplayKeys());
|
hudOverlay.KeyCounter.AddRange(rulesetInstance.CreateGameplayKeys());
|
||||||
hudOverlay.BindProcessor(scoreProcessor);
|
hudOverlay.BindProcessor(scoreProcessor);
|
||||||
hudOverlay.BindHitRenderer(HitRenderer);
|
hudOverlay.BindHitRenderer(HitRenderer);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new ReplaySliderBar<double>()
|
new ReplaySliderBar<double>
|
||||||
{
|
{
|
||||||
LabelText = "Playback speed",
|
LabelText = "Playback speed",
|
||||||
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed)
|
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed)
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
|||||||
public class ReplaySliderBar<T> : SettingsSlider<T>
|
public class ReplaySliderBar<T> : SettingsSlider<T>
|
||||||
where T : struct, IEquatable<T>
|
where T : struct, IEquatable<T>
|
||||||
{
|
{
|
||||||
protected override Drawable CreateControl() => new Sliderbar()
|
protected override Drawable CreateControl() => new Sliderbar
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
||||||
RelativeSizeAxes = Axes.X
|
RelativeSizeAxes = Axes.X
|
||||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
fill = new Box
|
fill = new Box
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,6 @@ using osu.Game.Beatmaps.Drawables;
|
|||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using System.Collections;
|
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -22,7 +21,7 @@ using osu.Framework.Configuration;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
internal class BeatmapCarousel : ScrollContainer, IEnumerable<BeatmapGroup>
|
internal class BeatmapCarousel : ScrollContainer
|
||||||
{
|
{
|
||||||
public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap;
|
public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap;
|
||||||
|
|
||||||
@ -265,10 +264,6 @@ namespace osu.Game.Screens.Select
|
|||||||
perform();
|
perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerator<BeatmapGroup> GetEnumerator() => groups.GetEnumerator();
|
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
|
||||||
|
|
||||||
private BeatmapGroup createGroup(BeatmapSetInfo beatmapSet)
|
private BeatmapGroup createGroup(BeatmapSetInfo beatmapSet)
|
||||||
{
|
{
|
||||||
foreach (var b in beatmapSet.Beatmaps)
|
foreach (var b in beatmapSet.Beatmaps)
|
||||||
@ -307,7 +302,7 @@ namespace osu.Game.Screens.Select
|
|||||||
panels.Remove(p);
|
panels.Remove(p);
|
||||||
|
|
||||||
scrollableContent.Remove(group.Header);
|
scrollableContent.Remove(group.Header);
|
||||||
scrollableContent.Remove(group.BeatmapPanels);
|
scrollableContent.RemoveRange(group.BeatmapPanels);
|
||||||
|
|
||||||
if (selectedGroup == group)
|
if (selectedGroup == group)
|
||||||
SelectNext();
|
SelectNext();
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public BeatmapDetailArea()
|
public BeatmapDetailArea()
|
||||||
{
|
{
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new BeatmapDetailAreaTabControl
|
new BeatmapDetailAreaTabControl
|
||||||
{
|
{
|
||||||
@ -61,7 +61,7 @@ namespace osu.Game.Screens.Select
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
Details = new BeatmapDetails
|
Details = new BeatmapDetails
|
||||||
{
|
{
|
||||||
|
@ -160,7 +160,7 @@ namespace osu.Game.Screens.Select
|
|||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
Alpha = 0.5f,
|
Alpha = 0.5f,
|
||||||
},
|
},
|
||||||
new FillFlowContainer<MetadataSegment>()
|
new FillFlowContainer<MetadataSegment>
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
|
@ -128,7 +128,7 @@ namespace osu.Game.Screens.Select
|
|||||||
// Bottom = 5
|
// Bottom = 5
|
||||||
// },
|
// },
|
||||||
//},
|
//},
|
||||||
sortTabs = new OsuTabControl<SortMode>()
|
sortTabs = new OsuTabControl<SortMode>
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Width = 0.5f,
|
Width = 0.5f,
|
||||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Screens.Select.Options
|
|||||||
Scale = new Vector2(1, 0),
|
Scale = new Vector2(1, 0),
|
||||||
Colour = Color4.Black.Opacity(0.5f),
|
Colour = Color4.Black.Opacity(0.5f),
|
||||||
},
|
},
|
||||||
buttonsContainer = new ReverseDepthFillFlowContainer<BeatmapOptionsButton>
|
buttonsContainer = new ReverseChildIDFillFlowContainer<BeatmapOptionsButton>
|
||||||
{
|
{
|
||||||
Height = height,
|
Height = height,
|
||||||
RelativePositionAxes = Axes.X,
|
RelativePositionAxes = Axes.X,
|
||||||
|
@ -190,7 +190,6 @@
|
|||||||
<Compile Include="Rulesets\Objects\Drawables\IScrollingHitObject.cs" />
|
<Compile Include="Rulesets\Objects\Drawables\IScrollingHitObject.cs" />
|
||||||
<Compile Include="Rulesets\Judgements\Judgement.cs" />
|
<Compile Include="Rulesets\Judgements\Judgement.cs" />
|
||||||
<Compile Include="Rulesets\Objects\HitObjectParser.cs" />
|
<Compile Include="Rulesets\Objects\HitObjectParser.cs" />
|
||||||
<Compile Include="Rulesets\Objects\HitObjectStartTimeComparer.cs" />
|
|
||||||
<Compile Include="Rulesets\Objects\Types\IHasCombo.cs" />
|
<Compile Include="Rulesets\Objects\Types\IHasCombo.cs" />
|
||||||
<Compile Include="Rulesets\Objects\Types\IHasEndTime.cs" />
|
<Compile Include="Rulesets\Objects\Types\IHasEndTime.cs" />
|
||||||
<Compile Include="Rulesets\Objects\Types\IHasDistance.cs" />
|
<Compile Include="Rulesets\Objects\Types\IHasDistance.cs" />
|
||||||
@ -474,10 +473,11 @@
|
|||||||
<Compile Include="Overlays\Direct\DirectPanel.cs" />
|
<Compile Include="Overlays\Direct\DirectPanel.cs" />
|
||||||
<Compile Include="Overlays\Direct\DirectGridPanel.cs" />
|
<Compile Include="Overlays\Direct\DirectGridPanel.cs" />
|
||||||
<Compile Include="Overlays\Direct\DirectListPanel.cs" />
|
<Compile Include="Overlays\Direct\DirectListPanel.cs" />
|
||||||
<Compile Include="Database\OnlineWorkingBeatmap.cs" />
|
|
||||||
<Compile Include="Database\BeatmapOnlineInfo.cs" />
|
<Compile Include="Database\BeatmapOnlineInfo.cs" />
|
||||||
<Compile Include="Graphics\Containers\ReverseDepthFillFlowContainer.cs" />
|
<Compile Include="Graphics\Containers\ReverseChildIDFillFlowContainer.cs" />
|
||||||
<Compile Include="Database\RankStatus.cs" />
|
<Compile Include="Database\RankStatus.cs" />
|
||||||
|
<Compile Include="Database\BeatmapSetOnlineInfo.cs" />
|
||||||
|
<Compile Include="Online\API\Requests\GetBeatmapSetsRequest.cs" />
|
||||||
<Compile Include="Overlays\SearchableList\SearchableListHeader.cs" />
|
<Compile Include="Overlays\SearchableList\SearchableListHeader.cs" />
|
||||||
<Compile Include="Overlays\SearchableList\HeaderTabControl.cs" />
|
<Compile Include="Overlays\SearchableList\HeaderTabControl.cs" />
|
||||||
<Compile Include="Overlays\Social\FilterControl.cs" />
|
<Compile Include="Overlays\Social\FilterControl.cs" />
|
||||||
|
@ -66,8 +66,8 @@
|
|||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInAttributeList/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInAttributeList/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInEnumDeclaration/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInEnumDeclaration/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInInitializer/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInInitializer/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexedValue"></s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexedValue">WARNING</s:String>
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexRemoved">True</s:Boolean>
|
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantExplicitParamsArrayCreation/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantExplicitParamsArrayCreation/@EntryIndexedValue">WARNING</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantImmediateDelegateInvocation/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantImmediateDelegateInvocation/@EntryIndexedValue">WARNING</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantLambdaSignatureParentheses/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantLambdaSignatureParentheses/@EntryIndexedValue">WARNING</s:String>
|
||||||
|
Loading…
Reference in New Issue
Block a user