mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Add hover+select sounds to some components that are missing them
This commit is contained in:
@ -3,6 +3,9 @@
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -13,6 +16,7 @@ using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.Chat;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
@ -39,6 +43,8 @@ namespace osu.Game.Overlays.Chat.Tabs
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
private Sample sampleTabSwitched;
|
||||
|
||||
public ChannelTabItem(Channel value)
|
||||
: base(value)
|
||||
{
|
||||
@ -112,6 +118,7 @@ namespace osu.Game.Overlays.Chat.Tabs
|
||||
},
|
||||
},
|
||||
},
|
||||
new HoverSounds()
|
||||
};
|
||||
}
|
||||
|
||||
@ -152,11 +159,12 @@ namespace osu.Game.Overlays.Chat.Tabs
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
private void load(OsuColour colours, AudioManager audio)
|
||||
{
|
||||
BackgroundActive = colours.ChatBlue;
|
||||
BackgroundInactive = colours.Gray4;
|
||||
backgroundHover = colours.Gray7;
|
||||
sampleTabSwitched = audio.Samples.Get($@"UI/{HoverSampleSet.Default.GetDescription()}-select");
|
||||
|
||||
highlightBox.Colour = colours.Yellow;
|
||||
}
|
||||
@ -217,7 +225,14 @@ namespace osu.Game.Overlays.Chat.Tabs
|
||||
Text.Font = Text.Font.With(weight: FontWeight.Medium);
|
||||
}
|
||||
|
||||
protected override void OnActivated() => updateState();
|
||||
protected override void OnActivated()
|
||||
{
|
||||
if (IsLoaded)
|
||||
sampleTabSwitched?.Play();
|
||||
|
||||
updateState();
|
||||
}
|
||||
|
||||
protected override void OnDeactivated() => updateState();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user