mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Add JPEG screenshot quality setting
This commit is contained in:
parent
4d7d4a7c7a
commit
4e0f16a450
@ -106,6 +106,7 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.Version, string.Empty);
|
Set(OsuSetting.Version, string.Empty);
|
||||||
|
|
||||||
Set(OsuSetting.ScreenshotFormat, ScreenshotFormat.Jpg);
|
Set(OsuSetting.ScreenshotFormat, ScreenshotFormat.Jpg);
|
||||||
|
Set(OsuSetting.ScreenshotJpegQuality, 75, 0, 100);
|
||||||
Set(OsuSetting.ScreenshotCaptureMenuCursor, false);
|
Set(OsuSetting.ScreenshotCaptureMenuCursor, false);
|
||||||
|
|
||||||
Set(OsuSetting.SongSelectRightMouseScroll, false);
|
Set(OsuSetting.SongSelectRightMouseScroll, false);
|
||||||
@ -212,6 +213,7 @@ namespace osu.Game.Configuration
|
|||||||
ShowConvertedBeatmaps,
|
ShowConvertedBeatmaps,
|
||||||
Skin,
|
Skin,
|
||||||
ScreenshotFormat,
|
ScreenshotFormat,
|
||||||
|
ScreenshotJpegQuality,
|
||||||
ScreenshotCaptureMenuCursor,
|
ScreenshotCaptureMenuCursor,
|
||||||
SongSelectRightMouseScroll,
|
SongSelectRightMouseScroll,
|
||||||
BeatmapSkins,
|
BeatmapSkins,
|
||||||
|
@ -19,6 +19,7 @@ using osu.Game.Input.Bindings;
|
|||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
using SixLabors.ImageSharp;
|
using SixLabors.ImageSharp;
|
||||||
|
using SixLabors.ImageSharp.Formats.Jpeg;
|
||||||
|
|
||||||
namespace osu.Game.Graphics
|
namespace osu.Game.Graphics
|
||||||
{
|
{
|
||||||
@ -33,6 +34,7 @@ namespace osu.Game.Graphics
|
|||||||
public IBindable<bool> CursorVisibility => cursorVisibility;
|
public IBindable<bool> CursorVisibility => cursorVisibility;
|
||||||
|
|
||||||
private Bindable<ScreenshotFormat> screenshotFormat;
|
private Bindable<ScreenshotFormat> screenshotFormat;
|
||||||
|
private Bindable<int> screenshotJpegQuality;
|
||||||
private Bindable<bool> captureMenuCursor;
|
private Bindable<bool> captureMenuCursor;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
@ -51,6 +53,7 @@ namespace osu.Game.Graphics
|
|||||||
this.storage = storage.GetStorageForDirectory(@"screenshots");
|
this.storage = storage.GetStorageForDirectory(@"screenshots");
|
||||||
|
|
||||||
screenshotFormat = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat);
|
screenshotFormat = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat);
|
||||||
|
screenshotJpegQuality = config.GetBindable<int>(OsuSetting.ScreenshotJpegQuality);
|
||||||
captureMenuCursor = config.GetBindable<bool>(OsuSetting.ScreenshotCaptureMenuCursor);
|
captureMenuCursor = config.GetBindable<bool>(OsuSetting.ScreenshotCaptureMenuCursor);
|
||||||
|
|
||||||
shutter = audio.Samples.Get("UI/shutter");
|
shutter = audio.Samples.Get("UI/shutter");
|
||||||
@ -119,7 +122,7 @@ namespace osu.Game.Graphics
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ScreenshotFormat.Jpg:
|
case ScreenshotFormat.Jpg:
|
||||||
image.SaveAsJpeg(stream);
|
image.SaveAsJpeg(stream, new JpegEncoder { Quality = screenshotJpegQuality.Value });
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -31,6 +31,11 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
LabelText = "Screenshot format",
|
LabelText = "Screenshot format",
|
||||||
Bindable = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat)
|
Bindable = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat)
|
||||||
},
|
},
|
||||||
|
new SettingsSlider<int>
|
||||||
|
{
|
||||||
|
LabelText = "JPEG Screenshot quality",
|
||||||
|
Bindable = config.GetBindable<int>(OsuSetting.ScreenshotJpegQuality)
|
||||||
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Show menu cursor in screenshots",
|
LabelText = "Show menu cursor in screenshots",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user