mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge remote-tracking branch 'upstream/master' into user-iqueryable
This commit is contained in:
@ -3,11 +3,12 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Database;
|
||||
|
||||
namespace osu.Game.Input.Bindings
|
||||
{
|
||||
[Table("KeyBinding")]
|
||||
public class DatabasedKeyBinding : KeyBinding
|
||||
public class DatabasedKeyBinding : KeyBinding, IHasPrimaryKey
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int ID { get; set; }
|
||||
|
@ -60,7 +60,7 @@ namespace osu.Game.Input
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve <see cref="KeyBinding"/>s for a specified ruleset/variant content.
|
||||
/// Retrieve <see cref="DatabasedKeyBinding"/>s for a specified ruleset/variant content.
|
||||
/// </summary>
|
||||
/// <param name="rulesetId">The ruleset's internal ID.</param>
|
||||
/// <param name="variant">An optional variant.</param>
|
||||
@ -70,8 +70,14 @@ namespace osu.Game.Input
|
||||
|
||||
public void Update(KeyBinding keyBinding)
|
||||
{
|
||||
var dbKeyBinding = (DatabasedKeyBinding)keyBinding;
|
||||
|
||||
var context = GetContext();
|
||||
context.Update(keyBinding);
|
||||
|
||||
Refresh(ref dbKeyBinding);
|
||||
|
||||
dbKeyBinding.KeyCombination = keyBinding.KeyCombination;
|
||||
|
||||
context.SaveChanges();
|
||||
|
||||
KeyBindingChanged?.Invoke();
|
||||
|
Reference in New Issue
Block a user