mirror of
https://github.com/ppy/osu.git
synced 2024-11-07 06:37:50 +08:00
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
namespace osu.Game.Graphics.Containers
|
|
{
|
|
public class OsuClickableContainer : ClickableContainer
|
|
{
|
|
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)
|
|
{
|
|
this.sampleSet = sampleSet;
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load()
|
|
{
|
|
if (AutoSizeAxes != Axes.None)
|
|
{
|
|
content.RelativeSizeAxes = RelativeSizeAxes;
|
|
content.AutoSizeAxes = AutoSizeAxes;
|
|
}
|
|
|
|
InternalChildren = new Drawable[]
|
|
{
|
|
content,
|
|
new HoverClickSounds(sampleSet)
|
|
};
|
|
}
|
|
}
|
|
}
|