ConfigCtrl.cs 29 KB

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