#pragma warning restore CS0649 //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On view creation /// </summary> protected override sealed void OnViewCreation() { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(Settings.OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); SDK.UI.ToggleSetting.Setup(m_UserBeatSaberPlusCustomMapsServer, l_Event, Config.Online.UseBSPCustomMapsServer, true); SDK.UI.ToggleSetting.Setup(m_UserBeatSaberPlusCustomMapsServerInMoreSongs, l_Event, Config.Online.UseBSPCustomMapsServerOnMoreSongs, true); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On view creation /// </summary> protected override sealed void OnViewCreation() { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(Settings.OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); //////////////////////////////////////////////////////////////////////////// /// GamePlay //////////////////////////////////////////////////////////////////////////// /// Particles / Effects SDK.UI.ToggleSetting.Setup(m_RemoveDebris, l_Event, Config.GameTweaker.RemoveDebris, true); SDK.UI.ToggleSetting.Setup(m_RemoveAllCutParticles, l_Event, Config.GameTweaker.RemoveAllCutParticles, true); SDK.UI.ToggleSetting.Setup(m_RemoveAllObstacleParticles, l_Event, Config.GameTweaker.RemoveObstacleParticles, true); SDK.UI.ToggleSetting.Setup(m_RemoveFloorBurnMarkParticles, l_Event, Config.GameTweaker.RemoveSaberBurnMarkSparkles, true); SDK.UI.ToggleSetting.Setup(m_RemoveFloorBurnMarkEffects, l_Event, Config.GameTweaker.RemoveSaberBurnMarks, true); SDK.UI.ToggleSetting.Setup(m_RemoveSaberClashEffects, l_Event, Config.GameTweaker.RemoveSaberClashEffects, true); SDK.UI.ToggleSetting.Setup(m_RemoveWorldParticles, l_Event, Config.GameTweaker.RemoveWorldParticles, true); /// Environment SDK.UI.ToggleSetting.Setup(m_RemoveMusicBandLogo, l_Event, Config.GameTweaker.RemoveMusicBandLogo, true); SDK.UI.ToggleSetting.Setup(m_RemoveFullComboLossAnimation, l_Event, Config.GameTweaker.RemoveFullComboLossAnimation, true); SDK.UI.ToggleSetting.Setup(m_NoFake360HUD, l_Event, Config.GameTweaker.NoFake360HUD, true); /// Sabers SDK.UI.ToggleSetting.Setup(m_RemoveTrail, l_Event, Config.GameTweaker.RemoveSaberSmoothingTrail, true); SDK.UI.IncrementSetting.Setup(m_Intensity, l_Event, SDK.UI.BSMLSettingFormarter.Percentage, Config.GameTweaker.SaberSmoothingTrailIntensity, true); m_Intensity.gameObject.SetActive(false); m_Intensity.interactable = !Config.GameTweaker.RemoveSaberSmoothingTrail; m_Intensity.gameObject.SetActive(true); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On activation /// </summary> /// <param name="p_FirstActivation">Is the first activation ?</param> /// <param name="p_AddedToHierarchy">Activation type</param> /// <param name="p_ScreenSystemEnabling">Is screen system enabled</param> protected override void DidActivate(bool p_FirstActivation, bool p_AddedToHierarchy, bool p_ScreenSystemEnabling) { /// Forward event base.DidActivate(p_FirstActivation, p_AddedToHierarchy, p_ScreenSystemEnabling); /// If first activation, bind event if (p_FirstActivation) { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Left Utils.GameUI.PrepareToggleSetting(m_FollowEnvironementRotations, l_Event, Config.SongChartVisualizer.FollowEnvironementRotation, true); Utils.GameUI.PrepareIncrementSetting(m_BackgroundOpacity, l_Event, Utils.GameUI.Formatter_Percentage, Config.SongChartVisualizer.BackgroundA, true); Utils.GameUI.PrepareIncrementSetting(m_CursorOpacity, l_Event, Utils.GameUI.Formatter_Percentage, Config.SongChartVisualizer.CursorA, true); Utils.GameUI.PrepareIncrementSetting(m_LineOpacity, l_Event, Utils.GameUI.Formatter_Percentage, Config.SongChartVisualizer.LineA, true); Utils.GameUI.PrepareIncrementSetting(m_LegendOpacity, l_Event, Utils.GameUI.Formatter_Percentage, Config.SongChartVisualizer.LegendA, true); Utils.GameUI.PrepareIncrementSetting(m_DashOpacity, l_Event, Utils.GameUI.Formatter_Percentage, Config.SongChartVisualizer.DashLineA, true); /// Right Utils.GameUI.PrepareToggleSetting(m_ShowNPSLegend, l_Event, Config.SongChartVisualizer.ShowNPSLegend, true); Utils.GameUI.PrepareColorSetting(m_BackgroundColor, l_Event, Config.SongChartVisualizer.BackgroundColor, true); Utils.GameUI.PrepareColorSetting(m_CursorColor, l_Event, Config.SongChartVisualizer.CursorColor, true); Utils.GameUI.PrepareColorSetting(m_LineColor, l_Event, Config.SongChartVisualizer.LineColor, true); Utils.GameUI.PrepareColorSetting(m_LegendColor, l_Event, Config.SongChartVisualizer.LegendColor, true); Utils.GameUI.PrepareColorSetting(m_DashColor, l_Event, Config.SongChartVisualizer.DashLineColor, true); } SongChartVisualizer.Instance.RefreshPreview(); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On activation /// </summary> /// <param name="p_FirstActivation">Is the first activation ?</param> /// <param name="p_AddedToHierarchy">Activation type</param> /// <param name="p_ScreenSystemEnabling">Is screen system enabled</param> protected override void DidActivate(bool p_FirstActivation, bool p_AddedToHierarchy, bool p_ScreenSystemEnabling) { /// Forward event base.DidActivate(p_FirstActivation, p_AddedToHierarchy, p_ScreenSystemEnabling); /// If first activation, bind event if (p_FirstActivation) { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Left BeatSaberPlus.Utils.GameUI.PrepareIncrementSetting(m_ChatWidth, l_Event, null, Config.Chat.ChatWidth, true); BeatSaberPlus.Utils.GameUI.PrepareIncrementSetting(m_ChatHeight, l_Event, null, Config.Chat.ChatHeight, true); BeatSaberPlus.Utils.GameUI.PrepareToggleSetting(m_ChatReverse, l_Event, Config.Chat.ReverseChatOrder, true); BeatSaberPlus.Utils.GameUI.PrepareIncrementSetting(m_ChatOpacity, l_Event, BeatSaberPlus.Utils.GameUI.Formatter_Percentage, Config.Chat.BackgroundA, true); BeatSaberPlus.Utils.GameUI.PrepareIncrementSetting(m_ChatFontSize, l_Event, null, Config.Chat.FontSize, true); /// Right BeatSaberPlus.Utils.GameUI.PrepareColorSetting(m_ChatBackgroundColor, l_Event, Config.Chat.BackgroundColor, true); BeatSaberPlus.Utils.GameUI.PrepareColorSetting(m_ChatHighlightColor, l_Event, Config.Chat.HighlightColor, true); BeatSaberPlus.Utils.GameUI.PrepareColorSetting(m_ChatAccentColor, l_Event, Config.Chat.AccentColor, true); BeatSaberPlus.Utils.GameUI.PrepareColorSetting(m_ChatTextColor, l_Event, Config.Chat.TextColor, true); BeatSaberPlus.Utils.GameUI.PrepareColorSetting(m_ChatPingColor, l_Event, Config.Chat.PingColor, true); } }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On activation /// </summary> /// <param name="p_FirstActivation">Is the first activation ?</param> /// <param name="p_AddedToHierarchy">Activation type</param> /// <param name="p_ScreenSystemEnabling">Is screen system enabled</param> protected override void DidActivate(bool p_FirstActivation, bool p_AddedToHierarchy, bool p_ScreenSystemEnabling) { /// Forward event base.DidActivate(p_FirstActivation, p_AddedToHierarchy, p_ScreenSystemEnabling); /// If first activation, bind event if (p_FirstActivation) { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Prepare PrepareSlider(m_FollowEnvironementRotations.gameObject); PrepareSlider(m_ChatFitlerViewers.gameObject); PrepareSlider(m_ChatFilterBroadcaster.gameObject); /// Set values m_FollowEnvironementRotations.Value = Config.Chat.FollowEnvironementRotation; m_ChatFitlerViewers.Value = Config.Chat.FilterViewersCommands; m_ChatFilterBroadcaster.Value = Config.Chat.FilterBroadcasterCommands; /// Bind events m_FollowEnvironementRotations.onChange = l_Event; m_ChatFitlerViewers.onChange = l_Event; m_ChatFilterBroadcaster.onChange = l_Event; /// Prepare PrepareSlider(m_FollowEvents.gameObject); PrepareSlider(m_SubscriptionEvents.gameObject); PrepareSlider(m_BitsCheering.gameObject); PrepareSlider(m_ChannelPoints.gameObject); /// Set values m_FollowEvents.Value = Config.Chat.ShowFollowEvents; m_SubscriptionEvents.Value = Config.Chat.ShowSubscriptionEvents; m_BitsCheering.Value = Config.Chat.ShowBitsCheeringEvents; m_ChannelPoints.Value = Config.Chat.ShowChannelPointsEvent; /// Bind events m_FollowEvents.onChange = l_Event; m_SubscriptionEvents.onChange = l_Event; m_BitsCheering.onChange = l_Event; m_ChannelPoints.onChange = l_Event; } m_PreventChanges = true; /// Set values m_FollowEnvironementRotations.Value = Config.Chat.FollowEnvironementRotation; m_ChatFitlerViewers.Value = Config.Chat.FilterViewersCommands; m_ChatFilterBroadcaster.Value = Config.Chat.FilterBroadcasterCommands; /// Set values m_FollowEvents.Value = Config.Chat.ShowFollowEvents; m_SubscriptionEvents.Value = Config.Chat.ShowSubscriptionEvents; m_BitsCheering.Value = Config.Chat.ShowBitsCheeringEvents; m_ChannelPoints.Value = Config.Chat.ShowChannelPointsEvent; m_PreventChanges = false; }
#pragma warning restore CS0649 //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On activation /// </summary> /// <param name="p_FirstActivation">Is the first activation ?</param> /// <param name="p_AddedToHierarchy">Activation type</param> /// <param name="p_ScreenSystemEnabling">Is screen system enabled</param> protected override void DidActivate(bool p_FirstActivation, bool p_AddedToHierarchy, bool p_ScreenSystemEnabling) { /// Forward event base.DidActivate(p_FirstActivation, p_AddedToHierarchy, p_ScreenSystemEnabling); if (p_FirstActivation) { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(Settings.OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); Utils.GameUI.PrepareToggleSetting(m_UserBeatSaberPlusCustomMapsServer, l_Event, Config.Online.UseBSPCustomMapsServer, false); Utils.GameUI.PrepareToggleSetting(m_UserBeatSaberPlusCustomMapsServerInMoreSongs, l_Event, Config.Online.UseBSPCustomMapsServerOnMoreSongs, false); } }
#pragma warning restore CS0649 //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On activation /// </summary> /// <param name="p_FirstActivation">Is the first activation ?</param> /// <param name="p_AddedToHierarchy">Activation type</param> /// <param name="p_ScreenSystemEnabling">Is screen system enabled</param> protected override void DidActivate(bool p_FirstActivation, bool p_AddedToHierarchy, bool p_ScreenSystemEnabling) { /// Forward event base.DidActivate(p_FirstActivation, p_AddedToHierarchy, p_ScreenSystemEnabling); /// If first activation, bind event if (p_FirstActivation) { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); var l_NewRectMin = new Vector2(0.71f, -0.05f); var l_NewRectMax = new Vector2(0.90f, 1.05f); /// Left Utils.GameUI.PrepareToggleSetting(m_NoBeatSageToggle, l_Event, Config.ChatRequest.NoBeatSage, true); Utils.GameUI.PrepareToggleSetting(m_NPSMinToggle, l_Event, Config.ChatRequest.NPSMin, true); Utils.GameUI.PrepareToggleSetting(m_NPSMaxToggle, l_Event, Config.ChatRequest.NPSMax, true); Utils.GameUI.PrepareToggleSetting(m_NJSMinToggle, l_Event, Config.ChatRequest.NJSMin, true); Utils.GameUI.PrepareToggleSetting(m_NJSMaxToggle, l_Event, Config.ChatRequest.NJSMax, true); Utils.GameUI.PrepareToggleSetting(m_DurationMaxToggle, l_Event, Config.ChatRequest.DurationMax, true); Utils.GameUI.PrepareToggleSetting(m_VoteMinToggle, l_Event, Config.ChatRequest.VoteMin, true); Utils.GameUI.PrepareToggleSetting(m_DateMinToggle, l_Event, Config.ChatRequest.DateMin, true); Utils.GameUI.PrepareToggleSetting(m_DateMaxToggle, l_Event, Config.ChatRequest.DateMax, true); /// Change value type if (Config.ChatRequest.VoteMinV > 1) { Config.ChatRequest.VoteMinV /= 100f; } /// Right Utils.GameUI.PrepareSliderSetting(m_NPSMin, l_Event, null, Config.ChatRequest.NPSMinV, true, true, l_NewRectMin, l_NewRectMax); Utils.GameUI.PrepareSliderSetting(m_NPSMax, l_Event, null, Config.ChatRequest.NPSMaxV, true, true, l_NewRectMin, l_NewRectMax); Utils.GameUI.PrepareSliderSetting(m_NJSMin, l_Event, null, Config.ChatRequest.NJSMinV, true, true, l_NewRectMin, l_NewRectMax); Utils.GameUI.PrepareSliderSetting(m_NJSMax, l_Event, null, Config.ChatRequest.NJSMaxV, true, true, l_NewRectMin, l_NewRectMax); Utils.GameUI.PrepareSliderSetting(m_DurationMax, l_Event, Utils.GameUI.Formatter_Minutes, Config.ChatRequest.DurationMaxV, true, true, l_NewRectMin, l_NewRectMax); Utils.GameUI.PrepareSliderSetting(m_VoteMin, l_Event, Utils.GameUI.Formatter_Percentage, Config.ChatRequest.VoteMinV, true, true, l_NewRectMin, l_NewRectMax); Utils.GameUI.PrepareSliderSetting(m_DateMin, l_Event, Utils.GameUI.Formatter_DateMonthFrom2018, Config.ChatRequest.DateMinV, true, true, l_NewRectMin, l_NewRectMax); Utils.GameUI.PrepareSliderSetting(m_DateMax, l_Event, Utils.GameUI.Formatter_DateMonthFrom2018, Config.ChatRequest.DateMaxV, true, true, l_NewRectMin, l_NewRectMax); /// Update interactable Utils.GameUI.SetSliderInteractable(m_NPSMin, m_NPSMinToggle.Value); Utils.GameUI.SetSliderInteractable(m_NPSMax, m_NPSMaxToggle.Value); Utils.GameUI.SetSliderInteractable(m_NJSMin, m_NJSMinToggle.Value); Utils.GameUI.SetSliderInteractable(m_NJSMax, m_NJSMaxToggle.Value); Utils.GameUI.SetSliderInteractable(m_DurationMax, m_DurationMaxToggle.Value); Utils.GameUI.SetSliderInteractable(m_VoteMin, m_VoteMinToggle.Value); Utils.GameUI.SetSliderInteractable(m_DateMin, m_DateMinToggle.Value); Utils.GameUI.SetSliderInteractable(m_DateMax, m_DateMaxToggle.Value); } }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On view creation /// </summary> protected override sealed void OnViewCreation() { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Prepare SDK.UI.ToggleSetting.Setup(m_FollowEnvironementRotations, l_Event, Config.Chat.FollowEnvironementRotation, true); SDK.UI.ToggleSetting.Setup(m_ChatFitlerViewers, l_Event, Config.Chat.FilterViewersCommands, true); SDK.UI.ToggleSetting.Setup(m_ChatFilterBroadcaster, l_Event, Config.Chat.FilterBroadcasterCommands, true); /// Prepare SDK.UI.ToggleSetting.Setup(m_FollowEvents, l_Event, Config.Chat.ShowFollowEvents, true); SDK.UI.ToggleSetting.Setup(m_SubscriptionEvents, l_Event, Config.Chat.ShowSubscriptionEvents, true); SDK.UI.ToggleSetting.Setup(m_BitsCheering, l_Event, Config.Chat.ShowBitsCheeringEvents, true); SDK.UI.ToggleSetting.Setup(m_ChannelPoints, l_Event, Config.Chat.ShowChannelPointsEvent, true); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On view creation /// </summary> protected override sealed void OnViewCreation() { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Left SDK.UI.IncrementSetting.Setup(m_UserRequest, l_Event, null, Config.ChatRequest.UserMaxRequest, true); SDK.UI.IncrementSetting.Setup(m_VIPBonusRequest, l_Event, null, Config.ChatRequest.VIPBonusRequest, true); SDK.UI.IncrementSetting.Setup(m_SubscriberBonusRequest, l_Event, null, Config.ChatRequest.SubscriberBonusRequest, true); SDK.UI.IncrementSetting.Setup(m_HistorySize, l_Event, null, Config.ChatRequest.HistorySize, true); /// Right SDK.UI.ToggleSetting.Setup(m_PlayPreviewMusic, l_Event, Config.ChatRequest.PlayPreviewMusic, true); SDK.UI.ToggleSetting.Setup(m_ModeratorPower, l_Event, Config.ChatRequest.ModeratorPower, true); SDK.UI.IncrementSetting.Setup(m_QueueSize, l_Event, null, Config.ChatRequest.QueueCommandShowSize, true); SDK.UI.IncrementSetting.Setup(m_QueueCooldown, l_Event, SDK.UI.BSMLSettingFormarter.Seconds, Config.ChatRequest.QueueCommandCooldown, true); }
#pragma warning restore CS0649 //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On activation /// </summary> /// <param name="p_FirstActivation">Is the first activation ?</param> /// <param name="p_AddedToHierarchy">Activation type</param> /// <param name="p_ScreenSystemEnabling">Is screen system enabled</param> protected override void DidActivate(bool p_FirstActivation, bool p_AddedToHierarchy, bool p_ScreenSystemEnabling) { /// Forward event base.DidActivate(p_FirstActivation, p_AddedToHierarchy, p_ScreenSystemEnabling); /// If first activation, bind event if (p_FirstActivation) { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Set values Utils.GameUI.PrepareToggleSetting(m_ShowPlayer, l_Event, Config.MenuMusic.ShowPlayer, false); Utils.GameUI.PrepareToggleSetting(m_PlaySongsFromBeginning, l_Event, Config.MenuMusic.StartSongFromBeginning, false); Utils.GameUI.PrepareToggleSetting(m_PlayOnlyCustomMenuMusics, l_Event, Config.MenuMusic.UseOnlyCustomMenuSongsFolder, false); Utils.GameUI.PrepareIncrementSetting(m_PlaybackVolume, l_Event, Utils.GameUI.Formatter_Percentage, Config.MenuMusic.PlaybackVolume, false); } }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On view creation /// </summary> protected override sealed void OnViewCreation() { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Left SDK.UI.ToggleSetting.Setup(m_ShowPlayerInterface, l_Event, Config.MenuMusic.ShowPlayer, true); SDK.UI.ToggleSetting.Setup(m_ShowPlayTime, l_Event, Config.MenuMusic.ShowPlayTime, true); SDK.UI.IncrementSetting.Setup(m_PlayerBackgroundOpacity, l_Event, SDK.UI.BSMLSettingFormarter.Percentage, Config.MenuMusic.BackgroundA, true); SDK.UI.ColorSetting.Setup(m_PlayerBackground, l_Event, Config.MenuMusic.BackgroundColor, true); /// Right SDK.UI.ToggleSetting.Setup(m_PlaySongsFromBeginning, l_Event, Config.MenuMusic.StartSongFromBeginning, true); SDK.UI.ToggleSetting.Setup(m_StartANewMusicOnSceneChange, l_Event, Config.MenuMusic.StartANewMusicOnSceneChange, true); SDK.UI.ToggleSetting.Setup(m_LoopCurrentMusic, l_Event, Config.MenuMusic.LoopCurrentMusic, true); SDK.UI.ToggleSetting.Setup(m_PlayOnlyCustomMenuMusics, l_Event, Config.MenuMusic.UseOnlyCustomMenuSongsFolder, true); SDK.UI.IncrementSetting.Setup(m_PlaybackVolume, l_Event, SDK.UI.BSMLSettingFormarter.Percentage, Config.MenuMusic.PlaybackVolume, true); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On view creation /// </summary> protected override sealed void OnViewCreation() { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Left SDK.UI.IncrementSetting.Setup(m_ChatWidth, l_Event, null, Config.Chat.ChatWidth, true); SDK.UI.IncrementSetting.Setup(m_ChatHeight, l_Event, null, Config.Chat.ChatHeight, true); SDK.UI.ToggleSetting.Setup(m_ChatReverse, l_Event, Config.Chat.ReverseChatOrder, true); SDK.UI.IncrementSetting.Setup(m_ChatOpacity, l_Event, SDK.UI.BSMLSettingFormarter.Percentage, Config.Chat.BackgroundA, true); SDK.UI.IncrementSetting.Setup(m_ChatFontSize, l_Event, null, Config.Chat.FontSize, true); /// Right SDK.UI.ColorSetting.Setup(m_ChatBackgroundColor, l_Event, Config.Chat.BackgroundColor, true); SDK.UI.ColorSetting.Setup(m_ChatHighlightColor, l_Event, Config.Chat.HighlightColor, true); SDK.UI.ColorSetting.Setup(m_ChatAccentColor, l_Event, Config.Chat.AccentColor, true); SDK.UI.ColorSetting.Setup(m_ChatTextColor, l_Event, Config.Chat.TextColor, true); SDK.UI.ColorSetting.Setup(m_ChatPingColor, l_Event, Config.Chat.PingColor, true); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On view creation /// </summary> protected override sealed void OnViewCreation() { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); var l_NewRectMin = new Vector2(0.71f, -0.05f); var l_NewRectMax = new Vector2(0.90f, 1.05f); /// Left SDK.UI.ToggleSetting.Setup(m_NoBeatSageToggle, l_Event, Config.ChatRequest.NoBeatSage, true); SDK.UI.ToggleSetting.Setup(m_NPSMinToggle, l_Event, Config.ChatRequest.NPSMin, true); SDK.UI.ToggleSetting.Setup(m_NPSMaxToggle, l_Event, Config.ChatRequest.NPSMax, true); SDK.UI.ToggleSetting.Setup(m_NJSMinToggle, l_Event, Config.ChatRequest.NJSMin, true); SDK.UI.ToggleSetting.Setup(m_NJSMaxToggle, l_Event, Config.ChatRequest.NJSMax, true); SDK.UI.ToggleSetting.Setup(m_DurationMaxToggle, l_Event, Config.ChatRequest.DurationMax, true); SDK.UI.ToggleSetting.Setup(m_VoteMinToggle, l_Event, Config.ChatRequest.VoteMin, true); SDK.UI.ToggleSetting.Setup(m_DateMinToggle, l_Event, Config.ChatRequest.DateMin, true); SDK.UI.ToggleSetting.Setup(m_DateMaxToggle, l_Event, Config.ChatRequest.DateMax, true); /// Change value type if (Config.ChatRequest.VoteMinV > 1) { Config.ChatRequest.VoteMinV /= 100f; } /// Right SDK.UI.SliderSetting.Setup(m_NPSMin, l_Event, null, Config.ChatRequest.NPSMinV, true, true, l_NewRectMin, l_NewRectMax); SDK.UI.SliderSetting.Setup(m_NPSMax, l_Event, null, Config.ChatRequest.NPSMaxV, true, true, l_NewRectMin, l_NewRectMax); SDK.UI.SliderSetting.Setup(m_NJSMin, l_Event, null, Config.ChatRequest.NJSMinV, true, true, l_NewRectMin, l_NewRectMax); SDK.UI.SliderSetting.Setup(m_NJSMax, l_Event, null, Config.ChatRequest.NJSMaxV, true, true, l_NewRectMin, l_NewRectMax); SDK.UI.SliderSetting.Setup(m_DurationMax, l_Event, SDK.UI.BSMLSettingFormarter.Minutes, Config.ChatRequest.DurationMaxV, true, true, l_NewRectMin, l_NewRectMax); SDK.UI.SliderSetting.Setup(m_VoteMin, l_Event, SDK.UI.BSMLSettingFormarter.Percentage, Config.ChatRequest.VoteMinV, true, true, l_NewRectMin, l_NewRectMax); SDK.UI.SliderSetting.Setup(m_DateMin, l_Event, SDK.UI.BSMLSettingFormarter.DateMonthFrom2018, Config.ChatRequest.DateMinV, true, true, l_NewRectMin, l_NewRectMax); SDK.UI.SliderSetting.Setup(m_DateMax, l_Event, SDK.UI.BSMLSettingFormarter.DateMonthFrom2018, Config.ChatRequest.DateMaxV, true, true, l_NewRectMin, l_NewRectMax); /// Update interactable SDK.UI.SliderSetting.SetInteractable(m_NPSMin, m_NPSMinToggle.Value); SDK.UI.SliderSetting.SetInteractable(m_NPSMax, m_NPSMaxToggle.Value); SDK.UI.SliderSetting.SetInteractable(m_NJSMin, m_NJSMinToggle.Value); SDK.UI.SliderSetting.SetInteractable(m_NJSMax, m_NJSMaxToggle.Value); SDK.UI.SliderSetting.SetInteractable(m_DurationMax, m_DurationMaxToggle.Value); SDK.UI.SliderSetting.SetInteractable(m_VoteMin, m_VoteMinToggle.Value); SDK.UI.SliderSetting.SetInteractable(m_DateMin, m_DateMinToggle.Value); SDK.UI.SliderSetting.SetInteractable(m_DateMax, m_DateMaxToggle.Value); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On view creation /// </summary> protected override sealed void OnViewCreation() { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Left SDK.UI.ToggleSetting.Setup(m_FollowEnvironementRotations, l_Event, Config.SongChartVisualizer.FollowEnvironementRotation, true); SDK.UI.IncrementSetting.Setup(m_BackgroundOpacity, l_Event, SDK.UI.BSMLSettingFormarter.Percentage, Config.SongChartVisualizer.BackgroundA, true); SDK.UI.IncrementSetting.Setup(m_CursorOpacity, l_Event, SDK.UI.BSMLSettingFormarter.Percentage, Config.SongChartVisualizer.CursorA, true); SDK.UI.IncrementSetting.Setup(m_LineOpacity, l_Event, SDK.UI.BSMLSettingFormarter.Percentage, Config.SongChartVisualizer.LineA, true); SDK.UI.IncrementSetting.Setup(m_LegendOpacity, l_Event, SDK.UI.BSMLSettingFormarter.Percentage, Config.SongChartVisualizer.LegendA, true); SDK.UI.IncrementSetting.Setup(m_DashOpacity, l_Event, SDK.UI.BSMLSettingFormarter.Percentage, Config.SongChartVisualizer.DashLineA, true); /// Right SDK.UI.ToggleSetting.Setup(m_ShowNPSLegend, l_Event, Config.SongChartVisualizer.ShowNPSLegend, true); SDK.UI.ColorSetting.Setup(m_BackgroundColor, l_Event, Config.SongChartVisualizer.BackgroundColor, true); SDK.UI.ColorSetting.Setup(m_CursorColor, l_Event, Config.SongChartVisualizer.CursorColor, true); SDK.UI.ColorSetting.Setup(m_LineColor, l_Event, Config.SongChartVisualizer.LineColor, true); SDK.UI.ColorSetting.Setup(m_LegendColor, l_Event, Config.SongChartVisualizer.LegendColor, true); SDK.UI.ColorSetting.Setup(m_DashColor, l_Event, Config.SongChartVisualizer.DashLineColor, true); }
#pragma warning restore CS0649 //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On activation /// </summary> /// <param name="p_FirstActivation">Is the first activation ?</param> /// <param name="p_AddedToHierarchy">Activation type</param> /// <param name="p_ScreenSystemEnabling">Is screen system enabled</param> protected override void DidActivate(bool p_FirstActivation, bool p_AddedToHierarchy, bool p_ScreenSystemEnabling) { /// Forward event base.DidActivate(p_FirstActivation, p_AddedToHierarchy, p_ScreenSystemEnabling); if (p_FirstActivation) { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Left Utils.GameUI.PrepareIncrementSetting(m_UserRequest, l_Event, null, Config.ChatRequest.UserMaxRequest, true); Utils.GameUI.PrepareIncrementSetting(m_VIPBonusRequest, l_Event, null, Config.ChatRequest.VIPBonusRequest, true); Utils.GameUI.PrepareIncrementSetting(m_SubscriberBonusRequest, l_Event, null, Config.ChatRequest.SubscriberBonusRequest, true); Utils.GameUI.PrepareIncrementSetting(m_HistorySize, l_Event, null, Config.ChatRequest.HistorySize, true); /// Right Utils.GameUI.PrepareToggleSetting(m_PlayPreviewMusic, l_Event, Config.ChatRequest.PlayPreviewMusic, true); Utils.GameUI.PrepareToggleSetting(m_ModeratorPower, l_Event, Config.ChatRequest.ModeratorPower, true); Utils.GameUI.PrepareIncrementSetting(m_QueueSize, l_Event, null, Config.ChatRequest.QueueCommandShowSize, true); Utils.GameUI.PrepareIncrementSetting(m_QueueCooldown, l_Event, Utils.GameUI.Formatter_Seconds, Config.ChatRequest.QueueCommandCooldown, true); } }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On view creation /// </summary> protected override sealed void OnViewCreation() { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(SettingsRight.OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Create type selector m_TypeSegmentControl = SDK.UI.TextSegmentedControl.Create(m_TypeSegmentPanel.transform as RectTransform, false); m_TypeSegmentControl.SetTexts(new string[] { "Menu", "Dev / Testing" }); m_TypeSegmentControl.ReloadData(); m_TypeSegmentControl.didSelectCellEvent += OnTypeChanged; //////////////////////////////////////////////////////////////////////////// /// Menu //////////////////////////////////////////////////////////////////////////// /// Main menu SDK.UI.ToggleSetting.Setup(m_DisableBeatMapEditorButtonInMainMenu, l_Event, Config.GameTweaker.DisableBeatMapEditorButtonOnMainMenu, true); SDK.UI.ToggleSetting.Setup(m_ShowPlayerStatisticsInMainMenu, l_Event, Config.GameTweaker.ShowPlayerStatisticsOnMainMenu, true); SDK.UI.ToggleSetting.Setup(m_RemoveNewContentPromotional, l_Event, Config.GameTweaker.RemoveNewContentPromotional, true); /// Level selection SDK.UI.ToggleSetting.Setup(m_ReorderPlayerSettings, l_Event, Config.GameTweaker.ReorderPlayerSettings, true); SDK.UI.ToggleSetting.Setup(m_AddOverrideLightIntensityOption, l_Event, Config.GameTweaker.AddOverrideLightIntensityOption, true); SDK.UI.ToggleSetting.Setup(m_RemoveBaseGameFilterButton, l_Event, Config.GameTweaker.RemoveBaseGameFilterButton, true); SDK.UI.ToggleSetting.Setup(m_DeleteSongButton, l_Event, Config.GameTweaker.DeleteSongButton, true); //////////////////////////////////////////////////////////////////////////// /// Dev / Testing //////////////////////////////////////////////////////////////////////////// /// Prepare sliders SDK.UI.ToggleSetting.Setup(m_FPFCEscape, l_Event, Config.GameTweaker.FPFCEscape, false); //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// Force change to tab GamePlay OnTypeChanged(null, 0); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// On activation /// </summary> /// <param name="p_FirstActivation">Is the first activation ?</param> /// <param name="p_AddedToHierarchy">Activation type</param> /// <param name="p_ScreenSystemEnabling">Is screen system enabled</param> protected override void DidActivate(bool p_FirstActivation, bool p_AddedToHierarchy, bool p_ScreenSystemEnabling) { /// Forward event base.DidActivate(p_FirstActivation, p_AddedToHierarchy, p_ScreenSystemEnabling); if (p_FirstActivation) { var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(this, this.GetType().GetMethod(nameof(Settings.OnSettingChanged), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); /// Create type selector m_TypeSegmentControl = BeatSaberPlus.Utils.GameUI.CreateTextSegmentedControl(m_TypeSegmentPanel.transform as RectTransform, false); m_TypeSegmentControl.SetTexts(new string[] { "Gameplay", "Menu", "Dev / Testing" }); m_TypeSegmentControl.ReloadData(); m_TypeSegmentControl.didSelectCellEvent += OnTypeChanged; //////////////////////////////////////////////////////////////////////////// /// GamePlay //////////////////////////////////////////////////////////////////////////// /// Prepare sliders left Utils.GameUI.PrepareToggleSetting(m_RemoveDebris, l_Event, Config.GameTweaker.RemoveDebris, true); Utils.GameUI.PrepareToggleSetting(m_RemoveAllCutParticles, l_Event, Config.GameTweaker.RemoveAllCutParticles, true); Utils.GameUI.PrepareToggleSetting(m_RemoveAllObstacleParticles, l_Event, Config.GameTweaker.RemoveObstacleParticles, true); Utils.GameUI.PrepareToggleSetting(m_RemoveFloorBurnMarkParticles, l_Event, Config.GameTweaker.RemoveSaberBurnMarkSparkles, true); Utils.GameUI.PrepareToggleSetting(m_RemoveFloorBurnMarkEffects, l_Event, Config.GameTweaker.RemoveSaberBurnMarks, true); Utils.GameUI.PrepareToggleSetting(m_RemoveSaberClashEffects, l_Event, Config.GameTweaker.RemoveSaberClashEffects, true); /// Prepare sliders right Utils.GameUI.PrepareToggleSetting(m_RemoveMusicBandLogo, l_Event, Config.GameTweaker.RemoveMusicBandLogo, true); Utils.GameUI.PrepareToggleSetting(m_RemoveFullComboLossAnimation, l_Event, Config.GameTweaker.RemoveFullComboLossAnimation, true); Utils.GameUI.PrepareToggleSetting(m_NoFake360HUD, l_Event, Config.GameTweaker.NoFake360HUD, true); Utils.GameUI.PrepareToggleSetting(m_RemoveTrail, l_Event, Config.GameTweaker.RemoveSaberSmoothingTrail, true); Utils.GameUI.PrepareIncrementSetting(m_Intensity, l_Event, null, Config.GameTweaker.SaberSmoothingTrailIntensity, true); //m_MenuConfirmation.Value = Config.GameTweaker.SongBackButtonConfirm; //m_RestartConfirmation.Value = Config.GameTweaker.SongRestartButtonConfirm; //m_MenuConfirmation.onChange = l_Event; //m_RestartConfirmation.onChange = l_Event; /// Update UI m_Intensity.gameObject.SetActive(false); m_Intensity.interactable = !Config.GameTweaker.RemoveSaberSmoothingTrail; m_Intensity.gameObject.SetActive(true); //////////////////////////////////////////////////////////////////////////// /// Menu //////////////////////////////////////////////////////////////////////////// /// Prepare sliders Utils.GameUI.PrepareToggleSetting(m_DisableBeatMapEditorButtonInMainMenu, l_Event, Config.GameTweaker.DisableBeatMapEditorButtonOnMainMenu, false); Utils.GameUI.PrepareToggleSetting(m_ShowPlayerStatisticsInMainMenu, l_Event, Config.GameTweaker.ShowPlayerStatisticsOnMainMenu, false); Utils.GameUI.PrepareToggleSetting(m_RemoveNewContentPromotional, l_Event, Config.GameTweaker.RemoveNewContentPromotional, false); Utils.GameUI.PrepareToggleSetting(m_ReorderPlayerSettings, l_Event, Config.GameTweaker.ReorderPlayerSettings, false); Utils.GameUI.PrepareToggleSetting(m_AddOverrideLightIntensityOption, l_Event, Config.GameTweaker.AddOverrideLightIntensityOption, false); Utils.GameUI.PrepareToggleSetting(m_RemoveBaseGameFilterButton, l_Event, Config.GameTweaker.RemoveBaseGameFilterButton, false); Utils.GameUI.PrepareToggleSetting(m_DeleteSongButton, l_Event, Config.GameTweaker.DeleteSongButton, false); //////////////////////////////////////////////////////////////////////////// /// Dev / Testing //////////////////////////////////////////////////////////////////////////// /// Prepare sliders Utils.GameUI.PrepareToggleSetting(m_FPFCEscape, l_Event, Config.GameTweaker.FPFCEscape, false); //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// Force change to tab SubRain OnTypeChanged(null, 0); } }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// Set if the effect is enabled /// </summary> /// <param name="p_Enabled">New state</param> internal static void SetReorderEnabled(bool p_Enabled, bool p_AddOverrideLightsIntensityOption) { if (m_StaticLightsToggle == null || m_NoteJumpStartBeatOffsetDropdown == null || m_SfxVolumeSettingsController == null) { return; } m_StaticLightsToggle.transform.parent.parent.GetComponent <VerticalLayoutGroup>().enabled = true; if (p_AddOverrideLightsIntensityOption && (m_OverrideLightsIntensityToggle == null || !m_OverrideLightsIntensityToggle)) { var l_Creator = new BeatSaberMarkupLanguage.Tags.Settings.IncrementSettingTag(); var l_Clone = l_Creator.CreateObject(m_StaticLightsToggle.transform.parent.parent); l_Clone.GetComponentInChildren <TextMeshProUGUI>().text = "Override lights intensity"; (l_Clone.transform as RectTransform).offsetMax = new Vector2(90, (l_Clone.transform as RectTransform).offsetMax.y); if (m_StaticLightsToggle.transform.parent.Find("Icon")) { var l_Icon = GameObject.Instantiate(m_StaticLightsToggle.transform.parent.Find("Icon"), l_Clone.transform); l_Icon.transform.SetAsFirstSibling(); } var l_LabelTemplateRectTransform = m_StaticLightsToggle.transform.parent.GetChild(1).transform as RectTransform; (l_Clone.transform.GetChild(1).transform as RectTransform).offsetMin = l_LabelTemplateRectTransform.offsetMin; (l_Clone.transform.GetChild(1).transform as RectTransform).offsetMax = l_LabelTemplateRectTransform.offsetMax; (l_Clone.transform.GetChild(2).transform as RectTransform).offsetMin = new Vector2(-36f, 0f); (l_Clone.transform.GetChild(2).transform as RectTransform).offsetMax = Vector2.zero; m_OverrideLightsIntensityToggle = l_Clone.GetComponent <IncrementSetting>(); m_OverrideLightsIntensityToggle.minValue = 0; m_OverrideLightsIntensityToggle.maxValue = 2; m_OverrideLightsIntensityToggle.increments = 0.1f; var l_Event = new BeatSaberMarkupLanguage.Parser.BSMLAction(null, typeof(PPlayerSettingsPanelController).GetMethod(nameof(OnOverrideLightIntensityChange), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)); Utils.GameUI.PrepareIncrementSetting(m_OverrideLightsIntensityToggle, l_Event, Utils.GameUI.Formatter_Percentage, Config.GameTweaker.OverrideLightIntensity, false); } else if (!p_AddOverrideLightsIntensityOption && m_OverrideLightsIntensityToggle != null && m_OverrideLightsIntensityToggle) { GameObject.DestroyImmediate(m_OverrideLightsIntensityToggle.gameObject); m_OverrideLightsIntensityToggle = null; } if (p_Enabled) { m_PlayerHeightSettingsController.transform.SetAsFirstSibling(); m_AutomaticPlayerHeightToggle.transform.parent.SetAsFirstSibling(); m_SfxVolumeSettingsController.transform.parent.SetAsFirstSibling(); m_NoTextsAndHudsToggle.transform.parent.SetAsFirstSibling(); m_AdvanceHudToggle.transform.parent.SetAsFirstSibling(); if (m_OverrideLightsIntensityToggle != null && m_OverrideLightsIntensityToggle) { m_OverrideLightsIntensityToggle.transform.SetAsFirstSibling(); } m_StaticLightsToggle.transform.parent.SetAsFirstSibling(); m_NoteJumpStartBeatOffsetDropdown.transform.parent.SetAsFirstSibling(); } else { m_NoteJumpStartBeatOffsetDropdown.transform.parent.SetAsFirstSibling(); m_HideNoteSpawnEffectToggle.transform.parent.SetAsFirstSibling(); m_AdaptiveSfxToggle.transform.parent.SetAsFirstSibling(); m_ReduceDebrisToggle.transform.parent.SetAsFirstSibling(); m_AdvanceHudToggle.transform.parent.SetAsFirstSibling(); m_NoTextsAndHudsToggle.transform.parent.SetAsFirstSibling(); m_SaberTrailIntensitySettingsController.transform.parent.SetAsFirstSibling(); if (m_OverrideLightsIntensityToggle != null && m_OverrideLightsIntensityToggle) { m_OverrideLightsIntensityToggle.transform.SetAsFirstSibling(); } m_StaticLightsToggle.transform.parent.SetAsFirstSibling(); m_LeftHandedToggle.transform.parent.SetAsFirstSibling(); m_SfxVolumeSettingsController.transform.parent.SetAsFirstSibling(); m_PlayerHeightSettingsController.transform.SetAsFirstSibling(); m_AutomaticPlayerHeightToggle.transform.parent.SetAsFirstSibling(); } }