mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:33:21 +08:00
Make TimeSpan a double again.
This commit is contained in:
parent
a07f6801da
commit
7aee8ee547
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Mania.Timing.Drawables
|
||||
return;
|
||||
|
||||
// This is very naive and can be improved, but is adequate for now
|
||||
LifetimeStart = TimingChange.Time - parent.TimeSpan.Y;
|
||||
LifetimeStart = TimingChange.Time - parent.TimeSpan;
|
||||
LifetimeEnd = TimingChange.Time + Content.RelativeChildSize.Y * 2;
|
||||
}
|
||||
}
|
||||
|
@ -185,10 +185,10 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
}
|
||||
}
|
||||
|
||||
public float TimeSpan
|
||||
public double TimeSpan
|
||||
{
|
||||
get { return timingChanges.TimeSpan.Y; }
|
||||
set { timingChanges.TimeSpan = new Vector2(1, value); }
|
||||
get { return timingChanges.TimeSpan; }
|
||||
set { timingChanges.TimeSpan = value; }
|
||||
}
|
||||
|
||||
public void Add(DrawableTimingChange timingChange) => timingChanges.Add(timingChange);
|
||||
|
@ -30,10 +30,10 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
{
|
||||
public const float HIT_TARGET_POSITION = 50;
|
||||
|
||||
private const float time_span_default = 1500;
|
||||
public const float TIME_SPAN_MIN = 50;
|
||||
public const float TIME_SPAN_MAX = 10000;
|
||||
private const float time_span_step = 50;
|
||||
private const double time_span_default = 1500;
|
||||
public const double TIME_SPAN_MIN = 50;
|
||||
public const double TIME_SPAN_MAX = 10000;
|
||||
private const double time_span_step = 50;
|
||||
|
||||
/// <summary>
|
||||
/// Default column keys, expanding outwards from the middle as more column are added.
|
||||
@ -230,11 +230,11 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
return false;
|
||||
}
|
||||
|
||||
private float timeSpan;
|
||||
private double timeSpan;
|
||||
/// <summary>
|
||||
/// The amount of time which the length of the playfield spans.
|
||||
/// </summary>
|
||||
public float TimeSpan
|
||||
public double TimeSpan
|
||||
{
|
||||
get { return timeSpan; }
|
||||
set
|
||||
@ -245,7 +245,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
timeSpan = MathHelper.Clamp(timeSpan, TIME_SPAN_MIN, TIME_SPAN_MAX);
|
||||
|
||||
barLineContainer.TimeSpan = new Vector2(1, value);
|
||||
barLineContainer.TimeSpan = value;
|
||||
Columns.ForEach(c => c.TimeSpan = value);
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Timing.Drawables
|
||||
float speedAdjustedSize = (float)(1000 / TimingChange.BeatLength / TimingChange.SpeedMultiplier);
|
||||
|
||||
Size = new Vector2((scrollingAxes & Axes.X) > 0 ? speedAdjustedSize : 1, (scrollingAxes & Axes.Y) > 0 ? speedAdjustedSize : 1);
|
||||
RelativeChildSize = new Vector2((scrollingAxes & Axes.X) > 0 ? parent.TimeSpan.X : 1, (scrollingAxes & Axes.Y) > 0 ? parent.TimeSpan.Y : 1);
|
||||
RelativeChildSize = new Vector2((scrollingAxes & Axes.X) > 0 ? (float)parent.TimeSpan : 1, (scrollingAxes & Axes.Y) > 0 ? (float)parent.TimeSpan : 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -14,6 +14,6 @@ namespace osu.Game.Rulesets.Timing
|
||||
/// <summary>
|
||||
/// The amount of time which this container spans.
|
||||
/// </summary>
|
||||
Vector2 TimeSpan { get; }
|
||||
double TimeSpan { get; }
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Timing
|
||||
{
|
||||
public class TimingChangeContainer : Container<DrawableTimingChange>, IHasTimeSpan
|
||||
{
|
||||
public Vector2 TimeSpan { get; set; }
|
||||
public double TimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Adds a hit object to the most applicable timing change in this container.
|
||||
|
Loading…
Reference in New Issue
Block a user