protected bool LoadSettings() { if (ModPrefs.GetString("TogglePOV", "Version", TogglePOVPlugin.PLUGIN_VERSION, true) != TogglePOVPlugin.PLUGIN_VERSION) { ModPrefs.SetString("TogglePOV", "Version", TogglePOVPlugin.PLUGIN_VERSION); ModPrefs.SetFloat("TogglePOV", "fFOV", DEFAULT_FOV); ModPrefs.SetBool("TogglePOV", "bShowHair", SHOW_HAIR); ModPrefs.SetFloat("TogglePOV", "fMaleOffset", MALE_OFFSET); ModPrefs.SetFloat("TogglePOV", "fFemaleOffset", FEMALE_OFFSET); } else { currentfov = DEFAULT_FOV = Mathf.Clamp(ModPrefs.GetFloat("TogglePOV", "fFOV", DEFAULT_FOV, true), 1f, MAXFOV); SHOW_HAIR = ModPrefs.GetBool("TogglePOV", "bShowHair", SHOW_HAIR, true); MALE_OFFSET = ModPrefs.GetFloat("TogglePOV", "fMaleOffset", MALE_OFFSET, true); FEMALE_OFFSET = ModPrefs.GetFloat("TogglePOV", "fFemaleOffset", FEMALE_OFFSET, true); } try { string keystring = ModPrefs.GetString("TogglePOV", "POVHotkey", hotkey.ToString(), true); hotkey = (KeyCode)Enum.Parse(typeof(KeyCode), keystring, true); } catch (Exception) { Console.WriteLine("Using default hotkey ({0})", hotkey.ToString()); return(false); } return(true); }
public static void InitializeMenu() { if (!initialized) { initialized = true; RGBLightsEnabled = ModPrefs.GetBool("ChromaLite", "RGBLights", true); SpecialEventsEnabled = ModPrefs.GetBool("ChromaLite", "SpecialEvents", false); } GameplaySettingsUI.CreateSubmenuOption(GameplaySettingsPanels.PlayerSettingsRight, "ChromaLite", "MainMenu", "CLite", "ChromaLite events options"); ToggleOption rgbLightsToggle = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.PlayerSettingsRight, "RGB Lights", "CLite", "Enable/Disable RGB lighting events."); rgbLightsToggle.GetValue = RGBLightsEnabled; rgbLightsToggle.OnToggle += delegate(bool value) { RGBLightsEnabled = value; ModPrefs.SetBool("ChromaLite", "RGBLights", value); }; rgbLightsToggle.AddConflict("Darth Maul"); ToggleOption specialEventsToggle = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.PlayerSettingsRight, "Special Events", "CLite", "Enable/Disable Special Events, such as note size changing, player heal/harm events, and rotation events."); specialEventsToggle.GetValue = SpecialEventsEnabled; specialEventsToggle.OnToggle += delegate(bool value) { SpecialEventsEnabled = value; ModPrefs.SetBool("ChromaLite", "SpecialEvents", value); }; specialEventsToggle.AddConflict("Darth Maul"); }
private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) { if (arg0.name != "Menu") { return; } Plugin.Log("Menu Tweaks Started!", LogLevel.DebugOnly); // Create the settings menu var submenu = SettingsUI.CreateSubMenu("Menu Tweaks"); // Add the Fail Counter toggle failCounterToggle = submenu.AddBool("Fail Counter"); failCounterToggle.GetValue += delegate { return(ModPrefs.GetBool("MenuTweaks", "FailCounterVisible", true, true)); }; failCounterToggle.SetValue += delegate(bool value) { ModPrefs.SetBool("MenuTweaks", "FailCounterVisible", value); }; failCounterToggle.EnabledText = "VISIBLE"; failCounterToggle.DisabledText = "HIDDEN"; // Add the Click Shockwave toggle menuShockwaveToggle = submenu.AddBool("Click Shockwave"); menuShockwaveToggle.GetValue += delegate { return(ModPrefs.GetBool("MenuTweaks", "ClickShockwaveEnabled", true, true)); }; menuShockwaveToggle.SetValue += delegate(bool value) { ModPrefs.SetBool("MenuTweaks", "ClickShockwaveEnabled", value); }; // Add the Fireworks toggle fireworksToggle = submenu.AddBool("Fireworks"); fireworksToggle.GetValue += delegate { return(ModPrefs.GetBool("MenuTweaks", "FireworksEnabled", true, true)); }; fireworksToggle.SetValue += delegate(bool value) { ModPrefs.SetBool("MenuTweaks", "FireworksEnabled", value); }; }
private void CheckForUserDataFolder() { string userDataPath = Environment.CurrentDirectory + "/UserData"; if (!Directory.Exists(userDataPath)) { Directory.CreateDirectory(userDataPath); } if ("".Equals(ModPrefs.GetString(PluginName, KeyDarthMode, ""))) { ModPrefs.SetBool(PluginName, KeyDarthMode, false); } if ("".Equals(ModPrefs.GetString(PluginName, KeyOneHanded, ""))) { ModPrefs.SetBool(PluginName, KeyOneHanded, false); } if ("".Equals(ModPrefs.GetString(PluginName, KeyAutoDetect, ""))) { ModPrefs.SetBool(PluginName, KeyAutoDetect, false); } if ("".Equals(ModPrefs.GetString(PluginName, KeySeparation, ""))) { ModPrefs.SetInt(PluginName, KeySeparation, 15); } }
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)); }; } }
private void CheckForUserDataFolder() { string userDataPath = Environment.CurrentDirectory + "/UserData"; if (!Directory.Exists(userDataPath)) { Directory.CreateDirectory(userDataPath); } if ("".Equals(ModPrefs.GetString(Plugin.PluginName, Plugin.KeyTranparentWall, ""))) { ModPrefs.SetBool(Plugin.PluginName, Plugin.KeyTranparentWall, true); } if ("".Equals(ModPrefs.GetString(Plugin.PluginName, Plugin.KeyHMD, ""))) { ModPrefs.SetBool(Plugin.PluginName, Plugin.KeyHMD, true); } if ("".Equals(ModPrefs.GetString(Plugin.PluginName, Plugin.KeyCameraPlus, ""))) { ModPrefs.SetBool(Plugin.PluginName, Plugin.KeyCameraPlus, true); } if ("".Equals(ModPrefs.GetString(Plugin.PluginName, Plugin.KeyMutiView, ""))) { ModPrefs.SetBool(Plugin.PluginName, Plugin.KeyMutiView, true); } if ("".Equals(ModPrefs.GetString(Plugin.PluginName, Plugin.KeyDynamicCamera, ""))) { ModPrefs.SetBool(Plugin.PluginName, Plugin.KeyDynamicCamera, true); } if ("".Equals(ModPrefs.GetString(Plugin.PluginName, Plugin.KeyLIV, ""))) { ModPrefs.SetBool(Plugin.PluginName, Plugin.KeyLIV, true); } }
private static void CreateSettingsUI() { var subMenu = SettingsUI.CreateSubMenu("Platforms"); var feetMenu = subMenu.AddBool("Always Show Feet"); feetMenu.GetValue += delegate { return(PlatformManager.Instance.envHider.showFeetOverride); }; feetMenu.SetValue += delegate(bool value) { PlatformManager.Instance.envHider.showFeetOverride = value; ModPrefs.SetBool(CustomFloorPlugin.PluginName, "AlwaysShowFeet", PlatformManager.Instance.envHider.showFeetOverride); }; var environment = subMenu.AddList("Environment Override", EnvironmentSceneOverrider.OverrideModes()); environment.GetValue += delegate { return((float)EnvironmentSceneOverrider.overrideMode); }; environment.SetValue += delegate(float value) { EnvironmentSceneOverrider.overrideMode = (EnvironmentSceneOverrider.EnvOverrideMode)value; EnvironmentSceneOverrider.OverrideEnvironmentScene(); ModPrefs.SetInt(CustomFloorPlugin.PluginName, "EnvironmentOverrideMode", (int)EnvironmentSceneOverrider.overrideMode); }; environment.FormatValue += delegate(float value) { return(EnvironmentSceneOverrider.Name((EnvironmentSceneOverrider.EnvOverrideMode)value)); }; }
public static void LoadOrCreateConfig() { if (!Directory.Exists("UserData")) { Directory.CreateDirectory("UserData"); } //EnablePlugin property if (!ModPrefs.HasKey("BeatSaverCustomExit", "EnablePlugin")) { ModPrefs.SetBool("BeatSaverCustomExit", "EnablePlugin", true); Console.WriteLine("Created config"); } else { EnablePlugin = ModPrefs.GetBool("BeatSaverCustomExit", "EnablePlugin", true, true); } //TextContent property if (!ModPrefs.HasKey("BeatSaverCustomExit", "TextContent")) { ModPrefs.SetString("BeatSaverCustomExit", "TextContent", "Are you really sure to quit <b><color=#FF6060>Beat <color=#00B0FF>Saber</b><color=#FFFFFF> ?"); Console.WriteLine("Created config"); } else { TextContent = ModPrefs.GetString("BeatSaverCustomExit", "TextContent", "Are you really sure to quit <b><color=#FF6060>Beat <color=#00B0FF>Saber</b><color=#FFFFFF> ?", true); } }
public static void CreateUI() { var toggleOption = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.ModifiersLeft, "Show Notes Left Counter", "MainMenu", "Shows the amount of notes left in the song as you progress"); toggleOption.GetValue = ModPrefs.GetBool("NotesLeftCounter", "showNoteCounter", true, true); toggleOption.OnToggle += (value) => { ShowNoteCounter = value; ModPrefs.SetBool("NotesLeftCounter", "showNoteCounter", value); }; }
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"; }
private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) { if (arg0.name == "Menu") { modEnable = false; var settingsSubmenu = SettingsUI.CreateSubMenu("AutoPause"); var en = settingsSubmenu.AddBool("AutoPause Enabled"); en.GetValue += delegate { return(ModPrefs.GetBool("Auros's AutoPause", "Enabled", true, true)); }; en.SetValue += delegate(bool value) { ModPrefs.SetBool("Auros's AutoPause", "Enabled", value); }; var pq = settingsSubmenu.AddBool("FPS Pause"); pq.GetValue += delegate { return(ModPrefs.GetBool("Auros's AutoPause", "FPSCheckerOn", false, true)); }; pq.SetValue += delegate(bool value) { ModPrefs.SetBool("Auros's AutoPause", "FPSCheckerOn", value); }; float[] fpsValues = { 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90 }; var fpsThreshold = settingsSubmenu.AddList("FPS Threshold", fpsValues); fpsThreshold.GetValue += delegate { return(ModPrefs.GetFloat("Auros's AutoPause", "FPSThreshold", 40, true)); }; fpsThreshold.SetValue += delegate(float value) { ModPrefs.SetFloat("Auros's AutoPause", "FPSThreshold", value); }; fpsThreshold.FormatValue += delegate(float value) { return(string.Format("{0:0}", value)); }; System.Console.WriteLine("[AutoPause] Settings Created"); //System.Console.Read(); //SharedCoroutineStarter.instance.StartCoroutine(DelayedEnable()); } }
public static void SaveConfig() { ModPrefs.SetBool("BeatSaverCustomExit", "EnablePlugin", EnablePlugin); ModPrefs.SetBool("BeatSaverCustomExit", "AskWhenQuitting", AskWhenQuitting); ModPrefs.SetBool("BeatSaverCustomExit", "AskWhenRestarting", AskWhenRestarting); ModPrefs.SetString("BeatSaverCustomExit", "QuitTextContent", QuitTextContent); ModPrefs.SetString("BeatSaverCustomExit", "RestartTextContent", RestartTextContent); }
public static void Write() { ModPrefs.SetBool("SyncSaber", "AutoDownloadSongs", AutoDownloadSongs); ModPrefs.SetBool("SyncSaber", "AutoUpdateSongs", AutoUpdateSongs); ModPrefs.SetString("SyncSaber", "BeastSaberUsername", BeastSaberUsername); ModPrefs.SetInt("SyncSaber", "MaxBeastSaberPages", MaxBeastSaberPages); ModPrefs.SetBool("SyncSaber", "DeleteOldVersions", DeleteOldVersions); }
public static void Write() { // Write the updated values to the config file in case we haven't already ModPrefs.SetBool(Plugin.Instance.Name, "Enabled", EnableHiddenBlocks); ModPrefs.SetFloat(Plugin.Instance.Name, "BlockHideDistance", BlockHideDistance); WritePending = false; }
private void OnSceneLoaded(Scene scene, LoadSceneMode arg1) { if (scene.name == "Menu") { var disableOption = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.PlayerSettingsRight, "Rainbow Lighting", "MainMenu", "Enable Rainbow Lighting"); disableOption.GetValue = ModPrefs.GetBool("RainbowLighting", "Enabled", true, true); disableOption.OnToggle += (value) => { enabled = value; ModPrefs.SetBool("RainbowLighting", "Enabled", value); }; } }
public override void OnUpdate() { if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.P)) { ModPrefs.SetBool("NoPerformanceStats", "DisablePerformanceStats", allowPerformanceScanner); LoadModPrefs(); MelonModLogger.Log("Avatar Performance Stats is now " + (allowPerformanceScanner ? "ENABLED" : "DISABLED")); } }
public static void SaveConfig() { File.WriteAllText(votedSongsPath, JsonConvert.SerializeObject(votedSongs, Formatting.Indented), Encoding.UTF8); File.WriteAllLines(configPath, favoriteSongs.Distinct().ToArray(), Encoding.UTF8); ModPrefs.SetBool("BeatSaverDownloader", "disableDeleteButton", disableDeleteButton); ModPrefs.SetBool("BeatSaverDownloader", "deleteToRecycleBin", deleteToRecycleBin); ModPrefs.SetInt("BeatSaverDownloader", "maxSimultaneousDownloads", maxSimultaneousDownloads); }
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; ModPrefs.SetBool(Plugin.PluginName, "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); ModPrefs.SetInt(Plugin.PluginName, "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; ModPrefs.SetInt(Plugin.PluginName, "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; ModPrefs.SetBool(Plugin.PluginName, "AutoDownload", ScreenManager.showVideo); }; }
public static void SaveConfig() { ModPrefs.SetBool("BeatSaberDrinkWater", "EnablePlugin", EnablePlugin); ModPrefs.SetBool("BeatSaberDrinkWater", "ShowGIFs", ShowGIFs); ModPrefs.SetInt("BeatSaberDrinkWater", "WaitDuration", WaitDuration); ModPrefs.SetBool("BeatSaberDrinkWater", "EnableByPlaytime", EnableByPlaytime); ModPrefs.SetBool("BeatSaberDrinkWater", "EnableByPlaycount", EnableByPlaycount); ModPrefs.SetInt("BeatSaberDrinkWater", "PlaytimeBeforeWarning", PlaytimeBeforeWarning); ModPrefs.SetInt("BeatSaberDrinkWater", "PlaycountBeforeWarning", PlaycountBeforeWarning); }
public static void Save() { ModPrefs.SetBool(PrefsSection, "Enabled", DisplayLyrics); ModPrefs.SetInt(PrefsSection, nameof(ToggleKeyCode), ToggleKeyCode); ModPrefs.SetFloat(PrefsSection, nameof(DisplayDelay), DisplayDelay); ModPrefs.SetFloat(PrefsSection, nameof(HideDelay), HideDelay); if (VerboseLogging) { ModPrefs.SetBool(PrefsSection, nameof(VerboseLogging), true); } }
public void OnApplicationStart() { Instance = this; SceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged; SceneManager.sceneLoaded += SceneManager_sceneLoaded; Enabled = ModPrefs.GetBool(Name, "Enabled", true); ModPrefs.SetBool(Name, "Enabled", Enabled); GameHooks.Apply(); }
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; }
public static void Write() { ModPrefs.SetBool(Plugin.Instance.Name, "AutoDownloadSongs", AutoDownloadSongs); ModPrefs.SetBool(Plugin.Instance.Name, "AutoUpdateSongs", AutoUpdateSongs); ModPrefs.SetString(Plugin.Instance.Name, "BeastSaberUsername", BeastSaberUsername); ModPrefs.SetBool(Plugin.Instance.Name, "DeleteOldVersions", DeleteOldVersions); ModPrefs.SetBool(Plugin.Instance.Name, "SyncBookmarksFeed", SyncBookmarksFeed); ModPrefs.SetBool(Plugin.Instance.Name, "SyncCuratorRecommendedFeed", SyncCuratorRecommendedFeed); ModPrefs.SetBool(Plugin.Instance.Name, "SyncFollowingsFeed", SyncFollowingsFeed); ModPrefs.SetInt(Plugin.Instance.Name, "MaxBookmarksPages", MaxBookmarksPages); ModPrefs.SetInt(Plugin.Instance.Name, "MaxCuratorRecommendedPages", MaxCuratorRecommendedPages); ModPrefs.SetInt(Plugin.Instance.Name, "MaxFollowingsPages", MaxFollowingsPages); }
private void SceneManager_sceneLoaded(Scene scene, LoadSceneMode arg1) { if (scene.name == "Menu") { var subMenuCC = SettingsUI.CreateSubMenu("Songloader"); var colorOverrideOption = subMenuCC.AddBool("Allow Custom Song Colors"); colorOverrideOption.GetValue += delegate { return(ModPrefs.GetBool("Songloader", "customSongColors", true, true)); }; colorOverrideOption.SetValue += delegate(bool value) { ModPrefs.SetBool("Songloader", "customSongColors", value); }; var platformOverrideOption = subMenuCC.AddBool("Allow Custom Song Platforms"); platformOverrideOption.GetValue += delegate { return(ModPrefs.GetBool("Songloader", "customSongPlatforms", true, true)); }; platformOverrideOption.SetValue += delegate(bool value) { ModPrefs.SetBool("Songloader", "customSongPlatforms", value); }; } }
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; }; }
void AmbientOcclusionAction(bool enable) { ModPrefs.SetBool("PHIBL", "AmbientOcclusion", enable); if (enable) { Camera.main.GetComponent <SSAOPro>().enabled = false; if (StudioMode) { Singleton <Studio.Studio> .Instance.sceneInfo.enableSSAO = false; } else { ConfigData.ssaoEnable = false; } } }
private void UserCustomModule() { GUILayout.Label(GUIStrings.Global_Settings, titlestyle2); SliderGUI(QualitySettings.shadowDistance, 20f, 150f, 30f, x => QualitySettings.shadowDistance = x, " Shadow Distance "); SliderGUI(Camera.main.nearClipPlane, 0.01f, 1f, 0.06f, x => Camera.main.nearClipPlane = x, new GUIContent(" Camra near clip plane ")); ToggleGUI(Camera.main.useOcclusionCulling, new GUIContent(" Occlusion Culling "), x => Camera.main.useOcclusionCulling = x); //ToggleGUI(Camera.main.useJitteredProjectionMatrixForTransparentRendering, new GUIContent(" Use Jittered Projection Matrix For Transparent Rendering "), x => Camera.main.useJitteredProjectionMatrixForTransparentRendering = x); SelectGUI(ref vSyncCount, GUIStrings.Vsync, GUIStrings.Disable_vs_Enable, count => ModPrefs.SetInt("PHIBL", "VSync", count)); ToggleGUI(ref asyncLoad, GUIStrings.Async_Load, enable => ModPrefs.SetBool("PHIBL", "AsyncLoad", enable)); //ToggleGUI(ref forceDeferred, GUIStrings.Force_Deferred, enable => ModPrefs.SetBool("PHIBL", "ForceDeferred", enable)); ToggleGUI(ref autoSetting, GUIStrings.Auto_Setting, enable => ModPrefs.SetBool("PHIBL", "AutoSetting", enable)); ToggleGUI(ref disableLightMap, GUIStrings.DisableLightMap, disablelightmap => ModPrefs.SetBool("PHIBL", "DisableLightMap", disablelightmap)); GUILayout.BeginHorizontal(); GUILayout.Label(GUIStrings.Custom_Window, labelstyle); GUILayout.FlexibleSpace(); if (GUILayout.Button(GUIStrings.Custom_Window_Remember, buttonstyleNoStretch, GUILayout.ExpandWidth(false))) { ModPrefs.SetFloat("PHIBL", "Window.width", windowRect.width); ModPrefs.SetFloat("PHIBL", "Window.height", windowRect.height); ModPrefs.SetFloat("PHIBL", "Window.x", windowRect.x); ModPrefs.SetFloat("PHIBL", "Window.y", windowRect.y); } GUILayout.EndHorizontal(); GUILayout.Space(space); float widthtemp; widthtemp = SliderGUI( value: windowRect.width, min: minwidth, max: UIUtils.Screen.width * 0.5f, reset: () => ModPrefs.GetFloat("PHIBL", "Window.width"), labeltext: GUIStrings.Window_Width, valuedecimals: "N0"); if (widthtemp != windowRect.width) { windowRect.x += (windowRect.width - widthtemp) * (windowRect.x) / (UIUtils.Screen.width - windowRect.width); windowRect.width = widthtemp; } windowRect.height = SliderGUI( value: windowRect.height, min: UIUtils.Screen.height * 0.2f, max: UIUtils.Screen.height - 10f, reset: () => ModPrefs.GetFloat("PHIBL", "Window.height"), labeltext: GUIStrings.Window_Height, valuedecimals: "N0"); SelectGUI(ref screenShotSize, new GUIContent(" Screen Shot Size: "), 0); }
private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) { Plugin.Log($"Scene: {arg0.name}"); if (arg0.name == "Menu") { var toggle = GameplaySettingsUI.CreateToggleOption("Debris Remover", "Stops note debris from spawning entirely when you slice a note."); toggle.GetValue = Enabled; toggle.OnToggle += (b) => { Instance.Enabled = b; ModPrefs.SetBool(Name, "Enabled", Instance.Enabled); Plugin.Log($"{(b ? "Enabled" : "Disabled")}"); }; Plugin.Log("Created gameplay settings toggle!"); } }
private void CreatUI() { var subMenu = SettingsUI.CreateSubMenu("Random Song"); var min = subMenu.AddList("Min Song Difficulty", Difficulties()); min.GetValue += delegate { return((float)minDiff); }; min.SetValue += delegate(float value) { minDiff = (LevelDifficulty)value; ModPrefs.SetInt(Plugin.PluginName, minDiffSetting, (int)minDiff); }; min.FormatValue += delegate(float value) { return(LevelDifficultyMethods.Name((LevelDifficulty)value)); }; var max = subMenu.AddList("Max Song Difficulty", Difficulties()); max.GetValue += delegate { return((float)maxDiff); }; max.SetValue += delegate(float value) { maxDiff = (LevelDifficulty)value; ModPrefs.SetInt(Plugin.PluginName, maxDiffSetting, (int)maxDiff); }; max.FormatValue += delegate(float value) { return(LevelDifficultyMethods.Name((LevelDifficulty)value)); }; var exclude = subMenu.AddBool("Exclude Standard Songs"); exclude.GetValue += delegate { return(excludeStandard); }; exclude.SetValue += delegate(bool value) { excludeStandard = value; ModPrefs.SetBool(Plugin.PluginName, excludeStandardSetting, excludeStandard); }; var autoPlayMenu = subMenu.AddBool("Auto Play"); autoPlayMenu.GetValue += delegate { return(autoPlay); }; autoPlayMenu.SetValue += delegate(bool value) { autoPlay = value; ModPrefs.SetBool(Plugin.PluginName, autoPlaySetting, autoPlay); }; }
private void TrackingSpace() { //This feels messy if (_localCam is null) { return; } ModPrefs.SetBool("LocalCamera", "ParentToTracking", !ModPrefs.GetBool("LocalCamera", "ParentToTracking")); if (ModPrefs.GetBool("LocalCamera", "ParentToTracking")) { _localCam.transform.SetParent(GameObject.Find("_Application/TrackingVolume/PlayerObjects").transform, true); } else { _localCam.transform.SetParent(null); } parentToTracking = ModPrefs.GetBool("LocalCamera", "ParentToTracking"); buttonList["trackingBut"].GetComponentInChildren <Text>().text = $"Toggle Tracking Space\n {(parentToTracking ? "-Following-" : "-Not Following-")} "; }