This repository has been archived by the owner on Jun 11, 2023. It is now read-only.
forked from ppy/osu
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
356 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Linq; | ||
using osu.Framework.Extensions; | ||
using osu.Framework.Graphics; | ||
using osu.Game.Screens.Mvis.SideBar.Settings.Items; | ||
|
||
namespace Mvis.Plugin.CloudMusicSupport.UI | ||
{ | ||
public class SettingsAnchorPiece : SettingsListPiece<Anchor> | ||
{ | ||
public SettingsAnchorPiece() | ||
{ | ||
var anchorArray = new[] | ||
{ | ||
Anchor.TopLeft, | ||
Anchor.TopCentre, | ||
Anchor.TopRight, | ||
Anchor.CentreLeft, | ||
Anchor.Centre, | ||
Anchor.CentreRight, | ||
Anchor.BottomLeft, | ||
Anchor.BottomCentre, | ||
Anchor.BottomRight, | ||
}; | ||
|
||
Values = anchorArray.ToList(); | ||
} | ||
|
||
protected override string GetValueText(Anchor newValue) => newValue.GetDescription(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using osu.Game.Rulesets.Osu.Objects; | ||
using osuTK; | ||
using static osu.Game.Rulesets.Osu.Replays.Movers.MoverUtilExtensions; | ||
|
||
namespace osu.Game.Rulesets.Osu.Replays.Movers | ||
{ | ||
public class AggressiveMover : DanceMover | ||
{ | ||
private BezierCurve curve; | ||
private float lastAngle; | ||
|
||
public override void OnObjChange() | ||
{ | ||
var scaledDistance = (float)(EndTime - StartTime); | ||
var newAngle = lastAngle + MathF.PI; | ||
|
||
if (Start is Slider start) | ||
newAngle = start.GetEndAngle(); | ||
|
||
var p1 = V2FromRad(newAngle, scaledDistance) + StartPos; | ||
var p2 = Vector2.Zero; | ||
|
||
if (scaledDistance > 1) | ||
lastAngle = p1.AngleRV(EndPos); | ||
|
||
if (End is Slider end) | ||
{ | ||
p2 = V2FromRad(end.GetStartAngle(), scaledDistance) + EndPos; | ||
} | ||
|
||
curve = new BezierCurve(StartPos, p1); | ||
if (p2 != Vector2.Zero) curve.Points.Add(p2); | ||
curve.Points.Add(EndPos); | ||
} | ||
|
||
public override Vector2 Update(double time) => curve.CalculatePoint(T(time)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Objects.Types; | ||
using osuTK; | ||
|
||
namespace osu.Game.Rulesets.Osu.Replays.Movers | ||
{ | ||
public class AxisAlignedMover : DanceMover | ||
{ | ||
private SliderPath path; | ||
|
||
public override void OnObjChange() | ||
{ | ||
var midP = MathF.Abs((EndPos - StartPos).X) < MathF.Abs((EndPos - EndPos).X) | ||
? new Vector2(StartX, EndY) | ||
: new Vector2(EndX, StartY); | ||
|
||
path = new SliderPath(new[] | ||
{ | ||
new PathControlPoint(StartPos, PathType.Linear), | ||
new PathControlPoint(midP), | ||
new PathControlPoint(EndPos) | ||
}); | ||
} | ||
|
||
public override Vector2 Update(double time) => path.PositionAt(T(time)); | ||
} | ||
} |
Oops, something went wrong.