mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 09:22:54 +08:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into songselect-best-user-score
This commit is contained in:
commit
9c13ede5a8
@ -248,7 +248,7 @@ namespace osu.Game
|
||||
}
|
||||
|
||||
// Use first beatmap available for current ruleset, else switch ruleset.
|
||||
var first = databasedSet.Beatmaps.Find(b => b.Ruleset == Ruleset.Value) ?? databasedSet.Beatmaps.First();
|
||||
var first = databasedSet.Beatmaps.Find(b => b.Ruleset.Equals(Ruleset.Value)) ?? databasedSet.Beatmaps.First();
|
||||
|
||||
Ruleset.Value = first.Ruleset;
|
||||
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first);
|
||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
foreach (var tabItem in TabContainer)
|
||||
{
|
||||
if (tabItem.Value == Current.Value)
|
||||
if (tabItem.Value.Equals(Current.Value))
|
||||
{
|
||||
ModeButtonLine.MoveToX(tabItem.DrawPosition.X, !hasInitialPosition ? 0 : 200, Easing.OutQuint);
|
||||
break;
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace osu.Game.Rulesets
|
||||
@ -23,6 +24,21 @@ namespace osu.Game.Rulesets
|
||||
|
||||
public bool Equals(RulesetInfo other) => other != null && ID == other.ID && Available == other.Available && Name == other.Name && InstantiationInfo == other.InstantiationInfo;
|
||||
|
||||
public override bool Equals(object obj) => obj is RulesetInfo rulesetInfo && Equals(rulesetInfo);
|
||||
|
||||
[SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")]
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
var hashCode = ID.HasValue ? ID.GetHashCode() : 0;
|
||||
hashCode = (hashCode * 397) ^ (InstantiationInfo != null ? InstantiationInfo.GetHashCode() : 0);
|
||||
hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
|
||||
hashCode = (hashCode * 397) ^ Available.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString() => $"{Name} ({ShortName}) ID: {ID}";
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets
|
||||
public RulesetStore(IDatabaseContextFactory factory)
|
||||
: base(factory)
|
||||
{
|
||||
AddMissingRulesets();
|
||||
addMissingRulesets();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -52,13 +52,13 @@ namespace osu.Game.Rulesets
|
||||
/// <summary>
|
||||
/// All available rulesets.
|
||||
/// </summary>
|
||||
public IEnumerable<RulesetInfo> AvailableRulesets;
|
||||
public IEnumerable<RulesetInfo> AvailableRulesets { get; private set; }
|
||||
|
||||
private static Assembly currentDomain_AssemblyResolve(object sender, ResolveEventArgs args) => loaded_assemblies.Keys.FirstOrDefault(a => a.FullName == args.Name);
|
||||
|
||||
private const string ruleset_library_prefix = "osu.Game.Rulesets";
|
||||
|
||||
protected void AddMissingRulesets()
|
||||
private void addMissingRulesets()
|
||||
{
|
||||
using (var usage = ContextFactory.GetForWrite())
|
||||
{
|
||||
|
@ -329,7 +329,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
if (this.IsCurrentScreen() && !Carousel.SelectBeatmap(e.NewValue?.BeatmapInfo, false))
|
||||
// If selecting new beatmap without bypassing filters failed, there's possibly a ruleset mismatch
|
||||
if (e.NewValue?.BeatmapInfo?.Ruleset != null && e.NewValue.BeatmapInfo.Ruleset != decoupledRuleset.Value)
|
||||
if (e.NewValue?.BeatmapInfo?.Ruleset != null && !e.NewValue.BeatmapInfo.Ruleset.Equals(decoupledRuleset.Value))
|
||||
{
|
||||
Ruleset.Value = e.NewValue.BeatmapInfo.Ruleset;
|
||||
Carousel.SelectBeatmap(e.NewValue.BeatmapInfo);
|
||||
|
Loading…
Reference in New Issue
Block a user