Пример #1
0
        private static void Prefix(IDifficultyBeatmap difficultyBeatmap, ref ColorScheme overrideColorScheme)
        {
            EnvironmentInfoSO environmentInfoSO = difficultyBeatmap.GetEnvironmentInfo();

            Data.ExtraSongData.DifficultyData songData = Collections.RetrieveDifficultyData(difficultyBeatmap);
            ColorScheme fallbackScheme = overrideColorScheme ?? new ColorScheme(environmentInfoSO.colorScheme);

            if (songData == null)
            {
                return;
            }
            if (songData._colorLeft != null || songData._colorRight != null || songData._envColorLeft != null || songData._envColorRight != null || songData._obstacleColor != null)
            {
                if (Plugin.customSongColors)
                {
                    Logging.logger.Info("Custom Song Colors On");
                    Color       saberLeft      = songData._colorLeft == null ? fallbackScheme.saberAColor : Utils.ColorFromMapColor(songData._colorLeft);
                    Color       saberRight     = songData._colorRight == null ? fallbackScheme.saberBColor : Utils.ColorFromMapColor(songData._colorRight);
                    Color       envLeft        = songData._envColorLeft == null ? songData._colorLeft == null ? fallbackScheme.environmentColor0 : Utils.ColorFromMapColor(songData._colorLeft) : Utils.ColorFromMapColor(songData._envColorLeft);
                    Color       envRight       = songData._envColorRight == null ? songData._colorRight == null ? fallbackScheme.environmentColor1 : Utils.ColorFromMapColor(songData._colorRight) : Utils.ColorFromMapColor(songData._envColorRight);
                    Color       envLeftBoost   = songData._envColorLeftBoost == null ? envLeft : Utils.ColorFromMapColor(songData._envColorLeftBoost);
                    Color       envRightBoost  = songData._envColorRightBoost == null ? envRight : Utils.ColorFromMapColor(songData._envColorRightBoost);
                    Color       obstacle       = songData._obstacleColor == null ? fallbackScheme.obstaclesColor : Utils.ColorFromMapColor(songData._obstacleColor);
                    ColorScheme mapColorScheme = new ColorScheme("SongCoreMapColorScheme", "SongCore Map Color Scheme", false, saberLeft, saberRight, envLeft, envRight, true, envLeftBoost, envRightBoost, obstacle);
                    overrideColorScheme = mapColorScheme;
                }
            }
        }
        static void Postfix(StandardLevelScenesTransitionSetupDataSO __instance, IDifficultyBeatmap difficultyBeatmap, IPreviewBeatmapLevel previewBeatmapLevel,
                            OverrideEnvironmentSettings overrideEnvironmentSettings, GameplayModifiers gameplayModifiers, ColorScheme overrideColorScheme, PlayerSpecificSettings playerSpecificSettings,
                            ref PracticeSettings practiceSettings, bool useTestNoteCutSoundEffects, MainSettingsModelSO ____mainSettingsModel)
        {
            EnvironmentInfoSO environmentInfoSO = difficultyBeatmap.GetEnvironmentInfo();

            if (overrideEnvironmentSettings is { overrideEnvironments : true })
Пример #3
0
 /// <summary>
 /// Enables the <see cref="OverrideEnvironmentSettings"/> and changes it to the selected <see cref="EnvOverrideMode"/>
 /// </summary>
 /// <param name="mode">The environment to load when transitioning into play mode</param>
 internal static void OverrideEnvironment(EnvOverrideMode mode)
 {
     if (supportedEnvironmentInfos[mode] != null)
     {
         Settings.PlayerData.overrideEnvironmentSettings.overrideEnvironments = true;
         oldEnvironmentInfoSO = Settings.PlayerData.overrideEnvironmentSettings.GetOverrideEnvironmentInfoForType(environmentType);
         Settings.PlayerData.overrideEnvironmentSettings.SetEnvironmentInfoForType(environmentType, supportedEnvironmentInfos[mode]);
         didOverrideEnvironment = true;
     }
 }
Пример #4
0
        static void Prefix(MissionLevelScenesTransitionSetupDataSO __instance, string missionId, IDifficultyBeatmap difficultyBeatmap, MissionObjective[] missionObjectives, ColorScheme overrideColorScheme, GameplayModifiers gameplayModifiers, PlayerSpecificSettings playerSpecificSettings, string backButtonText)
        {
            EnvironmentInfoSO environmentInfoSO = difficultyBeatmap.GetEnvironmentInfo();

            ScoreSubmission._wasDisabled  = false;
            ScoreSubmission.LastDisablers = Array.Empty <string>();
            Plugin.LevelData.GameplayCoreSceneSetupData = new GameplayCoreSceneSetupData(difficultyBeatmap, gameplayModifiers, playerSpecificSettings, PracticeSettings.defaultPracticeSettings, false, environmentInfoSO);
            Plugin.LevelData.IsSet = true;
            Plugin.LevelData.Mode  = Mode.Mission;
            Utilities.Logger.log.Debug("Level Data set");
            __instance.didFinishEvent -= __instance_didFinishEvent;
            __instance.didFinishEvent += __instance_didFinishEvent;
        }
        public static void Prefix(IDifficultyBeatmap difficultyBeatmap, ref ColorScheme overrideColorScheme)
        {
            EnvironmentInfoSO eiso = difficultyBeatmap.GetEnvironmentInfo();
            ColorScheme       curr = overrideColorScheme ?? new ColorScheme(eiso.colorScheme);

            // the second boost colour is often used more
            // new Color(0.09411764705f, 0, 0.78431372549f) dark blue, new Color(0.58823529411f, 0, 0) dark red
            BoostColour b        = Plugin.Boost;
            ColorScheme mapColor = new ColorScheme("CustomColourScheme", "CustomColourScheme", false, curr.saberAColor, curr.saberBColor, curr.environmentColor0, curr.environmentColor1, true, new Color(b.r0, b.g0, b.b0), new Color(b.r1, b.g1, b.b1), curr.obstaclesColor);

            overrideColorScheme = mapColor;
            Plugin.Log.Info("Loaded Custom Boost Colours");
        }
Пример #6
0
 private static void Postfix(string environmentSerializedName, ref EnvironmentInfoSO __result)
 {
     if (__result == null)
     {
         foreach (var environmentInfo in CustomEnvironmentsListSO.environmentInfos)
         {
             if (environmentInfo.serializedName == environmentSerializedName)
             {
                 __result = environmentInfo;
             }
         }
     }
 }
Пример #7
0
 static void Prefix(MultiplayerLevelScenesTransitionSetupDataSO __instance, ref EnvironmentInfoSO ____multiplayerEnvironmentInfo, string gameMode,
                    IPreviewBeatmapLevel previewBeatmapLevel, BeatmapDifficulty beatmapDifficulty,
                    BeatmapCharacteristicSO beatmapCharacteristic, IDifficultyBeatmap difficultyBeatmap,
                    ColorScheme overrideColorScheme, GameplayModifiers gameplayModifiers, PlayerSpecificSettings playerSpecificSettings,
                    PracticeSettings practiceSettings, bool useTestNoteCutSoundEffects = false)
 {
     ScoreSubmission._wasDisabled  = false;
     ScoreSubmission.LastDisablers = Array.Empty <string>();
     Plugin.LevelData.GameplayCoreSceneSetupData = new GameplayCoreSceneSetupData(difficultyBeatmap, gameplayModifiers, playerSpecificSettings, practiceSettings, useTestNoteCutSoundEffects, ____multiplayerEnvironmentInfo);
     Plugin.LevelData.IsSet = true;
     Plugin.LevelData.Mode  = Mode.Multiplayer;
     Utilities.Logger.log.Debug("Level Data set");
     __instance.didFinishEvent -= __instance_didFinishEvent;
     __instance.didFinishEvent += __instance_didFinishEvent;
 }
Пример #8
0
        static void Postfix(StandardLevelScenesTransitionSetupDataSO __instance, string gameMode, IDifficultyBeatmap difficultyBeatmap, IPreviewBeatmapLevel previewBeatmapLevel, OverrideEnvironmentSettings overrideEnvironmentSettings,
                            GameplayModifiers gameplayModifiers, ColorScheme overrideColorScheme, PlayerSpecificSettings playerSpecificSettings, ref PracticeSettings practiceSettings, string backButtonText, bool useTestNoteCutSoundEffects)
        {
            EnvironmentInfoSO environmentInfoSO = difficultyBeatmap.GetEnvironmentInfo();

            if (overrideEnvironmentSettings != null && overrideEnvironmentSettings.overrideEnvironments)
            {
                environmentInfoSO = overrideEnvironmentSettings.GetOverrideEnvironmentInfoForType(environmentInfoSO.environmentType);
            }
            ScoreSubmission._wasDisabled  = false;
            ScoreSubmission.LastDisablers = Array.Empty <string>();
            Plugin.LevelData.GameplayCoreSceneSetupData = new GameplayCoreSceneSetupData(difficultyBeatmap, previewBeatmapLevel, gameplayModifiers, playerSpecificSettings, practiceSettings, useTestNoteCutSoundEffects, environmentInfoSO, overrideColorScheme);
            Plugin.LevelData.IsSet = true;
            Plugin.LevelData.Mode  = Mode.Standard;
            Utilities.Logger.log.Debug("Level Data set");
            __instance.didFinishEvent -= __instance_didFinishEvent;
            __instance.didFinishEvent += __instance_didFinishEvent; // Not triggered in multiplayer
        }
        private static void Postfix(IDifficultyBeatmap difficultyBeatmap, ColorScheme overrideColorScheme)
        {
            IPALogger         logger            = Plugin.Logger;
            EnvironmentInfoSO environmentInfoSO = difficultyBeatmap.GetEnvironmentInfo();
            ColorScheme       colorScheme       = overrideColorScheme ?? new ColorScheme(environmentInfoSO.colorScheme);

            logger.Info("===================");
            logger.Info("ACTIVE COLOR SCHEME:");
            logger.Info($"colorSchemeId: {colorScheme.colorSchemeId}");
            logger.Info($"colorSchemeName: {colorScheme.colorSchemeName}");
            logger.Info($"supportsEnvironmentColorBoost: {colorScheme.supportsEnvironmentColorBoost}");
            logger.Info($"saberAColor: {PrintFullColor(colorScheme.saberAColor)}");
            logger.Info($"saberBColor: {PrintFullColor(colorScheme.saberBColor)}");
            logger.Info($"environmentColor0: {PrintFullColor(colorScheme.environmentColor0)}");
            logger.Info($"environmentColor1: {PrintFullColor(colorScheme.environmentColor1)}");
            logger.Info($"environmentColor0Boost: {PrintFullColor(colorScheme.environmentColor0Boost)}");
            logger.Info($"environmentColor1Boost: {PrintFullColor(colorScheme.environmentColor1Boost)}");
            logger.Info($"obstaclesColor: {PrintFullColor(colorScheme.obstaclesColor)}");
            logger.Info("===================");
        }
Пример #10
0
            public static void Postfix(IDifficultyBeatmap difficultyBeatmap, PlayerSpecificSettings playerSpecificSettings, ref ColorScheme overrideColorScheme)
            {
                loadedLights    = false;
                loadError       = false;
                playerLaserErr  = false;
                ringErr         = false;
                isInMultiplayer = true;
                Plugin.Log.Info("In multiplayer.");

                EnvironmentEffectsFilterPreset defaultPreset = playerSpecificSettings.environmentEffectsFilterDefaultPreset;
                EnvironmentEffectsFilterPreset ePlusPreset   = playerSpecificSettings.environmentEffectsFilterExpertPlusPreset;

                if (difficultyBeatmap.difficulty == BeatmapDifficulty.ExpertPlus && ePlusPreset == EnvironmentEffectsFilterPreset.NoEffects)
                {
                    staticLights = true;
                }
                else if (difficultyBeatmap.difficulty != BeatmapDifficulty.ExpertPlus && defaultPreset == EnvironmentEffectsFilterPreset.NoEffects)
                {
                    staticLights = true;
                }
                else
                {
                    staticLights = false;
                }

                EnvironmentInfoSO eiso = difficultyBeatmap.GetEnvironmentInfo();

                colours = overrideColorScheme ?? new ColorScheme(eiso.colorScheme);
                BoostColour b        = Plugin.Boost;
                ColorScheme mapColor = new ColorScheme("CustomColourScheme", "CustomColourScheme", false, colours.saberAColor, colours.saberBColor, colours.environmentColor0, colours.environmentColor1, true, new Color(b.r0, b.g0, b.b0), new Color(b.r1, b.g1, b.b1), colours.obstaclesColor);

                overrideColorScheme = mapColor;
                colours             = mapColor;
                colour0             = colours.environmentColor0;
                colour1             = colours.environmentColor1;
                ringErr             = false;
            }
 private static void SetEnvironmentTable(EnvironmentInfoSO environmentInfo)
 {
     LightIDTableManager.SetEnvironment(environmentInfo.serializedName);
 }
Пример #12
0
        // Taken from SongCore
        public static CustomPreviewBeatmapLevel LoadSong(StandardLevelInfoSaveData saveData, string songPath, out string hash, SongFolderEntry folderEntry = null)
        {
            CustomPreviewBeatmapLevel result;
            bool wip = false;

            if (songPath.Contains("CustomWIPLevels"))
            {
                wip = true;
            }
            if (folderEntry != null)
            {
                if (folderEntry.Pack == FolderLevelPack.CustomWIPLevels)
                {
                    wip = true;
                }
                else if (folderEntry.WIP)
                {
                    wip = true;
                }
            }
            hash = Hashing.GetCustomLevelHash(saveData, songPath);
            try
            {
                string folderName = new DirectoryInfo(songPath).Name;
                string levelID    = CustomLevelLoader.kCustomLevelPrefixId + hash;
                if (wip)
                {
                    levelID += " WIP";
                }
                if (SongCore.Collections.hashForLevelID(levelID) != "")
                {
                    levelID += "_" + folderName;
                }
                string            songName                    = saveData.songName;
                string            songSubName                 = saveData.songSubName;
                string            songAuthorName              = saveData.songAuthorName;
                string            levelAuthorName             = saveData.levelAuthorName;
                float             beatsPerMinute              = saveData.beatsPerMinute;
                float             songTimeOffset              = saveData.songTimeOffset;
                float             shuffle                     = saveData.shuffle;
                float             shufflePeriod               = saveData.shufflePeriod;
                float             previewStartTime            = saveData.previewStartTime;
                float             previewDuration             = saveData.previewDuration;
                EnvironmentInfoSO environmentSceneInfo        = _customLevelLoader.LoadEnvironmentInfo(saveData.environmentName, false);
                EnvironmentInfoSO allDirectionEnvironmentInfo = _customLevelLoader.LoadEnvironmentInfo(saveData.allDirectionsEnvironmentName, true);
                List <PreviewDifficultyBeatmapSet> list       = new List <PreviewDifficultyBeatmapSet>();
                foreach (StandardLevelInfoSaveData.DifficultyBeatmapSet difficultyBeatmapSet in saveData.difficultyBeatmapSets)
                {
                    BeatmapCharacteristicSO beatmapCharacteristicBySerializedName = beatmapCharacteristicCollection.GetBeatmapCharacteristicBySerializedName(difficultyBeatmapSet.beatmapCharacteristicName);
                    BeatmapDifficulty[]     array = new BeatmapDifficulty[difficultyBeatmapSet.difficultyBeatmaps.Length];
                    for (int j = 0; j < difficultyBeatmapSet.difficultyBeatmaps.Length; j++)
                    {
                        BeatmapDifficulty beatmapDifficulty;
                        difficultyBeatmapSet.difficultyBeatmaps[j].difficulty.BeatmapDifficultyFromSerializedName(out beatmapDifficulty);
                        array[j] = beatmapDifficulty;
                    }
                    list.Add(new PreviewDifficultyBeatmapSet(beatmapCharacteristicBySerializedName, array));
                }

                result = new CustomPreviewBeatmapLevel(defaultCoverImage.texture, saveData, songPath,
                                                       cachedMediaAsyncLoaderSO, cachedMediaAsyncLoaderSO, levelID, songName, songSubName,
                                                       songAuthorName, levelAuthorName, beatsPerMinute, songTimeOffset, shuffle, shufflePeriod,
                                                       previewStartTime, previewDuration, environmentSceneInfo, allDirectionEnvironmentInfo, list.ToArray());
            }
            catch
            {
                Plugin.log.Error("Failed to Load Song: " + songPath);
                result = null;
            }
            return(result);
        }
Пример #13
0
        private static void Postfix(IDifficultyBeatmap difficultyBeatmap, EnvironmentInfoSO ____multiplayerEnvironmentInfo)
        {
            LightIDTableManager.SetEnvironment(____multiplayerEnvironmentInfo.serializedName);

            SceneTransitionHelper.Patch(difficultyBeatmap);
        }