Beispiel #1
0
        /// <summary>
        /// Select a level pack.
        /// </summary>
        /// <param name="levelPackId"></param>
        public void SelectLevelPack(String levelPackId)
        {
            Logger.Trace("SelectLevelPack({0})", levelPackId);

            try
            {
                //var levelPacks = GetLevelPackCollection();
                IBeatmapLevelPack pack = GetLevelPackByPackId(levelPackId);

                if (pack == null)
                {
                    Logger.Debug("Could not locate requested level pack...");
                    return;
                }

                Logger.Info("Selecting level pack: {0}", pack.packID);

                LevelFilteringNavigationController.SelectBeatmapLevelPackOrPlayList(pack, null);
                LevelFilteringNavigationController.TabBarDidSwitch();

                Logger.Debug("Done selecting level pack!");
            }
            catch (Exception e)
            {
                Logger.Exception(e);
            }
        }
        /// <summary>
        /// Select a level collection.
        /// </summary>
        /// <param name="levelCollectionName"></param>
        public void SelectLevelCollection(String levelCollectionName)
        {
            Logger.Trace("SelectLevelCollection({0})", levelCollectionName);

            try
            {
                IAnnotatedBeatmapLevelCollection collection = GetLevelCollectionByName(levelCollectionName);

                if (collection == null)
                {
                    Logger.Debug("Could not locate requested level collection...");
                    return;
                }

                Logger.Info("Selecting level collection: {0}", collection.collectionName);

                LevelFilteringNavigationController.SelectBeatmapLevelPackOrPlayList(collection as IBeatmapLevelPack, collection as IPlaylist);
                LevelFilteringNavigationController.TabBarDidSwitch();

                Logger.Debug("Done selecting level collection!");
            }
            catch (Exception e)
            {
                Logger.Exception(e);
            }
        }
Beispiel #3
0
        internal void AttemptReselectCurrentLevelPack(LevelFilteringNavigationController controller)
        {
            var tabBarView = controller.GetField <TabBarViewController>("_tabBarViewController");

            if (tabBarView?.selectedCellNumber != 3)
            {
                return;
            }
            var tabBarDatas = controller.GetField <object[]>("_tabBarDatas");

            if (tabBarDatas == null)
            {
                return;
            }
            int selectedPackNum             = tabBarDatas[tabBarView.selectedCellNumber].GetField <int>("selectedItem");
            var currentLevelPacksCollection = tabBarDatas[tabBarView.selectedCellNumber].GetField <IAnnotatedBeatmapLevelCollection[]>("annotatedBeatmapLevelCollections");

            if (currentLevelPacksCollection == null)
            {
                return;
            }
            int packCount = currentLevelPacksCollection.Length;

            if (!(selectedPackNum < packCount))
            {
                return;
            }
            controller.SelectBeatmapLevelPackOrPlayList(currentLevelPacksCollection[selectedPackNum] as IBeatmapLevelPack, null);
        }