public static void ChangeColors()
        {
            colorManager = Resources.FindObjectsOfTypeAll <ColorManager>().FirstOrDefault();

            var playerDataModel = Resources.FindObjectsOfTypeAll <PlayerDataModel>().FirstOrDefault();

            colorSchemesSettings = playerDataModel.playerData.colorSchemesSettings;

            menuLightsManager = Resources.FindObjectsOfTypeAll <MenuLightsManager>().FirstOrDefault();
            bsLightManager    = Resources.FindObjectsOfTypeAll <LightWithIdManager>().FirstOrDefault();

            var overrideColorScheme = colorSchemesSettings.overrideDefaultColors ? colorSchemesSettings.GetSelectedColorScheme() : colorManager.GetField <ColorSchemeSO>("_defaultColorScheme").colorScheme;

            Utils.AdjustColorBW(overrideColorScheme);

            Plugin.Logger.Info("selected:" + overrideColorScheme.colorSchemeName);

            colorManager.SetPrivateField("_colorScheme", overrideColorScheme);

            SetMenuEnvironmentColors(overrideColorScheme);

            SetLogoColors(overrideColorScheme);
            SetMenuPlayersPlaceColors(overrideColorScheme);

            SetPointerColors(overrideColorScheme);

            SetColoredTextIconColors(overrideColorScheme);
            SetColoredImageColors(overrideColorScheme);

            SetSliderColors(overrideColorScheme);
            SetToggleColors(overrideColorScheme);
            SetAnimationClipColors(overrideColorScheme);
            SetButtonColors(overrideColorScheme);
            SetTMPUGUIColors(overrideColorScheme);
            SetMissionToggleColors(overrideColorScheme);
            SetTableCellColors(overrideColorScheme);
            SetFireWorkColors(overrideColorScheme);

            colorManager.Start();
            menuLightsManager.RefreshColors();

            currentColorScheme = overrideColorScheme;

            Plugin.Logger.Info("applied all colors");
        }
Пример #2
0
 public void SetColor(Color color)
 {
     defaultMenuLights = _menuLightsManager.GetField <MenuLightsPresetSO, MenuLightsManager>("_defaultPreset");
     _menuLightsManager?.SetColorPreset(CreateMenuLights(color), true);
     _menuLightsManager?.RefreshColors();
 }