1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Enable NRT in KeyBindingsSubsection

This commit is contained in:
Bartłomiej Dach 2023-10-11 08:49:52 +02:00
parent 797109c05c
commit 712564ea4f
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View File

@ -78,7 +78,7 @@ namespace osu.Game.Tests.Visual.Navigation
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()?

View File

@ -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;
@ -25,9 +25,9 @@ namespace osu.Game.Overlays.Settings.Sections.Input
/// </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;
@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
[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)