コード例 #1
0
 public override void OnPreferencesSaved()
 {
     Core.InternalSettingsRefresh();
 #if QM
     QuickMenus.QMPrefsRefresh();
 #endif
 }
コード例 #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!!");
                    }
                }
            }
        }