MainDialogs.cs 173 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183
  1. using System.Text.RegularExpressions;
  2. using Client.MirControls;
  3. using Client.MirGraphics;
  4. using Client.MirNetwork;
  5. using Client.MirObjects;
  6. using Client.MirSounds;
  7. using SlimDX;
  8. using Font = System.Drawing.Font;
  9. using C = ClientPackets;
  10. namespace Client.MirScenes.Dialogs
  11. {
  12. public sealed class MainDialog : MirImageControl
  13. {
  14. public static UserObject User
  15. {
  16. get { return MapObject.User; }
  17. set { MapObject.User = value; }
  18. }
  19. public MirImageControl ExperienceBar, WeightBar, LeftCap, RightCap;
  20. public MirButton GameShopButton, MenuButton, InventoryButton, CharacterButton, SkillButton, QuestButton, OptionButton;
  21. public MirControl HealthOrb;
  22. public MirLabel HealthLabel, ManaLabel, TopLabel, BottomLabel, LevelLabel, CharacterName, ExperienceLabel, GoldLabel, WeightLabel, SpaceLabel, AModeLabel, PModeLabel, SModeLabel;
  23. public HeroInfoPanel HeroInfoPanel;
  24. public HeroBehaviourPanel HeroBehaviourPanel;
  25. public MirButton HeroMenuButton, HeroSummonButton;
  26. public bool HPOnly
  27. {
  28. get { return User != null && User.Class == MirClass.Warrior && User.Level < 26; }
  29. }
  30. public MainDialog()
  31. {
  32. Index = Settings.Resolution == 800 ? 0 : Settings.Resolution == 1024 ? 1 : 2;
  33. Library = Libraries.Prguse;
  34. Location = new Point(((Settings.ScreenWidth / 2) - (Size.Width / 2)), Settings.ScreenHeight - Size.Height);
  35. PixelDetect = true;
  36. LeftCap = new MirImageControl
  37. {
  38. Index = 12,
  39. Library = Libraries.Prguse,
  40. Location = new Point(-67, this.Size.Height - 96),
  41. Parent = this,
  42. Visible = false
  43. };
  44. RightCap = new MirImageControl
  45. {
  46. Index = 13,
  47. Library = Libraries.Prguse,
  48. Location = new Point(1024, this.Size.Height - 104),
  49. Parent = this,
  50. Visible = false
  51. };
  52. if (Settings.Resolution > 1024)
  53. {
  54. LeftCap.Visible = true;
  55. RightCap.Visible = true;
  56. }
  57. InventoryButton = new MirButton
  58. {
  59. HoverIndex = 1904,
  60. Index = 1903,
  61. Library = Libraries.Prguse,
  62. Location = new Point(this.Size.Width - 96, 76),
  63. Parent = this,
  64. PressedIndex = 1905,
  65. Sound = SoundList.ButtonA,
  66. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.InventoryKey), CMain.InputKeys.GetKey(KeybindOptions.Inventory))
  67. };
  68. InventoryButton.Click += (o, e) =>
  69. {
  70. if (GameScene.Scene.InventoryDialog.Visible)
  71. GameScene.Scene.InventoryDialog.Hide();
  72. else
  73. GameScene.Scene.InventoryDialog.Show();
  74. };
  75. CharacterButton = new MirButton
  76. {
  77. HoverIndex = 1901,
  78. Index = 1900,
  79. Library = Libraries.Prguse,
  80. Location = new Point(this.Size.Width - 119, 76),
  81. Parent = this,
  82. PressedIndex = 1902,
  83. Sound = SoundList.ButtonA,
  84. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.CharacterKey), CMain.InputKeys.GetKey(KeybindOptions.Equipment))
  85. };
  86. CharacterButton.Click += (o, e) =>
  87. {
  88. if (GameScene.Scene.CharacterDialog.Visible && GameScene.Scene.CharacterDialog.CharacterPage.Visible)
  89. GameScene.Scene.CharacterDialog.Hide();
  90. else
  91. {
  92. GameScene.Scene.CharacterDialog.Show();
  93. GameScene.Scene.CharacterDialog.ShowCharacterPage();
  94. }
  95. };
  96. SkillButton = new MirButton
  97. {
  98. HoverIndex = 1907,
  99. Index = 1906,
  100. Library = Libraries.Prguse,
  101. Location = new Point(this.Size.Width - 73, 76),
  102. Parent = this,
  103. PressedIndex = 1908,
  104. Sound = SoundList.ButtonA,
  105. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SkillsKey), CMain.InputKeys.GetKey(KeybindOptions.Skills))
  106. };
  107. SkillButton.Click += (o, e) =>
  108. {
  109. if (GameScene.Scene.CharacterDialog.Visible && GameScene.Scene.CharacterDialog.SkillPage.Visible)
  110. GameScene.Scene.CharacterDialog.Hide();
  111. else
  112. {
  113. GameScene.Scene.CharacterDialog.Show();
  114. GameScene.Scene.CharacterDialog.ShowSkillPage();
  115. }
  116. };
  117. QuestButton = new MirButton
  118. {
  119. HoverIndex = 1910,
  120. Index = 1909,
  121. Library = Libraries.Prguse,
  122. Location = new Point(this.Size.Width - 50, 76),
  123. Parent = this,
  124. PressedIndex = 1911,
  125. Sound = SoundList.ButtonA,
  126. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.QuestsKey), CMain.InputKeys.GetKey(KeybindOptions.Quests))
  127. };
  128. QuestButton.Click += (o, e) =>
  129. {
  130. if (!GameScene.Scene.QuestLogDialog.Visible)
  131. GameScene.Scene.QuestLogDialog.Show();
  132. else GameScene.Scene.QuestLogDialog.Hide();
  133. };
  134. OptionButton = new MirButton
  135. {
  136. HoverIndex = 1913,
  137. Index = 1912,
  138. Library = Libraries.Prguse,
  139. Location = new Point(this.Size.Width - 27, 76),
  140. Parent = this,
  141. PressedIndex = 1914,
  142. Sound = SoundList.ButtonA,
  143. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.OptionsKey), CMain.InputKeys.GetKey(KeybindOptions.Options))
  144. };
  145. OptionButton.Click += (o, e) =>
  146. {
  147. if (!GameScene.Scene.OptionDialog.Visible)
  148. GameScene.Scene.OptionDialog.Show();
  149. else GameScene.Scene.OptionDialog.Hide();
  150. };
  151. MenuButton = new MirButton
  152. {
  153. HoverIndex = 1961,
  154. Index = 1960,
  155. Library = Libraries.Prguse,
  156. Location = new Point(this.Size.Width - 55, 35),
  157. Parent = this,
  158. PressedIndex = 1962,
  159. Sound = SoundList.ButtonC,
  160. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Menu)
  161. };
  162. MenuButton.Click += (o, e) =>
  163. {
  164. if (!GameScene.Scene.MenuDialog.Visible) GameScene.Scene.MenuDialog.Show();
  165. else GameScene.Scene.MenuDialog.Hide();
  166. };
  167. GameShopButton = new MirButton
  168. {
  169. HoverIndex = 827,
  170. Index = 826,
  171. Library = Libraries.Prguse,
  172. Location = new Point(this.Size.Width - 105, 35),
  173. Parent = this,
  174. PressedIndex = 828,
  175. Sound = SoundList.ButtonC,
  176. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.GameShopKey), CMain.InputKeys.GetKey(KeybindOptions.GameShop))
  177. };
  178. GameShopButton.Click += (o, e) =>
  179. {
  180. if (!GameScene.Scene.GameShopDialog.Visible) GameScene.Scene.GameShopDialog.Show();
  181. else GameScene.Scene.GameShopDialog.Hide();
  182. };
  183. HealthOrb = new MirControl
  184. {
  185. Parent = this,
  186. Location = new Point(0, 30),
  187. NotControl = true,
  188. };
  189. HealthOrb.BeforeDraw += HealthOrb_BeforeDraw;
  190. HealthLabel = new MirLabel
  191. {
  192. AutoSize = true,
  193. Location = new Point(0, 27),
  194. Parent = HealthOrb
  195. };
  196. HealthLabel.SizeChanged += Label_SizeChanged;
  197. ManaLabel = new MirLabel
  198. {
  199. AutoSize = true,
  200. Location = new Point(0, 42),
  201. Parent = HealthOrb
  202. };
  203. ManaLabel.SizeChanged += Label_SizeChanged;
  204. TopLabel = new MirLabel
  205. {
  206. Size = new Size(85, 30),
  207. DrawFormat = TextFormatFlags.HorizontalCenter,
  208. Location = new Point(9, 20),
  209. Parent = HealthOrb,
  210. };
  211. BottomLabel = new MirLabel
  212. {
  213. Size = new Size(85, 30),
  214. DrawFormat = TextFormatFlags.HorizontalCenter,
  215. Location = new Point(9, 50),
  216. Parent = HealthOrb,
  217. };
  218. LevelLabel = new MirLabel
  219. {
  220. AutoSize = true,
  221. Parent = this,
  222. Location = new Point(5, 108)
  223. };
  224. CharacterName = new MirLabel
  225. {
  226. DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
  227. Parent = this,
  228. Location = new Point(6, 120),
  229. Size = new Size(90, 16)
  230. };
  231. ExperienceBar = new MirImageControl
  232. {
  233. Index = Settings.Resolution != 800 ? 8 : 7,
  234. Library = Libraries.Prguse,
  235. Location = new Point(9, 143),
  236. Parent = this,
  237. DrawImage = false,
  238. NotControl = true,
  239. };
  240. ExperienceBar.BeforeDraw += ExperienceBar_BeforeDraw;
  241. ExperienceLabel = new MirLabel
  242. {
  243. AutoSize = true,
  244. Parent = ExperienceBar,
  245. NotControl = true,
  246. };
  247. GoldLabel = new MirLabel
  248. {
  249. DrawFormat = TextFormatFlags.VerticalCenter,
  250. Font = new Font(Settings.FontName, 8F),
  251. Location = new Point(this.Size.Width - 105, 119),
  252. Parent = this,
  253. Size = new Size(99, 13),
  254. Sound = SoundList.Gold,
  255. };
  256. GoldLabel.Click += (o, e) =>
  257. {
  258. if (GameScene.SelectedCell == null)
  259. GameScene.PickedUpGold = !GameScene.PickedUpGold && GameScene.Gold > 0;
  260. };
  261. WeightBar = new MirImageControl
  262. {
  263. Index = 76,
  264. Library = Libraries.Prguse,
  265. Location = new Point(this.Size.Width - 105, 103),
  266. Parent = this,
  267. DrawImage = false,
  268. NotControl = true,
  269. };
  270. WeightBar.BeforeDraw += WeightBar_BeforeDraw;
  271. WeightLabel = new MirLabel
  272. {
  273. Parent = this,
  274. Location = new Point(this.Size.Width - 105, 101),
  275. Size = new Size(40, 14),
  276. };
  277. SpaceLabel = new MirLabel
  278. {
  279. Parent = this,
  280. Location = new Point(this.Size.Width - 30, 101),
  281. Size = new Size(26, 14),
  282. };
  283. HeroMenuButton = new MirButton
  284. {
  285. Index = 2164,
  286. HoverIndex = 2165,
  287. PressedIndex = 2166,
  288. Library = Libraries.Prguse,
  289. Parent = this,
  290. Location = new Point(Size.Width - 160, 65),
  291. Size = new Size(20, 20),
  292. Sound = SoundList.ButtonA,
  293. Visible = false
  294. };
  295. HeroMenuButton.Click += (o, e) =>
  296. {
  297. GameScene.Scene.HeroMenuPanel.Toggle();
  298. };
  299. HeroSummonButton = new MirButton
  300. {
  301. Index = 2167,
  302. HoverIndex = 2168,
  303. PressedIndex = 2169,
  304. Library = Libraries.Prguse,
  305. Parent = this,
  306. Location = new Point(this.Size.Width - 160, 90),
  307. Size = new Size(20, 20),
  308. Sound = SoundList.ButtonA,
  309. Visible = false
  310. };
  311. HeroSummonButton.Click += (o, e) =>
  312. {
  313. Network.Enqueue(new C.Chat
  314. {
  315. Message = "@SUMMONHERO",
  316. });
  317. };
  318. HeroInfoPanel = new HeroInfoPanel { Parent = this, Visible = false };
  319. AModeLabel = new MirLabel
  320. {
  321. AutoSize = true,
  322. ForeColour = Color.Yellow,
  323. OutLineColour = Color.Black,
  324. Parent = this,
  325. Location = new Point(Settings.Resolution != 800 ? 899 : 675, Settings.Resolution != 800 ? -448 : -280),
  326. Visible = Settings.ModeView
  327. };
  328. PModeLabel = new MirLabel
  329. {
  330. AutoSize = true,
  331. ForeColour = Color.Orange,
  332. OutLineColour = Color.Black,
  333. Parent = this,
  334. Location = new Point(230, 125),
  335. Visible = Settings.ModeView
  336. };
  337. SModeLabel = new MirLabel
  338. {
  339. AutoSize = true,
  340. ForeColour = Color.LimeGreen,
  341. OutLineColour = Color.Black,
  342. Parent = this,
  343. Location = new Point(Settings.Resolution != 800 ? 899 : 675, Settings.Resolution != 800 ? -463 : -295),
  344. Visible = Settings.ModeView
  345. };
  346. }
  347. public void Process()
  348. {
  349. switch (GameScene.Scene.AMode)
  350. {
  351. case AttackMode.Peace:
  352. AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_Peace);
  353. break;
  354. case AttackMode.Group:
  355. AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_Group);
  356. break;
  357. case AttackMode.Guild:
  358. AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_Guild);
  359. break;
  360. case AttackMode.EnemyGuild:
  361. AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_EnemyGuild);
  362. break;
  363. case AttackMode.RedBrown:
  364. AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_RedBrown);
  365. break;
  366. case AttackMode.All:
  367. AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_All);
  368. break;
  369. }
  370. switch (GameScene.Scene.PMode)
  371. {
  372. case PetMode.Both:
  373. PModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PetMode_Both);
  374. break;
  375. case PetMode.MoveOnly:
  376. PModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PetMode_MoveOnly);
  377. break;
  378. case PetMode.AttackOnly:
  379. PModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PetMode_AttackOnly);
  380. break;
  381. case PetMode.None:
  382. PModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PetMode_None);
  383. break;
  384. case PetMode.FocusMasterTarget:
  385. PModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PetMode_FocusMasterTarget);
  386. break;
  387. }
  388. switch (Settings.SkillMode)
  389. {
  390. case true:
  391. SModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.SkillModeTilde);
  392. break;
  393. case false:
  394. SModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.SkillModeCtrl);
  395. break;
  396. }
  397. if (Settings.HPView)
  398. {
  399. HealthLabel.Text = string.Format("HP {0}/{1}", User.HP, User.Stats[Stat.HP]);
  400. ManaLabel.Text = HPOnly ? "" : string.Format("MP {0}/{1} ", User.MP, User.Stats[Stat.MP]);
  401. TopLabel.Text = string.Empty;
  402. BottomLabel.Text = string.Empty;
  403. }
  404. else
  405. {
  406. if (HPOnly)
  407. {
  408. TopLabel.Text = string.Format("{0}\n" + "--", User.HP);
  409. BottomLabel.Text = string.Format("{0}", User.Stats[Stat.HP]);
  410. }
  411. else
  412. {
  413. TopLabel.Text = string.Format(" {0} {1} \n" + "---------------", User.HP, User.MP);
  414. BottomLabel.Text = string.Format(" {0} {1} ", User.Stats[Stat.HP], User.Stats[Stat.MP]);
  415. }
  416. HealthLabel.Text = string.Empty;
  417. ManaLabel.Text = string.Empty;
  418. }
  419. LevelLabel.Text = User.Level.ToString();
  420. ExperienceLabel.Text = string.Format("{0:#0.##%}", User.Experience / (double)User.MaxExperience);
  421. ExperienceLabel.Location = new Point((ExperienceBar.Size.Width / 2) - 20, -10);
  422. GoldLabel.Text = GameScene.Gold.ToString("###,###,##0");
  423. CharacterName.Text = User.Name;
  424. SpaceLabel.Text = User.Inventory.Count(t => t == null).ToString();
  425. WeightLabel.Text = (MapObject.User.Stats[Stat.BagWeight] - MapObject.User.CurrentBagWeight).ToString();
  426. }
  427. private void Label_SizeChanged(object sender, EventArgs e)
  428. {
  429. if (!(sender is MirLabel l)) return;
  430. l.Location = new Point(50 - (l.Size.Width / 2), l.Location.Y);
  431. }
  432. private void HealthOrb_BeforeDraw(object sender, EventArgs e)
  433. {
  434. if (Libraries.Prguse == null) return;
  435. int height;
  436. if (User != null && User.HP != User.Stats[Stat.HP])
  437. height = (int)(80 * User.HP / (float)User.Stats[Stat.HP]);
  438. else
  439. height = 80;
  440. if (height < 0) height = 0;
  441. if (height > 80) height = 80;
  442. int orbImage = 4;
  443. bool hpOnly = false;
  444. if (HPOnly)
  445. {
  446. hpOnly = true;
  447. orbImage = 6;
  448. }
  449. Rectangle r = new Rectangle(0, 80 - height, hpOnly ? 100 : 50, height);
  450. Libraries.Prguse.Draw(orbImage, r, new Point(((Settings.ScreenWidth / 2) - (Size.Width / 2)), HealthOrb.DisplayLocation.Y + 80 - height), Color.White, false);
  451. if (hpOnly) return;
  452. if (User.MP != User.Stats[Stat.MP])
  453. height = (int)(80 * User.MP / (float)User.Stats[Stat.MP]);
  454. else
  455. height = 80;
  456. if (height < 0) height = 0;
  457. if (height > 80) height = 80;
  458. r = new Rectangle(51, 80 - height, 50, height);
  459. Libraries.Prguse.Draw(4, r, new Point(((Settings.ScreenWidth / 2) - (Size.Width / 2)) + 51, HealthOrb.DisplayLocation.Y + 80 - height), Color.White, false);
  460. }
  461. private void ExperienceBar_BeforeDraw(object sender, EventArgs e)
  462. {
  463. if (ExperienceBar.Library == null) return;
  464. double percent = MapObject.User.Experience / (double)MapObject.User.MaxExperience;
  465. if (percent > 1) percent = 1;
  466. if (percent <= 0) return;
  467. Rectangle section = new Rectangle
  468. {
  469. Size = new Size((int)((ExperienceBar.Size.Width - 3) * percent), ExperienceBar.Size.Height)
  470. };
  471. ExperienceBar.Library.Draw(ExperienceBar.Index, section, ExperienceBar.DisplayLocation, Color.White, false);
  472. }
  473. private void WeightBar_BeforeDraw(object sender, EventArgs e)
  474. {
  475. if (WeightBar.Library == null) return;
  476. double percent = MapObject.User.CurrentBagWeight / (double)MapObject.User.Stats[Stat.BagWeight];
  477. if (percent > 1) percent = 1;
  478. if (percent <= 0) return;
  479. // Weight bar art based on fill
  480. if (percent <= 0.50)
  481. {
  482. WeightBar.Library = Libraries.Prguse;
  483. WeightBar.Index = 76;
  484. }
  485. else if (percent <= 0.75)
  486. {
  487. WeightBar.Library = Libraries.UI_32bit;
  488. WeightBar.Index = 473;
  489. }
  490. else
  491. {
  492. WeightBar.Library = Libraries.UI_32bit;
  493. WeightBar.Index = 472;
  494. }
  495. Rectangle section = new Rectangle
  496. {
  497. Size = new Size((int)((WeightBar.Size.Width - 2) * percent), WeightBar.Size.Height)
  498. };
  499. WeightBar.Library.Draw(WeightBar.Index, section, WeightBar.DisplayLocation, Color.White, false);
  500. }
  501. }
  502. public sealed class ChatDialog : MirImageControl
  503. {
  504. public List<ChatHistory> FullHistory = new List<ChatHistory>();
  505. public List<ChatHistory> History = new List<ChatHistory>();
  506. public List<MirLabel> ChatLines = new List<MirLabel>();
  507. public List<ChatItem> LinkedItems = new List<ChatItem>();
  508. public List<MirLabel> LinkedItemButtons = new List<MirLabel>();
  509. public MirButton HomeButton, UpButton, EndButton, DownButton, PositionBar;
  510. public MirImageControl CountBar;
  511. public MirTextBox ChatTextBox;
  512. public Font ChatFont = new Font(Settings.FontName, 8F);
  513. public string LastPM = string.Empty;
  514. public int StartIndex, LineCount = 4, WindowSize;
  515. public string ChatPrefix = "";
  516. public bool Transparent;
  517. public ChatDialog()
  518. {
  519. Index = Settings.Resolution != 800 ? 2221 : 2201;
  520. Library = Libraries.Prguse;
  521. Location = new Point(GameScene.Scene.MainDialog.Location.X + 230, Settings.ScreenHeight - 97);
  522. PixelDetect = true;
  523. KeyPress += ChatPanel_KeyPress;
  524. KeyDown += ChatPanel_KeyDown;
  525. MouseWheel += ChatPanel_MouseWheel;
  526. ChatTextBox = new MirTextBox
  527. {
  528. BackColour = Color.DarkGray,
  529. ForeColour = Color.Black,
  530. Parent = this,
  531. Size = new Size(Settings.Resolution != 800 ? 627 : 403, 13),
  532. Location = new Point(1, 54),
  533. MaxLength = Globals.MaxChatLength,
  534. Visible = false,
  535. Font = ChatFont,
  536. };
  537. ChatTextBox.TextBox.KeyPress += ChatTextBox_KeyPress;
  538. ChatTextBox.TextBox.KeyDown += ChatTextBox_KeyDown;
  539. ChatTextBox.TextBox.KeyUp += ChatTextBox_KeyUp;
  540. HomeButton = new MirButton
  541. {
  542. Index = 2018,
  543. HoverIndex = 2019,
  544. Library = Libraries.Prguse,
  545. Location = new Point(Settings.Resolution != 800 ? 618 : 394, 1),
  546. Parent = this,
  547. PressedIndex = 2020,
  548. Sound = SoundList.ButtonA,
  549. };
  550. HomeButton.Click += (o, e) =>
  551. {
  552. if (StartIndex == 0) return;
  553. StartIndex = 0;
  554. Update();
  555. };
  556. UpButton = new MirButton
  557. {
  558. Index = 2021,
  559. HoverIndex = 2022,
  560. Library = Libraries.Prguse,
  561. Location = new Point(Settings.Resolution != 800 ? 618 : 394, 9),
  562. Parent = this,
  563. PressedIndex = 2023,
  564. Sound = SoundList.ButtonA,
  565. };
  566. UpButton.Click += (o, e) =>
  567. {
  568. if (StartIndex == 0) return;
  569. StartIndex--;
  570. Update();
  571. };
  572. EndButton = new MirButton
  573. {
  574. Index = 2027,
  575. HoverIndex = 2028,
  576. Library = Libraries.Prguse,
  577. Location = new Point(Settings.Resolution != 800 ? 618 : 394, 45),
  578. Parent = this,
  579. PressedIndex = 2029,
  580. Sound = SoundList.ButtonA,
  581. };
  582. EndButton.Click += (o, e) =>
  583. {
  584. if (StartIndex == History.Count - 1) return;
  585. StartIndex = History.Count - 1;
  586. Update();
  587. };
  588. DownButton = new MirButton
  589. {
  590. Index = 2024,
  591. HoverIndex = 2025,
  592. Library = Libraries.Prguse,
  593. Location = new Point(Settings.Resolution != 800 ? 618 : 394, 39),
  594. Parent = this,
  595. PressedIndex = 2026,
  596. Sound = SoundList.ButtonA,
  597. };
  598. DownButton.Click += (o, e) =>
  599. {
  600. if (StartIndex == History.Count - 1) return;
  601. StartIndex++;
  602. Update();
  603. };
  604. CountBar = new MirImageControl
  605. {
  606. Index = 2012,
  607. Library = Libraries.Prguse,
  608. Location = new Point(Settings.Resolution != 800 ? 622 : 398, 16),
  609. Parent = this,
  610. };
  611. PositionBar = new MirButton
  612. {
  613. Index = 2015,
  614. HoverIndex = 2016,
  615. Library = Libraries.Prguse,
  616. Location = new Point(Settings.Resolution != 800 ? 619 : 395, 16),
  617. Parent = this,
  618. PressedIndex = 2017,
  619. Movable = true,
  620. Sound = SoundList.None,
  621. };
  622. PositionBar.OnMoving += PositionBar_OnMoving;
  623. }
  624. public void SetChatText(string newText)
  625. {
  626. string newMsg = ChatTextBox.Text += newText;
  627. if (newMsg.Length > Globals.MaxChatLength) return;
  628. ChatTextBox.Text = newMsg;
  629. ChatTextBox.SetFocus();
  630. ChatTextBox.Visible = true;
  631. ChatTextBox.TextBox.SelectionLength = 0;
  632. ChatTextBox.TextBox.SelectionStart = ChatTextBox.Text.Length;
  633. }
  634. private void ChatTextBox_KeyPress(object sender, KeyPressEventArgs e)
  635. {
  636. switch (e.KeyChar)
  637. {
  638. case (char)Keys.Enter:
  639. e.Handled = true;
  640. if (!string.IsNullOrEmpty(ChatTextBox.Text))
  641. {
  642. string msg = ChatTextBox.Text;
  643. if (msg.ToUpper() == "@LEVELEFFECT")
  644. {
  645. Settings.LevelEffect = !Settings.LevelEffect;
  646. }
  647. if (msg.ToUpper() == "@TARGETDEAD")
  648. {
  649. Settings.TargetDead = !Settings.TargetDead;
  650. }
  651. Network.Enqueue(new C.Chat
  652. {
  653. Message = msg,
  654. LinkedItems = new List<ChatItem>(LinkedItems)
  655. });
  656. if (ChatTextBox.Text[0] == '/')
  657. {
  658. string[] parts = ChatTextBox.Text.Split(' ');
  659. if (parts.Length > 0)
  660. LastPM = parts[0];
  661. }
  662. }
  663. ChatTextBox.Visible = false;
  664. ChatTextBox.Text = string.Empty;
  665. LinkedItems.Clear();
  666. break;
  667. case (char)Keys.Escape:
  668. e.Handled = true;
  669. ChatTextBox.Visible = false;
  670. ChatTextBox.Text = string.Empty;
  671. LinkedItems.Clear();
  672. break;
  673. }
  674. }
  675. void PositionBar_OnMoving(object sender, MouseEventArgs e)
  676. {
  677. int x = Settings.Resolution != 800 ? 619 : 395;
  678. int y = PositionBar.Location.Y;
  679. if (y >= 16 + CountBar.Size.Height - PositionBar.Size.Height) y = 16 + CountBar.Size.Height - PositionBar.Size.Height;
  680. if (y < 16) y = 16;
  681. int h = CountBar.Size.Height - PositionBar.Size.Height;
  682. h = (int)((y - 16) / (h / (float)(History.Count - 1)));
  683. if (h != StartIndex)
  684. {
  685. StartIndex = h;
  686. Update();
  687. }
  688. PositionBar.Location = new Point(x, y);
  689. }
  690. public void ReceiveChat(string text, ChatType type)
  691. {
  692. Color foreColour, backColour;
  693. switch (type)
  694. {
  695. case ChatType.Hint:
  696. backColour = Color.White;
  697. foreColour = Color.DarkGreen;
  698. break;
  699. case ChatType.Announcement:
  700. backColour = Color.Blue;
  701. foreColour = Color.White;
  702. GameScene.Scene.ChatNoticeDialog.ShowNotice(RegexFunctions.CleanChatString(text));
  703. break;
  704. case ChatType.LineMessage:
  705. backColour = Color.Blue;
  706. foreColour = Color.White;
  707. break;
  708. case ChatType.Shout:
  709. backColour = Color.Yellow;
  710. foreColour = Color.Black;
  711. break;
  712. case ChatType.Shout2:
  713. backColour = Color.Green;
  714. foreColour = Color.White;
  715. break;
  716. case ChatType.Shout3:
  717. backColour = Color.Purple;
  718. foreColour = Color.White;
  719. break;
  720. case ChatType.System:
  721. backColour = Color.Red;
  722. foreColour = Color.White;
  723. break;
  724. case ChatType.System2:
  725. backColour = Color.DarkRed;
  726. foreColour = Color.White;
  727. break;
  728. case ChatType.Group:
  729. backColour = Color.White;
  730. foreColour = Color.Brown;
  731. break;
  732. case ChatType.WhisperOut:
  733. foreColour = Color.CornflowerBlue;
  734. backColour = Color.White;
  735. break;
  736. case ChatType.WhisperIn:
  737. foreColour = Color.DarkBlue;
  738. backColour = Color.White;
  739. break;
  740. case ChatType.Guild:
  741. backColour = Color.White;
  742. foreColour = Color.Green;
  743. break;
  744. case ChatType.LevelUp:
  745. backColour = Color.FromArgb(255, 225, 185, 250);
  746. foreColour = Color.Blue;
  747. break;
  748. case ChatType.Relationship:
  749. backColour = Color.Transparent;
  750. foreColour = Color.HotPink;
  751. break;
  752. case ChatType.Mentor:
  753. backColour = Color.White;
  754. foreColour = Color.Purple;
  755. break;
  756. default:
  757. backColour = Color.White;
  758. foreColour = Color.Black;
  759. break;
  760. }
  761. List<string> chat = new List<string>();
  762. int chatWidth = Settings.Resolution != 800 ? 614 : 390;
  763. int index = 0;
  764. for (int i = 1; i < text.Length; i++)
  765. {
  766. if (i - index < 0) continue;
  767. if (TextRenderer.MeasureText(CMain.Graphics, text.Substring(index, i - index), ChatFont).Width > chatWidth)
  768. {
  769. int offset = i - index;
  770. int newIndex = i - 1;
  771. var itemLinkMatches = RegexFunctions.ChatItemLinks.Matches(text.Substring(index)).Cast<Match>();
  772. if (itemLinkMatches.Any())
  773. {
  774. var match = itemLinkMatches.SingleOrDefault(x => (x.Index < (i - index)) && (x.Index + x.Length > offset - 1));
  775. if (match != null)
  776. {
  777. offset = match.Index;
  778. newIndex = match.Index;
  779. }
  780. }
  781. chat.Add(text.Substring(index, offset - 1));
  782. index = newIndex;
  783. }
  784. }
  785. chat.Add(text.Substring(index, text.Length - index));
  786. if (StartIndex == History.Count - LineCount)
  787. StartIndex += chat.Count;
  788. for (int i = 0; i < chat.Count; i++)
  789. FullHistory.Add(new ChatHistory { Text = chat[i], BackColour = backColour, ForeColour = foreColour, Type = type });
  790. Update();
  791. }
  792. public void Update()
  793. {
  794. History = new List<ChatHistory>();
  795. for (int i = 0; i < FullHistory.Count; i++)
  796. {
  797. switch (FullHistory[i].Type)
  798. {
  799. case ChatType.Normal:
  800. case ChatType.LineMessage:
  801. if (Settings.FilterNormalChat) continue;
  802. break;
  803. case ChatType.WhisperIn:
  804. case ChatType.WhisperOut:
  805. if (Settings.FilterWhisperChat) continue;
  806. break;
  807. case ChatType.Shout:
  808. case ChatType.Shout2:
  809. case ChatType.Shout3:
  810. if (Settings.FilterShoutChat) continue;
  811. break;
  812. case ChatType.System:
  813. case ChatType.System2:
  814. if (Settings.FilterSystemChat) continue;
  815. break;
  816. case ChatType.Group:
  817. if (Settings.FilterGroupChat) continue;
  818. break;
  819. case ChatType.Guild:
  820. if (Settings.FilterGuildChat) continue;
  821. break;
  822. }
  823. History.Add(FullHistory[i]);
  824. }
  825. for (int i = 0; i < ChatLines.Count; i++)
  826. ChatLines[i].Dispose();
  827. for (int i = 0; i < LinkedItemButtons.Count; i++)
  828. LinkedItemButtons[i].Dispose();
  829. ChatLines.Clear();
  830. LinkedItemButtons.Clear();
  831. if (StartIndex >= History.Count) StartIndex = History.Count - 1;
  832. if (StartIndex < 0) StartIndex = 0;
  833. if (History.Count > 1)
  834. {
  835. int h = CountBar.Size.Height - PositionBar.Size.Height;
  836. h = (int)((h / (float)(History.Count - 1)) * StartIndex);
  837. PositionBar.Location = new Point(Settings.Resolution != 800 ? 619 : 395, 16 + h);
  838. }
  839. int y = 1;
  840. for (int i = StartIndex; i < History.Count; i++)
  841. {
  842. MirLabel temp = new MirLabel
  843. {
  844. AutoSize = true,
  845. BackColour = History[i].BackColour,
  846. ForeColour = History[i].ForeColour,
  847. Location = new Point(1, y),
  848. OutLine = false,
  849. Parent = this,
  850. Text = History[i].Text,
  851. Font = ChatFont,
  852. };
  853. temp.MouseWheel += ChatPanel_MouseWheel;
  854. ChatLines.Add(temp);
  855. temp.Click += (o, e) =>
  856. {
  857. if (!(o is MirLabel l)) return;
  858. string[] parts = l.Text.Split(':', ' ');
  859. if (parts.Length == 0) return;
  860. string name = Regex.Replace(parts[0], "[^A-Za-z0-9]", "");
  861. ChatTextBox.SetFocus();
  862. ChatTextBox.Text = string.Format("/{0} ", name);
  863. ChatTextBox.Visible = true;
  864. ChatTextBox.TextBox.SelectionLength = 0;
  865. ChatTextBox.TextBox.SelectionStart = ChatTextBox.Text.Length;
  866. };
  867. string currentLine = History[i].Text;
  868. int oldLength = currentLine.Length;
  869. Capture capture = null;
  870. foreach (Match match in RegexFunctions.ChatItemLinks.Matches(currentLine).Cast<Match>().OrderBy(o => o.Index).ToList())
  871. {
  872. try
  873. {
  874. int offSet = oldLength - currentLine.Length;
  875. capture = match.Groups[1].Captures[0];
  876. string[] values = capture.Value.Split('/');
  877. currentLine = currentLine.Remove(capture.Index - 1 - offSet, capture.Length + 2).Insert(capture.Index - 1 - offSet, values[0]);
  878. string text = currentLine.Substring(0, capture.Index - 1 - offSet) + " ";
  879. Size size = TextRenderer.MeasureText(CMain.Graphics, text, temp.Font, temp.Size, TextFormatFlags.TextBoxControl);
  880. ChatLink(values[0], ulong.Parse(values[1]), temp.Location.Add(new Point(size.Width - 10, 0)));
  881. }
  882. catch(Exception ex)
  883. {
  884. //Temporary debug to catch unknown error
  885. CMain.SaveError(ex.ToString());
  886. CMain.SaveError(currentLine);
  887. CMain.SaveError(capture.Value);
  888. throw;
  889. }
  890. }
  891. temp.Text = currentLine;
  892. y += 13;
  893. if (i - StartIndex == LineCount - 1) break;
  894. }
  895. }
  896. private void ChatLink(string name, ulong uniqueID, Point p)
  897. {
  898. UserItem item = GameScene.ChatItemList.FirstOrDefault(x => x.UniqueID == uniqueID);
  899. if (item != null)
  900. {
  901. MirLabel temp = new MirLabel
  902. {
  903. AutoSize = true,
  904. Visible = true,
  905. Parent = this,
  906. Location = p,
  907. Text = name,
  908. ForeColour = Color.Blue,
  909. Sound = SoundList.ButtonC,
  910. Font = ChatFont,
  911. OutLine = false,
  912. };
  913. temp.MouseEnter += (o, e) => temp.ForeColour = Color.Red;
  914. temp.MouseLeave += (o, e) =>
  915. {
  916. GameScene.Scene.DisposeItemLabel();
  917. temp.ForeColour = Color.Blue;
  918. };
  919. temp.MouseDown += (o, e) => temp.ForeColour = Color.Blue;
  920. temp.MouseUp += (o, e) => temp.ForeColour = Color.Red;
  921. temp.Click += (o, e) =>
  922. {
  923. GameScene.Scene.CreateItemLabel(item);
  924. };
  925. LinkedItemButtons.Add(temp);
  926. }
  927. }
  928. private void ChatPanel_KeyDown(object sender, KeyEventArgs e)
  929. {
  930. switch (e.KeyCode)
  931. {
  932. case Keys.Up:
  933. if (StartIndex == 0) return;
  934. StartIndex--;
  935. break;
  936. case Keys.Home:
  937. if (StartIndex == 0) return;
  938. StartIndex = 0;
  939. break;
  940. case Keys.Down:
  941. if (StartIndex == History.Count - 1) return;
  942. StartIndex++;
  943. break;
  944. case Keys.End:
  945. if (StartIndex == History.Count - 1) return;
  946. StartIndex = History.Count - 1;
  947. break;
  948. case Keys.PageUp:
  949. if (StartIndex == 0) return;
  950. StartIndex -= LineCount;
  951. break;
  952. case Keys.PageDown:
  953. if (StartIndex == History.Count - 1) return;
  954. StartIndex += LineCount;
  955. break;
  956. default:
  957. return;
  958. }
  959. Update();
  960. e.Handled = true;
  961. }
  962. private void ChatPanel_KeyPress(object sender, KeyPressEventArgs e)
  963. {
  964. switch (e.KeyChar)
  965. {
  966. case '@':
  967. case '!':
  968. case ' ':
  969. case (char)Keys.Enter:
  970. ChatTextBox.SetFocus();
  971. if (e.KeyChar == '!') ChatTextBox.Text = "!";
  972. if (e.KeyChar == '@') ChatTextBox.Text = "@";
  973. if (ChatPrefix != "") ChatTextBox.Text = ChatPrefix;
  974. ChatTextBox.Visible = true;
  975. ChatTextBox.TextBox.SelectionLength = 0;
  976. ChatTextBox.TextBox.SelectionStart = ChatTextBox.Text.Length;
  977. e.Handled = true;
  978. break;
  979. case '/':
  980. ChatTextBox.SetFocus();
  981. ChatTextBox.Text = LastPM + " ";
  982. ChatTextBox.Visible = true;
  983. ChatTextBox.TextBox.SelectionLength = 0;
  984. ChatTextBox.TextBox.SelectionStart = ChatTextBox.Text.Length;
  985. e.Handled = true;
  986. break;
  987. }
  988. }
  989. private void ChatPanel_MouseWheel(object sender, MouseEventArgs e)
  990. {
  991. int count = e.Delta / SystemInformation.MouseWheelScrollDelta;
  992. if (StartIndex == 0 && count >= 0) return;
  993. if (StartIndex == History.Count - 1 && count <= 0) return;
  994. StartIndex -= count;
  995. Update();
  996. }
  997. private void ChatTextBox_KeyUp(object sender, KeyEventArgs e)
  998. {
  999. CMain.Shift = e.Shift;
  1000. CMain.Alt = e.Alt;
  1001. CMain.Ctrl = e.Control;
  1002. switch (e.KeyCode)
  1003. {
  1004. case Keys.F1:
  1005. case Keys.F2:
  1006. case Keys.F3:
  1007. case Keys.F4:
  1008. case Keys.F5:
  1009. case Keys.F6:
  1010. case Keys.F7:
  1011. case Keys.F8:
  1012. case Keys.F9:
  1013. case Keys.F10:
  1014. case Keys.F11:
  1015. case Keys.F12:
  1016. case Keys.Tab:
  1017. CMain.CMain_KeyUp(sender, e);
  1018. break;
  1019. }
  1020. }
  1021. private void ChatTextBox_KeyDown(object sender, KeyEventArgs e)
  1022. {
  1023. CMain.Shift = e.Shift;
  1024. CMain.Alt = e.Alt;
  1025. CMain.Ctrl = e.Control;
  1026. switch (e.KeyCode)
  1027. {
  1028. case Keys.F1:
  1029. case Keys.F2:
  1030. case Keys.F3:
  1031. case Keys.F4:
  1032. case Keys.F5:
  1033. case Keys.F6:
  1034. case Keys.F7:
  1035. case Keys.F8:
  1036. case Keys.F9:
  1037. case Keys.F10:
  1038. case Keys.F11:
  1039. case Keys.F12:
  1040. case Keys.Tab:
  1041. CMain.CMain_KeyDown(sender, e);
  1042. break;
  1043. }
  1044. }
  1045. public void ChangeSize()
  1046. {
  1047. if (++WindowSize >= 3) WindowSize = 0;
  1048. int y = DisplayRectangle.Bottom;
  1049. switch (WindowSize)
  1050. {
  1051. case 0:
  1052. LineCount = 4;
  1053. Index = Settings.Resolution != 800 ? 2221 : 2201;
  1054. CountBar.Index = 2012;
  1055. DownButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 39);
  1056. EndButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 45);
  1057. ChatTextBox.Location = new Point(1, 54);
  1058. break;
  1059. case 1:
  1060. LineCount = 7;
  1061. Index = Settings.Resolution != 800 ? 2224 : 2204;
  1062. CountBar.Index = 2013;
  1063. DownButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 39 + 48);
  1064. EndButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 45 + 48);
  1065. ChatTextBox.Location = new Point(1, 54 + 48);
  1066. break;
  1067. case 2:
  1068. LineCount = 11;
  1069. Index = Settings.Resolution != 800 ? 2227 : 2207;
  1070. CountBar.Index = 2014;
  1071. DownButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 39 + 96);
  1072. EndButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 45 + 96);
  1073. ChatTextBox.Location = new Point(1, 54 + 96);
  1074. break;
  1075. }
  1076. Location = new Point(Location.X, y - Size.Height);
  1077. UpdateBackground();
  1078. Update();
  1079. }
  1080. public void UpdateBackground()
  1081. {
  1082. int offset = Transparent ? 1 : 0;
  1083. switch (WindowSize)
  1084. {
  1085. case 0:
  1086. Index = Settings.Resolution != 800 ? 2221 : 2201;
  1087. break;
  1088. case 1:
  1089. Index = Settings.Resolution != 800 ? 2224 : 2204;
  1090. break;
  1091. case 2:
  1092. Index = Settings.Resolution != 800 ? 2227 : 2207;
  1093. break;
  1094. }
  1095. Index -= offset;
  1096. }
  1097. public class ChatHistory
  1098. {
  1099. public string Text;
  1100. public Color ForeColour, BackColour;
  1101. public ChatType Type;
  1102. }
  1103. }
  1104. public sealed class ChatControlBar : MirImageControl
  1105. {
  1106. public MirButton SizeButton, SettingsButton, NormalButton, ShoutButton, WhisperButton, LoverButton, MentorButton, GroupButton, GuildButton, ReportButton, TradeButton;
  1107. public ChatControlBar()
  1108. {
  1109. Index = Settings.Resolution != 800 ? 2034 : 2035;
  1110. Library = Libraries.Prguse;
  1111. Location = new Point(GameScene.Scene.MainDialog.Location.X + 230, Settings.ScreenHeight - 112);
  1112. SizeButton = new MirButton
  1113. {
  1114. Index = 2057,
  1115. HoverIndex = 2058,
  1116. PressedIndex = 2059,
  1117. Library = Libraries.Prguse,
  1118. Parent = this,
  1119. Location = new Point(Settings.Resolution != 800 ? 574 : 350, 1),
  1120. Visible = true,
  1121. Sound = SoundList.ButtonA,
  1122. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Size)
  1123. };
  1124. SizeButton.Click += (o, e) =>
  1125. {
  1126. GameScene.Scene.ChatDialog.ChangeSize();
  1127. Location = new Point(Location.X, GameScene.Scene.ChatDialog.DisplayRectangle.Top - Size.Height);
  1128. if (GameScene.Scene.BeltDialog.Index == 1932)
  1129. GameScene.Scene.BeltDialog.Location = new Point(GameScene.Scene.MainDialog.Location.X + 230, Location.Y - GameScene.Scene.BeltDialog.Size.Height);
  1130. if (GameScene.Scene.HeroBeltDialog != null)
  1131. GameScene.Scene.HeroBeltDialog.Location = new Point(GameScene.Scene.MainDialog.Location.X + 475, Location.Y - GameScene.Scene.HeroBeltDialog.Size.Height);
  1132. };
  1133. SettingsButton = new MirButton
  1134. {
  1135. Index = 2060,
  1136. HoverIndex = 2061,
  1137. PressedIndex = 2062,
  1138. Library = Libraries.Prguse,
  1139. Parent = this,
  1140. Location = new Point(Settings.Resolution != 800 ? 596 : 372, 1),
  1141. Sound = SoundList.ButtonA,
  1142. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ChatSettings)
  1143. };
  1144. SettingsButton.Click += (o, e) =>
  1145. {
  1146. if (GameScene.Scene.ChatOptionDialog.Visible)
  1147. GameScene.Scene.ChatOptionDialog.Hide();
  1148. else
  1149. GameScene.Scene.ChatOptionDialog.Show();
  1150. //GameScene.Scene.ChatDialog.Transparent = !GameScene.Scene.ChatDialog.Transparent;
  1151. //GameScene.Scene.ChatDialog.UpdateBackground();
  1152. };
  1153. NormalButton = new MirButton
  1154. {
  1155. Index = 2036,
  1156. HoverIndex = 2037,
  1157. PressedIndex = 2038,
  1158. Library = Libraries.Prguse,
  1159. Parent = this,
  1160. Location = new Point(12, 1),
  1161. Sound = SoundList.ButtonA,
  1162. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_All)
  1163. };
  1164. NormalButton.Click += (o, e) =>
  1165. {
  1166. ToggleChatFilter("All");
  1167. };
  1168. ShoutButton = new MirButton
  1169. {
  1170. Index = 2039,
  1171. HoverIndex = 2040,
  1172. PressedIndex = 2041,
  1173. Library = Libraries.Prguse,
  1174. Parent = this,
  1175. Location = new Point(34, 1),
  1176. Sound = SoundList.ButtonA,
  1177. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Short)
  1178. };
  1179. ShoutButton.Click += (o, e) =>
  1180. {
  1181. ToggleChatFilter("Shout");
  1182. };
  1183. WhisperButton = new MirButton
  1184. {
  1185. Index = 2042,
  1186. HoverIndex = 2043,
  1187. PressedIndex = 2044,
  1188. Library = Libraries.Prguse,
  1189. Parent = this,
  1190. Location = new Point(56, 1),
  1191. Sound = SoundList.ButtonA,
  1192. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Whisper)
  1193. };
  1194. WhisperButton.Click += (o, e) =>
  1195. {
  1196. ToggleChatFilter("Whisper");
  1197. };
  1198. LoverButton = new MirButton
  1199. {
  1200. Index = 2045,
  1201. HoverIndex = 2046,
  1202. PressedIndex = 2047,
  1203. Library = Libraries.Prguse,
  1204. Parent = this,
  1205. Location = new Point(78, 1),
  1206. Sound = SoundList.ButtonA,
  1207. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Lover)
  1208. };
  1209. LoverButton.Click += (o, e) =>
  1210. {
  1211. ToggleChatFilter("Lover");
  1212. };
  1213. MentorButton = new MirButton
  1214. {
  1215. Index = 2048,
  1216. HoverIndex = 2049,
  1217. PressedIndex = 2050,
  1218. Library = Libraries.Prguse,
  1219. Parent = this,
  1220. Location = new Point(100, 1),
  1221. Sound = SoundList.ButtonA,
  1222. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Mentor)
  1223. };
  1224. MentorButton.Click += (o, e) =>
  1225. {
  1226. ToggleChatFilter("Mentor");
  1227. };
  1228. GroupButton = new MirButton
  1229. {
  1230. Index = 2051,
  1231. HoverIndex = 2052,
  1232. PressedIndex = 2053,
  1233. Library = Libraries.Prguse,
  1234. Parent = this,
  1235. Location = new Point(122, 1),
  1236. Sound = SoundList.ButtonA,
  1237. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Group)
  1238. };
  1239. GroupButton.Click += (o, e) =>
  1240. {
  1241. ToggleChatFilter("Group");
  1242. };
  1243. GuildButton = new MirButton
  1244. {
  1245. Index = 2054,
  1246. HoverIndex = 2055,
  1247. PressedIndex = 2056,
  1248. Library = Libraries.Prguse,
  1249. Parent = this,
  1250. Location = new Point(144, 1),
  1251. Sound = SoundList.ButtonA,
  1252. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Guild)
  1253. };
  1254. GuildButton.Click += (o, e) =>
  1255. {
  1256. Settings.ShowGuildChat = !Settings.ShowGuildChat;
  1257. ToggleChatFilter("Guild");
  1258. };
  1259. TradeButton = new MirButton
  1260. {
  1261. Index = 2004,
  1262. HoverIndex = 2005,
  1263. PressedIndex = 2006,
  1264. Library = Libraries.Prguse,
  1265. Location = new Point(166, 1),
  1266. Parent = this,
  1267. Sound = SoundList.ButtonC,
  1268. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.TradeKey), CMain.InputKeys.GetKey(KeybindOptions.Trade)),
  1269. };
  1270. TradeButton.Click += (o, e) => Network.Enqueue(new C.TradeRequest());
  1271. ReportButton = new MirButton
  1272. {
  1273. Index = 2063,
  1274. HoverIndex = 2064,
  1275. PressedIndex = 2065,
  1276. Library = Libraries.Prguse,
  1277. Parent = this,
  1278. Location = new Point(Settings.Resolution != 800 ? 552 : 328, 1),
  1279. Sound = SoundList.ButtonA,
  1280. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Report),
  1281. Visible = false
  1282. };
  1283. ReportButton.Click += (o, e) =>
  1284. {
  1285. GameScene.Scene.ReportDialog.Visible = !GameScene.Scene.ReportDialog.Visible;
  1286. };
  1287. ToggleChatFilter("All");
  1288. }
  1289. public void ToggleChatFilter(string chatFilter)
  1290. {
  1291. NormalButton.Index = 2036;
  1292. NormalButton.HoverIndex = 2037;
  1293. ShoutButton.Index = 2039;
  1294. ShoutButton.HoverIndex = 2040;
  1295. WhisperButton.Index = 2042;
  1296. WhisperButton.HoverIndex = 2043;
  1297. LoverButton.Index = 2045;
  1298. LoverButton.HoverIndex = 2046;
  1299. MentorButton.Index = 2048;
  1300. MentorButton.HoverIndex = 2049;
  1301. GroupButton.Index = 2051;
  1302. GroupButton.HoverIndex = 2052;
  1303. GuildButton.Index = 2054;
  1304. GuildButton.HoverIndex = 2055;
  1305. GameScene.Scene.ChatDialog.ChatPrefix = "";
  1306. switch (chatFilter)
  1307. {
  1308. case "All":
  1309. NormalButton.Index = 2038;
  1310. NormalButton.HoverIndex = 2038;
  1311. GameScene.Scene.ChatDialog.ChatPrefix = "";
  1312. break;
  1313. case "Shout":
  1314. ShoutButton.Index = 2041;
  1315. ShoutButton.HoverIndex = 2041;
  1316. GameScene.Scene.ChatDialog.ChatPrefix = "!";
  1317. break;
  1318. case "Whisper":
  1319. WhisperButton.Index = 2044;
  1320. WhisperButton.HoverIndex = 2044;
  1321. GameScene.Scene.ChatDialog.ChatPrefix = "/";
  1322. break;
  1323. case "Group":
  1324. GroupButton.Index = 2053;
  1325. GroupButton.HoverIndex = 2053;
  1326. GameScene.Scene.ChatDialog.ChatPrefix = "!!";
  1327. break;
  1328. case "Guild":
  1329. GuildButton.Index = 2056;
  1330. GuildButton.HoverIndex = 2056;
  1331. GameScene.Scene.ChatDialog.ChatPrefix = "!~";
  1332. break;
  1333. case "Lover":
  1334. LoverButton.Index = 2047;
  1335. LoverButton.HoverIndex = 2047;
  1336. GameScene.Scene.ChatDialog.ChatPrefix = ":)";
  1337. break;
  1338. case "Mentor":
  1339. MentorButton.Index = 2050;
  1340. MentorButton.HoverIndex = 2050;
  1341. GameScene.Scene.ChatDialog.ChatPrefix = "!#";
  1342. break;
  1343. }
  1344. }
  1345. }
  1346. public sealed class SkillBarDialog : MirImageControl
  1347. {
  1348. private readonly MirButton _switchBindsButton;
  1349. public bool AltBind;
  1350. public bool HasSkill = false;
  1351. public byte BarIndex;
  1352. //public bool TopBind = !Settings.SkillMode;
  1353. public MirImageControl[] Cells = new MirImageControl[8];
  1354. public MirLabel[] KeyNameLabels = new MirLabel[8];
  1355. public MirLabel BindNumberLabel = new MirLabel();
  1356. public MirImageControl[] CoolDowns = new MirImageControl[8];
  1357. public SkillBarDialog()
  1358. {
  1359. Index = 2190;
  1360. Library = Libraries.Prguse;
  1361. Movable = true;
  1362. Sort = true;
  1363. Location = new Point(0, BarIndex * 20);
  1364. Visible = true;
  1365. BeforeDraw += MagicKeyDialog_BeforeDraw;
  1366. _switchBindsButton = new MirButton
  1367. {
  1368. Index = 2247,
  1369. Library = Libraries.Prguse,
  1370. Parent = this,
  1371. Sound = SoundList.ButtonA,
  1372. Size = new Size(16, 28),
  1373. Location = new Point(0, 0)
  1374. };
  1375. _switchBindsButton.Click += (o, e) =>
  1376. {
  1377. //Settings.SkillSet = !Settings.SkillSet;
  1378. Update();
  1379. };
  1380. for (var i = 0; i < Cells.Length; i++)
  1381. {
  1382. Cells[i] = new MirImageControl
  1383. {
  1384. Index = -1,
  1385. Library = Libraries.MagIcon,
  1386. Parent = this,
  1387. Location = new Point(i * 25 + 15, 3),
  1388. };
  1389. int j = i + 1;
  1390. Cells[i].Click += (o, e) =>
  1391. {
  1392. GameScene.Scene.UseSpell(j + (8 * BarIndex));
  1393. };
  1394. CoolDowns[i] = new MirImageControl
  1395. {
  1396. Library = Libraries.Prguse2,
  1397. Parent = this,
  1398. Location = new Point(i * 25 + 15, 3),
  1399. NotControl = true,
  1400. UseOffSet = true,
  1401. Opacity = 0.6F
  1402. };
  1403. }
  1404. BindNumberLabel = new MirLabel
  1405. {
  1406. Text = "1",
  1407. Font = new Font(Settings.FontName, 8F),
  1408. ForeColour = Color.White,
  1409. Parent = this,
  1410. Location = new Point(0, 1),
  1411. Size = new Size(10, 25),
  1412. NotControl = true
  1413. };
  1414. for (var i = 0; i < KeyNameLabels.Length; i++)
  1415. {
  1416. KeyNameLabels[i] = new MirLabel
  1417. {
  1418. Text = "F" + (i + 1),
  1419. Font = new Font(Settings.FontName, 8F),
  1420. ForeColour = Color.White,
  1421. Parent = this,
  1422. Location = new Point(i * 25 + 13, 0),
  1423. Size = new Size(25, 25),
  1424. NotControl = true
  1425. };
  1426. }
  1427. OnMoving += SkillBar_OnMoving;
  1428. }
  1429. private void SkillBar_OnMoving(object sender, MouseEventArgs e)
  1430. {
  1431. if (BarIndex * 2 >= Settings.SkillbarLocation.Length) return;
  1432. Settings.SkillbarLocation[BarIndex, 0] = this.Location.X;
  1433. Settings.SkillbarLocation[BarIndex, 1] = this.Location.Y;
  1434. }
  1435. private string GetKey(int barindex, int i)
  1436. {
  1437. //KeybindOptions Type = KeybindOptions.Bar1Skill1;
  1438. if ((barindex == 0) && (i == 1))
  1439. return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill1);
  1440. if ((barindex == 0) && (i == 2))
  1441. return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill2);
  1442. if ((barindex == 0) && (i == 3))
  1443. return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill3);
  1444. if ((barindex == 0) && (i == 4))
  1445. return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill4);
  1446. if ((barindex == 0) && (i == 5))
  1447. return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill5);
  1448. if ((barindex == 0) && (i == 6))
  1449. return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill6);
  1450. if ((barindex == 0) && (i == 7))
  1451. return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill7);
  1452. if ((barindex == 0) && (i == 8))
  1453. return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill8);
  1454. if ((barindex == 1) && (i == 1))
  1455. return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill1);
  1456. if ((barindex == 1) && (i == 2))
  1457. return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill2);
  1458. if ((barindex == 1) && (i == 3))
  1459. return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill3);
  1460. if ((barindex == 1) && (i == 4))
  1461. return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill4);
  1462. if ((barindex == 1) && (i == 5))
  1463. return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill5);
  1464. if ((barindex == 1) && (i == 6))
  1465. return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill6);
  1466. if ((barindex == 1) && (i == 7))
  1467. return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill7);
  1468. if ((barindex == 1) && (i == 8))
  1469. return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill8);
  1470. return "";
  1471. }
  1472. void MagicKeyDialog_BeforeDraw(object sender, EventArgs e)
  1473. {
  1474. Libraries.Prguse.Draw(2193, new Point(DisplayLocation.X + 12, DisplayLocation.Y), Color.White, true, 0.5F);
  1475. }
  1476. public void Update()
  1477. {
  1478. HasSkill = false;
  1479. foreach (var m in GameScene.User.Magics)
  1480. {
  1481. if ((m.Key < (BarIndex * 8)+1) || (m.Key > ((BarIndex + 1) * 8)+1)) continue;
  1482. HasSkill = true;
  1483. }
  1484. if (!Visible) return;
  1485. Index = 2190;
  1486. _switchBindsButton.Index = 2247;
  1487. BindNumberLabel.Text = (BarIndex + 1).ToString();
  1488. BindNumberLabel.Location = new Point(0, 1);
  1489. for (var i = 1; i <= 8; i++)
  1490. {
  1491. Cells[i - 1].Index = -1;
  1492. int offset = BarIndex * 8;
  1493. string key = GetKey(BarIndex, i);
  1494. KeyNameLabels[i - 1].Text = key;
  1495. foreach (var m in GameScene.User.Magics)
  1496. {
  1497. if (m.Key != i + offset) continue;
  1498. HasSkill = true;
  1499. ClientMagic magic = MapObject.User.GetMagic(m.Spell);
  1500. if (magic == null) continue;
  1501. //string key = m.Key > 8 ? string.Format("CTRL F{0}", i) : string.Format("F{0}", m.Key);
  1502. Cells[i - 1].Index = magic.Icon * 2;
  1503. Cells[i - 1].Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SkillMpCooldownKey), magic.Name,
  1504. (magic.BaseCost + (magic.LevelCost * magic.Level)), Functions.PrintTimeSpanFromMilliSeconds(magic.Delay), key);
  1505. KeyNameLabels[i - 1].Text = "";
  1506. }
  1507. }
  1508. }
  1509. public void Process()
  1510. {
  1511. ProcessSkillDelay();
  1512. }
  1513. private void ProcessSkillDelay()
  1514. {
  1515. if (!Visible) return;
  1516. int offset = BarIndex * 8;
  1517. for (int i = 0; i < Cells.Length; i++)
  1518. {
  1519. foreach (var magic in GameScene.User.Magics)
  1520. {
  1521. if (magic.Key != i + offset + 1) continue;
  1522. int totalFrames = 22;
  1523. long timeLeft = magic.CastTime + magic.Delay - CMain.Time;
  1524. if (timeLeft < 100)
  1525. {
  1526. if (timeLeft > 0)
  1527. {
  1528. CoolDowns[i].Visible = false;
  1529. // CoolDowns[i].Dispose();
  1530. }
  1531. else
  1532. continue;
  1533. }
  1534. int delayPerFrame = (int)(magic.Delay / totalFrames);
  1535. int startFrame = totalFrames - (int)(timeLeft / delayPerFrame);
  1536. if ((CMain.Time <= magic.CastTime + magic.Delay))
  1537. {
  1538. CoolDowns[i].Visible = true;
  1539. CoolDowns[i].Index = 1260 + startFrame;
  1540. }
  1541. }
  1542. }
  1543. }
  1544. public override void Show()
  1545. {
  1546. if (Visible) return;
  1547. if (!HasSkill) return;
  1548. Settings.SkillBar = true;
  1549. Visible = true;
  1550. Update();
  1551. }
  1552. public override void Hide()
  1553. {
  1554. if (!Visible) return;
  1555. Settings.SkillBar = false;
  1556. Visible = false;
  1557. }
  1558. }
  1559. public sealed class MiniMapDialog : MirImageControl
  1560. {
  1561. public MirImageControl LightSetting, NewMail;
  1562. public MirButton ToggleButton, BigMapButton, MailButton;
  1563. public MirLabel LocationLabel, MapNameLabel;
  1564. private float _fade = 1F;
  1565. private bool _bigMode = true;
  1566. public MirLabel AModeLabel, PModeLabel;
  1567. public List<MirLabel> QuestIcons = new List<MirLabel>();
  1568. public MiniMapDialog()
  1569. {
  1570. Index = 2090;
  1571. Library = Libraries.Prguse;
  1572. Location = new Point(Settings.ScreenWidth - 126, 0);
  1573. PixelDetect = true;
  1574. BeforeDraw += MiniMap_BeforeDraw;
  1575. AfterDraw += MiniMapDialog_AfterDraw;
  1576. MapNameLabel = new MirLabel
  1577. {
  1578. DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
  1579. Parent = this,
  1580. Size = new Size(120, 18),
  1581. Location = new Point(2, 2),
  1582. NotControl = true,
  1583. };
  1584. LocationLabel = new MirLabel
  1585. {
  1586. DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
  1587. Parent = this,
  1588. Size = new Size(56, 18),
  1589. Location = new Point(46, 131),
  1590. NotControl = true,
  1591. };
  1592. MailButton = new MirButton
  1593. {
  1594. Index = 2099,
  1595. HoverIndex = 2100,
  1596. PressedIndex = 2101,
  1597. Parent = this,
  1598. Location = new Point(4, 131),
  1599. Library = Libraries.Prguse,
  1600. Sound = SoundList.ButtonA,
  1601. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Mail)
  1602. };
  1603. MailButton.Click += (o, e) => GameScene.Scene.MailListDialog.Toggle();
  1604. NewMail = new MirImageControl
  1605. {
  1606. Index = 544,
  1607. Location = new Point(5, 132),
  1608. Parent = this,
  1609. Library = Libraries.Prguse,
  1610. Visible = false,
  1611. NotControl = true
  1612. };
  1613. BigMapButton = new MirButton
  1614. {
  1615. Index = 2096,
  1616. HoverIndex = 2097,
  1617. PressedIndex = 2098,
  1618. Parent = this,
  1619. Location = new Point(25, 131),
  1620. Library = Libraries.Prguse,
  1621. Sound = SoundList.ButtonA,
  1622. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.BigMapKey), CMain.InputKeys.GetKey(KeybindOptions.Bigmap))
  1623. };
  1624. BigMapButton.Click += (o, e) => GameScene.Scene.BigMapDialog.Toggle();
  1625. ToggleButton = new MirButton
  1626. {
  1627. Index = 2102,
  1628. HoverIndex = 2103,
  1629. PressedIndex = 2104,
  1630. Parent = this,
  1631. Location = new Point(109, 3),
  1632. Library = Libraries.Prguse,
  1633. Sound = SoundList.ButtonA,
  1634. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MiniMapKey), CMain.InputKeys.GetKey(KeybindOptions.Minimap))
  1635. };
  1636. ToggleButton.Click += (o, e) => Toggle();
  1637. LightSetting = new MirImageControl
  1638. {
  1639. Index = 2093,
  1640. Library = Libraries.Prguse,
  1641. Parent = this,
  1642. Location = new Point(102, 131),
  1643. };
  1644. AModeLabel = new MirLabel
  1645. {
  1646. AutoSize = true,
  1647. ForeColour = Color.Yellow,
  1648. OutLineColour = Color.Black,
  1649. Parent = this,
  1650. Location = new Point(115, 125)
  1651. };
  1652. PModeLabel = new MirLabel
  1653. {
  1654. AutoSize = true,
  1655. ForeColour = Color.Yellow,
  1656. OutLineColour = Color.Black,
  1657. Parent = this,
  1658. Location = new Point(230, 125),
  1659. Visible = false
  1660. };
  1661. }
  1662. private void MiniMapDialog_AfterDraw(object sender, EventArgs e)
  1663. {
  1664. }
  1665. private void MiniMap_BeforeDraw(object sender, EventArgs e)
  1666. {
  1667. foreach (var icon in QuestIcons)
  1668. icon.Dispose();
  1669. QuestIcons.Clear();
  1670. MapControl map = GameScene.Scene.MapControl;
  1671. if (map == null) return;
  1672. if (map.MiniMap == 0 && Index != 2091)
  1673. {
  1674. SetSmallMode();
  1675. }
  1676. else if (map.MiniMap > 0 && _bigMode && Index == 2091)
  1677. {
  1678. SetBigMode();
  1679. }
  1680. if (map.MiniMap <= 0 || Index != 2090 || Libraries.MiniMap == null)
  1681. {
  1682. return;
  1683. }
  1684. Rectangle viewRect = new Rectangle(0, 0, 120, 108);
  1685. Point drawLocation = Location;
  1686. drawLocation.Offset(3, 22);
  1687. Size miniMapSize = Libraries.MiniMap.GetSize(map.MiniMap);
  1688. float scaleX = miniMapSize.Width / (float)map.Width;
  1689. float scaleY = miniMapSize.Height / (float)map.Height;
  1690. viewRect.Location = new Point(
  1691. (int)(scaleX * MapObject.User.CurrentLocation.X) - viewRect.Width / 2,
  1692. (int)(scaleY * MapObject.User.CurrentLocation.Y) - viewRect.Height / 2);
  1693. // viewRect.Location = viewRect.Location.Subtract(1, 1);
  1694. if (viewRect.Right >= miniMapSize.Width)
  1695. viewRect.X = miniMapSize.Width - viewRect.Width;
  1696. if (viewRect.Bottom >= miniMapSize.Height)
  1697. viewRect.Y = miniMapSize.Height - viewRect.Height;
  1698. if (viewRect.X < 0) viewRect.X = 0;
  1699. if (viewRect.Y < 0) viewRect.Y = 0;
  1700. Libraries.MiniMap.Draw(map.MiniMap, viewRect, drawLocation, Color.FromArgb(255, 255, 255), _fade);
  1701. int startPointX = (int)(viewRect.X / scaleX);
  1702. int startPointY = (int)(viewRect.Y / scaleY);
  1703. foreach (var ob in MapControl.Objects.Values)
  1704. {
  1705. if (ob.Race == ObjectType.Item || ob.Dead || ob.Race == ObjectType.Spell || ob.Sneaking) continue;
  1706. float x = ((ob.CurrentLocation.X - startPointX) * scaleX) + drawLocation.X;
  1707. float y = ((ob.CurrentLocation.Y - startPointY) * scaleY) + drawLocation.Y;
  1708. Color colour;
  1709. if ((GroupDialog.GroupList.Contains(ob.Name) && MapObject.User != ob) || ob.Name.EndsWith(string.Format("({0})", MapObject.User.Name)))
  1710. colour = Color.FromArgb(0, 0, 255);
  1711. else
  1712. if (ob is PlayerObject)
  1713. {
  1714. colour = Color.FromArgb(255, 255, 255);
  1715. }
  1716. else if (ob is NPCObject || ob.AI == 6)
  1717. {
  1718. colour = Color.FromArgb(0, 255, 50);
  1719. }
  1720. else
  1721. colour = Color.FromArgb(255, 0, 0);
  1722. DXManager.Draw(DXManager.RadarTexture, new Rectangle(0, 0, 2, 2), new Vector3((float)(x - 0.5), (float)(y - 0.5), 0.0F), colour);
  1723. #region NPC Quest Icons
  1724. if (ob is NPCObject npc && npc.GetAvailableQuests(true).Any())
  1725. {
  1726. string text = "";
  1727. Color color = Color.Empty;
  1728. switch (npc.QuestIcon)
  1729. {
  1730. case QuestIcon.ExclamationBlue:
  1731. color = Color.DodgerBlue;
  1732. text = "!";
  1733. break;
  1734. case QuestIcon.ExclamationYellow:
  1735. color = Color.Yellow;
  1736. text = "!";
  1737. break;
  1738. case QuestIcon.ExclamationGreen:
  1739. color = Color.Green;
  1740. text = "!";
  1741. break;
  1742. case QuestIcon.QuestionBlue:
  1743. color = Color.DodgerBlue;
  1744. text = "?";
  1745. break;
  1746. case QuestIcon.QuestionWhite:
  1747. color = Color.White;
  1748. text = "?";
  1749. break;
  1750. case QuestIcon.QuestionYellow:
  1751. color = Color.Yellow;
  1752. text = "?";
  1753. break;
  1754. case QuestIcon.QuestionGreen:
  1755. color = Color.Green;
  1756. text = "?";
  1757. break;
  1758. }
  1759. QuestIcons.Add(new MirLabel
  1760. {
  1761. AutoSize = true,
  1762. Parent = GameScene.Scene.MiniMapDialog,
  1763. Font = new Font(Settings.FontName, 9f, FontStyle.Bold),
  1764. DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
  1765. Text = text,
  1766. ForeColour = color,
  1767. Location = new Point((int)(x - Settings.ScreenWidth + GameScene.Scene.MiniMapDialog.Size.Width) - 6, (int)(y) - 10),
  1768. NotControl = true,
  1769. Visible = true,
  1770. Modal = true
  1771. });
  1772. }
  1773. #endregion
  1774. }
  1775. }
  1776. public void Toggle()
  1777. {
  1778. if (_fade == 0F)
  1779. {
  1780. _bigMode = true;
  1781. SetBigMode();
  1782. _fade = 1F;
  1783. }
  1784. //else if(_fade == 1F)
  1785. //{
  1786. // _bigMode = true;
  1787. // SetBigMode();
  1788. // _fade = 0.8F;
  1789. //}
  1790. else
  1791. {
  1792. _bigMode = false;
  1793. SetSmallMode();
  1794. _fade = 0;
  1795. }
  1796. Redraw();
  1797. }
  1798. private void SetSmallMode()
  1799. {
  1800. Index = 2091;
  1801. int y = Size.Height - 23;
  1802. MailButton.Location = new Point(4, y);
  1803. NewMail.Location = new Point(5, y + 1);
  1804. BigMapButton.Location = new Point(25, y);
  1805. LocationLabel.Location = new Point(46, y);
  1806. LightSetting.Location = new Point(102, y);
  1807. GameScene.Scene.DuraStatusPanel.Location = new Point(GameScene.Scene.MiniMapDialog.Location.X + 86,
  1808. GameScene.Scene.MiniMapDialog.Size.Height);
  1809. }
  1810. private void SetBigMode()
  1811. {
  1812. Index = 2090;
  1813. int y = Size.Height - 23;
  1814. MailButton.Location = new Point(4, y);
  1815. NewMail.Location = new Point(5, y + 1);
  1816. BigMapButton.Location = new Point(25, y);
  1817. LocationLabel.Location = new Point(46, y);
  1818. LightSetting.Location = new Point(102, y);
  1819. GameScene.Scene.DuraStatusPanel.Location = new Point(GameScene.Scene.MiniMapDialog.Location.X + 86,
  1820. GameScene.Scene.MiniMapDialog.Size.Height);
  1821. }
  1822. public void Process()
  1823. {
  1824. MapControl map = GameScene.Scene.MapControl;
  1825. if (map == null) return;
  1826. MapNameLabel.Text = map.Title;
  1827. LocationLabel.Text = Functions.PointToString(MapObject.User.CurrentLocation);
  1828. GameScene.Scene.MainDialog.SModeLabel.Location = new Point((GameScene.Scene.MiniMapDialog.Location.X - 3) - GameScene.Scene.MainDialog.Location.X,
  1829. (GameScene.Scene.MiniMapDialog.Size.Height + 150) - Settings.ScreenHeight);
  1830. GameScene.Scene.MainDialog.AModeLabel.Location = new Point((GameScene.Scene.MiniMapDialog.Location.X - 3) - GameScene.Scene.MainDialog.Location.X,
  1831. (GameScene.Scene.MiniMapDialog.Size.Height + 165) - Settings.ScreenHeight);
  1832. GameScene.Scene.MainDialog.PModeLabel.Location = new Point((GameScene.Scene.MiniMapDialog.Location.X - 3) - GameScene.Scene.MainDialog.Location.X,
  1833. (GameScene.Scene.MiniMapDialog.Size.Height + 180) - Settings.ScreenHeight);
  1834. if (GameScene.Scene.NewMail)
  1835. {
  1836. double time = (CMain.Time) / 100D;
  1837. if (Math.Round(time) % 10 < 5 || GameScene.Scene.NewMailCounter >= 10)
  1838. {
  1839. NewMail.Visible = true;
  1840. }
  1841. else
  1842. {
  1843. if (NewMail.Visible)
  1844. {
  1845. GameScene.Scene.NewMailCounter++;
  1846. }
  1847. NewMail.Visible = false;
  1848. }
  1849. }
  1850. else
  1851. {
  1852. NewMail.Visible = false;
  1853. }
  1854. }
  1855. }
  1856. public sealed class InspectDialog : MirImageControl
  1857. {
  1858. public static UserItem[] Items = new UserItem[14];
  1859. public static uint InspectID;
  1860. public string Name;
  1861. public string GuildName;
  1862. public string GuildRank;
  1863. public MirClass Class;
  1864. public MirGender Gender;
  1865. public byte Hair;
  1866. public ushort Level;
  1867. public string LoverName;
  1868. public bool AllowObserve;
  1869. public MirButton CloseButton, GroupButton, FriendButton, MailButton, TradeButton, LoverButton, ObserveButton;
  1870. public MirImageControl CharacterPage, ClassImage;
  1871. public MirLabel NameLabel;
  1872. public MirLabel GuildLabel, LoverLabel;
  1873. public MirItemCell
  1874. WeaponCell,
  1875. ArmorCell,
  1876. HelmetCell,
  1877. TorchCell,
  1878. NecklaceCell,
  1879. BraceletLCell,
  1880. BraceletRCell,
  1881. RingLCell,
  1882. RingRCell,
  1883. AmuletCell,
  1884. BeltCell,
  1885. BootsCell,
  1886. StoneCell,
  1887. MountCell;
  1888. public InspectDialog()
  1889. {
  1890. Index = 430;
  1891. Library = Libraries.Prguse;
  1892. Location = new Point(536, 0);
  1893. Movable = true;
  1894. Sort = true;
  1895. CharacterPage = new MirImageControl
  1896. {
  1897. Index = 340,
  1898. Parent = this,
  1899. Library = Libraries.Prguse,
  1900. Location = new Point(8, 70),
  1901. };
  1902. CharacterPage.AfterDraw += (o, e) =>
  1903. {
  1904. if (Libraries.StateItems == null) return;
  1905. ItemInfo RealItem = null;
  1906. if (ArmorCell.Item != null)
  1907. {
  1908. RealItem = Functions.GetRealItem(ArmorCell.Item.Info, Level, Class, GameScene.ItemInfoList);
  1909. Libraries.StateItems.Draw(RealItem.Image, new Point(DisplayLocation.X + 0, DisplayLocation.Y + -20), Color.White, true, 1F);
  1910. if (RealItem.Effect > 0)
  1911. {
  1912. int wingOffset = RealItem.Effect == 1 ? 2 : 4;
  1913. int genderOffset = MapObject.User.Gender == MirGender.Male ? 0 : 1;
  1914. Libraries.Prguse2.DrawBlend(1200 + wingOffset + genderOffset, new Point(DisplayLocation.X, DisplayLocation.Y - 20), Color.White, true, 1F);
  1915. }
  1916. }
  1917. if (WeaponCell.Item != null)
  1918. {
  1919. RealItem = Functions.GetRealItem(WeaponCell.Item.Info, Level, Class, GameScene.ItemInfoList);
  1920. Libraries.StateItems.Draw(RealItem.Image, new Point(DisplayLocation.X, DisplayLocation.Y - 20),
  1921. Color.White, true, 1F);
  1922. }
  1923. if (HelmetCell.Item != null)
  1924. Libraries.StateItems.Draw(HelmetCell.Item.Info.Image, new Point(DisplayLocation.X, DisplayLocation.Y - 20), Color.White, true, 1F);
  1925. else
  1926. {
  1927. int hair = 441 + Hair + (Class == MirClass.Assassin ? 20 : 0) + (Gender == MirGender.Male ? 0 : 40);
  1928. int offSetX = Class == MirClass.Assassin ? (Gender == MirGender.Male ? 6 : 4) : 0;
  1929. int offSetY = Class == MirClass.Assassin ? (Gender == MirGender.Male ? 25 : 18) : 0;
  1930. Libraries.Prguse.Draw(hair, new Point(DisplayLocation.X + offSetX, DisplayLocation.Y + offSetY - 20), Color.White, true, 1F);
  1931. }
  1932. };
  1933. CloseButton = new MirButton
  1934. {
  1935. HoverIndex = 361,
  1936. Index = 360,
  1937. Location = new Point(241, 3),
  1938. Library = Libraries.Prguse2,
  1939. Parent = this,
  1940. PressedIndex = 362,
  1941. Sound = SoundList.ButtonA,
  1942. };
  1943. CloseButton.Click += (o, e) => Hide();
  1944. GroupButton = new MirButton
  1945. {
  1946. HoverIndex = 432,
  1947. Index = 431,
  1948. Location = new Point(55, 357),
  1949. Library = Libraries.Prguse,
  1950. Parent = this,
  1951. PressedIndex = 433,
  1952. Sound = SoundList.ButtonA,
  1953. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.InviteToGroup),
  1954. };
  1955. GroupButton.Click += (o, e) =>
  1956. {
  1957. if (GroupDialog.GroupList.Count >= Globals.MaxGroup)
  1958. {
  1959. GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GroupHasMaxMembers), ChatType.System);
  1960. return;
  1961. }
  1962. if (GroupDialog.GroupList.Count > 0 && GroupDialog.GroupList[0] != MapObject.User.Name)
  1963. {
  1964. GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.YouNotGroupLeader), ChatType.System);
  1965. }
  1966. Network.Enqueue(new C.AddMember { Name = Name });
  1967. return;
  1968. };
  1969. FriendButton = new MirButton
  1970. {
  1971. HoverIndex = 435,
  1972. Index = 434,
  1973. Location = new Point(85, 357),
  1974. Library = Libraries.Prguse,
  1975. Parent = this,
  1976. PressedIndex = 436,
  1977. Sound = SoundList.ButtonA,
  1978. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AddToFriendsList),
  1979. };
  1980. FriendButton.Click += (o, e) =>
  1981. {
  1982. Network.Enqueue(new C.AddFriend { Name = Name, Blocked = false });
  1983. };
  1984. MailButton = new MirButton
  1985. {
  1986. HoverIndex = 438,
  1987. Index = 437,
  1988. Location = new Point(115, 357),
  1989. Library = Libraries.Prguse,
  1990. Parent = this,
  1991. PressedIndex = 439,
  1992. Sound = SoundList.ButtonA,
  1993. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.SendMail),
  1994. };
  1995. MailButton.Click += (o, e) => GameScene.Scene.MailComposeLetterDialog.ComposeMail(Name);
  1996. TradeButton = new MirButton
  1997. {
  1998. HoverIndex = 524,
  1999. Index = 523,
  2000. Location = new Point(145, 357),
  2001. Library = Libraries.Prguse,
  2002. Parent = this,
  2003. PressedIndex = 525,
  2004. Sound = SoundList.ButtonA,
  2005. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Trade),
  2006. };
  2007. TradeButton.Click += (o, e) => Network.Enqueue(new C.TradeRequest());
  2008. ObserveButton = new MirButton
  2009. {
  2010. Index = 854,
  2011. HoverIndex = 855,
  2012. PressedIndex = 856,
  2013. Location = new Point(175, 357),
  2014. Library = Libraries.Title,
  2015. Parent = this,
  2016. Sound = SoundList.ButtonA,
  2017. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Observe),
  2018. };
  2019. ObserveButton.Click += (o, e) =>
  2020. {
  2021. if (AllowObserve)
  2022. {
  2023. Network.Enqueue(new C.Observe { Name = Name });
  2024. }
  2025. else
  2026. {
  2027. GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PlayerDisabledObservation), ChatType.System);
  2028. }
  2029. };
  2030. NameLabel = new MirLabel
  2031. {
  2032. DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
  2033. Parent = this,
  2034. Location = new Point(50, 12),
  2035. Size = new Size(190, 20),
  2036. NotControl = true
  2037. };
  2038. NameLabel.Click += (o, e) =>
  2039. {
  2040. GameScene.Scene.ChatDialog.ChatTextBox.SetFocus();
  2041. GameScene.Scene.ChatDialog.ChatTextBox.Text = string.Format("/{0} ", Name);
  2042. GameScene.Scene.ChatDialog.ChatTextBox.Visible = true;
  2043. GameScene.Scene.ChatDialog.ChatTextBox.TextBox.SelectionLength = 0;
  2044. GameScene.Scene.ChatDialog.ChatTextBox.TextBox.SelectionStart = Name.Length + 2;
  2045. };
  2046. LoverButton = new MirButton
  2047. {
  2048. Index = 604,
  2049. Location = new Point(17, 17),
  2050. Library = Libraries.Prguse,
  2051. Parent = this,
  2052. Sound = SoundList.None
  2053. };
  2054. GuildLabel = new MirLabel
  2055. {
  2056. DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
  2057. Parent = this,
  2058. Location = new Point(50, 33),
  2059. Size = new Size(190, 30),
  2060. NotControl = true,
  2061. };
  2062. ClassImage = new MirImageControl
  2063. {
  2064. Index = 100,
  2065. Library = Libraries.Prguse,
  2066. Location = new Point(15, 33),
  2067. Parent = this,
  2068. NotControl = true,
  2069. };
  2070. WeaponCell = new MirItemCell
  2071. {
  2072. ItemSlot = (int)EquipmentSlot.Weapon,
  2073. GridType = MirGridType.Inspect,
  2074. Parent = CharacterPage,
  2075. Location = new Point(123, 7),
  2076. };
  2077. ArmorCell = new MirItemCell
  2078. {
  2079. ItemSlot = (int)EquipmentSlot.Armour,
  2080. GridType = MirGridType.Inspect,
  2081. Parent = CharacterPage,
  2082. Location = new Point(163, 7),
  2083. };
  2084. HelmetCell = new MirItemCell
  2085. {
  2086. ItemSlot = (int)EquipmentSlot.Helmet,
  2087. GridType = MirGridType.Inspect,
  2088. Parent = CharacterPage,
  2089. Location = new Point(203, 7),
  2090. };
  2091. TorchCell = new MirItemCell
  2092. {
  2093. ItemSlot = (int)EquipmentSlot.Torch,
  2094. GridType = MirGridType.Inspect,
  2095. Parent = CharacterPage,
  2096. Location = new Point(203, 134),
  2097. };
  2098. NecklaceCell = new MirItemCell
  2099. {
  2100. ItemSlot = (int)EquipmentSlot.Necklace,
  2101. GridType = MirGridType.Inspect,
  2102. Parent = CharacterPage,
  2103. Location = new Point(203, 98),
  2104. };
  2105. BraceletLCell = new MirItemCell
  2106. {
  2107. ItemSlot = (int)EquipmentSlot.BraceletL,
  2108. GridType = MirGridType.Inspect,
  2109. Parent = CharacterPage,
  2110. Location = new Point(8, 170),
  2111. };
  2112. BraceletRCell = new MirItemCell
  2113. {
  2114. ItemSlot = (int)EquipmentSlot.BraceletR,
  2115. GridType = MirGridType.Inspect,
  2116. Parent = CharacterPage,
  2117. Location = new Point(203, 170),
  2118. };
  2119. RingLCell = new MirItemCell
  2120. {
  2121. ItemSlot = (int)EquipmentSlot.RingL,
  2122. GridType = MirGridType.Inspect,
  2123. Parent = CharacterPage,
  2124. Location = new Point(8, 206),
  2125. };
  2126. RingRCell = new MirItemCell
  2127. {
  2128. ItemSlot = (int)EquipmentSlot.RingR,
  2129. GridType = MirGridType.Inspect,
  2130. Parent = CharacterPage,
  2131. Location = new Point(203, 206),
  2132. };
  2133. AmuletCell = new MirItemCell
  2134. {
  2135. ItemSlot = (int)EquipmentSlot.Amulet,
  2136. GridType = MirGridType.Inspect,
  2137. Parent = CharacterPage,
  2138. Location = new Point(8, 242),
  2139. };
  2140. BootsCell = new MirItemCell
  2141. {
  2142. ItemSlot = (int)EquipmentSlot.Boots,
  2143. GridType = MirGridType.Inspect,
  2144. Parent = CharacterPage,
  2145. Location = new Point(48, 242),
  2146. };
  2147. BeltCell = new MirItemCell
  2148. {
  2149. ItemSlot = (int)EquipmentSlot.Belt,
  2150. GridType = MirGridType.Inspect,
  2151. Parent = CharacterPage,
  2152. Location = new Point(88, 242),
  2153. };
  2154. StoneCell = new MirItemCell
  2155. {
  2156. ItemSlot = (int)EquipmentSlot.Stone,
  2157. GridType = MirGridType.Inspect,
  2158. Parent = CharacterPage,
  2159. Location = new Point(128, 242),
  2160. };
  2161. MountCell = new MirItemCell
  2162. {
  2163. ItemSlot = (int)EquipmentSlot.Mount,
  2164. GridType = MirGridType.Inspect,
  2165. Parent = CharacterPage,
  2166. Location = new Point(203, 62),
  2167. };
  2168. }
  2169. public void RefreshInferface(bool IsHero)
  2170. {
  2171. int offSet = Gender == MirGender.Male ? 0 : 1;
  2172. CharacterPage.Index = 340 + offSet;
  2173. switch (Class)
  2174. {
  2175. case MirClass.Warrior:
  2176. ClassImage.Index = 100;// + offSet * 5;
  2177. break;
  2178. case MirClass.Wizard:
  2179. ClassImage.Index = 101;// + offSet * 5;
  2180. break;
  2181. case MirClass.Taoist:
  2182. ClassImage.Index = 102;// + offSet * 5;
  2183. break;
  2184. case MirClass.Assassin:
  2185. ClassImage.Index = 103;// + offSet * 5;
  2186. break;
  2187. case MirClass.Archer:
  2188. ClassImage.Index = 104;// + offSet * 5;
  2189. break;
  2190. }
  2191. NameLabel.Text = Name;
  2192. GuildLabel.Text = GuildName + " " + GuildRank;
  2193. if (LoverName != "")
  2194. {
  2195. LoverButton.Visible = true;
  2196. LoverButton.Hint = LoverName;
  2197. }
  2198. else
  2199. LoverButton.Visible = false;
  2200. for (int i = 0; i < Items.Length; i++)
  2201. {
  2202. if (Items[i] == null) continue;
  2203. GameScene.Bind(Items[i]);
  2204. }
  2205. //ObserveButton.Visible = AllowObserve; //Use this to allow observe button to be shown only if the player has Observe Enabled, pressing this wont bypass Observe being false.
  2206. ObserveButton.Visible = !IsHero;
  2207. TradeButton.Visible = !IsHero;
  2208. MailButton.Visible = !IsHero;
  2209. FriendButton.Visible = !IsHero;
  2210. GroupButton.Visible = !IsHero;
  2211. }
  2212. }
  2213. public sealed class OptionDialog : MirImageControl
  2214. {
  2215. public MirButton SkillModeOn, SkillModeOff;
  2216. public MirButton SkillBarOn, SkillBarOff;
  2217. public MirButton EffectOn, EffectOff;
  2218. public MirButton DropViewOn, DropViewOff;
  2219. public MirButton NameViewOn, NameViewOff;
  2220. public MirButton HPViewOn, HPViewOff;
  2221. public MirButton NewMoveOn, NewMoveOff;
  2222. public MirButton ObserveOn, ObserveOff;
  2223. public MirImageControl SoundBar, MusicSoundBar;
  2224. public MirImageControl VolumeBar, MusicVolumeBar;
  2225. public MirButton CloseButton;
  2226. public OptionDialog()
  2227. {
  2228. Index = 411;
  2229. Library = Libraries.Title;
  2230. Movable = true;
  2231. Sort = true;
  2232. Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2);
  2233. BeforeDraw += OptionPanel_BeforeDraw;
  2234. CloseButton = new MirButton
  2235. {
  2236. Index = 360,
  2237. HoverIndex = 361,
  2238. Library = Libraries.Prguse2,
  2239. Location = new Point(Size.Width - 26, 5),
  2240. Parent = this,
  2241. Sound = SoundList.ButtonA,
  2242. PressedIndex = 362,
  2243. };
  2244. CloseButton.Click += (o, e) => Hide();
  2245. //tilde option
  2246. SkillModeOn = new MirButton
  2247. {
  2248. Library = Libraries.Prguse2,
  2249. Location = new Point(159, 68),
  2250. Parent = this,
  2251. Sound = SoundList.ButtonA,
  2252. Size = new Size(36, 17),
  2253. PressedIndex = 451,
  2254. };
  2255. SkillModeOn.Click += (o, e) =>
  2256. {
  2257. GameScene.Scene.ChangeSkillMode(false);
  2258. };
  2259. //ctrl option
  2260. SkillModeOff = new MirButton
  2261. {
  2262. Library = Libraries.Prguse2,
  2263. Location = new Point(201, 68),
  2264. Parent = this,
  2265. Sound = SoundList.ButtonA,
  2266. Size = new Size(36, 17),
  2267. PressedIndex = 454
  2268. };
  2269. SkillModeOff.Click += (o, e) =>
  2270. {
  2271. GameScene.Scene.ChangeSkillMode(true);
  2272. };
  2273. SkillBarOn = new MirButton
  2274. {
  2275. Library = Libraries.Prguse2,
  2276. Location = new Point(159, 93),
  2277. Parent = this,
  2278. Sound = SoundList.ButtonA,
  2279. Size = new Size(36, 17),
  2280. PressedIndex = 457,
  2281. };
  2282. SkillBarOn.Click += (o, e) => Settings.SkillBar = true;
  2283. SkillBarOff = new MirButton
  2284. {
  2285. Library = Libraries.Prguse2,
  2286. Location = new Point(201, 93),
  2287. Parent = this,
  2288. Sound = SoundList.ButtonA,
  2289. Size = new Size(36, 17),
  2290. PressedIndex = 460
  2291. };
  2292. SkillBarOff.Click += (o, e) => Settings.SkillBar = false;
  2293. EffectOn = new MirButton
  2294. {
  2295. Library = Libraries.Prguse2,
  2296. Location = new Point(159, 118),
  2297. Parent = this,
  2298. Sound = SoundList.ButtonA,
  2299. Size = new Size(36, 17),
  2300. PressedIndex = 457,
  2301. };
  2302. EffectOn.Click += (o, e) => Settings.Effect = true;
  2303. EffectOff = new MirButton
  2304. {
  2305. Library = Libraries.Prguse2,
  2306. Location = new Point(201, 118),
  2307. Parent = this,
  2308. Sound = SoundList.ButtonA,
  2309. Size = new Size(36, 17),
  2310. PressedIndex = 460
  2311. };
  2312. EffectOff.Click += (o, e) => Settings.Effect = false;
  2313. DropViewOn = new MirButton
  2314. {
  2315. Library = Libraries.Prguse2,
  2316. Location = new Point(159, 143),
  2317. Parent = this,
  2318. Sound = SoundList.ButtonA,
  2319. Size = new Size(36, 17),
  2320. PressedIndex = 457,
  2321. };
  2322. DropViewOn.Click += (o, e) => Settings.DropView = true;
  2323. DropViewOff = new MirButton
  2324. {
  2325. Library = Libraries.Prguse2,
  2326. Location = new Point(201, 143),
  2327. Parent = this,
  2328. Sound = SoundList.ButtonA,
  2329. Size = new Size(36, 17),
  2330. PressedIndex = 460
  2331. };
  2332. DropViewOff.Click += (o, e) => Settings.DropView = false;
  2333. NameViewOn = new MirButton
  2334. {
  2335. Library = Libraries.Prguse2,
  2336. Location = new Point(159, 168),
  2337. Parent = this,
  2338. Sound = SoundList.ButtonA,
  2339. Size = new Size(36, 17),
  2340. PressedIndex = 457,
  2341. };
  2342. NameViewOn.Click += (o, e) => Settings.NameView = true;
  2343. NameViewOff = new MirButton
  2344. {
  2345. Library = Libraries.Prguse2,
  2346. Location = new Point(201, 168),
  2347. Parent = this,
  2348. Sound = SoundList.ButtonA,
  2349. Size = new Size(36, 17),
  2350. PressedIndex = 460
  2351. };
  2352. NameViewOff.Click += (o, e) => Settings.NameView = false;
  2353. HPViewOn = new MirButton
  2354. {
  2355. Library = Libraries.Prguse2,
  2356. Location = new Point(159, 193),
  2357. Parent = this,
  2358. Sound = SoundList.ButtonA,
  2359. Size = new Size(36, 17),
  2360. PressedIndex = 463,
  2361. };
  2362. HPViewOn.Click += (o, e) =>
  2363. {
  2364. Settings.HPView = true;
  2365. GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.HpMpMode1), ChatType.Hint);
  2366. };
  2367. HPViewOff = new MirButton
  2368. {
  2369. Library = Libraries.Prguse2,
  2370. Location = new Point(201, 193),
  2371. Parent = this,
  2372. Sound = SoundList.ButtonA,
  2373. Size = new Size(36, 17),
  2374. PressedIndex = 466
  2375. };
  2376. HPViewOff.Click += (o, e) =>
  2377. {
  2378. Settings.HPView = false;
  2379. GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.HpMpMode2), ChatType.Hint);
  2380. };
  2381. SoundBar = new MirImageControl
  2382. {
  2383. Index = 468,
  2384. Library = Libraries.Prguse2,
  2385. Location = new Point(159, 225),
  2386. Parent = this,
  2387. DrawImage = false,
  2388. };
  2389. SoundBar.MouseDown += SoundBar_MouseMove;
  2390. SoundBar.MouseMove += SoundBar_MouseMove;
  2391. SoundBar.BeforeDraw += SoundBar_BeforeDraw;
  2392. VolumeBar = new MirImageControl
  2393. {
  2394. Index = 20,
  2395. Library = Libraries.Prguse,
  2396. Location = new Point(155, 218),
  2397. Parent = this,
  2398. NotControl = true,
  2399. };
  2400. MusicSoundBar = new MirImageControl
  2401. {
  2402. Index = 468,
  2403. Library = Libraries.Prguse2,
  2404. Location = new Point(159, 251),
  2405. Parent = this,
  2406. DrawImage = false
  2407. };
  2408. MusicSoundBar.MouseDown += MusicSoundBar_MouseMove;
  2409. MusicSoundBar.MouseMove += MusicSoundBar_MouseMove;
  2410. MusicSoundBar.BeforeDraw += MusicSoundBar_BeforeDraw;
  2411. MusicVolumeBar = new MirImageControl
  2412. {
  2413. Index = 20,
  2414. Library = Libraries.Prguse,
  2415. Location = new Point(155, 244),
  2416. Parent = this,
  2417. NotControl = true,
  2418. };
  2419. NewMoveOn = new MirButton
  2420. {
  2421. Library = Libraries.Title,
  2422. Location = new Point(159, 296),
  2423. Parent = this,
  2424. Sound = SoundList.ButtonA,
  2425. Size = new Size(36, 17),
  2426. PressedIndex = 853,
  2427. };
  2428. NewMoveOn.Click += (o, e) =>
  2429. {
  2430. Settings.NewMove = true;
  2431. GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.NewMovementStyle), ChatType.Hint);
  2432. };
  2433. NewMoveOff = new MirButton
  2434. {
  2435. Library = Libraries.Title,
  2436. Location = new Point(201, 296),
  2437. Parent = this,
  2438. Sound = SoundList.ButtonA,
  2439. Size = new Size(36, 17),
  2440. PressedIndex = 850
  2441. };
  2442. NewMoveOff.Click += (o, e) =>
  2443. {
  2444. Settings.NewMove = false;
  2445. GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.OldMovementStyle), ChatType.Hint);
  2446. };
  2447. ObserveOn = new MirButton
  2448. {
  2449. Library = Libraries.Prguse2,
  2450. Location = new Point(159, 271),
  2451. Parent = this,
  2452. Sound = SoundList.ButtonA,
  2453. Size = new Size(36, 17),
  2454. PressedIndex = 457,
  2455. };
  2456. ObserveOn.Click += (o, e) => ToggleObserve(true);
  2457. ObserveOff = new MirButton
  2458. {
  2459. Library = Libraries.Prguse2,
  2460. Location = new Point(201, 271),
  2461. Parent = this,
  2462. Sound = SoundList.ButtonA,
  2463. Size = new Size(36, 17),
  2464. PressedIndex = 460
  2465. };
  2466. ObserveOff.Click += (o, e) => ToggleObserve(false);
  2467. }
  2468. private void ToggleObserve(bool allow)
  2469. {
  2470. if (GameScene.AllowObserve == allow) return;
  2471. Network.Enqueue(new C.Chat
  2472. {
  2473. Message = "@ALLOWOBSERVE",
  2474. });
  2475. }
  2476. public void ToggleSkillButtons(bool Ctrl)
  2477. {
  2478. foreach (KeyBind KeyCheck in CMain.InputKeys.Keylist)
  2479. {
  2480. if (KeyCheck.Key == Keys.None)
  2481. continue;
  2482. if ((KeyCheck.function < KeybindOptions.Bar1Skill1) || (KeyCheck.function > KeybindOptions.Bar2Skill8)) continue;
  2483. //need to test this
  2484. if ((KeyCheck.RequireCtrl != 1) && (KeyCheck.RequireTilde != 1)) continue;
  2485. KeyCheck.RequireCtrl = (byte)(Ctrl ? 1 : 0);
  2486. KeyCheck.RequireTilde = (byte)(Ctrl ? 0 : 1);
  2487. }
  2488. }
  2489. private void SoundBar_MouseMove(object sender, MouseEventArgs e)
  2490. {
  2491. if (e.Button != MouseButtons.Left || SoundBar != ActiveControl) return;
  2492. Point p = e.Location.Subtract(SoundBar.DisplayLocation);
  2493. byte volume = (byte)(p.X / (double)SoundBar.Size.Width * 100);
  2494. Settings.Volume = volume;
  2495. double percent = Settings.Volume / 100D;
  2496. SoundBar.Hint = $"{Settings.Volume}%";
  2497. if (percent > 1) percent = 1;
  2498. VolumeBar.Location = percent > 0 ? new Point(159 + (int)((SoundBar.Size.Width - 2) * percent), 218) : new Point(159, 218);
  2499. }
  2500. private void SoundBar_BeforeDraw(object sender, EventArgs e)
  2501. {
  2502. if (SoundBar.Library == null) return;
  2503. double percent = Settings.Volume / 100D;
  2504. SoundBar.Hint = $"{Settings.Volume}%";
  2505. if (percent > 1) percent = 1;
  2506. if (percent > 0)
  2507. {
  2508. Rectangle section = new Rectangle
  2509. {
  2510. Size = new Size((int)((SoundBar.Size.Width - 2) * percent), SoundBar.Size.Height)
  2511. };
  2512. SoundBar.Library.Draw(SoundBar.Index, section, SoundBar.DisplayLocation, Color.White, false);
  2513. VolumeBar.Location = new Point(159 + section.Size.Width, 218);
  2514. }
  2515. else
  2516. VolumeBar.Location = new Point(159, 218);
  2517. }
  2518. private void MusicSoundBar_BeforeDraw(object sender, EventArgs e)
  2519. {
  2520. if (MusicSoundBar.Library == null) return;
  2521. double percent = Settings.MusicVolume / 100D;
  2522. MusicSoundBar.Hint = $"{Settings.MusicVolume}%";
  2523. if (percent > 1) percent = 1;
  2524. if (percent > 0)
  2525. {
  2526. Rectangle section = new Rectangle
  2527. {
  2528. Size = new Size((int)((MusicSoundBar.Size.Width - 2) * percent), MusicSoundBar.Size.Height)
  2529. };
  2530. MusicSoundBar.Library.Draw(MusicSoundBar.Index, section, MusicSoundBar.DisplayLocation, Color.White, false);
  2531. MusicVolumeBar.Location = new Point(159 + section.Size.Width, 244);
  2532. }
  2533. else
  2534. MusicVolumeBar.Location = new Point(159, 244);
  2535. }
  2536. private void MusicSoundBar_MouseMove(object sender, MouseEventArgs e)
  2537. {
  2538. if (e.Button != MouseButtons.Left || MusicSoundBar != ActiveControl) return;
  2539. Point p = e.Location.Subtract(MusicSoundBar.DisplayLocation);
  2540. byte volume = (byte)(p.X / (double)MusicSoundBar.Size.Width * 100);
  2541. Settings.MusicVolume = volume;
  2542. double percent = Settings.MusicVolume / 100D;
  2543. MusicSoundBar.Hint = $"{Settings.MusicVolume}%";
  2544. if (percent > 1) percent = 1;
  2545. MusicVolumeBar.Location = percent > 0 ? new Point(159 + (int)((MusicSoundBar.Size.Width - 2) * percent), 244) : new Point(159, 244);
  2546. }
  2547. private void OptionPanel_BeforeDraw(object sender, EventArgs e)
  2548. {
  2549. if (Settings.SkillMode)
  2550. {
  2551. SkillModeOn.Index = 452;
  2552. SkillModeOff.Index = 453;
  2553. }
  2554. else
  2555. {
  2556. SkillModeOn.Index = 450;
  2557. SkillModeOff.Index = 455;
  2558. }
  2559. if (Settings.SkillBar)
  2560. {
  2561. SkillBarOn.Index = 458;
  2562. SkillBarOff.Index = 459;
  2563. }
  2564. else
  2565. {
  2566. SkillBarOn.Index = 456;
  2567. SkillBarOff.Index = 461;
  2568. }
  2569. if (Settings.Effect)
  2570. {
  2571. EffectOn.Index = 458;
  2572. EffectOff.Index = 459;
  2573. }
  2574. else
  2575. {
  2576. EffectOn.Index = 456;
  2577. EffectOff.Index = 461;
  2578. }
  2579. if (Settings.DropView)
  2580. {
  2581. DropViewOn.Index = 458;
  2582. DropViewOff.Index = 459;
  2583. }
  2584. else
  2585. {
  2586. DropViewOn.Index = 456;
  2587. DropViewOff.Index = 461;
  2588. }
  2589. if (Settings.NameView)
  2590. {
  2591. NameViewOn.Index = 458;
  2592. NameViewOff.Index = 459;
  2593. }
  2594. else
  2595. {
  2596. NameViewOn.Index = 456;
  2597. NameViewOff.Index = 461;
  2598. }
  2599. if (Settings.HPView)
  2600. {
  2601. HPViewOn.Index = 464;
  2602. HPViewOff.Index = 465;
  2603. }
  2604. else
  2605. {
  2606. HPViewOn.Index = 462;
  2607. HPViewOff.Index = 467;
  2608. }
  2609. if (Settings.NewMove)
  2610. {
  2611. NewMoveOn.Index = 853;
  2612. NewMoveOff.Index = 848;
  2613. }
  2614. else
  2615. {
  2616. NewMoveOn.Index = 851;
  2617. NewMoveOff.Index = 850;
  2618. }
  2619. if (GameScene.AllowObserve)
  2620. {
  2621. ObserveOn.Index = 458;
  2622. ObserveOff.Index = 459;
  2623. }
  2624. else
  2625. {
  2626. ObserveOn.Index = 456;
  2627. ObserveOff.Index = 461;
  2628. }
  2629. }
  2630. }
  2631. public sealed class MenuDialog : MirImageControl
  2632. {
  2633. public MirButton ExitButton,
  2634. LogOutButton,
  2635. HelpButton,
  2636. KeyboardLayoutButton,
  2637. RankingButton,
  2638. CraftingButton,
  2639. IntelligentCreatureButton,
  2640. RideButton,
  2641. FishingButton,
  2642. FriendButton,
  2643. MentorButton,
  2644. RelationshipButton,
  2645. GroupButton,
  2646. GuildButton;
  2647. public MenuDialog()
  2648. {
  2649. Index = 567;
  2650. Parent = GameScene.Scene;
  2651. Library = Libraries.Title;
  2652. Location = new Point(Settings.ScreenWidth - Size.Width, GameScene.Scene.MainDialog.Location.Y - this.Size.Height + 15);
  2653. Sort = true;
  2654. Visible = false;
  2655. Movable = true;
  2656. ExitButton = new MirButton
  2657. {
  2658. HoverIndex = 634,
  2659. Index = 633,
  2660. Parent = this,
  2661. Library = Libraries.Title,
  2662. Location = new Point(3, 12),
  2663. PressedIndex = 635,
  2664. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ExitKey), CMain.InputKeys.GetKey(KeybindOptions.Exit))
  2665. };
  2666. ExitButton.Click += (o, e) => GameScene.Scene.QuitGame();
  2667. LogOutButton = new MirButton
  2668. {
  2669. HoverIndex = 637,
  2670. Index = 636,
  2671. Parent = this,
  2672. Library = Libraries.Title,
  2673. Location = new Point(3, 31),
  2674. PressedIndex = 638,
  2675. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.LogOutKey), CMain.InputKeys.GetKey(KeybindOptions.Logout))
  2676. };
  2677. LogOutButton.Click += (o, e) => GameScene.Scene.LogOut();
  2678. HelpButton = new MirButton
  2679. {
  2680. Index = 1970,
  2681. HoverIndex = 1971,
  2682. PressedIndex = 1972,
  2683. Parent = this,
  2684. Library = Libraries.Prguse,
  2685. Location = new Point(3, 50),
  2686. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HelpKey), CMain.InputKeys.GetKey(KeybindOptions.Help))
  2687. };
  2688. HelpButton.Click += (o, e) =>
  2689. {
  2690. if (GameScene.Scene.HelpDialog.Visible)
  2691. GameScene.Scene.HelpDialog.Hide();
  2692. else GameScene.Scene.HelpDialog.Show();
  2693. };
  2694. KeyboardLayoutButton = new MirButton
  2695. {
  2696. Index = 1973,
  2697. HoverIndex = 1974,
  2698. PressedIndex = 1975,
  2699. Parent = this,
  2700. Library = Libraries.Prguse,
  2701. Location = new Point(3, 69),
  2702. Visible = true,
  2703. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.KeyboardKeybind), CMain.InputKeys.GetKey(KeybindOptions.Keybind))
  2704. };
  2705. KeyboardLayoutButton.Click += (o, e) =>
  2706. {
  2707. if (GameScene.Scene.KeyboardLayoutDialog.Visible)
  2708. GameScene.Scene.KeyboardLayoutDialog.Hide();
  2709. else GameScene.Scene.KeyboardLayoutDialog.Show();
  2710. };
  2711. RankingButton = new MirButton
  2712. {
  2713. Index = 2000,
  2714. HoverIndex = 2001,
  2715. PressedIndex = 2002,
  2716. Parent = this,
  2717. Library = Libraries.Prguse,
  2718. Location = new Point(3, 88),
  2719. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.RankingKey), CMain.InputKeys.GetKey(KeybindOptions.Ranking))
  2720. //Visible = false
  2721. };
  2722. RankingButton.Click += (o, e) =>
  2723. {
  2724. if (GameScene.Scene.RankingDialog.Visible)
  2725. GameScene.Scene.RankingDialog.Hide();
  2726. else GameScene.Scene.RankingDialog.Show();
  2727. };
  2728. CraftingButton = new MirButton
  2729. {
  2730. Index = 2000,
  2731. HoverIndex = 2001,
  2732. PressedIndex = 2002,
  2733. Parent = this,
  2734. Library = Libraries.Prguse,
  2735. Location = new Point(3, 107),
  2736. Visible = false
  2737. };
  2738. CraftingButton.Click += (o, e) =>
  2739. {
  2740. };
  2741. IntelligentCreatureButton = new MirButton
  2742. {
  2743. Index = 431,
  2744. HoverIndex = 432,
  2745. PressedIndex = 433,
  2746. Parent = this,
  2747. Library = Libraries.Prguse2,
  2748. Location = new Point(3, 126),
  2749. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.CreaturesKey), CMain.InputKeys.GetKey(KeybindOptions.Creature))
  2750. };
  2751. IntelligentCreatureButton.Click += (o, e) =>
  2752. {
  2753. if (GameScene.Scene.IntelligentCreatureDialog.Visible)
  2754. GameScene.Scene.IntelligentCreatureDialog.Hide();
  2755. else GameScene.Scene.IntelligentCreatureDialog.Show();
  2756. };
  2757. RideButton = new MirButton
  2758. {
  2759. Index = 1976,
  2760. HoverIndex = 1977,
  2761. PressedIndex = 1978,
  2762. Parent = this,
  2763. Library = Libraries.Prguse,
  2764. Location = new Point(3, 145),
  2765. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MountKey), CMain.InputKeys.GetKey(KeybindOptions.MountWindow))
  2766. };
  2767. RideButton.Click += (o, e) =>
  2768. {
  2769. if (GameScene.Scene.MountDialog.Visible)
  2770. GameScene.Scene.MountDialog.Hide();
  2771. else GameScene.Scene.MountDialog.Show();
  2772. };
  2773. FishingButton = new MirButton
  2774. {
  2775. Index = 1979,
  2776. HoverIndex = 1980,
  2777. PressedIndex = 1981,
  2778. Parent = this,
  2779. Library = Libraries.Prguse,
  2780. Location = new Point(3, 164),
  2781. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FishingKey), CMain.InputKeys.GetKey(KeybindOptions.Fishing))
  2782. };
  2783. FishingButton.Click += (o, e) =>
  2784. {
  2785. if (GameScene.Scene.FishingDialog.Visible)
  2786. GameScene.Scene.FishingDialog.Hide();
  2787. else GameScene.Scene.FishingDialog.Show();
  2788. };
  2789. FriendButton = new MirButton
  2790. {
  2791. Index = 1982,
  2792. HoverIndex = 1983,
  2793. PressedIndex = 1984,
  2794. Parent = this,
  2795. Library = Libraries.Prguse,
  2796. Location = new Point(3, 183),
  2797. Visible = true,
  2798. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FriendsKey), CMain.InputKeys.GetKey(KeybindOptions.Friends))
  2799. };
  2800. FriendButton.Click += (o, e) =>
  2801. {
  2802. if (GameScene.Scene.FriendDialog.Visible)
  2803. GameScene.Scene.FriendDialog.Hide();
  2804. else GameScene.Scene.FriendDialog.Show();
  2805. };
  2806. MentorButton = new MirButton
  2807. {
  2808. Index = 1985,
  2809. HoverIndex = 1986,
  2810. PressedIndex = 1987,
  2811. Parent = this,
  2812. Library = Libraries.Prguse,
  2813. Location = new Point(3, 202),
  2814. Visible = true,
  2815. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MentorKey), CMain.InputKeys.GetKey(KeybindOptions.Mentor))
  2816. };
  2817. MentorButton.Click += (o, e) =>
  2818. {
  2819. if (GameScene.Scene.MentorDialog.Visible)
  2820. GameScene.Scene.MentorDialog.Hide();
  2821. else GameScene.Scene.MentorDialog.Show();
  2822. };
  2823. RelationshipButton = new MirButton /* lover button */
  2824. {
  2825. Index = 1988,
  2826. HoverIndex = 1989,
  2827. PressedIndex = 1990,
  2828. Parent = this,
  2829. Library = Libraries.Prguse,
  2830. Location = new Point(3, 221),
  2831. Visible = true,
  2832. Hint = string.Format( GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.RelationshipKey), CMain.InputKeys.GetKey(KeybindOptions.Relationship))
  2833. };
  2834. RelationshipButton.Click += (o, e) =>
  2835. {
  2836. if (GameScene.Scene.RelationshipDialog.Visible)
  2837. GameScene.Scene.RelationshipDialog.Hide();
  2838. else GameScene.Scene.RelationshipDialog.Show();
  2839. };
  2840. GroupButton = new MirButton
  2841. {
  2842. Index = 1991,
  2843. HoverIndex = 1992,
  2844. PressedIndex = 1993,
  2845. Parent = this,
  2846. Library = Libraries.Prguse,
  2847. Location = new Point(3, 240),
  2848. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.GroupsKey), CMain.InputKeys.GetKey(KeybindOptions.Group))
  2849. };
  2850. GroupButton.Click += (o, e) =>
  2851. {
  2852. if (GameScene.Scene.GroupDialog.Visible)
  2853. GameScene.Scene.GroupDialog.Hide();
  2854. else GameScene.Scene.GroupDialog.Show();
  2855. };
  2856. GuildButton = new MirButton
  2857. {
  2858. Index = 1994,
  2859. HoverIndex = 1995,
  2860. PressedIndex = 1996,
  2861. Parent = this,
  2862. Library = Libraries.Prguse,
  2863. Location = new Point(3, 259),
  2864. Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.GuildKey), CMain.InputKeys.GetKey(KeybindOptions.Guilds))
  2865. };
  2866. GuildButton.Click += (o, e) =>
  2867. {
  2868. if (GameScene.Scene.GuildDialog.Visible)
  2869. GameScene.Scene.GuildDialog.Hide();
  2870. else GameScene.Scene.GuildDialog.Show();
  2871. };
  2872. }
  2873. }
  2874. public sealed class MagicButton : MirControl
  2875. {
  2876. public MirImageControl LevelImage, ExpImage;
  2877. public MirButton SkillButton;
  2878. public MirLabel LevelLabel, NameLabel, ExpLabel, KeyLabel;
  2879. public ClientMagic Magic;
  2880. public MirImageControl CoolDown;
  2881. public bool HeroMagic;
  2882. string[] Prefixes = new string[] { "", "CTRL", "Shift" };
  2883. public MagicButton()
  2884. {
  2885. Size = new Size(231, 33);
  2886. SkillButton = new MirButton
  2887. {
  2888. Index = 0,
  2889. PressedIndex = 1,
  2890. Library = Libraries.MagIcon2,
  2891. Parent = this,
  2892. Location = new Point(36, 0),
  2893. Sound = SoundList.ButtonA,
  2894. };
  2895. SkillButton.Click += (o, e) =>
  2896. {
  2897. if (HeroMagic)
  2898. {
  2899. if (GameScene.Hero == null || GameScene.Hero.Dead)
  2900. return;
  2901. new AssignKeyPanel(Magic, 17, new string[]
  2902. {
  2903. "Shift" + Environment.NewLine + "F1",
  2904. "Shift" + Environment.NewLine + "F2",
  2905. "Shift" + Environment.NewLine + "F3",
  2906. "Shift" + Environment.NewLine + "F4",
  2907. "Shift" + Environment.NewLine + "F5",
  2908. "Shift" + Environment.NewLine + "F6",
  2909. "Shift" + Environment.NewLine + "F7",
  2910. "Shift" + Environment.NewLine + "F8"
  2911. })
  2912. { Actor = GameScene.Hero };
  2913. }
  2914. else
  2915. {
  2916. new AssignKeyPanel(Magic, 1, new string[]
  2917. {
  2918. "F1",
  2919. "F2",
  2920. "F3",
  2921. "F4",
  2922. "F5",
  2923. "F6",
  2924. "F7",
  2925. "F8",
  2926. "Ctrl" + Environment.NewLine + "F1",
  2927. "Ctrl" + Environment.NewLine + "F2",
  2928. "Ctrl" + Environment.NewLine + "F3",
  2929. "Ctrl" + Environment.NewLine + "F4",
  2930. "Ctrl" + Environment.NewLine + "F5",
  2931. "Ctrl" + Environment.NewLine + "F6",
  2932. "Ctrl" + Environment.NewLine + "F7",
  2933. "Ctrl" + Environment.NewLine + "F8"
  2934. })
  2935. { Actor = GameScene.User };
  2936. }
  2937. };
  2938. LevelImage = new MirImageControl
  2939. {
  2940. Index = 516,
  2941. Library = Libraries.Title,
  2942. Location = new Point(73, 7),
  2943. Parent = this,
  2944. NotControl = true,
  2945. };
  2946. ExpImage = new MirImageControl
  2947. {
  2948. Index = 517,
  2949. Library = Libraries.Title,
  2950. Location = new Point(73, 19),
  2951. Parent = this,
  2952. NotControl = true,
  2953. };
  2954. LevelLabel = new MirLabel
  2955. {
  2956. AutoSize = true,
  2957. Parent = this,
  2958. Location = new Point(88, 2),
  2959. NotControl = true,
  2960. };
  2961. NameLabel = new MirLabel
  2962. {
  2963. AutoSize = true,
  2964. Parent = this,
  2965. Location = new Point(109, 2),
  2966. NotControl = true,
  2967. };
  2968. ExpLabel = new MirLabel
  2969. {
  2970. AutoSize = true,
  2971. Parent = this,
  2972. Location = new Point(109, 15),
  2973. NotControl = true,
  2974. };
  2975. KeyLabel = new MirLabel
  2976. {
  2977. AutoSize = true,
  2978. Parent = this,
  2979. Location = new Point(2, 2),
  2980. NotControl = true,
  2981. };
  2982. CoolDown = new MirImageControl
  2983. {
  2984. Library = Libraries.Prguse2,
  2985. Parent = this,
  2986. Location = new Point(36, 0),
  2987. Opacity = 0.6F,
  2988. NotControl = true,
  2989. UseOffSet = true,
  2990. };
  2991. }
  2992. public void Update(ClientMagic magic)
  2993. {
  2994. Magic = magic;
  2995. NameLabel.Text = Magic.Name;
  2996. LevelLabel.Text = Magic.Level.ToString();
  2997. switch (Magic.Level)
  2998. {
  2999. case 0:
  3000. ExpLabel.Text = string.Format("{0}/{1}", Magic.Experience, Magic.Need1);
  3001. break;
  3002. case 1:
  3003. ExpLabel.Text = string.Format("{0}/{1}", Magic.Experience, Magic.Need2);
  3004. break;
  3005. case 2:
  3006. ExpLabel.Text = string.Format("{0}/{1}", Magic.Experience, Magic.Need3);
  3007. break;
  3008. case 3:
  3009. ExpLabel.Text = "-";
  3010. break;
  3011. }
  3012. KeyLabel.Text = Magic.Key == 0 ? string.Empty : string.Format("{0}{1}F{2}",
  3013. Prefixes[(Magic.Key - 1) / 8],
  3014. Magic.Key > 8 ? Environment.NewLine : string.Empty,
  3015. (Magic.Key - 1) % 8 + 1);
  3016. switch (magic.Spell)
  3017. { //Warrior
  3018. case Spell.Fencing:
  3019. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FencingSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0);
  3020. break;
  3021. case Spell.Slaying:
  3022. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SlayingSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0);
  3023. break;
  3024. case Spell.Thrusting:
  3025. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ThrustingSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0);
  3026. break;
  3027. case Spell.Rage:
  3028. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.RageSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3029. break;
  3030. case Spell.ProtectionField:
  3031. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ProtectionFieldSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3032. break;
  3033. case Spell.HalfMoon:
  3034. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HalfMoonSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3035. break;
  3036. case Spell.FlamingSword:
  3037. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FlamingSwordSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3038. break;
  3039. case Spell.ShoulderDash:
  3040. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ShoulderDashSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3041. break;
  3042. case Spell.CrossHalfMoon:
  3043. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.CrossHalfMoonSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3044. break;
  3045. case Spell.TwinDrakeBlade:
  3046. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.TwinDrakeBladeSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3047. break;
  3048. case Spell.Entrapment:
  3049. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.EntrapmentSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3050. break;
  3051. case Spell.LionRoar:
  3052. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.LionRoarSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3053. break;
  3054. case Spell.CounterAttack:
  3055. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.CounterAttackSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3056. break;
  3057. case Spell.ImmortalSkin:
  3058. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ImmortalSkinSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3059. break;
  3060. case Spell.Fury:
  3061. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FurySkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3062. break;
  3063. case Spell.SlashingBurst:
  3064. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SlashingBurstSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3065. break;
  3066. case Spell.BladeAvalanche:
  3067. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.BladeAvalancheSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3068. break;
  3069. //Wizard
  3070. case Spell.FireBall:
  3071. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FireballSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3072. break;
  3073. case Spell.ThunderBolt:
  3074. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ThunderboltSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3075. break;
  3076. case Spell.GreatFireBall:
  3077. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.GreatFireballSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3078. break;
  3079. case Spell.Repulsion:
  3080. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.RepulsionSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3081. break;
  3082. case Spell.HellFire:
  3083. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HellfireSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3084. break;
  3085. case Spell.Lightning:
  3086. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.LightningSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3087. break;
  3088. case Spell.ElectricShock:
  3089. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ElectricShockSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3090. break;
  3091. case Spell.Teleport:
  3092. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.TeleportSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3093. break;
  3094. case Spell.FireWall:
  3095. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FireWallSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3096. break;
  3097. case Spell.FireBang:
  3098. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FireBangSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3099. break;
  3100. case Spell.ThunderStorm:
  3101. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ThunderstormSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3102. break;
  3103. case Spell.MagicShield:
  3104. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MagicShieldSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3105. break;
  3106. case Spell.TurnUndead:
  3107. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.TurnUndeadSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3108. break;
  3109. case Spell.IceStorm:
  3110. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.IceStormSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3111. break;
  3112. case Spell.FlameDisruptor:
  3113. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FlameDisruptorSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3114. break;
  3115. case Spell.FrostCrunch:
  3116. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FrostCrunchSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3117. break;
  3118. case Spell.Mirroring:
  3119. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MirroringSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3120. break;
  3121. case Spell.FlameField:
  3122. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FlameFieldSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3123. break;
  3124. case Spell.Vampirism:
  3125. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.VampirismSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3126. break;
  3127. case Spell.Blizzard:
  3128. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.BlizzardSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3129. break;
  3130. case Spell.MeteorStrike:
  3131. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MeteorStrikeSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3132. break;
  3133. case Spell.IceThrust:
  3134. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.IceThrustSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3135. break;
  3136. case Spell.MagicBooster:
  3137. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MagicBoosterSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3138. break;
  3139. case Spell.FastMove:
  3140. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FastMoveSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3141. break;
  3142. case Spell.StormEscape:
  3143. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.StormEscapeSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3144. break;
  3145. case Spell.Blink:
  3146. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.BlinkSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3147. break;
  3148. //Taoist
  3149. case Spell.SpiritSword:
  3150. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SpiritSwordSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3151. break;
  3152. case Spell.Healing:
  3153. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HealingSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3154. break;
  3155. case Spell.Poisoning:
  3156. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.PoisoningSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3157. break;
  3158. case Spell.SoulFireBall:
  3159. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SoulFireBallSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3160. break;
  3161. case Spell.SoulShield:
  3162. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SoulShieldSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3163. break;
  3164. case Spell.BlessedArmour:
  3165. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.BlessedArmourSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3166. break;
  3167. case Spell.TrapHexagon:
  3168. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.TrapHexagonSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3169. break;
  3170. case Spell.SummonSkeleton:
  3171. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SummonSkeletonSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3172. break;
  3173. case Spell.Hiding:
  3174. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HidingSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3175. break;
  3176. case Spell.MassHiding:
  3177. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MassHidingSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3178. break;
  3179. case Spell.Revelation:
  3180. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.RevelationSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3181. break;
  3182. case Spell.MassHealing:
  3183. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MassHealingSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3184. break;
  3185. case Spell.SummonShinsu:
  3186. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SummonShinsuSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3187. break;
  3188. case Spell.UltimateEnhancer:
  3189. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.UltimateEnhancerSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3190. break;
  3191. case Spell.EnergyRepulsor:
  3192. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.EnergyRepulsorSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3193. break;
  3194. case Spell.Purification:
  3195. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.PurificationSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3196. break;
  3197. case Spell.SummonHolyDeva:
  3198. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SummonHolyDevaSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3199. break;
  3200. case Spell.Curse:
  3201. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.CurseSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3202. break;
  3203. case Spell.Hallucination:
  3204. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HallucinationSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3205. break;
  3206. case Spell.Reincarnation:
  3207. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ReincarnationSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3208. break;
  3209. case Spell.PoisonCloud:
  3210. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.PoisonCloudSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3211. break;
  3212. case Spell.EnergyShield:
  3213. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.EnergyShieldSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3214. break;
  3215. case Spell.Plague:
  3216. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.PlagueSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3217. break;
  3218. case Spell.HealingCircle:
  3219. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HealingCircleSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3220. break;
  3221. case Spell.PetEnhancer:
  3222. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.PetEnhancerSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3223. break;
  3224. //Assassin
  3225. case Spell.FatalSword:
  3226. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FatalSwordPassiveSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3227. break;
  3228. case Spell.DoubleSlash:
  3229. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.DoubleSlashToggleSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3230. break;
  3231. case Spell.Haste:
  3232. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HasteBuffSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3233. break;
  3234. case Spell.FlashDash:
  3235. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FlashDashSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3236. break;
  3237. case Spell.HeavenlySword:
  3238. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HeavenlySwordSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3239. break;
  3240. case Spell.FireBurst:
  3241. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FireBurstSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3242. break;
  3243. case Spell.Trap:
  3244. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.TrapSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3245. break;
  3246. case Spell.MoonLight:
  3247. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MoonlightSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3248. break;
  3249. case Spell.MPEater:
  3250. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MPEaterSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3251. break;
  3252. case Spell.SwiftFeet:
  3253. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SwiftFeetSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3254. break;
  3255. case Spell.LightBody:
  3256. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.LightBodySkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3257. break;
  3258. case Spell.PoisonSword:
  3259. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.PoisonSwordSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3260. break;
  3261. case Spell.DarkBody:
  3262. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.DarkBodySkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3263. break;
  3264. case Spell.CrescentSlash:
  3265. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.CrescentSlashSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3266. break;
  3267. case Spell.Hemorrhage:
  3268. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HemorrhageSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3269. break;
  3270. case Spell.MoonMist:
  3271. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MoonMistSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3272. break;
  3273. //Archer
  3274. case Spell.Focus:
  3275. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FocusSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3276. break;
  3277. case Spell.StraightShot:
  3278. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.StraightShotSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3279. break;
  3280. case Spell.DoubleShot:
  3281. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.DoubleShotSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3282. break;
  3283. case Spell.ExplosiveTrap:
  3284. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ExplosiveTrapSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3285. break;
  3286. case Spell.DelayedExplosion:
  3287. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.DelayedExplosionSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3288. break;
  3289. case Spell.Meditation:
  3290. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MeditationSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3291. break;
  3292. case Spell.BackStep:
  3293. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.BackStepSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3294. break;
  3295. case Spell.ElementalShot:
  3296. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ElementalShotSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3297. break;
  3298. case Spell.Concentration:
  3299. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ConcentrationSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3300. break;
  3301. case Spell.Stonetrap:
  3302. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.StoneTrapSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3303. break;
  3304. case Spell.ElementalBarrier:
  3305. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ElementalBarrierSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3306. break;
  3307. case Spell.SummonVampire:
  3308. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SummonVampireSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3309. break;
  3310. case Spell.VampireShot:
  3311. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.VampireShotSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3312. break;
  3313. case Spell.SummonToad:
  3314. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SummonToadSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3315. break;
  3316. case Spell.PoisonShot:
  3317. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.PoisonShotSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3318. break;
  3319. case Spell.CrippleShot:
  3320. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.CrippleShotSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3321. break;
  3322. case Spell.SummonSnakes:
  3323. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SummonSnakesSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3324. break;
  3325. case Spell.NapalmShot:
  3326. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.NapalmShotSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3327. break;
  3328. case Spell.OneWithNature:
  3329. SkillButton.Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.OneWithNatureSkillDescription), Magic.Level, Magic.Level == 0 ? Magic.Level1 : Magic.Level == 1 ? Magic.Level2 : Magic.Level == 2 ? Magic.Level3 : 0, Magic.BaseCost);
  3330. break;
  3331. default:
  3332. break;
  3333. }
  3334. SkillButton.Index = Magic.Icon * 2;
  3335. SkillButton.PressedIndex = Magic.Icon * 2 + 1;
  3336. SetDelay();
  3337. }
  3338. public void SetDelay()
  3339. {
  3340. if (Magic == null) return;
  3341. int totalFrames = 34;
  3342. long timeLeft = Magic.CastTime + Magic.Delay - CMain.Time;
  3343. if (timeLeft < 100)
  3344. {
  3345. CoolDown.Visible = false;
  3346. return;
  3347. }
  3348. int delayPerFrame = (int)(Magic.Delay / totalFrames);
  3349. int startFrame = totalFrames - (int)(timeLeft / delayPerFrame);
  3350. if ((CMain.Time <= Magic.CastTime + Magic.Delay))
  3351. {
  3352. CoolDown.Visible = true;
  3353. CoolDown.Index = 1290 + startFrame;
  3354. }
  3355. }
  3356. }
  3357. public sealed class AssignKeyPanel : MirImageControl
  3358. {
  3359. public MirButton SaveButton, NoneButton;
  3360. public UserObject Actor;
  3361. public MirLabel TitleLabel;
  3362. public MirImageControl MagicImage;
  3363. public MirButton[] FKeys;
  3364. public ClientMagic Magic;
  3365. public byte Key;
  3366. public byte KeyOffset;
  3367. public AssignKeyPanel(ClientMagic magic, byte keyOffset, string[] keyStrings)
  3368. {
  3369. Magic = magic;
  3370. Key = magic.Key;
  3371. KeyOffset = keyOffset;
  3372. Modal = true;
  3373. Index = 710;
  3374. Library = Libraries.Prguse;
  3375. Location = Center;
  3376. Parent = GameScene.Scene;
  3377. Visible = true;
  3378. MagicImage = new MirImageControl
  3379. {
  3380. Location = new Point(16, 16),
  3381. Index = magic.Icon * 2,
  3382. Library = Libraries.MagIcon2,
  3383. Parent = this,
  3384. };
  3385. TitleLabel = new MirLabel
  3386. {
  3387. Location = new Point(49, 17),
  3388. Parent = this,
  3389. Size = new Size(230, 32),
  3390. DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.WordBreak,
  3391. Text = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SelectKey), magic.Name)
  3392. };
  3393. NoneButton = new MirButton
  3394. {
  3395. Index = 287, //154
  3396. HoverIndex = 288,
  3397. PressedIndex = 289,
  3398. Library = Libraries.Title,
  3399. Parent = this,
  3400. Location = new Point(284, 64),
  3401. };
  3402. NoneButton.Click += (o, e) => Key = 0;
  3403. SaveButton = new MirButton
  3404. {
  3405. Library = Libraries.Title,
  3406. Parent = this,
  3407. Location = new Point(284, 101),
  3408. Index = 156,
  3409. HoverIndex = 157,
  3410. PressedIndex = 158,
  3411. };
  3412. SaveButton.Click += (o, e) =>
  3413. {
  3414. for (int i = 0; i < Actor.Magics.Count; i++)
  3415. {
  3416. if (Actor.Magics[i].Key == Key)
  3417. Actor.Magics[i].Key = 0;
  3418. }
  3419. Network.Enqueue(new C.MagicKey { Spell = Magic.Spell, Key = Key, OldKey = Magic.Key });
  3420. Magic.Key = Key;
  3421. foreach (SkillBarDialog Bar in GameScene.Scene.SkillBarDialogs)
  3422. Bar.Update();
  3423. Dispose();
  3424. };
  3425. FKeys = new MirButton[keyStrings.Length];
  3426. for (byte i = 0; i < FKeys.Length; i++)
  3427. {
  3428. FKeys[i] = new MirButton
  3429. {
  3430. Index = 0,
  3431. PressedIndex = 1,
  3432. Library = Libraries.Prguse,
  3433. Parent = this,
  3434. Location = new Point(17 + 32 * (i % 8) + 5 * (i % 8 / 4), 58 + 37 * (i / 8)),
  3435. Sound = SoundList.ButtonA,
  3436. Text = keyStrings[i]
  3437. };
  3438. int num = i + keyOffset;
  3439. FKeys[i].Click += (o, e) =>
  3440. {
  3441. Key = (byte)num;
  3442. };
  3443. }
  3444. BeforeDraw += AssignKeyPanel_BeforeDraw;
  3445. }
  3446. private void AssignKeyPanel_BeforeDraw(object sender, EventArgs e)
  3447. {
  3448. for (int i = 0; i < FKeys.Length; i++)
  3449. {
  3450. FKeys[i].Index = 1656;
  3451. FKeys[i].HoverIndex = 1657;
  3452. FKeys[i].PressedIndex = 1658;
  3453. FKeys[i].Visible = true;
  3454. }
  3455. int key = Key - KeyOffset;
  3456. if (key < 0 || key > FKeys.Length) return;
  3457. FKeys[key].Index = 1658;
  3458. FKeys[key].HoverIndex = 1658;
  3459. FKeys[key].PressedIndex = 1658;
  3460. }
  3461. }
  3462. public sealed class DuraStatusDialog : MirImageControl
  3463. {
  3464. public MirButton Character;
  3465. public DuraStatusDialog()
  3466. {
  3467. Size = new Size(40, 19);
  3468. Location = new Point((GameScene.Scene.MiniMapDialog.Location.X + 86), GameScene.Scene.MiniMapDialog.Size.Height);
  3469. Character = new MirButton()
  3470. {
  3471. Index = 2113,
  3472. Library = Libraries.Prguse,
  3473. Parent = this,
  3474. Size = new Size(20, 19),
  3475. Location = new Point(20, 0),
  3476. HoverIndex = 2111,
  3477. PressedIndex = 2112,
  3478. Sound = SoundList.ButtonA,
  3479. Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.DuraPanel)
  3480. };
  3481. Character.Click += (o, e) =>
  3482. {
  3483. if (GameScene.Scene.CharacterDuraPanel.Visible == true)
  3484. {
  3485. GameScene.Scene.CharacterDuraPanel.Hide();
  3486. Settings.DuraView = false;
  3487. }
  3488. else
  3489. {
  3490. GameScene.Scene.CharacterDuraPanel.Show();
  3491. Settings.DuraView = true;
  3492. }
  3493. };
  3494. }
  3495. }
  3496. public sealed class CharacterDuraPanel : MirImageControl
  3497. {
  3498. public MirImageControl GrayBackground, Background, Helmet, Armour, Belt, Boots, Weapon, Necklace, RightBracelet, LeftBracelet, RightRing, LeftRing, Torch, Stone, Amulet, Mount, Item1, Item2;
  3499. public CharacterDuraPanel()
  3500. {
  3501. Index = 2105;
  3502. Library = Libraries.Prguse;
  3503. Movable = false;
  3504. Location = new Point(Settings.ScreenWidth - 61, 200);
  3505. GrayBackground = new MirImageControl()
  3506. {
  3507. Index = 2161,
  3508. Library = Libraries.Prguse,
  3509. Parent = this,
  3510. Size = new Size(56, 80),
  3511. Location = new Point(3, 3),
  3512. Opacity = 0.4F
  3513. };
  3514. Background = new MirImageControl()
  3515. {
  3516. Index = 2162,
  3517. Library = Libraries.Prguse,
  3518. Parent = this,
  3519. Size = new Size(56, 80),
  3520. Location = new Point(3, 3),
  3521. };
  3522. #region Pieces
  3523. Helmet = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(24, 3) };
  3524. Belt = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 7), Location = new Point(23, 23) };
  3525. Armour = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(28, 32), Location = new Point(16, 11) };
  3526. Boots = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(24, 9), Location = new Point(17, 43) };
  3527. Weapon = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 33), Location = new Point(4, 5) };
  3528. Necklace = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(3, 67) };
  3529. LeftBracelet = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 8), Location = new Point(3, 43) };
  3530. RightBracelet = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 8), Location = new Point(43, 43) };
  3531. LeftRing = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(3, 54) };
  3532. RightRing = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(43, 54) };
  3533. Torch = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(8, 32), Location = new Point(44, 5) };
  3534. Stone = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(30, 54) };
  3535. Amulet = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(16, 54) };
  3536. Mount = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(43, 68) };
  3537. Item1 = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(8, 12), Location = new Point(19, 67) };
  3538. Item2 = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(8, 12), Location = new Point(31, 67) };
  3539. #endregion
  3540. }
  3541. public void GetCharacterDura()
  3542. {
  3543. if (GameScene.Scene.CharacterDialog.Grid[0].Item == null) { Weapon.Index = -1; }
  3544. if (GameScene.Scene.CharacterDialog.Grid[1].Item == null) { Armour.Index = -1; }
  3545. if (GameScene.Scene.CharacterDialog.Grid[2].Item == null) { Helmet.Index = -1; }
  3546. if (GameScene.Scene.CharacterDialog.Grid[3].Item == null) { Torch.Index = -1; }
  3547. if (GameScene.Scene.CharacterDialog.Grid[4].Item == null) { Necklace.Index = -1; }
  3548. if (GameScene.Scene.CharacterDialog.Grid[5].Item == null) { LeftBracelet.Index = -1; }
  3549. if (GameScene.Scene.CharacterDialog.Grid[6].Item == null) { RightBracelet.Index = -1; }
  3550. if (GameScene.Scene.CharacterDialog.Grid[7].Item == null) { LeftRing.Index = -1; }
  3551. if (GameScene.Scene.CharacterDialog.Grid[8].Item == null) { RightRing.Index = -1; }
  3552. if (GameScene.Scene.CharacterDialog.Grid[9].Item == null) { Amulet.Index = -1; }
  3553. if (GameScene.Scene.CharacterDialog.Grid[10].Item == null) { Belt.Index = -1; }
  3554. if (GameScene.Scene.CharacterDialog.Grid[11].Item == null) { Boots.Index = -1; }
  3555. if (GameScene.Scene.CharacterDialog.Grid[12].Item == null) { Stone.Index = -1; }
  3556. for (int i = 0; i < MapObject.User.Equipment.Length; i++)
  3557. {
  3558. if (MapObject.User.Equipment[i] == null) continue;
  3559. UpdateCharacterDura(MapObject.User.Equipment[i]);
  3560. }
  3561. }
  3562. public void UpdateCharacterDura(UserItem item)
  3563. {
  3564. int Warning = item.MaxDura / 2;
  3565. int Danger = item.MaxDura / 5;
  3566. ushort AmuletWarning = (ushort)(item.Info.StackSize / 2);
  3567. ushort AmuletDanger = (ushort)(item.Info.StackSize / 5);
  3568. switch (item.Info.Type)
  3569. {
  3570. case ItemType.Amulet: //Based on stacks of 5000
  3571. if (item.Count > AmuletWarning)
  3572. Amulet.Index = 2134;
  3573. if (item.Count <= AmuletWarning)
  3574. Amulet.Index = 2135;
  3575. if (item.Count <= AmuletDanger)
  3576. Amulet.Index = 2136;
  3577. if (item.Count == 0)
  3578. Amulet.Index = -1;
  3579. break;
  3580. case ItemType.Armour:
  3581. if (item.CurrentDura > Warning)
  3582. Armour.Index = 2149;
  3583. if (item.CurrentDura <= Warning)
  3584. Armour.Index = 2150;
  3585. if (item.CurrentDura <= Danger)
  3586. Armour.Index = 2151;
  3587. if (item.CurrentDura == 0)
  3588. Armour.Index = -1;
  3589. break;
  3590. case ItemType.Belt:
  3591. if (item.CurrentDura > Warning)
  3592. Belt.Index = 2158;
  3593. if (item.CurrentDura <= Warning)
  3594. Belt.Index = 2159;
  3595. if (item.CurrentDura <= Danger)
  3596. Belt.Index = 2160;
  3597. if (item.CurrentDura == 0)
  3598. Belt.Index = -1;
  3599. break;
  3600. case ItemType.Boots:
  3601. if (item.CurrentDura > Warning)
  3602. Boots.Index = 2152;
  3603. if (item.CurrentDura <= Warning)
  3604. Boots.Index = 2153;
  3605. if (item.CurrentDura <= Danger)
  3606. Boots.Index = 2154;
  3607. if (item.CurrentDura == 0)
  3608. Boots.Index = -1;
  3609. break;
  3610. case ItemType.Bracelet:
  3611. if (GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.BraceletR].Item != null && item.UniqueID == GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.BraceletR].Item.UniqueID)
  3612. {
  3613. if (item.CurrentDura > Warning)
  3614. RightBracelet.Index = 2143;
  3615. if (item.CurrentDura <= Warning)
  3616. RightBracelet.Index = 2144;
  3617. if (item.CurrentDura <= Danger)
  3618. RightBracelet.Index = 2145;
  3619. if (item.CurrentDura == 0)
  3620. RightBracelet.Index = -1;
  3621. }
  3622. else if (GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.BraceletL].Item != null && item.UniqueID == GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.BraceletL].Item.UniqueID)
  3623. {
  3624. if (item.CurrentDura > Warning)
  3625. LeftBracelet.Index = 2143;
  3626. if (item.CurrentDura <= Warning)
  3627. LeftBracelet.Index = 2144;
  3628. if (item.CurrentDura <= Danger)
  3629. LeftBracelet.Index = 2145;
  3630. if (item.CurrentDura == 0)
  3631. LeftBracelet.Index = -1;
  3632. }
  3633. break;
  3634. case ItemType.Helmet:
  3635. if (item.CurrentDura > Warning)
  3636. Helmet.Index = 2155;
  3637. if (item.CurrentDura <= Warning)
  3638. Helmet.Index = 2156;
  3639. if (item.CurrentDura <= Danger)
  3640. Helmet.Index = 2157;
  3641. if (item.CurrentDura == 0)
  3642. Helmet.Index = -1;
  3643. break;
  3644. case ItemType.Necklace:
  3645. if (item.CurrentDura > Warning)
  3646. Necklace.Index = 2122;
  3647. if (item.CurrentDura <= Warning)
  3648. Necklace.Index = 2123;
  3649. if (item.CurrentDura <= Danger)
  3650. Necklace.Index = 2124;
  3651. if (item.CurrentDura == 0)
  3652. Necklace.Index = -1;
  3653. break;
  3654. case ItemType.Ring:
  3655. if (GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.RingR].Item != null && item.UniqueID == GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.RingR].Item.UniqueID)
  3656. {
  3657. if (item.CurrentDura > Warning)
  3658. RightRing.Index = 2131;
  3659. if (item.CurrentDura <= Warning)
  3660. RightRing.Index = 2132;
  3661. if (item.CurrentDura <= Danger)
  3662. RightRing.Index = 2133;
  3663. if (item.CurrentDura == 0)
  3664. RightRing.Index = -1;
  3665. }
  3666. else if (GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.RingL].Item != null && item.UniqueID == GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.RingL].Item.UniqueID)
  3667. {
  3668. if (item.CurrentDura > Warning)
  3669. LeftRing.Index = 2131;
  3670. if (item.CurrentDura <= Warning)
  3671. LeftRing.Index = 2132;
  3672. if (item.CurrentDura <= Danger)
  3673. LeftRing.Index = 2133;
  3674. if (item.CurrentDura == 0)
  3675. LeftRing.Index = -1;
  3676. }
  3677. break;
  3678. case ItemType.Stone:
  3679. if (item.CurrentDura == 0)
  3680. Stone.Index = 2137;
  3681. break;
  3682. case ItemType.Mount:
  3683. if (item.CurrentDura > Warning)
  3684. Mount.Index = 2140;
  3685. if (item.CurrentDura <= Warning)
  3686. Mount.Index = 2141;
  3687. if (item.CurrentDura <= Danger)
  3688. Mount.Index = 2142;
  3689. if (item.CurrentDura == 0)
  3690. Mount.Index = -1;
  3691. break;
  3692. case ItemType.Torch:
  3693. if (item.CurrentDura > Warning)
  3694. Torch.Index = 2146;
  3695. if (item.CurrentDura <= Warning)
  3696. Torch.Index = 2147;
  3697. if (item.CurrentDura <= Danger)
  3698. Torch.Index = 2148;
  3699. if (item.CurrentDura == 0)
  3700. Torch.Index = -1;
  3701. break;
  3702. case ItemType.Weapon:
  3703. if (item.CurrentDura > Warning)
  3704. Weapon.Index = 2125;
  3705. if (item.CurrentDura <= Warning)
  3706. Weapon.Index = 2126;
  3707. if (item.CurrentDura <= Danger)
  3708. Weapon.Index = 2127;
  3709. if (item.CurrentDura == 0)
  3710. Weapon.Index = -1;
  3711. break;
  3712. }
  3713. }
  3714. public override void Hide()
  3715. {
  3716. if (!Visible) return;
  3717. Visible = false;
  3718. GameScene.Scene.DuraStatusPanel.Character.Index = 2113;
  3719. }
  3720. public override void Show()
  3721. {
  3722. if (Visible) return;
  3723. Visible = true;
  3724. GameScene.Scene.DuraStatusPanel.Character.Index = 2110;
  3725. GetCharacterDura();
  3726. }
  3727. }
  3728. }