private void OtherOfferCatalog_OnSelectionChange(int selection) { var elemItem = OtherOfferCatalog.Selected[selection]; var item = OtherOffer.ObjectOffer.FirstOrDefault(x => x != null && (x.PID == (uint)elemItem.Tag || (x.PID < 3 && (uint)elemItem.Tag == x.GUID))); if (item == null) { return; } var oldGUID = item.GUID; if (item.LotID > 0) { item.GUID = (uint)((item.GUID == 1) ? 0x3495FC60 : 0x34B4B46A); } var BuyItem = CreateObjGroup(item); item.GUID = oldGUID; if (BuyItem == null) { return; } if (item.LotID > 0) { BuyItem.Name = elemItem.Item.Name; } QueryPanel.SetInfo(LotController.vm, BuyItem.Objects[0], true); QueryPanel.Mode = 2; QueryPanel.Tab = 1; QueryPanel.Active = true; BuyItem.Delete(LotController.vm.Context); }
private void Catalog_OnSelectionChange(int selection) { if (selection >= CurrentInventory.Count) { return; } var item = CurrentInventory[selection]; Catalog.SetActive(selection, true); var BuyItem = LotController.vm.Context.CreateObjectInstance(item.Item.GUID, LotView.Model.LotTilePos.OUT_OF_WORLD, LotView.Model.Direction.NORTH, true); if (BuyItem == null || BuyItem.Objects.Count == 0) { BuyItem = null; return; //uh } if (item.Item.Name != null && item.Item.Name != "") { BuyItem.Name = item.Item.Name; } if (item.Item.DisableLevel > 1 && ((VMTSOAvatarState)LotController.ActiveEntity.TSOState).Permissions < VMTSOAvatarPermissions.Admin) { HIT.HITVM.Get().PlaySoundEvent(UISounds.Error); QueryPanel.Active = false; return; //can't trade this } QueryPanel.InInventory = 1; QueryPanel.SetInfo(LotController.vm, BuyItem.Objects[0], false); QueryPanel.Mode = 2; QueryPanel.Tab = 0; QueryPanel.Active = true; BuyItem.Delete(LotController.vm.Context); if (item.Tag is uint) { BeginDrag(item, (uint)(item.Tag)); } }