ConfigCtrl.cs 28 KB

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