コード例 #1
0
        protected bool LoadSettings()
        {
            if (ModPrefs.GetString("TogglePOV", "Version", TogglePOVPlugin.PLUGIN_VERSION, true) != TogglePOVPlugin.PLUGIN_VERSION)
            {
                ModPrefs.SetString("TogglePOV", "Version", TogglePOVPlugin.PLUGIN_VERSION);
                ModPrefs.SetFloat("TogglePOV", "fFOV", DEFAULT_FOV);
                ModPrefs.SetBool("TogglePOV", "bShowHair", SHOW_HAIR);
                ModPrefs.SetFloat("TogglePOV", "fMaleOffset", MALE_OFFSET);
                ModPrefs.SetFloat("TogglePOV", "fFemaleOffset", FEMALE_OFFSET);
            }
            else
            {
                currentfov    = DEFAULT_FOV = Mathf.Clamp(ModPrefs.GetFloat("TogglePOV", "fFOV", DEFAULT_FOV, true), 1f, MAXFOV);
                SHOW_HAIR     = ModPrefs.GetBool("TogglePOV", "bShowHair", SHOW_HAIR, true);
                MALE_OFFSET   = ModPrefs.GetFloat("TogglePOV", "fMaleOffset", MALE_OFFSET, true);
                FEMALE_OFFSET = ModPrefs.GetFloat("TogglePOV", "fFemaleOffset", FEMALE_OFFSET, true);
            }

            try
            {
                string keystring = ModPrefs.GetString("TogglePOV", "POVHotkey", hotkey.ToString(), true);
                hotkey = (KeyCode)Enum.Parse(typeof(KeyCode), keystring, true);
            }
            catch (Exception)
            {
                Console.WriteLine("Using default hotkey ({0})", hotkey.ToString());
                return(false);
            }

            return(true);
        }
コード例 #2
0
        public static float Scale(VideoPlacement placement)
        {
            switch (placement)
            {
            case VideoPlacement.Background:
                return(30);

            case VideoPlacement.Center:
                return(8);

            case VideoPlacement.Left:
                return(4);

            case VideoPlacement.Right:
                return(4);

            case VideoPlacement.Bottom:
                return(2);

            case VideoPlacement.Top:
                return(3);

            default:     // Custom
                return(ModPrefs.GetFloat(Plugin.PluginName, "CustomScale", 6f, true));
            }
        }
コード例 #3
0
        public static void Load()
        {
            int defaultKeycode;

            if (XRDevice.model.IndexOf("rift", StringComparison.InvariantCultureIgnoreCase) != -1)
            {
                defaultKeycode = (int)ConInput.Oculus.LeftThumbstickPress;
            }
            else if (XRDevice.model.IndexOf("vive", StringComparison.InvariantCultureIgnoreCase) != -1)
            {
                defaultKeycode = (int)ConInput.Vive.LeftTrackpadPress;
            }
            else
            {
                defaultKeycode = (int)ConInput.WinMR.LeftThumbstickPress;
            }

            DisplayLyrics = ModPrefs.GetBool(PrefsSection, "Enabled", true);
            ToggleKeyCode = ModPrefs.GetInt(PrefsSection, nameof(ToggleKeyCode), defaultKeycode);

            DisplayDelay = ModPrefs.GetFloat(PrefsSection, nameof(DisplayDelay), -.1f);
            HideDelay    = ModPrefs.GetFloat(PrefsSection, nameof(HideDelay), 0f);

            VerboseLogging = ModPrefs.GetBool(PrefsSection, nameof(VerboseLogging), false);
        }
コード例 #4
0
 public void OnApplicationStart()
 {
     if (!CheckPHIBL())
     {
         float phong      = ModPrefs.GetFloat("PHIBL", "Tessellation.Phong", 0, true);
         float edgelength = ModPrefs.GetFloat("PHIBL", "Tessellation.EdgeLength", 15, true);
         if (phong < 0f)
         {
             phong = 0f;
         }
         else if (phong > 1f)
         {
             phong = 1f;
         }
         if (edgelength < 2f)
         {
             edgelength = 2f;
         }
         else if (edgelength > 50f)
         {
             edgelength = 50f;
         }
         Shader.SetGlobalFloat("_Phong", phong);
         Shader.SetGlobalFloat("_EdgeLength", edgelength);
     }
 }
コード例 #5
0
ファイル: Main.cs プロジェクト: M-oons/VRChat-Mods
        public override void OnApplicationStart()
        {
            ModPrefs.RegisterCategory("PortableMirror", "PortableMirror");
            ModPrefs.RegisterPrefFloat("PortableMirror", "MirrorScaleX", 5f, "Mirror Scale X");
            ModPrefs.RegisterPrefFloat("PortableMirror", "MirrorScaleY", 3f, "Mirror Scale Y");
            ModPrefs.RegisterPrefBool("PortableMirror", "OptimizedMirror", false, "Optimized Mirror");
            ModPrefs.RegisterPrefBool("PortableMirror", "CanPickupMirror", false, "Can Pickup Mirror");
            ModPrefs.RegisterPrefString("PortableMirror", "MirrorKeybind", "Alpha1", "Toggle Mirror Keybind");

            _mirrorScaleX    = ModPrefs.GetFloat("PortableMirror", "MirrorScaleX");
            _mirrorScaleY    = ModPrefs.GetFloat("PortableMirror", "MirrorScaleY");
            _optimizedMirror = ModPrefs.GetBool("PortableMirror", "OptimizedMirror");
            _canPickupMirror = ModPrefs.GetBool("PortableMirror", "CanPickupMirror");
            _mirrorKeybind   = Utils.GetMirrorKeybind();

            MelonModLogger.Log("Settings can be configured in UserData\\MelonPreferences.cfg");
            MelonModLogger.Log($"[{_mirrorKeybind}] -> Toggle portable mirror");

            MelonMod uiExpansionKit = MelonLoader.Main.Mods.Find(m => m.InfoAttribute.Name == "UI Expansion Kit");

            if (uiExpansionKit != null)
            {
                uiExpansionKit.InfoAttribute.SystemType.Assembly.GetTypes().First(t => t.FullName == "UIExpansionKit.API.ExpansionKitApi").GetMethod("RegisterWaitConditionBeforeDecorating", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static).Invoke(null, new object[]
                {
                    CreateQuickMenuButton()
                });
            }
        }
コード例 #6
0
        public void Init(Gun g, RaycastHit raycastHit)
        {
            go       = g.gameObject;
            hitPoint = raycastHit.point;
            gun      = go.GetComponent <Gun>();

            sj = go.AddComponent <SpringJoint>();
            sj.autoConfigureConnectedAnchor = false;
            sj.spring = ModPrefs.GetFloat(BuildInfo.Name, "strength");
            sj.damper = ModPrefs.GetFloat(BuildInfo.Name, "damper");
            sj.anchor = go.transform.InverseTransformPoint(gun.firePointTransform.position);

            Rigidbody rb = raycastHit.rigidbody;

            if (rb)
            {
                sj.connectedBody   = rb;
                sj.connectedAnchor = rb.transform.InverseTransformPoint(hitPoint);
                connected          = true;
            }
            else
            {
                sj.connectedAnchor = hitPoint;
            }

            lr                = go.AddComponent <LineRenderer>();
            lr.material       = new Material(Shader.Find("Unlit/Texture"));
            lr.material.color = Color.black;
            lr.startColor     = Color.black;
            lr.endColor       = Color.white;
            lr.startWidth     = .05f;
            lr.endWidth       = .05f;
        }
コード例 #7
0
        static bool Prefix(MirrorReflection __instance)
        {
            Map Map;

            if (null != (Map = UnityEngine.Object.FindObjectOfType <Map>()))
            {
                Map.GetType().GetField("mirrors", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(Map, null);
            }
            MirrorReflectionPlus MirrorPlus;

            if (null == (MirrorPlus = __instance.GetComponent <MirrorReflectionPlus>()))
            {
                MirrorPlus = __instance.gameObject.AddComponent <MirrorReflectionPlus>();
            }
            int texturesize = ModPrefs.GetInt("MirrorHelper", "Resolution", 2048, true);

            if (texturesize <= 1024)
            {
                texturesize = 1024;
            }
            else if (texturesize <= 2048)
            {
                texturesize = 2048;
            }
            else
            {
                texturesize = 4096;
            }
            MirrorPlus.m_ClipPlaneOffset = ModPrefs.GetFloat("MirrorHelper", "ClipPlaneOffset", 0, true);
            MirrorPlus.m_ReflectLayers   = __instance.m_ReflectLayers;
            MirrorPlus.m_TextureSize     = texturesize;
            UnityEngine.Object.Destroy(__instance);
            return(false);
        }
コード例 #8
0
        private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
        {
            if (arg0.name == "Menu")
            {
                modEnable = false;
                var settingsSubmenu = SettingsUI.CreateSubMenu("AutoPause");
                var en = settingsSubmenu.AddBool("AutoPause Enabled");
                en.GetValue += delegate { return(ModPrefs.GetBool("Auros's AutoPause", "Enabled", true, true)); };
                en.SetValue += delegate(bool value) { ModPrefs.SetBool("Auros's AutoPause", "Enabled", value); };

                var pq = settingsSubmenu.AddBool("FPS Pause");
                pq.GetValue += delegate { return(ModPrefs.GetBool("Auros's AutoPause", "FPSCheckerOn", false, true)); };
                pq.SetValue += delegate(bool value) { ModPrefs.SetBool("Auros's AutoPause", "FPSCheckerOn", value); };

                float[] fpsValues    = { 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90 };
                var     fpsThreshold = settingsSubmenu.AddList("FPS Threshold", fpsValues);
                fpsThreshold.GetValue    += delegate { return(ModPrefs.GetFloat("Auros's AutoPause", "FPSThreshold", 40, true)); };
                fpsThreshold.SetValue    += delegate(float value) { ModPrefs.SetFloat("Auros's AutoPause", "FPSThreshold", value); };
                fpsThreshold.FormatValue += delegate(float value) { return(string.Format("{0:0}", value)); };
                System.Console.WriteLine("[AutoPause] Settings Created");
                //System.Console.Read();

                //SharedCoroutineStarter.instance.StartCoroutine(DelayedEnable());
            }
        }
コード例 #9
0
        public void OnApplicationStart()
        {
            lightIntensityMax = ModPrefs.GetFloat("PHIBL", "Light.maxIntensity", 10f, true);

            Console.WriteLine(Application.productName);
            Control xmlLocale = new Control("PHIBL/Localization", Application.systemLanguage.ToString() + ".xml", "GUIStrings", new List <Data>
            {
                new GUIStrings("Strings")
            });

            xmlLocale.Read();
            xmlLocale.Write();
            QualitySettings.SetQualityLevel(2, false);
            QualitySettings.masterTextureLimit       = 0;
            QualitySettings.softVegetation           = true;
            QualitySettings.softParticles            = true;
            QualitySettings.pixelLightCount          = 8;
            QualitySettings.realtimeReflectionProbes = true;
            QualitySettings.vSyncCount            = ModPrefs.GetInt("PHIBL", "VSync", 1, true);
            QualitySettings.shadowResolution      = ShadowResolution.VeryHigh;
            QualitySettings.shadowProjection      = ShadowProjection.CloseFit;
            QualitySettings.shadowCascades        = 4;
            QualitySettings.shadowDistance        = ModPrefs.GetFloat("PHIBL", "shadowDistance", 30f, true);
            QualitySettings.asyncUploadBufferSize = 128;
            Shader.SetGlobalFloat("_MinEdgeLength", 2f);
            HarmonyInstance.Create(Name).PatchAll(Assembly.GetExecutingAssembly());
        }
コード例 #10
0
 public void OnApplicationStart()
 {
     m_minSpeed           = ModPrefs.GetFloat("Camera", "fMinSpeed", 10, true);
     m_maxSpeed           = ModPrefs.GetFloat("Camera", "fMaxSpeed", 180, true);
     m_cameraAcceleration = ModPrefs.GetFloat("Camera", "fCameraAcceleration", 5, true);
     useEnglish           = ModPrefs.GetBool("Camera", "bUseEnglish", Application.systemLanguage != SystemLanguage.Japanese, true);
 }
コード例 #11
0
 public void Start()
 {
     threshold         = ModPrefs.GetFloat(name, "FPSThreshold", threshold, true);
     fpsCheckerEnabled = ModPrefs.GetBool(name, "FPSCheckerOn", fpsCheckerEnabled, true);
     period            = ModPrefs.GetFloat(name, "ResponseTime", period, true);
     StartCoroutine(WaitForStart());
 }
コード例 #12
0
        public static void Load()
        {
            Length = ModPrefs.GetFloat(Plugin.Name, nameof(Length), 1f, true);
            Length = Math.Max(0.01f, Math.Min(2f, Length));

            IsTrailEnabled = ModPrefs.GetBool(Plugin.Name, nameof(IsTrailEnabled), true, true);

            TrailLength = ModPrefs.GetInt(Plugin.Name, nameof(TrailLength), 20, true);
            TrailLength = Math.Max(5, Math.Min(100, TrailLength));

            GripLeftPosition = ParseVector3(ModPrefs.GetString(Plugin.Name, nameof(GripLeftPosition), "0,0,0", true)) / 100f;
            GripLeftPosition = new Vector3
            {
                x = Mathf.Clamp(GripLeftPosition.x, -0.5f, 0.5f),
                y = Mathf.Clamp(GripLeftPosition.y, -0.5f, 0.5f),
                z = Mathf.Clamp(GripLeftPosition.z, -0.5f, 0.5f)
            };
            GripLeftRotation = Quaternion.Euler(ParseVector3(ModPrefs.GetString(Plugin.Name, nameof(GripLeftRotation), "0,0,0", true)));

            GripRightPosition = ParseVector3(ModPrefs.GetString(Plugin.Name, nameof(GripRightPosition), "0,0,0", true)) / 100f;
            GripRightPosition = new Vector3
            {
                x = Mathf.Clamp(GripRightPosition.x, -0.5f, 0.5f),
                y = Mathf.Clamp(GripRightPosition.y, -0.5f, 0.5f),
                z = Mathf.Clamp(GripRightPosition.z, -0.5f, 0.5f)
            };
            GripRightRotation = Quaternion.Euler(ParseVector3(ModPrefs.GetString(Plugin.Name, nameof(GripRightRotation), "0,0,0", true)));
        }
コード例 #13
0
ファイル: BoneManager.cs プロジェクト: emorins/PHPlugins
 void OnEnable()
 {
     scaleMin      = ModPrefs.GetFloat("BoneManager", "Scale.min", 0f);
     scaleMax      = ModPrefs.GetFloat("BoneManager", "Scale.max", 2f);
     positionRange = ModPrefs.GetFloat("BoneManager", "Position.range", 0.1f);
     rotationRange = ModPrefs.GetFloat("BoneManager", "Rotation.range", 60f);
     StartCoroutine(ApplyBone());
 }
コード例 #14
0
        protected override bool LoadSettings()
        {
            base.LoadSettings();

            manageCursorVisibility    = false;
            Guitime.pos               = new Vector2(1f, 1f);
            Camera.main.nearClipPlane = Mathf.Clamp(ModPrefs.GetFloat("LockOnPlugin", "NearClipPlane", Camera.main.nearClipPlane, true), 0.001f, 0.06f);
            return(true);
        }
コード例 #15
0
        static void Postfix(MPLightCtrl __instance)
        {
            var instance    = Traverse.Create(__instance);
            var viIntensity = instance.Field("viIntensity").GetValue();
            var ValueInfo   = Traverse.Create(viIntensity);
            var slider      = ValueInfo.Field("slider").GetValue <Slider>();

            slider.minValue = 0f;
            slider.maxValue = ModPrefs.GetFloat("PHIBL", "Light.maxIntensity", 10f, true);
        }
コード例 #16
0
        bool LoadSettings()
        {
            columnCount         = ModPrefs.GetInt("BetterSceneLoader", "ColumnCount", 3, true);
            useExternalSavedata = ModPrefs.GetBool("BetterSceneLoader", "UseExternalSavedata", true, true);
            scrollSensitivity   = ModPrefs.GetFloat("BetterSceneLoader", "ScrollSensitivity", 3f, true);
            autoClose           = ModPrefs.GetBool("BetterSceneLoader", "AutoClose", true, true);
            smallWindow         = ModPrefs.GetBool("BetterSceneLoader", "SmallWindow", true, true);

            UpdateWindow();
            return(true);
        }
コード例 #17
0
        public void Awake()
        {
            iniModEnable   = ModPrefs.GetBool(name, "Enabled", iniModEnable, true);
            threshold      = ModPrefs.GetFloat(name, "FPSThreshold", threshold, true);
            fpsCheckEnable = ModPrefs.GetBool(name, "FPSCheckerOn", fpsCheckEnable, true);
            updatePeriod   = ModPrefs.GetFloat(name, "ResponseTime", updatePeriod, true);

            _playerController = Resources.FindObjectsOfTypeAll <PlayerController>().FirstOrDefault();
            _gamePlayManager  = Resources.FindObjectsOfTypeAll <StandardLevelGameplayManager>().FirstOrDefault();
            System.Console.WriteLine("[AutoPause] Pauser Awakened");
        }
コード例 #18
0
        public static void Read()
        {
            // Read our config options, if they already exist
            EnableHiddenBlocks = ModPrefs.GetBool(Plugin.Instance.Name, "Enabled", false);
            BlockHideDistance  = ModPrefs.GetFloat(Plugin.Instance.Name, "BlockHideDistance", 4.5f);

            // Don't allow the user to set lower values, as it can be used to gain an unfair advantage by seeing through notes
            if (BlockHideDistance < 4.5f)
            {
                BlockHideDistance = 4.5f;
            }
        }
コード例 #19
0
        public Config(string filePath)
        {
            FilePath = filePath;

            if (File.Exists(filePath))
            {
                Load();
            }
            else
            {
                // If their old config exists, rename it then load their settings
                if (File.Exists("UserData\\BetterTwitchChat.ini"))
                {
                    File.Move("UserData\\BetterTwitchChat.ini", "UserData\\EnhancedTwitchChat.ini");
                    Load();
                    Plugin.Log("Migrated settings from BetterTwitchChat.ini to EnhancedTwitchChat.ini");
                }
                else
                {
                    string configSectionName = "BetterTwitchChat";
                    if (ModPrefs.GetString(configSectionName, "ChannelToJoin") != String.Empty && !ModPrefs.GetBool(configSectionName, "Migrated", false))
                    {
                        //TwitchoAuthToken = ModPrefs.GetString(configSectionName, "oAuth_Token", string.Empty);
                        //TwitchUsername = ModPrefs.GetString(configSectionName, "Username", string.Empty);
                        TwitchChannel     = ModPrefs.GetString(configSectionName, "ChannelToJoin", String.Empty).ToLower().Replace(" ", "");
                        ChatPosition      = new Vector3(ModPrefs.GetFloat(configSectionName, "PositionX", 2.0244143f), ModPrefs.GetFloat(configSectionName, "PositionY", 0.373768f), ModPrefs.GetFloat(configSectionName, "PositionZ", 0.08235432f));
                        ChatRotation      = new Vector3(ModPrefs.GetFloat(configSectionName, "RotationX", 2.026023f), ModPrefs.GetFloat(configSectionName, "RotationY", 97.58616f), ModPrefs.GetFloat(configSectionName, "RotationZ", 1.190764f));
                        TextColor         = new Color(ModPrefs.GetFloat(configSectionName, "TextColorRed", 1), ModPrefs.GetFloat(configSectionName, "TextColorGreen", 1), ModPrefs.GetFloat(configSectionName, "TextColorBlue", 1), ModPrefs.GetFloat(configSectionName, "TextColorAlpha", 1));
                        BackgroundColor   = new Color(ModPrefs.GetFloat(configSectionName, "BackgroundRed", 0), ModPrefs.GetFloat(configSectionName, "BackgroundGreen", 0), ModPrefs.GetFloat(configSectionName, "BackgroundBlue", 0), ModPrefs.GetFloat(configSectionName, "BackgroundAlpha", 0.5f));
                        MaxMessages       = ModPrefs.GetInt(configSectionName, "MaxChatLines", 20);
                        ChatWidth         = ModPrefs.GetFloat(configSectionName, "ChatWidth", 160);
                        BackgroundPadding = ModPrefs.GetFloat(configSectionName, "BackgroundPadding", 4);
                        FontName          = ModPrefs.GetString(configSectionName, "SystemFontName", "Segoe UI");
                        ReverseChatOrder  = ModPrefs.GetBool(configSectionName, "ReverseChatOrder", false);
                        LockChatPosition  = ModPrefs.GetBool(configSectionName, "LockChatPosition", false);

                        ModPrefs.SetBool(configSectionName, "Migrated", true);

                        Plugin.Log("Migrated old config settings to EnhancedTwitchChat.ini!");
                    }
                    Save();
                }
            }

            _configWatcher = new FileSystemWatcher($"{Environment.CurrentDirectory}\\UserData")
            {
                NotifyFilter        = NotifyFilters.LastWrite,
                Filter              = "EnhancedTwitchChat.ini",
                EnableRaisingEvents = true
            };
            _configWatcher.Changed += ConfigWatcherOnChanged;
        }
コード例 #20
0
ファイル: Prefs.cs プロジェクト: Ibodan/BloomMod
        public Params LoadForCamera(string cameraName)
        {
            Params ret      = new Params();
            var    defaults = new Params();

            ret.baseColorBoost          = ModPrefs.GetFloat(SECTIONBASE + "!" + cameraName, "BaseColorBoost", defaults.baseColorBoost);
            ret.baseColorBoostThreshold = ModPrefs.GetFloat(SECTIONBASE + "!" + cameraName, "BaseColorBoostThreshold", defaults.baseColorBoostThreshold);
            ret.bloomIntensity          = ModPrefs.GetFloat(SECTIONBASE + "!" + cameraName, "BloomIntensity", defaults.bloomIntensity);
            ret.bloomIterations         = ModPrefs.GetInt(SECTIONBASE + "!" + cameraName, "BloomIterations", defaults.bloomIterations);
            ret.textureWidth            = ModPrefs.GetFloat(SECTIONBASE + "!" + cameraName, "TextureWidth", defaults.textureWidth);

            return(ret);
        }
コード例 #21
0
        bool LoadSettings()
        {
            columnCount               = ModPrefs.GetInt("BetterSceneLoader", "ColumnCount", 3, true);
            useExternalSavedata       = ModPrefs.GetBool("BetterSceneLoader", "UseExternalSavedata", true, true);
            scrollSensitivityImages   = ModPrefs.GetFloat("BetterSceneLoader", "ScrollSensitivityImages", 3f, true);
            scrollSensitivityDropDown = ModPrefs.GetFloat("BetterSceneLoader", "ScrollSensitivityDropDown", 10f, true);
            autoClose   = ModPrefs.GetBool("BetterSceneLoader", "AutoClose", true, true);
            smallWindow = ModPrefs.GetBool("BetterSceneLoader", "SmallWindow", true, true);
            UIScale     = ModPrefs.GetFloat("BetterSceneLoader", "UIScale", 1f, true);



            return(true);
        }
コード例 #22
0
        static bool Prefix(MPLightCtrl __instance, string _text)
        {
            var   instance    = Traverse.Create(__instance);
            var   m_OCILight  = instance.Field("m_OCILight").GetValue <OCILight>();
            var   viIntensity = instance.Field("viIntensity").GetValue();
            var   ValueInfo   = Traverse.Create(viIntensity);
            var   inputField  = ValueInfo.Field("inputField").GetValue <InputField>();
            var   slider      = ValueInfo.Field("slider").GetValue <Slider>();
            float value       = Mathf.Clamp(__instance.StringToFloat(_text), 0f, ModPrefs.GetFloat("PHIBL", "Light.maxIntensity", 10f, true));

            m_OCILight.SetIntensity(value, false);
            inputField.text = m_OCILight.lightInfo.intensity.ToString("0.00");
            slider.value    = m_OCILight.lightInfo.intensity;
            return(false);
        }
コード例 #23
0
        private void Start()
        {
            instance = Singleton <HSceneManager> .Instance;
            camera   = FindObjectOfType <CameraControl_Ver2>();
            defaultCameraMoveSpeed = camera.moveSpeed;

            lockOnHotkey              = new Hotkey(ModPrefs.GetString("LockOnPlugin", "LockOnHotkey", "M", true).ToLower()[0].ToString(), 0.5f);
            rotationHotkey            = new Hotkey(ModPrefs.GetString("LockOnPlugin", "RotationHotkey", "N", true).ToLower()[0].ToString(), 0.5f);
            lockedZoomSpeed           = ModPrefs.GetFloat("LockOnPlugin", "LockedZoomSpeed", 5.0f, true);
            lockedMinDistance         = Math.Abs(ModPrefs.GetFloat("LockOnPlugin", "LockedMinDistance", 0.2f, true));
            lockedTrackingSpeed1      = lockedTrackingSpeed2 = Math.Abs(ModPrefs.GetFloat("LockOnPlugin", "LockedTrackingSpeed", 0.1f, true));
            boneList                  = ModPrefs.GetString("LockOnPlugin", "BoneList", "J_Head|J_Mune00|J_Spine01|J_Kokan", true).Split('|');
            camera.isOutsideTargetTex = !Convert.ToBoolean(ModPrefs.GetString("LockOnPlugin", "HideCameraTarget", "True", true));
            manageCursorVisibility    = Convert.ToBoolean(ModPrefs.GetString("LockOnPlugin", "ManageCursorVisibility", "True", true));
        }
コード例 #24
0
        void ReadPreferences()
        {
            _colorLeft = new Color(
                ModPrefs.GetFloat(Name, "LeftRed", 255, true) / 255f,
                ModPrefs.GetFloat(Name, "LeftGreen", 4, true) / 255f,
                ModPrefs.GetFloat(Name, "LeftBlue", 4, true) / 255f
                );

            _colorRight = new Color(
                ModPrefs.GetFloat(Name, "RightRed", 0, true) / 255f,
                ModPrefs.GetFloat(Name, "RightGreen", 192, true) / 255f,
                ModPrefs.GetFloat(Name, "RightBlue", 255, true) / 255f
                );

            _overrideCustomSabers = ModPrefs.GetBool(Name, "OverrideCustomSabers", true, true);
        }
コード例 #25
0
ファイル: UserModule.cs プロジェクト: emorins/PHPlugins
        private void UserCustomModule()
        {
            GUILayout.Label(GUIStrings.Global_Settings, titlestyle2);
            SliderGUI(QualitySettings.shadowDistance, 20f, 150f, 30f, x => QualitySettings.shadowDistance = x, " Shadow Distance ");
            SliderGUI(Camera.main.nearClipPlane, 0.01f, 1f, 0.06f, x => Camera.main.nearClipPlane         = x, new GUIContent(" Camra near clip plane "));
            ToggleGUI(Camera.main.useOcclusionCulling, new GUIContent(" Occlusion Culling "), x => Camera.main.useOcclusionCulling = x);
            //ToggleGUI(Camera.main.useJitteredProjectionMatrixForTransparentRendering, new GUIContent(" Use Jittered Projection Matrix For Transparent Rendering "), x => Camera.main.useJitteredProjectionMatrixForTransparentRendering = x);
            SelectGUI(ref vSyncCount, GUIStrings.Vsync, GUIStrings.Disable_vs_Enable, count => ModPrefs.SetInt("PHIBL", "VSync", count));
            ToggleGUI(ref asyncLoad, GUIStrings.Async_Load, enable => ModPrefs.SetBool("PHIBL", "AsyncLoad", enable));
            //ToggleGUI(ref forceDeferred, GUIStrings.Force_Deferred, enable => ModPrefs.SetBool("PHIBL", "ForceDeferred", enable));
            ToggleGUI(ref autoSetting, GUIStrings.Auto_Setting, enable => ModPrefs.SetBool("PHIBL", "AutoSetting", enable));
            ToggleGUI(ref disableLightMap, GUIStrings.DisableLightMap, disablelightmap => ModPrefs.SetBool("PHIBL", "DisableLightMap", disablelightmap));
            GUILayout.BeginHorizontal();
            GUILayout.Label(GUIStrings.Custom_Window, labelstyle);
            GUILayout.FlexibleSpace();
            if (GUILayout.Button(GUIStrings.Custom_Window_Remember, buttonstyleNoStretch, GUILayout.ExpandWidth(false)))
            {
                ModPrefs.SetFloat("PHIBL", "Window.width", windowRect.width);
                ModPrefs.SetFloat("PHIBL", "Window.height", windowRect.height);
                ModPrefs.SetFloat("PHIBL", "Window.x", windowRect.x);
                ModPrefs.SetFloat("PHIBL", "Window.y", windowRect.y);
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(space);
            float widthtemp;

            widthtemp = SliderGUI(
                value: windowRect.width,
                min: minwidth,
                max: UIUtils.Screen.width * 0.5f,
                reset: () => ModPrefs.GetFloat("PHIBL", "Window.width"),
                labeltext: GUIStrings.Window_Width,
                valuedecimals: "N0");
            if (widthtemp != windowRect.width)
            {
                windowRect.x    += (windowRect.width - widthtemp) * (windowRect.x) / (UIUtils.Screen.width - windowRect.width);
                windowRect.width = widthtemp;
            }
            windowRect.height = SliderGUI(
                value: windowRect.height,
                min: UIUtils.Screen.height * 0.2f,
                max: UIUtils.Screen.height - 10f,
                reset: () => ModPrefs.GetFloat("PHIBL", "Window.height"),
                labeltext: GUIStrings.Window_Height,
                valuedecimals: "N0");
            SelectGUI(ref screenShotSize, new GUIContent(" Screen Shot Size: "), 0);
        }
コード例 #26
0
ファイル: NeoMono.cs プロジェクト: kageyama7/LockOnPlugin
        protected override void LoadSettings()
        {
            base.LoadSettings();

            manageCursorVisibility = false;
            Guitime.pos            = new Vector2(1f, 1f);
            animMoveSetCurrent     = Mathf.Clamp(ModPrefs.GetInt("LockOnPlugin.Misc", "MovementAnimSet", 1, true), 0, animMoveSets.Count - 1);
            float nearClipPlane = Mathf.Clamp(ModPrefs.GetFloat("LockOnPlugin.Misc", "NearClipPlane", Camera.main.nearClipPlane, true), 0.001f, 0.06f);

            Camera.main.nearClipPlane = nearClipPlane;
            GameObject nearClipSlider = GameObject.Find("Slider NearClipPlane");

            if (nearClipSlider)
            {
                nearClipSlider.GetComponent <Slider>().value = nearClipPlane;
            }
        }
コード例 #27
0
 public static void OnModSettingsAppliedX()
 {
     NDBConfig.enabledByDefault        = ModPrefs.GetBool("NDB", "EnabledByDefault");
     NDBConfig.disallowInsideColliders = ModPrefs.GetBool("NDB", "DisallowInsideColliders");
     NDBConfig.distanceToDisable       = ModPrefs.GetFloat("NDB", "DistanceToDisable");
     NDBConfig.distanceDisable         = ModPrefs.GetBool("NDB", "DistanceDisable");
     NDBConfig.colliderSizeLimit       = ModPrefs.GetFloat("NDB", "ColliderSizeLimit");
     NDBConfig.onlyForMyBones          = ModPrefs.GetBool("NDB", "OnlyMe");
     NDBConfig.onlyForMeAndFriends     = ModPrefs.GetBool("NDB", "OnlyFriends");
     NDBConfig.dynamicBoneUpdateRate   = ModPrefs.GetInt("NDB", "DynamicBoneUpdateRate");
     NDBConfig.disallowDesktoppers     = ModPrefs.GetBool("NDB", "DisallowDesktoppers");
     NDBConfig.enableBoundsCheck       = ModPrefs.GetBool("NDB", "EnableJustIfVisible");
     NDBConfig.visiblityUpdateRate     = ModPrefs.GetFloat("NDB", "VisibilityUpdateRate");
     NDBConfig.onlyHandColliders       = ModPrefs.GetBool("NDB", "OnlyHandColliders");
     NDBConfig.keybindsEnabled         = ModPrefs.GetBool("NDB", "KeybindsEnabled");
     NDBConfig.onlyOptimize            = ModPrefs.GetBool("NDB", "OptimizeOnly");
     NDBConfig.updateMode = ModPrefs.GetInt("NDB", "UpdateMode");
 }
コード例 #28
0
 private void TessellationModule()
 {
     GUILayout.BeginHorizontal();
     GUILayout.Label(GUIStrings.Tessellation, titlestyle2);
     GUILayout.FlexibleSpace();
     if (GUILayout.Button(GUIStrings.Save, buttonstyleNoStretch))
     {
         ModPrefs.SetFloat("PHIBL", "Tessellation.Phong", phong);
         ModPrefs.SetFloat("PHIBL", "Tessellation.EdgeLength", edgelength);
     }
     GUILayout.EndHorizontal();
     SliderExGUI(value: phong, guiContent: GUIStrings.Tessellation_phong,
                 reset: () => ModPrefs.GetFloat("PHIBL", "Tessellation.Phong", 0.5f),
                 SetOutput: x => { phong = x; Shader.SetGlobalFloat(_Phong, x); });
     SliderGUI(value: edgelength, min: 2f, max: 50f, label: GUIStrings.Tessellation_edgelength,
               reset: () => ModPrefs.GetFloat("PHIBL", "Tessellation.EdgeLength", 15f),
               SetOutput: x => { edgelength = x; Shader.SetGlobalFloat(_EdgeLength, x); });
 }
コード例 #29
0
ファイル: Pauser.cs プロジェクト: Auros/Auros-s-Auto-Pause
        public void Awake()
        {
            iniVoicesEnabled = ModPrefs.GetBool(name, "Voices", iniVoicesEnabled, true);
            iniModEnable     = ModPrefs.GetBool(name, "Enabled", iniModEnable, true);
            threshold        = ModPrefs.GetFloat(name, "FPSThreshold", threshold, true);
            fpsCheckEnable   = ModPrefs.GetBool(name, "FPSCheckerOn", fpsCheckEnable, true);
            updatePeriod     = ModPrefs.GetFloat(name, "ResponseTime", updatePeriod, true);

            gameStateCheck = BS_Utils.Gameplay.Gamemode.GameMode;

            _playerController = Resources.FindObjectsOfTypeAll <PlayerController>().FirstOrDefault();
            _gamePlayManager  = Resources.FindObjectsOfTypeAll <StandardLevelGameplayManager>().FirstOrDefault();
            Log.AutoPause("Pauser Awakened");

            FPSTracker    = new SoundPlayer(Properties.Resources.fps);
            ReaxtsNerfGun = new SoundPlayer(Properties.Resources.tracking);

            Setup();
        }
コード例 #30
0
 public MirrorHelper()
 {
     shortcut        = ModPrefs.GetString("MirrorHelper", "Shortcut", "F6", true);
     texturesize     = ModPrefs.GetInt("MirrorHelper", "Resolution", 2048, true);
     clipplaneoffset = ModPrefs.GetFloat("MirrorHelper", "ClipPlaneOffset", 0, true);
     if (texturesize <= 1024)
     {
         texturesize = 1024;
     }
     else if (texturesize <= 2048)
     {
         texturesize = 2048;
     }
     else
     {
         texturesize = 4096;
     }
     ModPrefs.SetInt("MirrorHelper", "Resolution", texturesize);
 }