Fix KeyCounter M1 M2 display.

This commit is contained in:
Dean Herbert
2017-03-14 12:31:09 +09:00
parent 1eacafc7b4
commit 0da950beac

View File

@ -10,11 +10,25 @@ namespace osu.Game.Screens.Play
public class KeyCounterMouse : KeyCounter public class KeyCounterMouse : KeyCounter
{ {
public MouseButton Button { get; } public MouseButton Button { get; }
public KeyCounterMouse(MouseButton button) : base(button.ToString())
public KeyCounterMouse(MouseButton button) : base(getStringRepresentation(button))
{ {
Button = button; Button = button;
} }
private static string getStringRepresentation(MouseButton button)
{
switch (button)
{
default:
return button.ToString();
case MouseButton.Left:
return @"M1";
case MouseButton.Right:
return @"M2";
}
}
public override bool Contains(Vector2 screenSpacePos) => true; public override bool Contains(Vector2 screenSpacePos) => true;
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)