CMSystem.cs 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Windows.Forms;
  6. using System.Xml.Linq;
  7. using System.Xml.Serialization;
  8. using UnityEngine;
  9. public class CMSystem
  10. {
  11. public CMSystem()
  12. {
  13. this.SysButtonShowAlways = true;
  14. this.FullScreen = false;
  15. this.SetScreenSize(new Size<int>
  16. {
  17. width = 1280,
  18. height = 720
  19. });
  20. this.Antialias = CMSystem.AntiAliasType.X2;
  21. this.ShadowQuality = CMSystem.ShadowQualityType.Medium;
  22. this.TextureQuality = CMSystem.TextureQualityType.High;
  23. this.TargetFPS = 60;
  24. this.VSync = false;
  25. this.ViewFps = false;
  26. this.Bloom = true;
  27. this.BloomValue = 50;
  28. this.MsgAlreadySkip = true;
  29. this.MsgVoiceNoStop = true;
  30. this.SubtitleType = SubtitleDisplayManager.DisplayType.OriginalAndSubtitle;
  31. this.EjaculationSeEnabled = true;
  32. this.NetUse = false;
  33. this.CM3D2Path = string.Empty;
  34. this.LoadSystem();
  35. this.LoadLauncherCfg();
  36. }
  37. public bool SysButtonShowAlways { get; set; }
  38. public bool FullScreen { get; set; }
  39. public void SetSystemVers(string f_strKey, string f_strVal)
  40. {
  41. if (this.m_SystemVers.ContainsKey(f_strKey))
  42. {
  43. this.m_SystemVers[f_strKey] = f_strVal;
  44. }
  45. else
  46. {
  47. this.m_SystemVers.Add(f_strKey, f_strVal);
  48. }
  49. }
  50. public string GetSystemVers(string f_strKey)
  51. {
  52. string result = null;
  53. this.m_SystemVers.TryGetValue(f_strKey, out result);
  54. return result;
  55. }
  56. public List<Size<int>> GetScreenSizeList()
  57. {
  58. List<Size<int>> list = new List<Size<int>>();
  59. list.AddRange(this.m_listScreenDefSize);
  60. Size<int> siDesktop = default(Size<int>);
  61. siDesktop.width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
  62. siDesktop.height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
  63. list.RemoveAll((Size<int> s) => s.height > siDesktop.width || s.height > siDesktop.height);
  64. list.Add(siDesktop);
  65. list.Add(new Size<int>(UnityEngine.Screen.width, UnityEngine.Screen.height));
  66. return list;
  67. }
  68. public void SetScreenSize(Size<int> f_siSize)
  69. {
  70. this.m_siScreenSize = f_siSize;
  71. }
  72. public Size<int> GetScreenSizeNow()
  73. {
  74. return new Size<int>
  75. {
  76. width = UnityEngine.Screen.width,
  77. height = UnityEngine.Screen.height
  78. };
  79. }
  80. public CMSystem.AntiAliasType Antialias { get; set; }
  81. public CMSystem.ShadowQualityType ShadowQuality { get; set; }
  82. public CMSystem.TextureQualityType TextureQuality { get; set; }
  83. public bool VSync { get; set; }
  84. public int TargetFPS { get; set; }
  85. public bool ViewFps { get; set; }
  86. public bool Bloom { get; set; }
  87. public int BloomValue
  88. {
  89. get
  90. {
  91. return this.m_nBloomValue;
  92. }
  93. set
  94. {
  95. this.m_nBloomValue = Math.Max(0, Math.Min(100, value));
  96. }
  97. }
  98. public CMSystem.SSSuperSizeType ScreenShotSuperSize
  99. {
  100. get
  101. {
  102. return this.m_eScreenShotSuperSize;
  103. }
  104. set
  105. {
  106. this.m_eScreenShotSuperSize = value;
  107. }
  108. }
  109. public int ManAlpha
  110. {
  111. get
  112. {
  113. return this.m_nManAlpha;
  114. }
  115. set
  116. {
  117. this.m_nManAlpha = Math.Max(Math.Min(value, 100), 0);
  118. }
  119. }
  120. public int MsgWndAlpha
  121. {
  122. get
  123. {
  124. return this.m_nMsgWndAlpha;
  125. }
  126. set
  127. {
  128. this.m_nMsgWndAlpha = Math.Max(Math.Min(value, 100), 0);
  129. }
  130. }
  131. public int MsgTextSpeed
  132. {
  133. get
  134. {
  135. return this.m_nMsgTextSpeed;
  136. }
  137. set
  138. {
  139. this.m_nMsgTextSpeed = Math.Max(Math.Min(value, 100), 0);
  140. }
  141. }
  142. public int MsgAutoSpeed
  143. {
  144. get
  145. {
  146. return this.m_nMsgAutoSpeed;
  147. }
  148. set
  149. {
  150. this.m_nMsgAutoSpeed = Math.Max(Math.Min(value, 100), 0);
  151. }
  152. }
  153. public bool MsgAlreadySkip { get; set; }
  154. public bool MsgVoiceNoStop { get; set; }
  155. public SubtitleDisplayManager.DisplayType SubtitleType
  156. {
  157. get
  158. {
  159. return this.m_SubtitleType;
  160. }
  161. set
  162. {
  163. this.m_SubtitleType = value;
  164. }
  165. }
  166. public bool EjaculationSeEnabled { get; set; }
  167. public int FadeSpeed
  168. {
  169. get
  170. {
  171. return this.m_nFadeSpeed;
  172. }
  173. set
  174. {
  175. this.m_nFadeSpeed = Math.Max(Math.Min(value, 100), 0);
  176. }
  177. }
  178. public float FadeSpeedRate
  179. {
  180. get
  181. {
  182. return ((float)this.m_nFadeSpeed / 100f > 0.05f) ? ((float)this.m_nFadeSpeed / 100f) : 0.05f;
  183. }
  184. }
  185. public bool NetUse { get; set; }
  186. public string CM3D2Path { get; private set; }
  187. public int DesktopCaptureMonitorNo
  188. {
  189. get
  190. {
  191. return this.m_nDesktopCaptureMonitorNo;
  192. }
  193. set
  194. {
  195. this.m_nDesktopCaptureMonitorNo = value;
  196. }
  197. }
  198. public bool EditItemGroup
  199. {
  200. get
  201. {
  202. return this.m_bEditItemGroup;
  203. }
  204. set
  205. {
  206. this.m_bEditItemGroup = value;
  207. }
  208. }
  209. public bool EditTouchJump
  210. {
  211. get
  212. {
  213. return this.m_bEditTouchJump;
  214. }
  215. set
  216. {
  217. this.m_bEditTouchJump = value;
  218. }
  219. }
  220. public float VRCameraHeightStand
  221. {
  222. get
  223. {
  224. return this.m_fVRCameraHeightStand;
  225. }
  226. set
  227. {
  228. this.m_fVRCameraHeightStand = Mathf.Clamp(value, 1.5f, 1.8f);
  229. }
  230. }
  231. public float VRCameraHeightStandOffs
  232. {
  233. get
  234. {
  235. return this.m_fVRCameraHeightStand - 0.1f;
  236. }
  237. }
  238. public float VRCameraHeightSit
  239. {
  240. get
  241. {
  242. return this.m_fVRCameraHeightSit;
  243. }
  244. set
  245. {
  246. this.m_fVRCameraHeightSit = Mathf.Clamp(value, 0.7f, 1f);
  247. }
  248. }
  249. public float VRCameraHeightSitOffs
  250. {
  251. get
  252. {
  253. return this.m_fVRCameraHeightSit - 0.1f;
  254. }
  255. }
  256. public float VRCameraMoveSpeedKey
  257. {
  258. get
  259. {
  260. return this.m_fVRCameraMoveSpeedKey;
  261. }
  262. set
  263. {
  264. this.m_fVRCameraMoveSpeedKey = Mathf.Clamp(value, 0f, 1f);
  265. }
  266. }
  267. public float VRCameraRotSpeedKey
  268. {
  269. get
  270. {
  271. return this.m_fVRCameraRotSpeedKey;
  272. }
  273. set
  274. {
  275. this.m_fVRCameraRotSpeedKey = Mathf.Clamp(value, 0f, 1f);
  276. }
  277. }
  278. public bool VRCameraPlaneMove
  279. {
  280. get
  281. {
  282. return this.m_bVRCameraPlaneMove;
  283. }
  284. set
  285. {
  286. this.m_bVRCameraPlaneMove = value;
  287. }
  288. }
  289. public float VRCameraRotSpeedMouse
  290. {
  291. get
  292. {
  293. return this.m_fVRCameraRotSpeedMouse;
  294. }
  295. set
  296. {
  297. this.m_fVRCameraRotSpeedMouse = Mathf.Clamp(value, 0f, 1f);
  298. }
  299. }
  300. public bool VRManShow
  301. {
  302. get
  303. {
  304. return this.m_bVRManShow;
  305. }
  306. set
  307. {
  308. this.m_bVRManShow = value;
  309. }
  310. }
  311. public float VRCameraFov
  312. {
  313. get
  314. {
  315. return this.m_fVRCameraFov;
  316. }
  317. set
  318. {
  319. this.m_fVRCameraFov = Mathf.Clamp(value, 30f, 60f);
  320. }
  321. }
  322. public bool VRCamRotDownUp
  323. {
  324. get
  325. {
  326. return this.m_bVRCamRotDownUp;
  327. }
  328. set
  329. {
  330. this.m_bVRCamRotDownUp = value;
  331. }
  332. }
  333. public float OvrHeadScale
  334. {
  335. get
  336. {
  337. return this.m_fOvrHeadScale;
  338. }
  339. set
  340. {
  341. this.m_fOvrHeadScale = Math.Max(Math.Min(value, 3f), 0.1f);
  342. }
  343. }
  344. public float OvrCursorStabilization
  345. {
  346. get
  347. {
  348. return this.m_fOvrCursorStabilization;
  349. }
  350. set
  351. {
  352. this.m_fOvrCursorStabilization = value;
  353. }
  354. }
  355. public float OvrCursorBoostSpeed
  356. {
  357. get
  358. {
  359. return this.m_fOvrCursorBoostSpeed;
  360. }
  361. set
  362. {
  363. this.m_fOvrCursorBoostSpeed = value;
  364. }
  365. }
  366. public int OvrPointerMode
  367. {
  368. get
  369. {
  370. return this.m_nOvrPointerMode;
  371. }
  372. set
  373. {
  374. this.m_nOvrPointerMode = value;
  375. }
  376. }
  377. public int OvrMoveMode
  378. {
  379. get
  380. {
  381. return this.m_nOvrMoveMode;
  382. }
  383. set
  384. {
  385. this.m_nOvrMoveMode = value;
  386. }
  387. }
  388. public float OvrCursorPadSpeed
  389. {
  390. get
  391. {
  392. return this.m_fOvrCursorPadSpeed;
  393. }
  394. set
  395. {
  396. this.m_fOvrCursorPadSpeed = value;
  397. }
  398. }
  399. public float OvrViveCursorLaserHitScale
  400. {
  401. get
  402. {
  403. return this.m_fOvrViveCursorLaserHitScale;
  404. }
  405. set
  406. {
  407. this.m_fOvrViveCursorLaserHitScale = value;
  408. }
  409. }
  410. public float OvrViveCursorLaserEasing
  411. {
  412. get
  413. {
  414. return this.m_fOvrViveCursorLaserEasing;
  415. }
  416. set
  417. {
  418. this.m_fOvrViveCursorLaserEasing = value;
  419. }
  420. }
  421. public int OvrHandCameraWidth
  422. {
  423. get
  424. {
  425. return this.m_nOvrHandCameraWidth;
  426. }
  427. set
  428. {
  429. this.m_nOvrHandCameraWidth = value;
  430. }
  431. }
  432. public int OvrHandCameraHeight
  433. {
  434. get
  435. {
  436. return this.m_nOvrHandCameraHeight;
  437. }
  438. set
  439. {
  440. this.m_nOvrHandCameraHeight = value;
  441. }
  442. }
  443. public Dictionary<string, CMSystem.TransDD> OvrDDBG
  444. {
  445. get
  446. {
  447. return this.m_dicVRDDBG;
  448. }
  449. set
  450. {
  451. this.m_dicVRDDBG = value;
  452. }
  453. }
  454. public bool OvrScreenMirror
  455. {
  456. get
  457. {
  458. return this.m_bOvrScreenMirror;
  459. }
  460. set
  461. {
  462. this.m_bOvrScreenMirror = value;
  463. }
  464. }
  465. public CMSystem.OVR_CAM_HEIGHT_TYPE OvrCameraHeightType
  466. {
  467. get
  468. {
  469. return this.m_eOvrCameraHeightType;
  470. }
  471. set
  472. {
  473. this.m_eOvrCameraHeightType = value;
  474. }
  475. }
  476. public bool OvrMouseRot
  477. {
  478. get
  479. {
  480. return this.m_bOvrMouseRot;
  481. }
  482. set
  483. {
  484. this.m_bOvrMouseRot = value;
  485. }
  486. }
  487. public float OvrUITabletSize
  488. {
  489. get
  490. {
  491. return this.m_fOvrUITabletSize;
  492. }
  493. set
  494. {
  495. this.m_fOvrUITabletSize = value;
  496. }
  497. }
  498. public bool OvrUseTouch
  499. {
  500. get
  501. {
  502. return this.m_bOvrUseTouch;
  503. }
  504. set
  505. {
  506. this.m_bOvrUseTouch = value;
  507. }
  508. }
  509. public bool OvrUseNewControllerType
  510. {
  511. get
  512. {
  513. return this.m_bUseNewControllerType;
  514. }
  515. set
  516. {
  517. this.m_bUseNewControllerType = value;
  518. }
  519. }
  520. public bool OvrUseSnapRotate
  521. {
  522. get
  523. {
  524. return this.m_bOvrUseSnapRotate;
  525. }
  526. set
  527. {
  528. this.m_bOvrUseSnapRotate = value;
  529. }
  530. }
  531. public int OvrUseSnapRotateRate
  532. {
  533. get
  534. {
  535. return this.m_nOvrUseSnapRotateRate;
  536. }
  537. set
  538. {
  539. this.m_nOvrUseSnapRotateRate = Mathf.Clamp(value, 10, 80);
  540. }
  541. }
  542. public bool QuitWhenAssert
  543. {
  544. get
  545. {
  546. return NDebug.m_bQuitWhenAssert;
  547. }
  548. set
  549. {
  550. NDebug.m_bQuitWhenAssert = value;
  551. }
  552. }
  553. public string ShopURL
  554. {
  555. get
  556. {
  557. string text = "https://com3d2-shop.s-court.me/?ctv=1";
  558. if (!string.IsNullOrEmpty(this.CM3D2Path))
  559. {
  560. text += "&cmd=1";
  561. }
  562. else
  563. {
  564. text += "&cmd=0";
  565. }
  566. return text;
  567. }
  568. }
  569. public CMSystem.SerializeConfig SConfig
  570. {
  571. get
  572. {
  573. return this.m_SConfig;
  574. }
  575. }
  576. public void SetTmpGenericFlag(string flag_name, int val)
  577. {
  578. if (this.m_GenericTmpFlag.ContainsKey(flag_name))
  579. {
  580. this.m_GenericTmpFlag[flag_name] = val;
  581. }
  582. else
  583. {
  584. this.m_GenericTmpFlag.Add(flag_name, val);
  585. }
  586. }
  587. public int GetTmpGenericFlag(string flag_name)
  588. {
  589. return (!this.m_GenericTmpFlag.ContainsKey(flag_name)) ? 0 : this.m_GenericTmpFlag[flag_name];
  590. }
  591. public bool ExistEditColorPresetData(int slotNo)
  592. {
  593. return this.m_dicEditColorPresetData.ContainsKey(slotNo);
  594. }
  595. public Dictionary<string, int> GetEditColorPresetData(int slotNo)
  596. {
  597. return this.ExistEditColorPresetData(slotNo) ? this.m_dicEditColorPresetData[slotNo] : null;
  598. }
  599. public void SetEditColorPresetData(int slotNo, Dictionary<string, int> setData)
  600. {
  601. if (this.ExistEditColorPresetData(slotNo))
  602. {
  603. this.m_dicEditColorPresetData.Remove(slotNo);
  604. }
  605. if (setData != null)
  606. {
  607. this.m_dicEditColorPresetData.Add(slotNo, setData);
  608. }
  609. }
  610. public void RemoveEditColorPresetData(int slotNo)
  611. {
  612. this.SetEditColorPresetData(slotNo, null);
  613. }
  614. public void ConfigSystemApply()
  615. {
  616. }
  617. public void ConfigScreenApply()
  618. {
  619. bool flag = false;
  620. if (this.ShadowQuality == CMSystem.ShadowQualityType.None)
  621. {
  622. if (QualitySettings.GetQualityLevel() != 2)
  623. {
  624. QualitySettings.SetQualityLevel(2);
  625. flag = true;
  626. }
  627. }
  628. else if (this.ShadowQuality == CMSystem.ShadowQualityType.Low)
  629. {
  630. if (QualitySettings.GetQualityLevel() != 3)
  631. {
  632. QualitySettings.SetQualityLevel(3);
  633. flag = true;
  634. }
  635. }
  636. else if (this.ShadowQuality == CMSystem.ShadowQualityType.Medium)
  637. {
  638. if (QualitySettings.GetQualityLevel() != 4)
  639. {
  640. QualitySettings.SetQualityLevel(4);
  641. flag = true;
  642. }
  643. }
  644. else if (this.ShadowQuality == CMSystem.ShadowQualityType.High && QualitySettings.GetQualityLevel() != 5)
  645. {
  646. QualitySettings.SetQualityLevel(5);
  647. flag = true;
  648. }
  649. if (!GameMain.Instance.VRMode || GameMain.Instance.VRDummyMode)
  650. {
  651. if (UnityEngine.Screen.width != this.m_siScreenSize.width || UnityEngine.Screen.height != this.m_siScreenSize.height || UnityEngine.Screen.fullScreen != this.FullScreen)
  652. {
  653. UnityEngine.Screen.SetResolution(this.m_siScreenSize.width, this.m_siScreenSize.height, this.FullScreen);
  654. flag = true;
  655. }
  656. if (QualitySettings.antiAliasing != this.m_nAntiAlias[(int)this.Antialias])
  657. {
  658. QualitySettings.antiAliasing = this.m_nAntiAlias[(int)this.Antialias];
  659. flag = true;
  660. }
  661. }
  662. else if (QualitySettings.antiAliasing != this.m_nAntiAlias[(int)this.Antialias])
  663. {
  664. QualitySettings.antiAliasing = this.m_nAntiAlias[(int)this.Antialias];
  665. flag = true;
  666. }
  667. if (this.TextureQuality == CMSystem.TextureQualityType.Low)
  668. {
  669. if (QualitySettings.anisotropicFiltering != AnisotropicFiltering.Disable)
  670. {
  671. QualitySettings.anisotropicFiltering = AnisotropicFiltering.Disable;
  672. flag = true;
  673. }
  674. }
  675. else if (this.TextureQuality == CMSystem.TextureQualityType.Medium)
  676. {
  677. if (QualitySettings.anisotropicFiltering != AnisotropicFiltering.Enable)
  678. {
  679. QualitySettings.anisotropicFiltering = AnisotropicFiltering.Enable;
  680. flag = true;
  681. }
  682. }
  683. else if (this.TextureQuality == CMSystem.TextureQualityType.High && QualitySettings.anisotropicFiltering != AnisotropicFiltering.ForceEnable)
  684. {
  685. QualitySettings.anisotropicFiltering = AnisotropicFiltering.ForceEnable;
  686. flag = true;
  687. }
  688. if (!GameMain.Instance.VRMode || GameMain.Instance.VRDummyMode)
  689. {
  690. if (this.VSync)
  691. {
  692. if (QualitySettings.vSyncCount != 60)
  693. {
  694. QualitySettings.vSyncCount = 60;
  695. }
  696. }
  697. else if (QualitySettings.vSyncCount != 0)
  698. {
  699. QualitySettings.vSyncCount = 0;
  700. }
  701. if (UnityEngine.Application.targetFrameRate != this.TargetFPS)
  702. {
  703. UnityEngine.Application.targetFrameRate = this.TargetFPS;
  704. }
  705. flag = true;
  706. }
  707. else
  708. {
  709. if (QualitySettings.vSyncCount != 0)
  710. {
  711. QualitySettings.vSyncCount = 0;
  712. flag = true;
  713. }
  714. if (UnityEngine.Application.targetFrameRate != -1)
  715. {
  716. UnityEngine.Application.targetFrameRate = -1;
  717. flag = true;
  718. }
  719. }
  720. if (GameMain.Instance != null && GameMain.Instance.FpsCounter != null)
  721. {
  722. GameMain.Instance.FpsCounter.gameObject.SetActive(this.ViewFps);
  723. }
  724. if (GameMain.Instance != null && GameMain.Instance.CharacterMgr != null)
  725. {
  726. GameMain.Instance.CharacterMgr.ManAlphaUpdate();
  727. }
  728. if (flag && GameMain.Instance != null)
  729. {
  730. GameMain.Instance.BroadcastMessage("OnChangeScreenSizeOrAA", SendMessageOptions.DontRequireReceiver);
  731. }
  732. }
  733. public bool SaveIni()
  734. {
  735. XElement xelement = new XElement("Config", new object[]
  736. {
  737. new XAttribute("Version", 1170),
  738. new XElement("System", new XElement("SysButtonShowAlways", this.SysButtonShowAlways)),
  739. new XElement("Screen", new object[]
  740. {
  741. new XElement("FullScreen", this.FullScreen),
  742. new XElement("ScreenSizeNow.width", this.GetScreenSizeNow().width),
  743. new XElement("ScreenSizeNow.height", this.GetScreenSizeNow().height),
  744. new XElement("Antialias", this.Antialias),
  745. new XElement("ShadowQuality", this.ShadowQuality),
  746. new XElement("TextureQuality", this.TextureQuality),
  747. new XElement("VSync", this.VSync),
  748. new XElement("TargetFPS", this.TargetFPS),
  749. new XElement("ViewFps", this.ViewFps),
  750. new XElement("Bloom", this.Bloom),
  751. new XElement("BloomValue", this.BloomValue),
  752. new XElement("ScreenShotSuperSize", this.ScreenShotSuperSize),
  753. new XElement("ManAlpha", this.ManAlpha)
  754. }),
  755. new XElement("Message", new object[]
  756. {
  757. new XElement("MsgWndAlpha", this.MsgWndAlpha),
  758. new XElement("MsgTextSpeed", this.MsgTextSpeed),
  759. new XElement("MsgAutoSpeed", this.MsgAutoSpeed),
  760. new XElement("MsgAlreadySkip", this.MsgAlreadySkip),
  761. new XElement("MsgVoiceNoStop", this.MsgVoiceNoStop),
  762. new XElement("SubtitleType", this.SubtitleType.ToString()),
  763. new XElement("EjaculationSeEnabled", this.EjaculationSeEnabled)
  764. }),
  765. new XElement("Other", new object[]
  766. {
  767. new XElement("FadeSpeed", this.FadeSpeed),
  768. new XElement("DesktopCaptureMonitorNo", this.DesktopCaptureMonitorNo),
  769. new XElement("EditItemGroup", this.EditItemGroup),
  770. new XElement("EditTouchJump", this.EditTouchJump),
  771. new XElement("VRCameraHeightStand", (int)(this.VRCameraHeightStand * 1000f)),
  772. new XElement("VRCameraHeightSit", (int)(this.VRCameraHeightSit * 1000f)),
  773. new XElement("VRCameraMoveSpeedKey", (int)(this.VRCameraMoveSpeedKey * 1000f)),
  774. new XElement("VRCameraRotSpeedKey", (int)(this.VRCameraRotSpeedKey * 1000f)),
  775. new XElement("VRCameraPlaneMove", this.VRCameraPlaneMove),
  776. new XElement("VRCameraRotSpeedMouse", (int)(this.VRCameraRotSpeedMouse * 1000f)),
  777. new XElement("VRManShow", this.VRManShow),
  778. new XElement("VRCameraFov", (int)(this.VRCameraFov * 1000f)),
  779. new XElement("VRCamRotDownUp", this.VRCamRotDownUp),
  780. new XElement("QuitWhenAssert", this.QuitWhenAssert)
  781. })
  782. });
  783. if (GameMain.Instance.VRMode && !GameMain.Instance.VRDummyMode)
  784. {
  785. XContainer xcontainer = xelement;
  786. XName name = "Ovr";
  787. object[] array = new object[21];
  788. array[0] = new XElement("OvrConfVer", this.m_nOvrConfVer);
  789. array[1] = new XElement("HeadScale", (int)(this.OvrHeadScale * 1000f));
  790. array[2] = new XElement("CursorBoostSpeed", (int)(this.OvrCursorBoostSpeed * 1000f));
  791. array[3] = new XElement("CursorStabilization", (int)(this.OvrCursorStabilization * 1000f));
  792. array[4] = new XElement("PointerMode", this.OvrPointerMode);
  793. array[5] = new XElement("OvrMoveMode", this.OvrMoveMode);
  794. array[6] = new XElement("CursorPadSpeed", (int)(this.OvrCursorPadSpeed * 1000f));
  795. array[7] = new XElement("OvrViveCursorLaserHitScale", (int)(this.OvrViveCursorLaserHitScale * 1000f));
  796. array[8] = new XElement("OvrViveCursorLaserEasing", (int)(this.OvrViveCursorLaserEasing * 1000f));
  797. array[9] = new XElement("OvrHandCameraWidth", this.OvrHandCameraWidth);
  798. array[10] = new XElement("OvrHandCameraHeight", this.OvrHandCameraHeight);
  799. array[11] = new XElement("OvrDDBG", from keyValue in this.OvrDDBG
  800. select new XElement(keyValue.Key, keyValue.Value.ToSaveString()));
  801. array[12] = new XElement("OvrHandCameraWidth", this.OvrHandCameraWidth);
  802. array[13] = new XElement("OvrScreenMirror", this.OvrScreenMirror);
  803. array[14] = new XElement("OvrCameraHeightType1", this.OvrCameraHeightType);
  804. array[15] = new XElement("OvrMouseRot", this.OvrMouseRot);
  805. array[16] = new XElement("OvrUITabletSize", (int)(this.OvrUITabletSize * 1000f));
  806. array[17] = new XElement("OvrUseTouch", this.OvrUseTouch);
  807. array[18] = new XElement("OvrUseNewControllerType2", this.OvrUseNewControllerType);
  808. array[19] = new XElement("OvrUseSnapRotate2", this.OvrUseSnapRotate);
  809. array[20] = new XElement("OvrUseSnapRotateRate", this.OvrUseSnapRotateRate);
  810. xcontainer.Add(new XElement(name, array));
  811. }
  812. string value = JsonUtility.ToJson(this.m_SConfig, true);
  813. xelement.Add(new XElement("SJConfig", value));
  814. GameMain.Instance.SoundMgr.SaveIni(xelement);
  815. XDocument xdocument = new XDocument(new XDeclaration("1.0", "utf-8", "true"), new object[]
  816. {
  817. new XComment("CM3D2 Config"),
  818. xelement
  819. });
  820. string text = Path.GetFullPath(".\\");
  821. if (!GameMain.Instance.VRMode || GameMain.Instance.VRDummyMode)
  822. {
  823. text += "config.xml";
  824. }
  825. else
  826. {
  827. text += "config_ovr.xml";
  828. }
  829. xdocument.Save(text);
  830. return true;
  831. }
  832. public bool LoadIni()
  833. {
  834. string text = Path.GetFullPath(".\\");
  835. if (!GameMain.Instance.VRMode || GameMain.Instance.VRDummyMode)
  836. {
  837. text += "config.xml";
  838. }
  839. else
  840. {
  841. text += "config_ovr.xml";
  842. }
  843. if (File.Exists(text))
  844. {
  845. try
  846. {
  847. XDocument xdocument = XDocument.Load(text);
  848. XElement xelement = xdocument.Element("Config");
  849. XElement xelm = xelement.Element("System");
  850. this.SysButtonShowAlways = bool.Parse(this.getElemetn(xelm, "SysButtonShowAlways", "true").Value);
  851. XElement xelm2 = xelement.Element("Screen");
  852. this.FullScreen = bool.Parse(this.getElemetn(xelm2, "FullScreen", "false").Value);
  853. this.m_siScreenSize.width = int.Parse(this.getElemetn(xelm2, "ScreenSizeNow.width", "1280").Value);
  854. this.m_siScreenSize.height = int.Parse(this.getElemetn(xelm2, "ScreenSizeNow.height", "720").Value);
  855. this.Antialias = (CMSystem.AntiAliasType)Enum.Parse(typeof(CMSystem.AntiAliasType), this.getElemetn(xelm2, "Antialias", CMSystem.AntiAliasType.X2.ToString()).Value);
  856. this.ShadowQuality = (CMSystem.ShadowQualityType)Enum.Parse(typeof(CMSystem.ShadowQualityType), this.getElemetn(xelm2, "ShadowQuality", CMSystem.ShadowQualityType.Medium.ToString()).Value);
  857. this.TextureQuality = (CMSystem.TextureQualityType)Enum.Parse(typeof(CMSystem.TextureQualityType), this.getElemetn(xelm2, "TextureQuality", CMSystem.TextureQualityType.High.ToString()).Value);
  858. this.VSync = bool.Parse(this.getElemetn(xelm2, "VSync", "false").Value);
  859. this.TargetFPS = int.Parse(this.getElemetn(xelm2, "TargetFPS", "60").Value);
  860. this.ViewFps = bool.Parse(this.getElemetn(xelm2, "ViewFps", "false").Value);
  861. this.Bloom = bool.Parse(this.getElemetn(xelm2, "Bloom", "true").Value);
  862. this.BloomValue = int.Parse(this.getElemetn(xelm2, "BloomValue", "100").Value);
  863. this.ScreenShotSuperSize = (CMSystem.SSSuperSizeType)Enum.Parse(typeof(CMSystem.SSSuperSizeType), this.getElemetn(xelm2, "ScreenShotSuperSize", CMSystem.SSSuperSizeType.X1.ToString()).Value);
  864. this.ManAlpha = int.Parse(this.getElemetn(xelm2, "ManAlpha", "50").Value);
  865. XElement xelm3 = xelement.Element("Message");
  866. this.MsgWndAlpha = int.Parse(this.getElemetn(xelm3, "MsgWndAlpha", "0").Value);
  867. this.MsgTextSpeed = int.Parse(this.getElemetn(xelm3, "MsgTextSpeed", "80").Value);
  868. this.MsgAutoSpeed = int.Parse(this.getElemetn(xelm3, "MsgAutoSpeed", "50").Value);
  869. this.MsgAlreadySkip = bool.Parse(this.getElemetn(xelm3, "MsgAlreadySkip", "true").Value);
  870. this.MsgVoiceNoStop = bool.Parse(this.getElemetn(xelm3, "MsgVoiceNoStop", "true").Value);
  871. try
  872. {
  873. this.SubtitleType = (SubtitleDisplayManager.DisplayType)Enum.Parse(typeof(SubtitleDisplayManager.DisplayType), this.getElemetn(xelm3, "SubtitleType", SubtitleDisplayManager.DisplayType.OriginalAndSubtitle.ToString()).Value);
  874. }
  875. catch (Exception)
  876. {
  877. this.SubtitleType = SubtitleDisplayManager.DisplayType.None;
  878. }
  879. this.EjaculationSeEnabled = bool.Parse(this.getElemetn(xelm3, "EjaculationSeEnabled", "true").Value);
  880. XElement xelement2 = xelement.Element("Other");
  881. if (xelement2 != null)
  882. {
  883. this.FadeSpeed = int.Parse(this.getElemetn(xelement2, "FadeSpeed", "100").Value);
  884. this.DesktopCaptureMonitorNo = int.Parse(this.getElemetn(xelement2, "DesktopCaptureMonitorNo", "1").Value);
  885. this.EditItemGroup = bool.Parse(this.getElemetn(xelement2, "EditItemGroup", "True").Value);
  886. this.EditTouchJump = bool.Parse(this.getElemetn(xelement2, "EditTouchJump", "False").Value);
  887. this.VRCameraHeightStand = (float)int.Parse(this.getElemetn(xelement2, "VRCameraHeightStand", (this.VRCameraHeightStand * 1000f).ToString()).Value) / 1000f;
  888. this.VRCameraHeightSit = (float)int.Parse(this.getElemetn(xelement2, "VRCameraHeightSit", (this.VRCameraHeightSit * 1000f).ToString()).Value) / 1000f;
  889. this.VRCameraMoveSpeedKey = (float)int.Parse(this.getElemetn(xelement2, "VRCameraMoveSpeedKey", (this.VRCameraMoveSpeedKey * 1000f).ToString()).Value) / 1000f;
  890. this.VRCameraRotSpeedKey = (float)int.Parse(this.getElemetn(xelement2, "VRCameraRotSpeedKey", (this.VRCameraRotSpeedKey * 1000f).ToString()).Value) / 1000f;
  891. this.VRCameraPlaneMove = bool.Parse(this.getElemetn(xelement2, "VRCameraPlaneMove", this.VRCameraPlaneMove.ToString()).Value);
  892. this.VRCameraRotSpeedMouse = (float)int.Parse(this.getElemetn(xelement2, "VRCameraRotSpeedMouse", (this.VRCameraRotSpeedMouse * 1000f).ToString()).Value) / 1000f;
  893. this.VRManShow = bool.Parse(this.getElemetn(xelement2, "VRManShow", this.VRManShow.ToString()).Value);
  894. this.VRCameraFov = (float)int.Parse(this.getElemetn(xelement2, "VRCameraFov", (this.VRCameraFov * 1000f).ToString()).Value) / 1000f;
  895. this.VRCamRotDownUp = bool.Parse(this.getElemetn(xelement2, "VRCamRotDownUp", this.VRCamRotDownUp.ToString()).Value);
  896. this.QuitWhenAssert = bool.Parse(this.getElemetn(xelement2, "QuitWhenAssert", this.QuitWhenAssert.ToString()).Value);
  897. }
  898. if (GameMain.Instance.VRMode && !GameMain.Instance.VRDummyMode)
  899. {
  900. XElement xelement3 = xelement.Element("Ovr");
  901. if (xelement3 != null)
  902. {
  903. int num = 0;
  904. XElement xelement4 = xelement3.Element("OvrConfVer");
  905. if (xelement4 != null)
  906. {
  907. num = int.Parse(xelement4.Value);
  908. }
  909. xelement4 = xelement3.Element("HeadScale");
  910. if (xelement4 != null)
  911. {
  912. this.OvrHeadScale = (float)int.Parse(xelement4.Value) / 1000f;
  913. }
  914. xelement4 = xelement3.Element("CursorBoostSpeed");
  915. if (xelement4 != null)
  916. {
  917. this.OvrCursorBoostSpeed = (float)int.Parse(xelement4.Value) / 1000f;
  918. }
  919. xelement4 = xelement3.Element("CursorStabilization");
  920. if (xelement4 != null)
  921. {
  922. this.OvrCursorStabilization = (float)int.Parse(xelement4.Value) / 1000f;
  923. }
  924. xelement4 = xelement3.Element("PointerMode");
  925. if (xelement4 != null)
  926. {
  927. this.OvrPointerMode = int.Parse(xelement4.Value);
  928. }
  929. xelement4 = xelement3.Element("OvrMoveMode");
  930. if (xelement4 != null)
  931. {
  932. this.OvrMoveMode = int.Parse(xelement4.Value);
  933. }
  934. xelement4 = xelement3.Element("CursorPadSpeed");
  935. if (xelement4 != null)
  936. {
  937. this.OvrCursorPadSpeed = (float)int.Parse(xelement4.Value) / 1000f;
  938. }
  939. xelement4 = xelement3.Element("OvrViveCursorLaserHitScale");
  940. if (xelement4 != null)
  941. {
  942. this.OvrViveCursorLaserHitScale = (float)int.Parse(xelement4.Value) / 1000f;
  943. }
  944. xelement4 = xelement3.Element("OvrViveCursorLaserEasing");
  945. if (xelement4 != null)
  946. {
  947. this.OvrViveCursorLaserEasing = (float)int.Parse(xelement4.Value) / 1000f;
  948. }
  949. xelement4 = xelement3.Element("OvrHandCameraWidth");
  950. if (xelement4 != null)
  951. {
  952. this.OvrHandCameraWidth = int.Parse(xelement4.Value);
  953. }
  954. xelement4 = xelement3.Element("OvrHandCameraHeight");
  955. if (xelement4 != null)
  956. {
  957. this.OvrHandCameraHeight = int.Parse(xelement4.Value);
  958. }
  959. xelement4 = xelement3.Element("OvrDDBG");
  960. if (xelement4 != null)
  961. {
  962. this.OvrDDBG.Clear();
  963. foreach (XElement xelement5 in xelement4.Elements())
  964. {
  965. this.OvrDDBG.Add(xelement5.Name.LocalName, new CMSystem.TransDD(xelement5.Value, num));
  966. }
  967. }
  968. xelement4 = xelement3.Element("OvrScreenMirror");
  969. if (xelement4 != null)
  970. {
  971. this.OvrScreenMirror = bool.Parse(xelement4.Value);
  972. }
  973. xelement4 = xelement3.Element("OvrCameraHeightType1");
  974. if (xelement4 != null)
  975. {
  976. this.OvrCameraHeightType = (CMSystem.OVR_CAM_HEIGHT_TYPE)Enum.Parse(typeof(CMSystem.OVR_CAM_HEIGHT_TYPE), xelement4.Value);
  977. }
  978. xelement4 = xelement3.Element("OvrMouseRot");
  979. if (xelement4 != null)
  980. {
  981. this.OvrMouseRot = bool.Parse(xelement4.Value);
  982. }
  983. xelement4 = xelement3.Element("OvrUITabletSize");
  984. if (xelement4 != null)
  985. {
  986. this.OvrUITabletSize = (float)int.Parse(xelement4.Value) / 1000f;
  987. }
  988. xelement4 = xelement3.Element("OvrUseTouch");
  989. if (xelement4 != null)
  990. {
  991. this.OvrUseTouch = bool.Parse(xelement4.Value);
  992. }
  993. xelement4 = xelement3.Element("OvrUseNewControllerType2");
  994. if (xelement4 != null)
  995. {
  996. this.OvrUseNewControllerType = bool.Parse(xelement4.Value);
  997. }
  998. xelement4 = xelement3.Element("OvrUseSnapRotate2");
  999. if (xelement4 != null)
  1000. {
  1001. this.OvrUseSnapRotate = bool.Parse(xelement4.Value);
  1002. }
  1003. xelement4 = xelement3.Element("OvrUseSnapRotateRate");
  1004. if (xelement4 != null)
  1005. {
  1006. this.OvrUseSnapRotateRate = int.Parse(xelement4.Value);
  1007. }
  1008. if (num < 1430)
  1009. {
  1010. this.OvrPointerMode = 0;
  1011. this.OvrCursorPadSpeed *= 1000f;
  1012. }
  1013. }
  1014. }
  1015. XElement xelement6 = xelement.Element("SJConfig");
  1016. if (xelement6 != null)
  1017. {
  1018. this.m_SConfig = JsonUtility.FromJson<CMSystem.SerializeConfig>(xelement6.Value);
  1019. }
  1020. GameMain.Instance.SoundMgr.LoadIni(xelement);
  1021. Debug.Log("コンフィグ内容 " + xdocument.ToString(SaveOptions.DisableFormatting));
  1022. }
  1023. catch (Exception ex)
  1024. {
  1025. Debug.LogError("コンフィグが読み込めませんでした。" + ex.Message);
  1026. }
  1027. }
  1028. else
  1029. {
  1030. Debug.Log("コンフィグファイル " + text + " はありません。(初回起動)");
  1031. }
  1032. this.ConfigSystemApply();
  1033. this.ConfigScreenApply();
  1034. GameMain.Instance.SoundMgr.Apply();
  1035. return true;
  1036. }
  1037. private XElement getElemetn(XElement xelm, string name, string def)
  1038. {
  1039. xelm = xelm.Element(name);
  1040. if (xelm == null)
  1041. {
  1042. xelm = new XElement(name, def);
  1043. }
  1044. return xelm;
  1045. }
  1046. public void SaveSystem()
  1047. {
  1048. MemoryStream memoryStream = new MemoryStream();
  1049. BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
  1050. binaryWriter.Write("CM3D2_SYSTEM2");
  1051. binaryWriter.Write(1170);
  1052. binaryWriter.Write(this.m_dicEditColorPresetData.Count);
  1053. foreach (KeyValuePair<int, Dictionary<string, int>> keyValuePair in this.m_dicEditColorPresetData)
  1054. {
  1055. binaryWriter.Write(keyValuePair.Key);
  1056. binaryWriter.Write(keyValuePair.Value.Count);
  1057. foreach (KeyValuePair<string, int> keyValuePair2 in keyValuePair.Value)
  1058. {
  1059. binaryWriter.Write(keyValuePair2.Key);
  1060. binaryWriter.Write(keyValuePair2.Value);
  1061. }
  1062. }
  1063. binaryWriter.Write(this.m_SystemVers.Count);
  1064. foreach (KeyValuePair<string, string> keyValuePair3 in this.m_SystemVers)
  1065. {
  1066. binaryWriter.Write(keyValuePair3.Key);
  1067. binaryWriter.Write(keyValuePair3.Value);
  1068. }
  1069. File.WriteAllBytes(Path.GetFullPath(".\\") + "system.dat", memoryStream.ToArray());
  1070. memoryStream.Dispose();
  1071. memoryStream = null;
  1072. }
  1073. public bool LoadSystem()
  1074. {
  1075. string path = Path.GetFullPath(".\\") + "system.dat";
  1076. if (File.Exists(path))
  1077. {
  1078. try
  1079. {
  1080. this.m_dicEditColorPresetData.Clear();
  1081. this.m_SystemVers.Clear();
  1082. using (FileStream fileStream = new FileStream(Path.GetFullPath(".\\") + "system.dat", FileMode.Open))
  1083. {
  1084. BinaryReader binaryReader = new BinaryReader(fileStream);
  1085. string a = binaryReader.ReadString();
  1086. if (a == "CM3D2_SYSTEM")
  1087. {
  1088. return true;
  1089. }
  1090. NDebug.Assert(a == "CM3D2_SYSTEM2", "システムファイルのヘッダーが不正です。");
  1091. int num = binaryReader.ReadInt32();
  1092. int num2 = binaryReader.ReadInt32();
  1093. for (int i = 0; i < num2; i++)
  1094. {
  1095. int key = binaryReader.ReadInt32();
  1096. int num3 = binaryReader.ReadInt32();
  1097. Dictionary<string, int> dictionary = new Dictionary<string, int>();
  1098. for (int j = 0; j < num3; j++)
  1099. {
  1100. string key2 = binaryReader.ReadString();
  1101. int value = binaryReader.ReadInt32();
  1102. dictionary.Add(key2, value);
  1103. }
  1104. this.m_dicEditColorPresetData.Add(key, dictionary);
  1105. }
  1106. int num4 = binaryReader.ReadInt32();
  1107. for (int k = 0; k < num4; k++)
  1108. {
  1109. this.SetSystemVers(binaryReader.ReadString(), binaryReader.ReadString());
  1110. }
  1111. }
  1112. }
  1113. catch (Exception ex)
  1114. {
  1115. Debug.LogError("system.datの読み込みに失敗しました\n" + ex.Message);
  1116. }
  1117. return true;
  1118. }
  1119. return true;
  1120. }
  1121. private void LoadLauncherCfg()
  1122. {
  1123. string path = Path.GetFullPath(".\\") + "update.cfg";
  1124. if (File.Exists(path))
  1125. {
  1126. using (StreamReader streamReader = new StreamReader(path))
  1127. {
  1128. while (!streamReader.EndOfStream)
  1129. {
  1130. string text = streamReader.ReadLine();
  1131. Console.WriteLine("{0}", text);
  1132. string[] array = text.Split(new char[]
  1133. {
  1134. '='
  1135. });
  1136. if (array != null && array.Length == 2)
  1137. {
  1138. string a = array[0];
  1139. string text2 = array[1];
  1140. if (a == "m_bUseNet")
  1141. {
  1142. if (text2 == "1")
  1143. {
  1144. this.NetUse = true;
  1145. }
  1146. else
  1147. {
  1148. this.NetUse = false;
  1149. }
  1150. }
  1151. else if (a == "m_strCM3D2Path")
  1152. {
  1153. text2 = text2.Replace("/", "\\");
  1154. if (!string.IsNullOrEmpty(text2))
  1155. {
  1156. if (!File.Exists(text2 + "\\CM3D2.exe"))
  1157. {
  1158. NDebug.Assert("2.0互換パス " + text2 + " には CM3D2.exe が無く、互換モードは無効です。", true);
  1159. text2 = string.Empty;
  1160. }
  1161. else if (!File.Exists(text2 + "\\GameData\\csv.arc"))
  1162. {
  1163. NDebug.Assert("2.0互換パス " + text2 + " には csv.arc が無く、互換モードは無効です。", true);
  1164. text2 = string.Empty;
  1165. }
  1166. else if (!File.Exists(text2 + "\\GameData\\script.arc"))
  1167. {
  1168. NDebug.Assert("2.0互換パス " + text2 + " には script.arc が無く、互換モードは無効です。", true);
  1169. text2 = string.Empty;
  1170. }
  1171. }
  1172. this.CM3D2Path = text2;
  1173. }
  1174. }
  1175. }
  1176. }
  1177. }
  1178. }
  1179. private Dictionary<int, Dictionary<string, int>> m_dicEditColorPresetData = new Dictionary<int, Dictionary<string, int>>();
  1180. [XmlIgnore]
  1181. public Dictionary<string, int> m_GenericTmpFlag = new Dictionary<string, int>();
  1182. public Dictionary<string, string> m_SystemVers = new Dictionary<string, string>();
  1183. private int[] m_nAntiAlias = new int[]
  1184. {
  1185. 0,
  1186. 2,
  1187. 4,
  1188. 8
  1189. };
  1190. private Size<int> m_siScreenSize = new Size<int>
  1191. {
  1192. width = 1280,
  1193. height = 720
  1194. };
  1195. private CMSystem.SSSuperSizeType m_eScreenShotSuperSize;
  1196. private int m_nManAlpha = 50;
  1197. private int m_nBloomValue = 100;
  1198. private int m_nMsgWndAlpha;
  1199. private int m_nMsgTextSpeed = 80;
  1200. private int m_nMsgAutoSpeed = 50;
  1201. private int m_nFadeSpeed = 100;
  1202. private SubtitleDisplayManager.DisplayType m_SubtitleType;
  1203. private int m_nDesktopCaptureMonitorNo = 1;
  1204. private bool m_bEditItemGroup = true;
  1205. private bool m_bEditTouchJump;
  1206. private float m_fVRCameraHeightStand = 1.6f;
  1207. private float m_fVRCameraHeightSit = 0.8f;
  1208. private float m_fVRCameraMoveSpeedKey = 0.5f;
  1209. private float m_fVRCameraRotSpeedKey = 0.5f;
  1210. private bool m_bVRCameraPlaneMove;
  1211. private float m_fVRCameraRotSpeedMouse = 0.5f;
  1212. private bool m_bVRManShow = true;
  1213. private float m_fVRCameraFov = 60f;
  1214. private bool m_bVRCamRotDownUp;
  1215. private int m_nOvrConfVer = 1470;
  1216. private float m_fOvrHeadScale = 1f;
  1217. private float m_fOvrCursorStabilization = 0.05f;
  1218. private float m_fOvrCursorBoostSpeed = 0.2f;
  1219. private int m_nOvrPointerMode;
  1220. private int m_nOvrMoveMode;
  1221. private float m_fOvrCursorPadSpeed = 130f;
  1222. private float m_fOvrViveCursorLaserHitScale = 9f;
  1223. private float m_fOvrViveCursorLaserEasing = 0.3f;
  1224. private int m_nOvrHandCameraWidth = 720;
  1225. private int m_nOvrHandCameraHeight = 1280;
  1226. private Dictionary<string, CMSystem.TransDD> m_dicVRDDBG = new Dictionary<string, CMSystem.TransDD>();
  1227. private bool m_bOvrScreenMirror = true;
  1228. private CMSystem.OVR_CAM_HEIGHT_TYPE m_eOvrCameraHeightType = CMSystem.OVR_CAM_HEIGHT_TYPE.VR;
  1229. private bool m_bOvrMouseRot = true;
  1230. private float m_fOvrUITabletSize = 1f;
  1231. private bool m_bOvrUseTouch = true;
  1232. private bool m_bUseNewControllerType = true;
  1233. private bool m_bOvrUseSnapRotate = true;
  1234. private int m_nOvrUseSnapRotateRate = 30;
  1235. private readonly List<Size<int>> m_listScreenDefSize = new List<Size<int>>
  1236. {
  1237. new Size<int>
  1238. {
  1239. width = 1024,
  1240. height = 576
  1241. },
  1242. new Size<int>
  1243. {
  1244. width = 1280,
  1245. height = 720
  1246. },
  1247. new Size<int>
  1248. {
  1249. width = 1366,
  1250. height = 768
  1251. },
  1252. new Size<int>
  1253. {
  1254. width = 1920,
  1255. height = 1080
  1256. }
  1257. };
  1258. private CMSystem.SerializeConfig m_SConfig = new CMSystem.SerializeConfig();
  1259. public enum SSSuperSizeType
  1260. {
  1261. X1,
  1262. X2,
  1263. X4,
  1264. MAX
  1265. }
  1266. public enum AntiAliasType
  1267. {
  1268. None,
  1269. X2,
  1270. X4,
  1271. X8,
  1272. MAX
  1273. }
  1274. public enum ShadowQualityType
  1275. {
  1276. None,
  1277. Low,
  1278. Medium,
  1279. High
  1280. }
  1281. public enum TextureQualityType
  1282. {
  1283. Low,
  1284. Medium,
  1285. High
  1286. }
  1287. public class TransDD
  1288. {
  1289. public TransDD()
  1290. {
  1291. }
  1292. public TransDD(string strSaveString, int f_nOvrConfVer)
  1293. {
  1294. this.FromSaveString(strSaveString, f_nOvrConfVer);
  1295. }
  1296. public string ToSaveString()
  1297. {
  1298. string text = string.Concat(new string[]
  1299. {
  1300. this.m_vPos.x.ToString(),
  1301. ":",
  1302. this.m_vPos.y.ToString(),
  1303. ":",
  1304. this.m_vPos.z.ToString()
  1305. });
  1306. string text2 = text;
  1307. text = string.Concat(new string[]
  1308. {
  1309. text2,
  1310. ":",
  1311. this.m_qRot.x.ToString(),
  1312. ":",
  1313. this.m_qRot.y.ToString(),
  1314. ":",
  1315. this.m_qRot.z.ToString(),
  1316. ":",
  1317. this.m_qRot.w.ToString()
  1318. });
  1319. text2 = text;
  1320. return string.Concat(new string[]
  1321. {
  1322. text2,
  1323. ":",
  1324. this.m_vScale.x.ToString(),
  1325. ":",
  1326. this.m_vScale.y.ToString(),
  1327. ":",
  1328. this.m_vScale.z.ToString(),
  1329. ":",
  1330. this.m_bShow.ToString()
  1331. });
  1332. }
  1333. public void FromSaveString(string f_strString, int f_nOvrConfVer)
  1334. {
  1335. string[] array = f_strString.Split(new char[]
  1336. {
  1337. ':'
  1338. });
  1339. try
  1340. {
  1341. this.m_vPos.x = float.Parse(array[0]);
  1342. this.m_vPos.y = float.Parse(array[1]);
  1343. this.m_vPos.z = float.Parse(array[2]);
  1344. this.m_qRot.x = float.Parse(array[3]);
  1345. this.m_qRot.y = float.Parse(array[4]);
  1346. this.m_qRot.z = float.Parse(array[5]);
  1347. this.m_qRot.w = float.Parse(array[6]);
  1348. this.m_vScale.x = float.Parse(array[7]);
  1349. this.m_vScale.y = float.Parse(array[8]);
  1350. this.m_vScale.z = float.Parse(array[9]);
  1351. if (f_nOvrConfVer >= 1470)
  1352. {
  1353. this.m_bShow = bool.Parse(array[10]);
  1354. }
  1355. }
  1356. catch (Exception ex)
  1357. {
  1358. Debug.LogError(ex.Message);
  1359. }
  1360. }
  1361. public Vector3 m_vPos;
  1362. public Quaternion m_qRot;
  1363. public Vector3 m_vScale;
  1364. public bool m_bShow;
  1365. }
  1366. public enum OVR_CAM_HEIGHT_TYPE
  1367. {
  1368. REAL,
  1369. VR
  1370. }
  1371. [Serializable]
  1372. public class SerializeConfig : ISerializationCallbackReceiver
  1373. {
  1374. public int Version
  1375. {
  1376. get
  1377. {
  1378. return this.m_nVersion;
  1379. }
  1380. set
  1381. {
  1382. this.m_nVersion = value;
  1383. }
  1384. }
  1385. public string DShowFilter
  1386. {
  1387. get
  1388. {
  1389. return this.m_strDShowFilter;
  1390. }
  1391. }
  1392. public CMSystem.SerializeConfig.OVR_MOVE_TYPE OvrMoveType
  1393. {
  1394. get
  1395. {
  1396. return this.m_eOvrMoveType;
  1397. }
  1398. set
  1399. {
  1400. this.m_eOvrMoveType = value;
  1401. }
  1402. }
  1403. public float OvrMoveDirSpeed
  1404. {
  1405. get
  1406. {
  1407. return this.m_fOvrMoveDirSpeed;
  1408. }
  1409. }
  1410. public bool OvrViveSmoothRotatePadAreaUse
  1411. {
  1412. get
  1413. {
  1414. return this.m_bOvrViveSmoothRotateAreaUse;
  1415. }
  1416. set
  1417. {
  1418. this.m_bOvrViveSmoothRotateAreaUse = value;
  1419. }
  1420. }
  1421. public float OvrViveSmoothRotatePadAriaRate
  1422. {
  1423. get
  1424. {
  1425. return this.m_fOvrViveSmoothUpDownPadAriaRate = this.m_fOvrViveSmoothRotatePadAriaRate;
  1426. }
  1427. set
  1428. {
  1429. this.m_fOvrViveSmoothUpDownPadAriaRate = (this.m_fOvrViveSmoothRotatePadAriaRate = Mathf.Clamp(value, 10f, 80f));
  1430. }
  1431. }
  1432. public bool OvrViveSmoothupDownPadAreaUse
  1433. {
  1434. get
  1435. {
  1436. return this.m_bOvrViveSmoothupDownPadAreaUse;
  1437. }
  1438. set
  1439. {
  1440. this.m_bOvrViveSmoothupDownPadAreaUse = value;
  1441. }
  1442. }
  1443. public float OvrViveSmoothUpDownPadAriaRate
  1444. {
  1445. get
  1446. {
  1447. return this.OvrViveSmoothRotatePadAriaRate;
  1448. }
  1449. set
  1450. {
  1451. this.OvrViveSmoothRotatePadAriaRate = Mathf.Clamp(value, 10f, 80f);
  1452. }
  1453. }
  1454. public bool OvrIkAllSceneEnable
  1455. {
  1456. get
  1457. {
  1458. return this.m_bOvrIkAllSceneEnable;
  1459. }
  1460. set
  1461. {
  1462. this.m_bOvrIkAllSceneEnable = value;
  1463. }
  1464. }
  1465. public bool OvrRiftGripStickRotate
  1466. {
  1467. get
  1468. {
  1469. return this.m_bOvrRiftGripStickRotate;
  1470. }
  1471. set
  1472. {
  1473. this.m_bOvrRiftGripStickRotate = value;
  1474. }
  1475. }
  1476. public bool OvrRiftTriggerStickUpDown
  1477. {
  1478. get
  1479. {
  1480. return this.m_bOvrRiftTriggerStickUpDown;
  1481. }
  1482. set
  1483. {
  1484. this.m_bOvrRiftTriggerStickUpDown = value;
  1485. }
  1486. }
  1487. public float OvrIkSelfCamFovMin
  1488. {
  1489. get
  1490. {
  1491. return this.m_bOvrIkSelfCamFovMin;
  1492. }
  1493. set
  1494. {
  1495. this.m_bOvrIkSelfCamFovMin = value;
  1496. }
  1497. }
  1498. public float OvrIkSelfCamFovMax
  1499. {
  1500. get
  1501. {
  1502. return this.m_bOvrIkSelfCamFovMax;
  1503. }
  1504. set
  1505. {
  1506. this.m_bOvrIkSelfCamFovMax = value;
  1507. }
  1508. }
  1509. public bool OvrDDTouchToClick
  1510. {
  1511. get
  1512. {
  1513. return this.m_bOvrDesktopScreenTouchToClick;
  1514. }
  1515. set
  1516. {
  1517. this.m_bOvrDesktopScreenTouchToClick = value;
  1518. }
  1519. }
  1520. public bool OvrDDtoBG
  1521. {
  1522. get
  1523. {
  1524. return this.m_bOvrDesktopScreenPosSaveToBG;
  1525. }
  1526. set
  1527. {
  1528. this.m_bOvrDesktopScreenPosSaveToBG = value;
  1529. }
  1530. }
  1531. public bool OvrTabletFrameHideWhenMsgWndVisible
  1532. {
  1533. get
  1534. {
  1535. return this.m_bOvrTabletFrameHideWhenMsgWndVisible;
  1536. }
  1537. set
  1538. {
  1539. this.m_bOvrTabletFrameHideWhenMsgWndVisible = value;
  1540. }
  1541. }
  1542. public void OnBeforeSerialize()
  1543. {
  1544. this.m_nVersion = 1170;
  1545. }
  1546. public void OnAfterDeserialize()
  1547. {
  1548. }
  1549. [SerializeField]
  1550. private int m_nVersion = 1170;
  1551. [SerializeField]
  1552. private string m_strDShowFilter = "Microsoft DTV-DVD Video Decoder";
  1553. [SerializeField]
  1554. private CMSystem.SerializeConfig.OVR_MOVE_TYPE m_eOvrMoveType;
  1555. [SerializeField]
  1556. private float m_fOvrMoveDirSpeed = 5f;
  1557. [SerializeField]
  1558. private bool m_bOvrViveSmoothRotateAreaUse = true;
  1559. [SerializeField]
  1560. private float m_fOvrViveSmoothRotatePadAriaRate = 30f;
  1561. [SerializeField]
  1562. private bool m_bOvrViveSmoothupDownPadAreaUse = true;
  1563. [SerializeField]
  1564. private float m_fOvrViveSmoothUpDownPadAriaRate = 30f;
  1565. [SerializeField]
  1566. private bool m_bOvrIkAllSceneEnable;
  1567. [SerializeField]
  1568. private bool m_bOvrRiftGripStickRotate = true;
  1569. [SerializeField]
  1570. private bool m_bOvrRiftTriggerStickUpDown = true;
  1571. [SerializeField]
  1572. private float m_bOvrIkSelfCamFovMin = 20f;
  1573. [SerializeField]
  1574. private float m_bOvrIkSelfCamFovMax = 80f;
  1575. [SerializeField]
  1576. private bool m_bOvrDesktopScreenTouchToClick = true;
  1577. [SerializeField]
  1578. private bool m_bOvrDesktopScreenPosSaveToBG;
  1579. [SerializeField]
  1580. private bool m_bOvrTabletFrameHideWhenMsgWndVisible = true;
  1581. public enum OVR_MOVE_TYPE
  1582. {
  1583. WARP_DRAW_STEPROT,
  1584. DIRECTION
  1585. }
  1586. }
  1587. }