1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-14 05:47:20 +08:00

Merge pull request #20702 from peppy/update-prefer-no-video

Fix beatmap update button not respecting user "prefer no video" setting
This commit is contained in:
Dan Balasescu 2022-10-11 19:36:14 +09:00 committed by GitHub
commit cc0ca470f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -45,7 +45,7 @@ namespace osu.Game.Database
public bool Download(T model, bool minimiseDownloadSize = false) => Download(model, minimiseDownloadSize, null);
public void DownloadAsUpdate(TModel originalModel) => Download(originalModel, false, originalModel);
public void DownloadAsUpdate(TModel originalModel, bool minimiseDownloadSize) => Download(originalModel, minimiseDownloadSize, originalModel);
protected bool Download(T model, bool minimiseDownloadSize, TModel? originalModel)
{

View File

@ -2,12 +2,14 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
@ -43,11 +45,15 @@ namespace osu.Game.Screens.Select.Carousel
Origin = Anchor.CentreLeft;
}
private Bindable<bool> preferNoVideo = null!;
[BackgroundDependencyLoader]
private void load()
private void load(OsuConfigManager config)
{
const float icon_size = 14;
preferNoVideo = config.GetBindable<bool>(OsuSetting.PreferNoVideo);
Content.Anchor = Anchor.CentreLeft;
Content.Origin = Anchor.CentreLeft;
@ -104,7 +110,7 @@ namespace osu.Game.Screens.Select.Carousel
return;
}
beatmapDownloader.DownloadAsUpdate(beatmapSetInfo);
beatmapDownloader.DownloadAsUpdate(beatmapSetInfo, preferNoVideo.Value);
attachExistingDownload();
};
}