Exemplo n.º 1
0
        public static void PatchOptionsGraphicsPanel(bool patch)
        {
            try
            {
                OptionsGraphicsPanel _optionsGraphicsPanel = GameObject.Find("Graphics").GetComponent <OptionsGraphicsPanel>();

                if (_optionsGraphicsPanel != null)
                {
                    UIDropDown antialiasingDropdown = _optionsGraphicsPanel.GetType().GetField("m_AntialiasingDropdown", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(_optionsGraphicsPanel) as UIDropDown;

                    if (patch)
                    {
                        antialiasingDropdown.isInteractive = false;
                        antialiasingDropdown.opacity       = 0.3f;
                    }
                    else
                    {
                        antialiasingDropdown.isInteractive = true;
                        antialiasingDropdown.opacity       = 1f;
                    }
                }
            }
            catch (Exception e)
            {
                Debug.Log("[Render It!] ModUtils:PatchOptionsGraphicsPanel -> Exception: " + e.Message);
            }
        }
Exemplo n.º 2
0
        public void LoadLut(string lut)
        {
            if (string.IsNullOrEmpty(lut))
            {
                return;
            }
            Texture3DWrapper wrapper = BuiltInLuts.FirstOrDefault(t3d => t3d.name == lut);
            int index = wrapper != null?Array.IndexOf(BuiltInLuts, wrapper) : -1;

            if (index != -1)
            {
                ColorCorrectionManager.instance.currentSelection = index + 1;
                return;
            }
            var userLuts = UserLuts;

            Package.Asset asset = userLuts.Find(l => l.name == lut);
            index = asset != null?UserLuts.IndexOf(asset) : -1;

            if (index != -1)
            {
                ColorCorrectionManager.instance.currentSelection = index + BuiltInLuts.Length + 1;
            }
            OptionsGraphicsPanel ogp = FindObjectOfType <OptionsGraphicsPanel>();

            if (ogp == null)
            {
                return;
            }
            ogp.SendMessage("RefreshColorCorrectionLUTs");
        }
Exemplo n.º 3
0
 public void Awake()
 {
     try
     {
         _chirperPanel         = GameObject.Find("ChirperPanel").GetComponent <UIComponent>();
         _optionsPanel         = GameObject.Find("(Library) OptionsPanel").GetComponent <UIComponent>();
         _optionsGraphicsPanel = _optionsPanel.Find("Graphics").GetComponent <OptionsGraphicsPanel>();
     }
     catch (Exception e)
     {
         Debug.Log("[Stream It!] StreamManager:Awake -> Exception: " + e.Message);
     }
 }
Exemplo n.º 4
0
        public static void UpdateDepthOfField(bool enabled)
        {
            try
            {
                OptionsGraphicsPanel _optionsGraphicsPanel = GameObject.Find("Graphics").GetComponent <OptionsGraphicsPanel>();

                if (_optionsGraphicsPanel != null)
                {
                    UIDropDown dofTypeDropdown = _optionsGraphicsPanel.GetType().GetField("m_DOFTypeDropdown", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(_optionsGraphicsPanel) as UIDropDown;

                    dofTypeDropdown.selectedIndex = enabled ? 2 : 0;
                }
            }
            catch (Exception e)
            {
                Debug.Log("[Render It!] ModManager:UpdateDepthOfField -> Exception: " + e.Message);
            }
        }
        public static void InitAspectRatios(OptionsGraphicsPanel panel)
        {
            var mSupportedAspectRatios =
                (List <float>)
                typeof(OptionsGraphicsPanel).GetField("m_SupportedAspectRatios",
                                                      BindingFlags.NonPublic | BindingFlags.Instance)
                .GetValue(panel);

            mSupportedAspectRatios.Clear();
            var resolutions = Screen.resolutions;
            var list        = new List <string>();

            for (int index1 = 0; index1 < OptionsGraphicsPanelDetour.kAvailableAspectRatios.Length; ++index1)
            {
                for (int index2 = 0; index2 < resolutions.Length; ++index2)
                {
                    Resolution resolution = resolutions[index2];
                    if (MatchAspectRatio(panel, resolution.width, resolution.height,
                                         OptionsGraphicsPanelDetour.kAvailableAspectRatios[index1]))
                    {
                        mSupportedAspectRatios.Add(OptionsGraphicsPanelDetour.kAvailableAspectRatios[index1]);
                        list.Add(OptionsGraphicsPanelDetour.kAvailableAspectRatioNames[index1]);
                        break;
                    }
                }
            }
            if (mSupportedAspectRatios.Count == 0)
            {
                mSupportedAspectRatios.Add(OptionsGraphicsPanelDetour.kAvailableAspectRatios[0]);
                list.Add(OptionsGraphicsPanelDetour.kAvailableAspectRatioNames[0]);
            }
            var mAspectRatioDropdown =
                (UIDropDown)
                typeof(OptionsGraphicsPanel).GetField("m_AspectRatioDropdown",
                                                      BindingFlags.NonPublic | BindingFlags.Instance).GetValue(panel);

            mAspectRatioDropdown.localizedItems = list.ToArray();
            mAspectRatioDropdown.selectedIndex  = FindCurrentAspectRatio(panel);
        }
 private static bool MatchAspectRatio(OptionsGraphicsPanel panel, int width, int height, float aspect)
 {
     UnityEngine.Debug.Log("MatchAspectRatio");
     return(false);
 }
 public static void InitDisplayModes(OptionsGraphicsPanel panel)
 {
     UnityEngine.Debug.Log("InitDisplayModes");
 }
 public static void InitResolutions(OptionsGraphicsPanel panel)
 {
     UnityEngine.Debug.Log("InitResolutions");
 }
 private static int FindCurrentAspectRatio(OptionsGraphicsPanel panel)
 {
     UnityEngine.Debug.Log("FindCurrentAspectRatio");
     return(0);
 }