2
0

ModMain.cs 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Runtime.CompilerServices;
  8. using System.Runtime.InteropServices;
  9. using System.Text;
  10. using System.Text.RegularExpressions;
  11. using System.Threading;
  12. using System.Windows;
  13. using System.Windows.Controls;
  14. using System.Windows.Input;
  15. using System.Windows.Interop;
  16. using System.Windows.Media;
  17. using System.Windows.Threading;
  18. using Microsoft.VisualBasic;
  19. using Microsoft.VisualBasic.CompilerServices;
  20. using Newtonsoft.Json.Linq;
  21. using PCL.My;
  22. namespace PCL
  23. {
  24. // Token: 0x020001F2 RID: 498
  25. [StandardModule]
  26. public sealed class ModMain
  27. {
  28. // Token: 0x06001775 RID: 6005 RVA: 0x00097CA8 File Offset: 0x00095EA8
  29. public static void Hint(string Text, ModMain.HintType Type = ModMain.HintType.Info, bool Log = true)
  30. {
  31. if (ModMain.paramsIterator == null)
  32. {
  33. ModMain.paramsIterator = new List<ModMain.HintMessage>();
  34. }
  35. ModMain.paramsIterator.Add(new ModMain.HintMessage
  36. {
  37. regMap = (Text ?? ""),
  38. Type = Type,
  39. m_ProductMap = Log
  40. });
  41. }
  42. // Token: 0x06001776 RID: 6006 RVA: 0x00097CFC File Offset: 0x00095EFC
  43. private static void HintTick()
  44. {
  45. try
  46. {
  47. if (Enumerable.Any<ModMain.HintMessage>(ModMain.paramsIterator))
  48. {
  49. while (Enumerable.Any<ModMain.HintMessage>(ModMain.paramsIterator))
  50. {
  51. ModMain._Closure$__5-0 CS$<>8__locals1 = new ModMain._Closure$__5-0(CS$<>8__locals1);
  52. ModMain.HintMessage hintMessage = ModMain.paramsIterator[0];
  53. hintMessage.regMap = hintMessage.regMap.Replace("\r\n", " ").Replace("\r", " ").Replace("\n", " ");
  54. if (ModMain._ProcessIterator.PanHint.Children.Count < 20)
  55. {
  56. CS$<>8__locals1.$VB$Local_DoubleStack = null;
  57. try
  58. {
  59. foreach (object obj in ModMain._ProcessIterator.PanHint.Children)
  60. {
  61. Border border = (Border)obj;
  62. if (Conversions.ToBoolean(Conversions.ToBoolean(NewLateBinding.LateIndexGet(border.Tag, new object[]
  63. {
  64. 0
  65. }, null)) && Operators.CompareString(((TextBlock)border.Child).Text, hintMessage.regMap, false) == 0))
  66. {
  67. CS$<>8__locals1.$VB$Local_DoubleStack = border;
  68. }
  69. }
  70. }
  71. finally
  72. {
  73. IEnumerator enumerator;
  74. if (enumerator is IDisposable)
  75. {
  76. (enumerator as IDisposable).Dispose();
  77. }
  78. }
  79. CS$<>8__locals1.$VB$Local_Percent = 0.3;
  80. ModMain.HintType type = hintMessage.Type;
  81. if (type != ModMain.HintType.Info)
  82. {
  83. if (type != ModMain.HintType.Finish)
  84. {
  85. CS$<>8__locals1.$VB$Local_TargetColor0 = new ModBase.MyColor(215.0, 255.0, 53.0, 11.0);
  86. CS$<>8__locals1.$VB$Local_TargetColor1 = new ModBase.MyColor(215.0, 255.0, 43.0, 0.0);
  87. }
  88. else
  89. {
  90. CS$<>8__locals1.$VB$Local_TargetColor0 = new ModBase.MyColor(215.0, 33.0, 177.0, 33.0);
  91. CS$<>8__locals1.$VB$Local_TargetColor1 = new ModBase.MyColor(215.0, 29.0, 160.0, 29.0);
  92. }
  93. }
  94. else
  95. {
  96. CS$<>8__locals1.$VB$Local_TargetColor0 = new ModBase.MyColor(215.0, 37.0, 155.0, 252.0);
  97. CS$<>8__locals1.$VB$Local_TargetColor1 = new ModBase.MyColor(215.0, 10.0, 142.0, 252.0);
  98. }
  99. if (!Information.IsNothing(CS$<>8__locals1.$VB$Local_DoubleStack))
  100. {
  101. if (!ModAnimation.AniIsRun(Conversions.ToString(Operators.ConcatenateObject("Hint Show ", NewLateBinding.LateIndexGet(CS$<>8__locals1.$VB$Local_DoubleStack.Tag, new object[]
  102. {
  103. 1
  104. }, null)))))
  105. {
  106. ModAnimation.AniStop(Conversions.ToString(Operators.ConcatenateObject("Hint Hide ", NewLateBinding.LateIndexGet(CS$<>8__locals1.$VB$Local_DoubleStack.Tag, new object[]
  107. {
  108. 1
  109. }, null))));
  110. double a = (800.0 + ModBase.MathClamp((double)hintMessage.regMap.Length, 5.0, 23.0) * 180.0) * ModAnimation.m_Task;
  111. ModAnimation.AniStart(new ModAnimation.AniData[]
  112. {
  113. ModAnimation.AaX(CS$<>8__locals1.$VB$Local_DoubleStack, -12.0 - CS$<>8__locals1.$VB$Local_DoubleStack.Margin.Left, 50, 0, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), false),
  114. ModAnimation.AaX(CS$<>8__locals1.$VB$Local_DoubleStack, -8.0, 50, 50, new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Middle), false),
  115. ModAnimation.AaX(CS$<>8__locals1.$VB$Local_DoubleStack, 8.0, 50, 100, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), false),
  116. ModAnimation.AaX(CS$<>8__locals1.$VB$Local_DoubleStack, -8.0, 50, 150, new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Middle), false),
  117. ModAnimation.AaDouble(delegate(object i)
  118. {
  119. CS$<>8__locals1.$VB$Local_Percent = Conversions.ToDouble(Operators.AddObject(CS$<>8__locals1.$VB$Local_Percent, i));
  120. LinearGradientBrush linearGradientBrush = (LinearGradientBrush)CS$<>8__locals1.$VB$Local_DoubleStack.Background;
  121. linearGradientBrush.GradientStops[0].Color = CS$<>8__locals1.$VB$Local_TargetColor0 * CS$<>8__locals1.$VB$Local_Percent + new ModBase.MyColor(255.0, 255.0, 255.0) * (1.0 - CS$<>8__locals1.$VB$Local_Percent);
  122. linearGradientBrush.GradientStops[1].Color = CS$<>8__locals1.$VB$Local_TargetColor1 * CS$<>8__locals1.$VB$Local_Percent + new ModBase.MyColor(255.0, 255.0, 255.0) * (1.0 - CS$<>8__locals1.$VB$Local_Percent);
  123. }, 0.7, 250, 0, null, false),
  124. ModAnimation.AaX(CS$<>8__locals1.$VB$Local_DoubleStack, -50.0, 200, checked((int)Math.Round(a)), new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Middle), false),
  125. ModAnimation.AaOpacity(CS$<>8__locals1.$VB$Local_DoubleStack, -1.0, 150, checked((int)Math.Round(a)), null, false),
  126. ModAnimation.AaCode(delegate
  127. {
  128. NewLateBinding.LateIndexSetComplex(CS$<>8__locals1.$VB$Local_DoubleStack.Tag, new object[]
  129. {
  130. 0,
  131. false
  132. }, null, false, true);
  133. }, checked((int)Math.Round(a)), false),
  134. ModAnimation.AaHeight(CS$<>8__locals1.$VB$Local_DoubleStack, -26.0, 100, 0, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), true),
  135. ModAnimation.AaCode(delegate
  136. {
  137. ModMain._ProcessIterator.PanHint.Children.Remove(CS$<>8__locals1.$VB$Local_DoubleStack);
  138. }, 0, true)
  139. }, Conversions.ToString(Operators.ConcatenateObject("Hint Hide ", NewLateBinding.LateIndexGet(CS$<>8__locals1.$VB$Local_DoubleStack.Tag, new object[]
  140. {
  141. 1
  142. }, null))), false);
  143. }
  144. }
  145. else
  146. {
  147. ModMain._Closure$__5-1 CS$<>8__locals2 = new ModMain._Closure$__5-1(CS$<>8__locals2);
  148. CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2 = CS$<>8__locals1;
  149. CS$<>8__locals2.$VB$Local_NewHintControl = new Border
  150. {
  151. Tag = new object[]
  152. {
  153. true,
  154. ModBase.GetUuid()
  155. },
  156. Margin = new Thickness(-70.0, 0.0, 20.0, 0.0),
  157. Opacity = 0.0,
  158. Height = 0.0,
  159. HorizontalAlignment = HorizontalAlignment.Left,
  160. CornerRadius = new CornerRadius(0.0, 6.0, 6.0, 0.0)
  161. };
  162. CS$<>8__locals2.$VB$Local_NewHintControl.Background = new LinearGradientBrush(new GradientStopCollection(new List<GradientStop>
  163. {
  164. new GradientStop(CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_TargetColor0 * CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_Percent + new ModBase.MyColor(255.0, 255.0, 255.0) * (1.0 - CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_Percent), 0.0),
  165. new GradientStop(CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_TargetColor1 * CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_Percent + new ModBase.MyColor(255.0, 255.0, 255.0) * (1.0 - CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_Percent), 1.0)
  166. }), 90.0);
  167. CS$<>8__locals2.$VB$Local_NewHintControl.Child = new TextBlock
  168. {
  169. TextTrimming = TextTrimming.CharacterEllipsis,
  170. FontSize = 13.0,
  171. Text = hintMessage.regMap,
  172. Foreground = new ModBase.MyColor(255.0, 255.0, 255.0),
  173. Margin = new Thickness(33.0, 5.0, 8.0, 5.0)
  174. };
  175. ModMain._ProcessIterator.PanHint.Children.Add(CS$<>8__locals2.$VB$Local_NewHintControl);
  176. List<ModAnimation.AniData> list = new List<ModAnimation.AniData>();
  177. if (ModMain._ProcessIterator.PanHint.Children.Count > 1)
  178. {
  179. list.Add(ModAnimation.AaHeight(CS$<>8__locals2.$VB$Local_NewHintControl, 26.0, 150, 0, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), false));
  180. }
  181. else
  182. {
  183. CS$<>8__locals2.$VB$Local_NewHintControl.Height = 26.0;
  184. }
  185. list.AddRange(new ModAnimation.AniData[]
  186. {
  187. ModAnimation.AaX(CS$<>8__locals2.$VB$Local_NewHintControl, 30.0, 400, 0, new ModAnimation.AniEaseOutElastic(ModAnimation.AniEasePower.Weak), false),
  188. ModAnimation.AaX(CS$<>8__locals2.$VB$Local_NewHintControl, 20.0, 200, 0, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), false),
  189. ModAnimation.AaOpacity(CS$<>8__locals2.$VB$Local_NewHintControl, 1.0, 100, 0, null, false),
  190. ModAnimation.AaDouble(delegate(object i)
  191. {
  192. CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_Percent = Conversions.ToDouble(Operators.AddObject(CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_Percent, i));
  193. LinearGradientBrush linearGradientBrush = (LinearGradientBrush)CS$<>8__locals2.$VB$Local_NewHintControl.Background;
  194. linearGradientBrush.GradientStops[0].Color = CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_TargetColor0 * CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_Percent + new ModBase.MyColor(255.0, 255.0, 255.0) * (1.0 - CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_Percent);
  195. linearGradientBrush.GradientStops[1].Color = CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_TargetColor1 * CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_Percent + new ModBase.MyColor(255.0, 255.0, 255.0) * (1.0 - CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_Percent);
  196. }, 0.7, 250, 100, null, false)
  197. });
  198. ModAnimation.AniStart(list, Conversions.ToString(Operators.ConcatenateObject("Hint Show ", NewLateBinding.LateIndexGet(CS$<>8__locals2.$VB$Local_NewHintControl.Tag, new object[]
  199. {
  200. 1
  201. }, null))), false);
  202. double a2 = (800.0 + ModBase.MathClamp((double)hintMessage.regMap.Length, 5.0, 23.0) * 180.0) * ModAnimation.m_Task;
  203. ModAnimation.AniStart(checked(new ModAnimation.AniData[]
  204. {
  205. ModAnimation.AaX(CS$<>8__locals2.$VB$Local_NewHintControl, -50.0, 200, (int)Math.Round(a2), new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Middle), false),
  206. ModAnimation.AaOpacity(CS$<>8__locals2.$VB$Local_NewHintControl, -1.0, 150, (int)Math.Round(a2), null, false),
  207. ModAnimation.AaCode(delegate
  208. {
  209. NewLateBinding.LateIndexSetComplex(CS$<>8__locals2.$VB$Local_NewHintControl.Tag, new object[]
  210. {
  211. 0,
  212. false
  213. }, null, false, true);
  214. }, (int)Math.Round(a2), false),
  215. ModAnimation.AaHeight(CS$<>8__locals2.$VB$Local_NewHintControl, -26.0, 100, 0, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), true),
  216. ModAnimation.AaCode(delegate
  217. {
  218. ModMain._ProcessIterator.PanHint.Children.Remove(CS$<>8__locals2.$VB$Local_NewHintControl);
  219. }, 0, true)
  220. }), Conversions.ToString(Operators.ConcatenateObject("Hint Hide ", NewLateBinding.LateIndexGet(CS$<>8__locals2.$VB$Local_NewHintControl.Tag, new object[]
  221. {
  222. 1
  223. }, null))), false);
  224. }
  225. }
  226. if (hintMessage.m_ProductMap)
  227. {
  228. ModBase.Log("[UI] 弹出提示:" + hintMessage.regMap, ModBase.LogLevel.Normal, "出现错误");
  229. }
  230. ModMain.paramsIterator.RemoveAt(0);
  231. }
  232. }
  233. }
  234. catch (Exception ex)
  235. {
  236. ModBase.Log(ex, "显示弹出提示失败", ModBase.LogLevel.Normal, "出现错误");
  237. }
  238. }
  239. // Token: 0x06001777 RID: 6007 RVA: 0x0009878C File Offset: 0x0009698C
  240. private static void HideAllHint()
  241. {
  242. try
  243. {
  244. IEnumerator enumerator = ModMain._ProcessIterator.PanHint.Children.GetEnumerator();
  245. while (enumerator.MoveNext())
  246. {
  247. ModMain._Closure$__6-0 CS$<>8__locals1 = new ModMain._Closure$__6-0(CS$<>8__locals1);
  248. CS$<>8__locals1.$VB$Local_Control = (Border)enumerator.Current;
  249. CS$<>8__locals1.$VB$Local_Control.IsHitTestVisible = false;
  250. ModAnimation.AniStart(new ModAnimation.AniData[]
  251. {
  252. ModAnimation.AaX(CS$<>8__locals1.$VB$Local_Control, -50.0, 200, 0, new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Middle), false),
  253. ModAnimation.AaOpacity(CS$<>8__locals1.$VB$Local_Control, -1.0, 150, 0, new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Middle), false),
  254. ModAnimation.AaCode(delegate
  255. {
  256. NewLateBinding.LateIndexSetComplex(CS$<>8__locals1.$VB$Local_Control.Tag, new object[]
  257. {
  258. 0,
  259. false
  260. }, null, false, true);
  261. }, 0, false),
  262. ModAnimation.AaHeight(CS$<>8__locals1.$VB$Local_Control, -26.0, 100, 0, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), true),
  263. ModAnimation.AaCode(delegate
  264. {
  265. ModMain._ProcessIterator.PanHint.Children.Remove(CS$<>8__locals1.$VB$Local_Control);
  266. }, 0, true)
  267. }, Conversions.ToString(Operators.ConcatenateObject("Hint Hide ", NewLateBinding.LateIndexGet(CS$<>8__locals1.$VB$Local_Control.Tag, new object[]
  268. {
  269. 1
  270. }, null))), false);
  271. }
  272. }
  273. finally
  274. {
  275. IEnumerator enumerator;
  276. if (enumerator is IDisposable)
  277. {
  278. (enumerator as IDisposable).Dispose();
  279. }
  280. }
  281. }
  282. // Token: 0x06001778 RID: 6008 RVA: 0x000988F8 File Offset: 0x00096AF8
  283. public static int MyMsgBox(string Caption, string Title = "提示", string Button1 = "确定", string Button2 = "", string Button3 = "", bool IsWarn = false, bool HighLight = true, bool ForceWait = false, Action Button1Action = null, Action Button2Action = null, Action Button3Action = null)
  284. {
  285. ModMain.MyMsgBoxConverter myMsgBoxConverter = new ModMain.MyMsgBoxConverter
  286. {
  287. Type = ModMain.MyMsgBoxType.Text,
  288. m_BridgeMap = Button1,
  289. itemMap = Button2,
  290. reponseMap = Button3,
  291. listenerMap = Caption,
  292. _ClassMap = IsWarn,
  293. Title = Title,
  294. m_ObjectMap = HighLight,
  295. m_PolicyMap = true,
  296. m_GlobalMap = Button1Action,
  297. m_ExceptionMap = Button2Action,
  298. utilsMap = Button3Action
  299. };
  300. ModMain.m_DispatcherIterator.Add(myMsgBoxConverter);
  301. if (ModBase.RunInUi())
  302. {
  303. ModMain.MyMsgBoxTick();
  304. }
  305. checked
  306. {
  307. int result;
  308. if (Button2.Length <= 0 && !ForceWait)
  309. {
  310. result = 1;
  311. }
  312. else
  313. {
  314. if (ModMain._ProcessIterator != null && (ModMain._ProcessIterator.PanMsg != null || !ModBase.RunInUi()))
  315. {
  316. try
  317. {
  318. ModMain._ProcessIterator.DragStop();
  319. ComponentDispatcher.PushModal();
  320. Dispatcher.PushFrame(myMsgBoxConverter._OrderMap);
  321. goto IL_195;
  322. }
  323. finally
  324. {
  325. ComponentDispatcher.PopModal();
  326. }
  327. }
  328. ModMain.m_DispatcherIterator.Remove(myMsgBoxConverter);
  329. if (Button2.Length > 0)
  330. {
  331. MsgBoxResult msgBoxResult = Interaction.MsgBox(Caption, ((Button3.Length > 0) ? MsgBoxStyle.YesNoCancel : MsgBoxStyle.YesNo) + (IsWarn ? 16 : 32), Title);
  332. if (msgBoxResult != MsgBoxResult.Cancel)
  333. {
  334. if (msgBoxResult != MsgBoxResult.Yes)
  335. {
  336. if (msgBoxResult == MsgBoxResult.No)
  337. {
  338. myMsgBoxConverter.schemaMap = 2;
  339. }
  340. }
  341. else
  342. {
  343. myMsgBoxConverter.schemaMap = 1;
  344. }
  345. }
  346. else
  347. {
  348. myMsgBoxConverter.schemaMap = 3;
  349. }
  350. }
  351. else
  352. {
  353. Interaction.MsgBox(Caption, MsgBoxStyle.OkOnly + (IsWarn ? 16 : 32), Title);
  354. myMsgBoxConverter.schemaMap = 1;
  355. }
  356. ModBase.Log(string.Concat(new string[]
  357. {
  358. "[Control] 主窗体加载完成前出现意料外的等待弹窗:",
  359. Button1,
  360. ",",
  361. Button2,
  362. ",",
  363. Button3
  364. }), ModBase.LogLevel.Debug, "出现错误");
  365. IL_195:
  366. ModBase.Log(Conversions.ToString(Operators.ConcatenateObject("[Control] 普通弹框返回:", myMsgBoxConverter.schemaMap ?? "null")), ModBase.LogLevel.Normal, "出现错误");
  367. result = Conversions.ToInteger(myMsgBoxConverter.schemaMap);
  368. }
  369. return result;
  370. }
  371. }
  372. // Token: 0x06001779 RID: 6009 RVA: 0x00098AE0 File Offset: 0x00096CE0
  373. public static string MyMsgBoxInput(string Title, string Text = "", string DefaultInput = "", Collection<Validate> ValidateRules = null, string HintText = "", string Button1 = "确定", string Button2 = "取消", bool IsWarn = false)
  374. {
  375. ModMain.MyMsgBoxConverter myMsgBoxConverter = new ModMain.MyMsgBoxConverter
  376. {
  377. listenerMap = Text,
  378. m_ValueMap = HintText,
  379. Type = ModMain.MyMsgBoxType.Input,
  380. m_VisitorMap = (ValidateRules ?? new Collection<Validate>()),
  381. m_BridgeMap = Button1,
  382. itemMap = Button2,
  383. m_CollectionMap = DefaultInput,
  384. _ClassMap = IsWarn,
  385. Title = Title
  386. };
  387. ModMain.m_DispatcherIterator.Add(myMsgBoxConverter);
  388. try
  389. {
  390. if (ModMain._ProcessIterator != null)
  391. {
  392. ModMain._ProcessIterator.DragStop();
  393. }
  394. ComponentDispatcher.PushModal();
  395. Dispatcher.PushFrame(myMsgBoxConverter._OrderMap);
  396. }
  397. finally
  398. {
  399. ComponentDispatcher.PopModal();
  400. }
  401. ModBase.Log(Conversions.ToString(Operators.ConcatenateObject("[Control] 输入弹框返回:", myMsgBoxConverter.schemaMap ?? "null")), ModBase.LogLevel.Normal, "出现错误");
  402. return Conversions.ToString(myMsgBoxConverter.schemaMap);
  403. }
  404. // Token: 0x0600177A RID: 6010 RVA: 0x00098BB8 File Offset: 0x00096DB8
  405. public static int? MyMsgBoxSelect(List<IMyRadio> Selections, string Title = "提示", string Button1 = "确定", string Button2 = "", bool IsWarn = false)
  406. {
  407. ModMain.MyMsgBoxConverter myMsgBoxConverter = new ModMain.MyMsgBoxConverter
  408. {
  409. Type = ModMain.MyMsgBoxType.Select,
  410. m_BridgeMap = Button1,
  411. itemMap = Button2,
  412. m_CollectionMap = Selections,
  413. _ClassMap = IsWarn,
  414. Title = Title
  415. };
  416. ModMain.m_DispatcherIterator.Add(myMsgBoxConverter);
  417. try
  418. {
  419. if (ModMain._ProcessIterator != null)
  420. {
  421. ModMain._ProcessIterator.DragStop();
  422. }
  423. ComponentDispatcher.PushModal();
  424. Dispatcher.PushFrame(myMsgBoxConverter._OrderMap);
  425. }
  426. finally
  427. {
  428. ComponentDispatcher.PopModal();
  429. }
  430. ModBase.Log(Conversions.ToString(Operators.ConcatenateObject("[Control] 选择弹框返回:", myMsgBoxConverter.schemaMap ?? "null")), ModBase.LogLevel.Normal, "出现错误");
  431. return (int?)myMsgBoxConverter.schemaMap;
  432. }
  433. // Token: 0x0600177B RID: 6011 RVA: 0x00098C70 File Offset: 0x00096E70
  434. public static void MyMsgBoxTick()
  435. {
  436. try
  437. {
  438. if (ModMain._ProcessIterator != null && ModMain._ProcessIterator.PanMsg != null)
  439. {
  440. if (ModMain._ProcessIterator.WindowState != WindowState.Minimized)
  441. {
  442. if (ModMain._ProcessIterator.PanMsg.Children.Count > 0)
  443. {
  444. ModMain._ProcessIterator.PanMsg.Visibility = Visibility.Visible;
  445. }
  446. else if (Enumerable.Any<ModMain.MyMsgBoxConverter>(ModMain.m_DispatcherIterator))
  447. {
  448. ModMain._ProcessIterator.PanMsg.Visibility = Visibility.Visible;
  449. switch (ModMain.m_DispatcherIterator[0].Type)
  450. {
  451. case ModMain.MyMsgBoxType.Text:
  452. ModMain._ProcessIterator.PanMsg.Children.Add(new MyMsgText(ModMain.m_DispatcherIterator[0]));
  453. break;
  454. case ModMain.MyMsgBoxType.Select:
  455. ModMain._ProcessIterator.PanMsg.Children.Add(new MyMsgSelect(ModMain.m_DispatcherIterator[0]));
  456. break;
  457. case ModMain.MyMsgBoxType.Input:
  458. ModMain._ProcessIterator.PanMsg.Children.Add(new MyMsgInput(ModMain.m_DispatcherIterator[0]));
  459. break;
  460. case ModMain.MyMsgBoxType.Login:
  461. ModMain._ProcessIterator.PanMsg.Children.Add(new MyMsgLogin(ModMain.m_DispatcherIterator[0]));
  462. break;
  463. }
  464. ModMain.m_DispatcherIterator.RemoveAt(0);
  465. }
  466. else if (ModMain._ProcessIterator.PanMsg.Visibility != Visibility.Collapsed)
  467. {
  468. ModMain._ProcessIterator.PanMsg.Visibility = Visibility.Collapsed;
  469. }
  470. }
  471. }
  472. }
  473. catch (Exception ex)
  474. {
  475. ModBase.Log(ex, "处理等待中的弹窗失败", ModBase.LogLevel.Feedback, "出现错误");
  476. }
  477. }
  478. // Token: 0x0600177C RID: 6012 RVA: 0x00098E2C File Offset: 0x0009702C
  479. private static void HelpLoad(ModLoader.LoaderTask<int, List<ModMain.HelpEntry>> Loader)
  480. {
  481. object obj = ModMain.testRepository;
  482. ObjectFlowControl.CheckForSyncLockOnValueType(obj);
  483. checked
  484. {
  485. lock (obj)
  486. {
  487. try
  488. {
  489. ModMain.HelpTryExtract();
  490. List<string> list = new List<string>();
  491. try
  492. {
  493. List<string> list2 = new List<string>();
  494. if (Directory.Exists(ModBase.Path + "PCL\\Help\\"))
  495. {
  496. try
  497. {
  498. foreach (FileInfo fileInfo in ModBase.EnumerateFiles(ModBase.Path + "PCL\\Help\\"))
  499. {
  500. string left = fileInfo.Extension.ToLower();
  501. if (Operators.CompareString(left, ".helpignore", false) != 0)
  502. {
  503. if (Operators.CompareString(left, ".json", false) == 0)
  504. {
  505. list.Add(fileInfo.FullName);
  506. }
  507. }
  508. else
  509. {
  510. ModBase.Log("[Help] 发现 .helpignore 文件:" + fileInfo.FullName, ModBase.LogLevel.Normal, "出现错误");
  511. string[] array = ModBase.ReadFile(fileInfo.FullName, null).Split("\r\n".ToCharArray());
  512. for (int i = 0; i < array.Length; i++)
  513. {
  514. string text = array[i].BeforeFirst("#", false).Trim();
  515. if (!string.IsNullOrWhiteSpace(text))
  516. {
  517. list2.Add(text);
  518. if (ModBase._TokenRepository)
  519. {
  520. ModBase.Log("[Help] > " + text, ModBase.LogLevel.Normal, "出现错误");
  521. }
  522. }
  523. }
  524. }
  525. }
  526. }
  527. finally
  528. {
  529. IEnumerator<FileInfo> enumerator;
  530. if (enumerator != null)
  531. {
  532. enumerator.Dispose();
  533. }
  534. }
  535. }
  536. ModBase.Log("[Help] 已扫描 PCL 文件夹下的帮助文件,目前总计 " + Conversions.ToString(list.Count) + " 条", ModBase.LogLevel.Normal, "出现错误");
  537. try
  538. {
  539. IEnumerator<FileInfo> enumerator2 = ModBase.EnumerateFiles(ModBase.m_DecoratorRepository + "Help").GetEnumerator();
  540. IL_286:
  541. while (enumerator2.MoveNext())
  542. {
  543. FileInfo fileInfo2 = enumerator2.Current;
  544. if (Operators.CompareString(fileInfo2.Extension.ToLower(), ".json", false) == 0 && !fileInfo2.Directory.FullName.Replace(ModBase.m_DecoratorRepository + "Help", "").Contains("\\."))
  545. {
  546. string text2 = fileInfo2.FullName.Replace(ModBase.m_DecoratorRepository + "Help\\", "");
  547. try
  548. {
  549. foreach (string text3 in list2)
  550. {
  551. if (ModBase.RegexCheck(text2, text3, 0))
  552. {
  553. if (ModBase._TokenRepository)
  554. {
  555. ModBase.Log("[Help] 已忽略 " + text2 + ":" + text3, ModBase.LogLevel.Normal, "出现错误");
  556. }
  557. goto IL_286;
  558. }
  559. }
  560. }
  561. finally
  562. {
  563. List<string>.Enumerator enumerator3;
  564. ((IDisposable)enumerator3).Dispose();
  565. }
  566. list.Add(fileInfo2.FullName);
  567. }
  568. }
  569. }
  570. finally
  571. {
  572. IEnumerator<FileInfo> enumerator2;
  573. if (enumerator2 != null)
  574. {
  575. enumerator2.Dispose();
  576. }
  577. }
  578. ModBase.Log("[Help] 已扫描缓存文件夹下的帮助文件,目前总计 " + Conversions.ToString(list.Count) + " 条", ModBase.LogLevel.Normal, "出现错误");
  579. }
  580. catch (Exception ex)
  581. {
  582. ModBase.Log(ex, "检查帮助文件夹失败", ModBase.LogLevel.Msgbox, "出现错误");
  583. }
  584. if (!Loader.IsAborted)
  585. {
  586. List<ModMain.HelpEntry> list3 = new List<ModMain.HelpEntry>();
  587. try
  588. {
  589. foreach (string text4 in list)
  590. {
  591. try
  592. {
  593. ModMain.HelpEntry helpEntry = new ModMain.HelpEntry(text4);
  594. list3.Add(helpEntry);
  595. if (ModBase._TokenRepository)
  596. {
  597. ModBase.Log("[Help] 已加载的帮助条目:" + helpEntry.Title + " ← " + text4, ModBase.LogLevel.Normal, "出现错误");
  598. }
  599. }
  600. catch (Exception ex2)
  601. {
  602. ModBase.Log(ex2, "初始化帮助条目失败(" + text4 + ")", ModBase.LogLevel.Msgbox, "出现错误");
  603. }
  604. }
  605. }
  606. finally
  607. {
  608. List<string>.Enumerator enumerator4;
  609. ((IDisposable)enumerator4).Dispose();
  610. }
  611. if (!Enumerable.Any<ModMain.HelpEntry>(list3))
  612. {
  613. throw new Exception("未找到可用的帮助;若不需要帮助页面,可以在 设置 → 个性化 → 功能隐藏 中将其隐藏");
  614. }
  615. if (!Loader.IsAborted)
  616. {
  617. Loader.Output = list3;
  618. }
  619. }
  620. }
  621. catch (Exception ex3)
  622. {
  623. ModBase.Log(ex3, "帮助列表初始化失败", ModBase.LogLevel.Debug, "出现错误");
  624. throw;
  625. }
  626. }
  627. }
  628. }
  629. // Token: 0x0600177D RID: 6013 RVA: 0x000992DC File Offset: 0x000974DC
  630. public static void HelpTryExtract()
  631. {
  632. if (Operators.ConditionalCompareObjectNotEqual(ModBase.m_IdentifierRepository.Get("SystemHelpVersion", null), 347, false) || !File.Exists(ModBase.m_DecoratorRepository + "Help\\启动器\\备份设置.xaml"))
  633. {
  634. ModBase.DeleteDirectory(ModBase.m_DecoratorRepository + "Help", false);
  635. Directory.CreateDirectory(ModBase.m_DecoratorRepository + "Help");
  636. ModBase.WriteFile(ModBase.m_DecoratorRepository + "Cache\\Help.zip", ModBase.GetResources("Help"), false);
  637. ModBase.ExtractFile(ModBase.m_DecoratorRepository + "Cache\\Help.zip", ModBase.m_DecoratorRepository + "Help", Encoding.UTF8, null);
  638. ModBase.m_IdentifierRepository.Set("SystemHelpVersion", 347, false, null);
  639. ModBase.Log("[Help] 已解压内置帮助文件,目前状态:" + Conversions.ToString(File.Exists(ModBase.m_DecoratorRepository + "Help\\启动器\\备份设置.xaml")), ModBase.LogLevel.Debug, "出现错误");
  640. }
  641. }
  642. // Token: 0x0600177E RID: 6014 RVA: 0x000993E0 File Offset: 0x000975E0
  643. public static string HelpArgumentReplace(string Xaml)
  644. {
  645. return ModBase.RegexReplaceEach(ModBase.RegexReplaceEach(Xaml.Replace("{path}", ModBase.smethod_3(ModBase.Path)), (ModMain._Closure$__.$IR64-1 == null) ? (ModMain._Closure$__.$IR64-1 = ((Match a0) => ((ModMain._Closure$__.$I64-0 == null) ? (ModMain._Closure$__.$I64-0 = (() => ModBase.smethod_3(PageOtherTest.GetRandomHint()))) : ModMain._Closure$__.$I64-0)())) : ModMain._Closure$__.$IR64-1, "\\{hint\\}", 0), (ModMain._Closure$__.$IR64-2 == null) ? (ModMain._Closure$__.$IR64-2 = ((Match a0) => ((ModMain._Closure$__.$I64-1 == null) ? (ModMain._Closure$__.$I64-1 = (() => ModBase.smethod_3(PageOtherTest.GetRandomCave()))) : ModMain._Closure$__.$I64-1)())) : ModMain._Closure$__.$IR64-2, "\\{cave\\}", 0);
  646. }
  647. // Token: 0x0600177F RID: 6015 RVA: 0x00099460 File Offset: 0x00097660
  648. private static void TimerFool()
  649. {
  650. try
  651. {
  652. if (ModMain.recordIterator != null && ModMain.recordIterator.AprilPosTrans != null && ModMain._ProcessIterator.expressionIterator != null)
  653. {
  654. if (!ModMain.m_ErrorRepository && !(ModMain._ProcessIterator._MethodIterator != FormMain.PageType.Launch) && ModAnimation.CalcParser() == 0 && ModMain.recordIterator.BtnLaunch.IsLoaded)
  655. {
  656. Point position = ModMain._ProcessIterator.expressionIterator.GetPosition(ModMain._ProcessIterator);
  657. double num;
  658. double num2;
  659. Vector vector;
  660. Vector vector3;
  661. checked
  662. {
  663. if (position == ModMain.m_MockRepository)
  664. {
  665. ModMain._SpecificationRepository++;
  666. }
  667. else
  668. {
  669. ModMain.m_MockRepository = position;
  670. ModMain._SpecificationRepository = 0;
  671. }
  672. num = ModMain.recordIterator.BtnLaunch.ActualWidth / 2.0;
  673. num2 = ModMain.recordIterator.BtnLaunch.ActualHeight / 2.0;
  674. vector = (Vector)(ModMain._ProcessIterator.expressionIterator.GetPosition(ModMain.recordIterator.BtnLaunch) - new Vector(num, num2));
  675. Vector vector2 = new Vector(vector.X, vector.Y);
  676. vector2.Normalize();
  677. vector3 = -vector2;
  678. }
  679. double length = new Vector(Math.Max(0.0, Math.Abs(vector.X) - num), Math.Max(0.0, Math.Abs(vector.Y) - num2)).Length;
  680. double num3 = Math.Sin((double)ModMain.m_IssuerRepository / 37.5 * 3.141592653589793);
  681. Vector vector4 = Math.Max(0.0, num3 * 0.25 - 0.65 - Math.Log((length + 0.4) / 200.0)) * vector3;
  682. if (ModMain._SpecificationRepository >= 320)
  683. {
  684. Vector vector5 = (Vector)(ModMain._ProcessIterator.expressionIterator.GetPosition(ModMain._ProcessIterator.PanMain) - new Vector(num, ModMain._ProcessIterator.PanMain.ActualHeight - num2 * 3.0));
  685. Vector vector6 = new Vector(ModMain.recordIterator.AprilPosTrans.X, ModMain.recordIterator.AprilPosTrans.Y);
  686. if (vector5.Length > 250.0 && vector6.Length > 0.4)
  687. {
  688. vector4 -= vector6 * 0.0005;
  689. vector6.Normalize();
  690. vector4 -= vector6 * 0.15;
  691. }
  692. }
  693. Point point = ModMain.recordIterator.BtnLaunch.TranslatePoint(new Point(0.0, 0.0), ModMain._ProcessIterator.PanForm);
  694. if (point.X < -num * 2.0)
  695. {
  696. TranslateTransform aprilPosTrans;
  697. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).X = aprilPosTrans.X + (ModMain._ProcessIterator.PanForm.ActualWidth + num * 2.0);
  698. ModMain.m_ContextRepository.X = ModMain.m_ContextRepository.X - 80.0;
  699. if (point.Y < 0.0)
  700. {
  701. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).Y = aprilPosTrans.Y + num2 * 2.5;
  702. }
  703. else if (point.Y > ModMain._ProcessIterator.PanForm.ActualHeight - num2 * 2.0)
  704. {
  705. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).Y = aprilPosTrans.Y - num2 * 2.5;
  706. }
  707. }
  708. else if (point.X > ModMain._ProcessIterator.PanForm.ActualWidth)
  709. {
  710. TranslateTransform aprilPosTrans;
  711. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).X = aprilPosTrans.X - (ModMain._ProcessIterator.PanForm.ActualWidth + num * 2.0);
  712. ModMain.m_ContextRepository.X = ModMain.m_ContextRepository.X + 80.0;
  713. if (point.Y < 0.0)
  714. {
  715. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).Y = aprilPosTrans.Y + num2 * 2.5;
  716. }
  717. else if (point.Y > ModMain._ProcessIterator.PanForm.ActualHeight - num2 * 2.0)
  718. {
  719. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).Y = aprilPosTrans.Y - num2 * 2.5;
  720. }
  721. }
  722. else if (point.Y < -num2 * 2.0)
  723. {
  724. TranslateTransform aprilPosTrans;
  725. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).Y = aprilPosTrans.Y + (ModMain._ProcessIterator.PanForm.ActualHeight + num2 * 2.0);
  726. ModMain.m_ContextRepository.Y = ModMain.m_ContextRepository.Y - 25.0;
  727. if (point.X < 0.0)
  728. {
  729. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).X = aprilPosTrans.X + num * 2.0;
  730. }
  731. else if (point.X > ModMain._ProcessIterator.PanForm.ActualWidth - num * 2.0)
  732. {
  733. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).X = aprilPosTrans.X - num * 2.0;
  734. }
  735. }
  736. else if (point.Y > ModMain._ProcessIterator.PanForm.ActualHeight)
  737. {
  738. TranslateTransform aprilPosTrans;
  739. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).Y = aprilPosTrans.Y - (ModMain._ProcessIterator.PanForm.ActualHeight + num2 * 2.0);
  740. ModMain.m_ContextRepository.Y = ModMain.m_ContextRepository.Y + 25.0;
  741. if (point.X < 0.0)
  742. {
  743. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).X = aprilPosTrans.X + num * 2.0;
  744. }
  745. else if (point.X > ModMain._ProcessIterator.PanForm.ActualWidth - num * 2.0)
  746. {
  747. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).X = aprilPosTrans.X - num * 2.0;
  748. }
  749. }
  750. ModMain.m_ContextRepository = ModMain.m_ContextRepository * 0.8 + vector4;
  751. double num4 = Math.Min(60.0, ModMain.m_ContextRepository.Length);
  752. if (num4 >= 0.01)
  753. {
  754. ModMain.m_ContextRepository.Normalize();
  755. ModMain.m_ContextRepository *= num4;
  756. ModMain.requestRepository = checked((int)Math.Round(unchecked((double)ModMain.requestRepository + num4)));
  757. TranslateTransform aprilPosTrans;
  758. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).X = aprilPosTrans.X + ModMain.m_ContextRepository.X;
  759. (aprilPosTrans = ModMain.recordIterator.AprilPosTrans).Y = aprilPosTrans.Y + ModMain.m_ContextRepository.Y;
  760. ModMain.recordIterator.AprilScaleTrans.ScaleX = ModBase.MathClamp(1.0 - (Math.Abs(vector3.X) - Math.Abs(vector3.Y)) * (num4 / 160.0), 0.2, 1.8);
  761. ModMain.recordIterator.AprilScaleTrans.ScaleY = ModBase.MathClamp(1.0 - (Math.Abs(vector3.Y) - Math.Abs(vector3.X)) * (num4 / 100.0), 0.2, 1.8);
  762. if (ModMain.requestRepository > 4000)
  763. {
  764. ModMain.requestRepository = -4000;
  765. switch (ModBase.RandomInteger(0, 3))
  766. {
  767. case 0:
  768. ModMain.Hint("放弃吧!只需要点一下右下角的小白旗……", ModMain.HintType.Info, true);
  769. break;
  770. case 1:
  771. ModMain.Hint("看到右下角的那面小白旗了吗?", ModMain.HintType.Info, true);
  772. break;
  773. case 2:
  774. ModMain.Hint("这里建议点一下右下角的小白旗投降呢.jpg", ModMain.HintType.Info, true);
  775. break;
  776. case 3:
  777. ModMain.Hint("右下角的小白旗永远等着你……", ModMain.HintType.Info, true);
  778. break;
  779. }
  780. }
  781. }
  782. }
  783. }
  784. }
  785. catch (Exception ex)
  786. {
  787. ModBase.Log(ex, "愚人节移动出错", ModBase.LogLevel.Feedback, "出现错误");
  788. }
  789. }
  790. // Token: 0x06001780 RID: 6016 RVA: 0x00099D58 File Offset: 0x00097F58
  791. public static void ShowWindowToTop(IntPtr Handle)
  792. {
  793. try
  794. {
  795. ModMain.PostMessageA(Handle, 6402U, 0L, 0L);
  796. ModMain.SetForegroundWindow(Handle);
  797. }
  798. catch (Exception ex)
  799. {
  800. ModBase.Log(ex, "设置窗口置顶失败", ModBase.LogLevel.Hint, "出现错误");
  801. }
  802. }
  803. // Token: 0x06001781 RID: 6017
  804. [DllImport("user32", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
  805. public static extern IntPtr FindWindowA([MarshalAs(UnmanagedType.VBByRefStr)] ref string ClassName, [MarshalAs(UnmanagedType.VBByRefStr)] ref string WindowName);
  806. // Token: 0x06001782 RID: 6018
  807. [DllImport("user32", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
  808. public static extern int SetForegroundWindow(IntPtr hWnd);
  809. // Token: 0x06001783 RID: 6019
  810. [DllImport("user32", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
  811. private static extern bool PostMessageA(IntPtr hWnd, uint msg, long wParam, long lParam);
  812. // Token: 0x06001784 RID: 6020 RVA: 0x00099DBC File Offset: 0x00097FBC
  813. private static void TimerMain()
  814. {
  815. try
  816. {
  817. ModMain.HintTick();
  818. ModMain.MyMsgBoxTick();
  819. ModMain._ProcessIterator.DragTick();
  820. ModLoader.LoaderTaskbarProgressRefresh();
  821. if (ModSecret.registryField == 2)
  822. {
  823. ModSecret.ViewReader(-1);
  824. }
  825. }
  826. catch (Exception ex)
  827. {
  828. ModBase.Log(ex, "短程主时钟执行异常", ModBase.LogLevel.Assert, "出现错误");
  829. }
  830. checked
  831. {
  832. ModMain.m_HelperRepository++;
  833. if (ModMain.m_HelperRepository == 4)
  834. {
  835. ModMain.m_HelperRepository = 0;
  836. try
  837. {
  838. if (ModSecret.configurationField == 12)
  839. {
  840. ModSecret.ViewReader(-1);
  841. }
  842. }
  843. catch (Exception ex2)
  844. {
  845. ModBase.Log(ex2, "中程主时钟执行异常", ModBase.LogLevel.Debug, "出现错误");
  846. }
  847. }
  848. ModMain.m_IssuerRepository++;
  849. if (ModMain.m_IssuerRepository == 150)
  850. {
  851. ModMain.m_IssuerRepository = 0;
  852. try
  853. {
  854. if (ModMain._ProcessIterator.BtnExtraApril_ShowCheck() && ModMain.requestRepository != 0)
  855. {
  856. ModMain._ProcessIterator.BtnExtraApril.Ribble();
  857. }
  858. ModBase.RunInUi((ModMain._Closure$__.$I79-0 == null) ? (ModMain._Closure$__.$I79-0 = delegate()
  859. {
  860. if (!ModMain._ProcessIterator.Hidden)
  861. {
  862. if (ModMain._ProcessIterator.Top < -9000.0)
  863. {
  864. ModMain._ProcessIterator.Top = 100.0;
  865. }
  866. if (ModMain._ProcessIterator.Left < -9000.0)
  867. {
  868. ModMain._ProcessIterator.Left = 100.0;
  869. }
  870. }
  871. }) : ModMain._Closure$__.$I79-0, false);
  872. }
  873. catch (Exception ex3)
  874. {
  875. ModBase.Log(ex3, "长程主时钟执行异常", ModBase.LogLevel.Assert, "出现错误");
  876. }
  877. }
  878. }
  879. }
  880. // Token: 0x06001785 RID: 6021 RVA: 0x00099F10 File Offset: 0x00098110
  881. public static void TimerMainStart()
  882. {
  883. ModBase.RunInNewThread((ModMain._Closure$__.$I80-0 == null) ? (ModMain._Closure$__.$I80-0 = delegate()
  884. {
  885. try
  886. {
  887. for (;;)
  888. {
  889. ModBase.RunInUiWait(new Action(ModMain.TimerMain));
  890. Thread.Sleep(49);
  891. }
  892. }
  893. catch (Exception ex)
  894. {
  895. ModBase.Log(ex, "程序主时钟出错", ModBase.LogLevel.Feedback, "出现错误");
  896. }
  897. }) : ModMain._Closure$__.$I80-0, "Timer Main", ThreadPriority.Normal);
  898. if (ModMain.mapRepository)
  899. {
  900. ModBase.RunInNewThread((ModMain._Closure$__.$I80-1 == null) ? (ModMain._Closure$__.$I80-1 = delegate()
  901. {
  902. try
  903. {
  904. int tickCount = MyWpfExtension.ManageParser().Clock.TickCount;
  905. for (;;)
  906. {
  907. if (tickCount != MyWpfExtension.ManageParser().Clock.TickCount)
  908. {
  909. tickCount = MyWpfExtension.ManageParser().Clock.TickCount;
  910. ModBase.RunInUiWait(new Action(ModMain.TimerFool));
  911. }
  912. Thread.Sleep(1);
  913. }
  914. }
  915. catch (Exception ex)
  916. {
  917. ModBase.Log(ex, "愚人节主时钟出错", ModBase.LogLevel.Feedback, "出现错误");
  918. }
  919. }) : ModMain._Closure$__.$I80-1, "Timer Main Fool", ThreadPriority.Normal);
  920. }
  921. }
  922. // Token: 0x04000BDB RID: 3035
  923. private static List<ModMain.HintMessage> paramsIterator = ModMain.paramsIterator ?? new List<ModMain.HintMessage>();
  924. // Token: 0x04000BDC RID: 3036
  925. public static List<ModMain.MyMsgBoxConverter> m_DispatcherIterator = ModMain.m_DispatcherIterator ?? new List<ModMain.MyMsgBoxConverter>();
  926. // Token: 0x04000BDD RID: 3037
  927. public static FormMain _ProcessIterator;
  928. // Token: 0x04000BDE RID: 3038
  929. public static SplashScreen m_ParameterIterator;
  930. // Token: 0x04000BDF RID: 3039
  931. public static PageLaunchLeft recordIterator;
  932. // Token: 0x04000BE0 RID: 3040
  933. public static PageLaunchRight m_ServiceIterator;
  934. // Token: 0x04000BE1 RID: 3041
  935. public static PageSelectLeft _InvocationIterator;
  936. // Token: 0x04000BE2 RID: 3042
  937. public static PageSelectRight proxyIterator;
  938. // Token: 0x04000BE3 RID: 3043
  939. public static PageSpeedLeft _MessageIterator;
  940. // Token: 0x04000BE4 RID: 3044
  941. public static PageSpeedRight m_CreatorIterator;
  942. // Token: 0x04000BE5 RID: 3045
  943. public static PageLinkLeft m_InitializerIterator;
  944. // Token: 0x04000BE6 RID: 3046
  945. public static PageLinkIoi m_SingletonIterator;
  946. // Token: 0x04000BE7 RID: 3047
  947. public static PageLinkHiper m_RegIterator;
  948. // Token: 0x04000BE8 RID: 3048
  949. public static PageOtherHelpDetail _ProductIterator;
  950. // Token: 0x04000BE9 RID: 3049
  951. public static PageLinkFeedback m_ListenerIterator;
  952. // Token: 0x04000BEA RID: 3050
  953. public static PageDownloadLeft m_CollectionIterator;
  954. // Token: 0x04000BEB RID: 3051
  955. public static PageDownloadInstall m_VisitorIterator;
  956. // Token: 0x04000BEC RID: 3052
  957. public static PageDownloadClient _ValueIterator;
  958. // Token: 0x04000BED RID: 3053
  959. public static PageDownloadOptiFine objectIterator;
  960. // Token: 0x04000BEE RID: 3054
  961. public static PageDownloadLiteLoader bridgeIterator;
  962. // Token: 0x04000BEF RID: 3055
  963. public static PageDownloadForge m_ItemIterator;
  964. // Token: 0x04000BF0 RID: 3056
  965. public static PageDownloadNeoForge _ReponseIterator;
  966. // Token: 0x04000BF1 RID: 3057
  967. public static PageDownloadFabric _GlobalIterator;
  968. // Token: 0x04000BF2 RID: 3058
  969. public static PageDownloadMod m_ExceptionIterator;
  970. // Token: 0x04000BF3 RID: 3059
  971. public static PageDownloadPack m_UtilsIterator;
  972. // Token: 0x04000BF4 RID: 3060
  973. public static PageSetupLeft _ClassIterator;
  974. // Token: 0x04000BF5 RID: 3061
  975. public static PageSetupLaunch _PolicyIterator;
  976. // Token: 0x04000BF6 RID: 3062
  977. public static PageSetupUI m_OrderIterator;
  978. // Token: 0x04000BF7 RID: 3063
  979. public static PageSetupSystem producerIterator;
  980. // Token: 0x04000BF8 RID: 3064
  981. public static PageSetupLink m_SchemaIterator;
  982. // Token: 0x04000BF9 RID: 3065
  983. public static PageOtherLeft descriptorIterator;
  984. // Token: 0x04000BFA RID: 3066
  985. public static PageOtherHelp m_PublisherIterator;
  986. // Token: 0x04000BFB RID: 3067
  987. public static PageOtherAbout _DefinitionIterator;
  988. // Token: 0x04000BFC RID: 3068
  989. public static PageOtherTest _StrategyIterator;
  990. // Token: 0x04000BFD RID: 3069
  991. public static PageLoginLegacy m_ProcIterator;
  992. // Token: 0x04000BFE RID: 3070
  993. public static PageLoginNide parserRepository;
  994. // Token: 0x04000BFF RID: 3071
  995. public static PageLoginNideSkin broadcasterRepository;
  996. // Token: 0x04000C00 RID: 3072
  997. public static PageLoginAuth fieldRepository;
  998. // Token: 0x04000C01 RID: 3073
  999. public static PageLoginAuthSkin readerRepository;
  1000. // Token: 0x04000C02 RID: 3074
  1001. public static PageLoginMs m_ClientRepository;
  1002. // Token: 0x04000C03 RID: 3075
  1003. public static PageLoginMsSkin m_ConfigRepository;
  1004. // Token: 0x04000C04 RID: 3076
  1005. public static PageVersionLeft m_TestsRepository;
  1006. // Token: 0x04000C05 RID: 3077
  1007. public static PageVersionOverall m_MapperRepository;
  1008. // Token: 0x04000C06 RID: 3078
  1009. public static PageVersionMod _ThreadRepository;
  1010. // Token: 0x04000C07 RID: 3079
  1011. public static PageVersionModDisabled _PropertyRepository;
  1012. // Token: 0x04000C08 RID: 3080
  1013. public static PageVersionSetup composerRepository;
  1014. // Token: 0x04000C09 RID: 3081
  1015. public static PageDownloadCompDetail iteratorRepository;
  1016. // Token: 0x04000C0A RID: 3082
  1017. public static ModLoader.LoaderTask<int, List<ModMain.HelpEntry>> _RepositoryRepository = new ModLoader.LoaderTask<int, List<ModMain.HelpEntry>>("Help Page", new Action<ModLoader.LoaderTask<int, List<ModMain.HelpEntry>>>(ModMain.HelpLoad), null, ThreadPriority.BelowNormal);
  1018. // Token: 0x04000C0B RID: 3083
  1019. private static readonly object testRepository = RuntimeHelpers.GetObjectValue(new object());
  1020. // Token: 0x04000C0C RID: 3084
  1021. public static bool mapRepository = DateTime.Now.Month == 4 && DateTime.Now.Day == 1;
  1022. // Token: 0x04000C0D RID: 3085
  1023. public static bool m_ErrorRepository = false;
  1024. // Token: 0x04000C0E RID: 3086
  1025. private static Vector m_ContextRepository = new Vector(0.0, 0.0);
  1026. // Token: 0x04000C0F RID: 3087
  1027. private static int _SpecificationRepository = 0;
  1028. // Token: 0x04000C10 RID: 3088
  1029. private static Point m_MockRepository = new Point(0.0, 0.0);
  1030. // Token: 0x04000C11 RID: 3089
  1031. private static int requestRepository = 0;
  1032. // Token: 0x04000C12 RID: 3090
  1033. public static MySlider _DicRepository = null;
  1034. // Token: 0x04000C13 RID: 3091
  1035. private static int m_HelperRepository = 0;
  1036. // Token: 0x04000C14 RID: 3092
  1037. private static int m_IssuerRepository = 0;
  1038. // Token: 0x020001F3 RID: 499
  1039. public enum HintType
  1040. {
  1041. // Token: 0x04000C16 RID: 3094
  1042. Info,
  1043. // Token: 0x04000C17 RID: 3095
  1044. Finish,
  1045. // Token: 0x04000C18 RID: 3096
  1046. Critical
  1047. }
  1048. // Token: 0x020001F4 RID: 500
  1049. private struct HintMessage
  1050. {
  1051. // Token: 0x04000C19 RID: 3097
  1052. public string regMap;
  1053. // Token: 0x04000C1A RID: 3098
  1054. public ModMain.HintType Type;
  1055. // Token: 0x04000C1B RID: 3099
  1056. public bool m_ProductMap;
  1057. }
  1058. // Token: 0x020001F5 RID: 501
  1059. public class MyMsgBoxConverter
  1060. {
  1061. // Token: 0x06001786 RID: 6022 RVA: 0x00099F84 File Offset: 0x00098184
  1062. public MyMsgBoxConverter()
  1063. {
  1064. this.m_ValueMap = "";
  1065. this.m_BridgeMap = "确定";
  1066. this.itemMap = "";
  1067. this.reponseMap = "";
  1068. this.m_GlobalMap = null;
  1069. this.m_ExceptionMap = null;
  1070. this.utilsMap = null;
  1071. this._ClassMap = false;
  1072. this.m_PolicyMap = false;
  1073. this._OrderMap = new DispatcherFrame(true);
  1074. this.m_ProducerMap = false;
  1075. }
  1076. // Token: 0x04000C1C RID: 3100
  1077. public ModMain.MyMsgBoxType Type;
  1078. // Token: 0x04000C1D RID: 3101
  1079. public string Title;
  1080. // Token: 0x04000C1E RID: 3102
  1081. public string listenerMap;
  1082. // Token: 0x04000C1F RID: 3103
  1083. public object m_CollectionMap;
  1084. // Token: 0x04000C20 RID: 3104
  1085. public Collection<Validate> m_VisitorMap;
  1086. // Token: 0x04000C21 RID: 3105
  1087. public string m_ValueMap;
  1088. // Token: 0x04000C22 RID: 3106
  1089. public bool m_ObjectMap;
  1090. // Token: 0x04000C23 RID: 3107
  1091. public string m_BridgeMap;
  1092. // Token: 0x04000C24 RID: 3108
  1093. public string itemMap;
  1094. // Token: 0x04000C25 RID: 3109
  1095. public string reponseMap;
  1096. // Token: 0x04000C26 RID: 3110
  1097. public Action m_GlobalMap;
  1098. // Token: 0x04000C27 RID: 3111
  1099. public Action m_ExceptionMap;
  1100. // Token: 0x04000C28 RID: 3112
  1101. public Action utilsMap;
  1102. // Token: 0x04000C29 RID: 3113
  1103. public bool _ClassMap;
  1104. // Token: 0x04000C2A RID: 3114
  1105. public bool m_PolicyMap;
  1106. // Token: 0x04000C2B RID: 3115
  1107. public DispatcherFrame _OrderMap;
  1108. // Token: 0x04000C2C RID: 3116
  1109. public bool m_ProducerMap;
  1110. // Token: 0x04000C2D RID: 3117
  1111. public string schemaMap;
  1112. }
  1113. // Token: 0x020001F6 RID: 502
  1114. public enum MyMsgBoxType
  1115. {
  1116. // Token: 0x04000C2F RID: 3119
  1117. Text,
  1118. // Token: 0x04000C30 RID: 3120
  1119. Select,
  1120. // Token: 0x04000C31 RID: 3121
  1121. Input,
  1122. // Token: 0x04000C32 RID: 3122
  1123. Login
  1124. }
  1125. // Token: 0x020001F7 RID: 503
  1126. public class HelpEntry
  1127. {
  1128. // Token: 0x06001788 RID: 6024 RVA: 0x00099FFC File Offset: 0x000981FC
  1129. public HelpEntry(string FilePath)
  1130. {
  1131. this._ProcMap = null;
  1132. this._ParserError = true;
  1133. this.m_BroadcasterError = true;
  1134. this.fieldError = true;
  1135. this._DescriptorMap = FilePath;
  1136. JObject jobject = (JObject)ModBase.GetJson(ModMain.HelpArgumentReplace(ModBase.ReadFile(FilePath, null)));
  1137. if (jobject == null)
  1138. {
  1139. throw new FileNotFoundException("未找到帮助文件:" + FilePath, FilePath);
  1140. }
  1141. if (jobject["Title"] == null)
  1142. {
  1143. throw new ArgumentException("未找到 Title 项");
  1144. }
  1145. this.Title = (string)jobject["Title"];
  1146. this._PublisherMap = (string)(jobject["Description"] ?? "");
  1147. this._DefinitionMap = (string)(jobject["Keywords"] ?? "");
  1148. this._ProcMap = (string)jobject["Logo"];
  1149. this._ParserError = (bool)(jobject["ShowInSearch"] ?? this._ParserError);
  1150. this.m_BroadcasterError = (bool)(jobject["ShowInPublic"] ?? this.m_BroadcasterError);
  1151. this.fieldError = (bool)(jobject["ShowInSnapshot"] ?? this.fieldError);
  1152. this._StrategyMap = new List<string>();
  1153. try
  1154. {
  1155. foreach (object obj in ((IEnumerable)(jobject["Types"] ?? ModBase.GetJson("[]"))))
  1156. {
  1157. object objectValue = RuntimeHelpers.GetObjectValue(obj);
  1158. this._StrategyMap.Add(Conversions.ToString(objectValue));
  1159. }
  1160. }
  1161. finally
  1162. {
  1163. IEnumerator enumerator;
  1164. if (enumerator is IDisposable)
  1165. {
  1166. (enumerator as IDisposable).Dispose();
  1167. }
  1168. }
  1169. if (((bool?)(jobject["IsEvent"] ?? false)).GetValueOrDefault())
  1170. {
  1171. this._ClientError = (string)jobject["EventType"];
  1172. if (this._ClientError == null)
  1173. {
  1174. throw new ArgumentException("未找到 EventType 项");
  1175. }
  1176. this.m_ConfigError = (string)(jobject["EventData"] ?? "");
  1177. this._ReaderError = true;
  1178. return;
  1179. }
  1180. else
  1181. {
  1182. string text = FilePath.ToLower().Replace(".json", ".xaml");
  1183. if (!File.Exists(text))
  1184. {
  1185. throw new FileNotFoundException("未找到帮助条目 .json 对应的 .xaml 文件(" + text + ")");
  1186. }
  1187. this.testsError = ModBase.ReadFile(text, null);
  1188. this._ReaderError = false;
  1189. return;
  1190. }
  1191. }
  1192. // Token: 0x06001789 RID: 6025 RVA: 0x0000D1C4 File Offset: 0x0000B3C4
  1193. public MyListItem ToListItem()
  1194. {
  1195. return this.SetToListItem(new MyListItem());
  1196. }
  1197. // Token: 0x0600178A RID: 6026 RVA: 0x0009A2A0 File Offset: 0x000984A0
  1198. public MyListItem SetToListItem(MyListItem Item)
  1199. {
  1200. string text;
  1201. if (this._ReaderError)
  1202. {
  1203. if (Operators.CompareString(this._ClientError, "弹出窗口", false) == 0)
  1204. {
  1205. text = ModBase.m_SerializerRepository + "Blocks/GrassPath.png";
  1206. }
  1207. else
  1208. {
  1209. text = ModBase.m_SerializerRepository + "Blocks/CommandBlock.png";
  1210. }
  1211. }
  1212. else
  1213. {
  1214. text = ModBase.m_SerializerRepository + "Blocks/Grass.png";
  1215. }
  1216. Item.SnapsToDevicePixels = true;
  1217. Item.Title = this.Title;
  1218. Item.Info = this._PublisherMap;
  1219. Item.Logo = (this._ProcMap ?? text);
  1220. Item.Height = 42.0;
  1221. Item.Type = MyListItem.CheckType.Clickable;
  1222. Item.Tag = this;
  1223. Item.EventType = null;
  1224. Item.EventData = null;
  1225. Item.Click += ((ModMain.HelpEntry._Closure$__.$I15-0 == null) ? (ModMain.HelpEntry._Closure$__.$I15-0 = delegate(object sender, MouseButtonEventArgs e)
  1226. {
  1227. PageOtherHelp.OnItemClick((ModMain.HelpEntry)NewLateBinding.LateGet(sender, null, "Tag", new object[0], null, null, null));
  1228. }) : ModMain.HelpEntry._Closure$__.$I15-0);
  1229. return Item;
  1230. }
  1231. // Token: 0x04000C33 RID: 3123
  1232. public string _DescriptorMap;
  1233. // Token: 0x04000C34 RID: 3124
  1234. public string Title;
  1235. // Token: 0x04000C35 RID: 3125
  1236. public string _PublisherMap;
  1237. // Token: 0x04000C36 RID: 3126
  1238. public string _DefinitionMap;
  1239. // Token: 0x04000C37 RID: 3127
  1240. public List<string> _StrategyMap;
  1241. // Token: 0x04000C38 RID: 3128
  1242. public string _ProcMap;
  1243. // Token: 0x04000C39 RID: 3129
  1244. public bool _ParserError;
  1245. // Token: 0x04000C3A RID: 3130
  1246. public bool m_BroadcasterError;
  1247. // Token: 0x04000C3B RID: 3131
  1248. public bool fieldError;
  1249. // Token: 0x04000C3C RID: 3132
  1250. public bool _ReaderError;
  1251. // Token: 0x04000C3D RID: 3133
  1252. public string _ClientError;
  1253. // Token: 0x04000C3E RID: 3134
  1254. public string m_ConfigError;
  1255. // Token: 0x04000C3F RID: 3135
  1256. public string testsError;
  1257. }
  1258. }
  1259. }