Exemple #1
0
 internal static void OnWorldJoin()
 {
     Core.LayerChange().Coroutine();               // This Changes Toggles it if there's a layer before I create one.
     WorldVolumes.WorldJoin();
     CustomPostProcessing.GrabLayer().Coroutine(); // Grabs Current Volume Render Layer (Some Worlds use different layers)
     CustomPostProcessing.WorldJoin().Coroutine(); // This creates one.
 }
Exemple #2
0
        internal static void InternalSettingsRefresh()
        {
            var debugList = new List <string>();

            try
            {
                s_PostProcessing = MelonPreferences.GetEntryValue <bool>(ModID, "PostProcessing");
                s_QuickMenu      = MelonPreferences.GetEntryValue <bool>(ModID, "QMToggle");

                if (!s_UICreated)
                {
                    return;               //Prevents Errors when other mods call OnPreferencesSaved();
                }
                var ProcessLayer = MainCamera != null ? MainCamera.gameObject != null?MainCamera.gameObject.GetComponent <PostProcessLayer>() : null : null;

                if (ProcessLayer != null)
                {
                    ProcessLayer.enabled = s_PostProcessing;
                }
                debugList.Add("Camera");
                WorldVolumes.WorldQMToggle       = MelonPreferences.GetEntryValue <bool>(ModID, "WorldQMToggle");
                WorldVolumes.WorldPostProcessing = MelonPreferences.GetEntryValue <bool>(ModID, "WorldPostProcessing");
                WorldVolumes.ToggleWorldVolumes(); debugList.Add("Volumes");
                if (!CustomPostProcessing.m_ObjectsCreated)
                {
                    return;
                }
                UpdateWeights(); debugList.Add("Weights");
                UpdateStates(); debugList.Add("States");
                UpdateProfiles(); debugList.Add("Profiles");

            #if QM
                QuickMenus.QMPrefsRefresh();
            #endif
            }
            catch (Exception e)
            {
                MelonLogger.Error(e);
                MelonLogger.Error("Please Post your Latest.Log in the VRCMG Discord and @Mention arion#1223 Please.");
                MelonLogger.Error("Debug Dump:");

                if (debugList.Count == 0)
                {
                    MelonLogger.Error("Pre Camera");
                    return;
                }
                foreach (var debugEntry in debugList)
                {
                    MelonLogger.Error("Entry: " + debugEntry + "Checked.");
                    if (debugEntry == "Profiles")
                    {
                        MelonLogger.Error("QMPrefs!!");
                    }
                }
            }
        }
        internal static void InitQM()
        {
            TPPQM = new QMToggleButton("ShortcutMenu", 1.24f, 1.75f, "Post\nProcessing", () =>
            {
                if (WorldVolumes.WorldQMToggle)
                {
                    MelonPreferences.SetEntryValue(Core.ModID, "WorldPostProcessing", true);
                    WorldVolumes.WorldPostProcessing = true;
                    WorldVolumes.ToggleWorldVolumes();
                    return;
                }
                MelonPreferences.SetEntryValue(Core.ModID, "PostProcessing", true);
                Core.s_PostProcessing = true;
                Core.LayerChange().Coroutine();
            }, "OFF", () =>
            {
                if (WorldVolumes.WorldQMToggle)
                {
                    MelonPreferences.SetEntryValue(Core.ModID, "WorldPostProcessing", false);
                    WorldVolumes.WorldPostProcessing = false;
                    WorldVolumes.ToggleWorldVolumes();
                    return;
                }
                MelonPreferences.SetEntryValue(Core.ModID, "PostProcessing", false);
                Core.s_PostProcessing = false;
                Core.LayerChange().Coroutine();
            }, "Post Processing", Color.black);

            TPPQM.btnOff.SetSizeButtonfor(QMX, QMY);
            TPPQM.btnOn.SetSizeButtonfor(QMX, QMY);
            TPPQM.getGameObject().SetSizeButtonfor(1.9f, 1.8f);
            TPPQM.getGameObject().GetComponent <Image>().enabled = false;
            TPPQM.getGameObject().AddComponent <BoxCollider>();
            TPPQM.getGameObject().AddComponent <VRC_UiShape>();
            TPPQM.getGameObject().AddComponent <GraphicRaycaster>();
            TPPQM.btnOn.transform.Find("Text_ON").GetComponent <RectTransform>().localPosition  = new Vector3(0, 65, 0);
            TPPQM.btnOn.transform.Find("Text_ON").GetComponent <RectTransform>().localScale     = new Vector3(0.8f, 0.8f, 1);
            TPPQM.btnOff.transform.Find("Text_ON").GetComponent <RectTransform>().localPosition = new Vector3(0, 65, 0);
            TPPQM.btnOff.transform.Find("Text_ON").GetComponent <RectTransform>().localScale    = new Vector3(0.8f, 0.8f, 1);

            TPPQM.getGameObject().GetComponent <RectTransform>().localScale      -= new Vector3(0, 0.2f, 0);
            TPPQM.getGameObject().GetComponent <RectTransform>().anchoredPosition = new Vector2(-107.2f, -1340.8f);
            TPPQM.setToggleState(Core.s_PostProcessing);
            TPPQM.setActive(Core.s_QuickMenu);
            TPPQM.getGameObject().name = "Post-Processing";
            QMInit = true;
        }
Exemple #4
0
        internal static void InternalSettingsRefresh()
        {
            s_PostProcessing = MelonPreferences.GetEntryValue <bool>(ModID, "PostProcessing");
            s_QuickMenu      = MelonPreferences.GetEntryValue <bool>(ModID, "QMToggle");

            if (!s_UICreated)
            {
                return;               //Prevents Errors when other mods call OnPreferencesSaved();
            }
            var ProcessLayer = MainCamera.gameObject.GetComponent <PostProcessLayer>();

            if (ProcessLayer != null)
            {
                ProcessLayer.enabled = s_PostProcessing;
            }

            WorldVolumes.WorldQMToggle       = MelonPreferences.GetEntryValue <bool>(ModID, "WorldQMToggle");
            WorldVolumes.WorldPostProcessing = MelonPreferences.GetEntryValue <bool>(ModID, "WorldPostProcessing");
            WorldVolumes.ToggleWorldVolumes();

            if (!CustomPostProcessing.m_ObjectsCreated)
            {
                return;
            }
            #region Volume Weights
            CustomPostProcessing.s_DarkMode.m_PostProcessVolume.weight    = (MelonPreferences.GetEntryValue <float>(ModID, "Dark-Weight") / 100).Stabalize(0, 90f);
            CustomPostProcessing.s_Bloom.m_PostProcessVolume.weight       = (MelonPreferences.GetEntryValue <float>(ModID, "Bloom-Weight") / 100).Stabalize(0, 100f);
            CustomPostProcessing.s_Saturation.m_PostProcessVolume.weight  = (MelonPreferences.GetEntryValue <float>(ModID, "Saturation-Weight") / 100).Stabalize(0, 100f);
            CustomPostProcessing.s_Contrast.m_PostProcessVolume.weight    = (MelonPreferences.GetEntryValue <float>(ModID, "Contrast-Weight") / 100).Stabalize(0, 90f);
            CustomPostProcessing.s_Temperature.m_PostProcessVolume.weight = (MelonPreferences.GetEntryValue <float>(ModID, "Temperature-Weight") / 100).Stabalize(0, 100f);
            #endregion
            #region Object States
            CustomPostProcessing.s_DarkMode.enabled    = MelonPreferences.GetEntryValue <bool>(ModID, "Dark-Mode");
            CustomPostProcessing.s_Bloom.enabled       = MelonPreferences.GetEntryValue <bool>(ModID, "Bloom");
            CustomPostProcessing.s_Saturation.enabled  = MelonPreferences.GetEntryValue <bool>(ModID, "Saturation");
            CustomPostProcessing.s_Contrast.enabled    = MelonPreferences.GetEntryValue <bool>(ModID, "Contrast");
            CustomPostProcessing.s_Temperature.enabled = MelonPreferences.GetEntryValue <bool>(ModID, "Temperature");
            #endregion
            #region Profile Values
            CustomPostProcessing.m_DarknessValue    = MelonPreferences.GetEntryValue <float>(ModID, "DarknessValue").Stabalize(0, 100);
            CustomPostProcessing.m_BloomValue       = MelonPreferences.GetEntryValue <float>(ModID, "BloomValue").Stabalize(0, 100);
            CustomPostProcessing.m_ContrastValue    = MelonPreferences.GetEntryValue <float>(ModID, "ContrastValue").Stabalize(-90, 90);
            CustomPostProcessing.m_SaturationValue  = MelonPreferences.GetEntryValue <float>(ModID, "SaturationValue").Stabalize(-100, 100);
            CustomPostProcessing.m_TemperatureValue = MelonPreferences.GetEntryValue <float>(ModID, "TemperatureValue").Stabalize(-100, 100);
            #endregion
        }