<commit_before>﻿//Copyright (c) 2007-2016 ppy Pty Ltd <<EMAIL>>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using System;
using System.Collections.Generic;
using osu.Framework.GameModes;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Drawables;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Containers;
using OpenTK;
using OpenTK.Graphics;

namespace osu.Game.GameModes
{
    public class GameModeWhiteBox : OsuGameMode
    {
        private Button popButton;

        const int transition_time = 1000;

        protected virtual IEnumerable<Type> PossibleChildren => null;

        private FlowContainer childModeButtons;

        protected override double OnEntering(GameMode last)
        {
            //only show the pop button if we are entered form another gamemode.
            if (last != null)
                popButton.Alpha = 1;

            MoveTo(new Vector2(ActualSize.X, 0));
            MoveTo(Vector2.Zero, transition_time, EasingTypes.OutQuint);
            return transition_time;
        }

        protected override double OnExiting(GameMode next)
        {
            MoveTo(new Vector2(ActualSize.X, 0), transition_time, EasingTypes.OutQuint);
            return transition_time;
        }

        protected override double OnSuspending(GameMode next)
        {
            Content.MoveTo(new Vector2(-ActualSize.X, 0), transition_time, EasingTypes.OutQuint);
            return transition_time;
        }

        protected override double OnResuming(GameMode last)
        {
            Content.MoveTo(Vector2.Zero, transition_time, EasingTypes.OutQuint);
            return transition_time;
        }

        public override void Load()
        {
            base.Load();

            Children = new Drawable[]
            {
                    new Box
                    {
                        SizeMode = InheritMode.XY,
                        Size = new Vector2(1),
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Colour = getColourFor(GetType())
                    },
                    new SpriteText
                    {
                        Text = GetType().Name,
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        TextSize = 50,
                    },
                    new SpriteText
                    {
                        Text = GetType().Namespace,
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Position = new Vector2(0, 30)
                    },
                    popButton = new Button
                    {
                        Text = @"Back",
                        SizeMode = InheritMode.X,
                        Size = new Vector2(0.1f, 40),
                        Anchor = Anchor.BottomLeft,
                        Origin = Anchor.BottomLeft,
                        Colour = new Color4(235, 51, 153, 255),
                        Alpha = 0,
                        Action = delegate {
                            Exit();
                        }
                    },
                    childModeButtons = new FlowContainer
                    {
                        Direction = FlowDirection.VerticalOnly,
                        Anchor = Anchor.TopRight,
                        Origin = Anchor.TopRight,
                        SizeMode = InheritMode.XY,
                        Size = new Vector2(0.1f, 1)<commit_msg>Improve the transition and look of white-boxed game modes.<commit_after>﻿//Copyright (c) 2007-2016 ppy Pty Ltd <<EMAIL>>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using System;
using System.Collections.Generic;
using osu.Framework.GameModes;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Drawables;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Containers;
using OpenTK;
using OpenTK.Graphics;

namespace osu.Game.GameModes
{
    public class GameModeWhiteBox : OsuGameMode
    {
        private Button popButton;

        const int transition_time = 1000;

        protected virtual IEnumerable<Type> PossibleChildren => null;

        private FlowContainer childModeButtons;
        private Container textContainer;

        protected override double OnEntering(GameMode last)
        {
            //only show the pop button if we are entered form another gamemode.
            if (last != null)
                popButton.Alpha = 1;

            Content.Alpha = 0;
            textContainer.Position = new Vector2(ActualSize.X / 16, 0);

            Content.Delay(300);
            textContainer.MoveTo(Vector2.Zero, transition_time, EasingTypes.OutExpo);
            Content.FadeIn(transition_time, EasingTypes.OutExpo);
            return 0;// transition_time * 1000;
        }

        protected override double OnExiting(GameMode next)
        {
            textContainer.MoveTo(new Vector2((ActualSize.X / 16), 0), transition_time, EasingTypes.OutExpo);
            Content.FadeOut(transition_time, EasingTypes.OutExpo);
            return transition_time;
        }

        protected override double OnSuspending(GameMode next)
        {
            textContainer.MoveTo(new Vector2(-(ActualSize.X / 16), 0), transition_time, EasingTypes.OutExpo);
            Content.FadeOut(transition_time, EasingTypes.OutExpo);
            return transition_time;
        }

        protected override double OnResuming(GameMode last)
        {
            textContainer.MoveTo(Vector2.Zero, transition_time, EasingTypes.OutExpo);
            Content.FadeIn(transition_time, EasingTypes.OutExpo);
            return transition_time;
        }

        public override void Load()
        {
            base.Load();

            Children = new Drawable[]
            {
                    new Box
                    {
                        SizeMode = InheritMode.XY,
                        Size = new Vector2(0.7f),
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Colour = getColourFor(GetType()),
                        Alpha = 0.6f,
                        Additive = true
                    },
                    textContainer = new AutoSizeContainer
                    {
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Children = new[]
                        {
                            new SpriteText
                            {
                                Text = GetType().Name,
                                Anchor = Anchor.Centre,
                                Origin = Anchor.Centre,
                                TextSize = 50,
                            },
                            new SpriteText
                            {
                                Text = GetType().Namespace,
                                Anchor = Anchor.Centre,
                                Origin = Anchor.Centre,
                                Position = new Vector2(0, 30)
                            },
                        }
                    },
                    popButton = new Button
                    {
                        Text = @"Back",
                        SizeMode = InheritMode.X,
                        Size = new Vector2(0.1f, 40),
                        Anchor = Anchor.BottomLeft,
                        Origin = Anchor.BottomLeft,
                        Colour = new Color4(235, 51, 153, 255),
                        Alpha = 0,
                        Action = delegate {
                            Exit();
                        }
                    },
                    childModeButtons = new FlowContainer
                    {
                        Direction = FlowDirection.VerticalOnly,
                        Anchor = Anchor.TopRight,
                        Origin = Anchor.TopRight,
                        SizeMode = InheritMode.XY,
                        Size = new Vector2(0.1f, 1)
{'fraction_non_alphanumeric': 0.07315340909090909, 'fraction_numerical': 0.014204545454545454, 'mean_word_length': 1.2286995515695067, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6598406', 'n_tokens_mistral': 2179, 'n_tokens_neox': 1963, 'n_words': 452}