public virtual void ClickedInInventory(GameObject item) { EquipItemPackage objectToSend = new EquipItemPackage(); objectToSend.SessionID = Globals.SessionID; Data.Items.Item itemDat = item.GetComponent <EquipmentItem>().item_dat; objectToSend.Item = itemDat; Globals.con.SendObject <EquipItemPackage>("EquipItem", objectToSend); Debug.Log((object)"Clicked..."); }
public static Item[] GetAllVersionsWithMedia(Item item) { if (item == null) return null; bool multilanguage = IsMultilanguagePicture(item); if (!multilanguage && IsMediaItem(item)) return new Item[] { item }; return item.Versions.GetVersions(multilanguage).Where(IsMediaItem).ToArray(); }
public static void UpdateInventory() { bool reload = false; foreach (GameObject invItem in Globals._Inventory.GetComponent <Inventory>().items) { bool found = false; DraggableItem di = invItem.GetComponent <DraggableItem>(); Data.Items.Item item = di.item_dat; foreach (Data.Characters.Inventory.Inventory.ItemData dat in Globals.InventoryItemsNew) { if (dat.Item.Name == item.Name) { found = true; } } if (!found) { reload = true; } } foreach (Data.Characters.Inventory.Inventory.ItemData dat in Globals.InventoryItemsNew) { bool found1 = false; foreach (GameObject invItem in Globals._Inventory.GetComponent <Inventory>().items) { if (dat.Item.Name == invItem.GetComponent <DraggableItem>().item_dat.Name) { found1 = true; } } if (!found1) { reload = true; } } if (reload) { Globals._Inventory.GetComponent <Inventory>().items.Clear(); foreach (Data.Characters.Inventory.Inventory.ItemData dat in Globals.InventoryItemsNew) { GameObject newItem = GameObject.Instantiate(GameObject.Find("DragMe")); newItem.AddComponent <DraggableItem>(); newItem.GetComponent <DraggableItem>().item_name = dat.Item.Name; newItem.GetComponent <DraggableItem>().item_dat = dat.Item; Globals._Inventory.GetComponent <Inventory>().addItem(newItem); } Globals.InventoryItems = Globals.InventoryItemsNew; } }
public static bool IsMultilanguagePicture(Item item) { Media media = MediaManager.GetMedia(item); if (media?.MediaData == null) { return false; } Field mediaField = item.Fields[media.MediaData.DataFieldName]; if (mediaField == null) { return false; } return !mediaField.Shared; }
public static bool IsMediaItem(Item item) { return MediaManager.HasMediaContent(item); }
public MapPoint(Item item) { this.Name = item[Templates.MapPoint.Fields.Name]; this.Address = item[Templates.MapPoint.Fields.Address]; this.Location = item[Templates.MapPoint.Fields.Location]; }