mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 08:12:56 +08:00
Fix OsuClickableContainer's local content geting overwritten
This commit is contained in:
parent
9c90d9ca45
commit
671b3d01ff
@ -2,6 +2,7 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
|
||||||
@ -11,6 +12,10 @@ namespace osu.Game.Graphics.Containers
|
|||||||
{
|
{
|
||||||
private readonly HoverSampleSet sampleSet;
|
private readonly HoverSampleSet sampleSet;
|
||||||
|
|
||||||
|
private readonly Container content = new Container { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
public OsuClickableContainer(HoverSampleSet sampleSet = HoverSampleSet.Normal)
|
public OsuClickableContainer(HoverSampleSet sampleSet = HoverSampleSet.Normal)
|
||||||
{
|
{
|
||||||
this.sampleSet = sampleSet;
|
this.sampleSet = sampleSet;
|
||||||
@ -19,7 +24,17 @@ namespace osu.Game.Graphics.Containers
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
AddInternal(new HoverClickSounds(sampleSet));
|
if (AutoSizeAxes != Axes.None)
|
||||||
|
{
|
||||||
|
content.RelativeSizeAxes = RelativeSizeAxes;
|
||||||
|
content.AutoSizeAxes = AutoSizeAxes;
|
||||||
|
}
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
content,
|
||||||
|
new HoverClickSounds(sampleSet)
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user