Exemple #1
0
 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);
 }
Exemple #2
0
 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);
 }
Exemple #3
0
        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);
             */
        }
Exemple #4
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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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));
        }
        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);
        }
        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();
        }
Exemple #9
0
        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);
        }