Exemplo n.º 1
0
    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...");
    }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
    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;
        }
    }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
 public static bool IsMediaItem(Item item)
 {
     return MediaManager.HasMediaContent(item);
 }
Exemplo n.º 6
0
 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];
 }