CMSystem.cs 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813
  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 = SubtitleDisplayManager.DisplayType.None;
  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", 1240),
  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(1240);
  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 bool OvrHandHitToHair
  1543. {
  1544. get
  1545. {
  1546. return this.m_bOvrHandHitToHair;
  1547. }
  1548. set
  1549. {
  1550. this.m_bOvrHandHitToHair = value;
  1551. }
  1552. }
  1553. public CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT OvrHandHitToSkirt
  1554. {
  1555. get
  1556. {
  1557. return this.m_eOvrHandHitToSkirt;
  1558. }
  1559. set
  1560. {
  1561. this.m_eOvrHandHitToSkirt = value;
  1562. }
  1563. }
  1564. public CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT OvrHandHitToSkirtVAS
  1565. {
  1566. get
  1567. {
  1568. return this.m_eOvrHandHitToSkirtVAS;
  1569. }
  1570. set
  1571. {
  1572. this.m_eOvrHandHitToSkirtVAS = value;
  1573. }
  1574. }
  1575. public void OnBeforeSerialize()
  1576. {
  1577. this.m_nVersion = 1240;
  1578. }
  1579. public void OnAfterDeserialize()
  1580. {
  1581. }
  1582. [SerializeField]
  1583. private int m_nVersion = 1240;
  1584. [SerializeField]
  1585. private string m_strDShowFilter = "Microsoft DTV-DVD Video Decoder";
  1586. [SerializeField]
  1587. private CMSystem.SerializeConfig.OVR_MOVE_TYPE m_eOvrMoveType;
  1588. [SerializeField]
  1589. private float m_fOvrMoveDirSpeed = 5f;
  1590. [SerializeField]
  1591. private bool m_bOvrViveSmoothRotateAreaUse = true;
  1592. [SerializeField]
  1593. private float m_fOvrViveSmoothRotatePadAriaRate = 30f;
  1594. [SerializeField]
  1595. private bool m_bOvrViveSmoothupDownPadAreaUse = true;
  1596. [SerializeField]
  1597. private float m_fOvrViveSmoothUpDownPadAriaRate = 30f;
  1598. [SerializeField]
  1599. private bool m_bOvrIkAllSceneEnable;
  1600. [SerializeField]
  1601. private bool m_bOvrRiftGripStickRotate = true;
  1602. [SerializeField]
  1603. private bool m_bOvrRiftTriggerStickUpDown = true;
  1604. [SerializeField]
  1605. private float m_bOvrIkSelfCamFovMin = 20f;
  1606. [SerializeField]
  1607. private float m_bOvrIkSelfCamFovMax = 80f;
  1608. [SerializeField]
  1609. private bool m_bOvrDesktopScreenTouchToClick = true;
  1610. [SerializeField]
  1611. private bool m_bOvrDesktopScreenPosSaveToBG;
  1612. [SerializeField]
  1613. private bool m_bOvrTabletFrameHideWhenMsgWndVisible = true;
  1614. [SerializeField]
  1615. private bool m_bOvrHandHitToHair = true;
  1616. [SerializeField]
  1617. private CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT m_eOvrHandHitToSkirt = CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT.ON;
  1618. [SerializeField]
  1619. private CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT m_eOvrHandHitToSkirtVAS = CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT.GRAB;
  1620. public enum OVR_MOVE_TYPE
  1621. {
  1622. WARP_DRAW_STEPROT,
  1623. DIRECTION
  1624. }
  1625. public enum OVR_HAND_TO_SKIRT
  1626. {
  1627. OFF,
  1628. GRAB,
  1629. ON
  1630. }
  1631. }
  1632. }