mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Don't query database on keypress
This commit is contained in:
@ -15,6 +15,8 @@ namespace osu.Game.Input
|
||||
{
|
||||
public class KeyBindingStore : DatabaseBackedStore
|
||||
{
|
||||
public event Action KeyBindingChanged;
|
||||
|
||||
public KeyBindingStore(Func<OsuDbContext> getContext, RulesetStore rulesets, Storage storage = null)
|
||||
: base(getContext, storage)
|
||||
{
|
||||
@ -59,7 +61,8 @@ namespace osu.Game.Input
|
||||
});
|
||||
}
|
||||
|
||||
context.SaveChanges(transaction);
|
||||
context.SaveChanges();
|
||||
transaction.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,6 +82,8 @@ namespace osu.Game.Input
|
||||
var context = GetContext();
|
||||
context.Update(keyBinding);
|
||||
context.SaveChanges();
|
||||
|
||||
KeyBindingChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user