コード例 #1
0
 internal void DeletePlaylist()
 {
     if (PlaylistLibUtils.playlistManager.DeletePlaylist((BeatSaberPlaylistsLib.Types.IPlaylist)annotatedBeatmapLevelCollectionsViewController.selectedAnnotatedBeatmapLevelCollection))
     {
         SelectAnnotatedBeatmapCollectionByIdx(annotatedBeatmapLevelCollectionsViewController.selectedItemIndex - 1);
     }
     else
     {
         modalMessage.text = "Error: Playlist cannot be deleted.";
         CurrentModalState = ModalState.OkModal;
         modal.Show(true);
     }
 }
コード例 #2
0
        public void ShowDialog(string title, string message, Action onConfirm = null, Action onDecline = null)
        {
            _title.text   = title;
            _message.text = message;

            OnConfirm = onConfirm;
            OnDecline = onDecline;

            modal.Show(true);
        }
コード例 #3
0
        internal void ShowPlaylists()
        {
            modal.Show(true);
            customListTableData.data.Clear();
            loadedplaylists = PlaylistLibUtils.playlistManager.GetAllPlaylists(true);

            foreach (BeatSaberPlaylistsLib.Types.IPlaylist playlist in loadedplaylists)
            {
                if (playlist is IDeferredSpriteLoad deferredSpriteLoadPlaylist && !deferredSpriteLoadPlaylist.SpriteWasLoaded)
                {
                    _ = playlist.coverImage;
                    deferredSpriteLoadPlaylist.SpriteLoaded -= DeferredSpriteLoadPlaylist_SpriteLoaded;
                    deferredSpriteLoadPlaylist.SpriteLoaded += DeferredSpriteLoadPlaylist_SpriteLoaded;
                }
コード例 #4
0
        private void TryProcessNextChange()
        {
            if (CurrentChange != null || changeQueue.Count == 0 || changeQueue.Peek() == null)
            {
                return;
            }

            siraLog.Debug("Presenting change");

            CurrentChange = changeQueue.Dequeue();
            RefreshChangeItem();

            ChangeModal.Show(true, true, () => siraLog.Debug("Change is being presented"));
        }
コード例 #5
0
        internal void ShowPlaylists()
        {
            modal.Show(true);
            customListTableData.data.Clear();
            loadedplaylists = PlaylistLibUtils.playlistManager.GetAllPlaylists(true);

            foreach (BeatSaberPlaylistsLib.Types.IPlaylist playlist in loadedplaylists)
            {
                String subName = String.Format("{0} songs", playlist.beatmapLevelCollection.beatmapLevels.Length);
                customListTableData.data.Add(new CustomCellInfo(playlist.collectionName, subName, playlist.coverImage));
            }

            customListTableData.tableView.ReloadData();
            customListTableData.tableView.ScrollToCellWithIdx(0, TableViewScroller.ScrollPositionType.Beginning, false);
        }
コード例 #6
0
        private bool TryProcessNextChange()
        {
            if (CurrentChange != null)
            {
                return(false);
            }
            if (!changeQueue.TryDequeue(out var item))
            {
                return(false);
            }

            Logger.log.Debug("Presenting change");

            CurrentChange = item;
            RefreshChangeItem();
            ChangeModal.Show(true);
            return(true);
        }
コード例 #7
0
        public override void HandleType(ComponentTypeWithData componentType, BSMLParserParams parserParams)
        {
            try
            {
                ModalView modalView      = componentType.component as ModalView;
                Transform originalParent = modalView.transform.parent;
                bool      moveToCenter   = true;
                if (componentType.data.TryGetValue("moveToCenter", out string moveToCenterString))
                {
                    moveToCenter = bool.Parse(moveToCenterString);
                }

                if (componentType.data.TryGetValue("showEvent", out string showEvent))
                {
                    parserParams.AddEvent(showEvent, delegate
                    {
                        modalView.Show(true, moveToCenter);
                    });
                }

                if (componentType.data.TryGetValue("hideEvent", out string hideEvent))
                {
                    parserParams.AddEvent(hideEvent, delegate
                    {
                        modalView.Hide(true, () => modalView.transform.SetParent(originalParent, true));
                    });
                }

                if (componentType.data.TryGetValue("clickOffCloses", out string clickOffCloses) && Parse.Bool(clickOffCloses))
                {
                    modalView._blockerClickedEvent += delegate
                    {
                        modalView.Hide(true, () => modalView.transform.SetParent(originalParent, true));
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.log?.Error(ex);
            }
        }
コード例 #8
0
 private void CellSelected(TableView view, int idx)
 {
     SelectedCanvas = idx - 1;
     if (IsDeleting)
     {
         flowCoordinator.Value.SetRightViewController(null);
         DeactivateModals();
         if (idx == 0)
         {
             canvasError.Show(true);
         }
         else
         {
             deleteCanvas.Show(true);
         }
     }
     else
     {
         flowCoordinator.Value.SetRightViewController(hudEdit.Value);
         hudEdit.Value.ApplyCanvasForEditing(SelectedCanvas);
     }
 }
コード例 #9
0
 internal void DisplayWarning()
 {
     modal.Show(true);
     warningMessage.text = string.Format("Are you sure you would like to remove {0} from the playlist?", selectedPlaylistSong.songName);
 }
コード例 #10
0
 internal void DisplayWarning()
 {
     deleteModal.Show(true);
     warningMessage.text = string.Format("Are you sure you would like to delete {0}?", annotatedBeatmapLevelCollectionsViewController.selectedAnnotatedBeatmapLevelCollection.collectionName);
 }