private void HandleLeftClick() { bool mouseClicked = _currMouseState.LeftButton == ButtonState.Released && _prevMouseState.LeftButton == ButtonState.Pressed; if (mouseClicked && DrawArea.ContainsPoint(_currMouseState.X, _currMouseState.Y)) { if (OldWorld.Instance.MainPlayer.ActiveCharacter.NeedsSpellTarget) { var data = OldWorld.Instance.ESF[OldWorld.Instance.MainPlayer.ActiveCharacter.SelectedSpell]; if (data.TargetRestrict != SpellTargetRestrict.Friendly) { OldWorld.Instance.ActiveCharacterRenderer.SetSpellTarget(this); } else { //todo status label message "you cannot attack this NPC" OldWorld.Instance.MainPlayer.ActiveCharacter.SelectSpell(-1); } return; //don't process regular click on NPC while targeting a spell } PacketAPI api = ((EOGame)Game).API; switch (NPC.Data.Type) { case NPCType.Shop: ShopDialog.Show(api, this); break; case NPCType.Inn: break; case NPCType.Bank: BankAccountDialog.Show(api, NPC.Index); break; case NPCType.Barber: break; case NPCType.Guild: break; case NPCType.Priest: break; case NPCType.Law: break; case NPCType.Skills: SkillmasterDialog.Show(api, NPC.Index); break; case NPCType.Quest: QuestDialog.Show(api, NPC.Index, NPC.Data.VendorID, NPC.Data.Name); break; } } }
private void UIButtonRegBankAccount_Click(object sender, RoutedEventArgs e) { OpOp.AddBankAccount.Balance = "0"; OpOp.AddBankAccount.IdCurrency = UIBankAccountForm.IdCurrency; OpOp.AddBankAccount.IdCustomer = UIFindClient.IdClient; if (OpOp.AddBankAccount.Execute()) { var dg = new BankAccountDialog(); dg.TextMessage = OpOp.AddBankAccount.Information; dg.Owner = Application.Current.MainWindow; dg.ShowDialog(); var rs = dg.Result; switch (rs) { case 1: var bb = new EditBankAccount(); bb.UIFindBankAccount.FindByNumber(OpOp.AddBankAccount.AccountNumber); (Application.Current.MainWindow as IFrame).SetFrame(bb); return; case 2: var aa = new RegAC(); aa.UIFindAB.FindByNumber(OpOp.AddBankAccount.AccountNumber); (Application.Current.MainWindow as IFrame).SetFrame(aa); return; case 3: var rb = new RegBankAccount { }; rb.UIFindClient.FindById(OpOp.AddBankAccount.IdCustomer); (Application.Current.MainWindow as IFrame).SetFrame(rb); return; } var ci = new GetClientInfo(); ci.GetClientInfo_Loaded(null, null); ci.UIFindClient.FindById(OpOp.AddBankAccount.IdCustomer); ci.FindClient(null, null); (Application.Current.MainWindow as IFrame).SetFrame(ci); UIBankAccountForm.ClearUI(); } UIMessage.TextMessage = OpOp.AddBankAccount.Information; }