/// <summary> /// Called when the background of the current map has been blurred. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void OnBackgroundBlurred(object sender, BackgroundBlurredEventArgs e) { if (e.Map != MapManager.Selected.Value && MapManager.GetBackgroundPath(e.Map) != MapManager.GetBackgroundPath(MapManager.Selected.Value)) { return; } BackgroundHelper.Background.Image = e.Texture; BackgroundHelper.FadeIn(); }
/// <summary> /// Makes sure that the background of the map is up-to-date. /// </summary> public void HandleBackgroundChange() { // If we've already got the background loaded up, then use it. if (BackgroundHelper.Map != null && MapManager.GetBackgroundPath(BackgroundHelper.Map) == MapManager.GetBackgroundPath(MapManager.Selected.Value)) { BackgroundHelper.Background.Image = BackgroundHelper.BlurredTexture; BackgroundHelper.FadeIn(0.5f); return; } // Otherwise queue a load on it. BackgroundHelper.Load(MapManager.Selected.Value); }