Skip to content

Commit

Permalink
Enable NRT in KeyBindingsSubsection
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed Oct 11, 2023
1 parent 797109c commit bd48457
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// 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.

#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Input.Bindings;
using osu.Framework.Localisation;
using osu.Game.Database;
using osu.Game.Input.Bindings;
Expand All @@ -25,9 +25,9 @@ public abstract partial class KeyBindingsSubsection : SettingsSubsection
/// </summary>
protected virtual bool AutoAdvanceTarget => false;

protected IEnumerable<Framework.Input.Bindings.KeyBinding> Defaults { get; init; }
protected IEnumerable<KeyBinding> Defaults { get; init; } = Array.Empty<KeyBinding>();

public RulesetInfo Ruleset { get; protected set; }
public RulesetInfo? Ruleset { get; protected set; }

private readonly int? variant;

Expand All @@ -41,7 +41,7 @@ protected KeyBindingsSubsection(int? variant)
[BackgroundDependencyLoader]
private void load(RealmAccess realm)
{
string rulesetName = Ruleset?.ShortName;
string? rulesetName = Ruleset?.ShortName;

var bindings = realm.Run(r => r.All<RealmKeyBinding>()
.Where(b => b.RulesetName == rulesetName && b.Variant == variant)
Expand Down

0 comments on commit bd48457

Please sign in to comment.