Example #1
0
        private void onModeChanged(ValueChangedEvent <EditorScreenMode> e)
        {
            var lastScreen = currentScreen;

            lastScreen?
            .ScaleTo(0.98f, 200, Easing.OutQuint)
            .FadeOut(200, Easing.OutQuint);

            try
            {
                if ((currentScreen = screenContainer.SingleOrDefault(s => s.Type == e.NewValue)) != null)
                {
                    screenContainer.ChangeChildDepth(currentScreen, lastScreen?.Depth + 1 ?? 0);

                    currentScreen
                    .ScaleTo(1, 200, Easing.OutQuint)
                    .FadeIn(200, Easing.OutQuint);
                    return;
                }

                switch (e.NewValue)
                {
                case EditorScreenMode.SongSetup:
                    currentScreen = new SetupScreen();
                    break;

                case EditorScreenMode.Compose:
                    currentScreen = new ComposeScreen();
                    break;

                case EditorScreenMode.Design:
                    currentScreen = new DesignScreen();
                    break;

                case EditorScreenMode.Timing:
                    currentScreen = new TimingScreen();
                    break;

                case EditorScreenMode.Verify:
                    currentScreen = new VerifyScreen();
                    break;

                default:
                    throw new InvalidOperationException("Editor menu bar switched to an unsupported mode");
                }

                LoadComponentAsync(currentScreen, newScreen =>
                {
                    if (newScreen == currentScreen)
                    {
                        screenContainer.Add(newScreen);
                    }
                });
            }
            finally
            {
                updateSampleDisabledState();
            }
        }
Example #2
0
        private void onModeChanged(ValueChangedEvent <EditorScreenMode> e)
        {
            var lastScreen = currentScreen;

            lastScreen?
            .ScaleTo(0.98f, 200, Easing.OutQuint)
            .FadeOut(200, Easing.OutQuint);

            if ((currentScreen = screenContainer.SingleOrDefault(s => s.Type == e.NewValue)) != null)
            {
                screenContainer.ChangeChildDepth(currentScreen, lastScreen?.Depth + 1 ?? 0);

                currentScreen
                .ScaleTo(1, 200, Easing.OutQuint)
                .FadeIn(200, Easing.OutQuint);
                return;
            }

            switch (e.NewValue)
            {
            case EditorScreenMode.SongSetup:
                currentScreen = new SetupScreen();
                break;

            case EditorScreenMode.Compose:
                currentScreen = new ComposeScreen();
                break;

            case EditorScreenMode.Design:
                currentScreen = new DesignScreen();
                break;

            case EditorScreenMode.Timing:
                currentScreen = new TimingScreen();
                break;
            }

            LoadComponentAsync(currentScreen, newScreen =>
            {
                if (newScreen == currentScreen)
                {
                    screenContainer.Add(newScreen);
                }
            });
        }