1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 18:32:56 +08:00

Fixed NVika code quality errors

This commit is contained in:
Givikap120 2024-02-18 03:28:24 +02:00
parent 9070e973d3
commit a6b63efe7d
4 changed files with 9 additions and 4 deletions

View File

@ -163,6 +163,7 @@ namespace osu.Game.Overlays.Mods
mod.ApplyToDifficulty(originalDifficulty);
return originalDifficulty;
}
private void updateValues() => Scheduler.AddOnce(() =>
{
if (BeatmapInfo.Value == null)

View File

@ -42,7 +42,6 @@ namespace osu.Game.Overlays.Mods
[Cached]
public Bindable<IReadOnlyList<Mod>> SelectedMods { get; private set; } = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
/// <summary>
/// Contains a dictionary with the current <see cref="ModState"/> of all mods applicable for the current ruleset.
/// </summary>
@ -128,6 +127,7 @@ namespace osu.Game.Overlays.Mods
private Container aboveColumnsContent = null!;
protected RankingInformationDisplay? RankingInformationDisplay;
protected BeatmapAttributesDisplay? BeatmapAttributesDisplay;
protected virtual BeatmapAttributesDisplay GetBeatmapAttributesDisplay => new BeatmapAttributesDisplay
{
Anchor = Anchor.BottomRight,

View File

@ -86,12 +86,14 @@ namespace osu.Game.Overlays.Mods
{
double rate = base.GetRate();
Ruleset ruleset = GameRuleset.Value.CreateInstance();
if (multiplayerRoomItem != null && multiplayerRoomItem.Value != null)
if (multiplayerRoomItem?.Value != null)
{
var multiplayerRoomMods = multiplayerRoomItem.Value.RequiredMods.Select(m => m.ToMod(ruleset));
foreach (var mod in multiplayerRoomMods.OfType<IApplicableToRate>())
rate = mod.ApplyToRate(0, rate);
}
return rate;
}
@ -99,12 +101,14 @@ namespace osu.Game.Overlays.Mods
{
BeatmapDifficulty originalDifficulty = base.GetDifficulty();
Ruleset ruleset = GameRuleset.Value.CreateInstance();
if (multiplayerRoomItem != null && multiplayerRoomItem.Value != null)
if (multiplayerRoomItem?.Value != null)
{
var multiplayerRoomMods = multiplayerRoomItem.Value.RequiredMods.Select(m => m.ToMod(ruleset));
foreach (var mod in multiplayerRoomMods.OfType<IApplicableToDifficulty>())
mod.ApplyToDifficulty(originalDifficulty);
}
return originalDifficulty;
}
}

View File

@ -241,7 +241,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
}
};
LoadComponent(UserModsSelectOverlay = new MultiplayerModSelectOverlay()
LoadComponent(UserModsSelectOverlay = new MultiplayerModSelectOverlay
{
SelectedMods = { BindTarget = UserMods },
IsValidMod = _ => false