mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge pull request #13831 from nekodex/add-dropdown-sound-to-profile
Change profile section expansion button to use dropdown sounds
This commit is contained in:
@ -18,7 +18,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
protected virtual HoverClickSounds CreateHoverClickSounds(HoverSampleSet sampleSet) => new HoverClickSounds(sampleSet);
|
protected virtual HoverSounds CreateHoverSounds(HoverSampleSet sampleSet) => new HoverClickSounds(sampleSet);
|
||||||
|
|
||||||
public OsuClickableContainer(HoverSampleSet sampleSet = HoverSampleSet.Default)
|
public OsuClickableContainer(HoverSampleSet sampleSet = HoverSampleSet.Default)
|
||||||
{
|
{
|
||||||
@ -39,7 +39,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
content,
|
content,
|
||||||
CreateHoverClickSounds(sampleSet)
|
CreateHoverSounds(sampleSet)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Online.Chat
|
|||||||
|
|
||||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceivePositionalInputAt(screenSpacePos));
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceivePositionalInputAt(screenSpacePos));
|
||||||
|
|
||||||
protected override HoverClickSounds CreateHoverClickSounds(HoverSampleSet sampleSet) => new LinkHoverSounds(sampleSet, Parts);
|
protected override HoverSounds CreateHoverSounds(HoverSampleSet sampleSet) => new LinkHoverSounds(sampleSet, Parts);
|
||||||
|
|
||||||
public DrawableLinkCompiler(IEnumerable<Drawable> parts)
|
public DrawableLinkCompiler(IEnumerable<Drawable> parts)
|
||||||
{
|
{
|
||||||
|
@ -2,11 +2,14 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Header.Components
|
namespace osu.Game.Overlays.Profile.Header.Components
|
||||||
@ -18,18 +21,29 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
public override LocalisableString TooltipText => DetailsVisible.Value ? "collapse" : "expand";
|
public override LocalisableString TooltipText => DetailsVisible.Value ? "collapse" : "expand";
|
||||||
|
|
||||||
private SpriteIcon icon;
|
private SpriteIcon icon;
|
||||||
|
private Sample sampleOpen;
|
||||||
|
private Sample sampleClose;
|
||||||
|
|
||||||
|
protected override HoverSounds CreateHoverSounds(HoverSampleSet sampleSet) => new HoverSounds();
|
||||||
|
|
||||||
public ExpandDetailsButton()
|
public ExpandDetailsButton()
|
||||||
{
|
{
|
||||||
Action = () => DetailsVisible.Toggle();
|
Action = () =>
|
||||||
|
{
|
||||||
|
DetailsVisible.Toggle();
|
||||||
|
(DetailsVisible.Value ? sampleOpen : sampleClose)?.Play();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider)
|
private void load(OverlayColourProvider colourProvider, AudioManager audio)
|
||||||
{
|
{
|
||||||
IdleColour = colourProvider.Background2;
|
IdleColour = colourProvider.Background2;
|
||||||
HoverColour = colourProvider.Background2.Lighten(0.2f);
|
HoverColour = colourProvider.Background2.Lighten(0.2f);
|
||||||
|
|
||||||
|
sampleOpen = audio.Samples.Get(@"UI/dropdown-open");
|
||||||
|
sampleClose = audio.Samples.Get(@"UI/dropdown-close");
|
||||||
|
|
||||||
Child = icon = new SpriteIcon
|
Child = icon = new SpriteIcon
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
Reference in New Issue
Block a user