UserConfig.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Text;
  5. using System.Xml.Serialization;
  6. namespace COM3D2.PropMyItem.Plugin
  7. {
  8. // Token: 0x0200000D RID: 13
  9. public class UserConfig
  10. {
  11. // Token: 0x17000010 RID: 16
  12. // (get) Token: 0x06000053 RID: 83 RVA: 0x00008307 File Offset: 0x00006507
  13. // (set) Token: 0x06000054 RID: 84 RVA: 0x0000830F File Offset: 0x0000650F
  14. public string GuiVisibleKey
  15. {
  16. get
  17. {
  18. return this._guiVisible;
  19. }
  20. set
  21. {
  22. this._guiVisible = value;
  23. }
  24. }
  25. // Token: 0x17000011 RID: 17
  26. // (get) Token: 0x06000055 RID: 85 RVA: 0x00008318 File Offset: 0x00006518
  27. // (set) Token: 0x06000056 RID: 86 RVA: 0x00008320 File Offset: 0x00006520
  28. public bool IsControlKey
  29. {
  30. get
  31. {
  32. return this._isControlKey;
  33. }
  34. set
  35. {
  36. this._isControlKey = value;
  37. }
  38. }
  39. // Token: 0x17000012 RID: 18
  40. // (get) Token: 0x06000057 RID: 87 RVA: 0x00008329 File Offset: 0x00006529
  41. // (set) Token: 0x06000058 RID: 88 RVA: 0x00008331 File Offset: 0x00006531
  42. public bool IsAltKey
  43. {
  44. get
  45. {
  46. return this._isAltKey;
  47. }
  48. set
  49. {
  50. this._isAltKey = value;
  51. }
  52. }
  53. // Token: 0x17000013 RID: 19
  54. // (get) Token: 0x06000059 RID: 89 RVA: 0x0000833A File Offset: 0x0000653A
  55. // (set) Token: 0x0600005A RID: 90 RVA: 0x00008342 File Offset: 0x00006542
  56. public bool IsShiftKey
  57. {
  58. get
  59. {
  60. return this._isShift;
  61. }
  62. set
  63. {
  64. this._isShift = value;
  65. }
  66. }
  67. // Token: 0x17000014 RID: 20
  68. // (get) Token: 0x0600005B RID: 91 RVA: 0x0000834B File Offset: 0x0000654B
  69. // (set) Token: 0x0600005C RID: 92 RVA: 0x00008353 File Offset: 0x00006553
  70. public bool IsAutoShoesHide
  71. {
  72. get
  73. {
  74. return this._isAutoShoesHide;
  75. }
  76. set
  77. {
  78. this._isAutoShoesHide = value;
  79. }
  80. }
  81. // Token: 0x17000015 RID: 21
  82. // (get) Token: 0x0600005D RID: 93 RVA: 0x0000835C File Offset: 0x0000655C
  83. // (set) Token: 0x0600005E RID: 94 RVA: 0x00008364 File Offset: 0x00006564
  84. public bool IsOutputInfoLog
  85. {
  86. get
  87. {
  88. return this._isOutputInfoLog;
  89. }
  90. set
  91. {
  92. this._isOutputInfoLog = value;
  93. }
  94. }
  95. // Token: 0x17000016 RID: 22
  96. // (get) Token: 0x0600005F RID: 95 RVA: 0x0000836D File Offset: 0x0000656D
  97. // (set) Token: 0x06000060 RID: 96 RVA: 0x00008375 File Offset: 0x00006575
  98. public List<string> FavList
  99. {
  100. get
  101. {
  102. return this._favList;
  103. }
  104. set
  105. {
  106. this._favList = value;
  107. }
  108. }
  109. // Token: 0x17000017 RID: 23
  110. // (get) Token: 0x06000061 RID: 97 RVA: 0x0000837E File Offset: 0x0000657E
  111. // (set) Token: 0x06000062 RID: 98 RVA: 0x00008386 File Offset: 0x00006586
  112. public List<string> ColorLockList
  113. {
  114. get
  115. {
  116. return this._colorDisableList;
  117. }
  118. set
  119. {
  120. this._colorDisableList = value;
  121. }
  122. }
  123. // Token: 0x17000018 RID: 24
  124. // (get) Token: 0x06000063 RID: 99 RVA: 0x0000838F File Offset: 0x0000658F
  125. // (set) Token: 0x06000064 RID: 100 RVA: 0x00008397 File Offset: 0x00006597
  126. public List<string> FilterTextList
  127. {
  128. get
  129. {
  130. return this._filterTextList;
  131. }
  132. set
  133. {
  134. this._filterTextList = value;
  135. }
  136. }
  137. // Token: 0x17000019 RID: 25
  138. // (get) Token: 0x06000065 RID: 101 RVA: 0x000083A0 File Offset: 0x000065A0
  139. public static UserConfig Instance
  140. {
  141. get
  142. {
  143. if (UserConfig._config == null)
  144. {
  145. string text = Directory.GetCurrentDirectory() + "\\Sybaris\\UnityInjector\\Config\\PropMyItemUser.xml";
  146. UserConfig._config = new UserConfig();
  147. if (File.Exists(text))
  148. {
  149. UserConfig._config.Load(text);
  150. }
  151. else
  152. {
  153. UserConfig._config.IsShiftKey = true;
  154. UserConfig._config.GuiVisibleKey = "i";
  155. UserConfig._config.Save();
  156. }
  157. }
  158. return UserConfig._config;
  159. }
  160. }
  161. // Token: 0x06000066 RID: 102 RVA: 0x0000840C File Offset: 0x0000660C
  162. public void Load(string filePath)
  163. {
  164. try
  165. {
  166. XmlSerializer xmlSerializer = new XmlSerializer(typeof(UserConfig));
  167. using (StreamReader streamReader = new StreamReader(filePath, new UTF8Encoding(false)))
  168. {
  169. UserConfig userConfig = (UserConfig)xmlSerializer.Deserialize(streamReader);
  170. this.GuiVisibleKey = userConfig.GuiVisibleKey.ToLower();
  171. this.IsAutoShoesHide = userConfig.IsAutoShoesHide;
  172. this.IsOutputInfoLog = userConfig.IsOutputInfoLog;
  173. this.FavList = userConfig.FavList;
  174. this.ColorLockList = userConfig.ColorLockList;
  175. this.FilterTextList = userConfig.FilterTextList;
  176. this.IsControlKey = userConfig.IsControlKey;
  177. this.IsAltKey = userConfig.IsAltKey;
  178. this.IsShiftKey = userConfig.IsShiftKey;
  179. }
  180. }
  181. catch (Exception)
  182. {
  183. }
  184. if (string.IsNullOrEmpty(this.GuiVisibleKey))
  185. {
  186. this.GuiVisibleKey = "i";
  187. }
  188. if (this.FavList == null)
  189. {
  190. this.FavList = new List<string>();
  191. }
  192. if (this.FilterTextList == null)
  193. {
  194. this.FilterTextList = new List<string>();
  195. }
  196. if (this.ColorLockList == null)
  197. {
  198. this.ColorLockList = new List<string>();
  199. }
  200. }
  201. // Token: 0x06000067 RID: 103 RVA: 0x00008534 File Offset: 0x00006734
  202. public void Save()
  203. {
  204. string filePath = Directory.GetCurrentDirectory() + "\\Sybaris\\UnityInjector\\Config\\PropMyItemUser.xml";
  205. this.Save(filePath);
  206. }
  207. // Token: 0x06000068 RID: 104 RVA: 0x00008558 File Offset: 0x00006758
  208. public void Save(string filePath)
  209. {
  210. try
  211. {
  212. XmlSerializer xmlSerializer = new XmlSerializer(typeof(UserConfig));
  213. StreamWriter streamWriter = new StreamWriter(filePath, false, new UTF8Encoding(false));
  214. xmlSerializer.Serialize(streamWriter, this);
  215. streamWriter.Close();
  216. }
  217. catch (Exception value)
  218. {
  219. Console.WriteLine(value);
  220. }
  221. }
  222. // Token: 0x04000061 RID: 97
  223. private const string DefaultGUIKey = "i";
  224. // Token: 0x04000062 RID: 98
  225. private string _guiVisible = "i";
  226. // Token: 0x04000063 RID: 99
  227. private bool _isControlKey;
  228. // Token: 0x04000064 RID: 100
  229. private bool _isAltKey;
  230. // Token: 0x04000065 RID: 101
  231. private bool _isShift;
  232. // Token: 0x04000066 RID: 102
  233. private bool _isAutoShoesHide;
  234. // Token: 0x04000067 RID: 103
  235. private bool _isOutputInfoLog;
  236. // Token: 0x04000068 RID: 104
  237. private List<string> _favList = new List<string>();
  238. // Token: 0x04000069 RID: 105
  239. private List<string> _colorDisableList = new List<string>();
  240. // Token: 0x0400006A RID: 106
  241. private List<string> _filterTextList = new List<string>();
  242. // Token: 0x0400006B RID: 107
  243. private static UserConfig _config;
  244. }
  245. }