private void LoadRidable() { Ridable ridable = _listView.SelectedItem as Ridable; if (ridable != null) { if (Ridable_Selected != null) { Ridable_Selected.Invoke(this, ridable); } } }
void _ridableSelect_Ridable_Selected(object sender, Ridable ridable) { if (ridable == null) { return; } Player player = Client.Instance.GetPlayer(); M2SceneNode node = ModelSceneService.Instance.MainM2SceneNode; if (player == null || node == null || node.Type != M2Type.MT_CHARACTER || node.IsNpc) { return; } if (ridable.NpcId == 0) { player.RideOnModel(0, E_M2_STATES.EMS_STAND); } else { player.RideOnModel(ridable.NpcId, GetStateByMountFlag(ridable.MountFlag)); } }
private bool IsMatch(object ride) { Ridable i = ride as Ridable; return(-1 != i.Name.IndexOf(filter.Text, StringComparison.CurrentCultureIgnoreCase)); }