CMSystem.cs 40 KB

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