From b3e3c4a2260f9fd9eae36848701c0d7f728fe0c9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Jul 2017 16:53:37 +0900 Subject: [PATCH] Fix setting a ProgressNotification's progress too early crashing --- .../Notifications/ProgressNotification.cs | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index aa65f09ece..43a0a5f7a3 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -166,7 +166,7 @@ namespace osu.Game.Overlays.Notifications private class ProgressBar : Container { - private Box box; + private readonly Box box; private Color4 colourActive; private Color4 colourInactive; @@ -196,15 +196,8 @@ namespace osu.Game.Overlays.Notifications } } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) + public ProgressBar() { - colourActive = colours.Blue; - Colour = colourInactive = OsuColour.Gray(0.5f); - - Height = 5; - Children = new[] { box = new Box @@ -214,6 +207,15 @@ namespace osu.Game.Overlays.Notifications } }; } + + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + colourActive = colours.Blue; + Colour = colourInactive = OsuColour.Gray(0.5f); + Height = 5; + } } }