private void ClickedHiddenText() { var detail = _standardLevelDetailView; var level = _standardLevelDetailView.selectedDifficultyBeatmap.level; if (!_config.Levels.TryGetValue($"{level.levelID}_{_beatmapCharacteristicSegmentedControlController.selectedBeatmapCharacteristic.serializedName}", out Config.MapSet mapSet)) { mapSet = new Config.MapSet { Name = level.songName }; _config.Levels.Add($"{level.levelID}_{_beatmapCharacteristicSegmentedControlController.selectedBeatmapCharacteristic.serializedName}", mapSet); } mapSet.Difficulties.Add(_standardLevelDetailView.selectedDifficultyBeatmap.difficulty); _config.Changed(); /*var diffController = _diffdelDifficultyControlController as BeatmapDifficultySegmentedControlController; * Accessors.Diffs(ref diffController).Remove(_standardLevelDetailView.selectedDifficultyBeatmap.difficulty); * var closestIndex = diffController.GetClosestDifficultyIndex(_standardLevelDetailView.selectedDifficultyBeatmap.difficulty);*/ var set = level.beatmapLevelData.GetDifficultyBeatmapSet(_beatmapCharacteristicSegmentedControlController.selectedBeatmapCharacteristic).difficultyBeatmaps.Where(diff => !mapSet.Difficulties.Contains(diff.difficulty)); if (set.Count() != 0) { _diffdelDifficultyControlController.SetData(set.ToArray(), _standardLevelDetailView.selectedDifficultyBeatmap.difficulty); } _standardLevelDetailView.SetContent(level, _diffdelDifficultyControlController.selectedDifficulty, null, Accessors.Player(ref detail), Accessors.Stats(ref detail) ); _platformLeaderboardViewController.SetData(_standardLevelDetailView.selectedDifficultyBeatmap); }
public DiffdelController(Config config, PlatformLeaderboardViewController platformLeaderboardViewController, StandardLevelDetailViewController standardLevelDetailViewController) { _config = config; _platformLeaderboardViewController = platformLeaderboardViewController; _standardLevelDetailView = Accessors.LevelDetailView(ref standardLevelDetailViewController) !; _buttonText = (Accessors.NPSText(ref Accessors.ParamsPanel(ref _standardLevelDetailView)) as ButtonText) !; _beatmapCharacteristicSegmentedControlController = (Accessors.CharacteristicSegment(ref _standardLevelDetailView)) !; _diffdelDifficultyControlController = (Accessors.DifficultySegment(ref _standardLevelDetailView) as DiffdelDifficultyControlController) !; }
public Plugin(Conf conf, IPALogger logger, Zenjector zenjector) { Log = logger; var config = conf.Generated <Config>(); zenjector .On <MenuInstaller>() .Pseudo((Container) => { Container.BindInstance(config); Container.BindInterfacesTo <DiffdelController>().AsSingle(); }) .Mutate <StandardLevelDetailViewController>((ctx, levelDetailViewController) => { var levelDetail = Accessors.LevelDetailView(ref levelDetailViewController); var levelParams = Accessors.ParamsPanel(ref levelDetail); Accessors.NPSText(ref levelParams) = Accessors.NPSText(ref levelParams).Upgrade <TextMeshProUGUI, ButtonText>(); Accessors.DifficultySegment(ref levelDetail) = Accessors.DifficultySegment(ref levelDetail).Upgrade <BeatmapDifficultySegmentedControlController, DiffdelDifficultyControlController>(); }); }