mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Add start time tracking to EditorBeatmap
This commit is contained in:
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
@ -27,10 +28,16 @@ namespace osu.Game.Rulesets.Objects
|
||||
/// </summary>
|
||||
private const double control_point_leniency = 1;
|
||||
|
||||
public readonly Bindable<double> StartTimeBindable = new Bindable<double>();
|
||||
|
||||
/// <summary>
|
||||
/// The time at which the HitObject starts.
|
||||
/// </summary>
|
||||
public virtual double StartTime { get; set; }
|
||||
public virtual double StartTime
|
||||
{
|
||||
get => StartTimeBindable.Value;
|
||||
set => StartTimeBindable.Value = value;
|
||||
}
|
||||
|
||||
private List<HitSampleInfo> samples;
|
||||
|
||||
@ -67,6 +74,17 @@ namespace osu.Game.Rulesets.Objects
|
||||
[JsonIgnore]
|
||||
public IReadOnlyList<HitObject> NestedHitObjects => nestedHitObjects;
|
||||
|
||||
public HitObject()
|
||||
{
|
||||
StartTimeBindable.ValueChanged += time =>
|
||||
{
|
||||
double offset = time.NewValue - time.OldValue;
|
||||
|
||||
foreach (var nested in NestedHitObjects)
|
||||
nested.StartTime += offset;
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies default values to this HitObject.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user