//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// Constructor /// </summary> public MainView() { didActivate += (p_FirstActivation, _, __) => { if (p_FirstActivation) { PrepareSlider(m_EnableSlider); PrepareSlider(m_PlaylistTypeSlider); PrepareSlider(m_AccuracyTypeSlider); PrepareSlider(m_AccuracySlider, true); PrepareSlider(m_DifficultySlider, true); PrepareSlider(m_PlaylistSizeSlider, true); } }; m_TypeOptions = Helper.PlaylistTypes; m_TypeChoice = Helper.DefaultPlaylistType; m_AccuracyOptions = Helper.AccuracyTypes; m_AccuracyChoice = Helper.DefaultAccuracyType; var l_Config = Plugin.instance.PluginConfig; var l_Section = "Config_" + Helper.GetProfileID(); if (l_Config.HasKey(l_Section, "Enabled")) { m_Enabled = l_Config.GetBool(l_Section, "Enabled"); } if (l_Config.HasKey(l_Section, "PlaylistType")) { m_TypeChoice = Helper.PlaylistIDToPlaylistType(l_Config.GetInt(l_Section, "PlaylistType")); } if (l_Config.HasKey(l_Section, "AccuracyType")) { m_AccuracyChoice = Helper.AccuracyIDToAccuracyType(l_Config.GetInt(l_Section, "AccuracyType")); } if (l_Config.HasKey(l_Section, "RequiredAccuracy")) { m_RequiredAccuracy = ((float)l_Config.GetInt(l_Section, "RequiredAccuracy")) / 100; } if (l_Config.HasKey(l_Section, "RequiredDifficulty")) { m_RequiredDifficulty = ((float)l_Config.GetInt(l_Section, "RequiredDifficulty")) / 100; } if (l_Config.HasKey(l_Section, "PlaylistSize")) { m_PlaylistSize = l_Config.GetInt(l_Section, "PlaylistSize"); } m_HttpClient = new Http(new HttpOptions() { ApplicationName = "bs_pp_booster", Version = new System.Version(1, 0, 0), }); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// Constructor /// </summary> public PreviewView() { didActivate += (p_FirstActivation, _, __) => { if (p_FirstActivation) { PrepareSlider(m_PlaylistTypeSlider); PrepareSlider(m_AccuracyTypeSlider); PrepareSlider(m_AccuracySlider, true); PrepareSlider(m_DifficultySlider, true); } }; m_TypeOptions = Helper.PlaylistTypes; m_TypeChoice = Helper.DefaultPlaylistType; m_AccuracyOptions = Helper.AccuracyTypes; m_AccuracyChoice = Helper.DefaultAccuracyType; var l_Config = Plugin.instance.PluginConfig; var l_Section = "Config_" + Helper.GetProfileID(); if (l_Config.HasKey(l_Section, "PreviewPlaylistType")) { m_TypeChoice = Helper.PlaylistIDToPlaylistType(l_Config.GetInt(l_Section, "PreviewPlaylistType")); } if (l_Config.HasKey(l_Section, "PreviewAccuracyType")) { m_AccuracyChoice = Helper.AccuracyIDToAccuracyType(l_Config.GetInt(l_Section, "PreviewAccuracyType")); } if (l_Config.HasKey(l_Section, "PreviewRequiredAccuracy")) { m_RequiredAccuracy = ((float)l_Config.GetInt(l_Section, "PreviewRequiredAccuracy")) / 100; } if (l_Config.HasKey(l_Section, "PreviewRequiredDifficulty")) { m_RequiredDifficulty = ((float)l_Config.GetInt(l_Section, "PreviewRequiredDifficulty")) / 100; } }