Exemplo n.º 1
0
        public void OnApplicationStart()
        {
            Log("Creating Harmony Instance");
            harmony = HarmonyInstance.Create("com.kyle1413.BeatSaber.GamePlayModifiersPlus");
            ApplyPatches();
            CheckPlugins();

            if (twitchPluginInstalled)
            {
                InitStreamCore();
            }
            ChatConfig.Load();
            ReadPrefs();
            //Delete old config if it exists
            if (File.Exists(Path.Combine(Environment.CurrentDirectory, "UserData\\GamePlayModifiersPlusChatSettings.ini")))
            {
                try
                {
                    File.Delete(Path.Combine(Environment.CurrentDirectory, "UserData\\GamePlayModifiersPlusChatSettings.ini"));
                }
                catch (Exception ex)
                {
                    Log("Could not Delete Old Config: " + ex);
                }
            }
            cooldowns = new Cooldowns();
            defColorA.SetColor(new Color(1f, 0, 0));
            defColorB.SetColor(new Color(0, .706f, 1));

            if (ModPrefs.GetInt("GameplayModifiersPlus", "GameRumbleSetting", -1, false) != -1)
            {
                Log("Rumble Key Exists");
                setDefaultRumble = true;
            }
        }
Exemplo n.º 2
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());
        }
Exemplo n.º 3
0
        private void OnSceneLoaded(Scene arg0, LoadSceneMode arg1)
        {
            if (arg0.name != "MenuCore")
            {
                return;
            }

            var menu = SettingsUI.CreateSubMenu("FullComboDisplay");

            float[] effectVals = new float[effects.Length];
            for (int i = 0; i < effects.Length; i++)
            {
                effectVals[i] = i;
            }

            var enabled = menu.AddBool("Enabled");

            enabled.GetValue    += delegate { return(ModPrefs.GetBool("FCDisplay", "Enabled", true, true)); };
            enabled.SetValue    += delegate(bool value) { ModPrefs.SetBool("FCDisplay", "Enabled", value); };
            enabled.EnabledText  = "Enabled";
            enabled.DisabledText = "Disabled";

            var effect = menu.AddList("Miss Effect", effectVals);

            effect.GetValue    += delegate { return(ModPrefs.GetInt("FCDisplay", "MissEffect", 1, true)); };
            effect.SetValue    += delegate(float value) { ModPrefs.SetInt("FCDisplay", "MissEffect", (int)value); };
            effect.FormatValue += delegate(float value) { return(effects[(int)value]); };

            var vanilla = menu.AddBool("Vanilla Display (Combo Border)");

            vanilla.GetValue    += delegate { return(ModPrefs.GetBool("FCDisplay", "VanillaEnabled", false, true)); };
            vanilla.SetValue    += delegate(bool value) { ModPrefs.SetBool("FCDisplay", "VanillaEnabled", value); };
            vanilla.EnabledText  = "Visible";
            vanilla.DisabledText = "Hidden";
        }
Exemplo n.º 4
0
        public override void OnModSettingsApplied()
        {
            CameraSpeed = ModPrefs.GetInt(ModCategory, CameraSpeedPref);
            CameraSpeedAlt = ModPrefs.GetInt(ModCategory, CameraSpeedAltPref);

            CameraSpeed /= 1000;
            CameraSpeedAlt /= 1000;
        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)));
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        public static void playerProperties()
        {
            SubMenu            fitNessCalculating = SettingsUI.CreateSubMenu("Fitness Properties");
            BoolViewController units = fitNessCalculating.AddBool("Metric Units? (Kgs, cm)");

            units.GetValue += delegate { return(ModPrefs.GetBool(Plugin.alias, "lbskgs", false, true)); };
            units.SetValue += delegate(bool lork) { ModPrefs.SetBool(Plugin.alias, "lbskgs", lork); };

            bool lbsorkgs = ModPrefs.GetBool(Plugin.alias, "lbskgs", false, true);

            if (lbsorkgs) ////Converted to kgs
            {
                IntViewController weightKGS = fitNessCalculating.AddInt("Weight (kgs)", 36, 363, 1);
                weightKGS.GetValue += delegate { return(ModPrefs.GetInt(Plugin.alias, "weightKGS", 60, true)); };
                weightKGS.SetValue += delegate(int kgs)
                {
                    ModPrefs.SetInt(Plugin.alias, "weightKGS", kgs);
                };
            }/////// Freedom Units
            else
            {
                IntViewController weightLBS = fitNessCalculating.AddInt("Weight (lbs)", 80, 800, 2);
                weightLBS.GetValue += delegate { return(ModPrefs.GetInt(Plugin.alias, "weightLBS", 132, true)); };
                weightLBS.SetValue += delegate(int lbs)
                {
                    ModPrefs.SetInt(Plugin.alias, "weightLBS", (int)(lbs));
                };
            }
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
0
 private void LoadConfig()
 {
     randomSongBagSize = ModPrefs.GetInt("RandomSong", "RandomSongBagSize");
     if (randomSongBagSize > mainSongCount)
     {
         randomSongBagSize = mainSongCount;
     }
 }
Exemplo n.º 10
0
 public static void Read()
 {
     AutoDownloadSongs  = ModPrefs.GetBool("SyncSaber", "AutoDownloadSongs", true);
     AutoUpdateSongs    = ModPrefs.GetBool("SyncSaber", "AutoUpdateSongs", true);
     BeastSaberUsername = ModPrefs.GetString("SyncSaber", "BeastSaberUsername", "");
     MaxBeastSaberPages = ModPrefs.GetInt("SyncSaber", "MaxBeastSaberPages", 0);
     DeleteOldVersions  = ModPrefs.GetBool("SyncSaber", "DeleteOldVersions", true);
 }
Exemplo n.º 11
0
        public void OnApplicationStart()
        {
            SceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged;
            SceneManager.sceneLoaded        += SceneManager_sceneLoaded;

            BailOutInstalled = PluginManager.Plugins.Any(p => p.Name.Contains("Bail") && p.Name.Contains("Out") && p.Name.Contains("Mode"));
            if (BailOutInstalled)
            {
                Console.WriteLine("[StreamInfo] BailOut plugin found.");
            }
            else
            {
                Console.WriteLine("[StreamInfo] BailOut plugin not found.");
            }

            info = new SongInfo();

            if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "UserData")))
            {
                Directory.CreateDirectory(Path.Combine(Environment.CurrentDirectory, "UserData"));
            }
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }

            foreach (string s in new[] { "SongName", "overlaydata" })
            {
                if (!File.Exists(Path.Combine(dir, s + ".txt")))
                {
                    Console.WriteLine("[StreamInfo] " + s + ".txt not found. Creating file...");
                    if (s == "overlaydata")
                    {
                        File.WriteAllLines(Path.Combine(dir, s + ".txt"), new[] { "567,288", "0,0", "75,198", "307,134", "16,132", "87,19", "170,83", "303,19" });
                    }
                    else
                    {
                        File.WriteAllText(Path.Combine(dir, s + ".txt"), "");
                    }
                }
            }
            if (ModPrefs.GetBool("StreamInfo", "OverlayEnabled", true, true))
            {
                Console.WriteLine("[StreamInfo] Launching overlay...");
                overlay             = new Overlay();
                overlay.FormClosed += Overlay_FormClosed;
                Action overlayjob = delegate { Application.Run(overlay); };
                OverlayTask = new HMTask(overlayjob);
                OverlayTask.Run();
                overlay.Refresh();
                overlayRefreshRate = ModPrefs.GetInt("StreamInfo", "RefreshRate", 100, true);

                Console.WriteLine("[StreamInfo] Overlay started.");
                overlayEnabled = true;
            }
        }
 public override void OnModSettingsApplied()
 {
     ourMaxEyeResolution = ModPrefs.GetInt(ModCategory, MaxResPref);
     ourAllMirrorsAuto   = ModPrefs.GetBool(ModCategory, AllMirrorsAutoPref);
     ourMirrorMsaa       = ModPrefs.GetInt(ModCategory, MirrorMsaaPref);
     if (ourMirrorMsaa != 1 && ourMirrorMsaa != 2 && ourMirrorMsaa != 4 && ourMirrorMsaa != 8)
     {
         ourMirrorMsaa = 0;
     }
 }
Exemplo n.º 13
0
        public void OnApplicationStart()
        {
            SceneManager.activeSceneChanged += OnSceneChange;
            SceneManager.sceneLoaded        += OnSceneLoaded;

            // set defaults if they dont exist
            ModPrefs.GetInt("FCDisplay", "ColorRed", 255, true);
            ModPrefs.GetInt("FCDisplay", "ColorGreen", 255, true);
            ModPrefs.GetInt("FCDisplay", "ColorBlue", 255, true);
            ModPrefs.GetInt("FCDisplay", "MissEffect", 0, true);
        }
Exemplo n.º 14
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);
        }
Exemplo n.º 15
0
 Config()
 {
     _serverHubIPs             = new string[] { "127.0.0.1", "soupwhale.com", "hub.assistant.moe", "hub.n3s.co", "hub.auros.red", "beige.space", "treasurehunters.nz", "beatsaber.networkauditor.org", "hub.ligma.site", "hub.jogi-server.de", "beatsaberhub.freddi.xyz" };
     _serverHubPorts           = new int[] { 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700 };
     _showAvatarsInGame        = false;
     _showAvatarsInRoom        = true;
     _downloadAvatars          = true;
     _spectatorMode            = false;
     _maxSimultaneousDownloads = ModPrefs.GetInt("BeatSaverDownloader", "maxSimultaneousDownloads", 3);
     _beatSaverURL             = ModPrefs.GetString("BeatSaverDownloader", "beatsaverURL", "https://beatsaver.com");
     IsDirty = true;
 }
Exemplo n.º 16
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;
        }
Exemplo n.º 17
0
 public static void Read()
 {
     AutoDownloadSongs          = ModPrefs.GetBool(Plugin.Instance.Name, "AutoDownloadSongs", true);
     AutoUpdateSongs            = ModPrefs.GetBool(Plugin.Instance.Name, "AutoUpdateSongs", true);
     BeastSaberUsername         = ModPrefs.GetString(Plugin.Instance.Name, "BeastSaberUsername", "");
     DeleteOldVersions          = ModPrefs.GetBool(Plugin.Instance.Name, "DeleteOldVersions", true);
     SyncBookmarksFeed          = ModPrefs.GetBool(Plugin.Instance.Name, "SyncBookmarksFeed", true);
     SyncCuratorRecommendedFeed = ModPrefs.GetBool(Plugin.Instance.Name, "SyncCuratorRecommendedFeed", false);
     SyncFollowingsFeed         = ModPrefs.GetBool(Plugin.Instance.Name, "SyncFollowingsFeed", true);
     MaxFollowingsPages         = ModPrefs.GetInt(Plugin.Instance.Name, "MaxFollowingsPages", 0);
     MaxCuratorRecommendedPages = ModPrefs.GetInt(Plugin.Instance.Name, "MaxCuratorRecommendedPages", 0);
     MaxBookmarksPages          = ModPrefs.GetInt(Plugin.Instance.Name, "MaxBookmarksPages", 0);
 }
Exemplo n.º 18
0
        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);
        }
Exemplo n.º 19
0
 public static void OnLoad()
 {
     if (!Instance)
     {
         Instance = new GameObject("YoutubeDownloader").AddComponent <YouTubeDownloader>();
         DontDestroyOnLoad(Instance);
         Instance.videoQueue  = new Queue <VideoDownload>();
         Instance.quality     = (VideoQuality)ModPrefs.GetInt(Plugin.PluginName, "VideoDownloadQuality", (int)VideoQuality.Medium, true);
         Instance.downloading = false;
         Instance.updated     = false;
         Instance.UpdateYDL();
     }
 }
Exemplo n.º 20
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);
        }
Exemplo n.º 21
0
 void OnDestroy()
 {
     MenuDisplay.countLGC.text = lvlData.difficultyBeatmap.level.songName;
     MenuDisplay.labelLG.text  = "Last Played Song";
     MenuDisplay.lgcText.text  = (calories).ToString();
     MenuDisplay.cscText.text  = (currentSessionCals + calories).ToString();
     MenuDisplay.lcText.text   = (lifeCalories + calories).ToString();
     MenuDisplay.dcText.text   = (dailyCalories + calories).ToString();
     ModPrefs.SetInt("fitNessMod", "lifeCalories", lifeCalories + calories);
     ModPrefs.SetInt("fitNessMod", "dailyCalories", dailyCalories + calories);
     ModPrefs.SetInt("fitNessMod", "sessionCalories", currentSessionCals + calories);
     Console.WriteLine("[fitNessMod | LOG] Current Calories: " + ModPrefs.GetInt("fitNessMod", "sessionCalories", 0, true));
     saberRating.noteWasCutEvent    -= onNoteCut;
     saberRating.noteWasMissedEvent -= onNoteMiss;
 }
Exemplo n.º 22
0
        public static void Settings()
        {
            SubMenu            befitSettings = SettingsUI.CreateSubMenu("BeFit Settings");
            BoolViewController legacyMode    = befitSettings.AddBool("Legacy Mode?");

            legacyMode.GetValue += delegate { return(ModPrefs.GetBool(Plugin.alias, "legacyMode", false, true)); };
            legacyMode.SetValue += delegate(bool leg) { ModPrefs.SetBool(Plugin.alias, "legacyMode", leg); };
            IntViewController calCountAccuracy = befitSettings.AddInt("FPS Drop Reduction: ", 1, 45, 1);

            calCountAccuracy.GetValue += delegate { return(ModPrefs.GetInt(Plugin.alias, "caccVal", 30, true)); };
            calCountAccuracy.SetValue += delegate(int acc) { ModPrefs.SetInt(Plugin.alias, "caccVal", acc); };

            BoolViewController viewInGame = befitSettings.AddBool("Show Calories In Game");

            viewInGame.GetValue += delegate { return(ModPrefs.GetBool(Plugin.alias, "dcig", true, true)); };
            viewInGame.SetValue += delegate(bool dcig) { ModPrefs.SetBool(Plugin.alias, "dcig", dcig); };

            BoolViewController viewCurrent = befitSettings.AddBool("Show Current Session Calories");

            viewCurrent.GetValue += delegate { return(ModPrefs.GetBool(Plugin.alias, "csv", true, true)); };
            viewCurrent.SetValue += delegate(bool csv) {
                ModPrefs.SetBool(Plugin.alias, "csv", csv);
                MenuDisplay.visibleCurrentCalories = csv;
            };

            BoolViewController viewDaily = befitSettings.AddBool("Show Daily Calories");

            viewDaily.GetValue += delegate { return(ModPrefs.GetBool(Plugin.alias, "dcv", true, true)); };
            viewDaily.SetValue += delegate(bool dcv) {
                ModPrefs.SetBool(Plugin.alias, "dcv", dcv);
                MenuDisplay.visibleDailyCalories = dcv;
            };

            BoolViewController viewLife = befitSettings.AddBool("Show All Calories");

            viewLife.GetValue += delegate { return(ModPrefs.GetBool(Plugin.alias, "lcv", false, true)); };
            viewLife.SetValue += delegate(bool lcv) {
                ModPrefs.SetBool(Plugin.alias, "lcv", lcv);
                MenuDisplay.visibleLifeCalories = lcv;
            };
            BoolViewController viewLast = befitSettings.AddBool("Show Last Song Calories");

            viewLast.GetValue += delegate { return(ModPrefs.GetBool(Plugin.alias, "lgv", true, true)); };
            viewLast.SetValue += delegate(bool lgv) {
                ModPrefs.SetBool(Plugin.alias, "lgv", lgv);
                MenuDisplay.visibleLastGameCalories = lgv;
            };
        }
Exemplo n.º 23
0
        public Server()
        {
            int port = ModPrefs.GetInt("DroneCam", "port");

            server = new HttpServer(port);

            string webroot = Path.GetFullPath(@".\UserData\DroneCam\www");

            server.OnGet += (sender, e) => {
                var req = e.Request;
                var res = e.Response;

                if (ModPrefs.GetBool("DroneCam", "verboselogging"))
                {
                    Console.WriteLine(string.Format("[DroneCam][Server] GET {0}", req.RawUrl));
                }

                var path = req.RawUrl;
                if (path == "/")
                {
                    path += "index.html";
                }

                var abspath = webroot + path.Replace("/", "\\");

                if (File.Exists(abspath))
                {
                    try
                    {
                        res.ContentType     = MimeTypeMap.GetMimeType(path.Split('.').Last());
                        res.ContentEncoding = Encoding.UTF8;
                        byte[] contents = File.ReadAllBytes(abspath);
                        res.WriteContent(contents);
                    }
                    catch (Exception err)
                    {
                        Console.WriteLine(err);
                        res.StatusCode = 500;
                        res.WriteContent(Encoding.UTF8.GetBytes(err.ToString()));
                    }
                }
                else
                {
                    res.Redirect("http://" + req.UserHostName + "/");
                }
            };;
        }
Exemplo n.º 24
0
        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;
            }
        }
Exemplo n.º 25
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");
 }
Exemplo n.º 26
0
        public void OnApplicationStart()
        {
            if (_init)
            {
                return;
            }
            _init = true;

            scoreCounterPosition = ReadVector(ModPrefs.GetString("BeatSaberProgressCounter", "scorePosition",
                                                                 FormatVector(scoreCounterPosition), true));
            progressCounterPosition = ReadVector(ModPrefs.GetString("BeatSaberProgressCounter", "progressPosition",
                                                                    FormatVector(progressCounterPosition), true));

            progressTimeLeft = ModPrefs.GetBool("BeatSaberProgressCounter", "progressTimeLeft", false, true);
            progressCounterDecimalPrecision = ModPrefs.GetInt("BeatSaberProgressCounter", "progressCounterDecimalPrecision", 1, true);

            SceneManager.activeSceneChanged += OnSceneChanged;
        }
Exemplo n.º 27
0
        private static Color GetWallColor()
        {
            Color col;

            if (!Plugin.rainbowWall)
            {
                if (Plugin.wallColorPreset == 1)
                {
                    col = Plugin.ColorLeft;
                }
                else if (Plugin.wallColorPreset == 2)
                {
                    col = Plugin.ColorRight;
                }
                else if (Plugin.wallColorPreset == 3)
                {
                    col = new Color(
                        ModPrefs.GetInt(Plugin.Name, "LeftRed", 255, true) / 255f,
                        ModPrefs.GetInt(Plugin.Name, "LeftGreen", 4, true) / 255f,
                        ModPrefs.GetInt(Plugin.Name, "LeftBlue", 4, true) / 255f);
                }
                else if (Plugin.wallColorPreset == 4)
                {
                    col = new Color(
                        ModPrefs.GetInt(Plugin.Name, "RightRed", 255, true) / 255f,
                        ModPrefs.GetInt(Plugin.Name, "RightGreen", 4, true) / 255f,
                        ModPrefs.GetInt(Plugin.Name, "RightBlue", 4, true) / 255f);
                }
                else
                {
                    col = ColorsUI.OtherPresets[Plugin.wallColorPreset].Item1;
                }
            }
            else
            {
                col = Rainbow.GetRandomColor();
                if (!_colorInit)
                {
                    CurrentWallColor = col;
                }
            }
            return(col);
        }
Exemplo n.º 28
0
 public override void VRChat_OnUiManagerInit()
 {
     if (ModPrefs.GetInt(ModCategory, ResolutionPref) == 1)
     {
         Resolution1();
     }
     else if (ModPrefs.GetInt(ModCategory, ResolutionPref) == 2)
     {
         Resolution2();
     }
     else if (ModPrefs.GetInt(ModCategory, ResolutionPref) == 3)
     {
         Resolution3();
     }
     else
     {
         Resolution1();
     }
 }
Exemplo n.º 29
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);
 }
Exemplo n.º 30
0
        private void Init()
        {
            score.noteWasCutEvent    += OnNoteCut;
            score.noteWasMissedEvent += OnNoteMiss;

            g = new GameObject("FCRing");
            Canvas canvas = g.AddComponent <Canvas>();

            canvas.renderMode = RenderMode.WorldSpace;
            CanvasScaler cs = g.AddComponent <CanvasScaler>();

            cs.scaleFactor          = 10.0f;
            cs.dynamicPixelsPerUnit = 10f;
            GraphicRaycaster gr = g.AddComponent <GraphicRaycaster>();

            g.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 1f);
            g.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 1f);

            g2  = new GameObject();
            img = g2.AddComponent <Image>();
            g2.transform.parent = g.transform;
            g2.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 0.5f);
            g2.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 0.5f);
            g2.transform.localScale = new Vector3(2.5f, 2.5f, 2.5f);

            var circleimage = ReflectionUtil.GetPrivateField <Image>(multi, "_multiplierProgressImage");

            img.sprite = circleimage.sprite;
            img.color  = new Color(
                ModPrefs.GetInt("FCDisplay", "ColorRed", 255, true),
                ModPrefs.GetInt("FCDisplay", "ColorGreen", 255, true),
                ModPrefs.GetInt("FCDisplay", "ColorBlue", 255, true));

            g.transform.position = new Vector3(3.2f, 1.5f, 7f);

            if (ModPrefs.GetBool("FCDisplay", "VanillaEnabled", false, true))
            {
                return;
            }
            comboPanel.transform.Find("Line0").gameObject.SetActive(false);
            comboPanel.transform.Find("Line1").gameObject.SetActive(false);
        }