-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mania notes disappearing on seek to their end time
- Loading branch information
Showing
5 changed files
with
82 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Graphics; | ||
using osu.Game.Rulesets.Mania.Objects.Drawables; | ||
using osu.Game.Rulesets.Mania.UI; | ||
using osu.Game.Rulesets.Objects.Drawables; | ||
|
||
namespace osu.Game.Rulesets.Mania.Edit | ||
{ | ||
public partial class EditorColumn : Column | ||
{ | ||
public EditorColumn(int index, bool isSpecial) | ||
: base(index, isSpecial) | ||
{ | ||
} | ||
|
||
protected override void OnNewDrawableHitObject(DrawableHitObject drawableHitObject) | ||
{ | ||
base.OnNewDrawableHitObject(drawableHitObject); | ||
drawableHitObject.ApplyCustomUpdateState += (dho, state) => | ||
{ | ||
switch (dho) | ||
{ | ||
// hold note heads are exempt from what follows due to the "freezing" mechanic | ||
// which already ensures they'll never fade away on their own. | ||
case DrawableHoldNoteHead: | ||
break; | ||
|
||
// mania features instantaneous hitobject fade-outs. | ||
// this means that without manual intervention stopping the clock at the precise time of hitting the object | ||
// means the object will fade out. | ||
// this is anti-user in editor contexts, as the user is expecting to continue the see the note on the receptor line. | ||
// therefore, apply a crude workaround to prevent it from going away. | ||
default: | ||
{ | ||
if (state == ArmedState.Hit) | ||
dho.FadeTo(1).Delay(1).FadeOut().Expire(); | ||
break; | ||
} | ||
} | ||
}; | ||
} | ||
} | ||
} |
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,18 @@ | ||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Game.Rulesets.Mania.Beatmaps; | ||
using osu.Game.Rulesets.Mania.UI; | ||
|
||
namespace osu.Game.Rulesets.Mania.Edit | ||
{ | ||
public partial class EditorStage : Stage | ||
{ | ||
public EditorStage(int firstColumnIndex, StageDefinition definition, ref ManiaAction columnStartAction) | ||
: base(firstColumnIndex, definition, ref columnStartAction) | ||
{ | ||
} | ||
|
||
protected override Column CreateColumn(int index, bool isSpecial) => new EditorColumn(index, isSpecial); | ||
} | ||
} |
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