1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 07:22:54 +08:00

Change some component samples to go better with overlay pop-in samples

This commit is contained in:
Jamie Taylor 2023-08-17 17:07:02 +09:00
parent 3d7ba0e18c
commit d10d7b6ea4
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C
4 changed files with 10 additions and 2 deletions

View File

@ -46,8 +46,8 @@ namespace osu.Game.Graphics.UserInterface
private readonly Container content;
private readonly Box hover;
public OsuAnimatedButton()
: base(HoverSampleSet.Button)
public OsuAnimatedButton(HoverSampleSet sampleSet = HoverSampleSet.Button)
: base(sampleSet)
{
base.Content.Add(content = new Container
{

View File

@ -14,6 +14,8 @@ namespace osu.Game.Graphics.UserInterface
private Sample? sampleOff;
private Sample? sampleOn;
protected virtual bool PlayClickSampleOnly => false;
/// <summary>
/// Whether this button is currently toggled to an active state.
/// </summary>
@ -68,6 +70,9 @@ namespace osu.Game.Graphics.UserInterface
{
sampleClick?.Play();
if (PlayClickSampleOnly)
return;
if (Active.Value)
sampleOn?.Play();
else

View File

@ -18,6 +18,8 @@ namespace osu.Game.Overlays.Mods
{
public partial class AddPresetButton : ShearedToggleButton, IHasPopover
{
protected override bool PlayClickSampleOnly => true;
[Resolved]
private OsuColour colours { get; set; } = null!;

View File

@ -262,6 +262,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
private readonly OsuSpriteText divisorText;
public DivisorDisplay()
: base(HoverSampleSet.Default)
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;