From 0e669c9a3fb81a292affc5202def3c3dd9688714 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 24 Mar 2018 18:22:55 +0900 Subject: [PATCH] Fix many warnings --- osu-framework | 2 +- osu.Game/Beatmaps/IBeatmapConverter.cs | 2 +- osu.Game/Database/DatabaseBackedStore.cs | 3 --- osu.Game/Database/DatabaseContextFactory.cs | 2 +- osu.Game/Graphics/DrawableDate.cs | 3 +-- osu.Game/Online/API/APIAccess.cs | 2 +- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 1 + osu.Game/Rulesets/Replays/Types/IConvertibleReplayFrame.cs | 1 - osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs | 1 - osu.Game/Screens/Select/BeatmapCarousel.cs | 1 + osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- osu.Game/Screens/Select/PlaySongSelect.cs | 4 +++- osu.Game/Skinning/SkinManager.cs | 2 -- osu.Game/Skinning/SkinReloadableDrawable.cs | 2 +- osu.Game/Skinning/SkinnableDrawable.cs | 2 +- osu.sln.DotSettings | 1 + 16 files changed, 14 insertions(+), 17 deletions(-) diff --git a/osu-framework b/osu-framework index 7eb292e9ec..ae633287dc 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 7eb292e9ec09a18a50c0619e34a4a06ae155b49b +Subproject commit ae633287dc44517f3f5fc66f1d0f5333f76cc261 diff --git a/osu.Game/Beatmaps/IBeatmapConverter.cs b/osu.Game/Beatmaps/IBeatmapConverter.cs index ebd900b97e..096ba345a1 100644 --- a/osu.Game/Beatmaps/IBeatmapConverter.cs +++ b/osu.Game/Beatmaps/IBeatmapConverter.cs @@ -19,7 +19,7 @@ namespace osu.Game.Beatmaps /// /// Converts a Beatmap using this Beatmap Converter. /// - /// The un-converted Beatmap. + /// The un-converted Beatmap. void Convert(Beatmap beatmap); } } diff --git a/osu.Game/Database/DatabaseBackedStore.cs b/osu.Game/Database/DatabaseBackedStore.cs index 0fafb77339..4b582bdfea 100644 --- a/osu.Game/Database/DatabaseBackedStore.cs +++ b/osu.Game/Database/DatabaseBackedStore.cs @@ -11,9 +11,6 @@ namespace osu.Game.Database { protected readonly Storage Storage; - /// - /// Create a new instance (separate from the shared context via for performing isolated operations. - /// protected readonly IDatabaseContextFactory ContextFactory; /// diff --git a/osu.Game/Database/DatabaseContextFactory.cs b/osu.Game/Database/DatabaseContextFactory.cs index 712ed2d0cc..06737e61eb 100644 --- a/osu.Game/Database/DatabaseContextFactory.cs +++ b/osu.Game/Database/DatabaseContextFactory.cs @@ -17,7 +17,7 @@ namespace osu.Game.Database private readonly object writeLock = new object(); private bool currentWriteDidWrite; - private volatile int currentWriteUsages; + private int currentWriteUsages; public DatabaseContextFactory(GameHost host) { diff --git a/osu.Game/Graphics/DrawableDate.cs b/osu.Game/Graphics/DrawableDate.cs index a912f989e0..d2a7250aaa 100644 --- a/osu.Game/Graphics/DrawableDate.cs +++ b/osu.Game/Graphics/DrawableDate.cs @@ -6,7 +6,6 @@ using Humanizer; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Cursor; -using osu.Framework.Threading; using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics @@ -14,7 +13,6 @@ namespace osu.Game.Graphics public class DrawableDate : OsuSpriteText, IHasTooltip { private readonly DateTimeOffset date; - private ScheduledDelegate updateTask; public DrawableDate(DateTimeOffset date) { @@ -61,6 +59,7 @@ namespace osu.Game.Graphics public override bool HandleMouseInput => true; private void updateTime() => Text = date.Humanize(); + public string TooltipText => date.ToString(); } } diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 957aeac3cd..798ed1b9b3 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -64,7 +64,7 @@ namespace osu.Game.Online.API private readonly List components = new List(); - internal void Schedule(Action action) => base.Schedule(action); + internal new void Schedule(Action action) => base.Schedule(action); public void Register(IOnlineComponent component) { diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 0f0c43bc88..ca203e1cdb 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -33,6 +33,7 @@ namespace osu.Game.Rulesets.Judgements /// Creates a drawable which visualises a . /// /// The judgement to visualise. + /// The object which was judged. public DrawableJudgement(Judgement judgement, DrawableHitObject judgedObject) { Judgement = judgement; diff --git a/osu.Game/Rulesets/Replays/Types/IConvertibleReplayFrame.cs b/osu.Game/Rulesets/Replays/Types/IConvertibleReplayFrame.cs index ac1e5e29ec..892f5ca2fe 100644 --- a/osu.Game/Rulesets/Replays/Types/IConvertibleReplayFrame.cs +++ b/osu.Game/Rulesets/Replays/Types/IConvertibleReplayFrame.cs @@ -15,7 +15,6 @@ namespace osu.Game.Rulesets.Replays.Types /// Populates this using values from a . /// /// The to extract values from. - /// The score. /// The beatmap. void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap); } diff --git a/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs b/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs index a7be3c1eb5..0b30aeef8d 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs @@ -24,7 +24,6 @@ namespace osu.Game.Screens.Edit.Screens.Compose public class BeatDivisorControl : CompositeDrawable { private readonly BindableBeatDivisor beatDivisor = new BindableBeatDivisor(); - private int currentDivisorIndex; public BeatDivisorControl(BindableBeatDivisor beatDivisor) { diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index aed8fb110f..15f4d5cf96 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -547,6 +547,7 @@ namespace osu.Game.Screens.Select float? setY = null; if (!d.IsLoaded || beatmap.Alpha == 0) // can't use IsPresent due to DrawableCarouselItem override. + // ReSharper disable once PossibleNullReferenceException (resharper broken?) setY = lastSet.Y + lastSet.DrawHeight + 5; if (d.IsLoaded) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 7476df4955..5cde0d2751 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -254,7 +254,7 @@ namespace osu.Game.Screens.Select private OsuSpriteText[] getMapper(BeatmapMetadata metadata) { - if (string.IsNullOrEmpty(metadata.Author?.Username)) + if (metadata.Author == null || string.IsNullOrEmpty(metadata.Author.Username)) return Array.Empty(); return new[] diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 09524d2eac..d5a91e1a6b 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using OpenTK.Input; using osu.Framework.Allocation; using osu.Framework.Audio; @@ -75,7 +76,8 @@ namespace osu.Game.Screens.Select { // if we have no beatmaps but osu-stable is found, let's prompt the user to import. if (!beatmaps.GetAllUsableBeatmapSets().Any() && beatmaps.StableInstallationAvailable) - dialogOverlay.Push(new ImportFromStablePopup(() => beatmaps.ImportFromStable())); + dialogOverlay.Push(new ImportFromStablePopup(() => + Task.Factory.StartNew(beatmaps.ImportFromStable, TaskCreationOptions.LongRunning))); }); } } diff --git a/osu.Game/Skinning/SkinManager.cs b/osu.Game/Skinning/SkinManager.cs index f965a77cce..24d7155b53 100644 --- a/osu.Game/Skinning/SkinManager.cs +++ b/osu.Game/Skinning/SkinManager.cs @@ -80,8 +80,6 @@ namespace osu.Game.Skinning return new LegacySkin(skinInfo, Files.Store, audio); } - private SkinStore store; - public SkinManager(Storage storage, DatabaseContextFactory contextFactory, IIpcHost importHost, AudioManager audio) : base(storage, contextFactory, new SkinStore(contextFactory, storage), importHost) { diff --git a/osu.Game/Skinning/SkinReloadableDrawable.cs b/osu.Game/Skinning/SkinReloadableDrawable.cs index 36f33e746a..5007a9d325 100644 --- a/osu.Game/Skinning/SkinReloadableDrawable.cs +++ b/osu.Game/Skinning/SkinReloadableDrawable.cs @@ -23,7 +23,7 @@ namespace osu.Game.Skinning /// /// Create a new /// - /// Whether fallback to default skin should be allowed if the custom skin is missing this resource. + /// A conditional to decide whether to allow fallback to the default implementation if a skinned element is not present. protected SkinReloadableDrawable(Func allowFallback = null) { this.allowFallback = allowFallback; diff --git a/osu.Game/Skinning/SkinnableDrawable.cs b/osu.Game/Skinning/SkinnableDrawable.cs index 09d2e6a3ed..7ed796d433 100644 --- a/osu.Game/Skinning/SkinnableDrawable.cs +++ b/osu.Game/Skinning/SkinnableDrawable.cs @@ -29,7 +29,7 @@ namespace osu.Game.Skinning /// /// The namespace-complete resource name for this skinnable element. /// A function to create the default skin implementation of this element. - /// Whther to fallback to the default implementation when a custom skin is specified but not implementation is present. + /// A conditional to decide whether to allow fallback to the default implementation if a skinned element is not present. /// Whether a user-skin drawable should be limited to the size of our parent. public SkinnableDrawable(string name, Func defaultImplementation, Func allowFallback = null, bool restrictSize = true) : base(allowFallback) { diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 3b62dbe579..0b631d008b 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -43,6 +43,7 @@ DO_NOT_SHOW WARNING WARNING + HINT ERROR HINT HINT