Propagate framework updates

This commit is contained in:
Dean Herbert 2017-08-12 19:54:07 +09:00
parent 48d4ed55e9
commit 99458aab48
8 changed files with 29 additions and 29 deletions

View File

@ -11,18 +11,18 @@ namespace osu.Game.Rulesets.Catch
{ {
public class CatchInputManager : DatabasedKeyBindingInputManager<CatchAction> public class CatchInputManager : DatabasedKeyBindingInputManager<CatchAction>
{ {
public CatchInputManager(RulesetInfo ruleset) : base(ruleset, concurrencyMode: ConcurrentActionMode.UniqueActions) public CatchInputManager(RulesetInfo ruleset) : base(ruleset, simultaneousMode: SimultaneousBindingMode.Unique)
{ {
} }
protected override IDictionary<KeyCombination, CatchAction> CreateDefaultMappings() => new Dictionary<KeyCombination, CatchAction> protected override IEnumerable<KeyBinding> CreateDefaultMappings() => new[]
{ {
{ Key.Z, CatchAction.MoveLeft }, new KeyBinding( Key.Z, CatchAction.MoveLeft),
{ Key.Left, CatchAction.MoveLeft }, new KeyBinding( Key.Left, CatchAction.MoveLeft),
{ Key.X, CatchAction.MoveRight }, new KeyBinding( Key.X, CatchAction.MoveRight),
{ Key.Right, CatchAction.MoveRight }, new KeyBinding( Key.Right, CatchAction.MoveRight),
{ Key.LShift, CatchAction.Dash }, new KeyBinding( Key.LShift, CatchAction.Dash),
{ Key.RShift, CatchAction.Dash }, new KeyBinding( Key.RShift, CatchAction.Dash),
}; };
} }

View File

@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Catch.UI
catcher.Size = new Vector2(DrawSize.Y); catcher.Size = new Vector2(DrawSize.Y);
} }
private class Catcher : Container, IHandleKeyBindings<CatchAction> private class Catcher : Container, IKeyBindingHandler<CatchAction>
{ {
private Texture texture; private Texture texture;

View File

@ -12,7 +12,7 @@ using OpenTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
public class CirclePiece : Container, IHandleKeyBindings<OsuAction> public class CirclePiece : Container, IKeyBindingHandler<OsuAction>
{ {
private readonly Sprite disc; private readonly Sprite disc;

View File

@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Osu
{ {
public class OsuInputManager : DatabasedKeyBindingInputManager<OsuAction> public class OsuInputManager : DatabasedKeyBindingInputManager<OsuAction>
{ {
public OsuInputManager(RulesetInfo ruleset) : base(ruleset, concurrencyMode: ConcurrentActionMode.UniqueActions) public OsuInputManager(RulesetInfo ruleset) : base(ruleset, simultaneousMode: SimultaneousBindingMode.Unique)
{ {
} }
@ -34,12 +34,12 @@ namespace osu.Game.Rulesets.Osu
} }
} }
protected override IDictionary<KeyCombination, OsuAction> CreateDefaultMappings() => new Dictionary<KeyCombination, OsuAction> protected override IEnumerable<KeyBinding> CreateDefaultMappings() => new[]
{ {
{ Key.Z, OsuAction.LeftButton }, new KeyBinding(Key.Z, OsuAction.LeftButton),
{ Key.X, OsuAction.RightButton }, new KeyBinding(Key.X, OsuAction.RightButton),
{ Key.LastKey + 1, OsuAction.LeftButton }, new KeyBinding(Key.LastKey + 1, OsuAction.LeftButton),
{ Key.LastKey + 2, OsuAction.RightButton }, new KeyBinding(Key.LastKey + 2, OsuAction.RightButton),
}; };
} }

View File

@ -16,7 +16,7 @@ using OpenTK.Graphics;
namespace osu.Game.Rulesets.Osu.UI.Cursor namespace osu.Game.Rulesets.Osu.UI.Cursor
{ {
public class GameplayCursor : CursorContainer, IHandleKeyBindings<OsuAction> public class GameplayCursor : CursorContainer, IKeyBindingHandler<OsuAction>
{ {
protected override Drawable CreateCursor() => new OsuCursor(); protected override Drawable CreateCursor() => new OsuCursor();

View File

@ -22,9 +22,9 @@ namespace osu.Game.Input.Bindings
/// </summary> /// </summary>
/// <param name="ruleset">A reference to identify the current <see cref="Ruleset"/>. Used to lookup mappings. Null for global mappings.</param> /// <param name="ruleset">A reference to identify the current <see cref="Ruleset"/>. Used to lookup mappings. Null for global mappings.</param>
/// <param name="variant">An optional variant for the specified <see cref="Ruleset"/>. Used when a ruleset has more than one possible keyboard layouts.</param> /// <param name="variant">An optional variant for the specified <see cref="Ruleset"/>. Used when a ruleset has more than one possible keyboard layouts.</param>
/// <param name="concurrencyMode">Specify how to deal with multiple matches of <see cref="KeyCombination"/>s and <see cref="T"/>s.</param> /// <param name="simultaneousMode">Specify how to deal with multiple matches of <see cref="KeyCombination"/>s and <see cref="T"/>s.</param>
protected DatabasedKeyBindingInputManager(RulesetInfo ruleset = null, int? variant = null, ConcurrentActionMode concurrencyMode = ConcurrentActionMode.None) protected DatabasedKeyBindingInputManager(RulesetInfo ruleset = null, int? variant = null, SimultaneousBindingMode simultaneousMode = SimultaneousBindingMode.None)
: base(concurrencyMode) : base(simultaneousMode)
{ {
this.ruleset = ruleset; this.ruleset = ruleset;
this.variant = variant; this.variant = variant;

View File

@ -17,18 +17,18 @@ namespace osu.Game.Input.Bindings
public GlobalBindingInputManager(OsuGameBase game) public GlobalBindingInputManager(OsuGameBase game)
{ {
if (game is IHandleKeyBindings<GlobalAction>) if (game is IKeyBindingHandler<GlobalAction>)
handler = game; handler = game;
} }
protected override IDictionary<KeyCombination, GlobalAction> CreateDefaultMappings() => new Dictionary<KeyCombination, GlobalAction> protected override IEnumerable<KeyBinding> CreateDefaultMappings() => new[]
{ {
{ Key.F8, GlobalAction.ToggleChat }, new KeyBinding(Key.F8, GlobalAction.ToggleChat),
{ Key.F9, GlobalAction.ToggleSocial }, new KeyBinding(Key.F9, GlobalAction.ToggleSocial),
{ new[] { Key.LControl, Key.LAlt, Key.R }, GlobalAction.ResetInputSettings }, new KeyBinding(new[] { Key.LControl, Key.LAlt, Key.R }, GlobalAction.ResetInputSettings),
{ new[] { Key.LControl, Key.T }, GlobalAction.ToggleToolbar }, new KeyBinding(new[] { Key.LControl, Key.T }, GlobalAction.ToggleToolbar),
{ new[] { Key.LControl, Key.O }, GlobalAction.ToggleSettings }, new KeyBinding(new[] { Key.LControl, Key.O }, GlobalAction.ToggleSettings),
{ new[] { Key.LControl, Key.D }, GlobalAction.ToggleDirect }, new KeyBinding(new[] { Key.LControl, Key.D }, GlobalAction.ToggleDirect),
}; };
protected override bool PropagateKeyDown(IEnumerable<Drawable> drawables, InputState state, KeyDownEventArgs args) protected override bool PropagateKeyDown(IEnumerable<Drawable> drawables, InputState state, KeyDownEventArgs args)

View File

@ -30,7 +30,7 @@ using osu.Game.Input.Bindings;
namespace osu.Game namespace osu.Game
{ {
public class OsuGame : OsuGameBase, IHandleKeyBindings<GlobalAction> public class OsuGame : OsuGameBase, IKeyBindingHandler<GlobalAction>
{ {
public Toolbar Toolbar; public Toolbar Toolbar;