Fix OsuClickableContainer input receiving

This commit is contained in:
Andrei Zavatski
2022-12-12 14:42:50 +03:00
parent 7e39f171fb
commit d2b3533356

View File

@ -1,14 +1,13 @@
// 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.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Cursor;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osuTK;
namespace osu.Game.Graphics.Containers namespace osu.Game.Graphics.Containers
{ {
@ -18,6 +17,8 @@ namespace osu.Game.Graphics.Containers
private readonly Container content = new Container { RelativeSizeAxes = Axes.Both }; private readonly Container content = new Container { RelativeSizeAxes = Axes.Both };
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Content.ReceivePositionalInputAt(screenSpacePos);
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
protected virtual HoverSounds CreateHoverSounds(HoverSampleSet sampleSet) => new HoverClickSounds(sampleSet) { Enabled = { BindTarget = Enabled } }; protected virtual HoverSounds CreateHoverSounds(HoverSampleSet sampleSet) => new HoverClickSounds(sampleSet) { Enabled = { BindTarget = Enabled } };
@ -38,11 +39,8 @@ namespace osu.Game.Graphics.Containers
content.AutoSizeAxes = AutoSizeAxes; content.AutoSizeAxes = AutoSizeAxes;
} }
InternalChildren = new Drawable[] AddInternal(content);
{ Add(CreateHoverSounds(sampleSet));
content,
CreateHoverSounds(sampleSet)
};
} }
} }
} }