HelpDialog.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. using Client.MirControls;
  2. using Client.MirGraphics;
  3. using Client.MirSounds;
  4. namespace Client.MirScenes.Dialogs
  5. {
  6. public sealed class HelpDialog : MirImageControl
  7. {
  8. public List<HelpPage> Pages = new List<HelpPage>();
  9. public MirButton CloseButton, NextButton, PreviousButton;
  10. public MirLabel PageLabel;
  11. public HelpPage CurrentPage;
  12. public int CurrentPageNumber = 0;
  13. public HelpDialog()
  14. {
  15. Index = 920;
  16. Library = Libraries.Prguse;
  17. Movable = true;
  18. Sort = true;
  19. Location = Center;
  20. MirImageControl TitleLabel = new MirImageControl
  21. {
  22. Index = 57,
  23. Library = Libraries.Title,
  24. Location = new Point(18, 9),
  25. Parent = this
  26. };
  27. PreviousButton = new MirButton
  28. {
  29. Index = 240,
  30. HoverIndex = 241,
  31. PressedIndex = 242,
  32. Library = Libraries.Prguse2,
  33. Parent = this,
  34. Size = new Size(16, 16),
  35. Location = new Point(210, 485),
  36. Sound = SoundList.ButtonA,
  37. };
  38. PreviousButton.Click += (o, e) =>
  39. {
  40. CurrentPageNumber--;
  41. if (CurrentPageNumber < 0) CurrentPageNumber = Pages.Count - 1;
  42. DisplayPage(CurrentPageNumber);
  43. };
  44. NextButton = new MirButton
  45. {
  46. Index = 243,
  47. HoverIndex = 244,
  48. PressedIndex = 245,
  49. Library = Libraries.Prguse2,
  50. Parent = this,
  51. Size = new Size(16, 16),
  52. Location = new Point(310, 485),
  53. Sound = SoundList.ButtonA,
  54. };
  55. NextButton.Click += (o, e) =>
  56. {
  57. CurrentPageNumber++;
  58. if (CurrentPageNumber > Pages.Count - 1) CurrentPageNumber = 0;
  59. DisplayPage(CurrentPageNumber);
  60. };
  61. PageLabel = new MirLabel
  62. {
  63. Text = "",
  64. Font = new Font(Settings.FontName, 9F),
  65. DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter,
  66. Parent = this,
  67. NotControl = true,
  68. Location = new Point(230, 480),
  69. Size = new Size(80, 20)
  70. };
  71. CloseButton = new MirButton
  72. {
  73. HoverIndex = 361,
  74. Index = 360,
  75. Location = new Point(509, 3),
  76. Library = Libraries.Prguse2,
  77. Parent = this,
  78. PressedIndex = 362,
  79. Sound = SoundList.ButtonA,
  80. };
  81. CloseButton.Click += (o, e) => Hide();
  82. LoadImagePages();
  83. DisplayPage();
  84. }
  85. private void LoadImagePages()
  86. {
  87. Point location = new Point(12, 35);
  88. Dictionary<string, string> keybinds = new Dictionary<string, string>();
  89. List<HelpPage> imagePages = new List<HelpPage> {
  90. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ShortcutInformation), -1, new ShortcutPage1 { Parent = this } ) { Parent = this, Location = location, Visible = false },
  91. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ShortcutInformation), -1, new ShortcutPage2 { Parent = this } ) { Parent = this, Location = location, Visible = false },
  92. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ChatShortcuts), -1, new ShortcutPage3 { Parent = this } ) { Parent = this, Location = location, Visible = false },
  93. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Movements), 0, null) { Parent = this, Location = location, Visible = false },
  94. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Attacking), 1, null) { Parent = this, Location = location, Visible = false },
  95. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.CollectingItems), 2, null) { Parent = this, Location = location, Visible = false },
  96. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Health), 3, null) { Parent = this, Location = location, Visible = false },
  97. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Skills), 4, null) { Parent = this, Location = location, Visible = false },
  98. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Skills), 5, null) { Parent = this, Location = location, Visible = false },
  99. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Mana), 6, null) { Parent = this, Location = location, Visible = false },
  100. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chatting), 7, null) { Parent = this, Location = location, Visible = false },
  101. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Groups), 8, null) { Parent = this, Location = location, Visible = false },
  102. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Durability), 9, null) { Parent = this, Location = location, Visible = false },
  103. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Purchasing), 10, null) { Parent = this, Location = location, Visible = false },
  104. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Selling), 11, null) { Parent = this, Location = location, Visible = false },
  105. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Repairing), 12, null) { Parent = this, Location = location, Visible = false },
  106. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Trading), 13, null) { Parent = this, Location = location, Visible = false },
  107. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Inspecting), 14, null) { Parent = this, Location = location, Visible = false },
  108. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Statistics), 15, null) { Parent = this, Location = location, Visible = false },
  109. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Statistics), 16, null) { Parent = this, Location = location, Visible = false },
  110. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Statistics), 17, null) { Parent = this, Location = location, Visible = false },
  111. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Statistics), 18, null) { Parent = this, Location = location, Visible = false },
  112. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Statistics), 19, null) { Parent = this, Location = location, Visible = false },
  113. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Statistics), 20, null) { Parent = this, Location = location, Visible = false },
  114. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Quests), 21, null) { Parent = this, Location = location, Visible = false },
  115. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Quests), 22, null) { Parent = this, Location = location, Visible = false },
  116. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Quests), 23, null) { Parent = this, Location = location, Visible = false },
  117. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Quests), 24, null) { Parent = this, Location = location, Visible = false },
  118. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Mounts), 25, null) { Parent = this, Location = location, Visible = false },
  119. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Mounts), 26, null) { Parent = this, Location = location, Visible = false },
  120. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Fishing), 27, null) { Parent = this, Location = location, Visible = false },
  121. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GemsAndOrbs), 28, null) { Parent = this, Location = location, Visible = false },
  122. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Heroes), 29, null) { Parent = this, Location = location, Visible = false },
  123. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Heroes), 30, null) { Parent = this, Location = location, Visible = false },
  124. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Heroes), 31, null) { Parent = this, Location = location, Visible = false },
  125. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Heroes), 32, null) { Parent = this, Location = location, Visible = false },
  126. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Heroes), 33, null) { Parent = this, Location = location, Visible = false },
  127. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GuildBuffs), 34, null) { Parent = this, Location = location, Visible = false },
  128. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GuildBuffs), 35, null) { Parent = this, Location = location, Visible = false },
  129. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GuildBuffs), 36, null) { Parent = this, Location = location, Visible = false },
  130. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Awakening), 37, null) { Parent = this, Location = location, Visible = false },
  131. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Awakening), 38, null) { Parent = this, Location = location, Visible = false },
  132. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Awakening), 39, null) { Parent = this, Location = location, Visible = false },
  133. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Awakening), 40, null) { Parent = this, Location = location, Visible = false },
  134. new HelpPage(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Awakening), 41, null) { Parent = this, Location = location, Visible = false },
  135. };
  136. Pages.AddRange(imagePages);
  137. }
  138. public void DisplayPage(string pageName)
  139. {
  140. if (Pages.Count < 1) return;
  141. for (int i = 0; i < Pages.Count; i++)
  142. {
  143. if (Pages[i].Title.ToLower() != pageName.ToLower()) continue;
  144. DisplayPage(i);
  145. break;
  146. }
  147. }
  148. public void DisplayPage(int id = 0)
  149. {
  150. if (Pages.Count < 1) return;
  151. if (id > Pages.Count - 1) id = Pages.Count - 1;
  152. if (id < 0) id = 0;
  153. if (CurrentPage != null)
  154. {
  155. CurrentPage.Visible = false;
  156. if (CurrentPage.Page != null) CurrentPage.Page.Visible = false;
  157. }
  158. CurrentPage = Pages[id];
  159. if (CurrentPage == null) return;
  160. CurrentPage.Visible = true;
  161. if (CurrentPage.Page != null) CurrentPage.Page.Visible = true;
  162. CurrentPageNumber = id;
  163. CurrentPage.PageTitleLabel.Text = id + 1 + ". " + CurrentPage.Title;
  164. PageLabel.Text = string.Format("{0} / {1}", id + 1, Pages.Count);
  165. Show();
  166. }
  167. public void Toggle()
  168. {
  169. if (!Visible)
  170. Show();
  171. else
  172. Hide();
  173. }
  174. }
  175. public class ShortcutPage1 : ShortcutInfoPage
  176. {
  177. public ShortcutPage1()
  178. {
  179. Shortcuts = new List<ShortcutInfo>
  180. {
  181. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Exit), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ExitGame)),
  182. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Logout), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.LogOut)),
  183. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill1) + "-" + CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill8), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.SkillButtons)),
  184. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Inventory), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.InventoryWindowOpenClose)),
  185. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Equipment), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.StatusWindowOpenClose)),
  186. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Skills), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.SkillWindowOpenClose)),
  187. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Group), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GroupWindowOpenClose)),
  188. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Trade), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.TradeWindowOpenClose)),
  189. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Friends), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.FriendWindowOpenClose)),
  190. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Minimap), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.MinimapWindowOpenClose)),
  191. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Guilds), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GuildWindowOpenClose)),
  192. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.GameShop), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GameshopWindowOpenClose)),
  193. //Shortcuts.Add(new ShortcutInfo("K", "Rental window (open / close)"));
  194. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Relationship), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.EngagementWindowOpenClose)),
  195. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Belt), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.BeltWindowOpenClose)),
  196. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Options), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.OptionWindowOpenClose)),
  197. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Help), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.HelpWindowOpenClose)),
  198. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Mount), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.MountDismountRide)),
  199. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.TargetSpellLockOn), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.LockSpellOnTargetNotCursor))
  200. };
  201. LoadKeyBinds();
  202. }
  203. }
  204. public class ShortcutPage2 : ShortcutInfoPage
  205. {
  206. public ShortcutPage2()
  207. {
  208. Shortcuts = new List<ShortcutInfo>
  209. {
  210. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.ChangePetmode), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.TogglePetAttackPet)),
  211. //Shortcuts.Add(new ShortcutInfo("Ctrl + F", "Change the font in the chat box"));
  212. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.ChangeAttackmode), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.TogglePlayerAttackMode)),
  213. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.AttackmodePeace), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PeaceModeAttackMonstersOnly)),
  214. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.AttackmodeGroup), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GroupModeAttackExceptMembers)),
  215. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.AttackmodeGuild), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GuildModeAttackExceptMembers)),
  216. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.AttackmodeRedbrown), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GoodEvilModeAttackPKAndMonsters)),
  217. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.AttackmodeAll), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AllAttackModeAllSubjects)),
  218. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Bigmap), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ShowFieldMap)),
  219. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Skillbar), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ShowSkillBar)),
  220. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Autorun), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AutoRunOnOff)),
  221. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Cameramode), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ShowHideInterface)),
  222. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Pickup), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.HighlightPickupItems)),
  223. new ShortcutInfo(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.CtrlRightClick), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ShowOtherPlayersKits)),
  224. //Shortcuts.Add(new ShortcutInfo("F12", "Chat macros"));
  225. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Screenshot), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ScreenCapture)),
  226. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Fishing), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.OpenCloseFishingWindow)),
  227. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.Mentor), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.MentorWindowOpenClose)),
  228. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.CreaturePickup), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.CreaturePickupMultiMouseTarget)),
  229. new ShortcutInfo(CMain.InputKeys.GetKey(KeybindOptions.CreatureAutoPickup), GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.CreaturePickupSingleMouseTarget))
  230. };
  231. LoadKeyBinds();
  232. }
  233. }
  234. public class ShortcutPage3 : ShortcutInfoPage
  235. {
  236. public ShortcutPage3()
  237. {
  238. Shortcuts = new List<ShortcutInfo>
  239. {
  240. //Shortcuts.Add(new ShortcutInfo("` / Ctrl", "Change the skill bar"));
  241. new ShortcutInfo("/(username)", GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.CommandWhisperOthers)),
  242. new ShortcutInfo("!(text)", GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.CommandShoutNearby)),
  243. new ShortcutInfo("!~(text)", GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.CommandGuildChat))
  244. };
  245. LoadKeyBinds();
  246. }
  247. }
  248. public class ShortcutInfo
  249. {
  250. public string Shortcut { get; set; }
  251. public string Information { get; set; }
  252. public ShortcutInfo(string shortcut, string info)
  253. {
  254. Shortcut = shortcut.Replace("\n", " + ");
  255. Information = info;
  256. }
  257. }
  258. public class ShortcutInfoPage : MirControl
  259. {
  260. protected List<ShortcutInfo> Shortcuts = new List<ShortcutInfo>();
  261. public ShortcutInfoPage()
  262. {
  263. Visible = false;
  264. MirLabel shortcutTitleLabel = new MirLabel
  265. {
  266. Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Shortcuts),
  267. DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
  268. ForeColour = Color.White,
  269. Font = new Font(Settings.FontName, 10F),
  270. Parent = this,
  271. AutoSize = true,
  272. Location = new Point(13, 75),
  273. Size = new Size(100, 30)
  274. };
  275. MirLabel infoTitleLabel = new MirLabel
  276. {
  277. Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Information),
  278. DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
  279. ForeColour = Color.White,
  280. Font = new Font(Settings.FontName, 10F),
  281. Parent = this,
  282. AutoSize = true,
  283. Location = new Point(114, 75),
  284. Size = new Size(405, 30)
  285. };
  286. }
  287. public void LoadKeyBinds()
  288. {
  289. if (Shortcuts == null) return;
  290. for (int i = 0; i < Shortcuts.Count; i++)
  291. {
  292. MirLabel shortcutLabel = new MirLabel
  293. {
  294. Text = Shortcuts[i].Shortcut,
  295. ForeColour = Color.Yellow,
  296. DrawFormat = TextFormatFlags.VerticalCenter,
  297. Font = new Font(Settings.FontName, 9F),
  298. Parent = this,
  299. AutoSize = true,
  300. Location = new Point(18, 107 + (20 * i)),
  301. Size = new Size(95, 23),
  302. };
  303. MirLabel informationLabel = new MirLabel
  304. {
  305. Text = Shortcuts[i].Information,
  306. DrawFormat = TextFormatFlags.VerticalCenter,
  307. ForeColour = Color.White,
  308. Font = new Font(Settings.FontName, 9F),
  309. Parent = this,
  310. AutoSize = true,
  311. Location = new Point(119, 107 + (20 * i)),
  312. Size = new Size(400, 23),
  313. };
  314. }
  315. }
  316. }
  317. public class HelpPage : MirControl
  318. {
  319. public string Title;
  320. public int ImageID;
  321. public MirControl Page;
  322. public MirLabel PageTitleLabel;
  323. public HelpPage(string title, int imageID, MirControl page)
  324. {
  325. Title = title;
  326. ImageID = imageID;
  327. Page = page;
  328. NotControl = true;
  329. Size = new System.Drawing.Size(508, 396 + 40);
  330. BeforeDraw += HelpPage_BeforeDraw;
  331. PageTitleLabel = new MirLabel
  332. {
  333. Text = Title,
  334. Font = new Font(Settings.FontName, 10F, FontStyle.Bold),
  335. DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
  336. Parent = this,
  337. Size = new System.Drawing.Size(242, 30),
  338. Location = new Point(135, 4)
  339. };
  340. }
  341. void HelpPage_BeforeDraw(object sender, EventArgs e)
  342. {
  343. if (ImageID < 0) return;
  344. Libraries.Help.Draw(ImageID, new Point(DisplayLocation.X, DisplayLocation.Y + 40), Color.White, false);
  345. }
  346. }
  347. }