-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
1 parent
2247a65
commit 8265d02
Showing
7 changed files
with
171 additions
and
7 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
osu.Game.Rulesets.Sentakki/Edit/Blueprints/Holds/HoldSelectionBlueprint.cs
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
45 changes: 45 additions & 0 deletions
45
osu.Game.Rulesets.Sentakki/Edit/Blueprints/Slides/SlideBodyHighlight.cs
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,45 @@ | ||
using Microsoft.EntityFrameworkCore.Internal; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Graphics.Lines; | ||
using osu.Framework.Graphics.Primitives; | ||
using osu.Game.Rulesets.Sentakki.UI; | ||
using osuTK; | ||
using osuTK.Graphics; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Edit.Blueprints.Slides | ||
{ | ||
public class SlideBodyHighlight : CompositeDrawable | ||
{ | ||
public readonly SlideEditPath Path; | ||
|
||
// This drawable is zero width | ||
// We should use the quad of the note container | ||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Path.ReceivePositionalInputAt(screenSpacePos); | ||
public override Quad ScreenSpaceDrawQuad => Path.ScreenSpaceDrawQuad.AABBFloat; | ||
|
||
public SlideBodyHighlight() | ||
{ | ||
Anchor = Origin = Anchor.Centre; | ||
Colour = Color4.YellowGreen; | ||
Alpha = 0.5f; | ||
InternalChildren = new Drawable[] | ||
{ | ||
Path = new SlideEditPath() | ||
}; | ||
} | ||
|
||
public class SlideEditPath : SmoothPath | ||
{ | ||
public override Vector2 OriginPosition => Vertices.Any() ? PositionInBoundingBox(Vertices[0]) : base.OriginPosition; | ||
|
||
public SlideEditPath() | ||
{ | ||
PathRadius = 25; | ||
Position = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, 0); | ||
} | ||
|
||
protected override Color4 ColourAt(float position) => position <= .2f ? Color4.White : Color4.Transparent; | ||
} | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
osu.Game.Rulesets.Sentakki/Edit/Blueprints/Slides/SlideSelectionBlueprint.cs
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,70 @@ | ||
using System; | ||
using System.Linq; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Primitives; | ||
using osu.Game.Rulesets.Sentakki.Objects.Drawables; | ||
using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces; | ||
using osu.Game.Rulesets.Sentakki.UI; | ||
using osuTK; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Edit.Blueprints.Slides | ||
{ | ||
public class SlideSelectionBlueprint : SentakkiSelectionBlueprint | ||
{ | ||
public new DrawableSlide DrawableObject => (DrawableSlide)base.DrawableObject; | ||
|
||
private readonly SlideStarHighlight starHighlight; | ||
private readonly SlideBodyHighlight bodyHighlight; | ||
|
||
|
||
public SlideSelectionBlueprint(DrawableSlide drawableSlide) | ||
: base(drawableSlide) | ||
{ | ||
InternalChildren = new Drawable[]{ | ||
bodyHighlight = new SlideBodyHighlight(), | ||
starHighlight = new SlideStarHighlight() | ||
}; | ||
} | ||
|
||
protected override void Update() | ||
{ | ||
base.Update(); | ||
|
||
var SlideTap = DrawableObject.SlideTaps.Child; | ||
|
||
var FirstSlideBody = DrawableObject.SlideBodies.FirstOrDefault(); | ||
|
||
|
||
if (DrawableObject.Time.Current < DrawableObject.HitObject.StartTime) | ||
{ | ||
starHighlight.Rotation = SlideTap.HitObject.Lane.GetRotationForLane(); | ||
starHighlight.Note.Position = new Vector2(0, Math.Max(SlideTap.TapVisual.Y, -SentakkiPlayfield.INTERSECTDISTANCE)); | ||
starHighlight.Note.Scale = SlideTap.TapVisual.Scale; | ||
starHighlight.Note.Rotation = (SlideTap.TapVisual as SlideTapPiece).Stars.Rotation; | ||
} | ||
else | ||
{ | ||
if (FirstSlideBody is null) | ||
return; | ||
|
||
starHighlight.Rotation = SlideTap.HitObject.Lane.GetRotationForLane() - 22.5f; | ||
starHighlight.Note.Position = FirstSlideBody.SlideStar.Position; | ||
starHighlight.Note.Scale = FirstSlideBody.SlideStar.Scale; | ||
starHighlight.Note.Rotation = FirstSlideBody.SlideStar.Rotation; | ||
} | ||
|
||
if (FirstSlideBody is null) | ||
return; | ||
|
||
bodyHighlight.Rotation = SlideTap.HitObject.Lane.GetRotationForLane() - 22.5f; | ||
bodyHighlight.Path.Vertices = DrawableObject.SlideBodies.First().HitObject.SlideInfo.SlidePath.Vertices; | ||
} | ||
|
||
public override Vector2 ScreenSpaceSelectionPoint => starHighlight.ScreenSpaceDrawQuad.Centre; | ||
|
||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) | ||
=> starHighlight.ReceivePositionalInputAt(screenSpacePos) || bodyHighlight.ReceivePositionalInputAt(screenSpacePos); | ||
|
||
public override Quad SelectionQuad => starHighlight.ScreenSpaceDrawQuad; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
osu.Game.Rulesets.Sentakki/Edit/Blueprints/Slides/SlideStarHighlight.cs
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,39 @@ | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Graphics.Lines; | ||
using osu.Framework.Graphics.Primitives; | ||
using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces; | ||
using osuTK; | ||
using osuTK.Graphics; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Edit.Blueprints.Slides | ||
{ | ||
public class SlideStarHighlight : CompositeDrawable | ||
{ | ||
public readonly Container Note; | ||
|
||
// This drawable is zero width | ||
// We should use the quad of the note container | ||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Note.ReceivePositionalInputAt(screenSpacePos); | ||
public override Quad ScreenSpaceDrawQuad => Note.ScreenSpaceDrawQuad.AABBFloat; | ||
|
||
|
||
public SlideStarHighlight() | ||
{ | ||
Anchor = Origin = Anchor.Centre; | ||
Colour = Color4.YellowGreen; | ||
Alpha = 0.5f; | ||
InternalChildren = new Drawable[] | ||
{ | ||
Note = new Container{ | ||
Size = new Vector2(75), | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
Children = new Drawable[]{ | ||
new StarPiece() | ||
} | ||
} | ||
}; | ||
} | ||
} | ||
} |
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