mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 16:47:46 +08:00
Reorder command properties to match general format
I had them shuffled around in the middle of the refactor.
This commit is contained in:
parent
a85be2a46d
commit
c1649b76d6
@ -176,7 +176,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
var sprite = new StoryboardSprite(lookupName, origin, initialPosition);
|
||||
var loop = sprite.AddLoopingGroup(Time.Current, 100);
|
||||
loop.AddAlpha(0, 10000, 1, 1, Easing.None);
|
||||
loop.AddAlpha(Easing.None, 0, 10000, 1, 1);
|
||||
|
||||
layer.Elements.Clear();
|
||||
layer.Add(sprite);
|
||||
|
@ -47,7 +47,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
var sprite = new StoryboardSprite("unknown", Anchor.TopLeft, Vector2.Zero);
|
||||
|
||||
sprite.Commands.AddAlpha(firstStoryboardEvent, firstStoryboardEvent + 500, 0, 1, Easing.None);
|
||||
sprite.Commands.AddAlpha(Easing.None, firstStoryboardEvent, firstStoryboardEvent + 500, 0, 1);
|
||||
|
||||
storyboard.GetLayer("Background").Add(sprite);
|
||||
|
||||
@ -73,17 +73,17 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
var sprite = new StoryboardSprite("unknown", Anchor.TopLeft, Vector2.Zero);
|
||||
|
||||
// these should be ignored as we have an alpha visibility blocker proceeding this command.
|
||||
sprite.Commands.AddScale(loop_start_time, -18000, 0, 1, Easing.None);
|
||||
sprite.Commands.AddScale(Easing.None, loop_start_time, -18000, 0, 1);
|
||||
var loopGroup = sprite.AddLoopingGroup(loop_start_time, 50);
|
||||
loopGroup.AddScale(loop_start_time, -18000, 0, 1, Easing.None);
|
||||
loopGroup.AddScale(Easing.None, loop_start_time, -18000, 0, 1);
|
||||
|
||||
var target = addEventToLoop ? loopGroup : sprite.Commands;
|
||||
double loopRelativeOffset = addEventToLoop ? -loop_start_time : 0;
|
||||
target.AddAlpha(loopRelativeOffset + firstStoryboardEvent, loopRelativeOffset + firstStoryboardEvent + 500, 0, 1, Easing.None);
|
||||
target.AddAlpha(Easing.None, loopRelativeOffset + firstStoryboardEvent, loopRelativeOffset + firstStoryboardEvent + 500, 0, 1);
|
||||
|
||||
// these should be ignored due to being in the future.
|
||||
sprite.Commands.AddAlpha(18000, 20000, 0, 1, Easing.None);
|
||||
loopGroup.AddAlpha(38000, 40000, 0, 1, Easing.None);
|
||||
sprite.Commands.AddAlpha(Easing.None, 18000, 20000, 0, 1);
|
||||
loopGroup.AddAlpha(Easing.None, 38000, 40000, 0, 1);
|
||||
|
||||
storyboard.GetLayer("Background").Add(sprite);
|
||||
|
||||
|
@ -216,7 +216,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
var storyboard = new Storyboard();
|
||||
var sprite = new StoryboardSprite("unknown", Anchor.TopLeft, Vector2.Zero);
|
||||
sprite.Commands.AddAlpha(0, duration, 1, 0, Easing.None);
|
||||
sprite.Commands.AddAlpha(Easing.None, 0, duration, 1, 0);
|
||||
storyboard.GetLayer("Background").Add(sprite);
|
||||
return storyboard;
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
public void TestIntroStoryboardElement() => testLeadIn(b =>
|
||||
{
|
||||
var sprite = new StoryboardSprite("unknown", Anchor.TopLeft, Vector2.Zero);
|
||||
sprite.Commands.AddAlpha(-2000, 0, 0, 1, Easing.None);
|
||||
sprite.Commands.AddAlpha(Easing.None, -2000, 0, 0, 1);
|
||||
b.Storyboard.GetLayer("Background").Add(sprite);
|
||||
});
|
||||
|
||||
|
@ -204,7 +204,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
float startValue = Parsing.ParseFloat(split[4]);
|
||||
float endValue = split.Length > 5 ? Parsing.ParseFloat(split[5]) : startValue;
|
||||
currentCommandsGroup?.AddAlpha(startTime, endTime, startValue, endValue, easing);
|
||||
currentCommandsGroup?.AddAlpha(easing, startTime, endTime, startValue, endValue);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -212,7 +212,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
float startValue = Parsing.ParseFloat(split[4]);
|
||||
float endValue = split.Length > 5 ? Parsing.ParseFloat(split[5]) : startValue;
|
||||
currentCommandsGroup?.AddScale(startTime, endTime, startValue, endValue, easing);
|
||||
currentCommandsGroup?.AddScale(easing, startTime, endTime, startValue, endValue);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -222,7 +222,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
float startY = Parsing.ParseFloat(split[5]);
|
||||
float endX = split.Length > 6 ? Parsing.ParseFloat(split[6]) : startX;
|
||||
float endY = split.Length > 7 ? Parsing.ParseFloat(split[7]) : startY;
|
||||
currentCommandsGroup?.AddVectorScale(startTime, endTime, new Vector2(startX, startY), new Vector2(endX, endY), easing);
|
||||
currentCommandsGroup?.AddVectorScale(easing, startTime, endTime, new Vector2(startX, startY), new Vector2(endX, endY));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
float startValue = Parsing.ParseFloat(split[4]);
|
||||
float endValue = split.Length > 5 ? Parsing.ParseFloat(split[5]) : startValue;
|
||||
currentCommandsGroup?.AddRotation(startTime, endTime, float.RadiansToDegrees(startValue), float.RadiansToDegrees(endValue), easing);
|
||||
currentCommandsGroup?.AddRotation(easing, startTime, endTime, float.RadiansToDegrees(startValue), float.RadiansToDegrees(endValue));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -240,8 +240,8 @@ namespace osu.Game.Beatmaps.Formats
|
||||
float startY = Parsing.ParseFloat(split[5]);
|
||||
float endX = split.Length > 6 ? Parsing.ParseFloat(split[6]) : startX;
|
||||
float endY = split.Length > 7 ? Parsing.ParseFloat(split[7]) : startY;
|
||||
currentCommandsGroup?.AddX(startTime, endTime, startX, endX, easing);
|
||||
currentCommandsGroup?.AddY(startTime, endTime, startY, endY, easing);
|
||||
currentCommandsGroup?.AddX(easing, startTime, endTime, startX, endX);
|
||||
currentCommandsGroup?.AddY(easing, startTime, endTime, startY, endY);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
float startValue = Parsing.ParseFloat(split[4]);
|
||||
float endValue = split.Length > 5 ? Parsing.ParseFloat(split[5]) : startValue;
|
||||
currentCommandsGroup?.AddX(startTime, endTime, startValue, endValue, easing);
|
||||
currentCommandsGroup?.AddX(easing, startTime, endTime, startValue, endValue);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
float startValue = Parsing.ParseFloat(split[4]);
|
||||
float endValue = split.Length > 5 ? Parsing.ParseFloat(split[5]) : startValue;
|
||||
currentCommandsGroup?.AddY(startTime, endTime, startValue, endValue, easing);
|
||||
currentCommandsGroup?.AddY(easing, startTime, endTime, startValue, endValue);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -269,9 +269,9 @@ namespace osu.Game.Beatmaps.Formats
|
||||
float endRed = split.Length > 7 ? Parsing.ParseFloat(split[7]) : startRed;
|
||||
float endGreen = split.Length > 8 ? Parsing.ParseFloat(split[8]) : startGreen;
|
||||
float endBlue = split.Length > 9 ? Parsing.ParseFloat(split[9]) : startBlue;
|
||||
currentCommandsGroup?.AddColour(startTime, endTime,
|
||||
currentCommandsGroup?.AddColour(easing, startTime, endTime,
|
||||
new Color4(startRed / 255f, startGreen / 255f, startBlue / 255f, 1),
|
||||
new Color4(endRed / 255f, endGreen / 255f, endBlue / 255f, 1), easing);
|
||||
new Color4(endRed / 255f, endGreen / 255f, endBlue / 255f, 1));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -282,16 +282,16 @@ namespace osu.Game.Beatmaps.Formats
|
||||
switch (type)
|
||||
{
|
||||
case "A":
|
||||
currentCommandsGroup?.AddBlendingParameters(startTime, endTime, BlendingParameters.Additive,
|
||||
startTime == endTime ? BlendingParameters.Additive : BlendingParameters.Inherit, easing);
|
||||
currentCommandsGroup?.AddBlendingParameters(easing, startTime, endTime, BlendingParameters.Additive,
|
||||
startTime == endTime ? BlendingParameters.Additive : BlendingParameters.Inherit);
|
||||
break;
|
||||
|
||||
case "H":
|
||||
currentCommandsGroup?.AddFlipH(startTime, endTime, true, startTime == endTime, easing);
|
||||
currentCommandsGroup?.AddFlipH(easing, startTime, endTime, true, startTime == endTime);
|
||||
break;
|
||||
|
||||
case "V":
|
||||
currentCommandsGroup?.AddFlipV(startTime, endTime, true, startTime == endTime, easing);
|
||||
currentCommandsGroup?.AddFlipV(easing, startTime, endTime, true, startTime == endTime);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ namespace osu.Game.Storyboards.Commands
|
||||
{
|
||||
public class StoryboardAlphaCommand : StoryboardCommand<float>
|
||||
{
|
||||
public StoryboardAlphaCommand(double startTime, double endTime, float startValue, float endValue, Easing easing)
|
||||
: base(startTime, endTime, startValue, endValue, easing)
|
||||
public StoryboardAlphaCommand(Easing easing, double startTime, double endTime, float startValue, float endValue)
|
||||
: base(easing, startTime, endTime, startValue, endValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ namespace osu.Game.Storyboards.Commands
|
||||
{
|
||||
public class StoryboardBlendingParametersCommand : StoryboardCommand<BlendingParameters>
|
||||
{
|
||||
public StoryboardBlendingParametersCommand(double startTime, double endTime, BlendingParameters startValue, BlendingParameters endValue, Easing easing)
|
||||
: base(startTime, endTime, startValue, endValue, easing)
|
||||
public StoryboardBlendingParametersCommand(Easing easing, double startTime, double endTime, BlendingParameters startValue, BlendingParameters endValue)
|
||||
: base(easing, startTime, endTime, startValue, endValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,8 @@ namespace osu.Game.Storyboards.Commands
|
||||
{
|
||||
public class StoryboardColourCommand : StoryboardCommand<Color4>
|
||||
{
|
||||
public StoryboardColourCommand(double startTime, double endTime, Color4 startValue, Color4 endValue, Easing easing)
|
||||
: base(startTime, endTime, startValue, endValue, easing)
|
||||
public StoryboardColourCommand(Easing easing, double startTime, double endTime, Color4 startValue, Color4 endValue)
|
||||
: base(easing, startTime, endTime, startValue, endValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Storyboards.Commands
|
||||
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
protected StoryboardCommand(double startTime, double endTime, T startValue, T endValue, Easing easing)
|
||||
protected StoryboardCommand(Easing easing, double startTime, double endTime, T startValue, T endValue)
|
||||
{
|
||||
if (endTime < startTime)
|
||||
endTime = startTime;
|
||||
|
@ -45,35 +45,35 @@ namespace osu.Game.Storyboards.Commands
|
||||
[JsonIgnore]
|
||||
public bool HasCommands { get; private set; }
|
||||
|
||||
public void AddX(double startTime, double endTime, float startValue, float endValue, Easing easing)
|
||||
=> AddCommand(X, new StoryboardXCommand(startTime, endTime, startValue, endValue, easing));
|
||||
public void AddX(Easing easing, double startTime, double endTime, float startValue, float endValue)
|
||||
=> AddCommand(X, new StoryboardXCommand(easing, startTime, endTime, startValue, endValue));
|
||||
|
||||
public void AddY(double startTime, double endTime, float startValue, float endValue, Easing easing)
|
||||
=> AddCommand(Y, new StoryboardYCommand(startTime, endTime, startValue, endValue, easing));
|
||||
public void AddY(Easing easing, double startTime, double endTime, float startValue, float endValue)
|
||||
=> AddCommand(Y, new StoryboardYCommand(easing, startTime, endTime, startValue, endValue));
|
||||
|
||||
public void AddScale(double startTime, double endTime, float startValue, float endValue, Easing easing)
|
||||
=> AddCommand(Scale, new StoryboardScaleCommand(startTime, endTime, startValue, endValue, easing));
|
||||
public void AddScale(Easing easing, double startTime, double endTime, float startValue, float endValue)
|
||||
=> AddCommand(Scale, new StoryboardScaleCommand(easing, startTime, endTime, startValue, endValue));
|
||||
|
||||
public void AddVectorScale(double startTime, double endTime, Vector2 startValue, Vector2 endValue, Easing easing)
|
||||
=> AddCommand(VectorScale, new StoryboardVectorScaleCommand(startTime, endTime, startValue, endValue, easing));
|
||||
public void AddVectorScale(Easing easing, double startTime, double endTime, Vector2 startValue, Vector2 endValue)
|
||||
=> AddCommand(VectorScale, new StoryboardVectorScaleCommand(easing, startTime, endTime, startValue, endValue));
|
||||
|
||||
public void AddRotation(double startTime, double endTime, float startValue, float endValue, Easing easing)
|
||||
=> AddCommand(Rotation, new StoryboardRotationCommand(startTime, endTime, startValue, endValue, easing));
|
||||
public void AddRotation(Easing easing, double startTime, double endTime, float startValue, float endValue)
|
||||
=> AddCommand(Rotation, new StoryboardRotationCommand(easing, startTime, endTime, startValue, endValue));
|
||||
|
||||
public void AddColour(double startTime, double endTime, Color4 startValue, Color4 endValue, Easing easing)
|
||||
=> AddCommand(Colour, new StoryboardColourCommand(startTime, endTime, startValue, endValue, easing));
|
||||
public void AddColour(Easing easing, double startTime, double endTime, Color4 startValue, Color4 endValue)
|
||||
=> AddCommand(Colour, new StoryboardColourCommand(easing, startTime, endTime, startValue, endValue));
|
||||
|
||||
public void AddAlpha(double startTime, double endTime, float startValue, float endValue, Easing easing)
|
||||
=> AddCommand(Alpha, new StoryboardAlphaCommand(startTime, endTime, startValue, endValue, easing));
|
||||
public void AddAlpha(Easing easing, double startTime, double endTime, float startValue, float endValue)
|
||||
=> AddCommand(Alpha, new StoryboardAlphaCommand(easing, startTime, endTime, startValue, endValue));
|
||||
|
||||
public void AddBlendingParameters(double startTime, double endTime, BlendingParameters startValue, BlendingParameters endValue, Easing easing)
|
||||
=> AddCommand(BlendingParameters, new StoryboardBlendingParametersCommand(startTime, endTime, startValue, endValue, easing));
|
||||
public void AddBlendingParameters(Easing easing, double startTime, double endTime, BlendingParameters startValue, BlendingParameters endValue)
|
||||
=> AddCommand(BlendingParameters, new StoryboardBlendingParametersCommand(easing, startTime, endTime, startValue, endValue));
|
||||
|
||||
public void AddFlipH(double startTime, double endTime, bool startValue, bool endValue, Easing easing)
|
||||
=> AddCommand(FlipH, new StoryboardFlipHCommand(startTime, endTime, startValue, endValue, easing));
|
||||
public void AddFlipH(Easing easing, double startTime, double endTime, bool startValue, bool endValue)
|
||||
=> AddCommand(FlipH, new StoryboardFlipHCommand(easing, startTime, endTime, startValue, endValue));
|
||||
|
||||
public void AddFlipV(double startTime, double endTime, bool startValue, bool endValue, Easing easing)
|
||||
=> AddCommand(FlipV, new StoryboardFlipVCommand(startTime, endTime, startValue, endValue, easing));
|
||||
public void AddFlipV(Easing easing, double startTime, double endTime, bool startValue, bool endValue)
|
||||
=> AddCommand(FlipV, new StoryboardFlipVCommand(easing, startTime, endTime, startValue, endValue));
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given storyboard <paramref name="command"/> to the target <paramref name="list"/>.
|
||||
|
@ -9,8 +9,8 @@ namespace osu.Game.Storyboards.Commands
|
||||
{
|
||||
public class StoryboardFlipHCommand : StoryboardCommand<bool>
|
||||
{
|
||||
public StoryboardFlipHCommand(double startTime, double endTime, bool startValue, bool endValue, Easing easing)
|
||||
: base(startTime, endTime, startValue, endValue, easing)
|
||||
public StoryboardFlipHCommand(Easing easing, double startTime, double endTime, bool startValue, bool endValue)
|
||||
: base(easing, startTime, endTime, startValue, endValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,8 @@ namespace osu.Game.Storyboards.Commands
|
||||
{
|
||||
public class StoryboardFlipVCommand : StoryboardCommand<bool>
|
||||
{
|
||||
public StoryboardFlipVCommand(double startTime, double endTime, bool startValue, bool endValue, Easing easing)
|
||||
: base(startTime, endTime, startValue, endValue, easing)
|
||||
public StoryboardFlipVCommand(Easing easing, double startTime, double endTime, bool startValue, bool endValue)
|
||||
: base(easing, startTime, endTime, startValue, endValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Storyboards.Commands
|
||||
// In an ideal world, we would multiply the command duration by TotalIterations in command end time.
|
||||
// Unfortunately this would clash with how stable handled end times, and results in some storyboards playing outro
|
||||
// sequences for minutes or hours.
|
||||
: base(loopingGroup.loopStartTime + command.StartTime, loopingGroup.loopStartTime + command.EndTime, command.StartValue, command.EndValue, command.Easing)
|
||||
: base(command.Easing, loopingGroup.loopStartTime + command.StartTime, loopingGroup.loopStartTime + command.EndTime, command.StartValue, command.EndValue)
|
||||
{
|
||||
this.command = command;
|
||||
this.loopingGroup = loopingGroup;
|
||||
|
@ -8,8 +8,8 @@ namespace osu.Game.Storyboards.Commands
|
||||
{
|
||||
public class StoryboardRotationCommand : StoryboardCommand<float>
|
||||
{
|
||||
public StoryboardRotationCommand(double startTime, double endTime, float startValue, float endValue, Easing easing)
|
||||
: base(startTime, endTime, startValue, endValue, easing)
|
||||
public StoryboardRotationCommand(Easing easing, double startTime, double endTime, float startValue, float endValue)
|
||||
: base(easing, startTime, endTime, startValue, endValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,8 @@ namespace osu.Game.Storyboards.Commands
|
||||
{
|
||||
public class StoryboardScaleCommand : StoryboardCommand<float>
|
||||
{
|
||||
public StoryboardScaleCommand(double startTime, double endTime, float startValue, float endValue, Easing easing)
|
||||
: base(startTime, endTime, startValue, endValue, easing)
|
||||
public StoryboardScaleCommand(Easing easing, double startTime, double endTime, float startValue, float endValue)
|
||||
: base(easing, startTime, endTime, startValue, endValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,8 @@ namespace osu.Game.Storyboards.Commands
|
||||
{
|
||||
public class StoryboardVectorScaleCommand : StoryboardCommand<Vector2>
|
||||
{
|
||||
public StoryboardVectorScaleCommand(double startTime, double endTime, Vector2 startValue, Vector2 endValue, Easing easing)
|
||||
: base(startTime, endTime, startValue, endValue, easing)
|
||||
public StoryboardVectorScaleCommand(Easing easing, double startTime, double endTime, Vector2 startValue, Vector2 endValue)
|
||||
: base(easing, startTime, endTime, startValue, endValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ namespace osu.Game.Storyboards.Commands
|
||||
{
|
||||
public class StoryboardXCommand : StoryboardCommand<float>
|
||||
{
|
||||
public StoryboardXCommand(double startTime, double endTime, float startValue, float endValue, Easing easing)
|
||||
: base(startTime, endTime, startValue, endValue, easing)
|
||||
public StoryboardXCommand(Easing easing, double startTime, double endTime, float startValue, float endValue)
|
||||
: base(easing, startTime, endTime, startValue, endValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ namespace osu.Game.Storyboards.Commands
|
||||
{
|
||||
public class StoryboardYCommand : StoryboardCommand<float>
|
||||
{
|
||||
public StoryboardYCommand(double startTime, double endTime, float startValue, float endValue, Easing easing)
|
||||
: base(startTime, endTime, startValue, endValue, easing)
|
||||
public StoryboardYCommand(Easing easing, double startTime, double endTime, float startValue, float endValue)
|
||||
: base(easing, startTime, endTime, startValue, endValue)
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user