コード例 #1
0
ファイル: Plugin.cs プロジェクト: Auros/AutoPause-Overhaul
        //UI

        public void CreateUI()
        {
            GetIcons();

            GameplaySettingsUI.CreateSubmenuOption(GameplaySettingsPanels.ModifiersLeft, "AutoPause", "MainMenu", "apMenu", "Settings for AutoPause", _autoLogo);
            var apEnabled = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.ModifiersLeft, "Enabled", "apMenu", "Activate/Deactivate AutoPause", _onoffButton);
            var apWhite   = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.ModifiersLeft, "Low Sensitivity", "apMenu", "AutoPause will trigger for very big issues.", _sensitivty);
            var apYellow  = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.ModifiersLeft, "SensiMain", "apMenu", "AutoPause will work normally.", _sensiyellow);
            var apRed     = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.ModifiersLeft, "SensiRed", "apMenu", "AutoPause is on full alert.", _sensired);

            apWhite.AddConflict("SensiMain");
            apWhite.AddConflict("SensiRed");
            apYellow.AddConflict("Low Sensitivity");
            apYellow.AddConflict("SensiRed");
            apRed.AddConflict("Low Sensitivity");
            apRed.AddConflict("SensiMain");

            apEnabled.GetValue = AutoPauseConfig.GetBool("Main", "Enabled", true, true);
            apWhite.GetValue   = AutoPauseConfig.GetBool("Main", "LowSense", false, true);
            apYellow.GetValue  = AutoPauseConfig.GetBool("Main", "SensiMain", true, true);
            apRed.GetValue     = AutoPauseConfig.GetBool("Main", "SensiRed", false, true);

            apEnabled.OnToggle += (value) => { AutoPauseConfig.SetBool("Main", "Enabled", value); };
            apWhite.OnToggle   += (value) => { AutoPauseConfig.SetBool("Main", "LowSense", value); };
            apYellow.OnToggle  += (value) => { AutoPauseConfig.SetBool("Main", "SensiMain", value); };
            apRed.OnToggle     += (value) => { AutoPauseConfig.SetBool("Main", "SensiRed", value); };
        }
コード例 #2
0
ファイル: Plugin.cs プロジェクト: bigfoott/FCDisplay
 public void OnActiveSceneChanged(Scene prevScene, Scene nextScene)
 {
     if (nextScene.name != "GameCore" || !Config.GetBool("FCDisplay", "Enabled", true, true))
     {
         return;
     }
     new GameObject("FCDisplay").AddComponent <DisplayObject>();
 }
コード例 #3
0
        public void OnApplicationStart()
        {
            // TODO: Remove this migration path at some point
            var songCoreIniPath = Path.Combine(UnityGame.UserDataPath, nameof(SongCore), "SongCore.ini");

            if (File.Exists(songCoreIniPath))
            {
                var modPrefs = new BS_Utils.Utilities.Config("SongCore/SongCore");

                Configuration.CustomSongColors    = modPrefs.GetBool("SongCore", "customSongColors", true, true);
                Configuration.CustomSongPlatforms = modPrefs.GetBool("SongCore", "customSongPlatforms", true, true);
                Configuration.DisplayDiffLabels   = modPrefs.GetBool("SongCore", "displayDiffLabels", true, true);
                Configuration.ForceLongPreviews   = modPrefs.GetBool("SongCore", "forceLongPreviews", false, true);

                //Delete Old Config
                try
                {
                    File.Delete(songCoreIniPath);
                }
                catch
                {
                    Logging.Logger.Warn("Failed to delete old config file!");
                }
            }


            BSMLSettings.instance.AddSettingsMenu("SongCore", "SongCore.UI.settings.bsml", new SCSettingsController());
            SceneManager.activeSceneChanged += OnActiveSceneChanged;

            _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "com.kyle1413.BeatSaber.SongCore");

            BasicUI.GetIcons();
            BS_Utils.Utilities.BSEvents.levelSelected            += BSEvents_levelSelected;
            BS_Utils.Utilities.BSEvents.gameSceneLoaded          += BSEvents_gameSceneLoaded;
            BS_Utils.Utilities.BSEvents.lateMenuSceneLoadedFresh += BSEvents_menuSceneLoadedFresh;

            if (!File.Exists(Collections.DataPath))
            {
                File.Create(Collections.DataPath);
            }
            else
            {
                Collections.LoadExtraSongData();
            }

            Collections.RegisterCustomCharacteristic(BasicUI.MissingCharIcon !, "Missing Characteristic", "Missing Characteristic", "MissingCharacteristic", "MissingCharacteristic", false, false, 1000);
            Collections.RegisterCustomCharacteristic(BasicUI.LightshowIcon !, "Lightshow", "Lightshow", "Lightshow", "Lightshow", false, false, 100);
            Collections.RegisterCustomCharacteristic(BasicUI.ExtraDiffsIcon !, "Lawless", "Lawless - Anything Goes", "Lawless", "Lawless", false, false, 101);

            var foldersXmlFilePath = Path.Combine(UnityGame.UserDataPath, nameof(SongCore), "folders.xml");

            if (!File.Exists(foldersXmlFilePath))
            {
                File.WriteAllBytes(foldersXmlFilePath, Utilities.Utils.GetResource(Assembly.GetExecutingAssembly(), "SongCore.Data.folders.xml"));
            }

            Loader.SeperateSongFolders.InsertRange(0, Data.SeperateSongFolder.ReadSeperateFoldersFromFile(foldersXmlFilePath));
        }
コード例 #4
0
ファイル: Config.cs プロジェクト: Snow1226/CustomMenuMusic
        internal void Load()
        {
            Util.Logger.Log("Loading config!");

            UseCustomMenuSongs = config.GetBool(sectionCore, useCustomMenuSongs, false, true);
            Loop               = config.GetBool(sectionCore, loop, false, true);
            MenuMusicVolume    = config.GetFloat(sectionCore, menuMusicVolume, 0.5f, true);
            ShowNowPlaying     = config.GetBool(sectionNowPlaying, showNowPlaying, true, true);
            NowPlayingLocation = config.GetInt(sectionNowPlaying, nowPlayingLocation, 0, true);
            NowPlayingColor    = config.GetInt(sectionNowPlaying, nowPlayingColor, 0, true);
        }
コード例 #5
0
        /// <summary>
        /// Load Configuration
        /// </summary>
        internal static void Load()
        {
            BS_Utils.Utilities.Config oldConfig = new BS_Utils.Utilities.Config("modprefs");
            if (oldConfig.HasKey(Plugin.PluginName, "GripLeftPosition") && !oldConfig.GetBool(Plugin.PluginName, "IsExportedToNewConfig", false))
            {
                // Import SaberTailor's settings from the old configuration (ModPrefs)
                try
                {
                    PluginConfig importedConfig = ConfigurationImporter.ImportSettingsFromModPrefs(oldConfig);
                    PluginConfig.Instance = importedConfig;

                    // Store configuration in the new format immediately
                    PluginConfig.Instance.Changed();
                    Logger.log.Info("Configuration loaded from ModPrefs.");
                }
                catch (Exception ex)
                {
                    Logger.log.Warn("Failed to import ModPrefs configuration. Loading default BSIPA configuration instead.");
                    Logger.log.Warn(ex);
                }
            }

            LoadConfig();
            UpdateConfig();
            Logger.log.Debug("Configuration has been set");

            // Update variables used by mod logic
            UpdateModVariables();
        }
コード例 #6
0
ファイル: Config.cs プロジェクト: Kylemc1413/DiffReducer
 public static void Read()
 {
     //  ModifierUI.instance.enabled = config.GetBool("DiffReducer", "Enabled", false, true);
     ModifierUI.instance.beatDivision        = config.GetFloat("DiffReducer", "Section Detection", 1.5f, true);
     ModifierUI.instance.beatDivision2       = config.GetFloat("DiffReducer", "Simplification Detection", 1.5f, true);
     ModifierUI.instance.simplifySwingLength = config.GetBool("DiffReducer", "Simplify Swing Lengths", false, true);
 }
コード例 #7
0
ファイル: Config.cs プロジェクト: DDunkler/NjsFixer
        public static void Read()
        {
            if (!File.Exists(ConfigPath))
            {
                if (CheckForOldConfig())
                {
                    var oldConfig = new BS_Utils.Utilities.Config("NjsFixer");
                    UserConfig                 = new NjsFixerConfig();
                    UserConfig.njs             = oldConfig.GetFloat("NjsFixer", "njs", 0, true);
                    UserConfig.bpm             = oldConfig.GetFloat("NjsFixer", "bpm", 0, true);
                    UserConfig.spawnOffset     = oldConfig.GetFloat("NjsFixer", "spawnOffset", 0, true);
                    UserConfig.enabled         = oldConfig.GetBool("NjsFixer", "Enabled", false, true);
                    UserConfig.dontForceNJS    = oldConfig.GetBool("NjsFixer", "DontForceNJS", false, true);
                    UserConfig.jumpDistance    = oldConfig.GetFloat("NjsFixer", "DesiredJumpDistance", 24f, true);
                    UserConfig.minJumpDistance = oldConfig.GetInt("NjsFixer", "minJumpDistance", 20, true);
                    UserConfig.maxJumpDistance = oldConfig.GetInt("NjsFixer", "maxJumpDistance", 30, true);
                    try
                    {
                        File.Delete(Path.Combine(IPA.Utilities.UnityGame.UserDataPath, "NjsFixer.ini"));
                    }
                    catch (Exception ex)
                    {
                        Logger.log.Warn($"Failed to delete old NjsFixer Config file {ex}");
                    }
                }
                else
                {
                    UserConfig = new NjsFixerConfig();
                }
                Write();
            }
            else
            {
                UserConfig = JsonConvert.DeserializeObject <NjsFixerConfig>(File.ReadAllText(ConfigPath));
            }
            UserConfig.preferredValues = UserConfig.preferredValues.OrderByDescending(x => x.njs).ToList();

            /*
             * njs = ModPrefs.GetFloat("NjsFixer", "njs", 0, true);
             * bpm = ModPrefs.GetFloat("NjsFixer", "bpm", 0, true);
             * spawnOffset = ModPrefs.GetFloat("NjsFixer", "spawnOffset", 0, true);
             * enabled = ModPrefs.GetBool("NjsFixer", "Enabled", false, true);
             * dontForceNJS = ModPrefs.GetBool("NjsFixer", "DontForceNJS", false, true);
             * jumpDistance = ModPrefs.GetFloat("NjsFixer", "DesiredJumpDistance", 24f, true);
             */
        }
コード例 #8
0
ファイル: BasicUI.cs プロジェクト: Corben78/SongCore
        public static void CreateUI()
        {
            var songCoreSubMenu = GameplaySettingsUI.CreateSubmenuOption(GameplaySettingsPanels.PlayerSettingsLeft, "SongCore", "MainMenu",
                                                                         "songcore", "SongCore Options");

            var colorOverrideOption = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.PlayerSettingsLeft, "Allow Custom Song Colors",
                                                                            "songcore", "Allow Custom Songs to override note/light colors if Custom Colors or Chroma is installed");

            colorOverrideOption.GetValue  = ModPrefs.GetBool("SongCore", "customSongColors", true, true);
            colorOverrideOption.OnToggle += delegate(bool value) { Plugin.customSongColors = value; ModPrefs.SetBool("SongCore", "customSongColors", value); };

            var platformOverrideOption = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.PlayerSettingsLeft, "Allow Custom Song Platforms",
                                                                               "songcore", "Allow Custom Songs to override your Custom Platform if Custom Platforms is installed");

            platformOverrideOption.GetValue  = ModPrefs.GetBool("SongCore", "customSongPlatforms", true, true);
            platformOverrideOption.OnToggle += delegate(bool value) { Plugin.customSongPlatforms = value; ModPrefs.SetBool("SongCore", "customSongPlatforms", value); };
        }
コード例 #9
0
ファイル: Plugin.cs プロジェクト: DeadlyKitten/HyperBloom
 internal static void LoadSettings()
 {
     Logger.Log("Loading settings from config");
     postProcessEnabled      = config.GetBool(sectionName, "Post Process Enabled", true, true);
     baseColorBoost          = config.GetFloat(sectionName, "Base Color Boost", 0.5f, true);
     baseColorBoostThreshold = config.GetFloat(sectionName, "Base Color Boost Threshold", 0.1f, true);
     bloomIterations         = config.GetInt(sectionName, "Bloom Iterations", 4, true);
     bloomIntensity          = config.GetFloat(sectionName, "Bloom Intensity", 1, true);
     textureWidth            = config.GetInt(sectionName, "Texture Width", 512, true);
 }
コード例 #10
0
        public static void LoadIni()
        {
            if (config.HasKey("BeatSaverDownloader", "beatsaverURL"))
            {
                beatsaverURL = config.GetString("BeatSaverDownloader", "beatsaverURL", "https://beatsaver.com");
                if (string.IsNullOrEmpty(beatsaverURL))
                {
                    config.SetString("BeatSaverDownloader", "beatsaverURL", "https://beatsaver.com");
                    beatsaverURL = "https://beatsaver.com";
                }
            }
            else
            {
                LoadOldIni();
                SaveConfig();
                return;
            }


            apiAccessToken = config.GetString("BeatSaverDownloader", "apiAccessToken", apiTokenPlaceholder, true);

            disableDeleteButton = config.GetBool("BeatSaverDownloader", "disableDeleteButton", false, true);

            deleteToRecycleBin = config.GetBool("BeatSaverDownloader", "deleteToRecycleBin", true, true);

            enableSongIcons = config.GetBool("BeatSaverDownloader", "enableSongIcons", true, true);

            rememberLastPackAndSong = config.GetBool("BeatSaverDownloader", "rememberLastPackAndSong", false, true);

            lastSelectedSong = config.GetString("BeatSaverDownloader", "lastSelectedSong", "", true);


            lastSelectedPack = config.GetString("BeatSaverDownloader", "lastSelectedPack", "", true);


            lastSelectedSortMode = (SortMode)config.GetInt("BeatSaverDownloader", "lastSelectedSortMode", 0, true);


            maxSimultaneousDownloads = config.GetInt("BeatSaverDownloader", "maxSimultaneousDownloads", 3, true);

            fastScrollSpeed = config.GetInt("BeatSaverDownloader", "fastScrollSpeed", 5, true);
        }
コード例 #11
0
ファイル: Settings.cs プロジェクト: y0100100012/BeatSinger
        public static void Load()
        {
            DisplayLyrics = Config.GetBool(PrefsSection, "Enabled", true);

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

            VerboseLogging = Config.GetBool(PrefsSection, nameof(VerboseLogging), false, true);

            Shake     = Config.GetBool(PrefsSection, "Text Shaking", true, true);
            FontSize  = Config.GetInt(PrefsSection, "Font Size", 4, true);
            TextColor = new Color(
                Config.GetInt(PrefsSection, "ColorR", 100, true) / 255f,
                Config.GetInt(PrefsSection, "ColorG", 0, true) / 255f,
                Config.GetInt(PrefsSection, "ColorB", 255, true) / 255f,
                Config.GetInt(PrefsSection, "ColorA", 255, true) / 255f);
            Position = new Vector3(
                Config.GetFloat(PrefsSection, "PosX", 0, true),
                Config.GetFloat(PrefsSection, "PosY", 6, true),
                Config.GetFloat(PrefsSection, "PosZ", 6, true));
        }
コード例 #12
0
        public void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode)
        {
            if (scene.name == "MenuViewControllers")
            {
                if (SongLoader.reqDialog == null)
                {
                    SongLoader.InitRequirementsMenu();
                }

                var subMenuCC = GameplaySettingsUI.CreateSubmenuOption(GameplaySettingsPanels.PlayerSettingsLeft, "Song Loader", "MainMenu",
                                                                       "songloader", "Songloader Options");

                var colorOverrideOption = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.PlayerSettingsLeft, "Allow Custom Song Colors",
                                                                                "songloader", "Allow Custom Songs to override note/light colors if Custom Colors or Chroma is installed");
                colorOverrideOption.GetValue  = ModPrefs.GetBool("Songloader", "customSongColors", true, true);
                colorOverrideOption.OnToggle += delegate(bool value) { ModPrefs.SetBool("Songloader", "customSongColors", value); };

                var platformOverrideOption = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.PlayerSettingsLeft, "Allow Custom Song Platforms",
                                                                                   "songloader", "Allow Custom Songs to override your Custom Platform if Custom Platforms is installed");
                platformOverrideOption.GetValue  = ModPrefs.GetBool("Songloader", "customSongPlatforms", true, true);
                platformOverrideOption.OnToggle += delegate(bool value) { ModPrefs.SetBool("Songloader", "customSongPlatforms", value); };
            }
        }
コード例 #13
0
        public static void Read()
        {
            showInfo       = config.GetBool("PP Helper", "showInfo", true, true);
            defaultAcc     = config.GetFloat("PP Helper", "defaultAcc", 80f, true);
            ppTop          = config.GetBool("PP Helper", "ppTop", false, true);
            accIncrement   = config.GetFloat("PP Helper", "accIncrement", 0.1f, true);
            starRange      = config.GetFloat("PP Helper", "starRange", 0.5f, true);
            starAccChoice  = Enum.TryParse(config.GetString("PP Helper", "starAccChoice", "AverageOfTopN", true), out CalculationType starChoice) ? starChoice : CalculationType.AverageOfTopN;
            numberOfScores = config.GetInt("PP Helper", "numberOfScores", 3, true);
            accOverride    = config.GetBool("PP Helper", "accOverride", true, true);
            autoUpdate     = config.GetBool("PP Helper", "autoUpdate", true, true);
            playHistory    = config.GetBool("PP Helper", "playHistory", true, true);
            sortMethod     = Enum.TryParse(config.GetString("PP Helper", "sortMethod", "PPGain", true), out SortMethod sortChoice) ? sortChoice : SortMethod.PPGain;

            ignoreNoFail     = config.GetBool("PP Helper", "ignoreNoFail", true, true);
            hideOnStart      = config.GetBool("PP Helper", "hideOnStart", false, true);
            decimalPrecision = config.GetInt("PP Helper", "decimalPrecision", 2, true);
        }
コード例 #14
0
 private void LoadConfig()
 {
     useMaxDeviation = _config.GetBool("Settings", "Use Max Deviation", false, true);
     maxDeviation    = _config.GetInt("Settings", "Max Deviation", 15, true);
 }
コード例 #15
0
        public static void Read()
        {
            if (!_init)
            {
                Init();
            }

            parabola        = _config.GetBool(Plugin.Name, "parabola", false, true);
            parabolaOffsetY = _config.GetFloat(Plugin.Name, "parabolaOffsetY", 1.8f);
            noBlue          = _config.GetBool(Plugin.Name, "noBlue", false, true);
            noRed           = _config.GetBool(Plugin.Name, "noRed", false, true);
            redToBlue       = _config.GetBool(Plugin.Name, "redToBlue", false, true);
            blueToRed       = _config.GetBool(Plugin.Name, "blueToRed", false, true);
            oneColorRed     = _config.GetBool(Plugin.Name, "oneColorRed", false, true);

            boxing              = _config.GetBool(Plugin.Name, "boxing", false, true);
            hideSabers          = _config.GetBool(Plugin.Name, "hideSabers", false, true);
            hideSaberEffects    = _config.GetBool(Plugin.Name, "hideSaberEffects", false, true);
            centering           = _config.GetBool(Plugin.Name, "centering", false, true);
            centeringBaseY      = _config.GetFloat(Plugin.Name, "centeringBaseY", 0.8f, true);
            centeringNotesScale = _config.GetFloat(Plugin.Name, "centeringNotesScale", 0.75f, true);

            feetModifiers     = _config.GetBool(Plugin.Name, "feetModifiers", false, true);
            feet              = _config.GetBool(Plugin.Name, "feet", false, true);
            feetNotesY        = _config.GetFloat(Plugin.Name, "feetNotesY", 0.12f, true);
            noDirection       = _config.GetBool(Plugin.Name, "noDirection", false, true);
            ignoreBadColor    = _config.GetBool(Plugin.Name, "ignoreBadColor", false, true);
            flatNotes         = _config.GetBool(Plugin.Name, "flatNotes", false, true);
            feetAvatar        = _config.GetBool(Plugin.Name, "feetAvatar", false, true);
            feetTracker       = _config.GetBool(Plugin.Name, "feetTracker", false, true);
            disableStatistics = _config.GetBool(Plugin.Name, "disableStatistics", false, true);
            ReadFeetPosRot();

            ninjaModifiers    = _config.GetBool(Plugin.Name, "ninjaModifiers", false, true);
            fourSabers        = _config.GetBool(Plugin.Name, "fourSabers", false, true);
            reverseGrip       = _config.GetBool(Plugin.Name, "reverseGrip", false, true);
            topNotesToFeet    = _config.GetBool(Plugin.Name, "topNotesToFeet", false, true);
            middleNotesToFeet = _config.GetBool(Plugin.Name, "middleNotesToFeet", false, true);
            bottomNotesToFeet = _config.GetBool(Plugin.Name, "bottomNotesToFeet", false, true);

            headbang    = _config.GetBool(Plugin.Name, "headbang", false, true);
            superhot    = _config.GetBool(Plugin.Name, "superhot", false, true);
            vacuum      = _config.GetBool(Plugin.Name, "vacuum", false, true);
            ninjaMaster = _config.GetBool(Plugin.Name, "ninjaMaster", false, true);
            ninjaMasterSaberSeparation = _config.GetFloat(Plugin.Name, "ninjaMasterSaberSeparation", 0.18f, true);
            ninjaMasterHideHand        = _config.GetBool(Plugin.Name, "ninjaMasterHideHand", false, true);
            ninjaMasterHideHandL       = _config.GetBool(Plugin.Name, "ninjaMasterHideHandL", false, true);
            ninjaMasterHideHandR       = _config.GetBool(Plugin.Name, "ninjaMasterHideHandR", false, true);
            ninjaMasterHideFoot        = _config.GetBool(Plugin.Name, "ninjaMasterHideFoot", false, true);
            ninjaMasterHideWaist       = _config.GetBool(Plugin.Name, "ninjaMasterHideWaist", false, true);
            ninjaMasterHideMouth       = _config.GetBool(Plugin.Name, "ninjaMasterHideMouth", false, true);
            ninjaMasterHideHead        = _config.GetBool(Plugin.Name, "ninjaMasterHideHead", false, true);
        }
コード例 #16
0
        void ReadPreferences()
        {
            _overrideCustomSabers   = Config.GetBool("Core", "OverrideCustomSabers", true, true);
            useArrowColorsForSabers = Config.GetBool("Core", "useArrowColorsForSabers", false, true);
            allowEnvironmentColors  = Config.GetBool("Core", "allowEnvironmentColors", true, true);
            disablePlugin           = Config.GetBool("Core", "disablePlugin", false, true) || ctInstalled;
            if (disablePlugin)
            {
                queuedDisable = true;
            }

            if (queuedDisable)
            {
                ColorLeft = new Color(
                    1f,
                    4f / 255f,
                    4f / 255f
                    );
                ColorRight = new Color(
                    0,
                    192f / 255f,
                    1f
                    );
                ColorLeftLight       = new Color(1, 4 / 255f, 4 / 255f);
                ColorRightLight      = new Color(0, 192 / 255f, 1);
                wallColorPreset      = 0;
                wallFrameColorPreset = 0;
            }

            if (disablePlugin == false)
            {
                leftColorPreset      = Config.GetInt("Presets", "leftNoteColorPreset", 0, true);
                rightColorPreset     = Config.GetInt("Presets", "rightNoteColorPreset", 0, true);
                wallColorPreset      = Config.GetInt("Presets", "wallColorPreset", 0, true);
                wallFrameColorPreset = Config.GetInt("Presets", "wallFrameColorPreset", 0, true);
                leftLightPreset      = Config.GetInt("Presets", "leftLightPreset", 1, true);
                rightLightPreset     = Config.GetInt("Presets", "rightLightPreset", 2, true);
                bombColorPreset      = Config.GetInt("Presets", "bombColorPreset", 0, true);

                leftArrowPreset      = Config.GetInt("Presets", "leftArrowPreset", 0, true);
                rightArrowPreset     = Config.GetInt("Presets", "rightArrowPreset", 0, true);
                leftArrowGlowPreset  = Config.GetInt("Presets", "leftArrowGlowPreset", 0, true);
                rightArrowGlowPreset = Config.GetInt("Presets", "rightArrowGlowPreset", 0, true);
                dotArrowFix          = Config.GetBool("Core", "dotArrowFix", false, true);
                disableArrowChanges  = Config.GetBool("Core", "disableArrowChanges", false, true);

                brightness  = Config.GetFloat("Core", "Brightness", 1, true);
                rainbowWall = Config.GetBool("Presets", "rainbowWalls", false, true);
                //Make sure preset exists, else default to user
                if (leftColorPreset > ColorsUI.ColorPresets.Count)
                {
                    leftColorPreset = 0;
                }
                if (rightColorPreset > ColorsUI.ColorPresets.Count)
                {
                    rightColorPreset = 0;
                }
                if (leftLightPreset > ColorsUI.OtherPresets.Count)
                {
                    leftLightPreset = 0;
                }
                if (rightLightPreset > ColorsUI.OtherPresets.Count)
                {
                    rightLightPreset = 0;
                }
                if (wallColorPreset > ColorsUI.OtherPresets.Count)
                {
                    wallColorPreset = 0;
                }
                if (wallFrameColorPreset > ColorsUI.OtherPresets.Count)
                {
                    wallFrameColorPreset = 0;
                }
                if (leftArrowGlowPreset > ColorsUI.OtherPresets.Count)
                {
                    leftArrowGlowPreset = 0;
                }
                if (rightArrowGlowPreset > ColorsUI.OtherPresets.Count)
                {
                    rightArrowGlowPreset = 0;
                }
                if (rightArrowPreset > ColorsUI.OtherPresets.Count)
                {
                    rightArrowPreset = 0;
                }
                if (leftArrowPreset > ColorsUI.OtherPresets.Count)
                {
                    leftArrowPreset = 0;
                }
                if (bombColorPreset > ColorsUI.OtherPresets.Count)
                {
                    bombColorPreset = 0;
                }
                //If preset is user get config values for colors, otherwise use preset
                LeftUserColor = new Color(
                    Config.GetFloat("User Preset Colors", "Left User Preset R", 255, true) / 255f,
                    Config.GetFloat("User Preset Colors", "Left User Preset G", 4, true) / 255f,
                    Config.GetFloat("User Preset Colors", "Left User Preset B", 4, true) / 255f
                    );
                RightUserColor = new Color(
                    Config.GetFloat("User Preset Colors", "Right User Preset R", 0, true) / 255f,
                    Config.GetFloat("User Preset Colors", "Right User Preset G", 192, true) / 255f,
                    Config.GetFloat("User Preset Colors", "Right User Preset B", 255, true) / 255f
                    );
                if (leftColorPreset == 0)
                {
                    ColorLeft = LeftUserColor;
                }
                else
                {
                    ColorLeft = ColorsUI.ColorPresets[leftColorPreset].Item1;
                }

                if (rightColorPreset == 0)
                {
                    ColorRight = RightUserColor;
                }
                else
                {
                    ColorRight = ColorsUI.ColorPresets[rightColorPreset].Item1;
                }

                //Set Light colors
                switch (leftLightPreset)
                {
                case 0:
                    ColorLeftLight = new Color(1, 4 / 255f, 4 / 255f);
                    break;

                case 1:
                    ColorLeftLight = ColorLeft;
                    if (leftColorPreset != 1 && leftColorPreset != 2)
                    {
                        ColorLeftLight *= .8f;
                    }
                    break;

                case 2:
                    ColorLeftLight = ColorRight;
                    if (rightColorPreset != 1 && rightColorPreset != 2)
                    {
                        ColorLeftLight *= .8f;
                    }
                    break;

                case 3:
                    ColorLeftLight  = LeftUserColor;
                    ColorLeftLight *= .8f;
                    break;

                case 4:
                    ColorLeftLight  = RightUserColor;
                    ColorLeftLight *= .8f;
                    break;

                default:
                    ColorLeftLight  = ColorsUI.OtherPresets[leftLightPreset].Item1;
                    ColorLeftLight *= .8f;
                    break;
                }
                switch (rightLightPreset)
                {
                case 0:
                    ColorRightLight = new Color(0, 192 / 255f, 1);
                    break;

                case 1:
                    ColorRightLight = ColorLeft;
                    if (leftColorPreset != 1 && leftColorPreset != 2)
                    {
                        ColorRightLight *= .8f;
                    }
                    break;

                case 2:
                    ColorRightLight = ColorRight;
                    if (rightColorPreset != 1 && rightColorPreset != 2)
                    {
                        ColorRightLight *= .8f;
                    }
                    break;

                case 3:
                    ColorRightLight  = LeftUserColor;
                    ColorRightLight *= .8f;
                    break;

                case 4:
                    ColorRightLight  = RightUserColor;
                    ColorRightLight *= .8f;
                    break;

                default:
                    ColorRightLight  = ColorsUI.OtherPresets[rightLightPreset].Item1;
                    ColorRightLight *= .8f;
                    break;
                }
                switch (bombColorPreset)
                {
                case 0:
                    bombColor = new Color(0, 0, 0);
                    break;

                case 1:
                    bombColor = ColorLeft;
                    break;

                case 2:
                    bombColor = ColorRight;
                    break;

                case 3:
                    bombColor = LeftUserColor;
                    break;

                case 4:
                    bombColor = RightUserColor;
                    break;

                default:
                    bombColor = ColorsUI.OtherPresets[bombColorPreset].Item1;
                    break;
                }

                SetArrowColors();

                ColorLeftLight  *= brightness;
                ColorRightLight *= brightness;
            }
            CCSettingsChanged?.Invoke();
        }
コード例 #17
0
ファイル: Config.cs プロジェクト: wglnngt/NalulunaModifier
        public static void Read()
        {
            parabola        = config.GetBool(Plugin.Name, "parabola", false, true);
            parabolaOffsetY = config.GetFloat(Plugin.Name, "parabolaOffsetY", 1.8f);
            noBlue          = config.GetBool(Plugin.Name, "noBlue", false, true);
            noRed           = config.GetBool(Plugin.Name, "noRed", false, true);
            redToBlue       = config.GetBool(Plugin.Name, "redToBlue", false, true);
            blueToRed       = config.GetBool(Plugin.Name, "blueToRed", false, true);

            boxing           = config.GetBool(Plugin.Name, "boxing", false, true);
            hideSabers       = config.GetBool(Plugin.Name, "hideSabers", false, true);
            hideSaberEffects = config.GetBool(Plugin.Name, "hideSaberEffects", false, true);
            centering        = config.GetBool(Plugin.Name, "centering", false, true);

            feet           = config.GetBool(Plugin.Name, "feet", false, true);
            noDirection    = config.GetBool(Plugin.Name, "noDirection", false, true);
            ignoreBadColor = config.GetBool(Plugin.Name, "ignoreBadColor", false, true);
            flatNotes      = config.GetBool(Plugin.Name, "flatNotes", false, true);
            feetAvatar     = config.GetBool(Plugin.Name, "feetAvatar", false, true);
            ReadFeetPosRot();

            headbang = config.GetBool(Plugin.Name, "headbang", false, true);
            superhot = config.GetBool(Plugin.Name, "superhot", false, true);
            vacuum   = config.GetBool(Plugin.Name, "vacuum", false, true);
        }
コード例 #18
0
 public void OnApplicationStart()
 {
     harmony   = HarmonyInstance.Create(id);
     config    = new BS_Utils.Utilities.Config("Accurate Hit Scores");
     isEnabled = config.GetBool("Settings", "Enabled", false, true);
 }
コード例 #19
0
ファイル: Config.cs プロジェクト: Auros/Intro-Skip
 public static void Read()
 {
     AllowIntroSkip = ModPrefs.GetBool("IntroSkip", "allowIntroSkip", true, true);
     AllowOutroSkip = ModPrefs.GetBool("IntroSkip", "allowOutroSkip", true, true);
 }
コード例 #20
0
 /// <summary>
 /// Called before Start or Updates by Unity infrastructure
 /// </summary>
 public void Awake()
 {
     config         = new BS_Utils.Utilities.Config(Name);
     NoArrowsOption = config.GetBool(Name, Option, false, true);
 }
コード例 #21
0
 public static void Read()
 {
     enabled        = config.GetBool("PlaneVisualizer", "enabled", false, true);
     practiceEnable = config.GetBool("PlaneVisualizer", "practiceEnable", false, true);
 }