Example #1
0
        public ParticipantsDisplay(Direction direction)
        {
            OsuScrollContainer scroll;
            ParticipantsList   list;

            AddInternal(scroll = new OsuScrollContainer(direction)
            {
                Child = list = new ParticipantsList()
            });

            switch (direction)
            {
            case Direction.Horizontal:
                AutoSizeAxes     = Axes.Y;
                RelativeSizeAxes = Axes.X;

                scroll.RelativeSizeAxes = Axes.X;
                scroll.Height           = ParticipantsList.TILE_SIZE + OsuScrollContainer.SCROLL_BAR_HEIGHT + OsuScrollContainer.SCROLL_BAR_PADDING * 2;

                list.RelativeSizeAxes = Axes.Y;
                list.AutoSizeAxes     = Axes.X;
                break;

            case Direction.Vertical:
                RelativeSizeAxes = Axes.Both;

                scroll.RelativeSizeAxes = Axes.Both;

                list.RelativeSizeAxes = Axes.X;
                list.AutoSizeAxes     = Axes.Y;
                break;
            }
        }
Example #2
0
            public LyricPreview(IEnumerable <LyricLine> lyrics)
            {
                RelativeSizeAxes = Axes.X;
                Child            = new OsuScrollContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = lyricTable = new FillFlowContainer <ClickableLyric>
                    {
                        AutoSizeAxes     = Axes.Y,
                        RelativeSizeAxes = Axes.X,
                        Direction        = FillDirection.Vertical,
                        Spacing          = new Vector2(15),
                        Children         = lyrics.Select(x => new ClickableLyric(x)
                        {
                            Selected = false,
                            Action   = () => triggerLyricLine(x)
                        }).ToList()
                    }
                };

                selectedLyricLine.BindValueChanged(value =>
                {
                    var oldValue = value.OldValue;
                    if (oldValue != null)
                    {
                        lyricTable.Where(x => x.HitObject == oldValue).ForEach(x => { x.Selected = false; });
                    }

                    var newValue = value.NewValue;
                    if (newValue != null)
                    {
                        lyricTable.Where(x => x.HitObject == newValue).ForEach(x => { x.Selected = true; });
                    }
                });
            }
Example #3
0
        public LyricPreview(IEnumerable <Lyric> lyrics)
        {
            InternalChild = new OsuScrollContainer
            {
                RelativeSizeAxes = Axes.Both,
                Child            = lyricTable = new FillFlowContainer <ClickableLyric>
                {
                    AutoSizeAxes     = Axes.Y,
                    RelativeSizeAxes = Axes.X,
                    Direction        = FillDirection.Vertical,
                    Children         = lyrics.Select(x => CreateLyricContainer(x).With(c =>
                    {
                        c.Selected = false;
                        c.Action   = () => triggerLyric(x);
                    })).ToList()
                }
            };

            SelectedLyric.BindValueChanged(value =>
            {
                var oldValue = value.OldValue;
                if (oldValue != null)
                {
                    lyricTable.Where(x => x.HitObject == oldValue).ForEach(x => { x.Selected = false; });
                }

                var newValue = value.NewValue;
                if (newValue != null)
                {
                    lyricTable.Where(x => x.HitObject == newValue).ForEach(x => { x.Selected = true; });
                }
            });
        }
Example #4
0
        private void load()
        {
            Child = new OsuContextMenuContainer
            {
                RelativeSizeAxes = Axes.Both,
                Masking          = true,
                Child            = scroll = new OsuScrollContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    // Some chat lines have effects that slightly protrude to the bottom,
                    // which we do not want to mask away, hence the padding.
                    Padding = new MarginPadding {
                        Bottom = 5
                    },
                    Child = ChatLineFlow = new ChatLineContainer
                    {
                        Padding = new MarginPadding {
                            Left = 20, Right = 20
                        },
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Direction        = FillDirection.Vertical,
                    }
                },
            };

            newMessagesArrived(Channel.Messages);

            Channel.NewMessagesArrived     += newMessagesArrived;
            Channel.MessageRemoved         += messageRemoved;
            Channel.PendingMessageResolved += pendingMessageResolved;
        }
Example #5
0
        private void load(OverlayColourProvider colourProvider)
        {
            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = colourProvider.Background6,
                },
                scroll = new OsuScrollContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    ScrollbarAnchor  = Anchor.TopRight,
                    ScrollDistance   = 35f,
                    Child            = groupFlow = new FillFlowContainer
                    {
                        Direction        = FillDirection.Vertical,
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Children         = new Drawable[]
                        {
                            announceChannelGroup = new ChannelGroup(ChatStrings.ChannelsListTitleANNOUNCE.ToUpper()),
                            publicChannelGroup   = new ChannelGroup(ChatStrings.ChannelsListTitlePUBLIC.ToUpper()),
                            selector             = new ChannelListItem(ChannelListingChannel),
                            privateChannelGroup  = new ChannelGroup(ChatStrings.ChannelsListTitlePM.ToUpper()),
                        },
                    },
                },
            };

            selector.OnRequestSelect += chan => OnRequestSelect?.Invoke(chan);
        }
        public void TestUnloadAndReload()
        {
            var backgrounds = new List <TestUpdateableBeatmapBackgroundSprite>();
            OsuScrollContainer scrollContainer = null;

            AddStep("create backgrounds hierarchy", () =>
            {
                FillFlowContainer backgroundFlow;

                Child = scrollContainer = new OsuScrollContainer
                {
                    Size  = new Vector2(500),
                    Child = backgroundFlow = new FillFlowContainer
                    {
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Direction        = FillDirection.Vertical,
                        Spacing          = new Vector2(10),
                        Padding          = new MarginPadding {
                            Bottom = 550
                        }
                    }
                };

                for (int i = 0; i < 25; i++)
                {
                    var background = new TestUpdateableBeatmapBackgroundSprite {
                        RelativeSizeAxes = Axes.Both
                    };

                    if (i % 2 == 0)
                    {
                        background.Beatmap.Value = testBeatmap.Beatmaps.First();
                    }

                    backgroundFlow.Add(new Container
                    {
                        RelativeSizeAxes = Axes.X,
                        Height           = 100,
                        Masking          = true,
                        Child            = background
                    });

                    backgrounds.Add(background);
                }
            });

            var loadedBackgrounds = backgrounds.Where(b => b.ContentLoaded);

            AddUntilStep("some loaded", () => loadedBackgrounds.Any());
            AddStep("scroll to bottom", () => scrollContainer.ScrollToEnd());
            AddUntilStep("all unloaded", () => !loadedBackgrounds.Any());
        }
Example #7
0
 public LyricPreviewArea()
 {
     Child = new OsuScrollContainer(Direction.Horizontal)
     {
         RelativeSizeAxes = Axes.Both,
         Child            = container = new Container
         {
             RelativeSizeAxes = Axes.Y,
             AutoSizeAxes     = Axes.X,
             Padding          = new MarginPadding(30),
         }
     };
 }
Example #8
0
 public ParticipantsList()
 {
     InternalChild = new OsuScrollContainer
     {
         RelativeSizeAxes = Axes.Both,
         Child            = fill = new FillFlowContainer
         {
             Spacing          = new Vector2(10),
             RelativeSizeAxes = Axes.X,
             AutoSizeAxes     = Axes.Y,
             Direction        = FillDirection.Full,
         }
     };
 }
Example #9
0
 public ScrollingToolboxGroup(string title, float scrollAreaHeight)
     : base(title)
 {
     base.Content.Add(Scroll = new OsuScrollContainer
     {
         RelativeSizeAxes = Axes.X,
         Height           = scrollAreaHeight,
         Child            = Content = FillFlow = new FillFlowContainer
         {
             RelativeSizeAxes = Axes.X,
             AutoSizeAxes     = Axes.Y,
             Direction        = FillDirection.Vertical,
         },
     });
 }
Example #10
0
        public BeatmapSetOverlay()
            : base(OverlayColourScheme.Blue)
        {
            OsuScrollContainer scroll;
            Info info;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.Gray(0.2f)
                },
                scroll = new OsuScrollContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    ScrollbarVisible = false,
                    Child            = new ReverseChildIDFillFlowContainer <Drawable>
                    {
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Direction        = FillDirection.Vertical,
                        Children         = new Drawable[]
                        {
                            Header = new Header(),
                            info   = new Info(),
                            new ScoresContainer
                            {
                                Beatmap = { BindTarget = Header.Picker.Beatmap }
                            }
                        },
                    },
                },
            };

            Header.BeatmapSet.BindTo(beatmapSet);
            info.BeatmapSet.BindTo(beatmapSet);

            Header.Picker.Beatmap.ValueChanged += b =>
            {
                info.Beatmap = b.NewValue;

                scroll.ScrollToStart();
            };
        }
Example #11
0
            public MatchParticipants()
            {
                Padding = new MarginPadding {
                    Horizontal = 10
                };

                InternalChild = new OsuScrollContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = fill = new FillFlowContainer
                    {
                        Spacing          = new Vector2(10),
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Direction        = FillDirection.Full,
                    }
                };
            }
Example #12
0
        public void TestScrollInput()
        {
            OsuScrollContainer scroll = null;

            AddStep("add scroll layer", () => Add(scroll = new OsuScrollContainer
            {
                Depth            = 1f,
                RelativeSizeAxes = Axes.Both,
                Child            = new Box
                {
                    RelativeSizeAxes = Axes.X,
                    Height           = DrawHeight * 2,
                    Colour           = ColourInfo.GradientVertical(Color4.Gray, Color4.DarkGray),
                }
            }));

            AddStep("hover toolbar", () => InputManager.MoveMouseTo(toolbar));
            AddStep("perform scroll", () => InputManager.ScrollVerticalBy(500));
            AddAssert("not scrolled", () => scroll.Current == 0);
        }
Example #13
0
        public BeatmapSetOverlay()
        {
            Info            info;
            ScoresContainer scores;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.Gray(0.2f)
                },
                scroll = new OsuScrollContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    ScrollbarVisible = false,
                    Child            = new ReverseChildIDFillFlowContainer <Drawable>
                    {
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Direction        = FillDirection.Vertical,
                        Children         = new Drawable[]
                        {
                            header = new Header(),
                            info   = new Info(),
                            scores = new ScoresContainer(),
                        },
                    },
                },
            };

            header.BeatmapSet.BindTo(beatmapSet);
            info.BeatmapSet.BindTo(beatmapSet);

            header.Picker.Beatmap.ValueChanged += b =>
            {
                info.Beatmap   = b.NewValue;
                scores.Beatmap = b.NewValue;
            };
        }
Example #14
0
        private void load([CanBeNull] IdleTracker idleTracker)
        {
            const float controls_area_height = 25f;

            if (idleTracker != null)
            {
                isIdle.BindTo(idleTracker.IsIdle);
            }

            OsuScrollContainer scrollContainer;

            InternalChildren = new Drawable[]
            {
                ListingPollingComponent = CreatePollingComponent().With(c => c.Filter.BindTarget = filter),
                popoverContainer        = new PopoverContainer
                {
                    Name             = @"Rooms area",
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding
                    {
                        Horizontal = WaveOverlayContainer.WIDTH_PADDING,
                        Top        = Header.HEIGHT + controls_area_height + 20,
                    },
                    Child = scrollContainer = new OsuScrollContainer
                    {
                        RelativeSizeAxes         = Axes.Both,
                        ScrollbarOverlapsContent = false,
                        Child = roomsContainer = new RoomsContainer
                        {
                            Filter       = { BindTarget = filter },
                            SelectedRoom = { BindTarget = SelectedRoom }
                        }
                    },
                },
                loadingLayer = new LoadingLayer(true),
                new FillFlowContainer
                {
                    Name             = @"Header area flow",
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Padding          = new MarginPadding {
                        Horizontal = WaveOverlayContainer.WIDTH_PADDING
                    },
                    Direction = FillDirection.Vertical,
                    Children  = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = Header.HEIGHT,
                            Child            = searchTextBox = new SearchTextBox
                            {
                                Anchor           = Anchor.CentreRight,
                                Origin           = Anchor.CentreRight,
                                RelativeSizeAxes = Axes.X,
                                Width            = 0.6f,
                            },
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = controls_area_height,
                            Children         = new Drawable[]
                            {
                                Buttons.WithChild(CreateNewRoomButton().With(d =>
                                {
                                    d.Anchor = Anchor.BottomLeft;
                                    d.Origin = Anchor.BottomLeft;
                                    d.Size   = new Vector2(150, 37.5f);
                                    d.Action = () => Open();
                                })),
                                new FillFlowContainer
                                {
                                    Anchor             = Anchor.TopRight,
                                    Origin             = Anchor.TopRight,
                                    AutoSizeAxes       = Axes.Both,
                                    Direction          = FillDirection.Horizontal,
                                    Spacing            = new Vector2(10),
                                    ChildrenEnumerable = CreateFilterControls().Select(f => f.With(d =>
                                    {
                                        d.Anchor = Anchor.TopRight;
                                        d.Origin = Anchor.TopRight;
                                    }))
                                }
                            }
                        }
                    },
                },
            };

            // scroll selected room into view on selection.
            SelectedRoom.BindValueChanged(val =>
            {
                var drawable = roomsContainer.Rooms.FirstOrDefault(r => r.Room == val.NewValue);
                if (drawable != null)
                {
                    scrollContainer.ScrollIntoView(drawable);
                }
            });
        }
Example #15
0
        private void populateStatistics(ValueChangedEvent <ScoreInfo> score)
        {
            loadCancellation?.Cancel();
            loadCancellation = null;

            foreach (var child in content)
            {
                child.FadeOut(150).Expire();
            }

            spinner.Hide();

            var newScore = score.NewValue;

            if (newScore == null)
            {
                return;
            }

            spinner.Show();

            var      localCancellationSource = loadCancellation = new CancellationTokenSource();
            IBeatmap playableBeatmap         = null;

            // Todo: The placement of this is temporary. Eventually we'll both generate the playable beatmap _and_ run through it in a background task to generate the hit events.
            Task.Run(() =>
            {
                playableBeatmap = beatmapManager.GetWorkingBeatmap(newScore.BeatmapInfo).GetPlayableBeatmap(newScore.Ruleset, newScore.Mods);
            }, loadCancellation.Token).ContinueWith(t => Schedule(() =>
            {
                bool hitEventsAvailable = newScore.HitEvents.Count != 0;
                Container <Drawable> container;

                var statisticRows = newScore.Ruleset.CreateInstance().CreateStatisticsForScore(newScore, playableBeatmap);

                if (!hitEventsAvailable && statisticRows.SelectMany(r => r.Columns).All(c => c.RequiresHitEvents))
                {
                    container = new FillFlowContainer
                    {
                        RelativeSizeAxes = Axes.Both,
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        Direction        = FillDirection.Vertical,
                        Children         = new Drawable[]
                        {
                            new MessagePlaceholder("Extended statistics are only available after watching a replay!"),
                            new ReplayDownloadButton(newScore)
                            {
                                Scale  = new Vector2(1.5f),
                                Anchor = Anchor.Centre,
                                Origin = Anchor.Centre,
                            },
                        }
                    };
                }
                else
                {
                    FillFlowContainer rows;
                    container = new OsuScrollContainer(Direction.Vertical)
                    {
                        RelativeSizeAxes = Axes.Both,
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        Alpha            = 0,
                        Children         = new[]
                        {
                            rows = new FillFlowContainer
                            {
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y,
                                Spacing          = new Vector2(30, 15)
                            }
                        }
                    };

                    bool anyRequiredHitEvents = false;

                    foreach (var row in statisticRows)
                    {
                        var columns = row.Columns;

                        if (columns.Length == 0)
                        {
                            continue;
                        }

                        var columnContent = new List <Drawable>();
                        var dimensions    = new List <Dimension>();

                        foreach (var col in columns)
                        {
                            if (!hitEventsAvailable && col.RequiresHitEvents)
                            {
                                anyRequiredHitEvents = true;
                                continue;
                            }

                            columnContent.Add(new StatisticContainer(col)
                            {
                                Anchor = Anchor.Centre,
                                Origin = Anchor.Centre,
                            });

                            dimensions.Add(col.Dimension ?? new Dimension());
                        }

                        rows.Add(new GridContainer
                        {
                            Anchor           = Anchor.TopCentre,
                            Origin           = Anchor.TopCentre,
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Content          = new[] { columnContent.ToArray() },
                            ColumnDimensions = dimensions.ToArray(),
                            RowDimensions    = new[] { new Dimension(GridSizeMode.AutoSize) }
                        });
                    }

                    if (anyRequiredHitEvents)
                    {
                        rows.Add(new FillFlowContainer
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Direction        = FillDirection.Vertical,
                            Anchor           = Anchor.TopCentre,
                            Origin           = Anchor.TopCentre,
                            Children         = new Drawable[]
                            {
                                new MessagePlaceholder("More statistics available after watching a replay!"),
                                new ReplayDownloadButton(newScore)
                                {
                                    Scale  = new Vector2(1.5f),
                                    Anchor = Anchor.Centre,
                                    Origin = Anchor.Centre,
                                },
                            }
                        });
                    }
                }

                LoadComponentAsync(container, d =>
                {
                    if (!Score.Value.Equals(newScore))
                    {
                        return;
                    }

                    spinner.Hide();
                    content.Add(d);
                    d.FadeIn(250, Easing.OutQuint);
                }, localCancellationSource.Token);
            }), localCancellationSource.Token);
        }
        public void TestUnloadAndReload()
        {
            OsuScrollContainer scroll = null;
            List <UpdateableOnlineBeatmapSetCover> covers = new List <UpdateableOnlineBeatmapSetCover>();

            AddStep("setup covers", () =>
            {
                var beatmapSet = CreateAPIBeatmapSet();

                FillFlowContainer fillFlow;

                Child = scroll = new OsuScrollContainer
                {
                    Size  = new Vector2(500f),
                    Child = fillFlow = new FillFlowContainer
                    {
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Direction        = FillDirection.Vertical,
                        Spacing          = new Vector2(10),
                        Padding          = new MarginPadding {
                            Bottom = 550
                        }
                    }
                };

                var coverTypes = Enum.GetValues(typeof(BeatmapSetCoverType))
                                 .Cast <BeatmapSetCoverType>()
                                 .ToList();

                for (int i = 0; i < 25; i++)
                {
                    var coverType = coverTypes[i % coverTypes.Count];

                    var cover = new UpdateableOnlineBeatmapSetCover(coverType)
                    {
                        OnlineInfo = beatmapSet,
                        Height     = 100,
                        Masking    = true,
                    };

                    if (coverType == BeatmapSetCoverType.Cover)
                    {
                        cover.Width = 500;
                    }
                    else if (coverType == BeatmapSetCoverType.Card)
                    {
                        cover.Width = 400;
                    }
                    else if (coverType == BeatmapSetCoverType.List)
                    {
                        cover.Size = new Vector2(100, 50);
                    }

                    fillFlow.Add(cover);
                    covers.Add(cover);
                }
            });

            var loadedCovers = covers.Where(c => c.ChildrenOfType <OnlineBeatmapSetCover>().SingleOrDefault()?.IsLoaded ?? false);

            AddUntilStep("some loaded", () => loadedCovers.Any());
            AddStep("scroll to end", () => scroll.ScrollToEnd());
            AddUntilStep("all unloaded", () => !loadedCovers.Any());
        }
Example #17
0
        public void ShowWithNoFetch()
        {
            var providers = new[]
            {
                OverlayColourProvider.Red,
                OverlayColourProvider.Pink,
                OverlayColourProvider.Orange,
                OverlayColourProvider.Green,
                OverlayColourProvider.Purple,
                OverlayColourProvider.Blue
            };
            var colourName = new[]
            {
                "Colour1",
                "Colour2",
                "Colour3",
                "Colour4",
                "Highlight1",
                "Content1",
                "Content2",
                "Light1",
                "Light2",
                "Light3",
                "Light4",
                "Dark1",
                "Dark2",
                "Dark3",
                "Dark4",
                "Dark5",
                "Dark6",
                "Foreground1",
                "Background1",
                "Background2",
                "Background3",
                "Background4",
                "Background5",
                "Background6",
            };

            Schedule(() =>
            {
                Child = new OsuScrollContainer(Direction.Horizontal)
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = new TableContainer
                    {
                        RelativeSizeAxes = Axes.Y,
                        AutoSizeAxes     = Axes.X,
                        Columns          = colourName.Select(c => new TitleTableColumn(c)).ToArray(),
                        Content          = providers.Select(p =>
                        {
                            return(colourName.Select(c =>
                            {
                                var colour = (Color4)p.GetType().GetProperty(c).GetValue(p);
                                return new PreviewColourDrawable(colour);
                            }));
                        }).To2DArray(),
                    }
                };
            });
        }
Example #18
0
        public TestSceneTranslate()
        {
            Child = new OsuScrollContainer
            {
                RelativeSizeAxes = Axes.Both,
                Child            = new Container
                {
                    Masking      = true,
                    CornerRadius = 5,
                    AutoSizeAxes = Axes.Both,
                    Margin       = new MarginPadding(30),
                    Children     = new Drawable[]
                    {
                        background = new Box
                        {
                            Name             = "Background",
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            RelativeSizeAxes = Axes.Both,
                        },
                        new FillFlowContainer
                        {
                            Margin       = new MarginPadding(SPACING),
                            Direction    = FillDirection.Horizontal,
                            AutoSizeAxes = Axes.Both,
                            Spacing      = new Vector2(COLUMN_SPACING),
                            Children     = new Drawable[]
                            {
                                timePreview = new TimePreview
                                {
                                    Width = 200
                                },
                                lyricPreview = new LyricPreview
                                {
                                    Width = 400
                                },
                                translateEditor = new TranslateEditor
                                {
                                    Width = 400
                                },
                            }
                        }
                    }
                }
            };

            beatmap = CreateBeatmap(new KaraokeRuleset().RulesetInfo);
            timePreview.LyricLines  = lyricLines;
            lyricPreview.LyricLines = lyricLines;
            translateEditor.LanguageDropdown.Items = new[]
            {
                "zh-TW",
                "en-US",
                "ja-JP"
            };
            translateEditor.LanguageDropdown.Current.BindValueChanged(value =>
            {
                // Save translate first
                var oldLanguageCode = value.OldValue;

                if (!string.IsNullOrEmpty(oldLanguageCode))
                {
                    // Get translate and fill empty
                    var insertTranslate = translateEditor.Translates.ToList();
                    insertTranslate.AddRange(new string[lyricLines.Length - insertTranslate.Count]);

                    if (beatmap.AvailableTranslates().Contains(oldLanguageCode))
                    {
                        var translate = beatmap.GetTranslate(oldLanguageCode);
                        translate.Clear();
                        translate.AddRange(insertTranslate);
                    }
                    else
                    {
                        beatmap.GetProperty().Translates.Add(oldLanguageCode, insertTranslate);
                    }
                }

                // Apply new translate to editor
                var newLanguageCode        = value.NewValue;
                translateEditor.Translates = beatmap.GetTranslate(newLanguageCode)?.ToArray() ?? lyricLines.Select(x => "").ToArray();
            }, true);
        }