ModSetup.cs 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Net;
  4. using System.Net.Security;
  5. using System.Reflection;
  6. using System.Runtime.CompilerServices;
  7. using System.Security.Cryptography.X509Certificates;
  8. using System.Windows;
  9. using System.Windows.Media;
  10. using System.Windows.Media.Effects;
  11. using Microsoft.VisualBasic;
  12. using Microsoft.VisualBasic.CompilerServices;
  13. namespace PCL
  14. {
  15. // Token: 0x020001AD RID: 429
  16. public class ModSetup
  17. {
  18. // Token: 0x060011C4 RID: 4548 RVA: 0x0007E55C File Offset: 0x0007C75C
  19. public ModSetup()
  20. {
  21. this.m_ValThread = new Dictionary<string, ModSetup.SetupEntry>
  22. {
  23. {
  24. "Identify",
  25. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  26. },
  27. {
  28. "WindowHeight",
  29. new ModSetup.SetupEntry(550, 0, false)
  30. },
  31. {
  32. "WindowWidth",
  33. new ModSetup.SetupEntry(900, 0, false)
  34. },
  35. {
  36. "HintDownloadThread",
  37. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  38. },
  39. {
  40. "HintNotice",
  41. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, false)
  42. },
  43. {
  44. "HintDownload",
  45. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, false)
  46. },
  47. {
  48. "HintInstallBack",
  49. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  50. },
  51. {
  52. "HintHide",
  53. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  54. },
  55. {
  56. "HintHandInstall",
  57. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  58. },
  59. {
  60. "HintBuy",
  61. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  62. },
  63. {
  64. "HintClearRubbish",
  65. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, false)
  66. },
  67. {
  68. "HintUpdateMod",
  69. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  70. },
  71. {
  72. "TestSetupReader",
  73. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  74. },
  75. {
  76. "SystemEula",
  77. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  78. },
  79. {
  80. "SystemCount",
  81. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, true)
  82. },
  83. {
  84. "SystemLaunchCount",
  85. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, true)
  86. },
  87. {
  88. "SystemLastVersionReg",
  89. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, true)
  90. },
  91. {
  92. "SystemHighestBetaVersionReg",
  93. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, true)
  94. },
  95. {
  96. "SystemHighestAlphaVersionReg",
  97. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, true)
  98. },
  99. {
  100. "SystemSetupVersionReg",
  101. new ModSetup.SetupEntry(1, ModSetup.SetupSource.Registry, false)
  102. },
  103. {
  104. "SystemSetupVersionIni",
  105. new ModSetup.SetupEntry(1, 0, false)
  106. },
  107. {
  108. "SystemHelpVersion",
  109. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, false)
  110. },
  111. {
  112. "SystemDebugMode",
  113. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  114. },
  115. {
  116. "SystemDebugAnim",
  117. new ModSetup.SetupEntry(9, ModSetup.SetupSource.Registry, false)
  118. },
  119. {
  120. "SystemDebugDelay",
  121. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  122. },
  123. {
  124. "SystemDebugSkipCopy",
  125. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  126. },
  127. {
  128. "SystemSystemCache",
  129. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  130. },
  131. {
  132. "SystemSystemUpdate",
  133. new ModSetup.SetupEntry(0, 0, false)
  134. },
  135. {
  136. "SystemSystemActivity",
  137. new ModSetup.SetupEntry(0, 0, false)
  138. },
  139. {
  140. "CacheSavedPageUrl",
  141. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  142. },
  143. {
  144. "CacheSavedPageVersion",
  145. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  146. },
  147. {
  148. "CacheMsOAuthRefresh",
  149. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  150. },
  151. {
  152. "CacheMsAccess",
  153. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  154. },
  155. {
  156. "CacheMsProfileJson",
  157. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  158. },
  159. {
  160. "CacheMsUuid",
  161. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  162. },
  163. {
  164. "CacheMsName",
  165. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  166. },
  167. {
  168. "CacheMsV2Migrated",
  169. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  170. },
  171. {
  172. "CacheMsV2OAuthRefresh",
  173. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  174. },
  175. {
  176. "CacheMsV2Access",
  177. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  178. },
  179. {
  180. "CacheMsV2ProfileJson",
  181. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  182. },
  183. {
  184. "CacheMsV2Uuid",
  185. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  186. },
  187. {
  188. "CacheMsV2Name",
  189. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  190. },
  191. {
  192. "CacheNideAccess",
  193. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  194. },
  195. {
  196. "CacheNideClient",
  197. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  198. },
  199. {
  200. "CacheNideUuid",
  201. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  202. },
  203. {
  204. "CacheNideName",
  205. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  206. },
  207. {
  208. "CacheNideUsername",
  209. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  210. },
  211. {
  212. "CacheNidePass",
  213. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  214. },
  215. {
  216. "CacheNideServer",
  217. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  218. },
  219. {
  220. "CacheAuthAccess",
  221. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  222. },
  223. {
  224. "CacheAuthClient",
  225. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  226. },
  227. {
  228. "CacheAuthUuid",
  229. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  230. },
  231. {
  232. "CacheAuthName",
  233. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  234. },
  235. {
  236. "CacheAuthUsername",
  237. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  238. },
  239. {
  240. "CacheAuthPass",
  241. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  242. },
  243. {
  244. "CacheAuthServerServer",
  245. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  246. },
  247. {
  248. "CacheAuthServerName",
  249. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  250. },
  251. {
  252. "CacheAuthServerRegister",
  253. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  254. },
  255. {
  256. "CacheDownloadFolder",
  257. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  258. },
  259. {
  260. "CacheJavaListVersion",
  261. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, false)
  262. },
  263. {
  264. "LoginRemember",
  265. new ModSetup.SetupEntry(true, ModSetup.SetupSource.Registry, true)
  266. },
  267. {
  268. "LoginLegacyName",
  269. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  270. },
  271. {
  272. "LoginMsJson",
  273. new ModSetup.SetupEntry("{}", ModSetup.SetupSource.Registry, true)
  274. },
  275. {
  276. "LoginNideEmail",
  277. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  278. },
  279. {
  280. "LoginNidePass",
  281. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  282. },
  283. {
  284. "LoginAuthEmail",
  285. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  286. },
  287. {
  288. "LoginAuthPass",
  289. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  290. },
  291. {
  292. "LoginType",
  293. new ModSetup.SetupEntry(ModLaunch.McLoginType.Legacy, ModSetup.SetupSource.Registry, false)
  294. },
  295. {
  296. "LoginPageType",
  297. new ModSetup.SetupEntry(0, 0, false)
  298. },
  299. {
  300. "LaunchSkinID",
  301. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  302. },
  303. {
  304. "LaunchSkinType",
  305. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, false)
  306. },
  307. {
  308. "LaunchSkinSlim",
  309. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  310. },
  311. {
  312. "LaunchVersionSelect",
  313. new ModSetup.SetupEntry("", 0, false)
  314. },
  315. {
  316. "LaunchFolderSelect",
  317. new ModSetup.SetupEntry("", 0, false)
  318. },
  319. {
  320. "LaunchFolders",
  321. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  322. },
  323. {
  324. "LaunchArgumentTitle",
  325. new ModSetup.SetupEntry("", 0, false)
  326. },
  327. {
  328. "LaunchArgumentInfo",
  329. new ModSetup.SetupEntry("PCL", 0, false)
  330. },
  331. {
  332. "LaunchArgumentJavaSelect",
  333. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  334. },
  335. {
  336. "LaunchArgumentJavaAll",
  337. new ModSetup.SetupEntry("[]", ModSetup.SetupSource.Registry, false)
  338. },
  339. {
  340. "LaunchArgumentIndie",
  341. new ModSetup.SetupEntry(0, 0, false)
  342. },
  343. {
  344. "LaunchArgumentVisible",
  345. new ModSetup.SetupEntry(5, ModSetup.SetupSource.Registry, false)
  346. },
  347. {
  348. "LaunchArgumentPriority",
  349. new ModSetup.SetupEntry(1, ModSetup.SetupSource.Registry, false)
  350. },
  351. {
  352. "LaunchArgumentWindowWidth",
  353. new ModSetup.SetupEntry(854, 0, false)
  354. },
  355. {
  356. "LaunchArgumentWindowHeight",
  357. new ModSetup.SetupEntry(480, 0, false)
  358. },
  359. {
  360. "LaunchArgumentWindowType",
  361. new ModSetup.SetupEntry(1, 0, false)
  362. },
  363. {
  364. "LaunchArgumentRam",
  365. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  366. },
  367. {
  368. "LaunchAdvanceJvm",
  369. new ModSetup.SetupEntry("-XX:+UseG1GC -XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Djdk.lang.Process.allowAmbiguousCommands=true -Dfml.ignoreInvalidMinecraftCertificates=True -Dfml.ignorePatchDiscrepancies=True -Dlog4j2.formatMsgNoLookups=true", 0, false)
  370. },
  371. {
  372. "LaunchAdvanceGame",
  373. new ModSetup.SetupEntry("", 0, false)
  374. },
  375. {
  376. "LaunchAdvanceRun",
  377. new ModSetup.SetupEntry("", 0, false)
  378. },
  379. {
  380. "LaunchAdvanceRunWait",
  381. new ModSetup.SetupEntry(true, 0, false)
  382. },
  383. {
  384. "LaunchAdvanceAssets",
  385. new ModSetup.SetupEntry(false, 0, false)
  386. },
  387. {
  388. "LaunchAdvanceJava",
  389. new ModSetup.SetupEntry(false, 0, false)
  390. },
  391. {
  392. "LaunchRamType",
  393. new ModSetup.SetupEntry(0, 0, false)
  394. },
  395. {
  396. "LaunchRamCustom",
  397. new ModSetup.SetupEntry(15, 0, false)
  398. },
  399. {
  400. "LinkEula",
  401. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  402. },
  403. {
  404. "LinkName",
  405. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  406. },
  407. {
  408. "LinkHiperCertLast",
  409. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  410. },
  411. {
  412. "LinkHiperCertTime",
  413. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  414. },
  415. {
  416. "LinkHiperCertWarn",
  417. new ModSetup.SetupEntry(true, ModSetup.SetupSource.Registry, false)
  418. },
  419. {
  420. "LinkIoiVersion",
  421. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, true)
  422. },
  423. {
  424. "ToolHelpChinese",
  425. new ModSetup.SetupEntry(true, ModSetup.SetupSource.Registry, false)
  426. },
  427. {
  428. "ToolDownloadThread",
  429. new ModSetup.SetupEntry(63, ModSetup.SetupSource.Registry, false)
  430. },
  431. {
  432. "ToolDownloadSpeed",
  433. new ModSetup.SetupEntry(42, ModSetup.SetupSource.Registry, false)
  434. },
  435. {
  436. "ToolDownloadVersion",
  437. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, false)
  438. },
  439. {
  440. "ToolDownloadTranslate",
  441. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, false)
  442. },
  443. {
  444. "ToolDownloadIgnoreQuilt",
  445. new ModSetup.SetupEntry(true, ModSetup.SetupSource.Registry, false)
  446. },
  447. {
  448. "ToolDownloadCert",
  449. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  450. },
  451. {
  452. "ToolDownloadMod",
  453. new ModSetup.SetupEntry(1, ModSetup.SetupSource.Registry, false)
  454. },
  455. {
  456. "ToolModLocalNameStyle",
  457. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, false)
  458. },
  459. {
  460. "ToolUpdateAlpha",
  461. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Registry, true)
  462. },
  463. {
  464. "ToolUpdateRelease",
  465. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  466. },
  467. {
  468. "ToolUpdateSnapshot",
  469. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Registry, false)
  470. },
  471. {
  472. "ToolUpdateReleaseLast",
  473. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  474. },
  475. {
  476. "ToolUpdateSnapshotLast",
  477. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, false)
  478. },
  479. {
  480. "UiLauncherTransparent",
  481. new ModSetup.SetupEntry(600, 0, false)
  482. },
  483. {
  484. "UiLauncherHue",
  485. new ModSetup.SetupEntry(180, 0, false)
  486. },
  487. {
  488. "UiLauncherSat",
  489. new ModSetup.SetupEntry(80, 0, false)
  490. },
  491. {
  492. "UiLauncherDelta",
  493. new ModSetup.SetupEntry(90, 0, false)
  494. },
  495. {
  496. "UiLauncherLight",
  497. new ModSetup.SetupEntry(20, 0, false)
  498. },
  499. {
  500. "UiLauncherTheme",
  501. new ModSetup.SetupEntry(0, 0, false)
  502. },
  503. {
  504. "UiLauncherThemeGold",
  505. new ModSetup.SetupEntry("", ModSetup.SetupSource.Registry, true)
  506. },
  507. {
  508. "UiLauncherThemeHide",
  509. new ModSetup.SetupEntry("0|1|2|3|4", ModSetup.SetupSource.Registry, true)
  510. },
  511. {
  512. "UiLauncherThemeHide2",
  513. new ModSetup.SetupEntry("0|1|2|3|4", ModSetup.SetupSource.Registry, true)
  514. },
  515. {
  516. "UiLauncherLogo",
  517. new ModSetup.SetupEntry(true, 0, false)
  518. },
  519. {
  520. "UiLauncherEmail",
  521. new ModSetup.SetupEntry(false, 0, false)
  522. },
  523. {
  524. "UiBackgroundColorful",
  525. new ModSetup.SetupEntry(true, 0, false)
  526. },
  527. {
  528. "UiBackgroundOpacity",
  529. new ModSetup.SetupEntry(1000, 0, false)
  530. },
  531. {
  532. "UiBackgroundBlur",
  533. new ModSetup.SetupEntry(0, 0, false)
  534. },
  535. {
  536. "UiBackgroundSuit",
  537. new ModSetup.SetupEntry(0, 0, false)
  538. },
  539. {
  540. "UiCustomType",
  541. new ModSetup.SetupEntry(0, 0, false)
  542. },
  543. {
  544. "UiCustomPreset",
  545. new ModSetup.SetupEntry(0, 0, false)
  546. },
  547. {
  548. "UiCustomNet",
  549. new ModSetup.SetupEntry("", 0, false)
  550. },
  551. {
  552. "UiLogoType",
  553. new ModSetup.SetupEntry(1, 0, false)
  554. },
  555. {
  556. "UiLogoText",
  557. new ModSetup.SetupEntry("", 0, false)
  558. },
  559. {
  560. "UiLogoLeft",
  561. new ModSetup.SetupEntry(false, 0, false)
  562. },
  563. {
  564. "UiMusicVolume",
  565. new ModSetup.SetupEntry(500, 0, false)
  566. },
  567. {
  568. "UiMusicStop",
  569. new ModSetup.SetupEntry(false, 0, false)
  570. },
  571. {
  572. "UiMusicStart",
  573. new ModSetup.SetupEntry(false, 0, false)
  574. },
  575. {
  576. "UiMusicRandom",
  577. new ModSetup.SetupEntry(true, 0, false)
  578. },
  579. {
  580. "UiMusicAuto",
  581. new ModSetup.SetupEntry(true, 0, false)
  582. },
  583. {
  584. "UiHiddenPageDownload",
  585. new ModSetup.SetupEntry(false, 0, false)
  586. },
  587. {
  588. "UiHiddenPageLink",
  589. new ModSetup.SetupEntry(false, 0, false)
  590. },
  591. {
  592. "UiHiddenPageSetup",
  593. new ModSetup.SetupEntry(false, 0, false)
  594. },
  595. {
  596. "UiHiddenPageOther",
  597. new ModSetup.SetupEntry(false, 0, false)
  598. },
  599. {
  600. "UiHiddenFunctionSelect",
  601. new ModSetup.SetupEntry(false, 0, false)
  602. },
  603. {
  604. "UiHiddenFunctionModUpdate",
  605. new ModSetup.SetupEntry(false, 0, false)
  606. },
  607. {
  608. "UiHiddenFunctionHidden",
  609. new ModSetup.SetupEntry(false, 0, false)
  610. },
  611. {
  612. "UiHiddenSetupLaunch",
  613. new ModSetup.SetupEntry(false, 0, false)
  614. },
  615. {
  616. "UiHiddenSetupUi",
  617. new ModSetup.SetupEntry(false, 0, false)
  618. },
  619. {
  620. "UiHiddenSetupLink",
  621. new ModSetup.SetupEntry(false, 0, false)
  622. },
  623. {
  624. "UiHiddenSetupSystem",
  625. new ModSetup.SetupEntry(false, 0, false)
  626. },
  627. {
  628. "UiHiddenOtherHelp",
  629. new ModSetup.SetupEntry(false, 0, false)
  630. },
  631. {
  632. "UiHiddenOtherFeedback",
  633. new ModSetup.SetupEntry(false, 0, false)
  634. },
  635. {
  636. "UiHiddenOtherVote",
  637. new ModSetup.SetupEntry(false, 0, false)
  638. },
  639. {
  640. "UiHiddenOtherAbout",
  641. new ModSetup.SetupEntry(false, 0, false)
  642. },
  643. {
  644. "UiHiddenOtherTest",
  645. new ModSetup.SetupEntry(false, 0, false)
  646. },
  647. {
  648. "VersionAdvanceJvm",
  649. new ModSetup.SetupEntry("", ModSetup.SetupSource.Version, false)
  650. },
  651. {
  652. "VersionAdvanceGame",
  653. new ModSetup.SetupEntry("", ModSetup.SetupSource.Version, false)
  654. },
  655. {
  656. "VersionAdvanceAssets",
  657. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Version, false)
  658. },
  659. {
  660. "VersionAdvanceAssetsV2",
  661. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Version, false)
  662. },
  663. {
  664. "VersionAdvanceJava",
  665. new ModSetup.SetupEntry(false, ModSetup.SetupSource.Version, false)
  666. },
  667. {
  668. "VersionAdvanceRun",
  669. new ModSetup.SetupEntry("", ModSetup.SetupSource.Version, false)
  670. },
  671. {
  672. "VersionAdvanceRunWait",
  673. new ModSetup.SetupEntry(true, ModSetup.SetupSource.Version, false)
  674. },
  675. {
  676. "VersionRamType",
  677. new ModSetup.SetupEntry(2, ModSetup.SetupSource.Version, false)
  678. },
  679. {
  680. "VersionRamCustom",
  681. new ModSetup.SetupEntry(15, ModSetup.SetupSource.Version, false)
  682. },
  683. {
  684. "VersionRamOptimize",
  685. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Version, false)
  686. },
  687. {
  688. "VersionArgumentTitle",
  689. new ModSetup.SetupEntry("", ModSetup.SetupSource.Version, false)
  690. },
  691. {
  692. "VersionArgumentInfo",
  693. new ModSetup.SetupEntry("", ModSetup.SetupSource.Version, false)
  694. },
  695. {
  696. "VersionArgumentIndie",
  697. new ModSetup.SetupEntry(-1, ModSetup.SetupSource.Version, false)
  698. },
  699. {
  700. "VersionArgumentJavaSelect",
  701. new ModSetup.SetupEntry("使用全局设置", ModSetup.SetupSource.Version, false)
  702. },
  703. {
  704. "VersionServerEnter",
  705. new ModSetup.SetupEntry("", ModSetup.SetupSource.Version, false)
  706. },
  707. {
  708. "VersionServerLogin",
  709. new ModSetup.SetupEntry(0, ModSetup.SetupSource.Version, false)
  710. },
  711. {
  712. "VersionServerNide",
  713. new ModSetup.SetupEntry("", ModSetup.SetupSource.Version, false)
  714. },
  715. {
  716. "VersionServerAuthRegister",
  717. new ModSetup.SetupEntry("", ModSetup.SetupSource.Version, false)
  718. },
  719. {
  720. "VersionServerAuthName",
  721. new ModSetup.SetupEntry("", ModSetup.SetupSource.Version, false)
  722. },
  723. {
  724. "VersionServerAuthServer",
  725. new ModSetup.SetupEntry("", ModSetup.SetupSource.Version, false)
  726. }
  727. };
  728. }
  729. // Token: 0x060011C5 RID: 4549 RVA: 0x0000AB01 File Offset: 0x00008D01
  730. public void Set(string Key, object Value, bool ForceReload = false, ModMinecraft.McVersion Version = null)
  731. {
  732. this.Set(Key, RuntimeHelpers.GetObjectValue(Value), this.m_ValThread[Key], ForceReload, Version);
  733. }
  734. // Token: 0x060011C6 RID: 4550 RVA: 0x0007FCC0 File Offset: 0x0007DEC0
  735. private void Set(string Key, object Value, ModSetup.SetupEntry E, bool ForceReload, ModMinecraft.McVersion Version)
  736. {
  737. try
  738. {
  739. Value = RuntimeHelpers.GetObjectValue(Conversion.CTypeDynamic(RuntimeHelpers.GetObjectValue(Value), E.Type));
  740. if (E.databaseMap == 2)
  741. {
  742. if (Operators.ConditionalCompareObjectEqual(E.Value, Value, false) && !ForceReload)
  743. {
  744. return;
  745. }
  746. }
  747. else if (E.Source != ModSetup.SetupSource.Version)
  748. {
  749. E.databaseMap = 2;
  750. }
  751. E.Value = RuntimeHelpers.GetObjectValue(Value);
  752. if (E._MappingMap)
  753. {
  754. try
  755. {
  756. if (Value == null)
  757. {
  758. Value = "";
  759. }
  760. Value = ModSecret.SecretEncrypt(Conversions.ToString(Value), "PCL" + ModBase._TagRepository);
  761. }
  762. catch (Exception ex)
  763. {
  764. ModBase.Log(ex, "加密设置失败:" + Key, ModBase.LogLevel.Developer, "出现错误");
  765. }
  766. }
  767. switch (E.Source)
  768. {
  769. case ModSetup.SetupSource.Normal:
  770. ModBase.WriteIni("Setup", Key, Conversions.ToString(Value));
  771. break;
  772. case ModSetup.SetupSource.Registry:
  773. ModBase.WriteReg(Key, Conversions.ToString(Value), false);
  774. break;
  775. case ModSetup.SetupSource.Version:
  776. if (Version == null)
  777. {
  778. throw new Exception("更改版本设置 " + Key + " 时未提供目标版本");
  779. }
  780. ModBase.WriteIni(Version.Path + "PCL\\Setup.ini", Key, Conversions.ToString(Value));
  781. break;
  782. }
  783. MethodInfo method = typeof(ModSetup).GetMethod(Key);
  784. if (method != null)
  785. {
  786. method.Invoke(this, new object[]
  787. {
  788. Value
  789. });
  790. }
  791. }
  792. catch (Exception ex2)
  793. {
  794. ModBase.Log(ex2, Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject("设置设置项时出错(" + Key + ", ", Value), ")")), ModBase.LogLevel.Feedback, "出现错误");
  795. }
  796. }
  797. // Token: 0x060011C7 RID: 4551 RVA: 0x0000AB1F File Offset: 0x00008D1F
  798. public object Load(string Key, bool ForceReload = false, ModMinecraft.McVersion Version = null)
  799. {
  800. return this.Load(Key, this.m_ValThread[Key], ForceReload, Version);
  801. }
  802. // Token: 0x060011C8 RID: 4552 RVA: 0x0007FE88 File Offset: 0x0007E088
  803. private object Load(string Key, ModSetup.SetupEntry E, bool ForceReload, ModMinecraft.McVersion Version)
  804. {
  805. object value;
  806. if (E.databaseMap == 2 && !ForceReload)
  807. {
  808. value = E.Value;
  809. }
  810. else
  811. {
  812. this.Read(Key, ref E, Version);
  813. if (E.Source != ModSetup.SetupSource.Version)
  814. {
  815. E.databaseMap = 2;
  816. }
  817. MethodInfo method = typeof(ModSetup).GetMethod(Key);
  818. if (method != null)
  819. {
  820. method.Invoke(this, new object[]
  821. {
  822. E.Value
  823. });
  824. }
  825. value = E.Value;
  826. }
  827. return value;
  828. }
  829. // Token: 0x060011C9 RID: 4553 RVA: 0x0000AB36 File Offset: 0x00008D36
  830. public object Get(string Key, ModMinecraft.McVersion Version = null)
  831. {
  832. if (!this.m_ValThread.ContainsKey(Key))
  833. {
  834. throw new KeyNotFoundException("未找到设置项:" + Key)
  835. {
  836. Source = Key
  837. };
  838. }
  839. return this.Get(Key, this.m_ValThread[Key], Version);
  840. }
  841. // Token: 0x060011CA RID: 4554 RVA: 0x0007FEFC File Offset: 0x0007E0FC
  842. private object Get(string Key, ModSetup.SetupEntry E, ModMinecraft.McVersion Version)
  843. {
  844. string text = this.ForceValue(Key);
  845. if (text != null)
  846. {
  847. E.Value = RuntimeHelpers.GetObjectValue(Conversion.CTypeDynamic(text, E.Type));
  848. E.databaseMap = 1;
  849. }
  850. if (E.databaseMap == 0)
  851. {
  852. this.Read(Key, ref E, Version);
  853. if (E.Source != ModSetup.SetupSource.Version)
  854. {
  855. E.databaseMap = 1;
  856. }
  857. }
  858. return E.Value;
  859. }
  860. // Token: 0x060011CB RID: 4555 RVA: 0x0007FF5C File Offset: 0x0007E15C
  861. public void Reset(string Key, bool ForceReload = false, ModMinecraft.McVersion Version = null)
  862. {
  863. ModSetup.SetupEntry setupEntry = this.m_ValThread[Key];
  864. this.Set(Key, RuntimeHelpers.GetObjectValue(setupEntry.m_TokenizerMap), setupEntry, ForceReload, Version);
  865. }
  866. // Token: 0x060011CC RID: 4556 RVA: 0x0000AB72 File Offset: 0x00008D72
  867. public string GetDefault(string Key)
  868. {
  869. return Conversions.ToString(this.m_ValThread[Key].m_TokenizerMap);
  870. }
  871. // Token: 0x060011CD RID: 4557 RVA: 0x0007FF8C File Offset: 0x0007E18C
  872. private void Read(string Key, ref ModSetup.SetupEntry E, ModMinecraft.McVersion Version)
  873. {
  874. try
  875. {
  876. if (E.databaseMap == 0)
  877. {
  878. ModSetup.SetupSource source = E.Source;
  879. string text;
  880. if (source != ModSetup.SetupSource.Normal)
  881. {
  882. if (source != ModSetup.SetupSource.Registry)
  883. {
  884. if (Version == null)
  885. {
  886. throw new Exception("读取版本设置 " + Key + " 时未提供目标版本");
  887. }
  888. text = ModBase.ReadIni(Version.Path + "PCL\\Setup.ini", Key, Conversions.ToString(E.filterMap));
  889. }
  890. else
  891. {
  892. text = ModBase.ReadReg(Key, Conversions.ToString(E.filterMap));
  893. }
  894. }
  895. else
  896. {
  897. text = ModBase.ReadIni("Setup", Key, Conversions.ToString(E.filterMap));
  898. }
  899. if (E._MappingMap)
  900. {
  901. if (text.Equals(RuntimeHelpers.GetObjectValue(E.filterMap)))
  902. {
  903. text = Conversions.ToString(E.m_TokenizerMap);
  904. }
  905. else
  906. {
  907. try
  908. {
  909. text = ModSecret.SecretDecrypt(text, "PCL" + ModBase._TagRepository);
  910. }
  911. catch (Exception ex)
  912. {
  913. ModBase.Log(ex, "解密设置失败:" + Key, ModBase.LogLevel.Developer, "出现错误");
  914. text = Conversions.ToString(E.m_TokenizerMap);
  915. ModBase.m_IdentifierRepository.Set(Key, RuntimeHelpers.GetObjectValue(E.m_TokenizerMap), true, null);
  916. }
  917. }
  918. }
  919. E.Value = RuntimeHelpers.GetObjectValue(Conversion.CTypeDynamic(text, E.Type));
  920. }
  921. }
  922. catch (Exception ex2)
  923. {
  924. ModBase.Log(ex2, "读取设置失败:" + Key, ModBase.LogLevel.Hint, "出现错误");
  925. E.Value = RuntimeHelpers.GetObjectValue(Conversion.CTypeDynamic(RuntimeHelpers.GetObjectValue(E.m_TokenizerMap), E.Type));
  926. }
  927. }
  928. // Token: 0x060011CE RID: 4558 RVA: 0x0008014C File Offset: 0x0007E34C
  929. private string ForceValue(string Key)
  930. {
  931. string result;
  932. if (Operators.CompareString(Key, "UiLauncherTheme", false) == 0)
  933. {
  934. result = "0";
  935. }
  936. else if (Operators.CompareString(Key, "UiHiddenPageLink", false) == 0)
  937. {
  938. result = Conversions.ToString(true);
  939. }
  940. else if (Operators.CompareString(Key, "UiHiddenSetupLink", false) == 0)
  941. {
  942. result = Conversions.ToString(true);
  943. }
  944. else
  945. {
  946. result = null;
  947. }
  948. return result;
  949. }
  950. // Token: 0x060011CF RID: 4559 RVA: 0x000801A0 File Offset: 0x0007E3A0
  951. public void LaunchVersionSelect(string Value)
  952. {
  953. ModBase.Log("[Setup] 当前选择的 Minecraft 版本:" + Value, ModBase.LogLevel.Normal, "出现错误");
  954. ModBase.WriteIni(ModMinecraft.m_ProxyTests + "PCL.ini", "Version", Information.IsNothing(ModMinecraft.AddClient()) ? "" : ModMinecraft.AddClient().Name);
  955. }
  956. // Token: 0x060011D0 RID: 4560 RVA: 0x000801FC File Offset: 0x0007E3FC
  957. public void LaunchFolderSelect(string Value)
  958. {
  959. ModBase.Log("[Setup] 当前选择的 Minecraft 文件夹:" + Value.ToString().Replace("$", ModBase.Path), ModBase.LogLevel.Normal, "出现错误");
  960. ModMinecraft.m_ProxyTests = Value.ToString().Replace("$", ModBase.Path);
  961. }
  962. // Token: 0x060011D1 RID: 4561 RVA: 0x0000AB8A File Offset: 0x00008D8A
  963. public void LaunchRamType(int Type)
  964. {
  965. if (ModMain._PolicyIterator != null)
  966. {
  967. ModMain._PolicyIterator.RamType(Type);
  968. }
  969. }
  970. // Token: 0x060011D2 RID: 4562 RVA: 0x0000AB9E File Offset: 0x00008D9E
  971. public void LaunchSkinType(int Value)
  972. {
  973. ModBase.RunInUi(delegate()
  974. {
  975. if (!Information.IsNothing(ModMain._PolicyIterator))
  976. {
  977. switch (Value)
  978. {
  979. case 0:
  980. case 1:
  981. case 2:
  982. ModMain._PolicyIterator.PanSkinID.Visibility = Visibility.Collapsed;
  983. ModMain._PolicyIterator.PanSkinChange.Visibility = Visibility.Collapsed;
  984. break;
  985. case 3:
  986. ModMain._PolicyIterator.PanSkinID.Visibility = Visibility.Visible;
  987. ModMain._PolicyIterator.PanSkinChange.Visibility = Visibility.Collapsed;
  988. break;
  989. case 4:
  990. ModMain._PolicyIterator.PanSkinID.Visibility = Visibility.Collapsed;
  991. ModMain._PolicyIterator.PanSkinChange.Visibility = Visibility.Visible;
  992. break;
  993. }
  994. ModMain._PolicyIterator.CardSkin.TriggerForceResize();
  995. }
  996. PageLaunchLeft.infoMapper.Start(null, false);
  997. }, false);
  998. }
  999. // Token: 0x060011D3 RID: 4563 RVA: 0x0000ABBD File Offset: 0x00008DBD
  1000. public void LaunchSkinID(string Value)
  1001. {
  1002. PageLaunchLeft.infoMapper.Start(null, false);
  1003. }
  1004. // Token: 0x060011D4 RID: 4564 RVA: 0x0000ABCB File Offset: 0x00008DCB
  1005. public void ToolDownloadThread(int Value)
  1006. {
  1007. ModNet.m_StateTests = checked(Value + 1);
  1008. }
  1009. // Token: 0x060011D5 RID: 4565 RVA: 0x0000ABD5 File Offset: 0x00008DD5
  1010. public void ToolDownloadCert(bool Value)
  1011. {
  1012. ServicePointManager.ServerCertificateValidationCallback = (Value ? null : ((ModSetup._Closure$__.$IR21-1 == null) ? (ModSetup._Closure$__.$IR21-1 = ((object a0, X509Certificate a1, X509Chain a2, SslPolicyErrors a3) => ((ModSetup._Closure$__.$I21-0 == null) ? (ModSetup._Closure$__.$I21-0 = (() => true)) : ModSetup._Closure$__.$I21-0)())) : ModSetup._Closure$__.$IR21-1));
  1013. }
  1014. // Token: 0x060011D6 RID: 4566 RVA: 0x00080250 File Offset: 0x0007E450
  1015. public void ToolDownloadSpeed(int Value)
  1016. {
  1017. checked
  1018. {
  1019. if (Value <= 14)
  1020. {
  1021. ModNet.m_TemplateTests = (long)Math.Round(unchecked((double)(checked(Value + 1)) * 0.1 * 1024.0 * 1024.0));
  1022. return;
  1023. }
  1024. if (Value <= 31)
  1025. {
  1026. ModNet.m_TemplateTests = (long)Math.Round(unchecked((double)(checked(Value - 11)) * 0.5 * 1024.0 * 1024.0));
  1027. return;
  1028. }
  1029. if (Value <= 41)
  1030. {
  1031. ModNet.m_TemplateTests = unchecked((long)(checked((Value - 21) * 1024))) * 1024L;
  1032. return;
  1033. }
  1034. ModNet.m_TemplateTests = -1L;
  1035. }
  1036. }
  1037. // Token: 0x060011D7 RID: 4567 RVA: 0x0000AC06 File Offset: 0x00008E06
  1038. public void UiLauncherTransparent(int Value)
  1039. {
  1040. ModMain._ProcessIterator.Opacity = (double)Value / 1000.0 + 0.4;
  1041. }
  1042. // Token: 0x060011D8 RID: 4568 RVA: 0x0000AC28 File Offset: 0x00008E28
  1043. public void UiBackgroundColorful(bool Value)
  1044. {
  1045. ModSecret.ViewReader(-1);
  1046. }
  1047. // Token: 0x060011D9 RID: 4569 RVA: 0x0000AC30 File Offset: 0x00008E30
  1048. public void UiBackgroundOpacity(int Value)
  1049. {
  1050. ModMain._ProcessIterator.ImgBack.Opacity = (double)Value / 1000.0;
  1051. }
  1052. // Token: 0x060011DA RID: 4570 RVA: 0x000802F4 File Offset: 0x0007E4F4
  1053. public void UiBackgroundBlur(int Value)
  1054. {
  1055. checked
  1056. {
  1057. if (Value == 0)
  1058. {
  1059. ModMain._ProcessIterator.ImgBack.Effect = null;
  1060. }
  1061. else
  1062. {
  1063. ModMain._ProcessIterator.ImgBack.Effect = new BlurEffect
  1064. {
  1065. Radius = (double)(Value + 1)
  1066. };
  1067. }
  1068. ModMain._ProcessIterator.ImgBack.Margin = new Thickness((double)(0 - (Value + 1)) / 1.8);
  1069. }
  1070. }
  1071. // Token: 0x060011DB RID: 4571 RVA: 0x00080358 File Offset: 0x0007E558
  1072. public void UiBackgroundSuit(int Value)
  1073. {
  1074. if (!Information.IsNothing(ModMain._ProcessIterator.ImgBack.Background))
  1075. {
  1076. double width = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Width;
  1077. double height = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Height;
  1078. if (Value == 0)
  1079. {
  1080. if (width < ModMain._ProcessIterator.PanMain.ActualWidth / 2.0 && height < ModMain._ProcessIterator.PanMain.ActualHeight / 2.0)
  1081. {
  1082. Value = 4;
  1083. }
  1084. else
  1085. {
  1086. Value = 2;
  1087. }
  1088. }
  1089. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).TileMode = TileMode.None;
  1090. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).Viewport = new Rect(0.0, 0.0, 1.0, 1.0);
  1091. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ViewportUnits = BrushMappingMode.RelativeToBoundingBox;
  1092. switch (Value)
  1093. {
  1094. case 1:
  1095. ModMain._ProcessIterator.ImgBack.HorizontalAlignment = HorizontalAlignment.Center;
  1096. ModMain._ProcessIterator.ImgBack.VerticalAlignment = VerticalAlignment.Center;
  1097. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).Stretch = Stretch.None;
  1098. ModMain._ProcessIterator.ImgBack.Width = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Width;
  1099. ModMain._ProcessIterator.ImgBack.Height = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Height;
  1100. return;
  1101. case 2:
  1102. ModMain._ProcessIterator.ImgBack.HorizontalAlignment = HorizontalAlignment.Stretch;
  1103. ModMain._ProcessIterator.ImgBack.VerticalAlignment = VerticalAlignment.Stretch;
  1104. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).Stretch = Stretch.UniformToFill;
  1105. ModMain._ProcessIterator.ImgBack.Width = double.NaN;
  1106. ModMain._ProcessIterator.ImgBack.Height = double.NaN;
  1107. return;
  1108. case 3:
  1109. ModMain._ProcessIterator.ImgBack.HorizontalAlignment = HorizontalAlignment.Stretch;
  1110. ModMain._ProcessIterator.ImgBack.VerticalAlignment = VerticalAlignment.Stretch;
  1111. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).Stretch = Stretch.Fill;
  1112. ModMain._ProcessIterator.ImgBack.Width = double.NaN;
  1113. ModMain._ProcessIterator.ImgBack.Height = double.NaN;
  1114. return;
  1115. case 4:
  1116. ModMain._ProcessIterator.ImgBack.HorizontalAlignment = HorizontalAlignment.Stretch;
  1117. ModMain._ProcessIterator.ImgBack.VerticalAlignment = VerticalAlignment.Stretch;
  1118. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).Stretch = Stretch.None;
  1119. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).TileMode = TileMode.Tile;
  1120. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).Viewport = new Rect(0.0, 0.0, ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Width, ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Height);
  1121. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ViewportUnits = BrushMappingMode.Absolute;
  1122. ModMain._ProcessIterator.ImgBack.Width = double.NaN;
  1123. ModMain._ProcessIterator.ImgBack.Height = double.NaN;
  1124. return;
  1125. case 5:
  1126. ModMain._ProcessIterator.ImgBack.HorizontalAlignment = HorizontalAlignment.Left;
  1127. ModMain._ProcessIterator.ImgBack.VerticalAlignment = VerticalAlignment.Top;
  1128. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).Stretch = Stretch.None;
  1129. ModMain._ProcessIterator.ImgBack.Width = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Width;
  1130. ModMain._ProcessIterator.ImgBack.Height = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Height;
  1131. return;
  1132. case 6:
  1133. ModMain._ProcessIterator.ImgBack.HorizontalAlignment = HorizontalAlignment.Right;
  1134. ModMain._ProcessIterator.ImgBack.VerticalAlignment = VerticalAlignment.Top;
  1135. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).Stretch = Stretch.None;
  1136. ModMain._ProcessIterator.ImgBack.Width = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Width;
  1137. ModMain._ProcessIterator.ImgBack.Height = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Height;
  1138. return;
  1139. case 7:
  1140. ModMain._ProcessIterator.ImgBack.HorizontalAlignment = HorizontalAlignment.Left;
  1141. ModMain._ProcessIterator.ImgBack.VerticalAlignment = VerticalAlignment.Bottom;
  1142. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).Stretch = Stretch.None;
  1143. ModMain._ProcessIterator.ImgBack.Width = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Width;
  1144. ModMain._ProcessIterator.ImgBack.Height = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Height;
  1145. return;
  1146. case 8:
  1147. ModMain._ProcessIterator.ImgBack.HorizontalAlignment = HorizontalAlignment.Right;
  1148. ModMain._ProcessIterator.ImgBack.VerticalAlignment = VerticalAlignment.Bottom;
  1149. ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).Stretch = Stretch.None;
  1150. ModMain._ProcessIterator.ImgBack.Width = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Width;
  1151. ModMain._ProcessIterator.ImgBack.Height = ((ImageBrush)ModMain._ProcessIterator.ImgBack.Background).ImageSource.Height;
  1152. break;
  1153. default:
  1154. return;
  1155. }
  1156. }
  1157. }
  1158. // Token: 0x060011DC RID: 4572 RVA: 0x0008096C File Offset: 0x0007EB6C
  1159. public void UiCustomType(int Value)
  1160. {
  1161. if (ModMain.m_OrderIterator != null)
  1162. {
  1163. switch (Value)
  1164. {
  1165. case 0:
  1166. ModMain.m_OrderIterator.PanCustomPreset.Visibility = Visibility.Collapsed;
  1167. ModMain.m_OrderIterator.PanCustomLocal.Visibility = Visibility.Collapsed;
  1168. ModMain.m_OrderIterator.PanCustomNet.Visibility = Visibility.Collapsed;
  1169. ModMain.m_OrderIterator.HintCustom.Visibility = Visibility.Collapsed;
  1170. break;
  1171. case 1:
  1172. ModMain.m_OrderIterator.PanCustomPreset.Visibility = Visibility.Collapsed;
  1173. ModMain.m_OrderIterator.PanCustomLocal.Visibility = Visibility.Visible;
  1174. ModMain.m_OrderIterator.PanCustomNet.Visibility = Visibility.Collapsed;
  1175. ModMain.m_OrderIterator.HintCustom.Visibility = Visibility.Visible;
  1176. ModMain.m_OrderIterator.HintCustom.Text = string.Format("从 PCL 文件夹下的 Custom.xaml 读取主页内容。{0}你可以手动编辑该文件,向主页添加文本、图片、常用网站、快捷启动等功能。", "\r\n");
  1177. ModMain.m_OrderIterator.HintCustom.EventType = "";
  1178. ModMain.m_OrderIterator.HintCustom.EventData = "";
  1179. break;
  1180. case 2:
  1181. ModMain.m_OrderIterator.PanCustomPreset.Visibility = Visibility.Collapsed;
  1182. ModMain.m_OrderIterator.PanCustomLocal.Visibility = Visibility.Collapsed;
  1183. ModMain.m_OrderIterator.PanCustomNet.Visibility = Visibility.Visible;
  1184. ModMain.m_OrderIterator.HintCustom.Visibility = Visibility.Visible;
  1185. ModMain.m_OrderIterator.HintCustom.Text = string.Format("从指定网址联网获取主页内容。服主也可以用于动态更新服务器公告。{0}如果你制作了稳定运行的联网主页,可以点击这条提示投稿,若合格即可加入预设!", "\r\n");
  1186. ModMain.m_OrderIterator.HintCustom.EventType = "打开网页";
  1187. ModMain.m_OrderIterator.HintCustom.EventData = "https://github.com/Hex-Dragon/PCL2/discussions/2528";
  1188. break;
  1189. case 3:
  1190. ModMain.m_OrderIterator.PanCustomPreset.Visibility = Visibility.Visible;
  1191. ModMain.m_OrderIterator.PanCustomLocal.Visibility = Visibility.Collapsed;
  1192. ModMain.m_OrderIterator.PanCustomNet.Visibility = Visibility.Collapsed;
  1193. ModMain.m_OrderIterator.HintCustom.Visibility = Visibility.Collapsed;
  1194. break;
  1195. }
  1196. ModMain.m_OrderIterator.CardCustom.TriggerForceResize();
  1197. }
  1198. }
  1199. // Token: 0x060011DD RID: 4573 RVA: 0x00080B48 File Offset: 0x0007ED48
  1200. public void UiLogoType(int Value)
  1201. {
  1202. switch (Value)
  1203. {
  1204. case 0:
  1205. ModMain._ProcessIterator.ShapeTitleLogo.Visibility = Visibility.Collapsed;
  1206. ModMain._ProcessIterator.LabTitleLogo.Visibility = Visibility.Collapsed;
  1207. ModMain._ProcessIterator.ImageTitleLogo.Visibility = Visibility.Collapsed;
  1208. if (!Information.IsNothing(ModMain.m_OrderIterator))
  1209. {
  1210. ModMain.m_OrderIterator.CheckLogoLeft.Visibility = Visibility.Visible;
  1211. ModMain.m_OrderIterator.PanLogoText.Visibility = Visibility.Collapsed;
  1212. ModMain.m_OrderIterator.PanLogoChange.Visibility = Visibility.Collapsed;
  1213. }
  1214. break;
  1215. case 1:
  1216. ModMain._ProcessIterator.ShapeTitleLogo.Visibility = Visibility.Visible;
  1217. ModMain._ProcessIterator.LabTitleLogo.Visibility = Visibility.Collapsed;
  1218. ModMain._ProcessIterator.ImageTitleLogo.Visibility = Visibility.Collapsed;
  1219. if (!Information.IsNothing(ModMain.m_OrderIterator))
  1220. {
  1221. ModMain.m_OrderIterator.CheckLogoLeft.Visibility = Visibility.Collapsed;
  1222. ModMain.m_OrderIterator.PanLogoText.Visibility = Visibility.Collapsed;
  1223. ModMain.m_OrderIterator.PanLogoChange.Visibility = Visibility.Collapsed;
  1224. }
  1225. break;
  1226. case 2:
  1227. ModMain._ProcessIterator.ShapeTitleLogo.Visibility = Visibility.Collapsed;
  1228. ModMain._ProcessIterator.LabTitleLogo.Visibility = Visibility.Visible;
  1229. ModMain._ProcessIterator.ImageTitleLogo.Visibility = Visibility.Collapsed;
  1230. if (!Information.IsNothing(ModMain.m_OrderIterator))
  1231. {
  1232. ModMain.m_OrderIterator.CheckLogoLeft.Visibility = Visibility.Collapsed;
  1233. ModMain.m_OrderIterator.PanLogoText.Visibility = Visibility.Visible;
  1234. ModMain.m_OrderIterator.PanLogoChange.Visibility = Visibility.Collapsed;
  1235. }
  1236. ModBase.m_IdentifierRepository.Load("UiLogoText", true, null);
  1237. break;
  1238. case 3:
  1239. ModMain._ProcessIterator.ShapeTitleLogo.Visibility = Visibility.Collapsed;
  1240. ModMain._ProcessIterator.LabTitleLogo.Visibility = Visibility.Collapsed;
  1241. ModMain._ProcessIterator.ImageTitleLogo.Visibility = Visibility.Visible;
  1242. if (!Information.IsNothing(ModMain.m_OrderIterator))
  1243. {
  1244. ModMain.m_OrderIterator.CheckLogoLeft.Visibility = Visibility.Collapsed;
  1245. ModMain.m_OrderIterator.PanLogoText.Visibility = Visibility.Collapsed;
  1246. ModMain.m_OrderIterator.PanLogoChange.Visibility = Visibility.Visible;
  1247. }
  1248. try
  1249. {
  1250. ModMain._ProcessIterator.ImageTitleLogo.Source = ModBase.Path + "PCL\\Logo.png";
  1251. }
  1252. catch (Exception ex)
  1253. {
  1254. ModMain._ProcessIterator.ImageTitleLogo.Source = null;
  1255. ModBase.Log(ex, "显示标题栏图片失败", ModBase.LogLevel.Msgbox, "出现错误");
  1256. }
  1257. break;
  1258. }
  1259. ModBase.m_IdentifierRepository.Load("UiLogoLeft", true, null);
  1260. if (!Information.IsNothing(ModMain.m_OrderIterator))
  1261. {
  1262. ModMain.m_OrderIterator.CardLogo.TriggerForceResize();
  1263. }
  1264. }
  1265. // Token: 0x060011DE RID: 4574 RVA: 0x0000AC4D File Offset: 0x00008E4D
  1266. public void UiLogoText(string Value)
  1267. {
  1268. ModMain._ProcessIterator.LabTitleLogo.Text = Value;
  1269. }
  1270. // Token: 0x060011DF RID: 4575 RVA: 0x00080DD8 File Offset: 0x0007EFD8
  1271. public void UiLogoLeft(bool Value)
  1272. {
  1273. ModMain._ProcessIterator.PanTitleMain.ColumnDefinitions[0].Width = new GridLength((double)((!Value || !Operators.ConditionalCompareObjectEqual(ModBase.m_IdentifierRepository.Get("UiLogoType", null), 0, false)) ? 1 : 0), GridUnitType.Star);
  1274. }
  1275. // Token: 0x060011E0 RID: 4576 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1276. public void UiHiddenPageLink(bool Value)
  1277. {
  1278. PageSetupUI.HiddenRefresh();
  1279. }
  1280. // Token: 0x060011E1 RID: 4577 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1281. public void UiHiddenPageDownload(bool Value)
  1282. {
  1283. PageSetupUI.HiddenRefresh();
  1284. }
  1285. // Token: 0x060011E2 RID: 4578 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1286. public void UiHiddenPageSetup(bool Value)
  1287. {
  1288. PageSetupUI.HiddenRefresh();
  1289. }
  1290. // Token: 0x060011E3 RID: 4579 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1291. public void UiHiddenPageOther(bool Value)
  1292. {
  1293. PageSetupUI.HiddenRefresh();
  1294. }
  1295. // Token: 0x060011E4 RID: 4580 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1296. public void UiHiddenFunctionSelect(bool Value)
  1297. {
  1298. PageSetupUI.HiddenRefresh();
  1299. }
  1300. // Token: 0x060011E5 RID: 4581 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1301. public void UiHiddenFunctionModUpdate(bool Value)
  1302. {
  1303. PageSetupUI.HiddenRefresh();
  1304. }
  1305. // Token: 0x060011E6 RID: 4582 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1306. public void UiHiddenFunctionHidden(bool Value)
  1307. {
  1308. PageSetupUI.HiddenRefresh();
  1309. }
  1310. // Token: 0x060011E7 RID: 4583 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1311. public void UiHiddenSetupLaunch(bool Value)
  1312. {
  1313. PageSetupUI.HiddenRefresh();
  1314. }
  1315. // Token: 0x060011E8 RID: 4584 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1316. public void UiHiddenSetupUi(bool Value)
  1317. {
  1318. PageSetupUI.HiddenRefresh();
  1319. }
  1320. // Token: 0x060011E9 RID: 4585 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1321. public void UiHiddenSetupLink(bool Value)
  1322. {
  1323. PageSetupUI.HiddenRefresh();
  1324. }
  1325. // Token: 0x060011EA RID: 4586 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1326. public void UiHiddenSetupSystem(bool Value)
  1327. {
  1328. PageSetupUI.HiddenRefresh();
  1329. }
  1330. // Token: 0x060011EB RID: 4587 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1331. public void UiHiddenOtherHelp(bool Value)
  1332. {
  1333. PageSetupUI.HiddenRefresh();
  1334. }
  1335. // Token: 0x060011EC RID: 4588 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1336. public void UiHiddenOtherFeedback(bool Value)
  1337. {
  1338. PageSetupUI.HiddenRefresh();
  1339. }
  1340. // Token: 0x060011ED RID: 4589 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1341. public void UiHiddenOtherVote(bool Value)
  1342. {
  1343. PageSetupUI.HiddenRefresh();
  1344. }
  1345. // Token: 0x060011EE RID: 4590 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1346. public void UiHiddenOtherAbout(bool Value)
  1347. {
  1348. PageSetupUI.HiddenRefresh();
  1349. }
  1350. // Token: 0x060011EF RID: 4591 RVA: 0x0000AC5F File Offset: 0x00008E5F
  1351. public void UiHiddenOtherTest(bool Value)
  1352. {
  1353. PageSetupUI.HiddenRefresh();
  1354. }
  1355. // Token: 0x060011F0 RID: 4592 RVA: 0x0000AC66 File Offset: 0x00008E66
  1356. public void SystemDebugMode(bool Value)
  1357. {
  1358. ModBase._TokenRepository = Value;
  1359. }
  1360. // Token: 0x060011F1 RID: 4593 RVA: 0x00080E2C File Offset: 0x0007F02C
  1361. public void SystemDebugAnim(int Value)
  1362. {
  1363. ModAnimation.m_Task = ((Value >= 30) ? 200.0 : ModBase.MathClamp((double)Value * 0.1 + 0.1, 0.1, 3.0));
  1364. }
  1365. // Token: 0x060011F2 RID: 4594 RVA: 0x0000AC6E File Offset: 0x00008E6E
  1366. public void VersionRamType(int Type)
  1367. {
  1368. if (ModMain.composerRepository != null)
  1369. {
  1370. ModMain.composerRepository.RamType(Type);
  1371. }
  1372. }
  1373. // Token: 0x060011F3 RID: 4595 RVA: 0x00080E7C File Offset: 0x0007F07C
  1374. public void VersionServerLogin(int Type)
  1375. {
  1376. if (ModMain.composerRepository != null)
  1377. {
  1378. ModBase.WriteIni(ModMinecraft.m_ProxyTests + "PCL.ini", "VersionCache", "");
  1379. if (PageVersionLeft._InstanceConfig != null)
  1380. {
  1381. PageVersionLeft._InstanceConfig = new ModMinecraft.McVersion(PageVersionLeft._InstanceConfig.Name).Load();
  1382. ModLoader.LoaderFolderRun(ModMinecraft._ListenerTests, ModMinecraft.m_ProxyTests, ModLoader.LoaderFolderRunType.ForceRun, 1, "versions\\", false);
  1383. }
  1384. }
  1385. }
  1386. // Token: 0x04000937 RID: 2359
  1387. private readonly Dictionary<string, ModSetup.SetupEntry> m_ValThread;
  1388. // Token: 0x020001AE RID: 430
  1389. private enum SetupSource
  1390. {
  1391. // Token: 0x04000939 RID: 2361
  1392. Normal,
  1393. // Token: 0x0400093A RID: 2362
  1394. Registry,
  1395. // Token: 0x0400093B RID: 2363
  1396. Version
  1397. }
  1398. // Token: 0x020001AF RID: 431
  1399. private class SetupEntry
  1400. {
  1401. // Token: 0x060011F5 RID: 4597 RVA: 0x00080EE8 File Offset: 0x0007F0E8
  1402. public SetupEntry(object Value, object Source = 0, object Encoded = false)
  1403. {
  1404. this.databaseMap = 0;
  1405. try
  1406. {
  1407. this.m_TokenizerMap = RuntimeHelpers.GetObjectValue(Value);
  1408. this._MappingMap = Conversions.ToBoolean(Encoded);
  1409. this.Value = RuntimeHelpers.GetObjectValue(Value);
  1410. this.Source = (ModSetup.SetupSource)Conversions.ToInteger(Source);
  1411. this.Type = (Value ?? new object()).GetType();
  1412. this.filterMap = RuntimeHelpers.GetObjectValue(Conversions.ToBoolean(Encoded) ? ModSecret.SecretEncrypt(Conversions.ToString(Value), "PCL" + ModBase._TagRepository) : Value);
  1413. }
  1414. catch (Exception ex)
  1415. {
  1416. ModBase.Log(ex, "初始化 SetupEntry 失败", ModBase.LogLevel.Feedback, "出现错误");
  1417. }
  1418. }
  1419. // Token: 0x0400093C RID: 2364
  1420. public bool _MappingMap;
  1421. // Token: 0x0400093D RID: 2365
  1422. public object m_TokenizerMap;
  1423. // Token: 0x0400093E RID: 2366
  1424. public object filterMap;
  1425. // Token: 0x0400093F RID: 2367
  1426. public object Value;
  1427. // Token: 0x04000940 RID: 2368
  1428. public ModSetup.SetupSource Source;
  1429. // Token: 0x04000941 RID: 2369
  1430. public byte databaseMap;
  1431. // Token: 0x04000942 RID: 2370
  1432. public Type Type;
  1433. }
  1434. }
  1435. }