mirror of
https://github.com/ppy/osu.git
synced 2025-03-07 08:47:20 +08:00
Merge pull request #30755 from bdach/fix-mania-notes-disappearing
Fix mania notes disappearing on seek to their end time
This commit is contained in:
commit
b1389edbfe
45
osu.Game.Rulesets.Mania/Edit/EditorColumn.cs
Normal file
45
osu.Game.Rulesets.Mania/Edit/EditorColumn.cs
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
18
osu.Game.Rulesets.Mania/Edit/EditorStage.cs
Normal file
18
osu.Game.Rulesets.Mania/Edit/EditorStage.cs
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -13,5 +13,8 @@ namespace osu.Game.Rulesets.Mania.Edit
|
|||||||
: base(stages)
|
: base(stages)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override Stage CreateStage(int firstColumnIndex, StageDefinition stageDefinition, ref ManiaAction columnAction)
|
||||||
|
=> new EditorStage(firstColumnIndex, stageDefinition, ref columnAction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
@ -71,7 +72,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
for (int i = 0; i < stageDefinitions.Count; i++)
|
for (int i = 0; i < stageDefinitions.Count; i++)
|
||||||
{
|
{
|
||||||
var newStage = new Stage(firstColumnIndex, stageDefinitions[i], ref columnAction);
|
var newStage = CreateStage(firstColumnIndex, stageDefinitions[i], ref columnAction);
|
||||||
|
|
||||||
playfieldGrid.Content[0][i] = newStage;
|
playfieldGrid.Content[0][i] = newStage;
|
||||||
|
|
||||||
@ -82,6 +83,9 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Pure]
|
||||||
|
protected virtual Stage CreateStage(int firstColumnIndex, StageDefinition stageDefinition, ref ManiaAction columnAction) => new Stage(firstColumnIndex, stageDefinition, ref columnAction);
|
||||||
|
|
||||||
public override void Add(HitObject hitObject) => getStageByColumn(((ManiaHitObject)hitObject).Column).Add(hitObject);
|
public override void Add(HitObject hitObject) => getStageByColumn(((ManiaHitObject)hitObject).Column).Add(hitObject);
|
||||||
|
|
||||||
public override bool Remove(HitObject hitObject) => getStageByColumn(((ManiaHitObject)hitObject).Column).Remove(hitObject);
|
public override bool Remove(HitObject hitObject) => getStageByColumn(((ManiaHitObject)hitObject).Column).Remove(hitObject);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.ObjectExtensions;
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -134,12 +135,14 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
{
|
{
|
||||||
bool isSpecial = definition.IsSpecialColumn(i);
|
bool isSpecial = definition.IsSpecialColumn(i);
|
||||||
|
|
||||||
var column = new Column(firstColumnIndex + i, isSpecial)
|
var action = columnStartAction;
|
||||||
|
columnStartAction++;
|
||||||
|
var column = CreateColumn(firstColumnIndex + i, isSpecial).With(c =>
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
c.RelativeSizeAxes = Axes.Both;
|
||||||
Width = 1,
|
c.Width = 1;
|
||||||
Action = { Value = columnStartAction++ }
|
c.Action.Value = action;
|
||||||
};
|
});
|
||||||
|
|
||||||
topLevelContainer.Add(column.TopLevelContainer.CreateProxy());
|
topLevelContainer.Add(column.TopLevelContainer.CreateProxy());
|
||||||
columnBackgrounds.Add(column.BackgroundContainer.CreateProxy());
|
columnBackgrounds.Add(column.BackgroundContainer.CreateProxy());
|
||||||
@ -154,6 +157,9 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
RegisterPool<BarLine, DrawableBarLine>(50, 200);
|
RegisterPool<BarLine, DrawableBarLine>(50, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Pure]
|
||||||
|
protected virtual Column CreateColumn(int index, bool isSpecial) => new Column(index, isSpecial);
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(ISkinSource skin)
|
private void load(ISkinSource skin)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user