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); }
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); }
public void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode) { if (scene.name != "MenuCore") { return; } var menu = SettingsUI.CreateSubMenu("FCDisplay"); 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(Config.GetBool("FCDisplay", "Enabled", true, true)); }; enabled.SetValue += delegate(bool value) { Config.SetBool("FCDisplay", "Enabled", value); }; enabled.EnabledText = "Enabled"; enabled.DisabledText = "Disabled"; var effect = menu.AddList("Miss Effect", effectVals); effect.GetValue += delegate { return(Config.GetInt("FCDisplay", "MissEffect", 1, true)); }; effect.SetValue += delegate(float value) { Config.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(Config.GetBool("FCDisplay", "VanillaEnabled", false, true)); }; vanilla.SetValue += delegate(bool value) { Config.SetBool("FCDisplay", "VanillaEnabled", value); }; vanilla.EnabledText = "Visible"; vanilla.DisabledText = "Hidden"; }
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); */ }
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); }
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); }
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)); }
private void LoadConfig() { useMaxDeviation = _config.GetBool("Settings", "Use Max Deviation", false, true); maxDeviation = _config.GetInt("Settings", "Max Deviation", 15, 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(); }
public static void Load() { // beatsaverURL = config.GetString("BeatSaverDownloader", "beatsaverURL", "https://beatsaver.com", true); // scoresaberURL = config.GetString("BeatSaverDownloader", "scoresaberURL", "https://scoresaber.com", true); maxSimultaneousDownloads = config.GetInt("BeatSaverDownloader", "maxSimultaneousDownloads", 3, true); }