Exemple #1
0
        private void Load(AudioManager audio)
        {
            var audioPath = Path.Combine("TestTracks", "10-seconds-of-silence.mp3");
            var track     = S2VXTrack.Open(audioPath, audio);

            Add(new ScreenStack(Editor = new(new(), track)));
        }
Exemple #2
0
 private void LoadPlay()
 {
     try {
         var story = new S2VXStory(StoryPath, false);
         var track = S2VXTrack.Open(AudioPath, Audio);
         Screens.Push(new PlayScreen(false, story, track));
     } catch (Exception exception) {
         BtnPlay.BorderThickness = 5;
         Console.WriteLine(exception);
     }
 }
Exemple #3
0
        private void Load(AudioManager audio)
        {
            var storyPath = Path.Combine("VisualTests", "EditorScreenTests", "ValidStory.s2ry");

            Story = new S2VXStory();
            Story.Open(storyPath, true);
            var audioPath = Path.Combine("TestTracks", "10-seconds-of-silence.mp3");

            Track = S2VXTrack.Open(audioPath, audio);

            Add(new ScreenStack(Editor = new EditorScreen(Story, Track)));
        }
Exemple #4
0
        private void Load()
        {
            var audioPath = Path.Combine("TestTracks", "10-seconds-of-silence.mp3");

            Add(new ScreenStack(PlayScreen = new PlayScreen(false, Story, S2VXTrack.Open(audioPath, Audio))));
        }
Exemple #5
0
        private void Load()
        {
            var width             = Width;
            var songInfoHeight    = width * 0.4f;
            var leaderboardWidth  = width * 0.6f;
            var leaderboardHeight = width * 0.4f;
            var btnHeight         = width * 0.2f;
            var spacingMargin     = 0.05f;
            var textSize          = SizeConsts.TextSize1;
            var thumbnailSize     = width * 0.3f;
            var btnSize           = new Vector2(width / 5, width / 10);

            BtnEdit = new() {
                Origin       = Anchor.Centre,
                Anchor       = Anchor.Centre,
                Size         = btnSize,
                Icon         = FontAwesome.Solid.Edit,
                BorderColour = Color4.Red,
                Masking      = true,
                Action       = LoadEditor
            };
            BtnPlay = new() {
                Origin       = Anchor.Centre,
                Anchor       = Anchor.Centre,
                Size         = btnSize,
                Icon         = FontAwesome.Solid.Play,
                BorderColour = Color4.Red,
                Masking      = true,
                Action       = LoadPlay
            };

            InternalChildren = new Drawable[] {
                // TODO: add blurred background
                new FillFlowContainer {
                    Width    = width,
                    Height   = songInfoHeight,
                    Children = new Drawable[] {
                        // Thumbnail
                        new IconButton {
                            Size   = new Vector2(thumbnailSize),
                            Anchor = Anchor.TopLeft,
                            Origin = Anchor.TopLeft,
                            Margin = new MarginPadding {
                                Horizontal = width * spacingMargin,
                                Vertical   = width * spacingMargin,
                            },
                            Texture     = ThumbnailTexture,
                            TextureName = "logo",
                        },
                        TextContainer = new TextFlowContainer(s => s.Font = new FontUsage("default", textSize))
                        {
                            Width  = width - thumbnailSize - width * spacingMargin * 2,
                            Height = songInfoHeight,
                            Margin = new MarginPadding {
                                Vertical = width * spacingMargin,
                            },
                            TextAnchor = Anchor.TopLeft,
                            Colour     = Color4.White,
                            // TODO: truncate text if it's too long
                        },
                    }
                },
                LeaderboardContainer = new LeaderboardContainer(StoryDirectory)
                {
                    Width  = leaderboardWidth,
                    Height = leaderboardHeight,
                    Y      = songInfoHeight,
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre,
                },
                new FillFlowContainer {
                    Width     = width,
                    Height    = btnHeight,
                    Y         = songInfoHeight + leaderboardHeight,
                    Anchor    = Anchor.TopCentre,
                    Origin    = Anchor.TopCentre,
                    Direction = FillDirection.Horizontal,
                    Children  = new[] {
                        BtnEdit,
                        BtnPlay,
                    }
                }
            };

            LoadSongMetadata();
        }

        private void LoadEditor()
        {
            try {
                var story = new S2VXStory(StoryPath, true);
                var track = S2VXTrack.Open(AudioPath, Audio);
                Screens.Push(new EditorScreen(story, track));
            } catch (Exception exception) {
                BtnEdit.BorderThickness = 5;
                Console.WriteLine(exception);
            }
        }