using System; using System.Collections; using UnityEngine; public class ConfigMgr : BaseMgr { private void Start() { } private void Init() { string rootPath = "__GameMain__/SystemUI Root"; this.m_goPanel = base.GetPanel("ConfigPanel", rootPath); this.m_configCtrl = base.GetCtrl(); this.m_configCtrl.Init(this.m_goPanel); this.m_uiPanel = this.m_goPanel.GetComponent(); this.m_goPanel.SetActive(false); this.m_bInited = true; this.ChangeNormalConfig(); } public bool IsOpenConfigPanel() { return !(this.m_goPanel == null) && this.m_goPanel.activeSelf; } public void OnSysButtonShowAlwaysEnabled() { this.m_configCtrl.SetButtonShowAlwaysEnabled(true); } public void OnSysButtonShowAlwaysDisabled() { this.m_configCtrl.SetButtonShowAlwaysEnabled(false); } public void OnFullScreenEnabled() { this.m_configCtrl.SetFullScreenEnabled(true); } public void OnFullScreenDisabled() { this.m_configCtrl.SetFullScreenEnabled(false); } public void OnResolutionChange() { if (!this.m_bInited) { return; } string value = UIPopupList.current.value; this.m_configCtrl.ChangePopupListResolutionValue(value); } public void OnAntiAliasChange() { if (!this.m_bInited) { return; } string value = UIPopupList.current.value; base.IsValidatePopupValue(value); this.m_configCtrl.ChangePopupListValue(value); } public void OnShadowQualityChange() { if (!this.m_bInited) { return; } string value = UIPopupList.current.value; base.IsValidatePopupValue(value); this.m_configCtrl.ChangePopupListValue(value); } public void OnTextureQualityChange() { if (!this.m_bInited) { return; } string value = UIPopupList.current.value; base.IsValidatePopupValue(value); this.m_configCtrl.ChangePopupListValue(value); } public void OnFpsDisplayEnabled() { this.m_configCtrl.SetFpsDisplayEnabled(true); } public void OnFpsDisplayDisabled() { this.m_configCtrl.SetFpsDisplayEnabled(false); } public void OnCaptureMagnificationChange() { if (!this.m_bInited) { return; } string value = UIPopupList.current.value; base.IsValidatePopupValue(value); this.m_configCtrl.ChangePopupListValue(value); } public void OnSubtitleDisplayTypeChange() { if (!this.m_bInited) { return; } string value = UIPopupList.current.value; this.SubtitleDisplayTypeChange(value); } public void SubtitleDisplayTypeChange(string typeName) { IEnumerator enumerator = Enum.GetValues(typeof(SubtitleDisplayManager.DisplayType)).GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; string @string = SubtitleDisplayManager.EnumConvert.GetString((SubtitleDisplayManager.DisplayType)obj); if (typeName == @string) { GameMain.Instance.CMSystem.SubtitleType = (SubtitleDisplayManager.DisplayType)obj; break; } } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } } public void OnBloomChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.Bloom, value); } public void OnPlayerModelTransparencyChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.PlayerModelTransparency, value); } public void OnMessageWindowTransparencyChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.MessageWindowTransparency, value); } public void OnTextSpeedChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.TextSpeed, value); } public void OnAutoSpeedChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.AutoSpeed, value); } public void OnMasterVolumeChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.MasterVolume, value); } public void OnSystemVolumeChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.SystemVolume, value); } public void OnMusicVolumeChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.MusicVolume, value); } public void OnDanceVolumeChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.DanceVolume, value); } public void OnVoiceVolumeChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.VoiceVolume, value); } public void OnSoundEffectVolumeChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.SoundEffectVolume, value); } public void OnSoundEnvironmentVolumeChange() { if (!this.m_bInited) { return; } float value = UIProgressBar.current.value; this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.SoundEnvironmentVolume, value); } public void OnAlreadyReadSkipEnabled() { this.m_configCtrl.SetAlreadyReadSkipEnabled(true); } public void OnAlreadyReadSkipDisabled() { this.m_configCtrl.SetAlreadyReadSkipEnabled(false); } public void OnSequentialVoiceEnabled() { this.m_configCtrl.SetSequentialVoiceEnabled(true); } public void OnSequentialVoiceDisabled() { this.m_configCtrl.SetSequentialVoiceEnabled(false); } public void SetEjaculationSeEnabled() { this.m_configCtrl.SetEjaculationSeEnabled(true); } public void SetEjaculationSeDisabled() { this.m_configCtrl.SetEjaculationSeEnabled(false); } public void OnMusic3DActive() { this.m_configCtrl.SetMusic3DActive(); } public void OnVoice3DActive() { this.m_configCtrl.SetVoice3DActive(); } public void OnSoundEffect3DActive() { this.m_configCtrl.SetSoundEffect3DActive(); } public void OnSoundEnvironment3DActive() { this.m_configCtrl.SetSoundEnvironment3DActive(); } public void OpenConfigPanel() { if (!this.m_bInited) { this.Init(); } this.m_configCtrl.LoadConfigData(); this.m_configCtrl.SetOKButtonActive(true); this.m_goPanel.SetActive(true); TweenAlpha tweenAlpha = this.m_goPanel.AddComponent(); tweenAlpha.from = 0f; tweenAlpha.to = 1f; tweenAlpha.duration = 0.3f; tweenAlpha.PlayForward(); } public void CloseConfigPanel() { this.m_configCtrl.SetOKButtonActive(false); this.cblConfig.OnClose(); TweenAlpha tweenAlpha = TweenAlpha.Begin(this.m_goPanel, 0.3f, 0f); EventDelegate.Set(tweenAlpha.onFinished, delegate { this.m_goPanel.SetActive(false); }); GameMain.Instance.BroadcastMessage("OnChangeScreenSizeOrAA", SendMessageOptions.DontRequireReceiver); } public void ChangeNormalConfig() { this.m_configCtrl.SetContentsVisible(true); this.cblConfig.visible = false; } public void ChangeCBLConfig() { this.m_configCtrl.SetContentsVisible(false); this.cblConfig.visible = true; } [SerializeField] public ConfigCblManager cblConfig; private ConfigCtrl m_configCtrl; private const float DURATION_TO_FADE = 0.3f; private UIPanel m_uiPanel; private bool m_bInited; public enum SliderType { Bloom, PlayerModelTransparency, MessageWindowTransparency, TextSpeed, AutoSpeed, MasterVolume, SystemVolume, MusicVolume, DanceVolume, VoiceVolume, SoundEffectVolume, SoundEnvironmentVolume } }