Lock spinners to centre of screen

This commit is contained in:
smoogipoo 2018-11-01 19:24:58 +09:00
parent 1265d5ac0b
commit 2ac4f2b6af
1 changed files with 2 additions and 16 deletions

View File

@ -6,6 +6,7 @@
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Osu.Edit.Masks.SpinnerMasks.Components;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.UI;
namespace osu.Game.Rulesets.Osu.Edit.Masks.SpinnerMasks
{
@ -18,19 +19,11 @@ public class SpinnerPlacementMask : PlacementMask
private bool isPlacingEnd;
public SpinnerPlacementMask()
: base(new Spinner())
: base(new Spinner { Position = OsuPlayfield.BASE_SIZE / 2 })
{
InternalChild = piece = new SpinnerPiece(HitObject) { Alpha = 0.5f };
}
protected override void LoadComplete()
{
base.LoadComplete();
// Fixes a 1-frame position discrpancy due to the first mouse move event happening in the next frame
HitObject.Position = GetContainingInputManager().CurrentState.Mouse.Position;
}
protected override bool OnClick(ClickEvent e)
{
if (isPlacingEnd)
@ -48,12 +41,5 @@ protected override bool OnClick(ClickEvent e)
return true;
}
protected override bool OnMouseMove(MouseMoveEvent e)
{
if (!isPlacingEnd)
HitObject.Position = e.MousePosition;
return true;
}
}
}