mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Merge branch 'master' into input-settings
# Conflicts: # osu.Game/OsuGameBase.cs # osu.iOS/OsuGameIOS.cs
This commit is contained in:
@ -79,7 +79,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private RealmContextFactory realmFactory { get; set; }
|
||||
private RealmAccess realm { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
@ -386,11 +386,11 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
|
||||
private void updateStoreFromButton(KeyButton button)
|
||||
{
|
||||
using (var realm = realmFactory.CreateContext())
|
||||
realm.Run(r =>
|
||||
{
|
||||
var binding = realm.Find<RealmKeyBinding>(((IHasGuidPrimaryKey)button.KeyBinding).ID);
|
||||
realm.Write(() => binding.KeyCombinationString = button.KeyBinding.KeyCombinationString);
|
||||
}
|
||||
var binding = r.Find<RealmKeyBinding>(((IHasGuidPrimaryKey)button.KeyBinding).ID);
|
||||
r.Write(() => binding.KeyCombinationString = button.KeyBinding.KeyCombinationString);
|
||||
});
|
||||
}
|
||||
|
||||
private void updateIsDefaultValue()
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
{
|
||||
protected IEnumerable<Framework.Input.Bindings.KeyBinding> Defaults;
|
||||
|
||||
protected RulesetInfo Ruleset;
|
||||
public RulesetInfo Ruleset { get; protected set; }
|
||||
|
||||
private readonly int? variant;
|
||||
|
||||
@ -30,14 +30,13 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(RealmContextFactory realmFactory)
|
||||
private void load(RealmAccess realm)
|
||||
{
|
||||
string rulesetName = Ruleset?.ShortName;
|
||||
|
||||
List<RealmKeyBinding> bindings;
|
||||
|
||||
using (var realm = realmFactory.CreateContext())
|
||||
bindings = realm.All<RealmKeyBinding>().Where(b => b.RulesetName == rulesetName && b.Variant == variant).Detach();
|
||||
var bindings = realm.Run(r => r.All<RealmKeyBinding>()
|
||||
.Where(b => b.RulesetName == rulesetName && b.Variant == variant)
|
||||
.Detach());
|
||||
|
||||
foreach (var defaultGroup in Defaults.GroupBy(d => d.Action))
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
// 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.Diagnostics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Localisation;
|
||||
@ -26,6 +27,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
|
||||
var r = ruleset.CreateInstance();
|
||||
|
||||
Debug.Assert(r != null);
|
||||
|
||||
foreach (int variant in r.AvailableVariants)
|
||||
Add(new VariantBindingsSubsection(ruleset, variant));
|
||||
}
|
||||
|
Reference in New Issue
Block a user