private static void CreateSettingsUI() { var subMenu = SettingsUI.CreateSubMenu("VideoPlayer"); var showVideoSetting = subMenu.AddBool("Show Video"); showVideoSetting.GetValue += delegate { return(ScreenManager.showVideo); }; showVideoSetting.SetValue += delegate(bool value) { ScreenManager.showVideo = value; config.SetBool("Settings", "ShowVideo", ScreenManager.showVideo); }; var placementSetting = subMenu.AddList("Screen Position", VideoPlacementSetting.Modes()); placementSetting.GetValue += delegate { return((float)ScreenManager.Instance.placement); }; placementSetting.SetValue += delegate(float value) { ScreenManager.Instance.SetPlacement((VideoPlacement)value); config.SetInt("Settings", "ScreenPositionMode", (int)ScreenManager.Instance.placement); }; placementSetting.FormatValue += delegate(float value) { return(VideoPlacementSetting.Name((VideoPlacement)value)); }; var qualitySetting = subMenu.AddList("Video Download Quality", VideoQualitySetting.Modes()); qualitySetting.GetValue += delegate { return((float)YouTubeDownloader.Instance.quality); }; qualitySetting.SetValue += delegate(float value) { YouTubeDownloader.Instance.quality = (VideoQuality)value; config.SetInt("Settings", "VideoDownloadQuality", (int)YouTubeDownloader.Instance.quality); }; qualitySetting.FormatValue += delegate(float value) { return(VideoQualitySetting.Name((VideoQuality)value)); }; var autoDownloadSetting = subMenu.AddBool("Auto Download"); autoDownloadSetting.GetValue += delegate { return(VideoLoader.Instance.autoDownload); }; autoDownloadSetting.SetValue += delegate(bool value) { VideoLoader.Instance.autoDownload = value; config.SetBool("Settings", "AutoDownload", ScreenManager.showVideo); }; }
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"; }
internal void Save() { Util.Logger.Log("Saving config!"); config.SetBool(sectionCore, useCustomMenuSongs, UseCustomMenuSongs); config.SetBool(sectionCore, loop, Loop); config.SetFloat(sectionCore, menuMusicVolume, MenuMusicVolume); config.SetBool(sectionNowPlaying, showNowPlaying, ShowNowPlaying); config.SetInt(sectionNowPlaying, nowPlayingLocation, NowPlayingLocation); config.SetInt(sectionNowPlaying, nowPlayingColor, NowPlayingColor); CustomMenuMusicController.instance.GetSongsList(); StartCoroutine(SetVolume()); NowPlaying.instance?.SetCurrentSong(ShowNowPlaying ? CustomMenuMusicController.instance?.CurrentSongPath : String.Empty); NowPlaying.instance?.SetTextColor(NowPlayingColor); NowPlaying.instance?.SetLocation((Location)NowPlayingLocation); }
public static void SaveConfig() { File.WriteAllText(votedSongsPath, JsonConvert.SerializeObject(votedSongs, Formatting.Indented), Encoding.UTF8); File.WriteAllText(reviewedSongsPath, JsonConvert.SerializeObject(reviewedSongs, Formatting.Indented), Encoding.UTF8); File.WriteAllLines(favSongsPath, favoriteSongs.Distinct().ToArray(), Encoding.UTF8); config.SetString("BeatSaverDownloader", "beatsaverURL", beatsaverURL); config.SetBool("BeatSaverDownloader", "disableDeleteButton", disableDeleteButton); config.SetBool("BeatSaverDownloader", "deleteToRecycleBin", deleteToRecycleBin); config.SetBool("BeatSaverDownloader", "enableSongIcons", enableSongIcons); config.SetBool("BeatSaverDownloader", "rememberLastPackAndSong", rememberLastPackAndSong); config.SetInt("BeatSaverDownloader", "maxSimultaneousDownloads", maxSimultaneousDownloads); config.SetInt("BeatSaverDownloader", "fastScrollSpeed", fastScrollSpeed); config.SetString("BeatSaverDownloader", "lastSelectedPack", lastSelectedPack ?? ""); config.SetString("BeatSaverDownloader", "lastSelectedSong", lastSelectedSong ?? ""); config.SetInt("BeatSaverDownloader", "lastSelectedSortMode", (int)lastSelectedSortMode); }
public static void Save() { Config.SetBool(PrefsSection, "Enabled", DisplayLyrics); Config.SetFloat(PrefsSection, nameof(DisplayDelay), DisplayDelay); Config.SetFloat(PrefsSection, nameof(HideDelay), HideDelay); Config.SetBool(PrefsSection, nameof(VerboseLogging), VerboseLogging); Config.SetBool(PrefsSection, "Text Shaking", Shake); Config.SetInt(PrefsSection, "Font Size", FontSize); Config.SetInt(PrefsSection, "ColorR", (int)(TextColor.r * 255f)); Config.SetInt(PrefsSection, "ColorG", (int)(TextColor.g * 255f)); Config.SetInt(PrefsSection, "ColorB", (int)(TextColor.b * 255f)); Config.SetInt(PrefsSection, "ColorA", (int)(TextColor.a * 255f)); Config.SetFloat(PrefsSection, "PosX", Position.x); Config.SetFloat(PrefsSection, "PosY", Position.y); Config.SetFloat(PrefsSection, "PosZ", Position.z); }
public static void Write() { config.SetBool("PP Helper", "showInfo", showInfo); config.SetFloat("PP Helper", "defaultAcc", defaultAcc); config.SetBool("PP Helper", "ppTop", ppTop); config.SetFloat("PP Helper", "accIncrement", accIncrement); config.SetFloat("PP Helper", "starRange", starRange); config.SetString("PP Helper", "starAccChoice", starAccChoice.ToString()); config.SetInt("PP Helper", "numberOfScores", numberOfScores); config.SetBool("PP Helper", "accOverride", accOverride); config.SetBool("PP Helper", "autoUpdate", autoUpdate); config.SetBool("PP Helper", "playHistory", playHistory); config.SetString("PP Helper", "sortMethod", sortMethod.ToString()); config.SetBool("PP Helper", "ignoreNoFail", ignoreNoFail); config.SetBool("PP Helper", "hideOnStart", hideOnStart); config.SetInt("PP Helper", "decimalPrecision", decimalPrecision); }
public static void SaveConfig() { // config.SetString("BeatSaverDownloader", "beatsaverURL", beatsaverURL); // config.SetString("BeatSaverDownloader", "scoresaberURL", scoresaberURL); config.SetInt("BeatSaverDownloader", "maxSimultaneousDownloads", maxSimultaneousDownloads); }