CMSystem.cs 45 KB

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