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

Set hitobject placement time manually

This commit is contained in:
smoogipoo 2018-10-10 15:32:55 +09:00
parent e931aa3d9e
commit b56d09c83b
2 changed files with 3 additions and 9 deletions

View File

@ -31,6 +31,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Masks
protected override bool OnClick(ClickEvent e)
{
HitObject.StartTime = EditorClock.CurrentTime;
HitObject.Position = e.MousePosition;
Finish();
return true;

View File

@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Edit
/// </summary>
protected readonly HitObject HitObject;
private IAdjustableClock clock;
protected IClock EditorClock { get; private set; }
public PlacementMask(HitObject hitObject)
{
@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Edit
[BackgroundDependencyLoader]
private void load(IBindableBeatmap workingBeatmap, IAdjustableClock clock)
{
this.clock = clock;
EditorClock = clock;
HitObject.ApplyDefaults(workingBeatmap.Value.Beatmap.ControlPointInfo, workingBeatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty);
}
@ -45,13 +45,6 @@ namespace osu.Game.Rulesets.Edit
/// </summary>
public void Finish() => PlacementFinished?.Invoke(HitObject);
protected override void Update()
{
base.Update();
HitObject.StartTime = clock.CurrentTime;
}
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Parent?.ReceivePositionalInputAt(screenSpacePos) ?? false;
protected override bool Handle(UIEvent e)