mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 01:33:21 +08:00
Add ability to change slider velocity with shift-drag
This commit is contained in:
parent
b19dc5e41f
commit
87cfcf706e
@ -382,15 +382,29 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
switch (hitObject)
|
switch (hitObject)
|
||||||
{
|
{
|
||||||
case IHasRepeats repeatHitObject:
|
case IHasRepeats repeatHitObject:
|
||||||
// find the number of repeats which can fit in the requested time.
|
double proposedDuration = time - hitObject.StartTime;
|
||||||
var lengthOfOneRepeat = repeatHitObject.Duration / (repeatHitObject.RepeatCount + 1);
|
|
||||||
var proposedCount = Math.Max(0, (int)Math.Round((time - hitObject.StartTime) / lengthOfOneRepeat) - 1);
|
|
||||||
|
|
||||||
if (proposedCount == repeatHitObject.RepeatCount)
|
if (e.CurrentState.Keyboard.ShiftPressed)
|
||||||
return;
|
{
|
||||||
|
if (hitObject.DifficultyControlPoint == DifficultyControlPoint.DEFAULT)
|
||||||
|
hitObject.DifficultyControlPoint = new DifficultyControlPoint();
|
||||||
|
|
||||||
|
hitObject.DifficultyControlPoint.SliderVelocity *= (repeatHitObject.Duration / proposedDuration);
|
||||||
|
beatmap.Update(hitObject);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// find the number of repeats which can fit in the requested time.
|
||||||
|
var lengthOfOneRepeat = repeatHitObject.Duration / (repeatHitObject.RepeatCount + 1);
|
||||||
|
var proposedCount = Math.Max(0, (int)Math.Round(proposedDuration / lengthOfOneRepeat) - 1);
|
||||||
|
|
||||||
|
if (proposedCount == repeatHitObject.RepeatCount)
|
||||||
|
return;
|
||||||
|
|
||||||
|
repeatHitObject.RepeatCount = proposedCount;
|
||||||
|
beatmap.Update(hitObject);
|
||||||
|
}
|
||||||
|
|
||||||
repeatHitObject.RepeatCount = proposedCount;
|
|
||||||
beatmap.Update(hitObject);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IHasDuration endTimeHitObject:
|
case IHasDuration endTimeHitObject:
|
||||||
|
Loading…
Reference in New Issue
Block a user