mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 16:22:57 +08:00
Merge remote-tracking branch 'upstream/master' into user-status-wiring
This commit is contained in:
commit
e7afaeaa4d
@ -8,5 +8,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public class APIMod : IMod
|
||||
{
|
||||
public string Acronym { get; set; }
|
||||
|
||||
public bool Equals(IMod other) => Acronym == other?.Acronym;
|
||||
}
|
||||
}
|
||||
|
@ -134,8 +134,8 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
|
||||
DetailsVisible.BindValueChanged(visible =>
|
||||
{
|
||||
hiddenDetailContainer.Alpha = visible.NewValue ? 1 : 0;
|
||||
expandedDetailContainer.Alpha = visible.NewValue ? 0 : 1;
|
||||
hiddenDetailContainer.Alpha = visible.NewValue ? 0 : 1;
|
||||
expandedDetailContainer.Alpha = visible.NewValue ? 1 : 0;
|
||||
}, true);
|
||||
|
||||
User.BindValueChanged(user => updateDisplay(user.NewValue));
|
||||
@ -143,8 +143,8 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
|
||||
private void updateDisplay(User user)
|
||||
{
|
||||
hiddenDetailGlobal.Content = user?.Statistics?.Ranks.Global?.ToString("#,##0") ?? "-";
|
||||
hiddenDetailCountry.Content = user?.Statistics?.Ranks.Country?.ToString("#,##0") ?? "-";
|
||||
hiddenDetailGlobal.Content = user?.Statistics?.Ranks.Global?.ToString("\\##,##0") ?? "-";
|
||||
hiddenDetailCountry.Content = user?.Statistics?.Ranks.Country?.ToString("\\##,##0") ?? "-";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,12 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
public interface IMod
|
||||
public interface IMod : IEquatable<IMod>
|
||||
{
|
||||
/// <summary>
|
||||
/// The shortened name of this mod.
|
||||
|
@ -70,5 +70,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
/// Creates a copy of this <see cref="Mod"/> initialised to a default state.
|
||||
/// </summary>
|
||||
public virtual Mod CreateCopy() => (Mod)Activator.CreateInstance(GetType());
|
||||
|
||||
public bool Equals(IMod other) => GetType() == other?.GetType();
|
||||
}
|
||||
}
|
||||
|
@ -177,6 +177,8 @@ namespace osu.Game.Scoring
|
||||
protected class DeserializedMod : IMod
|
||||
{
|
||||
public string Acronym { get; set; }
|
||||
|
||||
public bool Equals(IMod other) => Acronym == other?.Acronym;
|
||||
}
|
||||
|
||||
public override string ToString() => $"{User} playing {Beatmap}";
|
||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Screens.Multi.Play
|
||||
if (ruleset.Value.ID != playlistItem.Ruleset.ID)
|
||||
throw new InvalidOperationException("Current Ruleset does not match PlaylistItem's Ruleset");
|
||||
|
||||
if (!playlistItem.RequiredMods.All(m => Mods.Value.Contains(m)))
|
||||
if (!playlistItem.RequiredMods.All(m => Mods.Value.Any(m.Equals)))
|
||||
throw new InvalidOperationException("Current Mods do not match PlaylistItem's RequiredMods");
|
||||
|
||||
var req = new CreateRoomScoreRequest(roomId.Value ?? 0, playlistItem.ID);
|
||||
|
Loading…
Reference in New Issue
Block a user