internal static void Patch() { TechnicolorConfig config = TechnicolorConfig.Instance; if (config.TechnicolorEnabled && !ChromaController.ChromaIsActive) { TechnicolorController.ToggleTechniPatches(config.TechnicolorLightsStyle != TechnicolorStyle.GRADIENT && config.TechnicolorLightsStyle != TechnicolorStyle.OFF, TechniPatchType.LIGHTS); TechnicolorController.ToggleTechniPatches(config.TechnicolorWallsStyle != TechnicolorStyle.GRADIENT && config.TechnicolorWallsStyle != TechnicolorStyle.OFF, TechniPatchType.OBSTACLES); TechnicolorController.ToggleTechniPatches(config.TechnicolorBlocksStyle != TechnicolorStyle.GRADIENT && config.TechnicolorBlocksStyle != TechnicolorStyle.OFF, TechniPatchType.NOTES); TechnicolorController.ToggleTechniPatches(config.TechnicolorBombsStyle != TechnicolorStyle.GRADIENT && config.TechnicolorBombsStyle != TechnicolorStyle.OFF, TechniPatchType.BOMBS); TechnicolorController.ToggleTechniPatches(config.TechnicolorLightsStyle != TechnicolorStyle.OFF, TechniPatchType.FCKGRADIENTS); if (config.TechnicolorBlocksStyle != TechnicolorStyle.OFF && config.TechnicolorSabersStyle == TechnicolorStyle.OFF) { ChromaController.DoColorizerSabers = true; } } else { TechnicolorController.ToggleTechniPatches(false, TechniPatchType.LIGHTS); TechnicolorController.ToggleTechniPatches(false, TechniPatchType.OBSTACLES); TechnicolorController.ToggleTechniPatches(false, TechniPatchType.NOTES); TechnicolorController.ToggleTechniPatches(false, TechniPatchType.BOMBS); } }
#pragma warning disable SA1313 // Parameter names should begin with lower-case letter private static void Postfix() #pragma warning restore SA1313 // Parameter names should begin with lower-case letter { TechnicolorConfig config = TechnicolorConfig.Instance; if (config.TechnicolorEnabled && !ChromaController.ChromaIsActive) { GradientController.InitializeGradients(); } }
internal static void InitializeGradients() { TechnicolorConfig config = TechnicolorConfig.Instance; if (config.TechnicolorLightsStyle == TechnicolorStyle.GRADIENT) { Instance.UpdateTechnicolourEvent += Instance.RainbowLights; } if (config.TechnicolorLightsStyle != TechnicolorStyle.OFF && !config.DisableGradientBackground) { Instance.UpdateTechnicolourEvent += Instance.RainbowGradientBackground; } if (config.TechnicolorBlocksStyle == TechnicolorStyle.GRADIENT) { Instance.UpdateTechnicolourEvent += Instance.RainbowNotes; } if (config.TechnicolorWallsStyle == TechnicolorStyle.GRADIENT) { Instance.UpdateTechnicolourEvent += Instance.RainbowWalls; } if (config.TechnicolorBombsStyle == TechnicolorStyle.GRADIENT) { Instance.UpdateTechnicolourEvent += Instance.RainbowBombs; } // sabers use this script regardless of technicolour style if (config.TechnicolorSabersStyle != TechnicolorStyle.OFF) { switch (config.TechnicolorSabersStyle) { case TechnicolorStyle.GRADIENT: Instance.UpdateTechnicolourEvent += Instance.GradientTick; break; case TechnicolorStyle.PURE_RANDOM: Instance.SetupRandom(); Instance.UpdateTechnicolourEvent += Instance.RandomTick; break; case TechnicolorStyle.WARM_COLD: default: Instance.SetupWarmCold(); Instance.UpdateTechnicolourEvent += Instance.PaletteTick; break; } Instance.UpdateTechnicolourEvent += Instance.RainbowSabers; } }
private static void Callback(bool value) { TechnicolorEnabled = value; TechnicolorConfig config = TechnicolorConfig.Instance; if (value) { LightsEnabled = config.TechnicolorLightsStyle is not(TechnicolorStyle.OFF or TechnicolorStyle.GRADIENT); ObstaclesEnabled = config.TechnicolorWallsStyle is not(TechnicolorStyle.OFF or TechnicolorStyle.GRADIENT); NotesEnabled = config.TechnicolorBlocksStyle is not(TechnicolorStyle.OFF or TechnicolorStyle.GRADIENT); BombsEnabled = config.TechnicolorBombsStyle is not(TechnicolorStyle.OFF or TechnicolorStyle.GRADIENT); FckGradientsEnabled = config.TechnicolorLightsStyle != TechnicolorStyle.OFF; } else { LightsEnabled = false; ObstaclesEnabled = false; NotesEnabled = false; BombsEnabled = false; FckGradientsEnabled = false; } }
private GradientController( SaberColorizerManager saberColorizerManager, LightColorizerManager lightColorizerManager, ObstacleColorizerManager obstacleColorizerManager, NoteColorizerManager noteColorizerManager, BombColorizerManager bombColorizerManager, BackgroundGradientColorizer backgroundGradientColorizer) { _saberColorizerManager = saberColorizerManager; _lightColorizerManager = lightColorizerManager; _obstacleColorizerManager = obstacleColorizerManager; _noteColorizerManager = noteColorizerManager; _bombColorizerManager = bombColorizerManager; _backgroundGradientColorizer = backgroundGradientColorizer; _match = TechnicolorConfig.Instance.Desync; _mismatchSpeedOffset = _match ? 0 : 0.5f; _timeMult = TechnicolorConfig.Instance.TechnicolorLightsFrequency; _timeGlobalMult = (TechnicolorConfig.Instance.TechnicolorLightsFrequency / 2) + 0.7f; TechnicolorConfig config = TechnicolorConfig.Instance; if (config.TechnicolorLightsStyle == TechnicolorStyle.GRADIENT) { UpdateTechnicolourEvent += RainbowLights; } if (config.TechnicolorLightsStyle != TechnicolorStyle.OFF && !config.DisableGradientBackground) { UpdateTechnicolourEvent += RainbowGradientBackground; } if (config.TechnicolorBlocksStyle == TechnicolorStyle.GRADIENT) { UpdateTechnicolourEvent += RainbowNotes; } if (config.TechnicolorWallsStyle == TechnicolorStyle.GRADIENT) { UpdateTechnicolourEvent += RainbowWalls; } if (config.TechnicolorBombsStyle == TechnicolorStyle.GRADIENT) { UpdateTechnicolourEvent += RainbowBombs; } // sabers use this script regardless of technicolour style if (config.TechnicolorSabersStyle == TechnicolorStyle.OFF) { return; } switch (config.TechnicolorSabersStyle) { case TechnicolorStyle.GRADIENT: UpdateTechnicolourEvent += GradientTick; break; case TechnicolorStyle.PURE_RANDOM: _leftSaberPalette = new[] { Color.HSVToRGB(Random.value, 1f, 1f), Color.HSVToRGB(Random.value, 1f, 1f) }; _rightSaberPalette = new[] { Color.HSVToRGB(Random.value, 1f, 1f), Color.HSVToRGB(Random.value, 1f, 1f) }; UpdateTechnicolourEvent += RandomTick; break; default: _leftSaberPalette = TechnicolorController.TechnicolorWarmPalette; _rightSaberPalette = TechnicolorController.TechnicolorColdPalette; UpdateTechnicolourEvent += PaletteTick; break; } UpdateTechnicolourEvent += RainbowSabers; }