1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 23:12:56 +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.Input.Events;
using osu.Framework.Localisation;
using osu.Framework.Platform;
using osu.Game.Database;
using osu.Game.Extensions;
using osu.Game.Graphics;
@ -67,16 +66,13 @@ namespace osu.Game.Online.Leaderboards
private List<ScoreComponentLabel> statisticsLabels;
[Resolved(CanBeNull = true)]
[Resolved(canBeNull: true)]
private IDialogOverlay dialogOverlay { get; set; }
[Resolved(CanBeNull = true)]
[Resolved(canBeNull: true)]
private SongSelect songSelect { get; set; }
[Resolved]
private Storage storage { get; set; }
[Resolved]
[Resolved(canBeNull: true)]
private LegacyExportManager exporter { get; set; }
public ITooltip<ScoreInfo> GetCustomTooltip() => new LeaderboardScoreTooltip();
@ -431,7 +427,7 @@ namespace osu.Game.Online.Leaderboards
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))));
}

View File

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

View File

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