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

impossible null and remove storage

This commit is contained in:
cdwcgt 2022-11-19 01:03:09 +09:00
parent fc4a6cb125
commit 4e457871f3
No known key found for this signature in database
GPG Key ID: 144396D01095C3A2
3 changed files with 8 additions and 20 deletions

View File

@ -18,7 +18,6 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Framework.Platform;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -67,16 +66,13 @@ namespace osu.Game.Online.Leaderboards
private List<ScoreComponentLabel> statisticsLabels; private List<ScoreComponentLabel> statisticsLabels;
[Resolved(CanBeNull = true)] [Resolved(canBeNull: true)]
private IDialogOverlay dialogOverlay { get; set; } private IDialogOverlay dialogOverlay { get; set; }
[Resolved(CanBeNull = true)] [Resolved(canBeNull: true)]
private SongSelect songSelect { get; set; } private SongSelect songSelect { get; set; }
[Resolved] [Resolved(canBeNull: true)]
private Storage storage { get; set; }
[Resolved]
private LegacyExportManager exporter { get; set; } private LegacyExportManager exporter { get; set; }
public ITooltip<ScoreInfo> GetCustomTooltip() => new LeaderboardScoreTooltip(); public ITooltip<ScoreInfo> GetCustomTooltip() => new LeaderboardScoreTooltip();
@ -431,7 +427,7 @@ namespace osu.Game.Online.Leaderboards
if (Score.Files.Count > 0) if (Score.Files.Count > 0)
{ {
items.Add(new OsuMenuItem("Export", MenuItemType.Standard, () => Task.Run(() => exporter.ExportAsync(Score)))); items.Add(new OsuMenuItem("Export", MenuItemType.Standard, () => Task.Run(() => exporter?.ExportAsync(Score))));
items.Add(new OsuMenuItem(CommonStrings.ButtonsDelete, MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(Score)))); items.Add(new OsuMenuItem(CommonStrings.ButtonsDelete, MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(Score))));
} }

View File

@ -13,7 +13,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation; using osu.Game.Localisation;
@ -138,10 +137,7 @@ namespace osu.Game.Overlays.Settings.Sections
[Resolved] [Resolved]
private SkinManager skins { get; set; } private SkinManager skins { get; set; }
[Resolved] [Resolved(canBeNull: true)]
private Storage storage { get; set; }
[Resolved]
private LegacyExportManager exporter { get; set; } private LegacyExportManager exporter { get; set; }
private Bindable<Skin> currentSkin; private Bindable<Skin> currentSkin;
@ -165,7 +161,7 @@ namespace osu.Game.Overlays.Settings.Sections
{ {
try try
{ {
currentSkin.Value.SkinInfo.PerformRead(s => exporter.ExportAsync(s)); currentSkin.Value.SkinInfo.PerformRead(s => exporter?.ExportAsync(s));
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -21,7 +21,6 @@ using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Framework.Threading; using osu.Framework.Threading;
@ -91,9 +90,6 @@ namespace osu.Game.Screens.Edit
[Resolved] [Resolved]
private RulesetStore rulesets { get; set; } private RulesetStore rulesets { get; set; }
[Resolved]
private Storage storage { get; set; }
[Resolved(canBeNull: true)] [Resolved(canBeNull: true)]
private IDialogOverlay dialogOverlay { get; set; } private IDialogOverlay dialogOverlay { get; set; }
@ -183,7 +179,7 @@ namespace osu.Game.Screens.Edit
private Bindable<float> editorBackgroundDim; private Bindable<float> editorBackgroundDim;
private Bindable<bool> editorHitMarkers; private Bindable<bool> editorHitMarkers;
[Resolved] [Resolved(canBeNull: true)]
private LegacyExportManager exporter { get; set; } private LegacyExportManager exporter { get; set; }
public Editor(EditorLoader loader = null) public Editor(EditorLoader loader = null)
@ -942,7 +938,7 @@ namespace osu.Game.Screens.Edit
private void exportBeatmap() private void exportBeatmap()
{ {
Save(); Save();
Task.Run(() => exporter.ExportAsync(Beatmap.Value.BeatmapSetInfo)); Task.Run(() => exporter?.ExportAsync(Beatmap.Value.BeatmapSetInfo));
} }
/// <summary> /// <summary>