internal StringConstructor(InventoryObject io) { _io = io; }
private void Storage_Identified(object sender, int ObjectId) { try { if (mCurrentStoragePendingIds.Count == 0) { return; } if (Core.Actions.OpenedContainer != mCurrentStorage.StorageChestGUID) { foreach (int PartialObject in mCurrentStoragePendingIds) { InventoryObject io = new InventoryObject(AetherObjects.Collection[ObjectId], @mCurrentStorage.OwnerName + @"'s Storage"); mCurrentStorage.StorageChestItems.Add(io); } WriteToChat("Warning: Storage closed with Object Identifications pending."); WriteToChat("Warning: " + mCurrentStoragePendingIds.Count + " items stored without identification."); WriteToChat("Reopen the storage chest to complete the identification of items."); mCurrentStoragePendingIds.Clear(); } else { if (AetherObjects.Collection[ObjectId].ObjectClass == AObjectClass.Container) { if (AetherObjects.Collection[ObjectId].Name.Contains("Storage")) { mCurrentStoragePendingIds.Remove(ObjectId); mCurrentStorage.ServerKey = @GearFiles.ServerKey; mCurrentStorage.OwnerName = @AetherObjects.Collection[mCurrentStorage.StorageChestGUID].Values(AStringValueKeys.FullDescription).Trim().Substring(9); mCurrentStorage.ChestKey = @mCurrentStorage.ServerKey + "_" + @mCurrentStorage.OwnerName; mCurrentStorage.LastUpdateTime = DateTime.Now.ToString(); } else { mCurrentStoragePendingIds.Remove(ObjectId); } } else { mCurrentStoragePendingIds.Remove(ObjectId); mCurrentStorage.StorageChestItems.RemoveWhere(x => x.Id == ObjectId); InventoryObject io = new InventoryObject(AetherObjects.Collection[ObjectId], @mCurrentStorage.OwnerName + @"'s Storage"); mCurrentStorage.StorageChestItems.Add(io); } } if (mCurrentStoragePendingIds.Count == 0) { if (Core.Actions.OpenedContainer != 0) { WriteToChat("Storage update complete. Storage can be closed."); } iLockerUpdate.bSubmitStorage = true; } UpdateInventoryPendingValues(); } catch (Exception ex) { LogError(ex); } }
private void UpdateInvDisplayHud(InventoryObject inv) { try { HudList.HudListRowAccessor HudRow; if (InvDisplayHudView == null) { return; } InvDisplayIcon.Image = inv.Icon + 0x6000000; StringConstructor sc = new StringConstructor(inv); foreach (string prop in sc.ReportInfo.Trim().Split(';')) { HudRow = InvDisplayList.AddRow(); ((HudStaticText)HudRow[0]).Text = prop.Trim(); } WriteToChat(sc.ReportInfo.Trim()); } catch (Exception ex) { LogError(ex); } }
private void Inventory_Identified(object sender, int ObjectId) { try { if (mCurrentInventoryPendingIds.Count == 0) { return; } if (mCurrentInventoryPendingIds.Contains(ObjectId)) { mCurrentInventoryPendingIds.Remove(ObjectId); if(!AetherObjects.IsInInventory(ObjectId)) {return;} glCharacterInventory.InventoryItems.RemoveWhere(x => x.Id == ObjectId); InventoryObject io = new InventoryObject(AetherObjects.Collection[ObjectId], @AetherCharacter.CharStats.Name); glCharacterInventory.InventoryItems.Add(io); iLockerUpdate.bSubmitInventory = true; if (mCurrentInventoryPendingIds.Count == 0) { WriteToChat("Character inventory update complete."); } UpdateInventoryPendingValues(); } } catch (Exception ex) { LogError(ex); } }