| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183 |
- using System.Text.RegularExpressions;
- using Client.MirControls;
- using Client.MirGraphics;
- using Client.MirNetwork;
- using Client.MirObjects;
- using Client.MirSounds;
- using SlimDX;
- using Font = System.Drawing.Font;
- using C = ClientPackets;
- namespace Client.MirScenes.Dialogs
- {
- public sealed class MainDialog : MirImageControl
- {
- public static UserObject User
- {
- get { return MapObject.User; }
- set { MapObject.User = value; }
- }
- public MirImageControl ExperienceBar, WeightBar, LeftCap, RightCap;
- public MirButton GameShopButton, MenuButton, InventoryButton, CharacterButton, SkillButton, QuestButton, OptionButton;
- public MirControl HealthOrb;
- public MirLabel HealthLabel, ManaLabel, TopLabel, BottomLabel, LevelLabel, CharacterName, ExperienceLabel, GoldLabel, WeightLabel, SpaceLabel, AModeLabel, PModeLabel, SModeLabel;
- public HeroInfoPanel HeroInfoPanel;
- public HeroBehaviourPanel HeroBehaviourPanel;
- public MirButton HeroMenuButton, HeroSummonButton;
- public bool HPOnly
- {
- get { return User != null && User.Class == MirClass.Warrior && User.Level < 26; }
- }
- public MainDialog()
- {
- Index = Settings.Resolution == 800 ? 0 : Settings.Resolution == 1024 ? 1 : 2;
- Library = Libraries.Prguse;
- Location = new Point(((Settings.ScreenWidth / 2) - (Size.Width / 2)), Settings.ScreenHeight - Size.Height);
- PixelDetect = true;
- LeftCap = new MirImageControl
- {
- Index = 12,
- Library = Libraries.Prguse,
- Location = new Point(-67, this.Size.Height - 96),
- Parent = this,
- Visible = false
- };
- RightCap = new MirImageControl
- {
- Index = 13,
- Library = Libraries.Prguse,
- Location = new Point(1024, this.Size.Height - 104),
- Parent = this,
- Visible = false
- };
- if (Settings.Resolution > 1024)
- {
- LeftCap.Visible = true;
- RightCap.Visible = true;
- }
- InventoryButton = new MirButton
- {
- HoverIndex = 1904,
- Index = 1903,
- Library = Libraries.Prguse,
- Location = new Point(this.Size.Width - 96, 76),
- Parent = this,
- PressedIndex = 1905,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.InventoryKey), CMain.InputKeys.GetKey(KeybindOptions.Inventory))
- };
- InventoryButton.Click += (o, e) =>
- {
- if (GameScene.Scene.InventoryDialog.Visible)
- GameScene.Scene.InventoryDialog.Hide();
- else
- GameScene.Scene.InventoryDialog.Show();
- };
- CharacterButton = new MirButton
- {
- HoverIndex = 1901,
- Index = 1900,
- Library = Libraries.Prguse,
- Location = new Point(this.Size.Width - 119, 76),
- Parent = this,
- PressedIndex = 1902,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.CharacterKey), CMain.InputKeys.GetKey(KeybindOptions.Equipment))
- };
- CharacterButton.Click += (o, e) =>
- {
- if (GameScene.Scene.CharacterDialog.Visible && GameScene.Scene.CharacterDialog.CharacterPage.Visible)
- GameScene.Scene.CharacterDialog.Hide();
- else
- {
- GameScene.Scene.CharacterDialog.Show();
- GameScene.Scene.CharacterDialog.ShowCharacterPage();
- }
- };
- SkillButton = new MirButton
- {
- HoverIndex = 1907,
- Index = 1906,
- Library = Libraries.Prguse,
- Location = new Point(this.Size.Width - 73, 76),
- Parent = this,
- PressedIndex = 1908,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SkillsKey), CMain.InputKeys.GetKey(KeybindOptions.Skills))
- };
- SkillButton.Click += (o, e) =>
- {
- if (GameScene.Scene.CharacterDialog.Visible && GameScene.Scene.CharacterDialog.SkillPage.Visible)
- GameScene.Scene.CharacterDialog.Hide();
- else
- {
- GameScene.Scene.CharacterDialog.Show();
- GameScene.Scene.CharacterDialog.ShowSkillPage();
- }
- };
- QuestButton = new MirButton
- {
- HoverIndex = 1910,
- Index = 1909,
- Library = Libraries.Prguse,
- Location = new Point(this.Size.Width - 50, 76),
- Parent = this,
- PressedIndex = 1911,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.QuestsKey), CMain.InputKeys.GetKey(KeybindOptions.Quests))
- };
- QuestButton.Click += (o, e) =>
- {
- if (!GameScene.Scene.QuestLogDialog.Visible)
- GameScene.Scene.QuestLogDialog.Show();
- else GameScene.Scene.QuestLogDialog.Hide();
- };
- OptionButton = new MirButton
- {
- HoverIndex = 1913,
- Index = 1912,
- Library = Libraries.Prguse,
- Location = new Point(this.Size.Width - 27, 76),
- Parent = this,
- PressedIndex = 1914,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.OptionsKey), CMain.InputKeys.GetKey(KeybindOptions.Options))
- };
- OptionButton.Click += (o, e) =>
- {
- if (!GameScene.Scene.OptionDialog.Visible)
- GameScene.Scene.OptionDialog.Show();
- else GameScene.Scene.OptionDialog.Hide();
- };
- MenuButton = new MirButton
- {
- HoverIndex = 1961,
- Index = 1960,
- Library = Libraries.Prguse,
- Location = new Point(this.Size.Width - 55, 35),
- Parent = this,
- PressedIndex = 1962,
- Sound = SoundList.ButtonC,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Menu)
- };
- MenuButton.Click += (o, e) =>
- {
- if (!GameScene.Scene.MenuDialog.Visible) GameScene.Scene.MenuDialog.Show();
- else GameScene.Scene.MenuDialog.Hide();
- };
- GameShopButton = new MirButton
- {
- HoverIndex = 827,
- Index = 826,
- Library = Libraries.Prguse,
- Location = new Point(this.Size.Width - 105, 35),
- Parent = this,
- PressedIndex = 828,
- Sound = SoundList.ButtonC,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.GameShopKey), CMain.InputKeys.GetKey(KeybindOptions.GameShop))
- };
- GameShopButton.Click += (o, e) =>
- {
- if (!GameScene.Scene.GameShopDialog.Visible) GameScene.Scene.GameShopDialog.Show();
- else GameScene.Scene.GameShopDialog.Hide();
- };
- HealthOrb = new MirControl
- {
- Parent = this,
- Location = new Point(0, 30),
- NotControl = true,
- };
- HealthOrb.BeforeDraw += HealthOrb_BeforeDraw;
- HealthLabel = new MirLabel
- {
- AutoSize = true,
- Location = new Point(0, 27),
- Parent = HealthOrb
- };
- HealthLabel.SizeChanged += Label_SizeChanged;
- ManaLabel = new MirLabel
- {
- AutoSize = true,
- Location = new Point(0, 42),
- Parent = HealthOrb
- };
- ManaLabel.SizeChanged += Label_SizeChanged;
- TopLabel = new MirLabel
- {
- Size = new Size(85, 30),
- DrawFormat = TextFormatFlags.HorizontalCenter,
- Location = new Point(9, 20),
- Parent = HealthOrb,
- };
- BottomLabel = new MirLabel
- {
- Size = new Size(85, 30),
- DrawFormat = TextFormatFlags.HorizontalCenter,
- Location = new Point(9, 50),
- Parent = HealthOrb,
- };
- LevelLabel = new MirLabel
- {
- AutoSize = true,
- Parent = this,
- Location = new Point(5, 108)
- };
- CharacterName = new MirLabel
- {
- DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
- Parent = this,
- Location = new Point(6, 120),
- Size = new Size(90, 16)
- };
- ExperienceBar = new MirImageControl
- {
- Index = Settings.Resolution != 800 ? 8 : 7,
- Library = Libraries.Prguse,
- Location = new Point(9, 143),
- Parent = this,
- DrawImage = false,
- NotControl = true,
- };
- ExperienceBar.BeforeDraw += ExperienceBar_BeforeDraw;
- ExperienceLabel = new MirLabel
- {
- AutoSize = true,
- Parent = ExperienceBar,
- NotControl = true,
- };
- GoldLabel = new MirLabel
- {
- DrawFormat = TextFormatFlags.VerticalCenter,
- Font = new Font(Settings.FontName, 8F),
- Location = new Point(this.Size.Width - 105, 119),
- Parent = this,
- Size = new Size(99, 13),
- Sound = SoundList.Gold,
- };
- GoldLabel.Click += (o, e) =>
- {
- if (GameScene.SelectedCell == null)
- GameScene.PickedUpGold = !GameScene.PickedUpGold && GameScene.Gold > 0;
- };
- WeightBar = new MirImageControl
- {
- Index = 76,
- Library = Libraries.Prguse,
- Location = new Point(this.Size.Width - 105, 103),
- Parent = this,
- DrawImage = false,
- NotControl = true,
- };
- WeightBar.BeforeDraw += WeightBar_BeforeDraw;
- WeightLabel = new MirLabel
- {
- Parent = this,
- Location = new Point(this.Size.Width - 105, 101),
- Size = new Size(40, 14),
- };
- SpaceLabel = new MirLabel
- {
- Parent = this,
- Location = new Point(this.Size.Width - 30, 101),
- Size = new Size(26, 14),
- };
- HeroMenuButton = new MirButton
- {
- Index = 2164,
- HoverIndex = 2165,
- PressedIndex = 2166,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(Size.Width - 160, 65),
- Size = new Size(20, 20),
- Sound = SoundList.ButtonA,
- Visible = false
- };
- HeroMenuButton.Click += (o, e) =>
- {
- GameScene.Scene.HeroMenuPanel.Toggle();
- };
- HeroSummonButton = new MirButton
- {
- Index = 2167,
- HoverIndex = 2168,
- PressedIndex = 2169,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(this.Size.Width - 160, 90),
- Size = new Size(20, 20),
- Sound = SoundList.ButtonA,
- Visible = false
- };
- HeroSummonButton.Click += (o, e) =>
- {
- Network.Enqueue(new C.Chat
- {
- Message = "@SUMMONHERO",
- });
- };
- HeroInfoPanel = new HeroInfoPanel { Parent = this, Visible = false };
- AModeLabel = new MirLabel
- {
- AutoSize = true,
- ForeColour = Color.Yellow,
- OutLineColour = Color.Black,
- Parent = this,
- Location = new Point(Settings.Resolution != 800 ? 899 : 675, Settings.Resolution != 800 ? -448 : -280),
- Visible = Settings.ModeView
- };
- PModeLabel = new MirLabel
- {
- AutoSize = true,
- ForeColour = Color.Orange,
- OutLineColour = Color.Black,
- Parent = this,
- Location = new Point(230, 125),
- Visible = Settings.ModeView
- };
- SModeLabel = new MirLabel
- {
- AutoSize = true,
- ForeColour = Color.LimeGreen,
- OutLineColour = Color.Black,
- Parent = this,
- Location = new Point(Settings.Resolution != 800 ? 899 : 675, Settings.Resolution != 800 ? -463 : -295),
- Visible = Settings.ModeView
- };
- }
- public void Process()
- {
- switch (GameScene.Scene.AMode)
- {
- case AttackMode.Peace:
- AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_Peace);
- break;
- case AttackMode.Group:
- AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_Group);
- break;
- case AttackMode.Guild:
- AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_Guild);
- break;
- case AttackMode.EnemyGuild:
- AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_EnemyGuild);
- break;
- case AttackMode.RedBrown:
- AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_RedBrown);
- break;
- case AttackMode.All:
- AModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AttackMode_All);
- break;
- }
- switch (GameScene.Scene.PMode)
- {
- case PetMode.Both:
- PModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PetMode_Both);
- break;
- case PetMode.MoveOnly:
- PModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PetMode_MoveOnly);
- break;
- case PetMode.AttackOnly:
- PModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PetMode_AttackOnly);
- break;
- case PetMode.None:
- PModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PetMode_None);
- break;
- case PetMode.FocusMasterTarget:
- PModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PetMode_FocusMasterTarget);
- break;
- }
- switch (Settings.SkillMode)
- {
- case true:
- SModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.SkillModeTilde);
- break;
- case false:
- SModeLabel.Text = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.SkillModeCtrl);
- break;
- }
- if (Settings.HPView)
- {
- HealthLabel.Text = string.Format("HP {0}/{1}", User.HP, User.Stats[Stat.HP]);
- ManaLabel.Text = HPOnly ? "" : string.Format("MP {0}/{1} ", User.MP, User.Stats[Stat.MP]);
- TopLabel.Text = string.Empty;
- BottomLabel.Text = string.Empty;
- }
- else
- {
- if (HPOnly)
- {
- TopLabel.Text = string.Format("{0}\n" + "--", User.HP);
- BottomLabel.Text = string.Format("{0}", User.Stats[Stat.HP]);
- }
- else
- {
- TopLabel.Text = string.Format(" {0} {1} \n" + "---------------", User.HP, User.MP);
- BottomLabel.Text = string.Format(" {0} {1} ", User.Stats[Stat.HP], User.Stats[Stat.MP]);
- }
- HealthLabel.Text = string.Empty;
- ManaLabel.Text = string.Empty;
- }
- LevelLabel.Text = User.Level.ToString();
- ExperienceLabel.Text = string.Format("{0:#0.##%}", User.Experience / (double)User.MaxExperience);
- ExperienceLabel.Location = new Point((ExperienceBar.Size.Width / 2) - 20, -10);
- GoldLabel.Text = GameScene.Gold.ToString("###,###,##0");
- CharacterName.Text = User.Name;
- SpaceLabel.Text = User.Inventory.Count(t => t == null).ToString();
- WeightLabel.Text = (MapObject.User.Stats[Stat.BagWeight] - MapObject.User.CurrentBagWeight).ToString();
- }
- private void Label_SizeChanged(object sender, EventArgs e)
- {
- if (!(sender is MirLabel l)) return;
- l.Location = new Point(50 - (l.Size.Width / 2), l.Location.Y);
- }
- private void HealthOrb_BeforeDraw(object sender, EventArgs e)
- {
- if (Libraries.Prguse == null) return;
- int height;
- if (User != null && User.HP != User.Stats[Stat.HP])
- height = (int)(80 * User.HP / (float)User.Stats[Stat.HP]);
- else
- height = 80;
- if (height < 0) height = 0;
- if (height > 80) height = 80;
- int orbImage = 4;
- bool hpOnly = false;
- if (HPOnly)
- {
- hpOnly = true;
- orbImage = 6;
- }
- Rectangle r = new Rectangle(0, 80 - height, hpOnly ? 100 : 50, height);
- Libraries.Prguse.Draw(orbImage, r, new Point(((Settings.ScreenWidth / 2) - (Size.Width / 2)), HealthOrb.DisplayLocation.Y + 80 - height), Color.White, false);
- if (hpOnly) return;
- if (User.MP != User.Stats[Stat.MP])
- height = (int)(80 * User.MP / (float)User.Stats[Stat.MP]);
- else
- height = 80;
- if (height < 0) height = 0;
- if (height > 80) height = 80;
- r = new Rectangle(51, 80 - height, 50, height);
- Libraries.Prguse.Draw(4, r, new Point(((Settings.ScreenWidth / 2) - (Size.Width / 2)) + 51, HealthOrb.DisplayLocation.Y + 80 - height), Color.White, false);
- }
- private void ExperienceBar_BeforeDraw(object sender, EventArgs e)
- {
- if (ExperienceBar.Library == null) return;
- double percent = MapObject.User.Experience / (double)MapObject.User.MaxExperience;
- if (percent > 1) percent = 1;
- if (percent <= 0) return;
- Rectangle section = new Rectangle
- {
- Size = new Size((int)((ExperienceBar.Size.Width - 3) * percent), ExperienceBar.Size.Height)
- };
- ExperienceBar.Library.Draw(ExperienceBar.Index, section, ExperienceBar.DisplayLocation, Color.White, false);
- }
- private void WeightBar_BeforeDraw(object sender, EventArgs e)
- {
- if (WeightBar.Library == null) return;
- double percent = MapObject.User.CurrentBagWeight / (double)MapObject.User.Stats[Stat.BagWeight];
- if (percent > 1) percent = 1;
- if (percent <= 0) return;
- // Weight bar art based on fill
- if (percent <= 0.50)
- {
- WeightBar.Library = Libraries.Prguse;
- WeightBar.Index = 76;
- }
- else if (percent <= 0.75)
- {
- WeightBar.Library = Libraries.UI_32bit;
- WeightBar.Index = 473;
- }
- else
- {
- WeightBar.Library = Libraries.UI_32bit;
- WeightBar.Index = 472;
- }
- Rectangle section = new Rectangle
- {
- Size = new Size((int)((WeightBar.Size.Width - 2) * percent), WeightBar.Size.Height)
- };
- WeightBar.Library.Draw(WeightBar.Index, section, WeightBar.DisplayLocation, Color.White, false);
- }
- }
- public sealed class ChatDialog : MirImageControl
- {
- public List<ChatHistory> FullHistory = new List<ChatHistory>();
- public List<ChatHistory> History = new List<ChatHistory>();
- public List<MirLabel> ChatLines = new List<MirLabel>();
- public List<ChatItem> LinkedItems = new List<ChatItem>();
- public List<MirLabel> LinkedItemButtons = new List<MirLabel>();
- public MirButton HomeButton, UpButton, EndButton, DownButton, PositionBar;
- public MirImageControl CountBar;
- public MirTextBox ChatTextBox;
- public Font ChatFont = new Font(Settings.FontName, 8F);
- public string LastPM = string.Empty;
- public int StartIndex, LineCount = 4, WindowSize;
- public string ChatPrefix = "";
- public bool Transparent;
- public ChatDialog()
- {
- Index = Settings.Resolution != 800 ? 2221 : 2201;
- Library = Libraries.Prguse;
- Location = new Point(GameScene.Scene.MainDialog.Location.X + 230, Settings.ScreenHeight - 97);
- PixelDetect = true;
- KeyPress += ChatPanel_KeyPress;
- KeyDown += ChatPanel_KeyDown;
- MouseWheel += ChatPanel_MouseWheel;
- ChatTextBox = new MirTextBox
- {
- BackColour = Color.DarkGray,
- ForeColour = Color.Black,
- Parent = this,
- Size = new Size(Settings.Resolution != 800 ? 627 : 403, 13),
- Location = new Point(1, 54),
- MaxLength = Globals.MaxChatLength,
- Visible = false,
- Font = ChatFont,
- };
- ChatTextBox.TextBox.KeyPress += ChatTextBox_KeyPress;
- ChatTextBox.TextBox.KeyDown += ChatTextBox_KeyDown;
- ChatTextBox.TextBox.KeyUp += ChatTextBox_KeyUp;
- HomeButton = new MirButton
- {
- Index = 2018,
- HoverIndex = 2019,
- Library = Libraries.Prguse,
- Location = new Point(Settings.Resolution != 800 ? 618 : 394, 1),
- Parent = this,
- PressedIndex = 2020,
- Sound = SoundList.ButtonA,
- };
- HomeButton.Click += (o, e) =>
- {
- if (StartIndex == 0) return;
- StartIndex = 0;
- Update();
- };
- UpButton = new MirButton
- {
- Index = 2021,
- HoverIndex = 2022,
- Library = Libraries.Prguse,
- Location = new Point(Settings.Resolution != 800 ? 618 : 394, 9),
- Parent = this,
- PressedIndex = 2023,
- Sound = SoundList.ButtonA,
- };
- UpButton.Click += (o, e) =>
- {
- if (StartIndex == 0) return;
- StartIndex--;
- Update();
- };
- EndButton = new MirButton
- {
- Index = 2027,
- HoverIndex = 2028,
- Library = Libraries.Prguse,
- Location = new Point(Settings.Resolution != 800 ? 618 : 394, 45),
- Parent = this,
- PressedIndex = 2029,
- Sound = SoundList.ButtonA,
- };
- EndButton.Click += (o, e) =>
- {
- if (StartIndex == History.Count - 1) return;
- StartIndex = History.Count - 1;
- Update();
- };
- DownButton = new MirButton
- {
- Index = 2024,
- HoverIndex = 2025,
- Library = Libraries.Prguse,
- Location = new Point(Settings.Resolution != 800 ? 618 : 394, 39),
- Parent = this,
- PressedIndex = 2026,
- Sound = SoundList.ButtonA,
- };
- DownButton.Click += (o, e) =>
- {
- if (StartIndex == History.Count - 1) return;
- StartIndex++;
- Update();
- };
- CountBar = new MirImageControl
- {
- Index = 2012,
- Library = Libraries.Prguse,
- Location = new Point(Settings.Resolution != 800 ? 622 : 398, 16),
- Parent = this,
- };
- PositionBar = new MirButton
- {
- Index = 2015,
- HoverIndex = 2016,
- Library = Libraries.Prguse,
- Location = new Point(Settings.Resolution != 800 ? 619 : 395, 16),
- Parent = this,
- PressedIndex = 2017,
- Movable = true,
- Sound = SoundList.None,
- };
- PositionBar.OnMoving += PositionBar_OnMoving;
- }
- public void SetChatText(string newText)
- {
- string newMsg = ChatTextBox.Text += newText;
- if (newMsg.Length > Globals.MaxChatLength) return;
- ChatTextBox.Text = newMsg;
- ChatTextBox.SetFocus();
- ChatTextBox.Visible = true;
- ChatTextBox.TextBox.SelectionLength = 0;
- ChatTextBox.TextBox.SelectionStart = ChatTextBox.Text.Length;
- }
- private void ChatTextBox_KeyPress(object sender, KeyPressEventArgs e)
- {
- switch (e.KeyChar)
- {
- case (char)Keys.Enter:
- e.Handled = true;
- if (!string.IsNullOrEmpty(ChatTextBox.Text))
- {
- string msg = ChatTextBox.Text;
- if (msg.ToUpper() == "@LEVELEFFECT")
- {
- Settings.LevelEffect = !Settings.LevelEffect;
- }
- if (msg.ToUpper() == "@TARGETDEAD")
- {
- Settings.TargetDead = !Settings.TargetDead;
- }
- Network.Enqueue(new C.Chat
- {
- Message = msg,
- LinkedItems = new List<ChatItem>(LinkedItems)
- });
- if (ChatTextBox.Text[0] == '/')
- {
- string[] parts = ChatTextBox.Text.Split(' ');
- if (parts.Length > 0)
- LastPM = parts[0];
- }
- }
- ChatTextBox.Visible = false;
- ChatTextBox.Text = string.Empty;
- LinkedItems.Clear();
- break;
- case (char)Keys.Escape:
- e.Handled = true;
- ChatTextBox.Visible = false;
- ChatTextBox.Text = string.Empty;
- LinkedItems.Clear();
- break;
- }
- }
- void PositionBar_OnMoving(object sender, MouseEventArgs e)
- {
- int x = Settings.Resolution != 800 ? 619 : 395;
- int y = PositionBar.Location.Y;
- if (y >= 16 + CountBar.Size.Height - PositionBar.Size.Height) y = 16 + CountBar.Size.Height - PositionBar.Size.Height;
- if (y < 16) y = 16;
- int h = CountBar.Size.Height - PositionBar.Size.Height;
- h = (int)((y - 16) / (h / (float)(History.Count - 1)));
- if (h != StartIndex)
- {
- StartIndex = h;
- Update();
- }
- PositionBar.Location = new Point(x, y);
- }
- public void ReceiveChat(string text, ChatType type)
- {
- Color foreColour, backColour;
- switch (type)
- {
- case ChatType.Hint:
- backColour = Color.White;
- foreColour = Color.DarkGreen;
- break;
- case ChatType.Announcement:
- backColour = Color.Blue;
- foreColour = Color.White;
- GameScene.Scene.ChatNoticeDialog.ShowNotice(RegexFunctions.CleanChatString(text));
- break;
- case ChatType.LineMessage:
- backColour = Color.Blue;
- foreColour = Color.White;
- break;
- case ChatType.Shout:
- backColour = Color.Yellow;
- foreColour = Color.Black;
- break;
- case ChatType.Shout2:
- backColour = Color.Green;
- foreColour = Color.White;
- break;
- case ChatType.Shout3:
- backColour = Color.Purple;
- foreColour = Color.White;
- break;
- case ChatType.System:
- backColour = Color.Red;
- foreColour = Color.White;
- break;
- case ChatType.System2:
- backColour = Color.DarkRed;
- foreColour = Color.White;
- break;
- case ChatType.Group:
- backColour = Color.White;
- foreColour = Color.Brown;
- break;
- case ChatType.WhisperOut:
- foreColour = Color.CornflowerBlue;
- backColour = Color.White;
- break;
- case ChatType.WhisperIn:
- foreColour = Color.DarkBlue;
- backColour = Color.White;
- break;
- case ChatType.Guild:
- backColour = Color.White;
- foreColour = Color.Green;
- break;
- case ChatType.LevelUp:
- backColour = Color.FromArgb(255, 225, 185, 250);
- foreColour = Color.Blue;
- break;
- case ChatType.Relationship:
- backColour = Color.Transparent;
- foreColour = Color.HotPink;
- break;
- case ChatType.Mentor:
- backColour = Color.White;
- foreColour = Color.Purple;
- break;
- default:
- backColour = Color.White;
- foreColour = Color.Black;
- break;
- }
- List<string> chat = new List<string>();
- int chatWidth = Settings.Resolution != 800 ? 614 : 390;
- int index = 0;
- for (int i = 1; i < text.Length; i++)
- {
- if (i - index < 0) continue;
- if (TextRenderer.MeasureText(CMain.Graphics, text.Substring(index, i - index), ChatFont).Width > chatWidth)
- {
- int offset = i - index;
- int newIndex = i - 1;
- var itemLinkMatches = RegexFunctions.ChatItemLinks.Matches(text.Substring(index)).Cast<Match>();
- if (itemLinkMatches.Any())
- {
- var match = itemLinkMatches.SingleOrDefault(x => (x.Index < (i - index)) && (x.Index + x.Length > offset - 1));
- if (match != null)
- {
- offset = match.Index;
- newIndex = match.Index;
- }
- }
- chat.Add(text.Substring(index, offset - 1));
- index = newIndex;
- }
- }
- chat.Add(text.Substring(index, text.Length - index));
- if (StartIndex == History.Count - LineCount)
- StartIndex += chat.Count;
- for (int i = 0; i < chat.Count; i++)
- FullHistory.Add(new ChatHistory { Text = chat[i], BackColour = backColour, ForeColour = foreColour, Type = type });
- Update();
- }
- public void Update()
- {
- History = new List<ChatHistory>();
- for (int i = 0; i < FullHistory.Count; i++)
- {
- switch (FullHistory[i].Type)
- {
- case ChatType.Normal:
- case ChatType.LineMessage:
- if (Settings.FilterNormalChat) continue;
- break;
- case ChatType.WhisperIn:
- case ChatType.WhisperOut:
- if (Settings.FilterWhisperChat) continue;
- break;
- case ChatType.Shout:
- case ChatType.Shout2:
- case ChatType.Shout3:
- if (Settings.FilterShoutChat) continue;
- break;
- case ChatType.System:
- case ChatType.System2:
- if (Settings.FilterSystemChat) continue;
- break;
- case ChatType.Group:
- if (Settings.FilterGroupChat) continue;
- break;
- case ChatType.Guild:
- if (Settings.FilterGuildChat) continue;
- break;
- }
- History.Add(FullHistory[i]);
- }
- for (int i = 0; i < ChatLines.Count; i++)
- ChatLines[i].Dispose();
- for (int i = 0; i < LinkedItemButtons.Count; i++)
- LinkedItemButtons[i].Dispose();
- ChatLines.Clear();
- LinkedItemButtons.Clear();
- if (StartIndex >= History.Count) StartIndex = History.Count - 1;
- if (StartIndex < 0) StartIndex = 0;
- if (History.Count > 1)
- {
- int h = CountBar.Size.Height - PositionBar.Size.Height;
- h = (int)((h / (float)(History.Count - 1)) * StartIndex);
- PositionBar.Location = new Point(Settings.Resolution != 800 ? 619 : 395, 16 + h);
- }
- int y = 1;
- for (int i = StartIndex; i < History.Count; i++)
- {
- MirLabel temp = new MirLabel
- {
- AutoSize = true,
- BackColour = History[i].BackColour,
- ForeColour = History[i].ForeColour,
- Location = new Point(1, y),
- OutLine = false,
- Parent = this,
- Text = History[i].Text,
- Font = ChatFont,
- };
- temp.MouseWheel += ChatPanel_MouseWheel;
- ChatLines.Add(temp);
- temp.Click += (o, e) =>
- {
- if (!(o is MirLabel l)) return;
- string[] parts = l.Text.Split(':', ' ');
- if (parts.Length == 0) return;
- string name = Regex.Replace(parts[0], "[^A-Za-z0-9]", "");
- ChatTextBox.SetFocus();
- ChatTextBox.Text = string.Format("/{0} ", name);
- ChatTextBox.Visible = true;
- ChatTextBox.TextBox.SelectionLength = 0;
- ChatTextBox.TextBox.SelectionStart = ChatTextBox.Text.Length;
- };
- string currentLine = History[i].Text;
- int oldLength = currentLine.Length;
- Capture capture = null;
- foreach (Match match in RegexFunctions.ChatItemLinks.Matches(currentLine).Cast<Match>().OrderBy(o => o.Index).ToList())
- {
- try
- {
- int offSet = oldLength - currentLine.Length;
- capture = match.Groups[1].Captures[0];
- string[] values = capture.Value.Split('/');
- currentLine = currentLine.Remove(capture.Index - 1 - offSet, capture.Length + 2).Insert(capture.Index - 1 - offSet, values[0]);
- string text = currentLine.Substring(0, capture.Index - 1 - offSet) + " ";
- Size size = TextRenderer.MeasureText(CMain.Graphics, text, temp.Font, temp.Size, TextFormatFlags.TextBoxControl);
- ChatLink(values[0], ulong.Parse(values[1]), temp.Location.Add(new Point(size.Width - 10, 0)));
- }
- catch(Exception ex)
- {
- //Temporary debug to catch unknown error
- CMain.SaveError(ex.ToString());
- CMain.SaveError(currentLine);
- CMain.SaveError(capture.Value);
- throw;
- }
- }
- temp.Text = currentLine;
- y += 13;
- if (i - StartIndex == LineCount - 1) break;
- }
- }
- private void ChatLink(string name, ulong uniqueID, Point p)
- {
- UserItem item = GameScene.ChatItemList.FirstOrDefault(x => x.UniqueID == uniqueID);
- if (item != null)
- {
- MirLabel temp = new MirLabel
- {
- AutoSize = true,
- Visible = true,
- Parent = this,
- Location = p,
- Text = name,
- ForeColour = Color.Blue,
- Sound = SoundList.ButtonC,
- Font = ChatFont,
- OutLine = false,
- };
- temp.MouseEnter += (o, e) => temp.ForeColour = Color.Red;
- temp.MouseLeave += (o, e) =>
- {
- GameScene.Scene.DisposeItemLabel();
- temp.ForeColour = Color.Blue;
- };
- temp.MouseDown += (o, e) => temp.ForeColour = Color.Blue;
- temp.MouseUp += (o, e) => temp.ForeColour = Color.Red;
- temp.Click += (o, e) =>
- {
- GameScene.Scene.CreateItemLabel(item);
- };
- LinkedItemButtons.Add(temp);
- }
- }
- private void ChatPanel_KeyDown(object sender, KeyEventArgs e)
- {
- switch (e.KeyCode)
- {
- case Keys.Up:
- if (StartIndex == 0) return;
- StartIndex--;
- break;
- case Keys.Home:
- if (StartIndex == 0) return;
- StartIndex = 0;
- break;
- case Keys.Down:
- if (StartIndex == History.Count - 1) return;
- StartIndex++;
- break;
- case Keys.End:
- if (StartIndex == History.Count - 1) return;
- StartIndex = History.Count - 1;
- break;
- case Keys.PageUp:
- if (StartIndex == 0) return;
- StartIndex -= LineCount;
- break;
- case Keys.PageDown:
- if (StartIndex == History.Count - 1) return;
- StartIndex += LineCount;
- break;
- default:
- return;
- }
- Update();
- e.Handled = true;
- }
- private void ChatPanel_KeyPress(object sender, KeyPressEventArgs e)
- {
- switch (e.KeyChar)
- {
- case '@':
- case '!':
- case ' ':
- case (char)Keys.Enter:
- ChatTextBox.SetFocus();
- if (e.KeyChar == '!') ChatTextBox.Text = "!";
- if (e.KeyChar == '@') ChatTextBox.Text = "@";
- if (ChatPrefix != "") ChatTextBox.Text = ChatPrefix;
- ChatTextBox.Visible = true;
- ChatTextBox.TextBox.SelectionLength = 0;
- ChatTextBox.TextBox.SelectionStart = ChatTextBox.Text.Length;
- e.Handled = true;
- break;
- case '/':
- ChatTextBox.SetFocus();
- ChatTextBox.Text = LastPM + " ";
- ChatTextBox.Visible = true;
- ChatTextBox.TextBox.SelectionLength = 0;
- ChatTextBox.TextBox.SelectionStart = ChatTextBox.Text.Length;
- e.Handled = true;
- break;
- }
- }
- private void ChatPanel_MouseWheel(object sender, MouseEventArgs e)
- {
- int count = e.Delta / SystemInformation.MouseWheelScrollDelta;
- if (StartIndex == 0 && count >= 0) return;
- if (StartIndex == History.Count - 1 && count <= 0) return;
- StartIndex -= count;
- Update();
- }
- private void ChatTextBox_KeyUp(object sender, KeyEventArgs e)
- {
- CMain.Shift = e.Shift;
- CMain.Alt = e.Alt;
- CMain.Ctrl = e.Control;
- switch (e.KeyCode)
- {
- case Keys.F1:
- case Keys.F2:
- case Keys.F3:
- case Keys.F4:
- case Keys.F5:
- case Keys.F6:
- case Keys.F7:
- case Keys.F8:
- case Keys.F9:
- case Keys.F10:
- case Keys.F11:
- case Keys.F12:
- case Keys.Tab:
- CMain.CMain_KeyUp(sender, e);
- break;
- }
- }
- private void ChatTextBox_KeyDown(object sender, KeyEventArgs e)
- {
- CMain.Shift = e.Shift;
- CMain.Alt = e.Alt;
- CMain.Ctrl = e.Control;
- switch (e.KeyCode)
- {
- case Keys.F1:
- case Keys.F2:
- case Keys.F3:
- case Keys.F4:
- case Keys.F5:
- case Keys.F6:
- case Keys.F7:
- case Keys.F8:
- case Keys.F9:
- case Keys.F10:
- case Keys.F11:
- case Keys.F12:
- case Keys.Tab:
- CMain.CMain_KeyDown(sender, e);
- break;
- }
- }
- public void ChangeSize()
- {
- if (++WindowSize >= 3) WindowSize = 0;
- int y = DisplayRectangle.Bottom;
- switch (WindowSize)
- {
- case 0:
- LineCount = 4;
- Index = Settings.Resolution != 800 ? 2221 : 2201;
- CountBar.Index = 2012;
- DownButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 39);
- EndButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 45);
- ChatTextBox.Location = new Point(1, 54);
- break;
- case 1:
- LineCount = 7;
- Index = Settings.Resolution != 800 ? 2224 : 2204;
- CountBar.Index = 2013;
- DownButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 39 + 48);
- EndButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 45 + 48);
- ChatTextBox.Location = new Point(1, 54 + 48);
- break;
- case 2:
- LineCount = 11;
- Index = Settings.Resolution != 800 ? 2227 : 2207;
- CountBar.Index = 2014;
- DownButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 39 + 96);
- EndButton.Location = new Point(Settings.Resolution != 800 ? 618 : 394, 45 + 96);
- ChatTextBox.Location = new Point(1, 54 + 96);
- break;
- }
- Location = new Point(Location.X, y - Size.Height);
- UpdateBackground();
- Update();
- }
- public void UpdateBackground()
- {
- int offset = Transparent ? 1 : 0;
- switch (WindowSize)
- {
- case 0:
- Index = Settings.Resolution != 800 ? 2221 : 2201;
- break;
- case 1:
- Index = Settings.Resolution != 800 ? 2224 : 2204;
- break;
- case 2:
- Index = Settings.Resolution != 800 ? 2227 : 2207;
- break;
- }
- Index -= offset;
- }
- public class ChatHistory
- {
- public string Text;
- public Color ForeColour, BackColour;
- public ChatType Type;
- }
- }
- public sealed class ChatControlBar : MirImageControl
- {
- public MirButton SizeButton, SettingsButton, NormalButton, ShoutButton, WhisperButton, LoverButton, MentorButton, GroupButton, GuildButton, ReportButton, TradeButton;
- public ChatControlBar()
- {
- Index = Settings.Resolution != 800 ? 2034 : 2035;
- Library = Libraries.Prguse;
- Location = new Point(GameScene.Scene.MainDialog.Location.X + 230, Settings.ScreenHeight - 112);
- SizeButton = new MirButton
- {
- Index = 2057,
- HoverIndex = 2058,
- PressedIndex = 2059,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(Settings.Resolution != 800 ? 574 : 350, 1),
- Visible = true,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Size)
- };
- SizeButton.Click += (o, e) =>
- {
- GameScene.Scene.ChatDialog.ChangeSize();
- Location = new Point(Location.X, GameScene.Scene.ChatDialog.DisplayRectangle.Top - Size.Height);
- if (GameScene.Scene.BeltDialog.Index == 1932)
- GameScene.Scene.BeltDialog.Location = new Point(GameScene.Scene.MainDialog.Location.X + 230, Location.Y - GameScene.Scene.BeltDialog.Size.Height);
- if (GameScene.Scene.HeroBeltDialog != null)
- GameScene.Scene.HeroBeltDialog.Location = new Point(GameScene.Scene.MainDialog.Location.X + 475, Location.Y - GameScene.Scene.HeroBeltDialog.Size.Height);
- };
- SettingsButton = new MirButton
- {
- Index = 2060,
- HoverIndex = 2061,
- PressedIndex = 2062,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(Settings.Resolution != 800 ? 596 : 372, 1),
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.ChatSettings)
- };
- SettingsButton.Click += (o, e) =>
- {
- if (GameScene.Scene.ChatOptionDialog.Visible)
- GameScene.Scene.ChatOptionDialog.Hide();
- else
- GameScene.Scene.ChatOptionDialog.Show();
- //GameScene.Scene.ChatDialog.Transparent = !GameScene.Scene.ChatDialog.Transparent;
- //GameScene.Scene.ChatDialog.UpdateBackground();
- };
- NormalButton = new MirButton
- {
- Index = 2036,
- HoverIndex = 2037,
- PressedIndex = 2038,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(12, 1),
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_All)
- };
- NormalButton.Click += (o, e) =>
- {
- ToggleChatFilter("All");
- };
- ShoutButton = new MirButton
- {
- Index = 2039,
- HoverIndex = 2040,
- PressedIndex = 2041,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(34, 1),
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Short)
- };
- ShoutButton.Click += (o, e) =>
- {
- ToggleChatFilter("Shout");
- };
- WhisperButton = new MirButton
- {
- Index = 2042,
- HoverIndex = 2043,
- PressedIndex = 2044,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(56, 1),
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Whisper)
- };
- WhisperButton.Click += (o, e) =>
- {
- ToggleChatFilter("Whisper");
- };
- LoverButton = new MirButton
- {
- Index = 2045,
- HoverIndex = 2046,
- PressedIndex = 2047,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(78, 1),
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Lover)
- };
- LoverButton.Click += (o, e) =>
- {
- ToggleChatFilter("Lover");
- };
- MentorButton = new MirButton
- {
- Index = 2048,
- HoverIndex = 2049,
- PressedIndex = 2050,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(100, 1),
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Mentor)
- };
- MentorButton.Click += (o, e) =>
- {
- ToggleChatFilter("Mentor");
- };
- GroupButton = new MirButton
- {
- Index = 2051,
- HoverIndex = 2052,
- PressedIndex = 2053,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(122, 1),
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Group)
- };
- GroupButton.Click += (o, e) =>
- {
- ToggleChatFilter("Group");
- };
- GuildButton = new MirButton
- {
- Index = 2054,
- HoverIndex = 2055,
- PressedIndex = 2056,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(144, 1),
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Chat_Guild)
- };
- GuildButton.Click += (o, e) =>
- {
- Settings.ShowGuildChat = !Settings.ShowGuildChat;
- ToggleChatFilter("Guild");
- };
- TradeButton = new MirButton
- {
- Index = 2004,
- HoverIndex = 2005,
- PressedIndex = 2006,
- Library = Libraries.Prguse,
- Location = new Point(166, 1),
- Parent = this,
- Sound = SoundList.ButtonC,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.TradeKey), CMain.InputKeys.GetKey(KeybindOptions.Trade)),
- };
- TradeButton.Click += (o, e) => Network.Enqueue(new C.TradeRequest());
- ReportButton = new MirButton
- {
- Index = 2063,
- HoverIndex = 2064,
- PressedIndex = 2065,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(Settings.Resolution != 800 ? 552 : 328, 1),
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Report),
- Visible = false
- };
- ReportButton.Click += (o, e) =>
- {
- GameScene.Scene.ReportDialog.Visible = !GameScene.Scene.ReportDialog.Visible;
- };
- ToggleChatFilter("All");
- }
- public void ToggleChatFilter(string chatFilter)
- {
- NormalButton.Index = 2036;
- NormalButton.HoverIndex = 2037;
- ShoutButton.Index = 2039;
- ShoutButton.HoverIndex = 2040;
- WhisperButton.Index = 2042;
- WhisperButton.HoverIndex = 2043;
- LoverButton.Index = 2045;
- LoverButton.HoverIndex = 2046;
- MentorButton.Index = 2048;
- MentorButton.HoverIndex = 2049;
- GroupButton.Index = 2051;
- GroupButton.HoverIndex = 2052;
- GuildButton.Index = 2054;
- GuildButton.HoverIndex = 2055;
- GameScene.Scene.ChatDialog.ChatPrefix = "";
- switch (chatFilter)
- {
- case "All":
- NormalButton.Index = 2038;
- NormalButton.HoverIndex = 2038;
- GameScene.Scene.ChatDialog.ChatPrefix = "";
- break;
- case "Shout":
- ShoutButton.Index = 2041;
- ShoutButton.HoverIndex = 2041;
- GameScene.Scene.ChatDialog.ChatPrefix = "!";
- break;
- case "Whisper":
- WhisperButton.Index = 2044;
- WhisperButton.HoverIndex = 2044;
- GameScene.Scene.ChatDialog.ChatPrefix = "/";
- break;
- case "Group":
- GroupButton.Index = 2053;
- GroupButton.HoverIndex = 2053;
- GameScene.Scene.ChatDialog.ChatPrefix = "!!";
- break;
- case "Guild":
- GuildButton.Index = 2056;
- GuildButton.HoverIndex = 2056;
- GameScene.Scene.ChatDialog.ChatPrefix = "!~";
- break;
- case "Lover":
- LoverButton.Index = 2047;
- LoverButton.HoverIndex = 2047;
- GameScene.Scene.ChatDialog.ChatPrefix = ":)";
- break;
- case "Mentor":
- MentorButton.Index = 2050;
- MentorButton.HoverIndex = 2050;
- GameScene.Scene.ChatDialog.ChatPrefix = "!#";
- break;
- }
- }
- }
- public sealed class SkillBarDialog : MirImageControl
- {
- private readonly MirButton _switchBindsButton;
- public bool AltBind;
- public bool HasSkill = false;
- public byte BarIndex;
- //public bool TopBind = !Settings.SkillMode;
- public MirImageControl[] Cells = new MirImageControl[8];
- public MirLabel[] KeyNameLabels = new MirLabel[8];
- public MirLabel BindNumberLabel = new MirLabel();
- public MirImageControl[] CoolDowns = new MirImageControl[8];
- public SkillBarDialog()
- {
- Index = 2190;
- Library = Libraries.Prguse;
- Movable = true;
- Sort = true;
- Location = new Point(0, BarIndex * 20);
- Visible = true;
- BeforeDraw += MagicKeyDialog_BeforeDraw;
- _switchBindsButton = new MirButton
- {
- Index = 2247,
- Library = Libraries.Prguse,
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(16, 28),
- Location = new Point(0, 0)
- };
- _switchBindsButton.Click += (o, e) =>
- {
- //Settings.SkillSet = !Settings.SkillSet;
- Update();
- };
- for (var i = 0; i < Cells.Length; i++)
- {
- Cells[i] = new MirImageControl
- {
- Index = -1,
- Library = Libraries.MagIcon,
- Parent = this,
- Location = new Point(i * 25 + 15, 3),
- };
- int j = i + 1;
- Cells[i].Click += (o, e) =>
- {
- GameScene.Scene.UseSpell(j + (8 * BarIndex));
- };
- CoolDowns[i] = new MirImageControl
- {
- Library = Libraries.Prguse2,
- Parent = this,
- Location = new Point(i * 25 + 15, 3),
- NotControl = true,
- UseOffSet = true,
- Opacity = 0.6F
- };
- }
- BindNumberLabel = new MirLabel
- {
- Text = "1",
- Font = new Font(Settings.FontName, 8F),
- ForeColour = Color.White,
- Parent = this,
- Location = new Point(0, 1),
- Size = new Size(10, 25),
- NotControl = true
- };
- for (var i = 0; i < KeyNameLabels.Length; i++)
- {
- KeyNameLabels[i] = new MirLabel
- {
- Text = "F" + (i + 1),
- Font = new Font(Settings.FontName, 8F),
- ForeColour = Color.White,
- Parent = this,
- Location = new Point(i * 25 + 13, 0),
- Size = new Size(25, 25),
- NotControl = true
- };
- }
- OnMoving += SkillBar_OnMoving;
- }
- private void SkillBar_OnMoving(object sender, MouseEventArgs e)
- {
- if (BarIndex * 2 >= Settings.SkillbarLocation.Length) return;
- Settings.SkillbarLocation[BarIndex, 0] = this.Location.X;
- Settings.SkillbarLocation[BarIndex, 1] = this.Location.Y;
- }
- private string GetKey(int barindex, int i)
- {
- //KeybindOptions Type = KeybindOptions.Bar1Skill1;
- if ((barindex == 0) && (i == 1))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill1);
- if ((barindex == 0) && (i == 2))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill2);
- if ((barindex == 0) && (i == 3))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill3);
- if ((barindex == 0) && (i == 4))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill4);
- if ((barindex == 0) && (i == 5))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill5);
- if ((barindex == 0) && (i == 6))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill6);
- if ((barindex == 0) && (i == 7))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill7);
- if ((barindex == 0) && (i == 8))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar1Skill8);
- if ((barindex == 1) && (i == 1))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill1);
- if ((barindex == 1) && (i == 2))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill2);
- if ((barindex == 1) && (i == 3))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill3);
- if ((barindex == 1) && (i == 4))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill4);
- if ((barindex == 1) && (i == 5))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill5);
- if ((barindex == 1) && (i == 6))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill6);
- if ((barindex == 1) && (i == 7))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill7);
- if ((barindex == 1) && (i == 8))
- return CMain.InputKeys.GetKey(KeybindOptions.Bar2Skill8);
- return "";
- }
- void MagicKeyDialog_BeforeDraw(object sender, EventArgs e)
- {
- Libraries.Prguse.Draw(2193, new Point(DisplayLocation.X + 12, DisplayLocation.Y), Color.White, true, 0.5F);
- }
- public void Update()
- {
- HasSkill = false;
- foreach (var m in GameScene.User.Magics)
- {
- if ((m.Key < (BarIndex * 8)+1) || (m.Key > ((BarIndex + 1) * 8)+1)) continue;
- HasSkill = true;
- }
- if (!Visible) return;
- Index = 2190;
- _switchBindsButton.Index = 2247;
- BindNumberLabel.Text = (BarIndex + 1).ToString();
- BindNumberLabel.Location = new Point(0, 1);
- for (var i = 1; i <= 8; i++)
- {
- Cells[i - 1].Index = -1;
- int offset = BarIndex * 8;
- string key = GetKey(BarIndex, i);
- KeyNameLabels[i - 1].Text = key;
- foreach (var m in GameScene.User.Magics)
- {
- if (m.Key != i + offset) continue;
- HasSkill = true;
- ClientMagic magic = MapObject.User.GetMagic(m.Spell);
- if (magic == null) continue;
- //string key = m.Key > 8 ? string.Format("CTRL F{0}", i) : string.Format("F{0}", m.Key);
- Cells[i - 1].Index = magic.Icon * 2;
- Cells[i - 1].Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SkillMpCooldownKey), magic.Name,
- (magic.BaseCost + (magic.LevelCost * magic.Level)), Functions.PrintTimeSpanFromMilliSeconds(magic.Delay), key);
- KeyNameLabels[i - 1].Text = "";
- }
- }
- }
- public void Process()
- {
- ProcessSkillDelay();
- }
- private void ProcessSkillDelay()
- {
- if (!Visible) return;
- int offset = BarIndex * 8;
- for (int i = 0; i < Cells.Length; i++)
- {
- foreach (var magic in GameScene.User.Magics)
- {
- if (magic.Key != i + offset + 1) continue;
- int totalFrames = 22;
- long timeLeft = magic.CastTime + magic.Delay - CMain.Time;
- if (timeLeft < 100)
- {
- if (timeLeft > 0)
- {
- CoolDowns[i].Visible = false;
- // CoolDowns[i].Dispose();
- }
- else
- continue;
- }
- int delayPerFrame = (int)(magic.Delay / totalFrames);
- int startFrame = totalFrames - (int)(timeLeft / delayPerFrame);
- if ((CMain.Time <= magic.CastTime + magic.Delay))
- {
- CoolDowns[i].Visible = true;
- CoolDowns[i].Index = 1260 + startFrame;
- }
- }
- }
- }
- public override void Show()
- {
- if (Visible) return;
- if (!HasSkill) return;
- Settings.SkillBar = true;
- Visible = true;
- Update();
- }
- public override void Hide()
- {
- if (!Visible) return;
- Settings.SkillBar = false;
- Visible = false;
- }
- }
- public sealed class MiniMapDialog : MirImageControl
- {
- public MirImageControl LightSetting, NewMail;
- public MirButton ToggleButton, BigMapButton, MailButton;
- public MirLabel LocationLabel, MapNameLabel;
- private float _fade = 1F;
- private bool _bigMode = true;
- public MirLabel AModeLabel, PModeLabel;
- public List<MirLabel> QuestIcons = new List<MirLabel>();
- public MiniMapDialog()
- {
- Index = 2090;
- Library = Libraries.Prguse;
- Location = new Point(Settings.ScreenWidth - 126, 0);
- PixelDetect = true;
- BeforeDraw += MiniMap_BeforeDraw;
- AfterDraw += MiniMapDialog_AfterDraw;
- MapNameLabel = new MirLabel
- {
- DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
- Parent = this,
- Size = new Size(120, 18),
- Location = new Point(2, 2),
- NotControl = true,
- };
- LocationLabel = new MirLabel
- {
- DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
- Parent = this,
- Size = new Size(56, 18),
- Location = new Point(46, 131),
- NotControl = true,
- };
- MailButton = new MirButton
- {
- Index = 2099,
- HoverIndex = 2100,
- PressedIndex = 2101,
- Parent = this,
- Location = new Point(4, 131),
- Library = Libraries.Prguse,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Mail)
- };
- MailButton.Click += (o, e) => GameScene.Scene.MailListDialog.Toggle();
- NewMail = new MirImageControl
- {
- Index = 544,
- Location = new Point(5, 132),
- Parent = this,
- Library = Libraries.Prguse,
- Visible = false,
- NotControl = true
- };
- BigMapButton = new MirButton
- {
- Index = 2096,
- HoverIndex = 2097,
- PressedIndex = 2098,
- Parent = this,
- Location = new Point(25, 131),
- Library = Libraries.Prguse,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.BigMapKey), CMain.InputKeys.GetKey(KeybindOptions.Bigmap))
- };
- BigMapButton.Click += (o, e) => GameScene.Scene.BigMapDialog.Toggle();
- ToggleButton = new MirButton
- {
- Index = 2102,
- HoverIndex = 2103,
- PressedIndex = 2104,
- Parent = this,
- Location = new Point(109, 3),
- Library = Libraries.Prguse,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MiniMapKey), CMain.InputKeys.GetKey(KeybindOptions.Minimap))
- };
- ToggleButton.Click += (o, e) => Toggle();
- LightSetting = new MirImageControl
- {
- Index = 2093,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(102, 131),
- };
- AModeLabel = new MirLabel
- {
- AutoSize = true,
- ForeColour = Color.Yellow,
- OutLineColour = Color.Black,
- Parent = this,
- Location = new Point(115, 125)
- };
- PModeLabel = new MirLabel
- {
- AutoSize = true,
- ForeColour = Color.Yellow,
- OutLineColour = Color.Black,
- Parent = this,
- Location = new Point(230, 125),
- Visible = false
- };
- }
- private void MiniMapDialog_AfterDraw(object sender, EventArgs e)
- {
- }
- private void MiniMap_BeforeDraw(object sender, EventArgs e)
- {
- foreach (var icon in QuestIcons)
- icon.Dispose();
- QuestIcons.Clear();
- MapControl map = GameScene.Scene.MapControl;
- if (map == null) return;
- if (map.MiniMap == 0 && Index != 2091)
- {
- SetSmallMode();
- }
- else if (map.MiniMap > 0 && _bigMode && Index == 2091)
- {
- SetBigMode();
- }
- if (map.MiniMap <= 0 || Index != 2090 || Libraries.MiniMap == null)
- {
- return;
- }
- Rectangle viewRect = new Rectangle(0, 0, 120, 108);
- Point drawLocation = Location;
- drawLocation.Offset(3, 22);
- Size miniMapSize = Libraries.MiniMap.GetSize(map.MiniMap);
- float scaleX = miniMapSize.Width / (float)map.Width;
- float scaleY = miniMapSize.Height / (float)map.Height;
- viewRect.Location = new Point(
- (int)(scaleX * MapObject.User.CurrentLocation.X) - viewRect.Width / 2,
- (int)(scaleY * MapObject.User.CurrentLocation.Y) - viewRect.Height / 2);
- // viewRect.Location = viewRect.Location.Subtract(1, 1);
- if (viewRect.Right >= miniMapSize.Width)
- viewRect.X = miniMapSize.Width - viewRect.Width;
- if (viewRect.Bottom >= miniMapSize.Height)
- viewRect.Y = miniMapSize.Height - viewRect.Height;
- if (viewRect.X < 0) viewRect.X = 0;
- if (viewRect.Y < 0) viewRect.Y = 0;
- Libraries.MiniMap.Draw(map.MiniMap, viewRect, drawLocation, Color.FromArgb(255, 255, 255), _fade);
- int startPointX = (int)(viewRect.X / scaleX);
- int startPointY = (int)(viewRect.Y / scaleY);
- foreach (var ob in MapControl.Objects.Values)
- {
- if (ob.Race == ObjectType.Item || ob.Dead || ob.Race == ObjectType.Spell || ob.Sneaking) continue;
- float x = ((ob.CurrentLocation.X - startPointX) * scaleX) + drawLocation.X;
- float y = ((ob.CurrentLocation.Y - startPointY) * scaleY) + drawLocation.Y;
- Color colour;
- if ((GroupDialog.GroupList.Contains(ob.Name) && MapObject.User != ob) || ob.Name.EndsWith(string.Format("({0})", MapObject.User.Name)))
- colour = Color.FromArgb(0, 0, 255);
- else
- if (ob is PlayerObject)
- {
- colour = Color.FromArgb(255, 255, 255);
- }
- else if (ob is NPCObject || ob.AI == 6)
- {
- colour = Color.FromArgb(0, 255, 50);
- }
- else
- colour = Color.FromArgb(255, 0, 0);
- DXManager.Draw(DXManager.RadarTexture, new Rectangle(0, 0, 2, 2), new Vector3((float)(x - 0.5), (float)(y - 0.5), 0.0F), colour);
- #region NPC Quest Icons
- if (ob is NPCObject npc && npc.GetAvailableQuests(true).Any())
- {
- string text = "";
- Color color = Color.Empty;
- switch (npc.QuestIcon)
- {
- case QuestIcon.ExclamationBlue:
- color = Color.DodgerBlue;
- text = "!";
- break;
- case QuestIcon.ExclamationYellow:
- color = Color.Yellow;
- text = "!";
- break;
- case QuestIcon.ExclamationGreen:
- color = Color.Green;
- text = "!";
- break;
- case QuestIcon.QuestionBlue:
- color = Color.DodgerBlue;
- text = "?";
- break;
- case QuestIcon.QuestionWhite:
- color = Color.White;
- text = "?";
- break;
- case QuestIcon.QuestionYellow:
- color = Color.Yellow;
- text = "?";
- break;
- case QuestIcon.QuestionGreen:
- color = Color.Green;
- text = "?";
- break;
- }
- QuestIcons.Add(new MirLabel
- {
- AutoSize = true,
- Parent = GameScene.Scene.MiniMapDialog,
- Font = new Font(Settings.FontName, 9f, FontStyle.Bold),
- DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
- Text = text,
- ForeColour = color,
- Location = new Point((int)(x - Settings.ScreenWidth + GameScene.Scene.MiniMapDialog.Size.Width) - 6, (int)(y) - 10),
- NotControl = true,
- Visible = true,
- Modal = true
- });
- }
- #endregion
- }
- }
- public void Toggle()
- {
- if (_fade == 0F)
- {
- _bigMode = true;
- SetBigMode();
- _fade = 1F;
- }
- //else if(_fade == 1F)
- //{
- // _bigMode = true;
- // SetBigMode();
- // _fade = 0.8F;
- //}
- else
- {
- _bigMode = false;
- SetSmallMode();
- _fade = 0;
- }
- Redraw();
- }
- private void SetSmallMode()
- {
- Index = 2091;
- int y = Size.Height - 23;
- MailButton.Location = new Point(4, y);
- NewMail.Location = new Point(5, y + 1);
- BigMapButton.Location = new Point(25, y);
- LocationLabel.Location = new Point(46, y);
- LightSetting.Location = new Point(102, y);
- GameScene.Scene.DuraStatusPanel.Location = new Point(GameScene.Scene.MiniMapDialog.Location.X + 86,
- GameScene.Scene.MiniMapDialog.Size.Height);
- }
- private void SetBigMode()
- {
- Index = 2090;
- int y = Size.Height - 23;
- MailButton.Location = new Point(4, y);
- NewMail.Location = new Point(5, y + 1);
- BigMapButton.Location = new Point(25, y);
- LocationLabel.Location = new Point(46, y);
- LightSetting.Location = new Point(102, y);
- GameScene.Scene.DuraStatusPanel.Location = new Point(GameScene.Scene.MiniMapDialog.Location.X + 86,
- GameScene.Scene.MiniMapDialog.Size.Height);
- }
- public void Process()
- {
- MapControl map = GameScene.Scene.MapControl;
- if (map == null) return;
- MapNameLabel.Text = map.Title;
- LocationLabel.Text = Functions.PointToString(MapObject.User.CurrentLocation);
- GameScene.Scene.MainDialog.SModeLabel.Location = new Point((GameScene.Scene.MiniMapDialog.Location.X - 3) - GameScene.Scene.MainDialog.Location.X,
- (GameScene.Scene.MiniMapDialog.Size.Height + 150) - Settings.ScreenHeight);
- GameScene.Scene.MainDialog.AModeLabel.Location = new Point((GameScene.Scene.MiniMapDialog.Location.X - 3) - GameScene.Scene.MainDialog.Location.X,
- (GameScene.Scene.MiniMapDialog.Size.Height + 165) - Settings.ScreenHeight);
- GameScene.Scene.MainDialog.PModeLabel.Location = new Point((GameScene.Scene.MiniMapDialog.Location.X - 3) - GameScene.Scene.MainDialog.Location.X,
- (GameScene.Scene.MiniMapDialog.Size.Height + 180) - Settings.ScreenHeight);
- if (GameScene.Scene.NewMail)
- {
- double time = (CMain.Time) / 100D;
- if (Math.Round(time) % 10 < 5 || GameScene.Scene.NewMailCounter >= 10)
- {
- NewMail.Visible = true;
- }
- else
- {
- if (NewMail.Visible)
- {
- GameScene.Scene.NewMailCounter++;
- }
- NewMail.Visible = false;
- }
- }
- else
- {
- NewMail.Visible = false;
- }
- }
- }
- public sealed class InspectDialog : MirImageControl
- {
- public static UserItem[] Items = new UserItem[14];
- public static uint InspectID;
- public string Name;
- public string GuildName;
- public string GuildRank;
- public MirClass Class;
- public MirGender Gender;
- public byte Hair;
- public ushort Level;
- public string LoverName;
- public bool AllowObserve;
- public MirButton CloseButton, GroupButton, FriendButton, MailButton, TradeButton, LoverButton, ObserveButton;
- public MirImageControl CharacterPage, ClassImage;
- public MirLabel NameLabel;
- public MirLabel GuildLabel, LoverLabel;
- public MirItemCell
- WeaponCell,
- ArmorCell,
- HelmetCell,
- TorchCell,
- NecklaceCell,
- BraceletLCell,
- BraceletRCell,
- RingLCell,
- RingRCell,
- AmuletCell,
- BeltCell,
- BootsCell,
- StoneCell,
- MountCell;
- public InspectDialog()
- {
- Index = 430;
- Library = Libraries.Prguse;
- Location = new Point(536, 0);
- Movable = true;
- Sort = true;
- CharacterPage = new MirImageControl
- {
- Index = 340,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(8, 70),
- };
- CharacterPage.AfterDraw += (o, e) =>
- {
- if (Libraries.StateItems == null) return;
- ItemInfo RealItem = null;
- if (ArmorCell.Item != null)
- {
- RealItem = Functions.GetRealItem(ArmorCell.Item.Info, Level, Class, GameScene.ItemInfoList);
- Libraries.StateItems.Draw(RealItem.Image, new Point(DisplayLocation.X + 0, DisplayLocation.Y + -20), Color.White, true, 1F);
- if (RealItem.Effect > 0)
- {
- int wingOffset = RealItem.Effect == 1 ? 2 : 4;
- int genderOffset = MapObject.User.Gender == MirGender.Male ? 0 : 1;
- Libraries.Prguse2.DrawBlend(1200 + wingOffset + genderOffset, new Point(DisplayLocation.X, DisplayLocation.Y - 20), Color.White, true, 1F);
- }
- }
- if (WeaponCell.Item != null)
- {
- RealItem = Functions.GetRealItem(WeaponCell.Item.Info, Level, Class, GameScene.ItemInfoList);
- Libraries.StateItems.Draw(RealItem.Image, new Point(DisplayLocation.X, DisplayLocation.Y - 20),
- Color.White, true, 1F);
- }
- if (HelmetCell.Item != null)
- Libraries.StateItems.Draw(HelmetCell.Item.Info.Image, new Point(DisplayLocation.X, DisplayLocation.Y - 20), Color.White, true, 1F);
- else
- {
- int hair = 441 + Hair + (Class == MirClass.Assassin ? 20 : 0) + (Gender == MirGender.Male ? 0 : 40);
- int offSetX = Class == MirClass.Assassin ? (Gender == MirGender.Male ? 6 : 4) : 0;
- int offSetY = Class == MirClass.Assassin ? (Gender == MirGender.Male ? 25 : 18) : 0;
- Libraries.Prguse.Draw(hair, new Point(DisplayLocation.X + offSetX, DisplayLocation.Y + offSetY - 20), Color.White, true, 1F);
- }
- };
- CloseButton = new MirButton
- {
- HoverIndex = 361,
- Index = 360,
- Location = new Point(241, 3),
- Library = Libraries.Prguse2,
- Parent = this,
- PressedIndex = 362,
- Sound = SoundList.ButtonA,
- };
- CloseButton.Click += (o, e) => Hide();
- GroupButton = new MirButton
- {
- HoverIndex = 432,
- Index = 431,
- Location = new Point(55, 357),
- Library = Libraries.Prguse,
- Parent = this,
- PressedIndex = 433,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.InviteToGroup),
- };
- GroupButton.Click += (o, e) =>
- {
- if (GroupDialog.GroupList.Count >= Globals.MaxGroup)
- {
- GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.GroupHasMaxMembers), ChatType.System);
- return;
- }
- if (GroupDialog.GroupList.Count > 0 && GroupDialog.GroupList[0] != MapObject.User.Name)
- {
- GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.YouNotGroupLeader), ChatType.System);
- }
- Network.Enqueue(new C.AddMember { Name = Name });
- return;
- };
- FriendButton = new MirButton
- {
- HoverIndex = 435,
- Index = 434,
- Location = new Point(85, 357),
- Library = Libraries.Prguse,
- Parent = this,
- PressedIndex = 436,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.AddToFriendsList),
- };
- FriendButton.Click += (o, e) =>
- {
- Network.Enqueue(new C.AddFriend { Name = Name, Blocked = false });
- };
- MailButton = new MirButton
- {
- HoverIndex = 438,
- Index = 437,
- Location = new Point(115, 357),
- Library = Libraries.Prguse,
- Parent = this,
- PressedIndex = 439,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.SendMail),
- };
- MailButton.Click += (o, e) => GameScene.Scene.MailComposeLetterDialog.ComposeMail(Name);
- TradeButton = new MirButton
- {
- HoverIndex = 524,
- Index = 523,
- Location = new Point(145, 357),
- Library = Libraries.Prguse,
- Parent = this,
- PressedIndex = 525,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Trade),
- };
- TradeButton.Click += (o, e) => Network.Enqueue(new C.TradeRequest());
- ObserveButton = new MirButton
- {
- Index = 854,
- HoverIndex = 855,
- PressedIndex = 856,
- Location = new Point(175, 357),
- Library = Libraries.Title,
- Parent = this,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.Observe),
- };
- ObserveButton.Click += (o, e) =>
- {
- if (AllowObserve)
- {
- Network.Enqueue(new C.Observe { Name = Name });
- }
- else
- {
- GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.PlayerDisabledObservation), ChatType.System);
- }
- };
- NameLabel = new MirLabel
- {
- DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
- Parent = this,
- Location = new Point(50, 12),
- Size = new Size(190, 20),
- NotControl = true
- };
- NameLabel.Click += (o, e) =>
- {
- GameScene.Scene.ChatDialog.ChatTextBox.SetFocus();
- GameScene.Scene.ChatDialog.ChatTextBox.Text = string.Format("/{0} ", Name);
- GameScene.Scene.ChatDialog.ChatTextBox.Visible = true;
- GameScene.Scene.ChatDialog.ChatTextBox.TextBox.SelectionLength = 0;
- GameScene.Scene.ChatDialog.ChatTextBox.TextBox.SelectionStart = Name.Length + 2;
- };
- LoverButton = new MirButton
- {
- Index = 604,
- Location = new Point(17, 17),
- Library = Libraries.Prguse,
- Parent = this,
- Sound = SoundList.None
- };
- GuildLabel = new MirLabel
- {
- DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
- Parent = this,
- Location = new Point(50, 33),
- Size = new Size(190, 30),
- NotControl = true,
- };
- ClassImage = new MirImageControl
- {
- Index = 100,
- Library = Libraries.Prguse,
- Location = new Point(15, 33),
- Parent = this,
- NotControl = true,
- };
- WeaponCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.Weapon,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(123, 7),
- };
- ArmorCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.Armour,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(163, 7),
- };
- HelmetCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.Helmet,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(203, 7),
- };
- TorchCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.Torch,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(203, 134),
- };
- NecklaceCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.Necklace,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(203, 98),
- };
- BraceletLCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.BraceletL,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(8, 170),
- };
- BraceletRCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.BraceletR,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(203, 170),
- };
- RingLCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.RingL,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(8, 206),
- };
- RingRCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.RingR,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(203, 206),
- };
- AmuletCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.Amulet,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(8, 242),
- };
- BootsCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.Boots,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(48, 242),
- };
- BeltCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.Belt,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(88, 242),
- };
- StoneCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.Stone,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(128, 242),
- };
- MountCell = new MirItemCell
- {
- ItemSlot = (int)EquipmentSlot.Mount,
- GridType = MirGridType.Inspect,
- Parent = CharacterPage,
- Location = new Point(203, 62),
- };
- }
- public void RefreshInferface(bool IsHero)
- {
- int offSet = Gender == MirGender.Male ? 0 : 1;
- CharacterPage.Index = 340 + offSet;
- switch (Class)
- {
- case MirClass.Warrior:
- ClassImage.Index = 100;// + offSet * 5;
- break;
- case MirClass.Wizard:
- ClassImage.Index = 101;// + offSet * 5;
- break;
- case MirClass.Taoist:
- ClassImage.Index = 102;// + offSet * 5;
- break;
- case MirClass.Assassin:
- ClassImage.Index = 103;// + offSet * 5;
- break;
- case MirClass.Archer:
- ClassImage.Index = 104;// + offSet * 5;
- break;
- }
- NameLabel.Text = Name;
- GuildLabel.Text = GuildName + " " + GuildRank;
- if (LoverName != "")
- {
- LoverButton.Visible = true;
- LoverButton.Hint = LoverName;
- }
- else
- LoverButton.Visible = false;
- for (int i = 0; i < Items.Length; i++)
- {
- if (Items[i] == null) continue;
- GameScene.Bind(Items[i]);
- }
- //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.
- ObserveButton.Visible = !IsHero;
- TradeButton.Visible = !IsHero;
- MailButton.Visible = !IsHero;
- FriendButton.Visible = !IsHero;
- GroupButton.Visible = !IsHero;
- }
- }
- public sealed class OptionDialog : MirImageControl
- {
- public MirButton SkillModeOn, SkillModeOff;
- public MirButton SkillBarOn, SkillBarOff;
- public MirButton EffectOn, EffectOff;
- public MirButton DropViewOn, DropViewOff;
- public MirButton NameViewOn, NameViewOff;
- public MirButton HPViewOn, HPViewOff;
- public MirButton NewMoveOn, NewMoveOff;
- public MirButton ObserveOn, ObserveOff;
- public MirImageControl SoundBar, MusicSoundBar;
- public MirImageControl VolumeBar, MusicVolumeBar;
- public MirButton CloseButton;
- public OptionDialog()
- {
- Index = 411;
- Library = Libraries.Title;
- Movable = true;
- Sort = true;
- Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2);
- BeforeDraw += OptionPanel_BeforeDraw;
- CloseButton = new MirButton
- {
- Index = 360,
- HoverIndex = 361,
- Library = Libraries.Prguse2,
- Location = new Point(Size.Width - 26, 5),
- Parent = this,
- Sound = SoundList.ButtonA,
- PressedIndex = 362,
- };
- CloseButton.Click += (o, e) => Hide();
- //tilde option
- SkillModeOn = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(159, 68),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 451,
- };
- SkillModeOn.Click += (o, e) =>
- {
- GameScene.Scene.ChangeSkillMode(false);
- };
- //ctrl option
- SkillModeOff = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(201, 68),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 454
- };
- SkillModeOff.Click += (o, e) =>
- {
- GameScene.Scene.ChangeSkillMode(true);
- };
- SkillBarOn = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(159, 93),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 457,
- };
- SkillBarOn.Click += (o, e) => Settings.SkillBar = true;
- SkillBarOff = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(201, 93),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 460
- };
- SkillBarOff.Click += (o, e) => Settings.SkillBar = false;
- EffectOn = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(159, 118),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 457,
- };
- EffectOn.Click += (o, e) => Settings.Effect = true;
- EffectOff = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(201, 118),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 460
- };
- EffectOff.Click += (o, e) => Settings.Effect = false;
- DropViewOn = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(159, 143),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 457,
- };
- DropViewOn.Click += (o, e) => Settings.DropView = true;
- DropViewOff = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(201, 143),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 460
- };
- DropViewOff.Click += (o, e) => Settings.DropView = false;
- NameViewOn = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(159, 168),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 457,
- };
- NameViewOn.Click += (o, e) => Settings.NameView = true;
- NameViewOff = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(201, 168),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 460
- };
- NameViewOff.Click += (o, e) => Settings.NameView = false;
- HPViewOn = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(159, 193),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 463,
- };
- HPViewOn.Click += (o, e) =>
- {
- Settings.HPView = true;
- GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.HpMpMode1), ChatType.Hint);
- };
- HPViewOff = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(201, 193),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 466
- };
- HPViewOff.Click += (o, e) =>
- {
- Settings.HPView = false;
- GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.HpMpMode2), ChatType.Hint);
- };
- SoundBar = new MirImageControl
- {
- Index = 468,
- Library = Libraries.Prguse2,
- Location = new Point(159, 225),
- Parent = this,
- DrawImage = false,
- };
- SoundBar.MouseDown += SoundBar_MouseMove;
- SoundBar.MouseMove += SoundBar_MouseMove;
- SoundBar.BeforeDraw += SoundBar_BeforeDraw;
- VolumeBar = new MirImageControl
- {
- Index = 20,
- Library = Libraries.Prguse,
- Location = new Point(155, 218),
- Parent = this,
- NotControl = true,
- };
- MusicSoundBar = new MirImageControl
- {
- Index = 468,
- Library = Libraries.Prguse2,
- Location = new Point(159, 251),
- Parent = this,
- DrawImage = false
- };
- MusicSoundBar.MouseDown += MusicSoundBar_MouseMove;
- MusicSoundBar.MouseMove += MusicSoundBar_MouseMove;
- MusicSoundBar.BeforeDraw += MusicSoundBar_BeforeDraw;
- MusicVolumeBar = new MirImageControl
- {
- Index = 20,
- Library = Libraries.Prguse,
- Location = new Point(155, 244),
- Parent = this,
- NotControl = true,
- };
- NewMoveOn = new MirButton
- {
- Library = Libraries.Title,
- Location = new Point(159, 296),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 853,
- };
- NewMoveOn.Click += (o, e) =>
- {
- Settings.NewMove = true;
- GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.NewMovementStyle), ChatType.Hint);
- };
- NewMoveOff = new MirButton
- {
- Library = Libraries.Title,
- Location = new Point(201, 296),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 850
- };
- NewMoveOff.Click += (o, e) =>
- {
- Settings.NewMove = false;
- GameScene.Scene.ChatDialog.ReceiveChat(GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.OldMovementStyle), ChatType.Hint);
- };
- ObserveOn = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(159, 271),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 457,
- };
- ObserveOn.Click += (o, e) => ToggleObserve(true);
- ObserveOff = new MirButton
- {
- Library = Libraries.Prguse2,
- Location = new Point(201, 271),
- Parent = this,
- Sound = SoundList.ButtonA,
- Size = new Size(36, 17),
- PressedIndex = 460
- };
- ObserveOff.Click += (o, e) => ToggleObserve(false);
- }
- private void ToggleObserve(bool allow)
- {
- if (GameScene.AllowObserve == allow) return;
- Network.Enqueue(new C.Chat
- {
- Message = "@ALLOWOBSERVE",
- });
- }
- public void ToggleSkillButtons(bool Ctrl)
- {
- foreach (KeyBind KeyCheck in CMain.InputKeys.Keylist)
- {
- if (KeyCheck.Key == Keys.None)
- continue;
- if ((KeyCheck.function < KeybindOptions.Bar1Skill1) || (KeyCheck.function > KeybindOptions.Bar2Skill8)) continue;
- //need to test this
- if ((KeyCheck.RequireCtrl != 1) && (KeyCheck.RequireTilde != 1)) continue;
- KeyCheck.RequireCtrl = (byte)(Ctrl ? 1 : 0);
- KeyCheck.RequireTilde = (byte)(Ctrl ? 0 : 1);
- }
- }
- private void SoundBar_MouseMove(object sender, MouseEventArgs e)
- {
- if (e.Button != MouseButtons.Left || SoundBar != ActiveControl) return;
- Point p = e.Location.Subtract(SoundBar.DisplayLocation);
- byte volume = (byte)(p.X / (double)SoundBar.Size.Width * 100);
- Settings.Volume = volume;
- double percent = Settings.Volume / 100D;
- SoundBar.Hint = $"{Settings.Volume}%";
- if (percent > 1) percent = 1;
- VolumeBar.Location = percent > 0 ? new Point(159 + (int)((SoundBar.Size.Width - 2) * percent), 218) : new Point(159, 218);
- }
- private void SoundBar_BeforeDraw(object sender, EventArgs e)
- {
- if (SoundBar.Library == null) return;
- double percent = Settings.Volume / 100D;
- SoundBar.Hint = $"{Settings.Volume}%";
- if (percent > 1) percent = 1;
- if (percent > 0)
- {
- Rectangle section = new Rectangle
- {
- Size = new Size((int)((SoundBar.Size.Width - 2) * percent), SoundBar.Size.Height)
- };
- SoundBar.Library.Draw(SoundBar.Index, section, SoundBar.DisplayLocation, Color.White, false);
- VolumeBar.Location = new Point(159 + section.Size.Width, 218);
- }
- else
- VolumeBar.Location = new Point(159, 218);
- }
- private void MusicSoundBar_BeforeDraw(object sender, EventArgs e)
- {
- if (MusicSoundBar.Library == null) return;
- double percent = Settings.MusicVolume / 100D;
- MusicSoundBar.Hint = $"{Settings.MusicVolume}%";
- if (percent > 1) percent = 1;
- if (percent > 0)
- {
- Rectangle section = new Rectangle
- {
- Size = new Size((int)((MusicSoundBar.Size.Width - 2) * percent), MusicSoundBar.Size.Height)
- };
- MusicSoundBar.Library.Draw(MusicSoundBar.Index, section, MusicSoundBar.DisplayLocation, Color.White, false);
- MusicVolumeBar.Location = new Point(159 + section.Size.Width, 244);
- }
- else
- MusicVolumeBar.Location = new Point(159, 244);
- }
- private void MusicSoundBar_MouseMove(object sender, MouseEventArgs e)
- {
- if (e.Button != MouseButtons.Left || MusicSoundBar != ActiveControl) return;
- Point p = e.Location.Subtract(MusicSoundBar.DisplayLocation);
- byte volume = (byte)(p.X / (double)MusicSoundBar.Size.Width * 100);
- Settings.MusicVolume = volume;
- double percent = Settings.MusicVolume / 100D;
- MusicSoundBar.Hint = $"{Settings.MusicVolume}%";
- if (percent > 1) percent = 1;
- MusicVolumeBar.Location = percent > 0 ? new Point(159 + (int)((MusicSoundBar.Size.Width - 2) * percent), 244) : new Point(159, 244);
- }
- private void OptionPanel_BeforeDraw(object sender, EventArgs e)
- {
- if (Settings.SkillMode)
- {
- SkillModeOn.Index = 452;
- SkillModeOff.Index = 453;
- }
- else
- {
- SkillModeOn.Index = 450;
- SkillModeOff.Index = 455;
- }
- if (Settings.SkillBar)
- {
- SkillBarOn.Index = 458;
- SkillBarOff.Index = 459;
- }
- else
- {
- SkillBarOn.Index = 456;
- SkillBarOff.Index = 461;
- }
- if (Settings.Effect)
- {
- EffectOn.Index = 458;
- EffectOff.Index = 459;
- }
- else
- {
- EffectOn.Index = 456;
- EffectOff.Index = 461;
- }
- if (Settings.DropView)
- {
- DropViewOn.Index = 458;
- DropViewOff.Index = 459;
- }
- else
- {
- DropViewOn.Index = 456;
- DropViewOff.Index = 461;
- }
- if (Settings.NameView)
- {
- NameViewOn.Index = 458;
- NameViewOff.Index = 459;
- }
- else
- {
- NameViewOn.Index = 456;
- NameViewOff.Index = 461;
- }
- if (Settings.HPView)
- {
- HPViewOn.Index = 464;
- HPViewOff.Index = 465;
- }
- else
- {
- HPViewOn.Index = 462;
- HPViewOff.Index = 467;
- }
- if (Settings.NewMove)
- {
- NewMoveOn.Index = 853;
- NewMoveOff.Index = 848;
- }
- else
- {
- NewMoveOn.Index = 851;
- NewMoveOff.Index = 850;
- }
- if (GameScene.AllowObserve)
- {
- ObserveOn.Index = 458;
- ObserveOff.Index = 459;
- }
- else
- {
- ObserveOn.Index = 456;
- ObserveOff.Index = 461;
- }
- }
- }
- public sealed class MenuDialog : MirImageControl
- {
- public MirButton ExitButton,
- LogOutButton,
- HelpButton,
- KeyboardLayoutButton,
- RankingButton,
- CraftingButton,
- IntelligentCreatureButton,
- RideButton,
- FishingButton,
- FriendButton,
- MentorButton,
- RelationshipButton,
- GroupButton,
- GuildButton;
- public MenuDialog()
- {
- Index = 567;
- Parent = GameScene.Scene;
- Library = Libraries.Title;
- Location = new Point(Settings.ScreenWidth - Size.Width, GameScene.Scene.MainDialog.Location.Y - this.Size.Height + 15);
- Sort = true;
- Visible = false;
- Movable = true;
- ExitButton = new MirButton
- {
- HoverIndex = 634,
- Index = 633,
- Parent = this,
- Library = Libraries.Title,
- Location = new Point(3, 12),
- PressedIndex = 635,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.ExitKey), CMain.InputKeys.GetKey(KeybindOptions.Exit))
- };
- ExitButton.Click += (o, e) => GameScene.Scene.QuitGame();
- LogOutButton = new MirButton
- {
- HoverIndex = 637,
- Index = 636,
- Parent = this,
- Library = Libraries.Title,
- Location = new Point(3, 31),
- PressedIndex = 638,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.LogOutKey), CMain.InputKeys.GetKey(KeybindOptions.Logout))
- };
- LogOutButton.Click += (o, e) => GameScene.Scene.LogOut();
- HelpButton = new MirButton
- {
- Index = 1970,
- HoverIndex = 1971,
- PressedIndex = 1972,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 50),
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.HelpKey), CMain.InputKeys.GetKey(KeybindOptions.Help))
- };
- HelpButton.Click += (o, e) =>
- {
- if (GameScene.Scene.HelpDialog.Visible)
- GameScene.Scene.HelpDialog.Hide();
- else GameScene.Scene.HelpDialog.Show();
- };
- KeyboardLayoutButton = new MirButton
- {
- Index = 1973,
- HoverIndex = 1974,
- PressedIndex = 1975,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 69),
- Visible = true,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.KeyboardKeybind), CMain.InputKeys.GetKey(KeybindOptions.Keybind))
- };
- KeyboardLayoutButton.Click += (o, e) =>
- {
- if (GameScene.Scene.KeyboardLayoutDialog.Visible)
- GameScene.Scene.KeyboardLayoutDialog.Hide();
- else GameScene.Scene.KeyboardLayoutDialog.Show();
- };
- RankingButton = new MirButton
- {
- Index = 2000,
- HoverIndex = 2001,
- PressedIndex = 2002,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 88),
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.RankingKey), CMain.InputKeys.GetKey(KeybindOptions.Ranking))
- //Visible = false
- };
- RankingButton.Click += (o, e) =>
- {
- if (GameScene.Scene.RankingDialog.Visible)
- GameScene.Scene.RankingDialog.Hide();
- else GameScene.Scene.RankingDialog.Show();
- };
- CraftingButton = new MirButton
- {
- Index = 2000,
- HoverIndex = 2001,
- PressedIndex = 2002,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 107),
- Visible = false
- };
- CraftingButton.Click += (o, e) =>
- {
- };
- IntelligentCreatureButton = new MirButton
- {
- Index = 431,
- HoverIndex = 432,
- PressedIndex = 433,
- Parent = this,
- Library = Libraries.Prguse2,
- Location = new Point(3, 126),
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.CreaturesKey), CMain.InputKeys.GetKey(KeybindOptions.Creature))
- };
- IntelligentCreatureButton.Click += (o, e) =>
- {
- if (GameScene.Scene.IntelligentCreatureDialog.Visible)
- GameScene.Scene.IntelligentCreatureDialog.Hide();
- else GameScene.Scene.IntelligentCreatureDialog.Show();
- };
- RideButton = new MirButton
- {
- Index = 1976,
- HoverIndex = 1977,
- PressedIndex = 1978,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 145),
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MountKey), CMain.InputKeys.GetKey(KeybindOptions.MountWindow))
- };
- RideButton.Click += (o, e) =>
- {
- if (GameScene.Scene.MountDialog.Visible)
- GameScene.Scene.MountDialog.Hide();
- else GameScene.Scene.MountDialog.Show();
- };
- FishingButton = new MirButton
- {
- Index = 1979,
- HoverIndex = 1980,
- PressedIndex = 1981,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 164),
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FishingKey), CMain.InputKeys.GetKey(KeybindOptions.Fishing))
- };
- FishingButton.Click += (o, e) =>
- {
- if (GameScene.Scene.FishingDialog.Visible)
- GameScene.Scene.FishingDialog.Hide();
- else GameScene.Scene.FishingDialog.Show();
- };
- FriendButton = new MirButton
- {
- Index = 1982,
- HoverIndex = 1983,
- PressedIndex = 1984,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 183),
- Visible = true,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.FriendsKey), CMain.InputKeys.GetKey(KeybindOptions.Friends))
- };
- FriendButton.Click += (o, e) =>
- {
- if (GameScene.Scene.FriendDialog.Visible)
- GameScene.Scene.FriendDialog.Hide();
- else GameScene.Scene.FriendDialog.Show();
- };
- MentorButton = new MirButton
- {
- Index = 1985,
- HoverIndex = 1986,
- PressedIndex = 1987,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 202),
- Visible = true,
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.MentorKey), CMain.InputKeys.GetKey(KeybindOptions.Mentor))
- };
- MentorButton.Click += (o, e) =>
- {
- if (GameScene.Scene.MentorDialog.Visible)
- GameScene.Scene.MentorDialog.Hide();
- else GameScene.Scene.MentorDialog.Show();
- };
- RelationshipButton = new MirButton /* lover button */
- {
- Index = 1988,
- HoverIndex = 1989,
- PressedIndex = 1990,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 221),
- Visible = true,
- Hint = string.Format( GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.RelationshipKey), CMain.InputKeys.GetKey(KeybindOptions.Relationship))
- };
- RelationshipButton.Click += (o, e) =>
- {
- if (GameScene.Scene.RelationshipDialog.Visible)
- GameScene.Scene.RelationshipDialog.Hide();
- else GameScene.Scene.RelationshipDialog.Show();
- };
- GroupButton = new MirButton
- {
- Index = 1991,
- HoverIndex = 1992,
- PressedIndex = 1993,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 240),
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.GroupsKey), CMain.InputKeys.GetKey(KeybindOptions.Group))
- };
- GroupButton.Click += (o, e) =>
- {
- if (GameScene.Scene.GroupDialog.Visible)
- GameScene.Scene.GroupDialog.Hide();
- else GameScene.Scene.GroupDialog.Show();
- };
- GuildButton = new MirButton
- {
- Index = 1994,
- HoverIndex = 1995,
- PressedIndex = 1996,
- Parent = this,
- Library = Libraries.Prguse,
- Location = new Point(3, 259),
- Hint = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.GuildKey), CMain.InputKeys.GetKey(KeybindOptions.Guilds))
- };
- GuildButton.Click += (o, e) =>
- {
- if (GameScene.Scene.GuildDialog.Visible)
- GameScene.Scene.GuildDialog.Hide();
- else GameScene.Scene.GuildDialog.Show();
- };
- }
- }
- public sealed class MagicButton : MirControl
- {
- public MirImageControl LevelImage, ExpImage;
- public MirButton SkillButton;
- public MirLabel LevelLabel, NameLabel, ExpLabel, KeyLabel;
- public ClientMagic Magic;
- public MirImageControl CoolDown;
- public bool HeroMagic;
- string[] Prefixes = new string[] { "", "CTRL", "Shift" };
- public MagicButton()
- {
- Size = new Size(231, 33);
- SkillButton = new MirButton
- {
- Index = 0,
- PressedIndex = 1,
- Library = Libraries.MagIcon2,
- Parent = this,
- Location = new Point(36, 0),
- Sound = SoundList.ButtonA,
- };
- SkillButton.Click += (o, e) =>
- {
- if (HeroMagic)
- {
- if (GameScene.Hero == null || GameScene.Hero.Dead)
- return;
- new AssignKeyPanel(Magic, 17, new string[]
- {
- "Shift" + Environment.NewLine + "F1",
- "Shift" + Environment.NewLine + "F2",
- "Shift" + Environment.NewLine + "F3",
- "Shift" + Environment.NewLine + "F4",
- "Shift" + Environment.NewLine + "F5",
- "Shift" + Environment.NewLine + "F6",
- "Shift" + Environment.NewLine + "F7",
- "Shift" + Environment.NewLine + "F8"
- })
- { Actor = GameScene.Hero };
- }
- else
- {
- new AssignKeyPanel(Magic, 1, new string[]
- {
- "F1",
- "F2",
- "F3",
- "F4",
- "F5",
- "F6",
- "F7",
- "F8",
- "Ctrl" + Environment.NewLine + "F1",
- "Ctrl" + Environment.NewLine + "F2",
- "Ctrl" + Environment.NewLine + "F3",
- "Ctrl" + Environment.NewLine + "F4",
- "Ctrl" + Environment.NewLine + "F5",
- "Ctrl" + Environment.NewLine + "F6",
- "Ctrl" + Environment.NewLine + "F7",
- "Ctrl" + Environment.NewLine + "F8"
- })
- { Actor = GameScene.User };
- }
- };
- LevelImage = new MirImageControl
- {
- Index = 516,
- Library = Libraries.Title,
- Location = new Point(73, 7),
- Parent = this,
- NotControl = true,
- };
- ExpImage = new MirImageControl
- {
- Index = 517,
- Library = Libraries.Title,
- Location = new Point(73, 19),
- Parent = this,
- NotControl = true,
- };
- LevelLabel = new MirLabel
- {
- AutoSize = true,
- Parent = this,
- Location = new Point(88, 2),
- NotControl = true,
- };
- NameLabel = new MirLabel
- {
- AutoSize = true,
- Parent = this,
- Location = new Point(109, 2),
- NotControl = true,
- };
- ExpLabel = new MirLabel
- {
- AutoSize = true,
- Parent = this,
- Location = new Point(109, 15),
- NotControl = true,
- };
- KeyLabel = new MirLabel
- {
- AutoSize = true,
- Parent = this,
- Location = new Point(2, 2),
- NotControl = true,
- };
- CoolDown = new MirImageControl
- {
- Library = Libraries.Prguse2,
- Parent = this,
- Location = new Point(36, 0),
- Opacity = 0.6F,
- NotControl = true,
- UseOffSet = true,
- };
- }
- public void Update(ClientMagic magic)
- {
- Magic = magic;
- NameLabel.Text = Magic.Name;
- LevelLabel.Text = Magic.Level.ToString();
- switch (Magic.Level)
- {
- case 0:
- ExpLabel.Text = string.Format("{0}/{1}", Magic.Experience, Magic.Need1);
- break;
- case 1:
- ExpLabel.Text = string.Format("{0}/{1}", Magic.Experience, Magic.Need2);
- break;
- case 2:
- ExpLabel.Text = string.Format("{0}/{1}", Magic.Experience, Magic.Need3);
- break;
- case 3:
- ExpLabel.Text = "-";
- break;
- }
- KeyLabel.Text = Magic.Key == 0 ? string.Empty : string.Format("{0}{1}F{2}",
- Prefixes[(Magic.Key - 1) / 8],
- Magic.Key > 8 ? Environment.NewLine : string.Empty,
- (Magic.Key - 1) % 8 + 1);
- switch (magic.Spell)
- { //Warrior
- case Spell.Fencing:
- 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);
- break;
- case Spell.Slaying:
- 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);
- break;
- case Spell.Thrusting:
- 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);
- break;
- case Spell.Rage:
- 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);
- break;
- case Spell.ProtectionField:
- 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);
- break;
- case Spell.HalfMoon:
- 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);
- break;
- case Spell.FlamingSword:
- 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);
- break;
- case Spell.ShoulderDash:
- 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);
- break;
- case Spell.CrossHalfMoon:
- 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);
- break;
- case Spell.TwinDrakeBlade:
- 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);
- break;
- case Spell.Entrapment:
- 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);
- break;
- case Spell.LionRoar:
- 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);
- break;
- case Spell.CounterAttack:
- 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);
- break;
- case Spell.ImmortalSkin:
- 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);
- break;
- case Spell.Fury:
- 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);
- break;
- case Spell.SlashingBurst:
- 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);
- break;
- case Spell.BladeAvalanche:
- 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);
- break;
- //Wizard
- case Spell.FireBall:
- 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);
- break;
- case Spell.ThunderBolt:
- 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);
- break;
- case Spell.GreatFireBall:
- 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);
- break;
- case Spell.Repulsion:
- 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);
- break;
- case Spell.HellFire:
- 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);
- break;
- case Spell.Lightning:
- 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);
- break;
- case Spell.ElectricShock:
- 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);
- break;
- case Spell.Teleport:
- 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);
- break;
- case Spell.FireWall:
- 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);
- break;
- case Spell.FireBang:
- 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);
- break;
- case Spell.ThunderStorm:
- 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);
- break;
- case Spell.MagicShield:
- 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);
- break;
- case Spell.TurnUndead:
- 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);
- break;
- case Spell.IceStorm:
- 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);
- break;
- case Spell.FlameDisruptor:
- 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);
- break;
- case Spell.FrostCrunch:
- 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);
- break;
- case Spell.Mirroring:
- 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);
- break;
- case Spell.FlameField:
- 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);
- break;
- case Spell.Vampirism:
- 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);
- break;
- case Spell.Blizzard:
- 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);
- break;
- case Spell.MeteorStrike:
- 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);
- break;
- case Spell.IceThrust:
- 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);
- break;
- case Spell.MagicBooster:
- 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);
- break;
- case Spell.FastMove:
- 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);
- break;
- case Spell.StormEscape:
- 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);
- break;
- case Spell.Blink:
- 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);
- break;
- //Taoist
- case Spell.SpiritSword:
- 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);
- break;
- case Spell.Healing:
- 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);
- break;
- case Spell.Poisoning:
- 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);
- break;
- case Spell.SoulFireBall:
- 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);
- break;
- case Spell.SoulShield:
- 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);
- break;
- case Spell.BlessedArmour:
- 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);
- break;
- case Spell.TrapHexagon:
- 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);
- break;
- case Spell.SummonSkeleton:
- 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);
- break;
- case Spell.Hiding:
- 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);
- break;
- case Spell.MassHiding:
- 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);
- break;
- case Spell.Revelation:
- 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);
- break;
- case Spell.MassHealing:
- 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);
- break;
- case Spell.SummonShinsu:
- 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);
- break;
- case Spell.UltimateEnhancer:
- 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);
- break;
- case Spell.EnergyRepulsor:
- 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);
- break;
- case Spell.Purification:
- 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);
- break;
- case Spell.SummonHolyDeva:
- 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);
- break;
- case Spell.Curse:
- 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);
- break;
- case Spell.Hallucination:
- 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);
- break;
- case Spell.Reincarnation:
- 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);
- break;
- case Spell.PoisonCloud:
- 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);
- break;
- case Spell.EnergyShield:
- 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);
- break;
- case Spell.Plague:
- 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);
- break;
- case Spell.HealingCircle:
- 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);
- break;
- case Spell.PetEnhancer:
- 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);
- break;
- //Assassin
- case Spell.FatalSword:
- 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);
- break;
- case Spell.DoubleSlash:
- 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);
- break;
- case Spell.Haste:
- 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);
- break;
- case Spell.FlashDash:
- 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);
- break;
- case Spell.HeavenlySword:
- 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);
- break;
- case Spell.FireBurst:
- 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);
- break;
- case Spell.Trap:
- 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);
- break;
- case Spell.MoonLight:
- 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);
- break;
- case Spell.MPEater:
- 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);
- break;
- case Spell.SwiftFeet:
- 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);
- break;
- case Spell.LightBody:
- 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);
- break;
- case Spell.PoisonSword:
- 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);
- break;
- case Spell.DarkBody:
- 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);
- break;
- case Spell.CrescentSlash:
- 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);
- break;
- case Spell.Hemorrhage:
- 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);
- break;
- case Spell.MoonMist:
- 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);
- break;
- //Archer
- case Spell.Focus:
- 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);
- break;
- case Spell.StraightShot:
- 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);
- break;
- case Spell.DoubleShot:
- 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);
- break;
- case Spell.ExplosiveTrap:
- 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);
- break;
- case Spell.DelayedExplosion:
- 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);
- break;
- case Spell.Meditation:
- 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);
- break;
- case Spell.BackStep:
- 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);
- break;
- case Spell.ElementalShot:
- 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);
- break;
- case Spell.Concentration:
- 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);
- break;
- case Spell.Stonetrap:
- 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);
- break;
- case Spell.ElementalBarrier:
- 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);
- break;
- case Spell.SummonVampire:
- 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);
- break;
- case Spell.VampireShot:
- 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);
- break;
- case Spell.SummonToad:
- 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);
- break;
- case Spell.PoisonShot:
- 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);
- break;
- case Spell.CrippleShot:
- 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);
- break;
- case Spell.SummonSnakes:
- 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);
- break;
- case Spell.NapalmShot:
- 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);
- break;
- case Spell.OneWithNature:
- 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);
- break;
- default:
- break;
- }
- SkillButton.Index = Magic.Icon * 2;
- SkillButton.PressedIndex = Magic.Icon * 2 + 1;
- SetDelay();
- }
- public void SetDelay()
- {
- if (Magic == null) return;
- int totalFrames = 34;
- long timeLeft = Magic.CastTime + Magic.Delay - CMain.Time;
- if (timeLeft < 100)
- {
- CoolDown.Visible = false;
- return;
- }
- int delayPerFrame = (int)(Magic.Delay / totalFrames);
- int startFrame = totalFrames - (int)(timeLeft / delayPerFrame);
- if ((CMain.Time <= Magic.CastTime + Magic.Delay))
- {
- CoolDown.Visible = true;
- CoolDown.Index = 1290 + startFrame;
- }
- }
- }
- public sealed class AssignKeyPanel : MirImageControl
- {
- public MirButton SaveButton, NoneButton;
- public UserObject Actor;
- public MirLabel TitleLabel;
- public MirImageControl MagicImage;
- public MirButton[] FKeys;
- public ClientMagic Magic;
- public byte Key;
- public byte KeyOffset;
- public AssignKeyPanel(ClientMagic magic, byte keyOffset, string[] keyStrings)
- {
- Magic = magic;
- Key = magic.Key;
- KeyOffset = keyOffset;
- Modal = true;
- Index = 710;
- Library = Libraries.Prguse;
- Location = Center;
- Parent = GameScene.Scene;
- Visible = true;
- MagicImage = new MirImageControl
- {
- Location = new Point(16, 16),
- Index = magic.Icon * 2,
- Library = Libraries.MagIcon2,
- Parent = this,
- };
- TitleLabel = new MirLabel
- {
- Location = new Point(49, 17),
- Parent = this,
- Size = new Size(230, 32),
- DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.WordBreak,
- Text = GameLanguage.ClientTextMap.GetLocalization((ClientTextKeys.SelectKey), magic.Name)
- };
- NoneButton = new MirButton
- {
- Index = 287, //154
- HoverIndex = 288,
- PressedIndex = 289,
- Library = Libraries.Title,
- Parent = this,
- Location = new Point(284, 64),
- };
- NoneButton.Click += (o, e) => Key = 0;
- SaveButton = new MirButton
- {
- Library = Libraries.Title,
- Parent = this,
- Location = new Point(284, 101),
- Index = 156,
- HoverIndex = 157,
- PressedIndex = 158,
- };
- SaveButton.Click += (o, e) =>
- {
- for (int i = 0; i < Actor.Magics.Count; i++)
- {
- if (Actor.Magics[i].Key == Key)
- Actor.Magics[i].Key = 0;
- }
- Network.Enqueue(new C.MagicKey { Spell = Magic.Spell, Key = Key, OldKey = Magic.Key });
- Magic.Key = Key;
- foreach (SkillBarDialog Bar in GameScene.Scene.SkillBarDialogs)
- Bar.Update();
- Dispose();
- };
- FKeys = new MirButton[keyStrings.Length];
- for (byte i = 0; i < FKeys.Length; i++)
- {
- FKeys[i] = new MirButton
- {
- Index = 0,
- PressedIndex = 1,
- Library = Libraries.Prguse,
- Parent = this,
- Location = new Point(17 + 32 * (i % 8) + 5 * (i % 8 / 4), 58 + 37 * (i / 8)),
- Sound = SoundList.ButtonA,
- Text = keyStrings[i]
- };
- int num = i + keyOffset;
- FKeys[i].Click += (o, e) =>
- {
- Key = (byte)num;
- };
- }
- BeforeDraw += AssignKeyPanel_BeforeDraw;
- }
- private void AssignKeyPanel_BeforeDraw(object sender, EventArgs e)
- {
- for (int i = 0; i < FKeys.Length; i++)
- {
- FKeys[i].Index = 1656;
- FKeys[i].HoverIndex = 1657;
- FKeys[i].PressedIndex = 1658;
- FKeys[i].Visible = true;
- }
- int key = Key - KeyOffset;
- if (key < 0 || key > FKeys.Length) return;
- FKeys[key].Index = 1658;
- FKeys[key].HoverIndex = 1658;
- FKeys[key].PressedIndex = 1658;
- }
- }
- public sealed class DuraStatusDialog : MirImageControl
- {
- public MirButton Character;
- public DuraStatusDialog()
- {
- Size = new Size(40, 19);
- Location = new Point((GameScene.Scene.MiniMapDialog.Location.X + 86), GameScene.Scene.MiniMapDialog.Size.Height);
- Character = new MirButton()
- {
- Index = 2113,
- Library = Libraries.Prguse,
- Parent = this,
- Size = new Size(20, 19),
- Location = new Point(20, 0),
- HoverIndex = 2111,
- PressedIndex = 2112,
- Sound = SoundList.ButtonA,
- Hint = GameLanguage.ClientTextMap.GetLocalization(ClientTextKeys.DuraPanel)
- };
- Character.Click += (o, e) =>
- {
- if (GameScene.Scene.CharacterDuraPanel.Visible == true)
- {
- GameScene.Scene.CharacterDuraPanel.Hide();
- Settings.DuraView = false;
- }
- else
- {
- GameScene.Scene.CharacterDuraPanel.Show();
- Settings.DuraView = true;
- }
- };
- }
- }
- public sealed class CharacterDuraPanel : MirImageControl
- {
- public MirImageControl GrayBackground, Background, Helmet, Armour, Belt, Boots, Weapon, Necklace, RightBracelet, LeftBracelet, RightRing, LeftRing, Torch, Stone, Amulet, Mount, Item1, Item2;
- public CharacterDuraPanel()
- {
- Index = 2105;
- Library = Libraries.Prguse;
- Movable = false;
- Location = new Point(Settings.ScreenWidth - 61, 200);
- GrayBackground = new MirImageControl()
- {
- Index = 2161,
- Library = Libraries.Prguse,
- Parent = this,
- Size = new Size(56, 80),
- Location = new Point(3, 3),
- Opacity = 0.4F
- };
- Background = new MirImageControl()
- {
- Index = 2162,
- Library = Libraries.Prguse,
- Parent = this,
- Size = new Size(56, 80),
- Location = new Point(3, 3),
- };
- #region Pieces
- Helmet = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(24, 3) };
- Belt = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 7), Location = new Point(23, 23) };
- Armour = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(28, 32), Location = new Point(16, 11) };
- Boots = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(24, 9), Location = new Point(17, 43) };
- Weapon = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 33), Location = new Point(4, 5) };
- Necklace = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(3, 67) };
- LeftBracelet = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 8), Location = new Point(3, 43) };
- RightBracelet = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 8), Location = new Point(43, 43) };
- LeftRing = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(3, 54) };
- RightRing = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(43, 54) };
- Torch = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(8, 32), Location = new Point(44, 5) };
- Stone = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(30, 54) };
- Amulet = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(16, 54) };
- Mount = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(12, 12), Location = new Point(43, 68) };
- Item1 = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(8, 12), Location = new Point(19, 67) };
- Item2 = new MirImageControl() { Index = -1, Library = Libraries.Prguse, Parent = Background, Size = new Size(8, 12), Location = new Point(31, 67) };
- #endregion
- }
- public void GetCharacterDura()
- {
- if (GameScene.Scene.CharacterDialog.Grid[0].Item == null) { Weapon.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[1].Item == null) { Armour.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[2].Item == null) { Helmet.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[3].Item == null) { Torch.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[4].Item == null) { Necklace.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[5].Item == null) { LeftBracelet.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[6].Item == null) { RightBracelet.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[7].Item == null) { LeftRing.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[8].Item == null) { RightRing.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[9].Item == null) { Amulet.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[10].Item == null) { Belt.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[11].Item == null) { Boots.Index = -1; }
- if (GameScene.Scene.CharacterDialog.Grid[12].Item == null) { Stone.Index = -1; }
- for (int i = 0; i < MapObject.User.Equipment.Length; i++)
- {
- if (MapObject.User.Equipment[i] == null) continue;
- UpdateCharacterDura(MapObject.User.Equipment[i]);
- }
- }
- public void UpdateCharacterDura(UserItem item)
- {
- int Warning = item.MaxDura / 2;
- int Danger = item.MaxDura / 5;
- ushort AmuletWarning = (ushort)(item.Info.StackSize / 2);
- ushort AmuletDanger = (ushort)(item.Info.StackSize / 5);
- switch (item.Info.Type)
- {
- case ItemType.Amulet: //Based on stacks of 5000
- if (item.Count > AmuletWarning)
- Amulet.Index = 2134;
- if (item.Count <= AmuletWarning)
- Amulet.Index = 2135;
- if (item.Count <= AmuletDanger)
- Amulet.Index = 2136;
- if (item.Count == 0)
- Amulet.Index = -1;
- break;
- case ItemType.Armour:
- if (item.CurrentDura > Warning)
- Armour.Index = 2149;
- if (item.CurrentDura <= Warning)
- Armour.Index = 2150;
- if (item.CurrentDura <= Danger)
- Armour.Index = 2151;
- if (item.CurrentDura == 0)
- Armour.Index = -1;
- break;
- case ItemType.Belt:
- if (item.CurrentDura > Warning)
- Belt.Index = 2158;
- if (item.CurrentDura <= Warning)
- Belt.Index = 2159;
- if (item.CurrentDura <= Danger)
- Belt.Index = 2160;
- if (item.CurrentDura == 0)
- Belt.Index = -1;
- break;
- case ItemType.Boots:
- if (item.CurrentDura > Warning)
- Boots.Index = 2152;
- if (item.CurrentDura <= Warning)
- Boots.Index = 2153;
- if (item.CurrentDura <= Danger)
- Boots.Index = 2154;
- if (item.CurrentDura == 0)
- Boots.Index = -1;
- break;
- case ItemType.Bracelet:
- if (GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.BraceletR].Item != null && item.UniqueID == GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.BraceletR].Item.UniqueID)
- {
- if (item.CurrentDura > Warning)
- RightBracelet.Index = 2143;
- if (item.CurrentDura <= Warning)
- RightBracelet.Index = 2144;
- if (item.CurrentDura <= Danger)
- RightBracelet.Index = 2145;
- if (item.CurrentDura == 0)
- RightBracelet.Index = -1;
- }
- else if (GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.BraceletL].Item != null && item.UniqueID == GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.BraceletL].Item.UniqueID)
- {
- if (item.CurrentDura > Warning)
- LeftBracelet.Index = 2143;
- if (item.CurrentDura <= Warning)
- LeftBracelet.Index = 2144;
- if (item.CurrentDura <= Danger)
- LeftBracelet.Index = 2145;
- if (item.CurrentDura == 0)
- LeftBracelet.Index = -1;
- }
- break;
- case ItemType.Helmet:
- if (item.CurrentDura > Warning)
- Helmet.Index = 2155;
- if (item.CurrentDura <= Warning)
- Helmet.Index = 2156;
- if (item.CurrentDura <= Danger)
- Helmet.Index = 2157;
- if (item.CurrentDura == 0)
- Helmet.Index = -1;
- break;
- case ItemType.Necklace:
- if (item.CurrentDura > Warning)
- Necklace.Index = 2122;
- if (item.CurrentDura <= Warning)
- Necklace.Index = 2123;
- if (item.CurrentDura <= Danger)
- Necklace.Index = 2124;
- if (item.CurrentDura == 0)
- Necklace.Index = -1;
- break;
- case ItemType.Ring:
- if (GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.RingR].Item != null && item.UniqueID == GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.RingR].Item.UniqueID)
- {
- if (item.CurrentDura > Warning)
- RightRing.Index = 2131;
- if (item.CurrentDura <= Warning)
- RightRing.Index = 2132;
- if (item.CurrentDura <= Danger)
- RightRing.Index = 2133;
- if (item.CurrentDura == 0)
- RightRing.Index = -1;
- }
- else if (GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.RingL].Item != null && item.UniqueID == GameScene.Scene.CharacterDialog.Grid[(byte)EquipmentSlot.RingL].Item.UniqueID)
- {
- if (item.CurrentDura > Warning)
- LeftRing.Index = 2131;
- if (item.CurrentDura <= Warning)
- LeftRing.Index = 2132;
- if (item.CurrentDura <= Danger)
- LeftRing.Index = 2133;
- if (item.CurrentDura == 0)
- LeftRing.Index = -1;
- }
- break;
- case ItemType.Stone:
- if (item.CurrentDura == 0)
- Stone.Index = 2137;
- break;
- case ItemType.Mount:
- if (item.CurrentDura > Warning)
- Mount.Index = 2140;
- if (item.CurrentDura <= Warning)
- Mount.Index = 2141;
- if (item.CurrentDura <= Danger)
- Mount.Index = 2142;
- if (item.CurrentDura == 0)
- Mount.Index = -1;
- break;
- case ItemType.Torch:
- if (item.CurrentDura > Warning)
- Torch.Index = 2146;
- if (item.CurrentDura <= Warning)
- Torch.Index = 2147;
- if (item.CurrentDura <= Danger)
- Torch.Index = 2148;
- if (item.CurrentDura == 0)
- Torch.Index = -1;
- break;
- case ItemType.Weapon:
- if (item.CurrentDura > Warning)
- Weapon.Index = 2125;
- if (item.CurrentDura <= Warning)
- Weapon.Index = 2126;
- if (item.CurrentDura <= Danger)
- Weapon.Index = 2127;
- if (item.CurrentDura == 0)
- Weapon.Index = -1;
- break;
- }
- }
- public override void Hide()
- {
- if (!Visible) return;
- Visible = false;
- GameScene.Scene.DuraStatusPanel.Character.Index = 2113;
- }
- public override void Show()
- {
- if (Visible) return;
- Visible = true;
- GameScene.Scene.DuraStatusPanel.Character.Index = 2110;
- GetCharacterDura();
- }
- }
- }
|