Example #1
0
        protected override bool OnExiting(Screen next)
        {
            if (ValidForResume && logo != null)
            {
                onExitingLogo();
            }

            OsuScreen nextOsu = next as OsuScreen;

            if (Background != null && !Background.Equals(nextOsu?.Background))
            {
                if (nextOsu != null)
                {
                    //We need to use MakeCurrent in case we are jumping up multiple game screens.
                    nextOsu.Background?.MakeCurrent();
                }
                else
                {
                    Background.Exit();
                }
            }

            if (base.OnExiting(next))
            {
                return(true);
            }

            Beatmap.UnbindAll();
            return(false);
        }
Example #2
0
        protected override void OnEntering(Screen last)
        {
            base.OnEntering(last);

            LoadComponentAsync(precompiler = new ShaderPrecompiler(loadIfReady), Add);
            LoadComponentAsync(loadScreen  = showDisclaimer ? (OsuScreen) new Disclaimer() : new Intro(), s => loadIfReady());
        }
Example #3
0
        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);
        }
Example #4
0
        protected override bool OnExiting(Screen next)
        {
            OsuScreen nextOsu = next as OsuScreen;

            if (Background != null && !Background.Equals(nextOsu?.Background))
            {
                if (nextOsu != null)
                {
                    //We need to use MakeCurrent in case we are jumping up multiple game screens.
                    nextOsu.Background?.MakeCurrent();
                }
                else
                {
                    Background.Exit();
                }
            }

            if (base.OnExiting(next))
            {
                return(true);
            }

            // while this is not necessary as we are constructing our own bindable, there are cases where
            // the GC doesn't run as fast as expected and this is triggered post-exit.
            // added to resolve https://github.com/ppy/osu/issues/829
            beatmap.ValueChanged -= OnBeatmapChanged;

            return(false);
        }
Example #5
0
        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);
        }
Example #6
0
        public override void OnEntering(ScreenTransitionEvent e)
        {
            base.OnEntering(e);

            LoadComponentAsync(precompiler = CreateShaderPrecompiler(), AddInternal);

            // A non-null context factory means there's still content to migrate.
            if (efContextFactory != null)
            {
                LoadComponentAsync(realmMigrator = new EFToRealmMigrator(), AddInternal);
                realmMigrator.MigrationCompleted.ContinueWith(_ => Schedule(() =>
                {
                    // Delay initial screen loading to ensure that the migration is in a complete and sane state
                    // before the intro screen may import the game intro beatmap.
                    LoadComponentAsync(loadableScreen = CreateLoadableScreen());
                }));
            }
            else
            {
                LoadComponentAsync(loadableScreen = CreateLoadableScreen());
            }

            LoadComponentAsync(spinner = new LoadingSpinner(true, true)
            {
                Anchor = Anchor.BottomRight,
                Origin = Anchor.BottomRight,
                Margin = new MarginPadding(40),
            }, _ =>
            {
                AddInternal(spinner);
                spinnerShow = Scheduler.AddDelayed(spinner.Show, 200);
            });

            checkIfLoaded();
        }
Example #7
0
        public override void OnEntering(IScreen last)
        {
            base.OnEntering(last);

            LoadComponentAsync(precompiler    = CreateShaderPrecompiler(), AddInternal);
            LoadComponentAsync(loadableScreen = CreateLoadableScreen());

            checkIfLoaded();
        }
Example #8
0
        public override bool Push(Screen screen)
        {
            OsuScreen nextOsu = screen as OsuScreen;

            if (nextOsu != null)
            {
                nextOsu.beatmap = beatmap;
            }

            return(base.Push(screen));
        }
Example #9
0
        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);
        }
Example #10
0
        protected override bool OnExiting(Screen next)
        {
            OsuScreen nextOsu = next as OsuScreen;

            if (Background != null && !Background.Equals(nextOsu?.Background))
            {
                if (nextOsu != null)
                {
                    //We need to use MakeCurrent in case we are jumping up multiple game screens.
                    nextOsu.Background?.MakeCurrent();
                }
                else
                {
                    Background.Exit();
                }
            }

            return(base.OnExiting(next));
        }
Example #11
0
        public override void OnEntering(IScreen last)
        {
            base.OnEntering(last);

            LoadComponentAsync(precompiler    = CreateShaderPrecompiler(), AddInternal);
            LoadComponentAsync(loadableScreen = CreateLoadableScreen());

            LoadComponentAsync(spinner = new LoadingSpinner(true, true)
            {
                Anchor = Anchor.BottomRight,
                Origin = Anchor.BottomRight,
                Margin = new MarginPadding(40),
            }, _ =>
            {
                AddInternal(spinner);
                spinnerShow = Scheduler.AddDelayed(spinner.Show, 200);
            });

            checkIfLoaded();
        }
Example #12
0
        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;
        }
Example #13
0
        public void PushSynchronously(OsuScreen screen)
        {
            LoadComponent(screen);

            Push(screen);
        }