1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +08:00

formatting

This commit is contained in:
unknown 2019-05-11 10:03:59 +02:00
parent 5761cc673f
commit a842d727c7

View File

@ -13,17 +13,21 @@ using osu.Game.Rulesets.UI;
using osuTK; using osuTK;
using System; using System;
namespace osu.Game.Rulesets.Catch.Mods { namespace osu.Game.Rulesets.Catch.Mods
public class CatchModRelax : ModRelax, IApplicableToDrawableRuleset<CatchHitObject> { {
public class CatchModRelax : ModRelax, IApplicableToDrawableRuleset<CatchHitObject>
{
public override string Description => @"Use the mouse to control the catcher."; public override string Description => @"Use the mouse to control the catcher.";
public void ApplyToDrawableRuleset(DrawableRuleset<CatchHitObject> drawableRuleset) => public void ApplyToDrawableRuleset(DrawableRuleset<CatchHitObject> drawableRuleset) =>
(drawableRuleset.Playfield.Parent as Container).Add(new CatchModRelaxHelper(drawableRuleset.Playfield as CatchPlayfield)); (drawableRuleset.Playfield.Parent as Container).Add(new CatchModRelaxHelper(drawableRuleset.Playfield as CatchPlayfield));
private class CatchModRelaxHelper : Drawable, IKeyBindingHandler<CatchAction>, IRequireHighFrequencyMousePosition { private class CatchModRelaxHelper : Drawable, IKeyBindingHandler<CatchAction>, IRequireHighFrequencyMousePosition
{
private CatcherArea.Catcher catcher; private CatcherArea.Catcher catcher;
public CatchModRelaxHelper(CatchPlayfield catchPlayfield) { public CatchModRelaxHelper(CatchPlayfield catchPlayfield)
{
catcher = catchPlayfield.CatcherArea.MovableCatcher; catcher = catchPlayfield.CatcherArea.MovableCatcher;
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
} }
@ -32,7 +36,8 @@ namespace osu.Game.Rulesets.Catch.Mods {
public bool OnPressed(CatchAction action) => true; public bool OnPressed(CatchAction action) => true;
public bool OnReleased(CatchAction action) => true; public bool OnReleased(CatchAction action) => true;
protected override bool OnMouseMove(MouseMoveEvent e) { protected override bool OnMouseMove(MouseMoveEvent e)
{
//lock catcher to mouse position horizontally //lock catcher to mouse position horizontally
catcher.X = e.MousePosition.X / DrawSize.X; catcher.X = e.MousePosition.X / DrawSize.X;