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 712564e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void TestGameplayKeyBindings()

private KeyBindingsSubsection osuBindingSubsection => keyBindingPanel
.ChildrenOfType<VariantBindingsSubsection>()
.FirstOrDefault(s => s.Ruleset.ShortName == "osu");
.FirstOrDefault(s => s.Ruleset!.ShortName == "osu");

private OsuButton configureBindingsButton => Game.Settings
.ChildrenOfType<BindingSettings>().SingleOrDefault()?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. 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 712564e

Please sign in to comment.