Simplify bubble container structure, modify some comments

This commit is contained in:
mk56-spn
2023-02-12 11:37:07 +01:00
parent 5e0c4aa904
commit 6ff6e06a69

View File

@ -38,8 +38,7 @@ namespace osu.Game.Rulesets.Osu.Mods
// Compatibility with these seems potentially feasible in the future, blocked for now because they don't work as one would expect // Compatibility with these seems potentially feasible in the future, blocked for now because they don't work as one would expect
public override Type[] IncompatibleMods => new[] { typeof(OsuModBarrelRoll), typeof(OsuModMagnetised), typeof(OsuModRepel) }; public override Type[] IncompatibleMods => new[] { typeof(OsuModBarrelRoll), typeof(OsuModMagnetised), typeof(OsuModRepel) };
private PlayfieldAdjustmentContainer adjustmentContainer = null!; private PlayfieldAdjustmentContainer bubbleContainer = null!;
private Container bubbleContainer = null!;
private readonly Bindable<int> currentCombo = new BindableInt(); private readonly Bindable<int> currentCombo = new BindableInt();
@ -119,20 +118,17 @@ namespace osu.Game.Rulesets.Osu.Mods
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset) public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
{ {
// Multiplying by 2 results in an initial size that is too large, hence 1.85 has been chosen // Multiplying by 2 results in an initial size that is too large, hence 1.90 has been chosen
bubbleRadius = (float)(drawableRuleset.Beatmap.HitObjects.OfType<HitCircle>().First().Radius * 1.85f); // Also avoids the HitObject bleeding around the edges of the bubble drawable at minimum size
bubbleRadius = (float)(drawableRuleset.Beatmap.HitObjects.OfType<HitCircle>().First().Radius * 1.90f);
bubbleFade = drawableRuleset.Beatmap.HitObjects.OfType<HitCircle>().First().TimePreempt * 2; bubbleFade = drawableRuleset.Beatmap.HitObjects.OfType<HitCircle>().First().TimePreempt * 2;
// We want to hide the judgements since they are obscured by the BubbleDrawable (due to layering) // We want to hide the judgements since they are obscured by the BubbleDrawable (due to layering)
drawableRuleset.Playfield.DisplayJudgements.Value = false; drawableRuleset.Playfield.DisplayJudgements.Value = false;
adjustmentContainer = drawableRuleset.CreatePlayfieldAdjustmentContainer(); bubbleContainer = drawableRuleset.CreatePlayfieldAdjustmentContainer();
adjustmentContainer.Add(bubbleContainer = new Container drawableRuleset.KeyBindingInputManager.Add(bubbleContainer);
{
RelativeSizeAxes = Axes.Both,
});
drawableRuleset.KeyBindingInputManager.Add(adjustmentContainer);
} }
protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state) => applyBubbleState(hitObject); protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state) => applyBubbleState(hitObject);