Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Sentakki editor #220

Draft
wants to merge 119 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
a8c1f44
Basic boilerplate for editor stuff
LumpBloom7 Apr 28, 2021
dbda82c
Add TapCompositionTool
LumpBloom7 Apr 29, 2021
2247a65
Add HoldCompositionTool
LumpBloom7 Apr 29, 2021
8265d02
Add SlideSelectionBlueprint
LumpBloom7 Apr 30, 2021
aa48122
Silently ignore attempts to set slide duration
LumpBloom7 May 1, 2021
30c2466
Add TouchCompositionTool
LumpBloom7 May 1, 2021
a1319e7
Change icon of TouchCompositionTool
LumpBloom7 May 1, 2021
e7ff1f3
Add TouchHoldCompositionTool
LumpBloom7 May 1, 2021
257d9b3
Merge branch 'master' into editor-2
LumpBloom7 May 2, 2021
4f1eab7
Lightly tweak TouchHold selection quad
LumpBloom7 May 2, 2021
43cadd5
Hide "New combo" from toggle list
LumpBloom7 May 2, 2021
3dc28b4
Add support for moving Touch notes
LumpBloom7 May 2, 2021
170b322
Add support for changing the lane of laned notes
LumpBloom7 May 2, 2021
be49d57
Implement break toggle in context menu for laned HOs
LumpBloom7 May 2, 2021
ef10ca7
Add sound selection to context menu
LumpBloom7 May 2, 2021
2d37866
Add placeholder slide composition tool
LumpBloom7 May 4, 2021
9986691
Fix codefactor complaints
LumpBloom7 May 4, 2021
523746c
Limit distance of touch placement to 250 units from centre
LumpBloom7 May 5, 2021
939892a
Fix crash when adjusting touch hold duration while within hittable time
LumpBloom7 May 7, 2021
0579439
Add pattern selection in menu for slides
LumpBloom7 May 11, 2021
7040fa8
Fix thunder group including a straight entry
LumpBloom7 May 11, 2021
b2d2e0d
Add slide mirroring toggle in context menu
LumpBloom7 May 11, 2021
5c2b8ad
Support modifying the lanes of multiple laned notes simultaneously
LumpBloom7 May 11, 2021
3915e05
Support simultaneously moving multiple Touch notes
Flutterish May 11, 2021
6e1da26
Fix math error in Touch note movement code
Flutterish May 11, 2021
458bfa3
Merge branch 'master' into editor-2
LumpBloom7 May 22, 2021
690bbf6
Update SelectionBlueprint in line with bump
LumpBloom7 May 22, 2021
88fd4b8
Fix jank when moving multiple notes at the same time
LumpBloom7 May 23, 2021
530d61f
Merge branch 'master' into editor-2
LumpBloom7 May 27, 2021
560259f
Allow duration adjustments of the first slidebody
LumpBloom7 May 26, 2021
563cf11
Merge branch 'master' into editor-2
LumpBloom7 Jun 24, 2021
2d34839
Merge branch 'master' into editor-2
LumpBloom7 Jul 14, 2021
fd6ce40
Differentiate timeline objects' colour in editor
LumpBloom7 Jul 16, 2021
338ad62
Merge branch 'master' into editor-2
LumpBloom7 Jul 28, 2021
956d740
Remove redundant override for blueprint lifetimes
LumpBloom7 Jul 28, 2021
d982873
Merge branch 'master' into editor-2
LumpBloom7 Oct 9, 2021
b89c7b0
Merge branch 'master' into editor-2
LumpBloom7 Nov 17, 2021
5972502
Merge branch 'master' into editor-2
LumpBloom7 Dec 26, 2021
350c96a
Merge branch 'master' into editor-2
LumpBloom7 Jan 28, 2022
226c53f
Merge branch 'master' into editor-2
LumpBloom7 Apr 9, 2022
b7265ff
Merge branch 'master' into editor-2
LumpBloom7 Jun 29, 2022
c28712b
Fix TouchHold selection blueprint always showing
LumpBloom7 Jun 29, 2022
987f712
Merge branch 'master' into editor-2
LumpBloom7 Jul 22, 2022
3f4f0a2
Allow use of fan-slide pattern
LumpBloom7 Jul 22, 2022
9638424
Support multi-slides in SlideSelectionBlueprint
LumpBloom7 Jul 22, 2022
18ec530
Reuse SlideVisual for blueprint highlight
LumpBloom7 Jul 22, 2022
a2fc0a1
Merge branch 'master' into editor-2
LumpBloom7 Nov 22, 2022
c57d21f
Add initial Slide selection blueprint
LumpBloom7 Nov 22, 2022
7258722
Recreate SlidePlacementBlueprint
LumpBloom7 Nov 23, 2022
51fea52
Add fan chevrons sprites to BlueprintContainer
LumpBloom7 Nov 24, 2022
a702ffb
Improve Slide placement blueprint
LumpBloom7 Nov 24, 2022
2b6ac2c
Prevent changing shape/mirroring while not placing
LumpBloom7 Nov 24, 2022
11fe80c
Use star icon in toolbox
LumpBloom7 Nov 24, 2022
0e39cca
Normalize candidate lane when creating valid path
LumpBloom7 Nov 24, 2022
c41c7e2
Fix bonkers SlideBodyPart equality check
LumpBloom7 Nov 24, 2022
31f3aed
Fix codeFactor issues
LumpBloom7 Nov 24, 2022
4e7d721
Remove redundant assignment
LumpBloom7 Nov 24, 2022
a448199
Inject ruleset dependencies for HitObjectComposer
LumpBloom7 Nov 26, 2022
e67fe49
Use right click to end placement
LumpBloom7 Nov 26, 2022
1b0795e
Fix negative time
LumpBloom7 Nov 26, 2022
dcd3283
Add fallback empty path in SlideBodyInfo
LumpBloom7 Nov 26, 2022
b9550d7
Normalize start and end times of slide placement
LumpBloom7 Nov 26, 2022
29f2e0c
Fix Slide placement crash
LumpBloom7 Nov 26, 2022
1194156
Fix crash when pasting Holds
LumpBloom7 Nov 26, 2022
5e0aba3
Prevent slide parent from playing samples
LumpBloom7 Nov 26, 2022
71a5ad9
Make sure slide bodies get a sample from editor
LumpBloom7 Nov 26, 2022
d59e91e
Change how hold note gets samples
LumpBloom7 Nov 26, 2022
284fcd0
Allow clicks to be registered outside of placement area
LumpBloom7 Nov 26, 2022
11ad5ed
Disallow 0 duration HitObjects
LumpBloom7 Nov 26, 2022
4aa773a
Use BackSlash for mirroring slide paths
LumpBloom7 Nov 26, 2022
c8be5d6
Merge branch 'master' into editor-2
LumpBloom7 Nov 27, 2022
fab79b9
Fade out tap visuals when hit
LumpBloom7 Nov 28, 2022
eae3751
Pass SampleControlPoint to nested HitObjects
LumpBloom7 Nov 28, 2022
1959707
Fix incorrect empty path
LumpBloom7 Nov 28, 2022
7b89a32
Add ability to remove last commited part
LumpBloom7 Nov 28, 2022
53a913a
Add break slide toggle
LumpBloom7 Nov 28, 2022
0177244
Add basic way to adjust shootdelay
LumpBloom7 Nov 28, 2022
173b1d8
Merge branch 'master' into editor-2
LumpBloom7 Nov 28, 2022
caeabfa
Increase shoot delay font size
LumpBloom7 Nov 28, 2022
fe5e15d
Update shoot delay text when resetting to default
LumpBloom7 Nov 28, 2022
cddb054
Return true on handled placement blueprint clicks
LumpBloom7 Dec 3, 2022
b6d160b
Merge branch 'master' into editor-2
LumpBloom7 Dec 5, 2022
0a7942d
Add support for slide (un)merging
LumpBloom7 Dec 7, 2022
3f8cc10
Adjusting slide duration affects all bodies
LumpBloom7 Dec 7, 2022
443fb20
Merge branch 'master' into editor-2
LumpBloom7 Mar 2, 2023
b7471d0
Merge branch 'master' into editor-2
LumpBloom7 Mar 25, 2023
45d5870
Merge branch 'master' into editor-2
LumpBloom7 Jul 23, 2023
4b7a70a
Begin implementation of Slide toolbox
LumpBloom7 Jul 23, 2023
573d2a6
Add more decimals to the counter
LumpBloom7 Jul 24, 2023
97863af
Make toolbox fully "correct"
LumpBloom7 Jul 24, 2023
501249e
Add beats unit to shoot offset
LumpBloom7 Jul 24, 2023
c58ea01
Add mirrored state checkbox
LumpBloom7 Jul 24, 2023
e665fc5
Block mouse lane changes if too far from playfield
LumpBloom7 Jul 24, 2023
904c52f
Minor cleanups
LumpBloom7 Jul 24, 2023
afbbb7f
Use local bindable instead hooking to original bindable
LumpBloom7 Jul 27, 2023
2ff1c9b
Fix mouse-based lane offset not snapping to closest lane
LumpBloom7 Jul 27, 2023
0680dc4
Merge branch 'master' into editor-2
LumpBloom7 Aug 16, 2023
16e4fe3
Fix hold tail not having sound
LumpBloom7 Sep 2, 2023
2577787
Merge branch 'master' into editor-2
LumpBloom7 Oct 2, 2023
c788108
Add Ex state to right click menu
LumpBloom7 Oct 2, 2023
2bf28b0
Merge branch 'master' into editor-2
LumpBloom7 Oct 29, 2023
59f531e
Optimize slide selection chevron usage
LumpBloom7 Oct 29, 2023
a294163
Implement snap grid
LumpBloom7 Oct 29, 2023
bfb7adc
Lightly optimize snap line (re)creation
LumpBloom7 Oct 31, 2023
e32c53f
Merge branch 'master' into editor-2
LumpBloom7 Oct 31, 2023
b7470cc
Handle lane change via snapping
LumpBloom7 Oct 31, 2023
9637d3f
Adjust Laned Highlights to better represent timings
LumpBloom7 Oct 31, 2023
361ddb2
Minor cleaning
LumpBloom7 Oct 31, 2023
d4ca436
Implement touch note snapping
LumpBloom7 Oct 31, 2023
85c226f
Fix laned snap grid not showing when beatmap length is 0
LumpBloom7 Nov 1, 2023
4b18c31
Fix not being able to copy hold notes
LumpBloom7 Nov 1, 2023
0977a74
Merge branch 'master' into editor-2
LumpBloom7 Jan 7, 2024
8802dff
Merge branch 'master' into editor-2
LumpBloom7 Jan 30, 2024
3c29dde
Use Slide.Samples instead of Nodesamples
LumpBloom7 Jan 30, 2024
a22df6e
Adjust laned snap grid in line with anim speed changes
LumpBloom7 Jan 8, 2024
311bdd7
Merge branch 'master' into editor-2
LumpBloom7 Mar 24, 2024
a7a3f08
Merge branch 'master' into editor-2
LumpBloom7 Apr 13, 2024
44ba28f
Merge branch 'master' into editor-2
LumpBloom7 May 20, 2024
515c81d
Update in line with osu
LumpBloom7 May 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions osu.Game.Rulesets.Sentakki.Tests/TestSceneSentakkiEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using NUnit.Framework;
using osu.Game.Tests.Visual;

namespace osu.Game.Rulesets.Sentakki.Tests
{
[TestFixture]
public partial class TestSceneSentakkiEditor : EditorTestScene
{
protected override Ruleset CreateEditorRuleset() => new SentakkiRuleset();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ private SentakkiHitObject createHoldNote(HitObject original, IList<IList<HitSamp
Break = !ClassicMode && isBreak,
Lane = patternGenerator.GetNextLane(twin),
NodeSamples = samples,
Samples = original.Samples,
StartTime = original.StartTime,
EndTime = original.GetEndTime()
};
Expand Down
57 changes: 57 additions & 0 deletions osu.Game.Rulesets.Sentakki/Edit/Blueprints/Holds/HoldHighlight.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
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.Holds
{
public partial class HoldHighlight : 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) => ring.ReceivePositionalInputAt(screenSpacePos);
public override Quad ScreenSpaceDrawQuad => ring.ScreenSpaceDrawQuad;

private readonly RingPiece ring;

public HoldHighlight()
{
Anchor = Origin = Anchor.Centre;
Colour = Color4.YellowGreen;
Alpha = 0.5f;
InternalChildren = new Drawable[]
{
Note = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.TopCentre,
Children = new Drawable[]
{
new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(-75 / 2f),
Child = ring = new RingPiece()
},
new DotPiece(squared: true)
{
Anchor = Anchor.TopCentre,
Rotation = 45,
},
new DotPiece(squared: true)
{
Anchor = Anchor.BottomCentre,
Rotation = 45,
},
}
}
};
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Sentakki.Objects;
using osu.Game.Rulesets.Sentakki.UI;
using osu.Game.Screens.Edit;
using osuTK.Input;

namespace osu.Game.Rulesets.Sentakki.Edit.Blueprints.Holds
{
public partial class HoldPlacementBlueprint : SentakkiPlacementBlueprint<Hold>
{
private readonly HoldHighlight highlight;

public HoldPlacementBlueprint()
{
InternalChild = highlight = new HoldHighlight();
highlight.Note.Y = -SentakkiPlayfield.INTERSECTDISTANCE;
}

[Resolved]
private SentakkiSnapProvider snapProvider { get; set; } = null!;

protected override void Update()
{
highlight.Rotation = HitObject.Lane.GetRotationForLane();
highlight.Note.Y = -snapProvider.GetDistanceRelativeToCurrentTime(HitObject.StartTime, SentakkiPlayfield.NOTESTARTDISTANCE);
highlight.Note.Height = -snapProvider.GetDistanceRelativeToCurrentTime(HitObject.EndTime, SentakkiPlayfield.NOTESTARTDISTANCE) - highlight.Note.Y;
}

protected override bool OnMouseDown(MouseDownEvent e)
{
if (e.Button != MouseButton.Left)
return false;

if (PlacementActive == PlacementState.Active)
return false;

BeginPlacement(true);
EditorClock.SeekSmoothlyTo(HitObject.StartTime);

return true;
}

protected override void OnMouseUp(MouseUpEvent e)
{
if (e.Button != MouseButton.Right)
return;

if (PlacementActive == PlacementState.Active)
EndPlacement(HitObject.Duration > 0);
}

private double originalStartTime;

public override void UpdateTimeAndPosition(SnapResult result)
{
base.UpdateTimeAndPosition(result);

if (result is not SentakkiLanedSnapResult senRes)
return;

if (PlacementActive == PlacementState.Active)
{
if (result.Time is double endTime)
{
HitObject.StartTime = endTime < originalStartTime ? endTime : originalStartTime;
HitObject.Duration = Math.Abs(endTime - originalStartTime);
}
}
else
{
HitObject.Lane = senRes.Lane;
if (result.Time is double startTime)
originalStartTime = HitObject.StartTime = startTime;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics.Primitives;
using osu.Game.Rulesets.Sentakki.Objects;
using osu.Game.Rulesets.Sentakki.Objects.Drawables;
using osu.Game.Rulesets.Sentakki.UI;
using osuTK;

namespace osu.Game.Rulesets.Sentakki.Edit.Blueprints.Holds
{
public partial class HoldSelectionBlueprint : SentakkiSelectionBlueprint<Hold>
{
public new DrawableHold DrawableObject => (DrawableHold)base.DrawableObject;

private readonly HoldHighlight highlight;

public HoldSelectionBlueprint(Hold hitObject)
: base(hitObject)
{
InternalChild = highlight = new HoldHighlight();
}

[Resolved]
private SentakkiSnapProvider snapProvider { get; set; } = null!;

protected override void Update()
{
base.Update();

highlight.Rotation = DrawableObject.HitObject.Lane.GetRotationForLane();
highlight.Note.Y = -snapProvider.GetDistanceRelativeToCurrentTime(HitObject.StartTime, SentakkiPlayfield.NOTESTARTDISTANCE);
highlight.Note.Height = -snapProvider.GetDistanceRelativeToCurrentTime(HitObject.EndTime, SentakkiPlayfield.NOTESTARTDISTANCE) - highlight.Note.Y;
highlight.Note.Scale = DrawableObject.NoteBody.Scale;
}

public override Vector2 ScreenSpaceSelectionPoint => highlight.ScreenSpaceDrawQuad.Centre;

public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => highlight.ReceivePositionalInputAt(screenSpacePos);

public override Quad SelectionQuad => highlight.ScreenSpaceDrawQuad;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using osu.Framework.Graphics;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osuTK;

namespace osu.Game.Rulesets.Sentakki.Edit.Blueprints
{
public partial class SentakkiPlacementBlueprint<T> : PlacementBlueprint where T : HitObject, new()
{
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;

public new T HitObject => (T)base.HitObject;

public SentakkiPlacementBlueprint()
: base(new T())
{
Anchor = Origin = Anchor.Centre;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Sentakki.Objects;

namespace osu.Game.Rulesets.Sentakki.Edit.Blueprints
{
public partial class SentakkiSelectionBlueprint<T> : HitObjectSelectionBlueprint<T> where T : SentakkiHitObject
{
protected override bool AlwaysShowWhenSelected => true;

public SentakkiSelectionBlueprint(T hitObject)
: base(hitObject)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Sentakki.Objects;
using osu.Game.Rulesets.Sentakki.Objects.Drawables;
using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces.Slides;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Sentakki.Edit.Blueprints.Slides
{
public partial class SlideBodyHighlight : CompositeDrawable
{
private readonly Container<StarPiece> stars;

private readonly SlideVisual slideBody;

private readonly SlideBodyInfo slideBodyInfo;

// This drawable is zero width
// We should use the quad of the note container
//public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => SlideTapPiece.ReceivePositionalInputAt(screenSpacePos);
//public override Quad ScreenSpaceDrawQuad => SlideTapPiece.ScreenSpaceDrawQuad;

public SlideBodyHighlight(SlideBodyInfo slideBodyInfo)
{
Anchor = Origin = Anchor.Centre;
Colour = Color4.YellowGreen;
Alpha = 1;

InternalChildren = new Drawable[]
{
slideBody = new SlideVisual(),
stars = new Container<StarPiece>(),
};

const int number_of_stars = 3;

for (int i = 0; i < number_of_stars; ++i)
stars.Add(new StarPiece());

this.slideBodyInfo = slideBodyInfo;
}

public void OnSelected() => slideBody.Path = slideBodyInfo.SlidePath;

public void OnDeselected() => slideBody.Free();

public void UpdateFrom(DrawableSlideBody body)
{
for (int i = 0; i < body.SlideStars.Count; ++i)
{
stars[i].Position = body.SlideStars[i].Position;
stars[i].Rotation = body.SlideStars[i].Rotation;
stars[i].Scale = body.SlideStars[i].Scale;
stars[i].Alpha = body.SlideStars[i].Alpha;
}
}
}
}
Loading
Loading