1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 06:52:55 +08:00

Move positional modifications to HitCirclePlacementMask

This commit is contained in:
smoogipoo 2018-10-04 13:43:50 +09:00
parent 6a65802528
commit e931aa3d9e
3 changed files with 16 additions and 17 deletions

View File

@ -21,16 +21,25 @@ namespace osu.Game.Rulesets.Osu.Edit.Masks
InternalChild = new HitCircleMask(HitObject);
}
protected override void LoadComplete()
{
base.LoadComplete();
// Fixes a 1-frame position discrpancy due to the first mouse move event happening in the next frame
Position = GetContainingInputManager().CurrentState.Mouse.Position;
}
protected override bool OnClick(ClickEvent e)
{
HitObject.Position = e.MousePosition;
Finish();
return true;
}
protected override bool OnMouseMove(MouseMoveEvent e)
{
HitObject.Position = e.MousePosition;
return base.OnMouseMove(e);
Position = e.MousePosition;
return true;
}
}
}

View File

@ -13,6 +13,7 @@ using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Edit;
using osu.Game.Rulesets.Osu.Edit.Masks;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Screens.Edit.Screens.Compose.Layers;
using osu.Game.Tests.Beatmaps;
@ -29,7 +30,10 @@ namespace osu.Game.Tests.Visual
typeof(HitObjectComposer),
typeof(OsuHitObjectComposer),
typeof(HitObjectMaskLayer),
typeof(NotNullAttribute)
typeof(NotNullAttribute),
typeof(HitCircleMask),
typeof(HitCircleSelectionMask),
typeof(HitCirclePlacementMask),
};
[BackgroundDependencyLoader]

View File

@ -40,14 +40,6 @@ namespace osu.Game.Rulesets.Edit
HitObject.ApplyDefaults(workingBeatmap.Value.Beatmap.ControlPointInfo, workingBeatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty);
}
protected override void LoadComplete()
{
base.LoadComplete();
// Fixes a 1-frame position discrpancy due to the first mouse move event happening in the next frame
Position = GetContainingInputManager().CurrentState.Mouse.Position;
}
/// <summary>
/// Finishes the placement of <see cref="HitObject"/>.
/// </summary>
@ -75,12 +67,6 @@ namespace osu.Game.Rulesets.Edit
}
}
protected override bool OnMouseMove(MouseMoveEvent e)
{
Position = e.MousePosition;
return true;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);