Пример #1
0
        public override TableCell CellForIdx(TableView view, int row, CountersPlusHorizontalSettingsListViewController settings)
        {
            AnnotatedBeatmapLevelCollectionTableCell cell = view.DequeueReusableCellForIdentifier(settings.ReuseIdentifier) as AnnotatedBeatmapLevelCollectionTableCell;

            if (cell == null) //Dequeue the cell, and make an instance if it doesn't exist.
            {
                cell = UnityEngine.Object.Instantiate(settings.levelPackTableCellInstance);
                cell.reuseIdentifier = settings.ReuseIdentifier;
            }
            cell.showNewRibbon = false; //Dequeued cells will keep NEW ribbon value. Always change it to false.

            switch (row)
            {
            case 0:
                SetCellInfo(ref cell, "General HUD Settings", "Change general settings, such as HUD size.", "HUD_General");
                break;

            case 1:
                SetCellInfo(ref cell, "Lock HUD to Camera", "Allows the HUD to be locked to various cameras.", "HUD_Camera");
                break;

            case 2:
                SetCellInfo(ref cell, "HUD Position Offset", "Changes the positional offset of the HUD.", "HUD_Position");
                break;

            case 3:
                SetCellInfo(ref cell, "HUD Rotation Offset", "Changes the rotational offset of the HUD.", "HUD_Rotation");
                break;
            }
            return(cell);
        }
Пример #2
0
        public override TableCell CellForIdx(TableView view, int row, CountersPlusHorizontalSettingsListViewController settings)
        {
            AnnotatedBeatmapLevelCollectionTableCell cell = view.DequeueReusableCellForIdentifier(settings.ReuseIdentifier) as AnnotatedBeatmapLevelCollectionTableCell;

            if (cell == null) //Dequeue the cell, and make an instance if it doesn't exist.
            {
                cell = Object.Instantiate(settings.levelPackTableCellInstance);
                cell.reuseIdentifier = settings.ReuseIdentifier;
            }
            cell.showNewRibbon = false; //Dequeued cells will keep NEW ribbon value. Always change it to false.
            TextMeshProUGUI packInfoText = cell.GetPrivateField <TextMeshProUGUI>("_infoText");

            packInfoText.richText = true;                                //Enable rich text for info text. Optional, but I use it for Counters+.
            UnityEngine.UI.Image packCoverImage = cell.GetPrivateField <UnityEngine.UI.Image>("_coverImage");
            packCoverImage.mainTexture.wrapMode = TextureWrapMode.Clamp; //Fixes bordering on images (especially transparent ones)
            switch (row)
            {
            case 0:
                SetText("Main Settings", "Configure basic Counters+ settings.", Images.Images.LoadSprite("MainSettings"),
                        ref packInfoText, ref packCoverImage);
                break;

            case 1:
                SetText("Donators", "See who supported me on Ko-fi!", Images.Images.LoadSprite("Donators"),
                        ref packInfoText, ref packCoverImage);
                break;

            case 2:
                SetText("Contributors", "See who helped with Counters+!", Images.Images.LoadSprite("Contributors"),
                        ref packInfoText, ref packCoverImage);
                break;
            }
            return(cell);
        }
Пример #3
0
        protected override void DidActivate(bool firstActivation, ActivationType activationType)
        {
            MainScreen         = GameObject.Find("MainScreen");
            MainScreenPosition = MainScreen.transform.position;
            if (firstActivation && activationType == ActivationType.AddedToHierarchy)
            {
                Instance = this;
                title    = "Counters+";

                navigationController = BeatSaberUI.CreateViewController <BackButton>();
                navigationController.DidFinishEvent += BackButton_DidFinish;

                editSettings = BeatSaberUI.CreateViewController <CountersPlusEditViewController>();
                placeholder  = BeatSaberUI.CreateViewController <CountersPlusFillerForMainViewController>();
                //settingsList = BeatSaberUI.CreateViewController<CountersPlusSettingsListViewController>();
                horizSettingsList = BeatSaberUI.CreateViewController <CountersPlusHorizontalSettingsListViewController>();
                credits           = BeatSaberUI.CreateViewController <CountersPlusCreditsViewController>();
            }
            SetViewControllersToNavigationConctroller(navigationController, new VRUIViewController[] { credits });
            ProvideInitialViewControllers(placeholder, navigationController, editSettings, horizSettingsList);
            MainScreen.transform.position = new Vector3(0, -100, 0); //"If it works it's not stupid"

            CounterWarning.CreateWarning("Due to limitations, some counters may not reflect their true appearance in-game.", 7.5f);
            if (!Plugin.UpToDate)
            {
                CounterWarning.CreateWarning("A new Counters+ update is available to download!", 5);
            }
            StartCoroutine(InitMockCounters());
        }
        public override TableCell CellForIdx(TableView view, int row, CountersPlusHorizontalSettingsListViewController settings)
        {
            if (!counterInfos.Any())
            {
                LoadData();
            }
            AnnotatedBeatmapLevelCollectionTableCell cell = view.DequeueReusableCellForIdentifier(settings.ReuseIdentifier) as AnnotatedBeatmapLevelCollectionTableCell;

            if (cell == null) //Dequeue the cell, and make an instance if it doesn't exist.
            {
                cell = UnityEngine.Object.Instantiate(settings.levelPackTableCellInstance);
                cell.reuseIdentifier = settings.ReuseIdentifier;
            }
            cell.showNewRibbon = false; //Dequeued cells will keep NEW ribbon value. Always change it to false.
            TextMeshProUGUI packInfoText = cell.GetPrivateField <TextMeshProUGUI>("_infoText");

            packInfoText.richText = true;                                //Enable rich text for info text. Optional, but I use it for Counters+.
            UnityEngine.UI.Image packCoverImage = cell.GetPrivateField <UnityEngine.UI.Image>("_coverImage");
            packCoverImage.mainTexture.wrapMode = TextureWrapMode.Clamp; //Fixes bordering on images (especially transparent ones)

            SettingsInfo info = counterInfos[row];

            packInfoText.text = $"{info.Name}\n\n{info.Description}";
            try
            {
                if (info.IsCustom)
                {
                    if ((info.Model as CustomConfigModel).CustomCounter.LoadedIcon != null)
                    {
                        packCoverImage.sprite = (info.Model as CustomConfigModel).CustomCounter.LoadedIcon;
                    }
                    else
                    {
                        packCoverImage.sprite = Images.Images.LoadSprite("Custom");
                    }
                    cell.showNewRibbon = (info.Model as CustomConfigModel).CustomCounter.IsNew;
                }
                else
                {
                    packCoverImage.sprite = Images.Images.LoadSprite(info.Name);
                    if (info.Model.VersionAdded != null)
                    {
                        cell.showNewRibbon = Plugin.PluginVersion == info.Model.VersionAdded;
                        packInfoText.text += $"\n\n<i>Version added: {info.Model.VersionAdded.ToString()}</i>";
                    }
                }
            }
            catch { packCoverImage.sprite = Images.Images.LoadSprite("Bug"); }
            return(cell);
        }
Пример #5
0
        public override void OnCellSelect(TableView view, int row, CountersPlusHorizontalSettingsListViewController settings)
        {
            switch (row)
            {
            case 0:
                CountersPlusEditViewController.ShowMainSettings();
                break;

            case 1:
                CountersPlusEditViewController.ShowDonators();
                break;

            case 2:
                CountersPlusEditViewController.ShowContributors();
                break;
            }
        }
Пример #6
0
        public override void OnCellSelect(TableView view, int row, CountersPlusHorizontalSettingsListViewController settings)
        {
            CountersPlusEditViewController.ClearScreen(true);
            MockCounter.Highlight <ConfigModel>(null);
            switch (row)
            {
            case 0:
                RefreshScreen("General", "General HUD Settings");
                break;

            case 1:
                RefreshScreen("Camera", "HUD Camera Settings");
                break;

            case 2:
                RefreshScreen("Position", "HUD Position Offset");
                break;

            case 3:
                RefreshScreen("Rotation", "HUD Rotation");
                break;
            }
        }
Пример #7
0
 public abstract void OnCellSelect(TableView view, int row, CountersPlusHorizontalSettingsListViewController settings);
Пример #8
0
 public abstract TableCell CellForIdx(TableView view, int row, CountersPlusHorizontalSettingsListViewController settings);
 public override void OnCellSelect(TableView view, int row, CountersPlusHorizontalSettingsListViewController settings)
 {
     CountersPlusEditViewController.UpdateSettings(counterInfos[row].Model);
 }