Skip to content

Commit 59a097d

Browse files
committed
Prevent place 0 duration notes
1 parent 6d0b17b commit 59a097d

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

osu.Game.Rulesets.Sentakki/Edit/Blueprints/Holds/HoldPlacementBlueprint.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace osu.Game.Rulesets.Sentakki.Edit.Blueprints.Holds
1111
{
1212
public partial class HoldPlacementBlueprint : SentakkiPlacementBlueprint<Hold>
1313
{
14+
protected override bool IsValidForPlacement => HitObject.Duration > 0;
1415
private readonly HoldHighlight highlight;
1516

1617
public HoldPlacementBlueprint()

osu.Game.Rulesets.Sentakki/Edit/Blueprints/Slides/SlidePlacementBlueprint.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public partial class SlidePlacementBlueprint : SentakkiPlacementBlueprint<Slide>
2323

2424
private readonly SlideVisual bodyHighlight;
2525
private readonly SlideVisual commited;
26+
protected override bool IsValidForPlacement => HitObject.Duration > 0 && commitedSlideBodyInfo?.SlidePathParts?.Length > 0;
2627

2728
[Resolved]
2829
private SlideEditorToolboxGroup slidePlacementToolbox { get; set; } = null!;

osu.Game.Rulesets.Sentakki/Edit/Blueprints/TouchHolds/TouchHoldPlacementBlueprint.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace osu.Game.Rulesets.Sentakki.Edit.Blueprints.TouchHolds
99
{
1010
public partial class TouchHoldPlacementBlueprint : SentakkiPlacementBlueprint<TouchHold>
1111
{
12+
protected override bool IsValidForPlacement => HitObject.Duration > 0;
13+
1214
public TouchHoldPlacementBlueprint()
1315
{
1416
InternalChild = new TouchHoldHighlight();

osu.Game.Rulesets.Sentakki/Edit/Blueprints/Touches/TouchPlacementBlueprint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ public override void UpdateTimeAndPosition(SnapResult result)
3535

3636
var newPosition = ToLocalSpace(result.ScreenSpacePosition) - OriginPosition;
3737

38-
if (Vector2.Distance(Vector2.Zero, newPosition) > 250)
38+
if (Vector2.Distance(Vector2.Zero, newPosition) > 270)
3939
{
4040
float angle = Vector2.Zero.GetDegreesFromPosition(newPosition);
41-
newPosition = SentakkiExtensions.GetCircularPosition(250, angle);
41+
newPosition = SentakkiExtensions.GetCircularPosition(270, angle);
4242
}
4343

4444
HitObject.Position = newPosition;

osu.Game.Rulesets.Sentakki/Objects/Slide.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ public double Duration
2626
}
2727
set
2828
{
29+
if (Duration == 0)
30+
{
31+
foreach (var slide in SlideInfoList)
32+
slide.Duration = value;
33+
34+
return;
35+
}
36+
2937
double ratio = value / Duration;
3038

3139
foreach (var slide in SlideInfoList)

0 commit comments

Comments
 (0)