1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 00:53:22 +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) protected override bool OnClick(ClickEvent e)
{ {
HitObject.StartTime = EditorClock.CurrentTime;
HitObject.Position = e.MousePosition; HitObject.Position = e.MousePosition;
Finish(); Finish();
return true; return true;

View File

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