1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Refactor migration to read the same as previous one

This commit is contained in:
Dean Herbert 2023-08-16 16:21:42 +09:00
parent 68db112882
commit caf0fd0742

View File

@ -1022,10 +1022,10 @@ namespace osu.Game.Database
{
// Clear default bindings for the chat focus toggle,
// as they would conflict with the newly-added leaderboard toggle.
var newKeyBindings = migration.NewRealm.All<RealmKeyBinding>().ToList();
var toggleChatBind = newKeyBindings.FirstOrDefault(bind => bind.ActionInt == (int)GlobalAction.ToggleChatFocus);
var keyBindings = migration.NewRealm.All<RealmKeyBinding>();
if (toggleChatBind != default && toggleChatBind.KeyCombination.Keys.SequenceEqual(new[] { InputKey.Tab }))
var toggleChatBind = keyBindings.FirstOrDefault(bind => bind.ActionInt == (int)GlobalAction.ToggleChatFocus);
if (toggleChatBind != null && toggleChatBind.KeyCombination.Keys.SequenceEqual(new[] { InputKey.Tab }))
migration.NewRealm.Remove(toggleChatBind);
break;