Fix strong bindable changes for DrumRolls

This commit is contained in:
Dean Herbert
2020-05-26 16:58:28 +09:00
parent 910326623c
commit a2eec5d963
5 changed files with 18 additions and 17 deletions

View File

@ -48,12 +48,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
colourIdle = colours.YellowDark; colourIdle = colours.YellowDark;
colourEngaged = colours.YellowDarker; colourEngaged = colours.YellowDarker;
updateColour(); Content.Add(tickContainer = new Container
{
Content.Add(tickContainer = new Container { RelativeSizeAxes = Axes.Both }); RelativeSizeAxes = Axes.Both,
Depth = float.MinValue
if (MainPiece.Drawable is IHasAccentColour accentMain) });
accentMain.AccentColour = colourIdle;
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -63,6 +62,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
OnNewResult += onNewResult; OnNewResult += onNewResult;
} }
protected override void RecreatePieces()
{
base.RecreatePieces();
updateColour();
}
protected override void AddNestedHitObject(DrawableHitObject hitObject) protected override void AddNestedHitObject(DrawableHitObject hitObject)
{ {
base.AddNestedHitObject(hitObject); base.AddNestedHitObject(hitObject);

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
using System;
using System.Threading; using System.Threading;
using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
@ -25,11 +24,6 @@ namespace osu.Game.Rulesets.Taiko.Objects
/// </summary> /// </summary>
public int RequiredHits = 10; public int RequiredHits = 10;
public override bool IsStrong
{
set => throw new NotSupportedException($"{nameof(Swell)} cannot be a strong hitobject.");
}
protected override void CreateNestedHitObjects(CancellationToken cancellationToken) protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
{ {
base.CreateNestedHitObjects(cancellationToken); base.CreateNestedHitObjects(cancellationToken);

View File

@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
/// Whether this HitObject is a "strong" type. /// Whether this HitObject is a "strong" type.
/// Strong hit objects give more points for hitting the hit object with both keys. /// Strong hit objects give more points for hitting the hit object with both keys.
/// </summary> /// </summary>
public virtual bool IsStrong public bool IsStrong
{ {
get => IsStrongBindable.Value; get => IsStrongBindable.Value;
set => IsStrongBindable.Value = value; set => IsStrongBindable.Value = value;

View File

@ -107,6 +107,8 @@ namespace osu.Game.Rulesets.Taiko
h.IsStrong = false; h.IsStrong = false;
break; break;
} }
EditorBeatmap?.UpdateHitObject(h);
} }
}) })
{ {

View File

@ -38,7 +38,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
private Drawable outline; private Drawable outline;
[Resolved(CanBeNull = true)] [Resolved(CanBeNull = true)]
private EditorBeatmap editorBeatmap { get; set; } protected EditorBeatmap EditorBeatmap { get; private set; }
[Resolved(CanBeNull = true)] [Resolved(CanBeNull = true)]
private IEditorChangeHandler changeHandler { get; set; } private IEditorChangeHandler changeHandler { get; set; }
@ -117,7 +117,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
internal void HandleSelected(SelectionBlueprint blueprint) internal void HandleSelected(SelectionBlueprint blueprint)
{ {
selectedBlueprints.Add(blueprint); selectedBlueprints.Add(blueprint);
editorBeatmap.SelectedHitObjects.Add(blueprint.HitObject); EditorBeatmap.SelectedHitObjects.Add(blueprint.HitObject);
UpdateVisibility(); UpdateVisibility();
} }
@ -129,7 +129,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
internal void HandleDeselected(SelectionBlueprint blueprint) internal void HandleDeselected(SelectionBlueprint blueprint)
{ {
selectedBlueprints.Remove(blueprint); selectedBlueprints.Remove(blueprint);
editorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject); EditorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject);
// We don't want to update visibility if > 0, since we may be deselecting blueprints during drag-selection // We don't want to update visibility if > 0, since we may be deselecting blueprints during drag-selection
if (selectedBlueprints.Count == 0) if (selectedBlueprints.Count == 0)
@ -165,7 +165,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
changeHandler?.BeginChange(); changeHandler?.BeginChange();
foreach (var h in selectedBlueprints.ToList()) foreach (var h in selectedBlueprints.ToList())
editorBeatmap?.Remove(h.HitObject); EditorBeatmap?.Remove(h.HitObject);
changeHandler?.EndChange(); changeHandler?.EndChange();
} }