ConfigManager.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Text.RegularExpressions;
  5. using UnityEngine;
  6. public class ConfigManager : MonoBehaviour
  7. {
  8. public UIPopupList subtitleTypePopupList
  9. {
  10. get
  11. {
  12. return this.subtitleType;
  13. }
  14. }
  15. public void Init(ConfigCblManager cblConfigMgr)
  16. {
  17. this.cblConfigMgr = cblConfigMgr;
  18. ConfigManager.CategoryButton[] array = this.categoryTabButtons;
  19. for (int i = 0; i < array.Length; i++)
  20. {
  21. ConfigManager.CategoryButton categoryData = array[i];
  22. if (categoryData.type == ConfigManager.CategoryButton.Type.System)
  23. {
  24. this.OnClickCategoryTabButton(categoryData);
  25. }
  26. EventDelegate.Add(categoryData.tab.onClick, delegate()
  27. {
  28. this.OnClickCategoryTabButton(categoryData);
  29. });
  30. if (categoryData.type == ConfigManager.CategoryButton.Type.ChuBLip)
  31. {
  32. categoryData.tab.gameObject.SetActive(false);
  33. }
  34. }
  35. KeyValuePair<UIGrid, GameObject> rootItem = this.GetRootItem<UIGrid>(this.deviceSelect.gameObject);
  36. UIGrid key = rootItem.Key;
  37. GameObject value = rootItem.Value;
  38. if (value != null)
  39. {
  40. value.gameObject.SetActive(false);
  41. }
  42. if (key != null)
  43. {
  44. key.repositionNow = true;
  45. }
  46. if (Product.supportMultiLanguage)
  47. {
  48. this.vSync.transform.parent.parent.SetParent(UTY.GetChildObject(this.systemFrame.gameObject, "SystemBlockLeft", false).gameObject.transform, true);
  49. this.vSync.transform.parent.localPosition = new Vector3(598f, this.vSync.transform.parent.localPosition.y, 0f);
  50. }
  51. UTY.GetChildObject(this.systemFrame.gameObject, "SystemBlockLeft", false).GetComponent<UIGrid>().repositionNow = true;
  52. UTY.GetChildObject(this.systemFrame.gameObject, "SystemBlockRight", false).GetComponent<UIGrid>().repositionNow = true;
  53. EventDelegate.Add(this.closeButton.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.CloseConfigPanel));
  54. EventDelegate.Add(this.vrConfigButton.onClick, delegate()
  55. {
  56. BaseMgr<ConfigMgr>.Instance.CloseConfigPanel();
  57. ConfigVRCtrl.Open(null);
  58. });
  59. Action<ConfigSelectButton> action = delegate(ConfigSelectButton button)
  60. {
  61. button.Initialize();
  62. this.selectButtons.Add(button);
  63. };
  64. Action<ConfigIntegerSlider> intSliderInit = delegate(ConfigIntegerSlider slider)
  65. {
  66. slider.Initialize();
  67. this.intSliders.Add(slider);
  68. };
  69. Action<ConfigIntegerSlider, AudioSourceMgr.Type> action2 = delegate(ConfigIntegerSlider slider, AudioSourceMgr.Type type)
  70. {
  71. intSliderInit(slider);
  72. slider.onGetValue = (() => GameMain.Instance.SoundMgr.GetVolume(type));
  73. slider.onSetValue = delegate(int setValue)
  74. {
  75. GameMain.Instance.SoundMgr.SetVolume(type, setValue);
  76. GameMain.Instance.SoundMgr.Apply();
  77. };
  78. };
  79. Action<WFCheckBox, AudioSourceMgr.Type> action3 = delegate(WFCheckBox checkBox, AudioSourceMgr.Type type)
  80. {
  81. checkBox.onClick.Add(delegate(WFCheckBox clickCheckBox)
  82. {
  83. GameMain.Instance.SoundMgr.SetThreeD(type, clickCheckBox.check);
  84. GameMain.Instance.SoundMgr.Apply();
  85. });
  86. };
  87. action(this.systemButtonVisible);
  88. this.systemButtonVisible.onGetValue = (() => GameMain.Instance.CMSystem.SysButtonShowAlways);
  89. this.systemButtonVisible.onSetValue = delegate(bool setValue)
  90. {
  91. GameMain.Instance.CMSystem.SysButtonShowAlways = setValue;
  92. };
  93. action(this.screenMode);
  94. this.screenMode.onGetValue = (() => GameMain.Instance.CMSystem.FullScreen);
  95. this.screenMode.onSetValue = delegate(bool setValue)
  96. {
  97. GameMain.Instance.CMSystem.FullScreen = setValue;
  98. GameMain.Instance.CMSystem.ConfigScreenApply();
  99. };
  100. action(this.drawFPS);
  101. this.drawFPS.onGetValue = (() => GameMain.Instance.CMSystem.ViewFps);
  102. this.drawFPS.onSetValue = delegate(bool setValue)
  103. {
  104. GameMain.Instance.CMSystem.ViewFps = setValue;
  105. GameMain.Instance.CMSystem.ConfigScreenApply();
  106. };
  107. action(this.sequentialVoice);
  108. this.sequentialVoice.onGetValue = (() => GameMain.Instance.CMSystem.MsgVoiceNoStop);
  109. this.sequentialVoice.onSetValue = delegate(bool setValue)
  110. {
  111. GameMain.Instance.CMSystem.MsgVoiceNoStop = setValue;
  112. };
  113. action(this.ejaculationSe);
  114. this.ejaculationSe.onGetValue = (() => GameMain.Instance.CMSystem.EjaculationSeEnabled);
  115. this.ejaculationSe.onSetValue = delegate(bool setValue)
  116. {
  117. GameMain.Instance.CMSystem.EjaculationSeEnabled = setValue;
  118. };
  119. if (Product.isPublic)
  120. {
  121. this.ejaculationSe.gameObject.SetActive(false);
  122. }
  123. action(this.yotogiSubtitleVisible);
  124. this.yotogiSubtitleVisible.onGetValue = (() => GameMain.Instance.CMSystem.YotogiSubtitleVisible);
  125. this.yotogiSubtitleVisible.onSetValue = delegate(bool setValue)
  126. {
  127. GameMain.Instance.CMSystem.YotogiSubtitleVisible = setValue;
  128. };
  129. if (!Product.supportMultiLanguage || Product.isPublic)
  130. {
  131. this.yotogiSubtitleVisible.gameObject.SetActive(false);
  132. }
  133. foreach (Size<int> size in this.MakeResolutionPopupList())
  134. {
  135. this.screenResolution.items.Add(string.Format("{0}x{1}", size.width, size.height));
  136. }
  137. EventDelegate.Add(this.screenResolution.onChange, delegate()
  138. {
  139. string currentPopupListValue = this.GetCurrentPopupListValue();
  140. Size<int> screenSize = this.ResolutionTextToSize(currentPopupListValue);
  141. GameMain.Instance.CMSystem.SetScreenSize(screenSize);
  142. GameMain.Instance.CMSystem.ConfigScreenApply();
  143. });
  144. this.CreateEnumPopupList<CMSystem.SSSuperSizeType>(this.captureMagnification, delegate(CMSystem.SSSuperSizeType setValue)
  145. {
  146. GameMain.Instance.CMSystem.ScreenShotSuperSize = setValue;
  147. GameMain.Instance.CMSystem.ConfigScreenApply();
  148. });
  149. this.CreateEnumPopupList<CMSystem.AntiAliasType>(this.antiAlias, delegate(CMSystem.AntiAliasType setValue)
  150. {
  151. GameMain.Instance.CMSystem.Antialias = setValue;
  152. GameMain.Instance.CMSystem.ConfigScreenApply();
  153. });
  154. this.CreateEnumPopupList<CMSystem.ShadowQualityType>(this.shadowQuality, delegate(CMSystem.ShadowQualityType setValue)
  155. {
  156. GameMain.Instance.CMSystem.ShadowQuality = setValue;
  157. GameMain.Instance.CMSystem.ConfigScreenApply();
  158. });
  159. this.CreateEnumPopupList<CMSystem.TextureQualityType>(this.textureQuality, delegate(CMSystem.TextureQualityType setValue)
  160. {
  161. GameMain.Instance.CMSystem.TextureQuality = setValue;
  162. GameMain.Instance.CMSystem.ConfigScreenApply();
  163. });
  164. this.CreateEnumPopupList<CMSystem.VSyncType>(this.vSync, delegate(CMSystem.VSyncType setValue)
  165. {
  166. GameMain.Instance.CMSystem.VSyncMode = setValue;
  167. GameMain.Instance.CMSystem.ConfigScreenApply();
  168. });
  169. if (this.subtitleType != null)
  170. {
  171. if (Product.supportMultiLanguage)
  172. {
  173. IEnumerator enumerator2 = Enum.GetValues(typeof(SubtitleDisplayManager.DisplayType)).GetEnumerator();
  174. try
  175. {
  176. while (enumerator2.MoveNext())
  177. {
  178. object obj = enumerator2.Current;
  179. if ((SubtitleDisplayManager.DisplayType)obj != SubtitleDisplayManager.DisplayType.None)
  180. {
  181. this.subtitleType.AddItem(SubtitleDisplayManager.EnumConvert.GetTerm((SubtitleDisplayManager.DisplayType)obj));
  182. }
  183. }
  184. }
  185. finally
  186. {
  187. IDisposable disposable;
  188. if ((disposable = (enumerator2 as IDisposable)) != null)
  189. {
  190. disposable.Dispose();
  191. }
  192. }
  193. EventDelegate.Add(this.subtitleType.onChange, delegate()
  194. {
  195. string currentPopupListValue = this.GetCurrentPopupListValue();
  196. IEnumerator enumerator4 = Enum.GetValues(typeof(SubtitleDisplayManager.DisplayType)).GetEnumerator();
  197. try
  198. {
  199. while (enumerator4.MoveNext())
  200. {
  201. object obj3 = enumerator4.Current;
  202. string term = SubtitleDisplayManager.EnumConvert.GetTerm((SubtitleDisplayManager.DisplayType)obj3);
  203. if (currentPopupListValue == term)
  204. {
  205. GameMain.Instance.CMSystem.SubtitleType = (SubtitleDisplayManager.DisplayType)obj3;
  206. break;
  207. }
  208. }
  209. }
  210. finally
  211. {
  212. IDisposable disposable3;
  213. if ((disposable3 = (enumerator4 as IDisposable)) != null)
  214. {
  215. disposable3.Dispose();
  216. }
  217. }
  218. });
  219. }
  220. else
  221. {
  222. Transform transform = this.subtitleType.transform;
  223. while (transform.parent == null || transform.parent.GetComponent<UIGrid>() == null)
  224. {
  225. transform = transform.parent;
  226. }
  227. if (transform != null)
  228. {
  229. transform.gameObject.SetActive(false);
  230. }
  231. }
  232. }
  233. if (this.systemLanguage != null)
  234. {
  235. if (Product.supportMultiLanguage)
  236. {
  237. IEnumerator enumerator3 = Enum.GetValues(typeof(Product.Language)).GetEnumerator();
  238. try
  239. {
  240. while (enumerator3.MoveNext())
  241. {
  242. object obj2 = enumerator3.Current;
  243. this.systemLanguage.AddItem(Product.EnumConvert.GetTerm((Product.Language)obj2));
  244. }
  245. }
  246. finally
  247. {
  248. IDisposable disposable2;
  249. if ((disposable2 = (enumerator3 as IDisposable)) != null)
  250. {
  251. disposable2.Dispose();
  252. }
  253. }
  254. EventDelegate.Add(this.systemLanguage.onChange, delegate()
  255. {
  256. string currentPopupListValue = this.GetCurrentPopupListValue();
  257. IEnumerator enumerator4 = Enum.GetValues(typeof(Product.Language)).GetEnumerator();
  258. try
  259. {
  260. while (enumerator4.MoveNext())
  261. {
  262. object obj3 = enumerator4.Current;
  263. string term = Product.EnumConvert.GetTerm((Product.Language)obj3);
  264. if (currentPopupListValue == term)
  265. {
  266. GameMain.Instance.CMSystem.SystemLanguage = (Product.Language)obj3;
  267. break;
  268. }
  269. }
  270. }
  271. finally
  272. {
  273. IDisposable disposable3;
  274. if ((disposable3 = (enumerator4 as IDisposable)) != null)
  275. {
  276. disposable3.Dispose();
  277. }
  278. }
  279. });
  280. }
  281. else
  282. {
  283. Transform transform2 = this.systemLanguage.transform;
  284. while (transform2.parent == null || transform2.parent.GetComponent<UIGrid>() == null)
  285. {
  286. transform2 = transform2.parent;
  287. }
  288. if (transform2 != null)
  289. {
  290. transform2.gameObject.SetActive(false);
  291. }
  292. }
  293. }
  294. intSliderInit(this.manAlpha);
  295. this.manAlpha.onGetValue = (() => GameMain.Instance.CMSystem.ManAlpha);
  296. this.manAlpha.onSetValue = delegate(int setValue)
  297. {
  298. GameMain.Instance.CMSystem.ManAlpha = setValue;
  299. GameMain.Instance.CMSystem.ConfigScreenApply();
  300. };
  301. intSliderInit(this.bloom);
  302. this.bloom.onGetValue = (() => GameMain.Instance.CMSystem.BloomValue);
  303. this.bloom.onSetValue = delegate(int setValue)
  304. {
  305. GameMain.Instance.CMSystem.BloomValue = setValue;
  306. };
  307. intSliderInit(this.messageAlpha);
  308. this.messageAlpha.onGetValue = (() => GameMain.Instance.CMSystem.MsgWndAlpha);
  309. this.messageAlpha.onSetValue = delegate(int setValue)
  310. {
  311. GameMain.Instance.CMSystem.MsgWndAlpha = setValue;
  312. };
  313. intSliderInit(this.textSpeed);
  314. this.textSpeed.onGetValue = (() => GameMain.Instance.CMSystem.MsgTextSpeed);
  315. this.textSpeed.onSetValue = delegate(int setValue)
  316. {
  317. GameMain.Instance.CMSystem.MsgTextSpeed = setValue;
  318. };
  319. intSliderInit(this.textAutoSpeed);
  320. this.textAutoSpeed.onGetValue = (() => GameMain.Instance.CMSystem.MsgAutoSpeed);
  321. this.textAutoSpeed.onSetValue = delegate(int setValue)
  322. {
  323. GameMain.Instance.CMSystem.MsgAutoSpeed = setValue;
  324. };
  325. intSliderInit(this.volumeMaster);
  326. this.volumeMaster.onGetValue = (() => GameMain.Instance.SoundMgr.GetVolumeAll());
  327. this.volumeMaster.onSetValue = delegate(int setValue)
  328. {
  329. GameMain.Instance.SoundMgr.SetVolumeAll(setValue);
  330. GameMain.Instance.SoundMgr.Apply();
  331. };
  332. action2(this.volumeSystem, AudioSourceMgr.Type.System);
  333. action2(this.volumeBGM, AudioSourceMgr.Type.Bgm);
  334. intSliderInit(this.volumeDance);
  335. this.volumeDance.onGetValue = (() => GameMain.Instance.SoundMgr.GetVolumeDance());
  336. this.volumeDance.onSetValue = delegate(int setValue)
  337. {
  338. GameMain.Instance.SoundMgr.SetVolumeDance(setValue);
  339. GameMain.Instance.SoundMgr.Apply();
  340. };
  341. action2(this.volumeVoiceMaster, AudioSourceMgr.Type.Voice);
  342. action2(this.volumeVoiceHeroine, AudioSourceMgr.Type.VoiceHeroine);
  343. action3(this.threeDEffectVoiceHeroine, AudioSourceMgr.Type.VoiceHeroine);
  344. action2(this.volumeSubVoice, AudioSourceMgr.Type.VoiceSub);
  345. action3(this.threeDEffectSubVoice, AudioSourceMgr.Type.VoiceSub);
  346. action2(this.volumeExtraVoice, AudioSourceMgr.Type.VoiceExtra);
  347. action3(this.threeDEffectExtraVoice, AudioSourceMgr.Type.VoiceExtra);
  348. action2(this.volumeMobVoice, AudioSourceMgr.Type.VoiceMob);
  349. action3(this.threeDEffectMobVoice, AudioSourceMgr.Type.VoiceMob);
  350. action2(this.volumeSE, AudioSourceMgr.Type.Se);
  351. action3(this.threeDEffectSE, AudioSourceMgr.Type.Se);
  352. action2(this.volumeEnv, AudioSourceMgr.Type.Env);
  353. action3(this.threeDEffectEnv, AudioSourceMgr.Type.Env);
  354. foreach (UIGrid uigrid in base.GetComponentsInChildren<UIGrid>())
  355. {
  356. uigrid.repositionNow = true;
  357. }
  358. }
  359. public void LoadConfig()
  360. {
  361. foreach (ConfigSelectButton configSelectButton in this.selectButtons)
  362. {
  363. configSelectButton.UpdateButton();
  364. }
  365. foreach (ConfigIntegerSlider configIntegerSlider in this.intSliders)
  366. {
  367. configIntegerSlider.UpdateSlider();
  368. }
  369. SoundMgr soundMgr = GameMain.Instance.SoundMgr;
  370. this.threeDEffectVoiceHeroine.check = soundMgr.GetThreeD(AudioSourceMgr.Type.VoiceHeroine);
  371. this.threeDEffectSubVoice.check = soundMgr.GetThreeD(AudioSourceMgr.Type.VoiceSub);
  372. this.threeDEffectExtraVoice.check = soundMgr.GetThreeD(AudioSourceMgr.Type.VoiceExtra);
  373. this.threeDEffectMobVoice.check = soundMgr.GetThreeD(AudioSourceMgr.Type.VoiceMob);
  374. this.threeDEffectSE.check = soundMgr.GetThreeD(AudioSourceMgr.Type.Se);
  375. this.threeDEffectEnv.check = soundMgr.GetThreeD(AudioSourceMgr.Type.Env);
  376. Size<int> screenSizeNow = GameMain.Instance.CMSystem.GetScreenSizeNow();
  377. this.screenResolution.value = string.Format("{0}x{1}", screenSizeNow.width, screenSizeNow.height);
  378. this.captureMagnification.value = GameMain.Instance.CMSystem.ScreenShotSuperSize.ToString();
  379. this.antiAlias.value = GameMain.Instance.CMSystem.Antialias.ToString();
  380. this.shadowQuality.value = GameMain.Instance.CMSystem.ShadowQuality.ToString();
  381. this.textureQuality.value = GameMain.Instance.CMSystem.TextureQuality.ToString();
  382. this.vSync.value = GameMain.Instance.CMSystem.VSyncMode.ToString();
  383. this.subtitleType.value = SubtitleDisplayManager.EnumConvert.GetTerm(GameMain.Instance.CMSystem.SubtitleType);
  384. this.systemLanguage.value = Product.EnumConvert.GetTerm(GameMain.Instance.CMSystem.SystemLanguage);
  385. }
  386. public void SetCloseButtonActive(bool active)
  387. {
  388. this.closeButton.gameObject.SetActive(active);
  389. }
  390. private void OnClickCategoryTabButton(ConfigManager.CategoryButton data)
  391. {
  392. ConfigManager.CategoryButton.Type type = data.type;
  393. if (type != ConfigManager.CategoryButton.Type.System)
  394. {
  395. if (type != ConfigManager.CategoryButton.Type.Sound)
  396. {
  397. if (type == ConfigManager.CategoryButton.Type.ChuBLip)
  398. {
  399. UIRect uirect = this.systemWidget;
  400. float alpha = 0f;
  401. this.soundWidget.alpha = alpha;
  402. uirect.alpha = alpha;
  403. this.cblConfigMgr.visible = true;
  404. }
  405. }
  406. else
  407. {
  408. this.systemWidget.alpha = 0f;
  409. this.soundWidget.alpha = 1f;
  410. this.cblConfigMgr.visible = false;
  411. }
  412. }
  413. else
  414. {
  415. this.systemWidget.alpha = 1f;
  416. this.soundWidget.alpha = 0f;
  417. this.cblConfigMgr.visible = false;
  418. }
  419. foreach (ConfigManager.CategoryButton categoryButton in this.categoryTabButtons)
  420. {
  421. categoryButton.tab.SetSelect(categoryButton.type == data.type);
  422. }
  423. }
  424. private void CreateEnumPopupList<enumT>(UIPopupList addPopupList, Action<enumT> applyAction)
  425. {
  426. IEnumerator enumerator = Enum.GetValues(typeof(enumT)).GetEnumerator();
  427. try
  428. {
  429. while (enumerator.MoveNext())
  430. {
  431. object obj = enumerator.Current;
  432. if (obj.ToString() != "MAX")
  433. {
  434. addPopupList.items.Add(obj.ToString());
  435. }
  436. }
  437. }
  438. finally
  439. {
  440. IDisposable disposable;
  441. if ((disposable = (enumerator as IDisposable)) != null)
  442. {
  443. disposable.Dispose();
  444. }
  445. }
  446. EventDelegate.Add(addPopupList.onChange, delegate()
  447. {
  448. string currentPopupListValue = this.GetCurrentPopupListValue();
  449. if (this.IsValidatePopupValue<enumT>(currentPopupListValue))
  450. {
  451. enumT obj2 = (enumT)((object)Enum.Parse(typeof(enumT), currentPopupListValue));
  452. applyAction(obj2);
  453. }
  454. });
  455. }
  456. private string GetCurrentPopupListValue()
  457. {
  458. return Regex.Replace(UIPopupList.current.value, "[\\r\\n]+$", string.Empty);
  459. }
  460. private List<Size<int>> MakeResolutionPopupList()
  461. {
  462. List<Size<int>> screenSizeList = GameMain.Instance.CMSystem.GetScreenSizeList();
  463. Size<int> screenSizeNow = GameMain.Instance.CMSystem.GetScreenSizeNow();
  464. if (!screenSizeList.Contains(screenSizeNow))
  465. {
  466. screenSizeList.Add(screenSizeNow);
  467. }
  468. return screenSizeList;
  469. }
  470. private Size<int> ResolutionTextToSize(string value)
  471. {
  472. Size<int> result = default(Size<int>);
  473. int num = value.IndexOf("x");
  474. if (num < 0)
  475. {
  476. Debug.LogError(string.Format("不適切な解像度が設定されています。設定された解像度={0}", value));
  477. }
  478. string s = value.Substring(0, num);
  479. int width;
  480. if (int.TryParse(s, out width))
  481. {
  482. result.width = width;
  483. }
  484. else
  485. {
  486. Debug.LogError(string.Format("不適切な解像度が設定されています。設定された解像度={0}", value));
  487. }
  488. string s2 = value.Substring(num + 1);
  489. int height;
  490. if (int.TryParse(s2, out height))
  491. {
  492. result.height = height;
  493. }
  494. else
  495. {
  496. Debug.LogError(string.Format("不適切な解像度が設定されています。設定された解像度={0}", value));
  497. }
  498. return result;
  499. }
  500. private bool IsValidatePopupValue<T>(string value)
  501. {
  502. if (!Enum.IsDefined(typeof(T), value))
  503. {
  504. Debug.LogError(string.Format("ポップアップリストから不適切な値が選択されました。選択されたボタン名={0}", value));
  505. return false;
  506. }
  507. return true;
  508. }
  509. private KeyValuePair<T, GameObject> GetRootItem<T>(GameObject obj) where T : class
  510. {
  511. T t = (T)((object)null);
  512. Transform transform = obj.transform;
  513. for (;;)
  514. {
  515. t = transform.parent.GetComponent<T>();
  516. if (!(transform.parent == null) && t != null)
  517. {
  518. break;
  519. }
  520. transform = transform.parent;
  521. }
  522. if (transform != null)
  523. {
  524. transform.gameObject.SetActive(false);
  525. }
  526. return new KeyValuePair<T, GameObject>(t, transform.gameObject);
  527. }
  528. [SerializeField]
  529. [Header("タブボタンのデータ")]
  530. private ConfigManager.CategoryButton[] categoryTabButtons;
  531. [SerializeField]
  532. [Header("閉じるボタン")]
  533. private UIButton closeButton;
  534. [SerializeField]
  535. [Header("VRボタン")]
  536. private UIButton vrConfigButton;
  537. [SerializeField]
  538. [Header("システムタブ表示用Widget")]
  539. private UIWidget systemWidget;
  540. [SerializeField]
  541. [Header("システムフレーム")]
  542. private UISprite systemFrame;
  543. [SerializeField]
  544. [Header("サウンドタブ表示用Widget")]
  545. private UIWidget soundWidget;
  546. [SerializeField]
  547. [Header("システムボタン常時表示")]
  548. private ConfigSelectButton systemButtonVisible;
  549. [SerializeField]
  550. [Header("スクリーンモード")]
  551. private ConfigSelectButton screenMode;
  552. [SerializeField]
  553. [Header("FPS表示")]
  554. private ConfigSelectButton drawFPS;
  555. [SerializeField]
  556. [Header("ボイス継続")]
  557. private ConfigSelectButton sequentialVoice;
  558. [SerializeField]
  559. [Header("射精音の再生")]
  560. private ConfigSelectButton ejaculationSe;
  561. [SerializeField]
  562. [Header("夜伽中の字幕表示")]
  563. private ConfigSelectButton yotogiSubtitleVisible;
  564. [SerializeField]
  565. [Header("男透明度")]
  566. private ConfigIntegerSlider manAlpha;
  567. [SerializeField]
  568. [Header("ブルーム")]
  569. private ConfigIntegerSlider bloom;
  570. [SerializeField]
  571. [Header("メッセージウィンドウ透明度")]
  572. private ConfigIntegerSlider messageAlpha;
  573. [SerializeField]
  574. [Header("テキストスピード")]
  575. private ConfigIntegerSlider textSpeed;
  576. [SerializeField]
  577. [Header("テキストオートスピード")]
  578. private ConfigIntegerSlider textAutoSpeed;
  579. [SerializeField]
  580. [Header("CBLデバイス選択")]
  581. private UIPopupList deviceSelect;
  582. [SerializeField]
  583. [Header("画面解像度")]
  584. private UIPopupList screenResolution;
  585. [SerializeField]
  586. [Header("キャプチャ倍率")]
  587. private UIPopupList captureMagnification;
  588. [SerializeField]
  589. [Header("アンチエイリアス")]
  590. private UIPopupList antiAlias;
  591. [SerializeField]
  592. [Header("影のクオリティ")]
  593. private UIPopupList shadowQuality;
  594. [SerializeField]
  595. [Header("テクスチャのクオリティ")]
  596. private UIPopupList textureQuality;
  597. [SerializeField]
  598. [Header("システム言語")]
  599. private UIPopupList systemLanguage;
  600. [SerializeField]
  601. [Header("垂直同期")]
  602. private UIPopupList vSync;
  603. [SerializeField]
  604. [Header("翻訳版用-ADVの表示タイプ")]
  605. private UIPopupList subtitleType;
  606. [SerializeField]
  607. [Header("音量-マスター")]
  608. private ConfigIntegerSlider volumeMaster;
  609. [SerializeField]
  610. [Header("音量-システム")]
  611. private ConfigIntegerSlider volumeSystem;
  612. [SerializeField]
  613. [Header("音量-BGM")]
  614. private ConfigIntegerSlider volumeBGM;
  615. [SerializeField]
  616. [Header("音量-ダンス")]
  617. private ConfigIntegerSlider volumeDance;
  618. [SerializeField]
  619. [Header("音量-ボイスマスター")]
  620. private ConfigIntegerSlider volumeVoiceMaster;
  621. [SerializeField]
  622. [Header("音量-ボイスヒロイン")]
  623. private ConfigIntegerSlider volumeVoiceHeroine;
  624. [SerializeField]
  625. [Header("3D-ボイスヒロイン")]
  626. private WFCheckBox threeDEffectVoiceHeroine;
  627. [SerializeField]
  628. [Header("音量-ボイスサブ")]
  629. private ConfigIntegerSlider volumeSubVoice;
  630. [SerializeField]
  631. [Header("3D-ボイスサブ")]
  632. private WFCheckBox threeDEffectSubVoice;
  633. [SerializeField]
  634. [Header("音量-ボイスエキストラ")]
  635. private ConfigIntegerSlider volumeExtraVoice;
  636. [SerializeField]
  637. [Header("3D-ボイスエキストラ")]
  638. private WFCheckBox threeDEffectExtraVoice;
  639. [SerializeField]
  640. [Header("音量-ボイスモブ")]
  641. private ConfigIntegerSlider volumeMobVoice;
  642. [SerializeField]
  643. [Header("3D-ボイスモブ")]
  644. private WFCheckBox threeDEffectMobVoice;
  645. [SerializeField]
  646. [Header("音量-SE")]
  647. private ConfigIntegerSlider volumeSE;
  648. [SerializeField]
  649. [Header("3D-SE")]
  650. private WFCheckBox threeDEffectSE;
  651. [SerializeField]
  652. [Header("音量-環境音")]
  653. private ConfigIntegerSlider volumeEnv;
  654. [SerializeField]
  655. [Header("3D-環境音")]
  656. private WFCheckBox threeDEffectEnv;
  657. private ConfigCblManager cblConfigMgr;
  658. private List<ConfigSelectButton> selectButtons = new List<ConfigSelectButton>();
  659. private List<ConfigIntegerSlider> intSliders = new List<ConfigIntegerSlider>();
  660. [Serializable]
  661. private struct CategoryButton
  662. {
  663. public ConfigManager.CategoryButton.Type type;
  664. public UIWFTabButton tab;
  665. public enum Type
  666. {
  667. System = 10,
  668. Sound = 20,
  669. ChuBLip = 30
  670. }
  671. }
  672. }