KeyBindSettings.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Windows.Forms;
  5. namespace Client
  6. {
  7. public enum KeybindOptions : int
  8. {
  9. Bar1Skill1 = 0,
  10. Bar1Skill2,
  11. Bar1Skill3,
  12. Bar1Skill4,
  13. Bar1Skill5,
  14. Bar1Skill6,
  15. Bar1Skill7,
  16. Bar1Skill8,
  17. Bar1Skill9,
  18. Bar1Skill10,
  19. Bar1Skill11,
  20. Bar1Skill12,
  21. Bar2Skill1,
  22. Bar2Skill2,
  23. Bar2Skill3,
  24. Bar2Skill4,
  25. Bar2Skill5,
  26. Bar2Skill6,
  27. Bar2Skill7,
  28. Bar2Skill8,
  29. Bar2Skill9,
  30. Bar2Skill10,
  31. Bar2Skill11,
  32. Bar2Skill12,
  33. Inventory,
  34. Inventory2,
  35. Equipment,
  36. Equipment2,
  37. Skills,
  38. Skills2,
  39. Creature,
  40. MountWindow,
  41. Mount,
  42. Fishing,
  43. Skillbar,
  44. Mentor,
  45. Relationship,
  46. Friends,
  47. Guilds,
  48. GameShop,
  49. Quests,
  50. Closeall,
  51. Options,
  52. Options2,
  53. Group,
  54. Belt,
  55. BeltFlip,
  56. Pickup,
  57. Belt1,
  58. Belt1Alt,
  59. Belt2,
  60. Belt2Alt,
  61. Belt3,
  62. Belt3Alt,
  63. Belt4,
  64. Belt4Alt,
  65. Belt5,
  66. Belt5Alt,
  67. Belt6,
  68. Belt6Alt,
  69. Logout,
  70. Exit,
  71. CreaturePickup,
  72. CreatureAutoPickup,
  73. Minimap,
  74. Bigmap,
  75. Trade,
  76. ChangeAttackmode,
  77. AttackmodePeace,
  78. AttackmodeGroup,
  79. AttackmodeGuild,
  80. AttackmodeEnemyguild,
  81. AttackmodeRedbrown,
  82. AttackmodeAll,
  83. ChangePetmode,
  84. PetmodeBoth,
  85. PetmodeMoveonly,
  86. PetmodeAttackonly,
  87. PetmodeNone,
  88. Help,
  89. Autorun,
  90. Cameramode,
  91. Screenshot,
  92. DropView,
  93. TargetDead,
  94. Ranking,
  95. AddGroupMember,
  96. DelGroupMember,
  97. Auxiliary, //外挂快捷键
  98. MarryMove, //夫妻传送
  99. Talklong,
  100. KeepMagic,
  101. LockPlayer,
  102. MailSystem,
  103. TalkSwitch,
  104. ReliveTom, //复活回城
  105. DebugWindow,
  106. }
  107. public class KeyBind
  108. {
  109. public KeybindOptions function = KeybindOptions.Bar1Skill1;
  110. public byte RequireCtrl = 0; //so these requirexxx: 0 < only works if you DONT hold the key, 1 < only works if you HOLD the key, 2 < works REGARDLESSS of the key
  111. public byte RequireShift = 0;
  112. public byte RequireAlt = 0;
  113. public byte RequireTilde = 0;
  114. public Keys Key = 0;
  115. }
  116. public class KeyBindSettings
  117. {
  118. private static InIReader Reader = new InIReader(@".\KeyBinds.ini");
  119. public List<KeyBind> Keylist = new List<KeyBind>();
  120. public KeyBindSettings()
  121. {
  122. New();
  123. if (!File.Exists(@".\KeyBinds.ini"))
  124. {
  125. Save();
  126. return;
  127. }
  128. Load();
  129. }
  130. public void Load()
  131. {
  132. foreach (KeyBind Inputkey in Keylist)
  133. {
  134. Inputkey.RequireAlt = Reader.ReadByte(Inputkey.function.ToString(), "RequireAlt", Inputkey.RequireAlt);
  135. Inputkey.RequireShift = Reader.ReadByte(Inputkey.function.ToString(), "RequireShift", Inputkey.RequireShift);
  136. Inputkey.RequireTilde = Reader.ReadByte(Inputkey.function.ToString(), "RequireTilde", Inputkey.RequireTilde);
  137. Inputkey.RequireCtrl = Reader.ReadByte(Inputkey.function.ToString(), "RequireCtrl", Inputkey.RequireCtrl);
  138. string Input = Reader.ReadString(Inputkey.function.ToString(), "RequireKey", Inputkey.Key.ToString());
  139. Enum.TryParse(Input, out Inputkey.Key);
  140. }
  141. }
  142. public void Save()
  143. {
  144. Reader.Write("Guide", "01", "RequireAlt,RequireShift,RequireTilde,RequireCtrl");
  145. Reader.Write("Guide", "02", "have 3 options: 0/1/2");
  146. Reader.Write("Guide", "03", "0 < you cannot have this key pressed to use the function");
  147. Reader.Write("Guide", "04", "1 < you have to have this key pressed to use this function");
  148. Reader.Write("Guide", "05", "2 < it doesnt matter if you press this key to use this function");
  149. Reader.Write("Guide", "06", "by default just use 2, unless you have 2 functions on the same key");
  150. Reader.Write("Guide", "07", "example: change attack mode (ctrl+h) and help (h)");
  151. Reader.Write("Guide", "08", "if you set either of those to requireshift 2, then they wil both work at the same time or not work");
  152. Reader.Write("Guide", "09", "");
  153. Reader.Write("Guide", "10", "To get the value for RequireKey look at:");
  154. Reader.Write("Guide", "11", "https://msdn.microsoft.com/en-us/library/system.windows.forms.keys(v=vs.110).aspx");
  155. foreach (KeyBind Inputkey in Keylist)
  156. {
  157. Reader.Write(Inputkey.function.ToString(), "RequireAlt", Inputkey.RequireAlt);
  158. Reader.Write(Inputkey.function.ToString(), "RequireShift", Inputkey.RequireShift);
  159. Reader.Write(Inputkey.function.ToString(), "RequireTilde", Inputkey.RequireTilde);
  160. Reader.Write(Inputkey.function.ToString(), "RequireCtrl", Inputkey.RequireCtrl);
  161. Reader.Write(Inputkey.function.ToString(), "RequireKey", Inputkey.Key.ToString());
  162. }
  163. }
  164. public void New()
  165. {
  166. KeyBind InputKey;
  167. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill1, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F1 };
  168. Keylist.Add(InputKey);
  169. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill2, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F2 };
  170. Keylist.Add(InputKey);
  171. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill3, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F3 };
  172. Keylist.Add(InputKey);
  173. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill4, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F4 };
  174. Keylist.Add(InputKey);
  175. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill5, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F5 };
  176. Keylist.Add(InputKey);
  177. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill6, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F6 };
  178. Keylist.Add(InputKey);
  179. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill7, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F7 };
  180. Keylist.Add(InputKey);
  181. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill8, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F8 };
  182. Keylist.Add(InputKey);
  183. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill9, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F9 };
  184. Keylist.Add(InputKey);
  185. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill10, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F10 };
  186. Keylist.Add(InputKey);
  187. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill11, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F11 };
  188. Keylist.Add(InputKey);
  189. InputKey = new KeyBind { function = KeybindOptions.Bar1Skill12, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 0, Key = Keys.F12 };
  190. Keylist.Add(InputKey);
  191. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill1, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F1 };
  192. Keylist.Add(InputKey);
  193. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill2, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F2 };
  194. Keylist.Add(InputKey);
  195. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill3, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F3 };
  196. Keylist.Add(InputKey);
  197. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill4, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F4 };
  198. Keylist.Add(InputKey);
  199. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill5, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F5 };
  200. Keylist.Add(InputKey);
  201. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill6, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F6 };
  202. Keylist.Add(InputKey);
  203. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill7, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F7 };
  204. Keylist.Add(InputKey);
  205. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill8, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F8 };
  206. Keylist.Add(InputKey);
  207. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill9, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F9 };
  208. Keylist.Add(InputKey);
  209. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill10, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F10 };
  210. Keylist.Add(InputKey);
  211. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill11, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F11 };
  212. Keylist.Add(InputKey);
  213. InputKey = new KeyBind { function = KeybindOptions.Bar2Skill12, RequireAlt = 2, RequireShift = 2, RequireTilde = 0, RequireCtrl = 1, Key = Keys.F12 };
  214. Keylist.Add(InputKey);
  215. InputKey = new KeyBind { function = KeybindOptions.Inventory, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.W };
  216. Keylist.Add(InputKey);
  217. // InputKey = new KeyBind { function = KeybindOptions.Inventory2, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.I };
  218. // Keylist.Add(InputKey);
  219. InputKey = new KeyBind { function = KeybindOptions.Equipment, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Q };
  220. Keylist.Add(InputKey);
  221. // InputKey = new KeyBind { function = KeybindOptions.Equipment2, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.C };
  222. // Keylist.Add(InputKey);
  223. InputKey = new KeyBind { function = KeybindOptions.Trade, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.C };
  224. Keylist.Add(InputKey);
  225. InputKey = new KeyBind { function = KeybindOptions.Skills, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.E };
  226. Keylist.Add(InputKey);
  227. InputKey = new KeyBind { function = KeybindOptions.Skills2, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  228. Keylist.Add(InputKey);
  229. // InputKey = new KeyBind { function = KeybindOptions.Creature, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.F11 };
  230. // Keylist.Add(InputKey);
  231. InputKey = new KeyBind { function = KeybindOptions.MountWindow, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.S };
  232. Keylist.Add(InputKey);
  233. InputKey = new KeyBind { function = KeybindOptions.DebugWindow, RequireAlt = 1, RequireShift = 1, RequireTilde = 2, RequireCtrl = 1, Key = Keys.S };
  234. Keylist.Add(InputKey);
  235. InputKey = new KeyBind { function = KeybindOptions.Mount, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.M };
  236. Keylist.Add(InputKey);
  237. InputKey = new KeyBind { function = KeybindOptions.Fishing, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  238. Keylist.Add(InputKey);
  239. InputKey = new KeyBind { function = KeybindOptions.Skillbar, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.B };
  240. Keylist.Add(InputKey);
  241. InputKey = new KeyBind { function = KeybindOptions.Mentor, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.L };
  242. Keylist.Add(InputKey);
  243. InputKey = new KeyBind { function = KeybindOptions.Relationship, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.I }; //结婚
  244. Keylist.Add(InputKey);
  245. InputKey = new KeyBind { function = KeybindOptions.Friends, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.U }; //好友
  246. Keylist.Add(InputKey);
  247. InputKey = new KeyBind { function = KeybindOptions.Guilds, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 0, Key = Keys.F }; //行会
  248. Keylist.Add(InputKey);
  249. // InputKey = new KeyBind { function = KeybindOptions.GameShop, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Y };
  250. // Keylist.Add(InputKey);
  251. InputKey = new KeyBind { function = KeybindOptions.Quests, RequireAlt = 0, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.D };
  252. Keylist.Add(InputKey);
  253. InputKey = new KeyBind { function = KeybindOptions.Closeall, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Escape };
  254. Keylist.Add(InputKey);
  255. InputKey = new KeyBind { function = KeybindOptions.Options, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.N };
  256. Keylist.Add(InputKey);
  257. // InputKey = new KeyBind { function = KeybindOptions.Options2, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.N };
  258. // Keylist.Add(InputKey);
  259. InputKey = new KeyBind { function = KeybindOptions.Group, RequireAlt = 0, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.G };
  260. Keylist.Add(InputKey);
  261. InputKey = new KeyBind { function = KeybindOptions.Belt, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 0, Key = Keys.Z };
  262. Keylist.Add(InputKey);
  263. InputKey = new KeyBind { function = KeybindOptions.BeltFlip, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 1, Key = Keys.Z };
  264. Keylist.Add(InputKey);
  265. InputKey = new KeyBind { function = KeybindOptions.Pickup, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Tab };
  266. Keylist.Add(InputKey);
  267. InputKey = new KeyBind { function = KeybindOptions.Belt1, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.D1 };
  268. Keylist.Add(InputKey);
  269. InputKey = new KeyBind { function = KeybindOptions.Belt1Alt, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.NumPad1 };
  270. Keylist.Add(InputKey);
  271. InputKey = new KeyBind { function = KeybindOptions.Belt2, RequireAlt = 0, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.D2 };
  272. Keylist.Add(InputKey);
  273. InputKey = new KeyBind { function = KeybindOptions.Belt2Alt, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.NumPad2 };
  274. Keylist.Add(InputKey);
  275. InputKey = new KeyBind { function = KeybindOptions.Belt3, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.D3 };
  276. Keylist.Add(InputKey);
  277. InputKey = new KeyBind { function = KeybindOptions.Belt3Alt, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.NumPad3 };
  278. Keylist.Add(InputKey);
  279. InputKey = new KeyBind { function = KeybindOptions.Belt4, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.D4 };
  280. Keylist.Add(InputKey);
  281. InputKey = new KeyBind { function = KeybindOptions.Belt4Alt, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.NumPad4 };
  282. Keylist.Add(InputKey);
  283. InputKey = new KeyBind { function = KeybindOptions.Belt5, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.D5 };
  284. Keylist.Add(InputKey);
  285. InputKey = new KeyBind { function = KeybindOptions.Belt5Alt, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.NumPad5 };
  286. Keylist.Add(InputKey);
  287. InputKey = new KeyBind { function = KeybindOptions.Belt6, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.D6 };
  288. Keylist.Add(InputKey);
  289. InputKey = new KeyBind { function = KeybindOptions.Belt6Alt, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.NumPad6 };
  290. Keylist.Add(InputKey);
  291. InputKey = new KeyBind { function = KeybindOptions.Logout, RequireAlt = 1, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.X };
  292. Keylist.Add(InputKey);
  293. InputKey = new KeyBind { function = KeybindOptions.Exit, RequireAlt = 1, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Q };
  294. Keylist.Add(InputKey);
  295. InputKey = new KeyBind { function = KeybindOptions.CreaturePickup, RequireAlt = 0, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.X };
  296. Keylist.Add(InputKey);
  297. InputKey = new KeyBind { function = KeybindOptions.CreatureAutoPickup, RequireAlt = 1, RequireShift = 0, RequireTilde = 2, RequireCtrl = 2, Key = Keys.A };
  298. Keylist.Add(InputKey);
  299. InputKey = new KeyBind { function = KeybindOptions.Minimap, RequireAlt = 0, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.V };
  300. Keylist.Add(InputKey);
  301. InputKey = new KeyBind { function = KeybindOptions.Bigmap, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.T };
  302. Keylist.Add(InputKey);
  303. InputKey = new KeyBind { function = KeybindOptions.Auxiliary, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Home }; //一定外挂按键
  304. Keylist.Add(InputKey);
  305. InputKey = new KeyBind { function = KeybindOptions.ChangeAttackmode, RequireAlt = 2, RequireShift = 0, RequireTilde = 2, RequireCtrl = 1, Key = Keys.H };
  306. Keylist.Add(InputKey);
  307. InputKey = new KeyBind { function = KeybindOptions.AttackmodePeace, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  308. Keylist.Add(InputKey);
  309. InputKey = new KeyBind { function = KeybindOptions.AttackmodeGroup, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  310. Keylist.Add(InputKey);
  311. InputKey = new KeyBind { function = KeybindOptions.AttackmodeGuild, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  312. Keylist.Add(InputKey);
  313. InputKey = new KeyBind { function = KeybindOptions.AttackmodeEnemyguild, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  314. Keylist.Add(InputKey);
  315. InputKey = new KeyBind { function = KeybindOptions.AttackmodeRedbrown, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  316. Keylist.Add(InputKey);
  317. InputKey = new KeyBind { function = KeybindOptions.AttackmodeAll, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  318. Keylist.Add(InputKey);
  319. InputKey = new KeyBind { function = KeybindOptions.ChangePetmode, RequireAlt = 0, RequireShift = 0, RequireTilde = 2, RequireCtrl = 1, Key = Keys.A };
  320. Keylist.Add(InputKey);
  321. InputKey = new KeyBind { function = KeybindOptions.PetmodeBoth, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  322. Keylist.Add(InputKey);
  323. InputKey = new KeyBind { function = KeybindOptions.PetmodeMoveonly, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  324. Keylist.Add(InputKey);
  325. InputKey = new KeyBind { function = KeybindOptions.PetmodeAttackonly, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  326. Keylist.Add(InputKey);
  327. InputKey = new KeyBind { function = KeybindOptions.PetmodeNone, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.None };
  328. Keylist.Add(InputKey);
  329. // InputKey = new KeyBind { function = KeybindOptions.Help, RequireAlt = 2, RequireShift = 0, RequireTilde = 2, RequireCtrl = 2, Key = Keys.H };
  330. // Keylist.Add(InputKey);
  331. InputKey = new KeyBind { function = KeybindOptions.Autorun, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.P };
  332. Keylist.Add(InputKey);
  333. InputKey = new KeyBind { function = KeybindOptions.Cameramode, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Insert };
  334. Keylist.Add(InputKey);
  335. InputKey = new KeyBind { function = KeybindOptions.Screenshot, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.PrintScreen };
  336. Keylist.Add(InputKey);
  337. InputKey = new KeyBind { function = KeybindOptions.DropView, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Tab };
  338. Keylist.Add(InputKey);
  339. InputKey = new KeyBind { function = KeybindOptions.TargetDead, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 1, Key = Keys.ControlKey };
  340. Keylist.Add(InputKey);
  341. // InputKey = new KeyBind { function = KeybindOptions.Ranking, RequireAlt = 2, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.K };
  342. // Keylist.Add(InputKey);
  343. InputKey = new KeyBind { function = KeybindOptions.AddGroupMember, RequireAlt = 1, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.G };
  344. Keylist.Add(InputKey);
  345. InputKey = new KeyBind { function = KeybindOptions.DelGroupMember, RequireAlt = 1, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.V };
  346. Keylist.Add(InputKey);
  347. InputKey = new KeyBind { function = KeybindOptions.MarryMove, RequireAlt = 1, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.ControlKey };
  348. Keylist.Add(InputKey);
  349. InputKey = new KeyBind { function = KeybindOptions.Talklong, RequireAlt = 0, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.R };
  350. Keylist.Add(InputKey);
  351. InputKey = new KeyBind { function = KeybindOptions.KeepMagic, RequireAlt = 0, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Tab };
  352. Keylist.Add(InputKey);
  353. InputKey = new KeyBind { function = KeybindOptions.LockPlayer, RequireAlt = 0, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Oemtilde };
  354. Keylist.Add(InputKey);
  355. InputKey = new KeyBind { function = KeybindOptions.MailSystem, RequireAlt = 0, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.Y };
  356. Keylist.Add(InputKey);
  357. InputKey = new KeyBind { function = KeybindOptions.TalkSwitch, RequireAlt = 0, RequireShift = 2, RequireTilde = 2, RequireCtrl = 2, Key = Keys.K };
  358. Keylist.Add(InputKey);
  359. InputKey = new KeyBind { function = KeybindOptions.ReliveTom, RequireAlt = 2, RequireShift = 0, RequireTilde = 2, RequireCtrl = 1, Key = Keys.X };
  360. Keylist.Add(InputKey);
  361. }
  362. public string GetKey(KeybindOptions Option)
  363. {
  364. string output = "";
  365. for (int i = 0; i < Keylist.Count; i++)
  366. {
  367. if (Keylist[i].function == Option)
  368. {
  369. if (CMain.InputKeys.Keylist[i].Key == Keys.None) return output;
  370. if (CMain.InputKeys.Keylist[i].RequireAlt == 1)
  371. output = "Alt";
  372. if (CMain.InputKeys.Keylist[i].RequireCtrl == 1)
  373. output = output != "" ? output + "\nCtrl" : "Ctrl";
  374. if (CMain.InputKeys.Keylist[i].RequireShift == 1)
  375. output = output != "" ? output + "\nShift" : "Shift";
  376. if (CMain.InputKeys.Keylist[i].RequireTilde == 1)
  377. output = output != "" ? output + "\n~" : "~";
  378. output = output != "" ? output + "\n" + CMain.InputKeys.Keylist[i].Key.ToString() : CMain.InputKeys.Keylist[i].Key.ToString();
  379. return output;
  380. }
  381. }
  382. return "";
  383. }
  384. }
  385. }