CharacterDialog.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. using Client.MirControls;
  2. using Client.MirGraphics;
  3. using Client.MirObjects;
  4. using Client.MirSounds;
  5. namespace Client.MirScenes.Dialogs
  6. {
  7. public sealed class CharacterDialog : MirImageControl
  8. {
  9. public MirButton CloseButton, CharacterButton, StatusButton, StateButton, SkillButton;
  10. public MirImageControl CharacterPage, StatusPage, StatePage, SkillPage, ClassImage;
  11. public MirLabel NameLabel, GuildLabel, LoverLabel;
  12. public MirLabel ACLabel, MACLabel, DCLabel, MCLabel, SCLabel, HealthLabel, ManaLabel;
  13. public MirLabel CritRLabel, CritDLabel, LuckLabel, AttkSpdLabel, AccLabel, AgilLabel;
  14. public MirLabel ExpPLabel, BagWLabel, WearWLabel, HandWLabel, MagicRLabel, PoisonRecLabel, HealthRLabel, ManaRLabel, PoisonResLabel, HolyTLabel, FreezeLabel, PoisonAtkLabel;
  15. public MirLabel HeadingLabel, StatLabel;
  16. public MirButton NextButton, BackButton;
  17. public MirItemCell[] Grid;
  18. private MirGridType GridType;
  19. public MagicButton[] Magics;
  20. public int StartIndex;
  21. private UserObject Actor;
  22. public CharacterDialog(MirGridType gridType, UserObject actor)
  23. {
  24. Actor = actor;
  25. GridType = gridType;
  26. Index = 504;
  27. Library = Libraries.Title;
  28. Location = new Point(Settings.ScreenWidth - 264, 0);
  29. Movable = true;
  30. Sort = true;
  31. BeforeDraw += (o, e) => RefreshInterface();
  32. CharacterPage = new MirImageControl
  33. {
  34. Index = 340,
  35. Parent = this,
  36. Library = Libraries.Prguse,
  37. Location = new Point(8, 90),
  38. };
  39. CharacterPage.AfterDraw += (o, e) =>
  40. {
  41. if (Libraries.StateItems == null) return;
  42. ItemInfo RealItem = null;
  43. if (Grid[(int)EquipmentSlot.Armour].Item != null)
  44. {
  45. if (actor.WingEffect == 1 || actor.WingEffect == 2)
  46. {
  47. int wingOffset = actor.WingEffect == 1 ? 2 : 4;
  48. int genderOffset = actor.Gender == MirGender.Male ? 0 : 1;
  49. Libraries.Prguse2.DrawBlend(1200 + wingOffset + genderOffset, DisplayLocation, Color.White, true, 1F);
  50. }
  51. RealItem = Functions.GetRealItem(Grid[(int)EquipmentSlot.Armour].Item.Info, actor.Level, actor.Class, GameScene.ItemInfoList);
  52. Libraries.StateItems.Draw(RealItem.Image, DisplayLocation, Color.White, true, 1F);
  53. }
  54. if (Grid[(int)EquipmentSlot.Weapon].Item != null)
  55. {
  56. RealItem = Functions.GetRealItem(Grid[(int)EquipmentSlot.Weapon].Item.Info, actor.Level, actor.Class, GameScene.ItemInfoList);
  57. Libraries.StateItems.Draw(RealItem.Image, DisplayLocation, Color.White, true, 1F);
  58. }
  59. if (Grid[(int)EquipmentSlot.Helmet].Item != null)
  60. Libraries.StateItems.Draw(Grid[(int)EquipmentSlot.Helmet].Item.Info.Image, DisplayLocation, Color.White, true, 1F);
  61. else
  62. {
  63. int hair = 441 + actor.Hair + (actor.Class == MirClass.Assassin ? 20 : 0) + (actor.Gender == MirGender.Male ? 0 : 40);
  64. int offSetX = actor.Class == MirClass.Assassin ? (actor.Gender == MirGender.Male ? 6 : 4) : 0;
  65. int offSetY = actor.Class == MirClass.Assassin ? (actor.Gender == MirGender.Male ? 25 : 18) : 0;
  66. Libraries.Prguse.Draw(hair, new Point(DisplayLocation.X + offSetX, DisplayLocation.Y + offSetY), Color.White, true, 1F);
  67. }
  68. };
  69. StatusPage = new MirImageControl
  70. {
  71. Index = 506,
  72. Parent = this,
  73. Library = Libraries.Title,
  74. Location = new Point(8, 90),
  75. Visible = false,
  76. };
  77. StatusPage.BeforeDraw += (o, e) =>
  78. {
  79. ACLabel.Text = string.Format("{0}-{1}", actor.Stats[Stat.MinAC], actor.Stats[Stat.MaxAC]);
  80. MACLabel.Text = string.Format("{0}-{1}", actor.Stats[Stat.MinMAC], actor.Stats[Stat.MaxMAC]);
  81. DCLabel.Text = string.Format("{0}-{1}", actor.Stats[Stat.MinDC], actor.Stats[Stat.MaxDC]);
  82. MCLabel.Text = string.Format("{0}-{1}", actor.Stats[Stat.MinMC], actor.Stats[Stat.MaxMC]);
  83. SCLabel.Text = string.Format("{0}-{1}", actor.Stats[Stat.MinSC], actor.Stats[Stat.MaxSC]);
  84. HealthLabel.Text = string.Format("{0}/{1}", actor.HP, actor.Stats[Stat.HP]);
  85. ManaLabel.Text = string.Format("{0}/{1}", actor.MP, actor.Stats[Stat.MP]);
  86. CritRLabel.Text = string.Format("{0}%", actor.Stats[Stat.CriticalRate]);
  87. CritDLabel.Text = string.Format("{0}", actor.Stats[Stat.CriticalDamage]);
  88. AttkSpdLabel.Text = string.Format("{0}", actor.Stats[Stat.AttackSpeed]);
  89. AccLabel.Text = string.Format("+{0}", actor.Stats[Stat.Accuracy]);
  90. AgilLabel.Text = string.Format("+{0}", actor.Stats[Stat.Agility]);
  91. LuckLabel.Text = string.Format("{0}", actor.Stats[Stat.Luck]);
  92. };
  93. StatePage = new MirImageControl
  94. {
  95. Index = 507,
  96. Parent = this,
  97. Library = Libraries.Title,
  98. Location = new Point(8, 90),
  99. Visible = false
  100. };
  101. StatePage.BeforeDraw += (o, e) =>
  102. {
  103. ExpPLabel.Text = string.Format("{0:0.##%}", actor.Experience / (double)actor.MaxExperience);
  104. BagWLabel.Text = string.Format("{0}/{1}", actor.CurrentBagWeight, actor.Stats[Stat.BagWeight]);
  105. WearWLabel.Text = string.Format("{0}/{1}", actor.CurrentWearWeight, actor.Stats[Stat.WearWeight]);
  106. HandWLabel.Text = string.Format("{0}/{1}", actor.CurrentHandWeight, actor.Stats[Stat.HandWeight]);
  107. MagicRLabel.Text = string.Format("+{0}", actor.Stats[Stat.MagicResist]);
  108. PoisonResLabel.Text = string.Format("+{0}", actor.Stats[Stat.PoisonResist]);
  109. HealthRLabel.Text = string.Format("+{0}", actor.Stats[Stat.HealthRecovery]);
  110. ManaRLabel.Text = string.Format("+{0}", actor.Stats[Stat.SpellRecovery]);
  111. PoisonRecLabel.Text = string.Format("+{0}", actor.Stats[Stat.PoisonRecovery]);
  112. HolyTLabel.Text = string.Format("+{0}", actor.Stats[Stat.Holy]);
  113. FreezeLabel.Text = string.Format("+{0}", actor.Stats[Stat.Freezing]);
  114. PoisonAtkLabel.Text = string.Format("+{0}", actor.Stats[Stat.PoisonAttack]);
  115. };
  116. SkillPage = new MirImageControl
  117. {
  118. Index = 508,
  119. Parent = this,
  120. Library = Libraries.Title,
  121. Location = new Point(8, 90),
  122. Visible = false
  123. };
  124. CharacterButton = new MirButton
  125. {
  126. Index = 500,
  127. Library = Libraries.Title,
  128. Location = new Point(8, 70),
  129. Parent = this,
  130. PressedIndex = 500,
  131. Size = new Size(64, 20),
  132. Sound = SoundList.ButtonA,
  133. };
  134. CharacterButton.Click += (o, e) => ShowCharacterPage();
  135. StatusButton = new MirButton
  136. {
  137. Library = Libraries.Title,
  138. Location = new Point(70, 70),
  139. Parent = this,
  140. PressedIndex = 501,
  141. Size = new Size(64, 20),
  142. Sound = SoundList.ButtonA
  143. };
  144. StatusButton.Click += (o, e) => ShowStatusPage();
  145. StateButton = new MirButton
  146. {
  147. Library = Libraries.Title,
  148. Location = new Point(132, 70),
  149. Parent = this,
  150. PressedIndex = 502,
  151. Size = new Size(64, 20),
  152. Sound = SoundList.ButtonA
  153. };
  154. StateButton.Click += (o, e) => ShowStatePage();
  155. SkillButton = new MirButton
  156. {
  157. Library = Libraries.Title,
  158. Location = new Point(194, 70),
  159. Parent = this,
  160. PressedIndex = 503,
  161. Size = new Size(64, 20),
  162. Sound = SoundList.ButtonA
  163. };
  164. SkillButton.Click += (o, e) => ShowSkillPage();
  165. CloseButton = new MirButton
  166. {
  167. HoverIndex = 361,
  168. Index = 360,
  169. Location = new Point(241, 3),
  170. Library = Libraries.Prguse2,
  171. Parent = this,
  172. PressedIndex = 362,
  173. Sound = SoundList.ButtonA,
  174. };
  175. CloseButton.Click += (o, e) => Hide();
  176. NameLabel = new MirLabel
  177. {
  178. DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter,
  179. Parent = this,
  180. Location = new Point(0, 12),
  181. Size = new Size(264, 20),
  182. NotControl = true,
  183. };
  184. GuildLabel = new MirLabel
  185. {
  186. DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter,
  187. Parent = this,
  188. Location = new Point(0, 33),
  189. Size = new Size(264, 30),
  190. NotControl = true,
  191. };
  192. ClassImage = new MirImageControl
  193. {
  194. Index = 100,
  195. Library = Libraries.Prguse,
  196. Location = new Point(15, 33),
  197. Parent = this,
  198. NotControl = true,
  199. };
  200. Grid = new MirItemCell[Enum.GetNames(typeof(EquipmentSlot)).Length];
  201. Grid[(int)EquipmentSlot.Weapon] = new MirItemCell
  202. {
  203. ItemSlot = (int)EquipmentSlot.Weapon,
  204. GridType = gridType,
  205. Parent = CharacterPage,
  206. Location = new Point(123, 7),
  207. };
  208. Grid[(int)EquipmentSlot.Armour] = new MirItemCell
  209. {
  210. ItemSlot = (int)EquipmentSlot.Armour,
  211. GridType = gridType,
  212. Parent = CharacterPage,
  213. Location = new Point(163, 7),
  214. };
  215. Grid[(int)EquipmentSlot.Helmet] = new MirItemCell
  216. {
  217. ItemSlot = (int)EquipmentSlot.Helmet,
  218. GridType = gridType,
  219. Parent = CharacterPage,
  220. Location = new Point(203, 7),
  221. };
  222. Grid[(int)EquipmentSlot.Torch] = new MirItemCell
  223. {
  224. ItemSlot = (int)EquipmentSlot.Torch,
  225. GridType = gridType,
  226. Parent = CharacterPage,
  227. Location = new Point(203, 134),
  228. };
  229. Grid[(int)EquipmentSlot.Necklace] = new MirItemCell
  230. {
  231. ItemSlot = (int)EquipmentSlot.Necklace,
  232. GridType = gridType,
  233. Parent = CharacterPage,
  234. Location = new Point(203, 98),
  235. };
  236. Grid[(int)EquipmentSlot.BraceletL] = new MirItemCell
  237. {
  238. ItemSlot = (int)EquipmentSlot.BraceletL,
  239. GridType = gridType,
  240. Parent = CharacterPage,
  241. Location = new Point(8, 170),
  242. };
  243. Grid[(int)EquipmentSlot.BraceletR] = new MirItemCell
  244. {
  245. ItemSlot = (int)EquipmentSlot.BraceletR,
  246. GridType = gridType,
  247. Parent = CharacterPage,
  248. Location = new Point(203, 170),
  249. };
  250. Grid[(int)EquipmentSlot.RingL] = new MirItemCell
  251. {
  252. ItemSlot = (int)EquipmentSlot.RingL,
  253. GridType = gridType,
  254. Parent = CharacterPage,
  255. Location = new Point(8, 206),
  256. };
  257. Grid[(int)EquipmentSlot.RingR] = new MirItemCell
  258. {
  259. ItemSlot = (int)EquipmentSlot.RingR,
  260. GridType = gridType,
  261. Parent = CharacterPage,
  262. Location = new Point(203, 206),
  263. };
  264. Grid[(int)EquipmentSlot.Amulet] = new MirItemCell
  265. {
  266. ItemSlot = (int)EquipmentSlot.Amulet,
  267. GridType = gridType,
  268. Parent = CharacterPage,
  269. Location = new Point(8, 242),
  270. };
  271. Grid[(int)EquipmentSlot.Boots] = new MirItemCell
  272. {
  273. ItemSlot = (int)EquipmentSlot.Boots,
  274. GridType = gridType,
  275. Parent = CharacterPage,
  276. Location = new Point(48, 242),
  277. };
  278. Grid[(int)EquipmentSlot.Belt] = new MirItemCell
  279. {
  280. ItemSlot = (int)EquipmentSlot.Belt,
  281. GridType = gridType,
  282. Parent = CharacterPage,
  283. Location = new Point(88, 242),
  284. };
  285. Grid[(int)EquipmentSlot.Stone] = new MirItemCell
  286. {
  287. ItemSlot = (int)EquipmentSlot.Stone,
  288. GridType = gridType,
  289. Parent = CharacterPage,
  290. Location = new Point(128, 242),
  291. };
  292. Grid[(int)EquipmentSlot.Mount] = new MirItemCell
  293. {
  294. ItemSlot = (int)EquipmentSlot.Mount,
  295. GridType = gridType,
  296. Parent = CharacterPage,
  297. Location = new Point(203, 62),
  298. };
  299. // STATS I
  300. HealthLabel = new MirLabel
  301. {
  302. AutoSize = true,
  303. Parent = StatusPage,
  304. Location = new Point(126, 20),
  305. NotControl = true,
  306. Text = "0-0",
  307. };
  308. ManaLabel = new MirLabel
  309. {
  310. AutoSize = true,
  311. Parent = StatusPage,
  312. Location = new Point(126, 38),
  313. NotControl = true,
  314. Text = "0-0",
  315. };
  316. ACLabel = new MirLabel
  317. {
  318. AutoSize = true,
  319. Parent = StatusPage,
  320. Location = new Point(126, 56),
  321. NotControl = true,
  322. Text = "0-0",
  323. };
  324. MACLabel = new MirLabel
  325. {
  326. AutoSize = true,
  327. Parent = StatusPage,
  328. Location = new Point(126, 74),
  329. NotControl = true,
  330. Text = "0-0",
  331. };
  332. DCLabel = new MirLabel
  333. {
  334. AutoSize = true,
  335. Parent = StatusPage,
  336. Location = new Point(126, 92),
  337. NotControl = true,
  338. Text = "0-0"
  339. };
  340. MCLabel = new MirLabel
  341. {
  342. AutoSize = true,
  343. Parent = StatusPage,
  344. Location = new Point(126, 110),
  345. NotControl = true,
  346. Text = "0/0"
  347. };
  348. SCLabel = new MirLabel
  349. {
  350. AutoSize = true,
  351. Parent = StatusPage,
  352. Location = new Point(126, 128),
  353. NotControl = true,
  354. Text = "0/0"
  355. };
  356. //Breezer - New Labels
  357. CritRLabel = new MirLabel
  358. {
  359. AutoSize = true,
  360. Parent = StatusPage,
  361. Location = new Point(126, 146),
  362. NotControl = true
  363. };
  364. CritDLabel = new MirLabel
  365. {
  366. AutoSize = true,
  367. Parent = StatusPage,
  368. Location = new Point(126, 164),
  369. NotControl = true
  370. };
  371. AttkSpdLabel = new MirLabel
  372. {
  373. AutoSize = true,
  374. Parent = StatusPage,
  375. Location = new Point(126, 182),
  376. NotControl = true
  377. };
  378. AccLabel = new MirLabel
  379. {
  380. AutoSize = true,
  381. Parent = StatusPage,
  382. Location = new Point(126, 200),
  383. NotControl = true
  384. };
  385. AgilLabel = new MirLabel
  386. {
  387. AutoSize = true,
  388. Parent = StatusPage,
  389. Location = new Point(126, 218),
  390. NotControl = true
  391. };
  392. LuckLabel = new MirLabel
  393. {
  394. AutoSize = true,
  395. Parent = StatusPage,
  396. Location = new Point(126, 236),
  397. NotControl = true
  398. };
  399. // STATS II
  400. ExpPLabel = new MirLabel
  401. {
  402. AutoSize = true,
  403. Parent = StatePage,
  404. Location = new Point(126, 20),
  405. NotControl = true,
  406. Text = "0-0",
  407. };
  408. BagWLabel = new MirLabel
  409. {
  410. AutoSize = true,
  411. Parent = StatePage,
  412. Location = new Point(126, 38),
  413. NotControl = true,
  414. Text = "0-0",
  415. };
  416. WearWLabel = new MirLabel
  417. {
  418. AutoSize = true,
  419. Parent = StatePage,
  420. Location = new Point(126, 56),
  421. NotControl = true,
  422. Text = "0-0",
  423. };
  424. HandWLabel = new MirLabel
  425. {
  426. AutoSize = true,
  427. Parent = StatePage,
  428. Location = new Point(126, 74),
  429. NotControl = true,
  430. Text = "0-0",
  431. };
  432. MagicRLabel = new MirLabel
  433. {
  434. AutoSize = true,
  435. Parent = StatePage,
  436. Location = new Point(126, 92),
  437. NotControl = true,
  438. Text = "0-0"
  439. };
  440. PoisonResLabel = new MirLabel
  441. {
  442. AutoSize = true,
  443. Parent = StatePage,
  444. Location = new Point(126, 110),
  445. NotControl = true,
  446. Text = "0/0"
  447. };
  448. HealthRLabel = new MirLabel
  449. {
  450. AutoSize = true,
  451. Parent = StatePage,
  452. Location = new Point(126, 128),
  453. NotControl = true,
  454. Text = "0/0"
  455. };
  456. //Breezer
  457. ManaRLabel = new MirLabel
  458. {
  459. AutoSize = true,
  460. Parent = StatePage,
  461. Location = new Point(126, 146),
  462. NotControl = true
  463. };
  464. PoisonRecLabel = new MirLabel
  465. {
  466. AutoSize = true,
  467. Parent = StatePage,
  468. Location = new Point(126, 164),
  469. NotControl = true
  470. };
  471. HolyTLabel = new MirLabel
  472. {
  473. AutoSize = true,
  474. Parent = StatePage,
  475. Location = new Point(126, 182),
  476. NotControl = true
  477. };
  478. FreezeLabel = new MirLabel
  479. {
  480. AutoSize = true,
  481. Parent = StatePage,
  482. Location = new Point(126, 200),
  483. NotControl = true
  484. };
  485. PoisonAtkLabel = new MirLabel
  486. {
  487. AutoSize = true,
  488. Parent = StatePage,
  489. Location = new Point(126, 218),
  490. NotControl = true
  491. };
  492. Magics = new MagicButton[7];
  493. for (int i = 0; i < Magics.Length; i++)
  494. Magics[i] = new MagicButton
  495. {
  496. Parent = SkillPage,
  497. Visible = false,
  498. Location = new Point(8, 8 + i * 33),
  499. HeroMagic = gridType == MirGridType.HeroEquipment
  500. };
  501. NextButton = new MirButton
  502. {
  503. Index = 396,
  504. Location = new Point(140, 250),
  505. Library = Libraries.Prguse,
  506. Parent = SkillPage,
  507. PressedIndex = 397,
  508. Sound = SoundList.ButtonA,
  509. };
  510. NextButton.Click += (o, e) =>
  511. {
  512. if (StartIndex + 7 >= actor.Magics.Count) return;
  513. StartIndex += 7;
  514. RefreshInterface();
  515. };
  516. BackButton = new MirButton
  517. {
  518. Index = 398,
  519. Location = new Point(90, 250),
  520. Library = Libraries.Prguse,
  521. Parent = SkillPage,
  522. PressedIndex = 399,
  523. Sound = SoundList.ButtonA,
  524. };
  525. BackButton.Click += (o, e) =>
  526. {
  527. if (StartIndex - 7 < 0) return;
  528. StartIndex -= 7;
  529. RefreshInterface();
  530. };
  531. }
  532. public override void Show()
  533. {
  534. if (Visible) return;
  535. Visible = true;
  536. }
  537. public override void Hide()
  538. {
  539. GameScene.Scene.SocketDialog.Hide();
  540. base.Hide();
  541. }
  542. public void ShowCharacterPage()
  543. {
  544. CharacterPage.Visible = true;
  545. StatusPage.Visible = false;
  546. StatePage.Visible = false;
  547. SkillPage.Visible = false;
  548. CharacterButton.Index = 500;
  549. StatusButton.Index = -1;
  550. StateButton.Index = -1;
  551. SkillButton.Index = -1;
  552. }
  553. private void ShowStatusPage()
  554. {
  555. CharacterPage.Visible = false;
  556. StatusPage.Visible = true;
  557. StatePage.Visible = false;
  558. SkillPage.Visible = false;
  559. CharacterButton.Index = -1;
  560. StatusButton.Index = 501;
  561. StateButton.Index = -1;
  562. SkillButton.Index = -1;
  563. }
  564. private void ShowStatePage()
  565. {
  566. CharacterPage.Visible = false;
  567. StatusPage.Visible = false;
  568. StatePage.Visible = true;
  569. SkillPage.Visible = false;
  570. CharacterButton.Index = -1;
  571. StatusButton.Index = -1;
  572. StateButton.Index = 502;
  573. SkillButton.Index = -1;
  574. }
  575. public void ShowSkillPage()
  576. {
  577. CharacterPage.Visible = false;
  578. StatusPage.Visible = false;
  579. StatePage.Visible = false;
  580. SkillPage.Visible = true;
  581. CharacterButton.Index = -1;
  582. StatusButton.Index = -1;
  583. StateButton.Index = -1;
  584. SkillButton.Index = 503;
  585. //StartIndex = 0;
  586. }
  587. private void RefreshInterface()
  588. {
  589. int offSet = Actor.Gender == MirGender.Male ? 0 : 1;
  590. Index = 504;// +offSet;
  591. CharacterPage.Index = 340 + offSet;
  592. switch (Actor.Class)
  593. {
  594. case MirClass.Warrior:
  595. ClassImage.Index = 100;// + offSet * 5;
  596. break;
  597. case MirClass.Wizard:
  598. ClassImage.Index = 101;// + offSet * 5;
  599. break;
  600. case MirClass.Taoist:
  601. ClassImage.Index = 102;// + offSet * 5;
  602. break;
  603. case MirClass.Assassin:
  604. ClassImage.Index = 103;// + offSet * 5;
  605. break;
  606. case MirClass.Archer:
  607. ClassImage.Index = 104;// + offSet * 5;
  608. break;
  609. }
  610. NameLabel.Text = Actor.Name;
  611. GuildLabel.Text = Actor.GuildName + " " + Actor.GuildRankName;
  612. for (int i = 0; i < Magics.Length; i++)
  613. {
  614. if (i + StartIndex >= Actor.Magics.Count)
  615. {
  616. Magics[i].Visible = false;
  617. continue;
  618. }
  619. Magics[i].Visible = true;
  620. Magics[i].Update(Actor.Magics[i + StartIndex]);
  621. }
  622. }
  623. public MirItemCell GetCell(ulong id)
  624. {
  625. for (int i = 0; i < Grid.Length; i++)
  626. {
  627. if (Grid[i].Item == null || Grid[i].Item.UniqueID != id) continue;
  628. return Grid[i];
  629. }
  630. return null;
  631. }
  632. }
  633. }