protected override void OnEntering(Screen last) { OsuScreen lastOsu = last as OsuScreen; BackgroundScreen bg = CreateBackground(); if (lastOsu?.Background != null) { if (bg == null || lastOsu.Background.Equals(bg)) { //we can keep the previous mode's background. Background = lastOsu.Background; } else { lastOsu.Background.Push(Background = bg); } } else if (bg != null) { // this makes up for the fact our padding changes when the global toolbar is visible. bg.Scale = new Vector2(1.06f); AddInternal(new ParallaxContainer { Depth = float.MaxValue, Children = new[] { Background = bg } }); } base.OnEntering(last); }
protected override void OnEntering(Screen last) { OsuScreen lastOsu = last as OsuScreen; BackgroundScreen bg = CreateBackground(); OnBeatmapChanged(Beatmap); if (lastOsu?.Background != null) { if (bg == null || lastOsu.Background.Equals(bg)) { //we can keep the previous mode's background. Background = lastOsu.Background; } else { lastOsu.Background.Push(Background = bg); } } else if (bg != null) { AddInternal(new ParallaxContainer { Depth = float.MaxValue, Children = new[] { Background = bg } }); } base.OnEntering(last); }
public override void OnEntering(IScreen last) { applyArrivingDefaults(false); backgroundStack?.Push(localBackground = CreateBackground()); base.OnEntering(last); }
//public float ParallaxAmount { set => parallax.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * value; } public void Push(BackgroundScreen screen) { if (screen == null) { return; } if (EqualityComparer <BackgroundScreen> .Default.Equals((BackgroundScreen)CurrentScreen, screen)) { return; } base.Push(screen); }
public bool Push(BackgroundScreen screen) { if (screen == null) { return(false); } if (EqualityComparer <BackgroundScreen> .Default.Equals((BackgroundScreen)CurrentScreen, screen)) { return(false); } base.Push(screen); return(true); }
protected override void OnEntering(Screen last) { OsuScreen lastOsu = last as OsuScreen; BackgroundScreen bg = CreateBackground(); if (lastOsu?.Background != null) { backgroundParallaxContainer = lastOsu.backgroundParallaxContainer; if (bg == null || lastOsu.Background.Equals(bg)) { //we can keep the previous mode's background. Background = lastOsu.Background; } else { lastOsu.Background.Push(Background = bg); } } else if (bg != null) { // this makes up for the fact our padding changes when the global toolbar is visible. bg.Scale = new Vector2(1.06f); AddInternal(backgroundParallaxContainer = new ParallaxContainer { Depth = float.MaxValue, Children = new[] { Background = bg } }); } if ((logo = lastOsu?.logo) == null) { LoadComponentAsync(logo = new OsuLogo { Alpha = 0 }, AddInternal); } applyArrivingDefaults(false); base.OnEntering(last); }
public override void OnEntering(IScreen last) { applyArrivingDefaults(false); backgroundStack?.Push(ownedBackground = CreateBackground()); background = backgroundStack?.CurrentScreen as BackgroundScreen; if (background != ownedBackground) { // background may have not been replaced, at which point we don't want to track the background lifetime. ownedBackground?.Dispose(); ownedBackground = null; } base.OnEntering(last); }
public override void OnEntering(IScreen last) { applyArrivingDefaults(false); if (AllowTrackAdjustments != null) { musicController.AllowTrackAdjustments = AllowTrackAdjustments.Value; } if (backgroundStack?.Push(ownedBackground = CreateBackground()) != true) { // If the constructed instance was not actually pushed to the background stack, we don't want to track it unnecessarily. ownedBackground?.Dispose(); ownedBackground = null; } background = backgroundStack?.CurrentScreen as BackgroundScreen; base.OnEntering(last); }
protected override void OnEntering(Screen last) { OsuScreen lastOsu = last as OsuScreen; BackgroundScreen bg = CreateBackground(); if (lastOsu?.Background != null) { if (bg == null || lastOsu.Background.Equals(bg)) //we can keep the previous mode's background. Background = lastOsu.Background; else { lastOsu.Background.Push(Background = bg); } } else if (bg != null) { // this makes up for the fact our padding changes when the global toolbar is visible. bg.Scale = new Vector2(1.06f); AddInternal(new ParallaxContainer { Depth = float.MaxValue, Children = new[] { Background = bg } }); } if ((logo = lastOsu?.logo) == null) LoadComponentAsync(logo = new OsuLogo { Alpha = 0 }, AddInternal); logo.AppendAnimatingAction(() => LogoArriving(logo, false), true); base.OnEntering(last); ShowOverlays.Value = ShowOverlaysOnEnter; }