1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 13:23:05 +08:00

Fix osu!catch fruit showing on plate when hidden mod is enabled

Closes https://github.com/ppy/osu/issues/12065.
This commit is contained in:
Dean Herbert 2021-03-25 17:04:35 +09:00
parent 41cf261286
commit 013ddc734c
3 changed files with 21 additions and 4 deletions

View File

@ -3,13 +3,16 @@
using System.Linq; using System.Linq;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.Objects.Drawables; using osu.Game.Rulesets.Catch.Objects.Drawables;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Catch.Mods namespace osu.Game.Rulesets.Catch.Mods
{ {
public class CatchModHidden : ModHidden public class CatchModHidden : ModHidden, IApplicableToDrawableRuleset<CatchHitObject>
{ {
public override string Description => @"Play with fading fruits."; public override string Description => @"Play with fading fruits.";
public override double ScoreMultiplier => 1.06; public override double ScoreMultiplier => 1.06;
@ -17,6 +20,14 @@ namespace osu.Game.Rulesets.Catch.Mods
private const double fade_out_offset_multiplier = 0.6; private const double fade_out_offset_multiplier = 0.6;
private const double fade_out_duration_multiplier = 0.44; private const double fade_out_duration_multiplier = 0.44;
public void ApplyToDrawableRuleset(DrawableRuleset<CatchHitObject> drawableRuleset)
{
var drawableCatchRuleset = (DrawableCatchRuleset)drawableRuleset;
var catchPlayfield = (CatchPlayfield)drawableCatchRuleset.Playfield;
catchPlayfield.CatcherArea.CatchFruitOnPlate = false;
}
protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state) protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state)
{ {
base.ApplyNormalVisibilityState(hitObject, state); base.ApplyNormalVisibilityState(hitObject, state);

View File

@ -223,7 +223,7 @@ namespace osu.Game.Rulesets.Catch.UI
catchObjectPosition <= catcherPosition + halfCatchWidth; catchObjectPosition <= catcherPosition + halfCatchWidth;
} }
public void OnNewResult(DrawableCatchHitObject drawableObject, JudgementResult result) public void OnNewResult(DrawableCatchHitObject drawableObject, JudgementResult result, bool placeOnPlate)
{ {
var catchResult = (CatchJudgementResult)result; var catchResult = (CatchJudgementResult)result;
catchResult.CatcherAnimationState = CurrentState; catchResult.CatcherAnimationState = CurrentState;
@ -237,7 +237,8 @@ namespace osu.Game.Rulesets.Catch.UI
{ {
var positionInStack = computePositionInStack(new Vector2(palpableObject.X - X, 0), palpableObject.DisplaySize.X / 2); var positionInStack = computePositionInStack(new Vector2(palpableObject.X - X, 0), palpableObject.DisplaySize.X / 2);
placeCaughtObject(palpableObject, positionInStack); if (placeOnPlate)
placeCaughtObject(palpableObject, positionInStack);
if (hitLighting.Value) if (hitLighting.Value)
addLighting(hitObject, positionInStack.X, drawableObject.AccentColour.Value); addLighting(hitObject, positionInStack.X, drawableObject.AccentColour.Value);

View File

@ -21,6 +21,11 @@ namespace osu.Game.Rulesets.Catch.UI
public readonly Catcher MovableCatcher; public readonly Catcher MovableCatcher;
private readonly CatchComboDisplay comboDisplay; private readonly CatchComboDisplay comboDisplay;
/// <summary>
/// Whether <see cref="DrawablePalpableCatchHitObject"/> fruit should appear on the plate.
/// </summary>
public bool CatchFruitOnPlate { get; set; } = true;
public CatcherArea(Container<CaughtObject> droppedObjectContainer, BeatmapDifficulty difficulty = null) public CatcherArea(Container<CaughtObject> droppedObjectContainer, BeatmapDifficulty difficulty = null)
{ {
Size = new Vector2(CatchPlayfield.WIDTH, CATCHER_SIZE); Size = new Vector2(CatchPlayfield.WIDTH, CATCHER_SIZE);
@ -41,7 +46,7 @@ namespace osu.Game.Rulesets.Catch.UI
public void OnNewResult(DrawableCatchHitObject hitObject, JudgementResult result) public void OnNewResult(DrawableCatchHitObject hitObject, JudgementResult result)
{ {
MovableCatcher.OnNewResult(hitObject, result); MovableCatcher.OnNewResult(hitObject, result, CatchFruitOnPlate);
if (!result.Type.IsScorable()) if (!result.Type.IsScorable())
return; return;