CMSystem.cs 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014
  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", 1480),
  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 = GameMain.Instance.SerializeStorageManager.StoreDirectoryPath;
  880. if (!GameMain.Instance.VRMode || GameMain.Instance.VRDummyMode)
  881. {
  882. text = Path.Combine(text, "config.xml");
  883. }
  884. else
  885. {
  886. text = Path.Combine(text, "config_ovr.xml");
  887. }
  888. xdocument.Save(text);
  889. return true;
  890. }
  891. public bool LoadIni()
  892. {
  893. string text = GameMain.Instance.SerializeStorageManager.StoreDirectoryPath;
  894. if (!GameMain.Instance.VRMode || GameMain.Instance.VRDummyMode)
  895. {
  896. text = Path.Combine(text, "config.xml");
  897. }
  898. else
  899. {
  900. text = Path.Combine(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. NInput.InputUseLegacyAxisMode = GameMain.Instance.CMSystem.SConfig.InputUseLegacyAxisMode;
  1112. return true;
  1113. }
  1114. private XElement getElemetn(XElement xelm, string name, string def)
  1115. {
  1116. xelm = xelm.Element(name);
  1117. if (xelm == null)
  1118. {
  1119. xelm = new XElement(name, def);
  1120. }
  1121. return xelm;
  1122. }
  1123. public void SaveSystem()
  1124. {
  1125. MemoryStream memoryStream = new MemoryStream();
  1126. BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
  1127. binaryWriter.Write("CM3D2_SYSTEM2");
  1128. binaryWriter.Write(1480);
  1129. binaryWriter.Write(this.m_dicEditColorPresetData.Count);
  1130. foreach (KeyValuePair<int, Dictionary<string, int>> keyValuePair in this.m_dicEditColorPresetData)
  1131. {
  1132. binaryWriter.Write(keyValuePair.Key);
  1133. binaryWriter.Write(keyValuePair.Value.Count);
  1134. foreach (KeyValuePair<string, int> keyValuePair2 in keyValuePair.Value)
  1135. {
  1136. binaryWriter.Write(keyValuePair2.Key);
  1137. binaryWriter.Write(keyValuePair2.Value);
  1138. }
  1139. }
  1140. binaryWriter.Write(this.m_SystemVers.Count);
  1141. foreach (KeyValuePair<string, string> keyValuePair3 in this.m_SystemVers)
  1142. {
  1143. binaryWriter.Write(keyValuePair3.Key);
  1144. binaryWriter.Write(keyValuePair3.Value);
  1145. }
  1146. File.WriteAllBytes(Path.Combine(GameMain.Instance.SerializeStorageManager.StoreDirectoryPath, "system.dat"), memoryStream.ToArray());
  1147. memoryStream.Dispose();
  1148. memoryStream = null;
  1149. }
  1150. public bool LoadSystem()
  1151. {
  1152. string text = Path.Combine(GameMain.Instance.SerializeStorageManager.StoreDirectoryPath, "system.dat");
  1153. if (File.Exists(text))
  1154. {
  1155. try
  1156. {
  1157. this.m_dicEditColorPresetData.Clear();
  1158. this.m_SystemVers.Clear();
  1159. using (FileStream fileStream = new FileStream(text, FileMode.Open))
  1160. {
  1161. BinaryReader binaryReader = new BinaryReader(fileStream);
  1162. string a = binaryReader.ReadString();
  1163. if (a == "CM3D2_SYSTEM")
  1164. {
  1165. return true;
  1166. }
  1167. NDebug.Assert(a == "CM3D2_SYSTEM2", "システムファイルのヘッダーが不正です。");
  1168. int num = binaryReader.ReadInt32();
  1169. int num2 = binaryReader.ReadInt32();
  1170. for (int i = 0; i < num2; i++)
  1171. {
  1172. int key = binaryReader.ReadInt32();
  1173. int num3 = binaryReader.ReadInt32();
  1174. Dictionary<string, int> dictionary = new Dictionary<string, int>();
  1175. for (int j = 0; j < num3; j++)
  1176. {
  1177. string key2 = binaryReader.ReadString();
  1178. int value = binaryReader.ReadInt32();
  1179. dictionary.Add(key2, value);
  1180. }
  1181. this.m_dicEditColorPresetData.Add(key, dictionary);
  1182. }
  1183. int num4 = binaryReader.ReadInt32();
  1184. for (int k = 0; k < num4; k++)
  1185. {
  1186. this.SetSystemVers(binaryReader.ReadString(), binaryReader.ReadString());
  1187. }
  1188. }
  1189. }
  1190. catch (Exception ex)
  1191. {
  1192. Debug.LogError(text + "の読み込みに失敗しました\n" + ex.Message);
  1193. }
  1194. return true;
  1195. }
  1196. return true;
  1197. }
  1198. private void LoadLauncherCfg()
  1199. {
  1200. string path = UTY.gameProjectPath + "\\update.cfg";
  1201. if (File.Exists(path))
  1202. {
  1203. using (StreamReader streamReader = new StreamReader(path))
  1204. {
  1205. while (!streamReader.EndOfStream)
  1206. {
  1207. string text = streamReader.ReadLine();
  1208. Console.WriteLine("{0}", text);
  1209. string[] array = text.Split(new char[]
  1210. {
  1211. '='
  1212. });
  1213. if (array != null && array.Length == 2)
  1214. {
  1215. string a = array[0];
  1216. string text2 = array[1];
  1217. if (a == "m_bUseNet")
  1218. {
  1219. if (text2 == "1")
  1220. {
  1221. this.NetUse = true;
  1222. }
  1223. else
  1224. {
  1225. this.NetUse = false;
  1226. }
  1227. }
  1228. else if (a == "m_strCM3D2Path")
  1229. {
  1230. text2 = text2.Replace("/", "\\");
  1231. if (!string.IsNullOrEmpty(text2))
  1232. {
  1233. if (!File.Exists(text2 + "\\CM3D2.exe"))
  1234. {
  1235. NDebug.Assert("2.0互換パス " + text2 + " には CM3D2.exe が無く、互換モードは無効です。", true);
  1236. text2 = string.Empty;
  1237. }
  1238. else if (!File.Exists(text2 + "\\GameData\\csv.arc"))
  1239. {
  1240. NDebug.Assert("2.0互換パス " + text2 + " には csv.arc が無く、互換モードは無効です。", true);
  1241. text2 = string.Empty;
  1242. }
  1243. else if (!File.Exists(text2 + "\\GameData\\script.arc"))
  1244. {
  1245. NDebug.Assert("2.0互換パス " + text2 + " には script.arc が無く、互換モードは無効です。", true);
  1246. text2 = string.Empty;
  1247. }
  1248. }
  1249. this.CM3D2Path = text2;
  1250. }
  1251. }
  1252. }
  1253. }
  1254. }
  1255. }
  1256. private Dictionary<int, Dictionary<string, int>> m_dicEditColorPresetData = new Dictionary<int, Dictionary<string, int>>();
  1257. [XmlIgnore]
  1258. public Dictionary<string, int> m_GenericTmpFlag = new Dictionary<string, int>();
  1259. public Dictionary<string, string> m_SystemVers = new Dictionary<string, string>();
  1260. private int[] m_nAntiAlias = new int[]
  1261. {
  1262. 0,
  1263. 2,
  1264. 4,
  1265. 8
  1266. };
  1267. private Size<int> m_siScreenSize = new Size<int>
  1268. {
  1269. width = 1280,
  1270. height = 720
  1271. };
  1272. private CMSystem.SSSuperSizeType m_eScreenShotSuperSize;
  1273. private int m_nManAlpha = 50;
  1274. private int m_nBloomValue = 100;
  1275. private int m_nMsgWndAlpha;
  1276. private int m_nMsgTextSpeed = 80;
  1277. private int m_nMsgAutoSpeed = 50;
  1278. private int m_nFadeSpeed = 100;
  1279. private SubtitleDisplayManager.DisplayType m_SubtitleType;
  1280. private bool m_YotogiSubtitleVisible;
  1281. private int m_nDesktopCaptureMonitorNo = 1;
  1282. private bool m_bEditItemGroup = true;
  1283. private bool m_bEditTouchJump;
  1284. private float m_fVRCameraHeightStand = 1.6f;
  1285. private float m_fVRCameraHeightSit = 0.8f;
  1286. private float m_fVRCameraMoveSpeedKey = 0.5f;
  1287. private float m_fVRCameraRotSpeedKey = 0.5f;
  1288. private bool m_bVRCameraPlaneMove;
  1289. private float m_fVRCameraRotSpeedMouse = 0.5f;
  1290. private bool m_bVRManShow = true;
  1291. private float m_fVRCameraFov = 60f;
  1292. private bool m_bVRCamRotDownUp;
  1293. private int m_nOvrConfVer = 1470;
  1294. private float m_fOvrHeadScale = 1f;
  1295. private float m_fOvrCursorStabilization = 0.05f;
  1296. private float m_fOvrCursorBoostSpeed = 0.2f;
  1297. private int m_nOvrPointerMode;
  1298. private int m_nOvrMoveMode;
  1299. private float m_fOvrCursorPadSpeed = 130f;
  1300. private float m_fOvrViveCursorLaserHitScale = 9f;
  1301. private float m_fOvrViveCursorLaserEasing = 0.3f;
  1302. private int m_nOvrHandCameraWidth = 720;
  1303. private int m_nOvrHandCameraHeight = 1280;
  1304. private Dictionary<string, CMSystem.TransDD> m_dicVRDDBG = new Dictionary<string, CMSystem.TransDD>();
  1305. private bool m_bOvrScreenMirror = true;
  1306. private CMSystem.OVR_CAM_HEIGHT_TYPE m_eOvrCameraHeightType = CMSystem.OVR_CAM_HEIGHT_TYPE.VR;
  1307. private bool m_bOvrMouseRot = true;
  1308. private float m_fOvrUITabletSize = 1f;
  1309. private bool m_bOvrUseTouch = true;
  1310. private bool m_bUseNewControllerType = true;
  1311. private bool m_bOvrUseSnapRotate = true;
  1312. private int m_nOvrUseSnapRotateRate = 30;
  1313. private readonly List<Size<int>> m_listScreenDefSize = new List<Size<int>>
  1314. {
  1315. new Size<int>
  1316. {
  1317. width = 1024,
  1318. height = 576
  1319. },
  1320. new Size<int>
  1321. {
  1322. width = 1280,
  1323. height = 720
  1324. },
  1325. new Size<int>
  1326. {
  1327. width = 1366,
  1328. height = 768
  1329. },
  1330. new Size<int>
  1331. {
  1332. width = 1920,
  1333. height = 1080
  1334. }
  1335. };
  1336. private CMSystem.SerializeConfig m_SConfig = new CMSystem.SerializeConfig();
  1337. public enum SSSuperSizeType
  1338. {
  1339. X1,
  1340. X2,
  1341. X4,
  1342. MAX
  1343. }
  1344. public enum AntiAliasType
  1345. {
  1346. None,
  1347. X2,
  1348. X4,
  1349. X8,
  1350. MAX
  1351. }
  1352. public enum ShadowQualityType
  1353. {
  1354. None,
  1355. Low,
  1356. Medium,
  1357. High
  1358. }
  1359. public enum TextureQualityType
  1360. {
  1361. Low,
  1362. Medium,
  1363. High
  1364. }
  1365. public class TransDD
  1366. {
  1367. public TransDD()
  1368. {
  1369. }
  1370. public TransDD(string strSaveString, int f_nOvrConfVer)
  1371. {
  1372. this.FromSaveString(strSaveString, f_nOvrConfVer);
  1373. }
  1374. public string ToSaveString()
  1375. {
  1376. string text = string.Concat(new string[]
  1377. {
  1378. this.m_vPos.x.ToString(),
  1379. ":",
  1380. this.m_vPos.y.ToString(),
  1381. ":",
  1382. this.m_vPos.z.ToString()
  1383. });
  1384. string text2 = text;
  1385. text = string.Concat(new string[]
  1386. {
  1387. text2,
  1388. ":",
  1389. this.m_qRot.x.ToString(),
  1390. ":",
  1391. this.m_qRot.y.ToString(),
  1392. ":",
  1393. this.m_qRot.z.ToString(),
  1394. ":",
  1395. this.m_qRot.w.ToString()
  1396. });
  1397. text2 = text;
  1398. return string.Concat(new string[]
  1399. {
  1400. text2,
  1401. ":",
  1402. this.m_vScale.x.ToString(),
  1403. ":",
  1404. this.m_vScale.y.ToString(),
  1405. ":",
  1406. this.m_vScale.z.ToString(),
  1407. ":",
  1408. this.m_bShow.ToString()
  1409. });
  1410. }
  1411. public void FromSaveString(string f_strString, int f_nOvrConfVer)
  1412. {
  1413. string[] array = f_strString.Split(new char[]
  1414. {
  1415. ':'
  1416. });
  1417. try
  1418. {
  1419. this.m_vPos.x = float.Parse(array[0]);
  1420. this.m_vPos.y = float.Parse(array[1]);
  1421. this.m_vPos.z = float.Parse(array[2]);
  1422. this.m_qRot.x = float.Parse(array[3]);
  1423. this.m_qRot.y = float.Parse(array[4]);
  1424. this.m_qRot.z = float.Parse(array[5]);
  1425. this.m_qRot.w = float.Parse(array[6]);
  1426. this.m_vScale.x = float.Parse(array[7]);
  1427. this.m_vScale.y = float.Parse(array[8]);
  1428. this.m_vScale.z = float.Parse(array[9]);
  1429. if (f_nOvrConfVer >= 1470)
  1430. {
  1431. this.m_bShow = bool.Parse(array[10]);
  1432. }
  1433. }
  1434. catch (Exception ex)
  1435. {
  1436. Debug.LogError(ex.Message);
  1437. }
  1438. }
  1439. public Vector3 m_vPos;
  1440. public Quaternion m_qRot;
  1441. public Vector3 m_vScale;
  1442. public bool m_bShow;
  1443. }
  1444. public enum OVR_CAM_HEIGHT_TYPE
  1445. {
  1446. REAL,
  1447. VR
  1448. }
  1449. [Serializable]
  1450. public class SerializeConfig : ISerializationCallbackReceiver
  1451. {
  1452. public int Version
  1453. {
  1454. get
  1455. {
  1456. return this.m_nVersion;
  1457. }
  1458. set
  1459. {
  1460. this.m_nVersion = value;
  1461. }
  1462. }
  1463. public string DShowFilter
  1464. {
  1465. get
  1466. {
  1467. return this.m_strDShowFilter;
  1468. }
  1469. }
  1470. public CMSystem.SerializeConfig.OVR_MOVE_TYPE OvrMoveType
  1471. {
  1472. get
  1473. {
  1474. return this.m_eOvrMoveType;
  1475. }
  1476. set
  1477. {
  1478. this.m_eOvrMoveType = value;
  1479. }
  1480. }
  1481. public float OvrMoveDirSpeed
  1482. {
  1483. get
  1484. {
  1485. return this.m_fOvrMoveDirSpeed;
  1486. }
  1487. }
  1488. public bool OvrViveSmoothRotatePadAreaUse
  1489. {
  1490. get
  1491. {
  1492. return this.m_bOvrViveSmoothRotateAreaUse;
  1493. }
  1494. set
  1495. {
  1496. this.m_bOvrViveSmoothRotateAreaUse = value;
  1497. }
  1498. }
  1499. public float OvrViveSmoothRotatePadAriaRate
  1500. {
  1501. get
  1502. {
  1503. return this.m_fOvrViveSmoothUpDownPadAriaRate = this.m_fOvrViveSmoothRotatePadAriaRate;
  1504. }
  1505. set
  1506. {
  1507. this.m_fOvrViveSmoothUpDownPadAriaRate = (this.m_fOvrViveSmoothRotatePadAriaRate = Mathf.Clamp(value, 10f, 80f));
  1508. }
  1509. }
  1510. public bool OvrViveSmoothupDownPadAreaUse
  1511. {
  1512. get
  1513. {
  1514. return this.m_bOvrViveSmoothupDownPadAreaUse;
  1515. }
  1516. set
  1517. {
  1518. this.m_bOvrViveSmoothupDownPadAreaUse = value;
  1519. }
  1520. }
  1521. public float OvrViveSmoothUpDownPadAriaRate
  1522. {
  1523. get
  1524. {
  1525. return this.OvrViveSmoothRotatePadAriaRate;
  1526. }
  1527. set
  1528. {
  1529. this.OvrViveSmoothRotatePadAriaRate = Mathf.Clamp(value, 10f, 80f);
  1530. }
  1531. }
  1532. public bool OvrIkAllSceneEnable
  1533. {
  1534. get
  1535. {
  1536. return this.m_bOvrIkAllSceneEnable;
  1537. }
  1538. set
  1539. {
  1540. this.m_bOvrIkAllSceneEnable = value;
  1541. }
  1542. }
  1543. public bool OvrRiftGripStickRotate
  1544. {
  1545. get
  1546. {
  1547. return this.m_bOvrRiftGripStickRotate;
  1548. }
  1549. set
  1550. {
  1551. this.m_bOvrRiftGripStickRotate = value;
  1552. }
  1553. }
  1554. public bool OvrRiftTriggerStickUpDown
  1555. {
  1556. get
  1557. {
  1558. return this.m_bOvrRiftTriggerStickUpDown;
  1559. }
  1560. set
  1561. {
  1562. this.m_bOvrRiftTriggerStickUpDown = value;
  1563. }
  1564. }
  1565. public float OvrIkSelfCamFovMin
  1566. {
  1567. get
  1568. {
  1569. return this.m_bOvrIkSelfCamFovMin;
  1570. }
  1571. set
  1572. {
  1573. this.m_bOvrIkSelfCamFovMin = value;
  1574. }
  1575. }
  1576. public float OvrIkSelfCamFovMax
  1577. {
  1578. get
  1579. {
  1580. return this.m_bOvrIkSelfCamFovMax;
  1581. }
  1582. set
  1583. {
  1584. this.m_bOvrIkSelfCamFovMax = value;
  1585. }
  1586. }
  1587. public bool OvrDDTouchToClick
  1588. {
  1589. get
  1590. {
  1591. return this.m_bOvrDesktopScreenTouchToClick;
  1592. }
  1593. set
  1594. {
  1595. this.m_bOvrDesktopScreenTouchToClick = value;
  1596. }
  1597. }
  1598. public bool OvrDDtoBG
  1599. {
  1600. get
  1601. {
  1602. return this.m_bOvrDesktopScreenPosSaveToBG;
  1603. }
  1604. set
  1605. {
  1606. this.m_bOvrDesktopScreenPosSaveToBG = value;
  1607. }
  1608. }
  1609. public bool OvrTabletFrameHideWhenMsgWndVisible
  1610. {
  1611. get
  1612. {
  1613. return this.m_bOvrTabletFrameHideWhenMsgWndVisible;
  1614. }
  1615. set
  1616. {
  1617. this.m_bOvrTabletFrameHideWhenMsgWndVisible = value;
  1618. }
  1619. }
  1620. public bool OvrHandHitToHair
  1621. {
  1622. get
  1623. {
  1624. return this.m_bOvrHandHitToHair;
  1625. }
  1626. set
  1627. {
  1628. this.m_bOvrHandHitToHair = value;
  1629. }
  1630. }
  1631. public CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT OvrHandHitToSkirt
  1632. {
  1633. get
  1634. {
  1635. return this.m_eOvrHandHitToSkirt;
  1636. }
  1637. set
  1638. {
  1639. this.m_eOvrHandHitToSkirt = value;
  1640. }
  1641. }
  1642. public CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT OvrHandHitToSkirtVAS
  1643. {
  1644. get
  1645. {
  1646. return this.m_eOvrHandHitToSkirtVAS;
  1647. }
  1648. set
  1649. {
  1650. this.m_eOvrHandHitToSkirtVAS = value;
  1651. }
  1652. }
  1653. public bool EditAutoCam
  1654. {
  1655. get
  1656. {
  1657. return this.m_bEditAutoCam;
  1658. }
  1659. set
  1660. {
  1661. this.m_bEditAutoCam = value;
  1662. }
  1663. }
  1664. public bool EditEyeToCam
  1665. {
  1666. get
  1667. {
  1668. return this.m_bEditEyeToCam;
  1669. }
  1670. set
  1671. {
  1672. this.m_bEditEyeToCam = value;
  1673. }
  1674. }
  1675. public bool PrivateModeEventListVisible
  1676. {
  1677. get
  1678. {
  1679. return this.m_bPrivateModeEventListVisible;
  1680. }
  1681. set
  1682. {
  1683. this.m_bPrivateModeEventListVisible = value;
  1684. }
  1685. }
  1686. public bool PrivateModeSettingEventListVisible
  1687. {
  1688. get
  1689. {
  1690. return this.m_bPrivateModeSettingEventListVisible;
  1691. }
  1692. set
  1693. {
  1694. this.m_bPrivateModeSettingEventListVisible = value;
  1695. }
  1696. }
  1697. public bool PrivateModeSettingDayTalkEnabled
  1698. {
  1699. get
  1700. {
  1701. return this.m_bPrivateModeSettingDayTalkEnabled;
  1702. }
  1703. set
  1704. {
  1705. this.m_bPrivateModeSettingDayTalkEnabled = value;
  1706. }
  1707. }
  1708. public bool PrivateModeSettingNightTalkEnabled
  1709. {
  1710. get
  1711. {
  1712. return this.m_bPrivateModeSettingNightTalkEnabled;
  1713. }
  1714. set
  1715. {
  1716. this.m_bPrivateModeSettingNightTalkEnabled = value;
  1717. }
  1718. }
  1719. public bool PrivateModeSettingHEventEnabled
  1720. {
  1721. get
  1722. {
  1723. return this.m_bPrivateModeSettingHEventEnabled;
  1724. }
  1725. set
  1726. {
  1727. this.m_bPrivateModeSettingHEventEnabled = value;
  1728. }
  1729. }
  1730. public bool InputUseLegacyAxisMode
  1731. {
  1732. get
  1733. {
  1734. return this.inputUseLegacyAxisMode;
  1735. }
  1736. set
  1737. {
  1738. this.inputUseLegacyAxisMode = value;
  1739. }
  1740. }
  1741. public void OnBeforeSerialize()
  1742. {
  1743. this.m_nVersion = 1480;
  1744. }
  1745. public void OnAfterDeserialize()
  1746. {
  1747. }
  1748. [SerializeField]
  1749. private int m_nVersion = 1480;
  1750. [SerializeField]
  1751. private string m_strDShowFilter = "Microsoft DTV-DVD Video Decoder";
  1752. [SerializeField]
  1753. private CMSystem.SerializeConfig.OVR_MOVE_TYPE m_eOvrMoveType;
  1754. [SerializeField]
  1755. private float m_fOvrMoveDirSpeed = 5f;
  1756. [SerializeField]
  1757. private bool m_bOvrViveSmoothRotateAreaUse = true;
  1758. [SerializeField]
  1759. private float m_fOvrViveSmoothRotatePadAriaRate = 30f;
  1760. [SerializeField]
  1761. private bool m_bOvrViveSmoothupDownPadAreaUse = true;
  1762. [SerializeField]
  1763. private float m_fOvrViveSmoothUpDownPadAriaRate = 30f;
  1764. [SerializeField]
  1765. private bool m_bOvrIkAllSceneEnable;
  1766. [SerializeField]
  1767. private bool m_bOvrRiftGripStickRotate = true;
  1768. [SerializeField]
  1769. private bool m_bOvrRiftTriggerStickUpDown = true;
  1770. [SerializeField]
  1771. private float m_bOvrIkSelfCamFovMin = 20f;
  1772. [SerializeField]
  1773. private float m_bOvrIkSelfCamFovMax = 80f;
  1774. [SerializeField]
  1775. private bool m_bOvrDesktopScreenTouchToClick = true;
  1776. [SerializeField]
  1777. private bool m_bOvrDesktopScreenPosSaveToBG;
  1778. [SerializeField]
  1779. private bool m_bOvrTabletFrameHideWhenMsgWndVisible = true;
  1780. [SerializeField]
  1781. private bool m_bOvrHandHitToHair = true;
  1782. [SerializeField]
  1783. private CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT m_eOvrHandHitToSkirt = CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT.ON;
  1784. [SerializeField]
  1785. private CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT m_eOvrHandHitToSkirtVAS = CMSystem.SerializeConfig.OVR_HAND_TO_SKIRT.GRAB;
  1786. [SerializeField]
  1787. private bool m_bEditAutoCam = true;
  1788. [SerializeField]
  1789. private bool m_bEditEyeToCam = true;
  1790. [SerializeField]
  1791. private bool m_bPrivateModeEventListVisible = true;
  1792. [SerializeField]
  1793. private bool m_bPrivateModeSettingEventListVisible;
  1794. [SerializeField]
  1795. private bool m_bPrivateModeSettingDayTalkEnabled = true;
  1796. [SerializeField]
  1797. private bool m_bPrivateModeSettingNightTalkEnabled = true;
  1798. [SerializeField]
  1799. private bool m_bPrivateModeSettingHEventEnabled = true;
  1800. [SerializeField]
  1801. private bool inputUseLegacyAxisMode;
  1802. public enum OVR_MOVE_TYPE
  1803. {
  1804. WARP_DRAW_STEPROT,
  1805. DIRECTION
  1806. }
  1807. public enum OVR_HAND_TO_SKIRT
  1808. {
  1809. OFF,
  1810. GRAB,
  1811. ON
  1812. }
  1813. }
  1814. }