mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Add realm store / key binding implementations
This commit is contained in:
33
osu.Game/Input/Bindings/RealmKeyBinding.cs
Normal file
33
osu.Game/Input/Bindings/RealmKeyBinding.cs
Normal file
@ -0,0 +1,33 @@
|
||||
// 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;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Database;
|
||||
using Realms;
|
||||
|
||||
namespace osu.Game.Input.Bindings
|
||||
{
|
||||
[MapTo("KeyBinding")]
|
||||
public class RealmKeyBinding : RealmObject, IHasGuidPrimaryKey
|
||||
{
|
||||
public Guid ID { get; set; }
|
||||
|
||||
public int? RulesetID { get; set; }
|
||||
|
||||
public int? Variant { get; set; }
|
||||
|
||||
[Ignored]
|
||||
public KeyBinding KeyBinding
|
||||
{
|
||||
get
|
||||
{
|
||||
var split = KeyBindingString.Split(':');
|
||||
return new KeyBinding(split[0], int.Parse(split[1]));
|
||||
}
|
||||
set => KeyBindingString = $"{value.KeyCombination}:{(int)value.Action}";
|
||||
}
|
||||
|
||||
public string KeyBindingString { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user