mirror of https://github.com/ppy/osu
Add shutter sound
This commit is contained in:
parent
4991f2ad2e
commit
9e080028ff
|
@ -1 +1 @@
|
|||
Subproject commit 7bb0782200abadf73b79ed1a3bc1d5b926c6a81e
|
||||
Subproject commit 6e145ed50274539ee827fdc3d1fda1e130b070fd
|
|
@ -5,6 +5,8 @@
|
|||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input;
|
||||
|
@ -24,14 +26,18 @@ public class ScreenshotManager : Container, IKeyBindingHandler<GlobalAction>, IH
|
|||
private Storage storage;
|
||||
private NotificationOverlay notificationOverlay;
|
||||
|
||||
private SampleChannel shutter;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(GameHost host, OsuConfigManager config, Storage storage, NotificationOverlay notificationOverlay)
|
||||
private void load(GameHost host, OsuConfigManager config, Storage storage, NotificationOverlay notificationOverlay, AudioManager audio)
|
||||
{
|
||||
this.host = host;
|
||||
this.storage = storage.GetStorageForDirectory(@"screenshots");
|
||||
this.notificationOverlay = notificationOverlay;
|
||||
|
||||
screenshotFormat = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat);
|
||||
|
||||
shutter = audio.Sample.Get("UI/shutter");
|
||||
}
|
||||
|
||||
public bool OnPressed(GlobalAction action)
|
||||
|
@ -39,6 +45,7 @@ public bool OnPressed(GlobalAction action)
|
|||
switch (action)
|
||||
{
|
||||
case GlobalAction.TakeScreenshot:
|
||||
shutter.Play();
|
||||
TakeScreenshotAsync();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue