From b56d09c83b918a8c209d08802cd550f1078f6bdb Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 10 Oct 2018 15:32:55 +0900 Subject: [PATCH] Set hitobject placement time manually --- .../Edit/Masks/HitCirclePlacementMask.cs | 1 + osu.Game/Rulesets/Edit/PlacementMask.cs | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Masks/HitCirclePlacementMask.cs b/osu.Game.Rulesets.Osu/Edit/Masks/HitCirclePlacementMask.cs index 9082f40445..0b248e20fe 100644 --- a/osu.Game.Rulesets.Osu/Edit/Masks/HitCirclePlacementMask.cs +++ b/osu.Game.Rulesets.Osu/Edit/Masks/HitCirclePlacementMask.cs @@ -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; diff --git a/osu.Game/Rulesets/Edit/PlacementMask.cs b/osu.Game/Rulesets/Edit/PlacementMask.cs index 3cee09a8ee..fd1b670274 100644 --- a/osu.Game/Rulesets/Edit/PlacementMask.cs +++ b/osu.Game/Rulesets/Edit/PlacementMask.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Edit /// 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 /// 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)