ConfigCtrl.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Text.RegularExpressions;
  5. using UnityEngine;
  6. public class ConfigCtrl : MonoBehaviour
  7. {
  8. public void Init(GameObject configPanel)
  9. {
  10. this.m_sysBtnShowAlwaysOn = UTY.GetChildObject(configPanel, "System/SysButtonShowAlways/On", false).GetComponent<UIButton>();
  11. this.m_sysBtnShowAlwaysOff = UTY.GetChildObject(configPanel, "System/SysButtonShowAlways/Off", false).GetComponent<UIButton>();
  12. EventDelegate.Add(this.m_sysBtnShowAlwaysOn.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnSysButtonShowAlwaysEnabled));
  13. EventDelegate.Add(this.m_sysBtnShowAlwaysOff.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnSysButtonShowAlwaysDisabled));
  14. UTY.GetChildObject(configPanel, "CategorySwitch", false).SetActive(false);
  15. GameObject childObject = UTY.GetChildObject(configPanel, "Screen", false);
  16. this.m_fullScreenOn = UTY.GetChildObject(childObject, "FullScreen/On", false).GetComponent<UIButton>();
  17. this.m_fullScreenOff = UTY.GetChildObject(childObject, "FullScreen/Off", false).GetComponent<UIButton>();
  18. EventDelegate.Add(this.m_fullScreenOn.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnFullScreenEnabled));
  19. EventDelegate.Add(this.m_fullScreenOff.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnFullScreenDisabled));
  20. this.m_plResolution = UTY.GetChildObject(childObject, "Resolution/PopupList", false).GetComponent<UIPopupList>();
  21. List<Size<int>> list = this.MakeResolutionPopupList();
  22. foreach (Size<int> size in list)
  23. {
  24. this.m_plResolution.items.Add(this.ToResolutionOption(size));
  25. }
  26. EventDelegate.Add(this.m_plResolution.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnResolutionChange));
  27. this.m_plAntiAlias = UTY.GetChildObject(childObject, "AntiAlias/PopupList", false).GetComponent<UIPopupList>();
  28. IEnumerator enumerator2 = Enum.GetValues(typeof(CMSystem.AntiAliasType)).GetEnumerator();
  29. try
  30. {
  31. while (enumerator2.MoveNext())
  32. {
  33. object obj = enumerator2.Current;
  34. this.MakePopupListOption(this.m_plAntiAlias, obj.ToString());
  35. }
  36. }
  37. finally
  38. {
  39. IDisposable disposable;
  40. if ((disposable = (enumerator2 as IDisposable)) != null)
  41. {
  42. disposable.Dispose();
  43. }
  44. }
  45. EventDelegate.Add(this.m_plAntiAlias.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnAntiAliasChange));
  46. this.m_plShadowQuality = UTY.GetChildObject(childObject, "ShadowQuality/PopupList", false).GetComponent<UIPopupList>();
  47. IEnumerator enumerator3 = Enum.GetValues(typeof(CMSystem.ShadowQualityType)).GetEnumerator();
  48. try
  49. {
  50. while (enumerator3.MoveNext())
  51. {
  52. object obj2 = enumerator3.Current;
  53. this.MakePopupListOption(this.m_plShadowQuality, obj2.ToString());
  54. }
  55. }
  56. finally
  57. {
  58. IDisposable disposable2;
  59. if ((disposable2 = (enumerator3 as IDisposable)) != null)
  60. {
  61. disposable2.Dispose();
  62. }
  63. }
  64. EventDelegate.Add(this.m_plShadowQuality.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnShadowQualityChange));
  65. this.m_plTextureQuality = UTY.GetChildObject(childObject, "TextureQuality/PopupList", false).GetComponent<UIPopupList>();
  66. IEnumerator enumerator4 = Enum.GetValues(typeof(CMSystem.TextureQualityType)).GetEnumerator();
  67. try
  68. {
  69. while (enumerator4.MoveNext())
  70. {
  71. object obj3 = enumerator4.Current;
  72. this.MakePopupListOption(this.m_plTextureQuality, obj3.ToString());
  73. }
  74. }
  75. finally
  76. {
  77. IDisposable disposable3;
  78. if ((disposable3 = (enumerator4 as IDisposable)) != null)
  79. {
  80. disposable3.Dispose();
  81. }
  82. }
  83. EventDelegate.Add(this.m_plTextureQuality.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnTextureQualityChange));
  84. this.m_fpsDisplayOn = UTY.GetChildObject(childObject, "FpsDisplay/On", false).GetComponent<UIButton>();
  85. this.m_fpsDisplayOff = UTY.GetChildObject(childObject, "FpsDisplay/Off", false).GetComponent<UIButton>();
  86. EventDelegate.Add(this.m_fpsDisplayOn.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnFpsDisplayEnabled));
  87. EventDelegate.Add(this.m_fpsDisplayOff.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnFpsDisplayDisabled));
  88. this.m_slBloom = UTY.GetChildObject(childObject, "Bloom/Slider", false).GetComponent<UISlider>();
  89. EventDelegate.Add(this.m_slBloom.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnBloomChange));
  90. this.m_plCaptureMagnification = UTY.GetChildObject(childObject, "CaptureMagnification/PopupList", false).GetComponent<UIPopupList>();
  91. IEnumerator enumerator5 = Enum.GetValues(typeof(CMSystem.SSSuperSizeType)).GetEnumerator();
  92. try
  93. {
  94. while (enumerator5.MoveNext())
  95. {
  96. object obj4 = enumerator5.Current;
  97. this.MakePopupListOption(this.m_plCaptureMagnification, obj4.ToString());
  98. }
  99. }
  100. finally
  101. {
  102. IDisposable disposable4;
  103. if ((disposable4 = (enumerator5 as IDisposable)) != null)
  104. {
  105. disposable4.Dispose();
  106. }
  107. }
  108. EventDelegate.Add(this.m_plCaptureMagnification.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnCaptureMagnificationChange));
  109. this.m_slPlayerModelTransparency = UTY.GetChildObject(childObject, "PlayerModelTransparency/Slider", false).GetComponent<UISlider>();
  110. EventDelegate.Add(this.m_slPlayerModelTransparency.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnPlayerModelTransparencyChange));
  111. GameObject childObject2 = UTY.GetChildObject(configPanel, "Message", false);
  112. this.m_slMessageWindowTransparency = UTY.GetChildObject(childObject2, "MessageWindowTransparency/Slider", false).GetComponent<UISlider>();
  113. EventDelegate.Add(this.m_slMessageWindowTransparency.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnMessageWindowTransparencyChange));
  114. this.m_slTextSpeed = UTY.GetChildObject(childObject2, "TextSpeed/Slider", false).GetComponent<UISlider>();
  115. EventDelegate.Add(this.m_slTextSpeed.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnTextSpeedChange));
  116. this.m_slAutoSpeed = UTY.GetChildObject(childObject2, "AutoSpeed/Slider", false).GetComponent<UISlider>();
  117. EventDelegate.Add(this.m_slAutoSpeed.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnAutoSpeedChange));
  118. this.m_sequentialVoiceOn = UTY.GetChildObject(childObject2, "SequentialVoice/On", false).GetComponent<UIButton>();
  119. this.m_sequentialVoiceOff = UTY.GetChildObject(childObject2, "SequentialVoice/Off", false).GetComponent<UIButton>();
  120. EventDelegate.Add(this.m_sequentialVoiceOn.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnSequentialVoiceEnabled));
  121. EventDelegate.Add(this.m_sequentialVoiceOff.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnSequentialVoiceDisabled));
  122. this.m_plSubtitleType = UTY.GetChildObject(childObject2, "Subtitle/PopupList", false).GetComponent<UIPopupList>();
  123. IEnumerator enumerator6 = Enum.GetValues(typeof(SubtitleDisplayManager.DisplayType)).GetEnumerator();
  124. try
  125. {
  126. while (enumerator6.MoveNext())
  127. {
  128. object obj5 = enumerator6.Current;
  129. this.MakePopupListOption(this.m_plSubtitleType, SubtitleDisplayManager.EnumConvert.GetTerm((SubtitleDisplayManager.DisplayType)obj5));
  130. }
  131. }
  132. finally
  133. {
  134. IDisposable disposable5;
  135. if ((disposable5 = (enumerator6 as IDisposable)) != null)
  136. {
  137. disposable5.Dispose();
  138. }
  139. }
  140. EventDelegate.Add(this.m_plSubtitleType.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnSubtitleDisplayTypeChange));
  141. this.m_plSubtitleType.transform.parent.gameObject.SetActive(false);
  142. GameObject childObject3 = UTY.GetChildObject(configPanel, "Sound", false);
  143. this.m_slMasterVolume = UTY.GetChildObject(childObject3, "MasterVolume/Slider", false).GetComponent<UISlider>();
  144. EventDelegate.Add(this.m_slMasterVolume.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnMasterVolumeChange));
  145. this.m_slSystemVolume = UTY.GetChildObject(childObject3, "SystemVolume/Slider", false).GetComponent<UISlider>();
  146. EventDelegate.Add(this.m_slSystemVolume.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnSystemVolumeChange));
  147. this.m_slMusicVolume = UTY.GetChildObject(childObject3, "MusicVolume/Slider", false).GetComponent<UISlider>();
  148. EventDelegate.Add(this.m_slMusicVolume.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnMusicVolumeChange));
  149. this.m_slDanceVolume = UTY.GetChildObject(childObject3, "DanceVolume/Slider", false).GetComponent<UISlider>();
  150. EventDelegate.Add(this.m_slDanceVolume.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnDanceVolumeChange));
  151. this.m_music3d = UTY.GetChildObject(childObject3, "MusicVolume/3D", false).GetComponent<UIButton>();
  152. EventDelegate.Add(this.m_music3d.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnMusic3DActive));
  153. this.m_slVoiceVolume = UTY.GetChildObject(childObject3, "VoiceVolume/Slider", false).GetComponent<UISlider>();
  154. EventDelegate.Add(this.m_slVoiceVolume.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnVoiceVolumeChange));
  155. this.m_voice3d = UTY.GetChildObject(childObject3, "VoiceVolume/3D", false).GetComponent<UIButton>();
  156. EventDelegate.Add(this.m_voice3d.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnVoice3DActive));
  157. this.m_slSoundEffectVolume = UTY.GetChildObject(childObject3, "SoundEffectVolume/Slider", false).GetComponent<UISlider>();
  158. EventDelegate.Add(this.m_slSoundEffectVolume.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnSoundEffectVolumeChange));
  159. this.m_soundEffect3d = UTY.GetChildObject(childObject3, "SoundEffectVolume/3D", false).GetComponent<UIButton>();
  160. EventDelegate.Add(this.m_soundEffect3d.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnSoundEffect3DActive));
  161. this.m_slSoundEnvironmentVolume = UTY.GetChildObject(childObject3, "SoundEnvironmentVolume/Slider", false).GetComponent<UISlider>();
  162. EventDelegate.Add(this.m_slSoundEnvironmentVolume.onChange, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnSoundEnvironmentVolumeChange));
  163. this.m_soundEnvironment3d = UTY.GetChildObject(childObject3, "SoundEnvironmentVolume/3D", false).GetComponent<UIButton>();
  164. EventDelegate.Add(this.m_soundEnvironment3d.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.OnSoundEnvironment3DActive));
  165. this.m_ejaculationSeEnabledOn = UTY.GetChildObject(childObject3, "EjaculationSeEnabled/On", false).GetComponent<UIButton>();
  166. this.m_ejaculationSeEnabledOff = UTY.GetChildObject(childObject3, "EjaculationSeEnabled/Off", false).GetComponent<UIButton>();
  167. EventDelegate.Add(this.m_ejaculationSeEnabledOn.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.SetEjaculationSeEnabled));
  168. EventDelegate.Add(this.m_ejaculationSeEnabledOff.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.SetEjaculationSeDisabled));
  169. this.m_okButton = UTY.GetChildObject(configPanel, "OK", false).GetComponent<UIButton>();
  170. EventDelegate.Add(this.m_okButton.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.CloseConfigPanel));
  171. this.m_changeVRConfigButton = UTY.GetChildObject(configPanel, "Change VR", false).GetComponent<UIButton>();
  172. EventDelegate.Add(this.m_changeVRConfigButton.onClick, delegate()
  173. {
  174. BaseMgr<ConfigMgr>.Instance.CloseConfigPanel();
  175. ConfigVRCtrl.Open(null);
  176. });
  177. this.activeColor = new Color(this.m_sysBtnShowAlwaysOn.defaultColor.r, this.m_sysBtnShowAlwaysOn.defaultColor.g, this.m_sysBtnShowAlwaysOn.defaultColor.b, 1f);
  178. this.inActiveColor = this.m_sysBtnShowAlwaysOn.defaultColor;
  179. this.LoadConfigData();
  180. }
  181. private void MakePopupListOption(UIPopupList popupList, string option)
  182. {
  183. if (option != "MAX")
  184. {
  185. popupList.items.Add(option);
  186. }
  187. }
  188. private List<Size<int>> MakeResolutionPopupList()
  189. {
  190. List<Size<int>> screenSizeList = GameMain.Instance.CMSystem.GetScreenSizeList();
  191. Size<int> screenSizeNow = GameMain.Instance.CMSystem.GetScreenSizeNow();
  192. if (!screenSizeList.Contains(screenSizeNow))
  193. {
  194. screenSizeList.Add(screenSizeNow);
  195. }
  196. return screenSizeList;
  197. }
  198. public void LoadConfigData()
  199. {
  200. bool sysButtonShowAlways = GameMain.Instance.CMSystem.SysButtonShowAlways;
  201. this.SetButtonActive(this.m_sysBtnShowAlwaysOn, this.m_sysBtnShowAlwaysOff, sysButtonShowAlways);
  202. Debug.Log("Load sysButtonShowAlwaysEnabled=" + sysButtonShowAlways);
  203. bool fullScreen = GameMain.Instance.CMSystem.FullScreen;
  204. this.SetButtonActive(this.m_fullScreenOn, this.m_fullScreenOff, fullScreen);
  205. Debug.Log("Load fullScreenEnabled=" + fullScreen);
  206. Size<int> screenSizeNow = GameMain.Instance.CMSystem.GetScreenSizeNow();
  207. this.m_plResolution.value = this.ToResolutionOption(screenSizeNow);
  208. CMSystem.AntiAliasType antialias = GameMain.Instance.CMSystem.Antialias;
  209. this.m_plAntiAlias.value = antialias.ToString();
  210. CMSystem.ShadowQualityType shadowQuality = GameMain.Instance.CMSystem.ShadowQuality;
  211. this.m_plShadowQuality.value = shadowQuality.ToString();
  212. CMSystem.TextureQualityType textureQuality = GameMain.Instance.CMSystem.TextureQuality;
  213. this.m_plTextureQuality.value = textureQuality.ToString();
  214. bool viewFps = GameMain.Instance.CMSystem.ViewFps;
  215. this.SetButtonActive(this.m_fpsDisplayOn, this.m_fpsDisplayOff, viewFps);
  216. Debug.Log("Load viewFpsEnabled=" + viewFps);
  217. int bloomValue = GameMain.Instance.CMSystem.BloomValue;
  218. float num = (float)Math.Round((double)((float)bloomValue / 100f), 2, MidpointRounding.AwayFromZero);
  219. this.m_slBloom.value = num;
  220. Debug.Log(string.Concat(new object[]
  221. {
  222. "Load bloom Value=",
  223. bloomValue,
  224. " sliderValue=",
  225. num
  226. }));
  227. CMSystem.SSSuperSizeType screenShotSuperSize = GameMain.Instance.CMSystem.ScreenShotSuperSize;
  228. this.m_plCaptureMagnification.value = screenShotSuperSize.ToString();
  229. int manAlpha = GameMain.Instance.CMSystem.ManAlpha;
  230. num = (float)Math.Round((double)((float)manAlpha / 100f), 2, MidpointRounding.AwayFromZero);
  231. this.m_slPlayerModelTransparency.value = num;
  232. Debug.Log(string.Concat(new object[]
  233. {
  234. "Load playerModelTransparency Value=",
  235. manAlpha,
  236. " sliderValue=",
  237. num
  238. }));
  239. int msgWndAlpha = GameMain.Instance.CMSystem.MsgWndAlpha;
  240. num = (float)Math.Round((double)((float)msgWndAlpha / 100f), 2, MidpointRounding.AwayFromZero);
  241. this.m_slMessageWindowTransparency.value = num;
  242. Debug.Log(string.Concat(new object[]
  243. {
  244. "Load messageWindowTransparency Value :",
  245. msgWndAlpha,
  246. " sliderValue=",
  247. num
  248. }));
  249. int msgTextSpeed = GameMain.Instance.CMSystem.MsgTextSpeed;
  250. num = (float)Math.Round((double)((float)msgTextSpeed / 100f), 2, MidpointRounding.AwayFromZero);
  251. this.m_slTextSpeed.value = num;
  252. Debug.Log(string.Concat(new object[]
  253. {
  254. "Load textSpeed Value :",
  255. msgTextSpeed,
  256. " sliderValue=",
  257. num
  258. }));
  259. int msgAutoSpeed = GameMain.Instance.CMSystem.MsgAutoSpeed;
  260. num = (float)Math.Round((double)((float)msgAutoSpeed / 100f), 2, MidpointRounding.AwayFromZero);
  261. this.m_slAutoSpeed.value = num;
  262. Debug.Log(string.Concat(new object[]
  263. {
  264. "Load autoSpeed Value :",
  265. msgAutoSpeed,
  266. " sliderValue=",
  267. num
  268. }));
  269. SubtitleDisplayManager.DisplayType subtitleType = GameMain.Instance.CMSystem.SubtitleType;
  270. this.m_plSubtitleType.value = SubtitleDisplayManager.EnumConvert.GetTerm(subtitleType);
  271. bool msgVoiceNoStop = GameMain.Instance.CMSystem.MsgVoiceNoStop;
  272. Debug.Log("Load alreadyReadSkipEnabled:" + msgVoiceNoStop);
  273. this.SetButtonActive(this.m_sequentialVoiceOn, this.m_sequentialVoiceOff, msgVoiceNoStop);
  274. int volumeAll = GameMain.Instance.SoundMgr.GetVolumeAll();
  275. num = (float)Math.Round((double)((float)volumeAll / 100f), 2, MidpointRounding.AwayFromZero);
  276. this.m_slMasterVolume.value = num;
  277. Debug.Log(string.Concat(new object[]
  278. {
  279. "Load masterVolume Value :",
  280. volumeAll,
  281. " sliderValue=",
  282. num
  283. }));
  284. int volume = GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.System);
  285. num = (float)Math.Round((double)((float)volume / 100f), 2, MidpointRounding.AwayFromZero);
  286. this.m_slSystemVolume.value = num;
  287. Debug.Log(string.Concat(new object[]
  288. {
  289. "Load systemVolume Value :",
  290. volume,
  291. " sliderValue=",
  292. num
  293. }));
  294. int volume2 = GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.Bgm);
  295. num = (float)Math.Round((double)((float)volume2 / 100f), 2, MidpointRounding.AwayFromZero);
  296. this.m_slMusicVolume.value = num;
  297. Debug.Log(string.Concat(new object[]
  298. {
  299. "Load musicVolume Value :",
  300. volume2,
  301. " sliderValue=",
  302. num
  303. }));
  304. int volumeDance = GameMain.Instance.SoundMgr.GetVolumeDance();
  305. num = (float)Math.Round((double)((float)volumeDance / 100f), 2, MidpointRounding.AwayFromZero);
  306. this.m_slDanceVolume.value = num;
  307. Debug.Log(string.Concat(new object[]
  308. {
  309. "Load danceVolume Value :",
  310. volumeDance,
  311. " sliderValue=",
  312. num
  313. }));
  314. int volume3 = GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.Voice);
  315. num = (float)Math.Round((double)((float)volume3 / 100f), 2, MidpointRounding.AwayFromZero);
  316. this.m_slVoiceVolume.value = num;
  317. Debug.Log(string.Concat(new object[]
  318. {
  319. "Load voiceVolume Value :",
  320. volume3,
  321. " sliderValue=",
  322. num
  323. }));
  324. int volume4 = GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.Se);
  325. num = (float)Math.Round((double)((float)volume4 / 100f), 2, MidpointRounding.AwayFromZero);
  326. this.m_slSoundEffectVolume.value = num;
  327. Debug.Log(string.Concat(new object[]
  328. {
  329. "Load soundEffectVolume Value :",
  330. volume4,
  331. " sliderValue=",
  332. num
  333. }));
  334. int volume5 = GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.Env);
  335. num = (float)Math.Round((double)((float)volume5 / 100f), 2, MidpointRounding.AwayFromZero);
  336. this.m_slSoundEnvironmentVolume.value = num;
  337. Debug.Log(string.Concat(new object[]
  338. {
  339. "Load soundEnvironmentVolume Value :",
  340. volume5,
  341. " sliderValue=",
  342. num
  343. }));
  344. bool threeD = GameMain.Instance.SoundMgr.GetThreeD(AudioSourceMgr.Type.Voice);
  345. Debug.Log("Load voice3dEnabled:" + threeD);
  346. this.SetToggleButtonActive(this.m_voice3d, threeD);
  347. bool threeD2 = GameMain.Instance.SoundMgr.GetThreeD(AudioSourceMgr.Type.Se);
  348. Debug.Log("Load soundEffect3dEnabled:" + threeD2);
  349. this.SetToggleButtonActive(this.m_soundEffect3d, threeD2);
  350. bool threeD3 = GameMain.Instance.SoundMgr.GetThreeD(AudioSourceMgr.Type.Env);
  351. Debug.Log("Load soundEnvironment3dEnabled:" + threeD3);
  352. this.SetToggleButtonActive(this.m_soundEnvironment3d, threeD3);
  353. bool ejaculationSeEnabled = GameMain.Instance.CMSystem.EjaculationSeEnabled;
  354. Debug.Log("Load EjaculationSeEnabled:" + ejaculationSeEnabled);
  355. this.SetButtonActive(this.m_ejaculationSeEnabledOn, this.m_ejaculationSeEnabledOff, ejaculationSeEnabled);
  356. }
  357. private void SetButtonActive(UIButton ActiveButton, UIButton InActiveButton, bool active)
  358. {
  359. if (active)
  360. {
  361. this.SetButtonActive(ActiveButton, InActiveButton);
  362. }
  363. else
  364. {
  365. this.SetButtonActive(InActiveButton, ActiveButton);
  366. }
  367. }
  368. private string ToResolutionOption(Size<int> size)
  369. {
  370. return string.Format("{0}x{1}", size.width, size.height);
  371. }
  372. private void SetButtonActive(UIButton activeButton, UIButton inActiveButton)
  373. {
  374. activeButton.defaultColor = this.activeColor;
  375. inActiveButton.defaultColor = this.inActiveColor;
  376. }
  377. private void InvertButtonActive(UIButton toggleButton, bool wasActive)
  378. {
  379. if (wasActive)
  380. {
  381. toggleButton.defaultColor = this.inActiveColor;
  382. }
  383. else
  384. {
  385. toggleButton.defaultColor = this.activeColor;
  386. }
  387. }
  388. private void SetToggleButtonActive(UIButton toggleButton, bool active)
  389. {
  390. if (active)
  391. {
  392. toggleButton.defaultColor = this.activeColor;
  393. }
  394. else
  395. {
  396. toggleButton.defaultColor = this.inActiveColor;
  397. }
  398. }
  399. public void SetButtonShowAlwaysEnabled(bool enabled)
  400. {
  401. this.SetButtonActive(this.m_sysBtnShowAlwaysOn, this.m_sysBtnShowAlwaysOff, enabled);
  402. GameMain.Instance.CMSystem.SysButtonShowAlways = enabled;
  403. GameMain.Instance.CMSystem.ConfigSystemApply();
  404. Debug.Log(string.Format("{0}に{1}を設定しました。", "SysButtonShowAlways", enabled));
  405. }
  406. public void SetFullScreenEnabled(bool enabled)
  407. {
  408. this.SetButtonActive(this.m_fullScreenOn, this.m_fullScreenOff, enabled);
  409. GameMain.Instance.CMSystem.FullScreen = enabled;
  410. GameMain.Instance.CMSystem.ConfigScreenApply();
  411. Debug.Log(string.Format("{0}に{1}を設定しました。", "FullScreen", enabled));
  412. }
  413. public void SetFpsDisplayEnabled(bool enabled)
  414. {
  415. this.SetButtonActive(this.m_fpsDisplayOn, this.m_fpsDisplayOff, enabled);
  416. GameMain.Instance.CMSystem.ViewFps = enabled;
  417. GameMain.Instance.CMSystem.ConfigScreenApply();
  418. Debug.Log(string.Format("{0}に{1}を設定しました。", "ViewFps", enabled));
  419. }
  420. public void SetAlreadyReadSkipEnabled(bool enabled)
  421. {
  422. this.SetButtonActive(this.m_alreadyReadSkipOn, this.m_alreadyReadSkipOff, enabled);
  423. GameMain.Instance.CMSystem.MsgAlreadySkip = enabled;
  424. GameMain.Instance.CMSystem.ConfigSystemApply();
  425. Debug.Log(string.Format("{0}に{1}を設定しました。", "MsgAlreadySkip", enabled));
  426. }
  427. public void SetSequentialVoiceEnabled(bool enabled)
  428. {
  429. this.SetButtonActive(this.m_sequentialVoiceOn, this.m_sequentialVoiceOff, enabled);
  430. GameMain.Instance.CMSystem.MsgVoiceNoStop = enabled;
  431. GameMain.Instance.CMSystem.ConfigSystemApply();
  432. Debug.Log(string.Format("{0}に{1}を設定しました。", "MsgVoiceNoStop", enabled));
  433. }
  434. public void SetEjaculationSeEnabled(bool enabled)
  435. {
  436. this.SetButtonActive(this.m_ejaculationSeEnabledOn, this.m_ejaculationSeEnabledOff, enabled);
  437. GameMain.Instance.CMSystem.EjaculationSeEnabled = enabled;
  438. GameMain.Instance.CMSystem.ConfigSystemApply();
  439. Debug.Log(string.Format("{0}に{1}を設定しました。", "EjaculationSeEnabled", enabled));
  440. }
  441. public void SetMusic3DActive()
  442. {
  443. this.SetSound3DActive(this.m_music3d, AudioSourceMgr.Type.Bgm);
  444. }
  445. public void SetVoice3DActive()
  446. {
  447. this.SetSound3DActive(this.m_voice3d, AudioSourceMgr.Type.Voice);
  448. }
  449. public void SetSoundEffect3DActive()
  450. {
  451. this.SetSound3DActive(this.m_soundEffect3d, AudioSourceMgr.Type.Se);
  452. }
  453. public void SetSoundEnvironment3DActive()
  454. {
  455. this.SetSound3DActive(this.m_soundEnvironment3d, AudioSourceMgr.Type.Env);
  456. }
  457. private void SetSound3DActive(UIButton button, AudioSourceMgr.Type soundType)
  458. {
  459. bool threeD = GameMain.Instance.SoundMgr.GetThreeD(soundType);
  460. this.InvertButtonActive(button, threeD);
  461. GameMain.Instance.SoundMgr.SetThreeD(soundType, !threeD);
  462. GameMain.Instance.SoundMgr.Apply();
  463. Debug.Log(string.Format("{0}[3D]に{1}を設定しました。", soundType, !threeD));
  464. }
  465. public void ChangePopupListResolutionValue(string value)
  466. {
  467. value = this.DelNewlineOfSentenceEnd(value);
  468. Size<int> screenSize = this.ToSize(value);
  469. GameMain.Instance.CMSystem.SetScreenSize(screenSize);
  470. GameMain.Instance.CMSystem.ConfigScreenApply();
  471. Debug.Log(string.Format("{0}に{1}を設定しました。", "解像度", value));
  472. }
  473. private Size<int> ToSize(string value)
  474. {
  475. Size<int> result = default(Size<int>);
  476. int num = value.IndexOf("x");
  477. if (num < 0)
  478. {
  479. Debug.LogError(string.Format("不適切な解像度が設定されています。設定された解像度={0}", value));
  480. }
  481. string s = value.Substring(0, num);
  482. int width;
  483. if (int.TryParse(s, out width))
  484. {
  485. result.width = width;
  486. }
  487. else
  488. {
  489. Debug.LogError(string.Format("不適切な解像度が設定されています。設定された解像度={0}", value));
  490. }
  491. string s2 = value.Substring(num + 1);
  492. int height;
  493. if (int.TryParse(s2, out height))
  494. {
  495. result.height = height;
  496. }
  497. else
  498. {
  499. Debug.LogError(string.Format("不適切な解像度が設定されています。設定された解像度={0}", value));
  500. }
  501. return result;
  502. }
  503. public void ChangePopupListValue<PopupListType>(string value)
  504. {
  505. value = this.DelNewlineOfSentenceEnd(value);
  506. if (typeof(PopupListType) == typeof(CMSystem.AntiAliasType))
  507. {
  508. GameMain.Instance.CMSystem.Antialias = (CMSystem.AntiAliasType)Enum.Parse(typeof(CMSystem.AntiAliasType), value);
  509. }
  510. else if (typeof(PopupListType) == typeof(CMSystem.ShadowQualityType))
  511. {
  512. GameMain.Instance.CMSystem.ShadowQuality = (CMSystem.ShadowQualityType)Enum.Parse(typeof(CMSystem.ShadowQualityType), value);
  513. }
  514. else if (typeof(PopupListType) == typeof(CMSystem.TextureQualityType))
  515. {
  516. GameMain.Instance.CMSystem.TextureQuality = (CMSystem.TextureQualityType)Enum.Parse(typeof(CMSystem.TextureQualityType), value);
  517. }
  518. else if (typeof(PopupListType) == typeof(CMSystem.SSSuperSizeType))
  519. {
  520. GameMain.Instance.CMSystem.ScreenShotSuperSize = (CMSystem.SSSuperSizeType)Enum.Parse(typeof(CMSystem.SSSuperSizeType), value);
  521. }
  522. GameMain.Instance.CMSystem.ConfigScreenApply();
  523. Debug.Log(string.Format("{0}に[{1}]が設定されました。", typeof(PopupListType).ToString(), value));
  524. }
  525. public void ChangeSliderValue(ConfigMgr.SliderType sliderType, float value)
  526. {
  527. int num = (int)Math.Ceiling((double)(value * 100f));
  528. switch (sliderType)
  529. {
  530. case ConfigMgr.SliderType.Bloom:
  531. GameMain.Instance.CMSystem.BloomValue = num;
  532. GameMain.Instance.CMSystem.ConfigScreenApply();
  533. break;
  534. case ConfigMgr.SliderType.PlayerModelTransparency:
  535. GameMain.Instance.CMSystem.ManAlpha = num;
  536. GameMain.Instance.CMSystem.ConfigScreenApply();
  537. break;
  538. case ConfigMgr.SliderType.MessageWindowTransparency:
  539. GameMain.Instance.CMSystem.MsgWndAlpha = num;
  540. GameMain.Instance.CMSystem.ConfigSystemApply();
  541. break;
  542. case ConfigMgr.SliderType.TextSpeed:
  543. GameMain.Instance.CMSystem.MsgTextSpeed = num;
  544. GameMain.Instance.CMSystem.ConfigSystemApply();
  545. break;
  546. case ConfigMgr.SliderType.AutoSpeed:
  547. GameMain.Instance.CMSystem.MsgAutoSpeed = num;
  548. GameMain.Instance.CMSystem.ConfigSystemApply();
  549. break;
  550. case ConfigMgr.SliderType.MasterVolume:
  551. GameMain.Instance.SoundMgr.SetVolumeAll(num);
  552. GameMain.Instance.SoundMgr.Apply();
  553. break;
  554. case ConfigMgr.SliderType.SystemVolume:
  555. GameMain.Instance.SoundMgr.SetVolume(AudioSourceMgr.Type.System, num);
  556. GameMain.Instance.SoundMgr.Apply();
  557. break;
  558. case ConfigMgr.SliderType.MusicVolume:
  559. GameMain.Instance.SoundMgr.SetVolume(AudioSourceMgr.Type.Bgm, num);
  560. GameMain.Instance.SoundMgr.Apply();
  561. break;
  562. case ConfigMgr.SliderType.DanceVolume:
  563. GameMain.Instance.SoundMgr.SetVolumeDance(num);
  564. GameMain.Instance.SoundMgr.Apply();
  565. break;
  566. case ConfigMgr.SliderType.VoiceVolume:
  567. GameMain.Instance.SoundMgr.SetVolume(AudioSourceMgr.Type.Voice, num);
  568. GameMain.Instance.SoundMgr.Apply();
  569. break;
  570. case ConfigMgr.SliderType.SoundEffectVolume:
  571. GameMain.Instance.SoundMgr.SetVolume(AudioSourceMgr.Type.Se, num);
  572. GameMain.Instance.SoundMgr.Apply();
  573. break;
  574. case ConfigMgr.SliderType.SoundEnvironmentVolume:
  575. GameMain.Instance.SoundMgr.SetVolume(AudioSourceMgr.Type.Env, num);
  576. GameMain.Instance.SoundMgr.Apply();
  577. break;
  578. default:
  579. Debug.LogError(string.Format("不適切な項目が変更されました。変更しようとした項目={0}", sliderType));
  580. break;
  581. }
  582. Debug.Log(string.Format("{0}の値に[{1}]が設定されました。", sliderType.ToString(), num));
  583. }
  584. public void SetOKButtonActive(bool active)
  585. {
  586. this.m_okButton.enabled = active;
  587. }
  588. public void SetContentsVisible(bool value)
  589. {
  590. string[] array = new string[]
  591. {
  592. "System",
  593. "Screen",
  594. "Message",
  595. "Sound"
  596. };
  597. foreach (string f_strObjName in array)
  598. {
  599. UTY.GetChildObject(base.gameObject, f_strObjName, false).SetActive(value);
  600. }
  601. }
  602. private string DelNewlineOfSentenceEnd(string str)
  603. {
  604. return Regex.Replace(str, "[\\r\\n]+$", string.Empty);
  605. }
  606. public UIPopupList m_plSubtitleType;
  607. private UIPopupList m_resolution;
  608. private UIPopupList m_plResolution;
  609. private UIPopupList m_plAntiAlias;
  610. private UIPopupList m_plShadowQuality;
  611. private UIPopupList m_plTextureQuality;
  612. private UIPopupList m_plCaptureMagnification;
  613. private UISlider m_volume;
  614. private UISlider m_slSystemVolume;
  615. private UISlider m_slBloom;
  616. private UISlider m_slPlayerModelTransparency;
  617. private UISlider m_slMessageWindowTransparency;
  618. private UISlider m_slTextSpeed;
  619. private UISlider m_slAutoSpeed;
  620. private UISlider m_slMasterVolume;
  621. private UISlider m_slMusicVolume;
  622. private UISlider m_slDanceVolume;
  623. private UISlider m_slVoiceVolume;
  624. private UISlider m_slSoundEffectVolume;
  625. private UISlider m_slSoundEnvironmentVolume;
  626. private UIButton m_sysBtnShowAlwaysOn;
  627. private UIButton m_sysBtnShowAlwaysOff;
  628. private UIButton m_fullScreenOn;
  629. private UIButton m_fullScreenOff;
  630. private UIButton m_fpsDisplayOn;
  631. private UIButton m_fpsDisplayOff;
  632. private UIButton m_alreadyReadSkipOn;
  633. private UIButton m_alreadyReadSkipOff;
  634. private UIButton m_sequentialVoiceOn;
  635. private UIButton m_sequentialVoiceOff;
  636. private UIButton m_ejaculationSeEnabledOn;
  637. private UIButton m_ejaculationSeEnabledOff;
  638. private UIButton m_music3d;
  639. private UIButton m_voice3d;
  640. private UIButton m_soundEffect3d;
  641. private UIButton m_soundEnvironment3d;
  642. private UIButton m_okButton;
  643. private UIButton m_changeVRConfigButton;
  644. private Color activeColor;
  645. private Color inActiveColor;
  646. private const string RESOLUTION_MARK = "x";
  647. private const string ENUM_MAX_MARK = "MAX";
  648. private const int COEFFICIENT = 100;
  649. private class Resolution
  650. {
  651. public int width;
  652. public int height;
  653. }
  654. }