Beispiel #1
0
    // Token: 0x060034BB RID: 13499 RVA: 0x000C32C4 File Offset: 0x000C14C4
    public global::IInventoryItem CreateItem()
    {
        global::IInventoryItem inventoryItem = this.ConstructItem();

        this.InstallData(inventoryItem);
        return(inventoryItem);
    }
Beispiel #2
0
    // Token: 0x060031A9 RID: 12713 RVA: 0x000BEB4C File Offset: 0x000BCD4C
    public override void PopulateInfoWindow(global::ItemToolTip infoWindow, global::IInventoryItem tipItem)
    {
        infoWindow.AddItemTitle(this, tipItem, 0f);
        infoWindow.AddConditionInfo(tipItem);
        infoWindow.AddSectionTitle("Protection", 0f);
        for (int i = 0; i < 6; i++)
        {
            if (this.armorValues[i] != 0f)
            {
                float      contentHeight = infoWindow.GetContentHeight();
                GameObject gameObject    = infoWindow.AddBasicLabel(global::TakeDamage.DamageIndexToString((global::DamageTypeIndex)i), 0f);
                GameObject gameObject2   = infoWindow.AddBasicLabel("+" + ((int)this.armorValues[i]).ToString("N0"), 0f);
                gameObject2.transform.SetLocalPositionX(145f);
                gameObject2.GetComponentInChildren <global::UILabel>().color = Color.green;
                gameObject.transform.SetLocalPositionY(-(contentHeight + 10f));
                gameObject2.transform.SetLocalPositionY(-(contentHeight + 10f));
            }
        }
        infoWindow.AddSectionTitle("Equipment Slot", 20f);
        string text = "Head, Chest, Legs, Feet";

        if ((this._itemFlags & global::Inventory.SlotFlags.Head) == global::Inventory.SlotFlags.Head)
        {
            text = "Head";
        }
        else if ((this._itemFlags & global::Inventory.SlotFlags.Chest) == global::Inventory.SlotFlags.Chest)
        {
            text = "Chest";
        }
        infoWindow.AddBasicLabel(text, 10f);
        infoWindow.AddItemDescription(this, 15f);
        infoWindow.FinishPopulating();
    }
Beispiel #3
0
 // Token: 0x060034D1 RID: 13521 RVA: 0x000C358C File Offset: 0x000C178C
 public virtual void PopulateInfoWindow(global::ItemToolTip infoWindow, global::IInventoryItem item)
 {
     infoWindow.AddItemTitle(this, item, 0f);
     infoWindow.AddConditionInfo(item);
     infoWindow.AddItemDescription(this, 15f);
     infoWindow.FinishPopulating();
 }
Beispiel #4
0
    // Token: 0x060039D9 RID: 14809 RVA: 0x000CBAD0 File Offset: 0x000C9CD0
    public override global::InventoryItem.MergeResult TryCombine(global::IInventoryItem otherItem)
    {
        global::PlayerInventory playerInventory = base.inventory as global::PlayerInventory;

        if (!playerInventory || otherItem.inventory != playerInventory)
        {
            return(global::InventoryItem.MergeResult.Failed);
        }
        global::ItemDataBlock datablock = otherItem.datablock;

        if (!datablock || !datablock.isResearchable)
        {
            Rust.Notice.Popup("", "You can't research this", 4f);
            return(global::InventoryItem.MergeResult.Failed);
        }
        if (!playerInventory.AtWorkBench())
        {
            Rust.Notice.Popup("", "You must be at a workbench to do this.", 4f);
            return(global::InventoryItem.MergeResult.Failed);
        }
        global::BlueprintDataBlock bp;

        if (!global::BlueprintDataBlock.FindBlueprintForItem <global::BlueprintDataBlock>(otherItem.datablock, out bp))
        {
            Rust.Notice.Popup("", "You can't research this.. No Blueprint Available!...", 4f);
            return(global::InventoryItem.MergeResult.Failed);
        }
        if (playerInventory.KnowsBP(bp))
        {
            Rust.Notice.Popup("", "You already know how to make this!", 4f);
            return(global::InventoryItem.MergeResult.Failed);
        }
        return(global::InventoryItem.MergeResult.Combined);
    }
    // Token: 0x06002877 RID: 10359 RVA: 0x00093C04 File Offset: 0x00091E04
    public bool SetHeldItem(global::RPOSInventoryCell cell)
    {
        global::IInventoryItem heldItem;

        if (cell)
        {
            global::IInventoryItem slotItem = cell.slotItem;
            heldItem = slotItem;
        }
        else
        {
            heldItem = null;
        }
        if (this.SetHeldItem(heldItem))
        {
            try
            {
                Vector3 vector;
                if (global::NGUITools.GetCentroid(cell, out vector))
                {
                    Vector2 vector2 = global::UICamera.FindCameraForLayer(cell.gameObject.layer).cachedCamera.WorldToScreenPoint(vector);
                    this.offsetPoint = vector2 - global::UICamera.lastMousePosition;
                }
            }
            catch
            {
                this.offsetPoint = Vector3.zero;
            }
            return(true);
        }
        return(false);
    }
    // Token: 0x06003CEC RID: 15596 RVA: 0x000DA044 File Offset: 0x000D8244
    public bool CanRepair(global::Inventory ingredientInv)
    {
        global::IInventoryItem repairItem = this.GetRepairItem();

        if (repairItem == null || !repairItem.datablock.isRepairable)
        {
            return(false);
        }
        if (!repairItem.IsDamaged())
        {
            return(false);
        }
        global::BlueprintDataBlock blueprintDataBlock;

        if (global::BlueprintDataBlock.FindBlueprintForItem <global::BlueprintDataBlock>(repairItem.datablock, out blueprintDataBlock))
        {
            for (int i = 0; i < blueprintDataBlock.ingredients.Length; i++)
            {
                global::BlueprintDataBlock.IngredientEntry ingredientEntry = blueprintDataBlock.ingredients[i];
                int num = Mathf.CeilToInt((float)blueprintDataBlock.ingredients[i].amount * this.GetResourceScalar());
                if (num > 0 && ingredientInv.CanConsume(blueprintDataBlock.ingredients[i].Ingredient, num) <= 0)
                {
                    return(false);
                }
            }
            return(true);
        }
        return(false);
    }
    // Token: 0x060039B5 RID: 14773 RVA: 0x000CB3E8 File Offset: 0x000C95E8
    public override global::InventoryItem.MergeResult TryStack(global::IInventoryItem other)
    {
        int uses = base.uses;

        if (uses == 0)
        {
            return(global::InventoryItem.MergeResult.Failed);
        }
        DB db = other.datablock as DB;

        if (db && db == this.datablock)
        {
            int uses2 = other.uses;
            if (uses2 == this.maxUses)
            {
                return(global::InventoryItem.MergeResult.Failed);
            }
            DB db2 = this.datablock;
            if (db2.IsSplittable())
            {
                int num = other.AddUses(uses);
                if (num == 0)
                {
                    return(global::InventoryItem.MergeResult.Failed);
                }
                bool flag = this.Consume(ref num);
                if (flag)
                {
                    this.inventory.RemoveItem(this.slot);
                }
                return(global::InventoryItem.MergeResult.Merged);
            }
        }
        return(global::InventoryItem.MergeResult.Failed);
    }
Beispiel #8
0
    // Token: 0x06003313 RID: 13075 RVA: 0x000C0754 File Offset: 0x000BE954
    public override void InstallData(global::IInventoryItem item)
    {
        base.InstallData(item);
        global::IBulletWeaponItem bulletWeaponItem = item as global::IBulletWeaponItem;

        this._maxUses             = this.maxClipAmmo;
        bulletWeaponItem.clipAmmo = this.maxClipAmmo;
    }
Beispiel #9
0
 // Token: 0x060034CC RID: 13516 RVA: 0x000C3470 File Offset: 0x000C1670
 public virtual int RetreiveMenuOptions(global::IInventoryItem item, global::InventoryItem.MenuItem[] results, int offset)
 {
     if (this._splittable && item.uses > 1 && item.isInLocalInventory)
     {
         results[offset++] = global::InventoryItem.MenuItem.Split;
     }
     return(offset);
 }
 // Token: 0x06003208 RID: 12808 RVA: 0x000BF134 File Offset: 0x000BD334
 public override int RetreiveMenuOptions(global::IInventoryItem item, global::InventoryItem.MenuItem[] results, int offset)
 {
     offset = base.RetreiveMenuOptions(item, results, offset);
     if (item.isInLocalInventory)
     {
         results[offset++] = global::InventoryItem.MenuItem.Use;
     }
     return(offset);
 }
 // Token: 0x060039BF RID: 14783 RVA: 0x000CB734 File Offset: 0x000C9934
 public override global::InventoryItem.MergeResult TryStack(global::IInventoryItem otherItem)
 {
     global::InventoryItem.MergeResult mergeResult = this.TryCombine(otherItem);
     if (mergeResult == global::InventoryItem.MergeResult.Failed)
     {
         return(base.TryStack(otherItem));
     }
     return(mergeResult);
 }
Beispiel #12
0
 // Token: 0x06002A61 RID: 10849 RVA: 0x0009D848 File Offset: 0x0009BA48
 public void SetRepairItem(global::IInventoryItem item)
 {
     if (item == null || !item.datablock.isRepairable)
     {
         this.ClearRepairItem();
         return;
     }
     this._benchItem = item;
     this.UpdateGUIAmounts();
 }
Beispiel #13
0
    // Token: 0x06002A60 RID: 10848 RVA: 0x0009D80C File Offset: 0x0009BA0C
    public void Update()
    {
        global::IInventoryItem repairItem = null;

        if (this._bench)
        {
            this._bench.GetComponent <global::Inventory>().GetItem(0, out repairItem);
        }
        this.SetRepairItem(repairItem);
    }
    // Token: 0x06003CF0 RID: 15600 RVA: 0x000DA230 File Offset: 0x000D8430
    public float GetResourceScalar()
    {
        global::IInventoryItem repairItem = this.GetRepairItem();

        if (repairItem == null)
        {
            return(0f);
        }
        return((repairItem.maxcondition - repairItem.condition) * 0.5f);
    }
    // Token: 0x060039B7 RID: 14775 RVA: 0x000CB508 File Offset: 0x000C9708
    public override global::InventoryItem.MergeResult TryCombine(global::IInventoryItem other)
    {
        global::ItemDataBlock db = other.datablock;
        DB db2 = this.datablock;

        global::ItemDataBlock.CombineRecipe matchingRecipe = db2.GetMatchingRecipe(db);
        if (matchingRecipe == null)
        {
            return(global::InventoryItem.MergeResult.Failed);
        }
        int uses = other.uses;

        if (uses < matchingRecipe.amountToLoseOther)
        {
            return(global::InventoryItem.MergeResult.Failed);
        }
        if (base.uses < matchingRecipe.amountToLose)
        {
            return(global::InventoryItem.MergeResult.Failed);
        }
        global::Inventory inventory = other.inventory;
        int num  = base.uses / matchingRecipe.amountToLose;
        int num2 = uses / matchingRecipe.amountToLoseOther;
        int num3 = Mathf.Min(num, num2);
        int num4 = 0;

        if (matchingRecipe.resultItem.IsSplittable())
        {
            num4 = Mathf.CeilToInt((float)num3 / (float)num4);
        }
        else
        {
            num4 = num3;
        }
        int vacantSlotCount = inventory.vacantSlotCount;

        if (num4 > vacantSlotCount)
        {
            return(global::InventoryItem.MergeResult.Failed);
        }
        int num5 = num3 * matchingRecipe.amountToLoseOther;

        if (other.Consume(ref num5))
        {
            inventory.RemoveItem(other.slot);
        }
        inventory.AddItemAmount(matchingRecipe.resultItem, num3, global::Inventory.AmountMode.Default);
        int num6 = num3 * matchingRecipe.amountToLose;

        if (base.Consume(ref num6))
        {
            base.inventory.RemoveItem(base.slot);
        }
        return(global::InventoryItem.MergeResult.Failed);
    }
Beispiel #16
0
    // Token: 0x060036F6 RID: 14070 RVA: 0x000C5E28 File Offset: 0x000C4028
    public override bool CanWork(global::IToolItem tool, global::Inventory workbenchInv)
    {
        if (workbenchInv.occupiedSlotCount > 2)
        {
            Debug.Log("Too many items for recycle");
            return(false);
        }
        global::IInventoryItem firstItemNotTool = base.GetFirstItemNotTool(tool, workbenchInv);

        return(firstItemNotTool.datablock.isRecycleable && global::BlueprintDataBlock.FindBlueprintForItem(firstItemNotTool.datablock));
    }
Beispiel #17
0
 // Token: 0x06003AA1 RID: 15009 RVA: 0x000CDC74 File Offset: 0x000CBE74
 protected override void ItemAdded(int slot, global::IInventoryItem item)
 {
     if (global::PlayerInventory.IsEquipmentSlot(slot))
     {
         global::IEquipmentItem equipmentItem = item as global::IEquipmentItem;
         if (equipmentItem != null)
         {
             equipmentItem.OnEquipped();
             this.UpdateEquipment();
         }
     }
 }
    // Token: 0x06002A4B RID: 10827 RVA: 0x0009D190 File Offset: 0x0009B390
    public virtual void SetItem(global::IInventoryItem item)
    {
        this.ClearChildren();
        this._observedItem = item;
        int num = item.datablock.RetreiveMenuOptions(item, global::RPOSItemRightClickMenu.menuItemBuffer, 0);

        for (int i = 0; i < num; i++)
        {
            this.AddRightClickEntry(global::RPOSItemRightClickMenu.menuItemBuffer[i].ToString());
        }
        global::UICamera.PopupPanel(base.GetComponent <global::UIPanel>());
    }
 // Token: 0x060028E5 RID: 10469 RVA: 0x00095B00 File Offset: 0x00093D00
 public void Internal_SetToolTip(global::ItemDataBlock itemdb, global::IInventoryItem item)
 {
     this.ClearContents();
     if (itemdb == null)
     {
         this.SetVisible(false);
         return;
     }
     this.RepositionAtCursor();
     itemdb.PopulateInfoWindow(this, item);
     this._background.transform.localScale = new Vector3(250f, this.GetContentHeight() + Mathf.Abs(this.addParent.transform.localPosition.y * 2f), 1f);
     this.SetVisible(true);
 }
    // Token: 0x060028E8 RID: 10472 RVA: 0x00095C10 File Offset: 0x00093E10
    public GameObject AddItemTitle(global::ItemDataBlock itemdb, global::IInventoryItem itemInstance = null, float aboveSpace = 0f)
    {
        float      contentHeight = this.GetContentHeight();
        GameObject gameObject    = global::NGUITools.AddChild(this.addParent, this.itemTitlePrefab);

        gameObject.GetComponentInChildren <global::UILabel>().text = ((itemInstance == null) ? itemdb.name : itemInstance.toolTip);
        global::UITexture componentInChildren = gameObject.GetComponentInChildren <global::UITexture>();

        componentInChildren.material = componentInChildren.material.Clone();
        componentInChildren.material.Set("_MainTex", itemdb.GetIconTexture());
        componentInChildren.color = ((itemInstance == null || !itemInstance.IsBroken()) ? Color.white : Color.red);
        gameObject.transform.SetLocalPositionY(-(contentHeight + aboveSpace));
        return(gameObject);
    }
Beispiel #21
0
    // Token: 0x0600371B RID: 14107 RVA: 0x000C6120 File Offset: 0x000C4320
    public override bool CompleteWork(global::IToolItem tool, global::Inventory workbenchInv)
    {
        if (!this.CanWork(tool, workbenchInv))
        {
            return(false);
        }
        global::IInventoryItem     firstItemNotTool = base.GetFirstItemNotTool(tool, workbenchInv);
        global::BlueprintDataBlock blueprintDataBlock;

        if (global::BlueprintDataBlock.FindBlueprintForItem <global::BlueprintDataBlock>(firstItemNotTool.datablock, out blueprintDataBlock))
        {
            workbenchInv.AddItem(blueprintDataBlock, global::Inventory.Slot.Preference.Define(global::Inventory.Slot.Kind.Default, blueprintDataBlock.IsSplittable(), global::Inventory.Slot.Kind.Belt), 1);
            return(true);
        }
        return(false);
    }
Beispiel #22
0
    // Token: 0x0600371A RID: 14106 RVA: 0x000C60BC File Offset: 0x000C42BC
    public override bool CanWork(global::IToolItem tool, global::Inventory workbenchInv)
    {
        if (workbenchInv.occupiedSlotCount > 2)
        {
            Debug.Log("Too many items for research");
            return(false);
        }
        global::IInventoryItem firstItemNotTool = base.GetFirstItemNotTool(tool, workbenchInv);

        if (firstItemNotTool != null && firstItemNotTool.datablock.isResearchable && global::BlueprintDataBlock.FindBlueprintForItem(firstItemNotTool.datablock))
        {
            return(true);
        }
        Debug.Log("Can't work!?!!?");
        return(false);
    }
Beispiel #23
0
    // Token: 0x060036F8 RID: 14072 RVA: 0x000C5E84 File Offset: 0x000C4084
    public override bool CompleteWork(global::IToolItem tool, global::Inventory workbenchInv)
    {
        if (!this.CanWork(tool, workbenchInv))
        {
            return(false);
        }
        global::IInventoryItem     firstItemNotTool = base.GetFirstItemNotTool(tool, workbenchInv);
        global::BlueprintDataBlock blueprintDataBlock;

        global::BlueprintDataBlock.FindBlueprintForItem <global::BlueprintDataBlock>(firstItemNotTool.datablock, out blueprintDataBlock);
        int num = 1;

        if (firstItemNotTool.datablock.IsSplittable())
        {
            num = firstItemNotTool.uses;
        }
        for (int i = 0; i < num; i++)
        {
            foreach (global::BlueprintDataBlock.IngredientEntry ingredientEntry in blueprintDataBlock.ingredients)
            {
                int num2 = Random.Range(0, 4);
                if (num2 != 0)
                {
                    if (num2 == 1 || num2 == 2 || num2 == 3)
                    {
                        workbenchInv.AddItemAmount(ingredientEntry.Ingredient, ingredientEntry.amount);
                    }
                }
            }
        }
        int num3;

        if (!firstItemNotTool.datablock.IsSplittable())
        {
            num3 = firstItemNotTool.uses;
        }
        else
        {
            num3 = num;
        }
        if (firstItemNotTool.Consume(ref num3))
        {
            firstItemNotTool.inventory.RemoveItem(firstItemNotTool.slot);
        }
        return(true);
    }
 // Token: 0x06003294 RID: 12948 RVA: 0x000BFC7C File Offset: 0x000BDE7C
 public override void PopulateInfoWindow(global::ItemToolTip infoWindow, global::IInventoryItem tipItem)
 {
     infoWindow.AddItemTitle(this, tipItem, 0f);
     infoWindow.AddSectionTitle("Ingredients", 15f);
     for (int i = 0; i < this.ingredients.Length; i++)
     {
         string text = this.ingredients[i].Ingredient.name;
         if (this.ingredients[i].amount > 1)
         {
             text = text + " x" + this.ingredients[i].amount;
         }
         infoWindow.AddBasicLabel(text, 15f);
     }
     infoWindow.AddSectionTitle("Result Item", 15f);
     infoWindow.AddBasicLabel(this.resultItem.name, 15f);
     infoWindow.AddItemDescription(this, 15f);
     infoWindow.FinishPopulating();
 }
Beispiel #25
0
    // Token: 0x06002A43 RID: 10819 RVA: 0x0009CF7C File Offset: 0x0009B17C
    private void OnTooltip(bool show)
    {
        global::IInventoryItem inventoryItem;

        if (show && this._myDisplayItem != null)
        {
            global::IInventoryItem myDisplayItem = this._myDisplayItem;
            inventoryItem = myDisplayItem;
        }
        else
        {
            inventoryItem = null;
        }
        global::IInventoryItem item   = inventoryItem;
        global::ItemDataBlock  itemdb = (!show || this._myDisplayItem == null) ? null : this._myDisplayItem.datablock;

        global::ItemToolTip.SetToolTip(itemdb, item);
    }
    // Token: 0x0600328D RID: 12941 RVA: 0x000BF9DC File Offset: 0x000BDBDC
    public virtual int MaxAmount(global::Inventory workbenchInv)
    {
        int num = int.MaxValue;

        foreach (global::BlueprintDataBlock.IngredientEntry ingredientEntry in this.ingredients)
        {
            int num2 = 0;
            global::IInventoryItem inventoryItem = workbenchInv.FindItem(ingredientEntry.Ingredient, out num2);
            if (inventoryItem != null)
            {
                int num3 = num2 / ingredientEntry.amount;
                if (num3 < num)
                {
                    num = num3;
                }
            }
        }
        return((num != int.MaxValue) ? num : 0);
    }
 // Token: 0x060028ED RID: 10477 RVA: 0x00095DB4 File Offset: 0x00093FB4
 public GameObject AddConditionInfo(global::IInventoryItem item)
 {
     if (item != null && item.datablock.DoesLoseCondition())
     {
         Color col = Color.green;
         if (item.condition <= 0.6f)
         {
             col = Color.yellow;
         }
         else if (item.IsBroken())
         {
             col = Color.red;
         }
         float num  = 100f * item.condition;
         float num2 = 100f * item.maxcondition;
         return(this.AddBasicLabel("Condition : " + num.ToString("0") + "/" + num2.ToString("0"), 15f, col));
     }
     return(null);
 }
Beispiel #28
0
    // Token: 0x06003D35 RID: 15669 RVA: 0x000DB014 File Offset: 0x000D9214
    public virtual global::BlueprintDataBlock GetMatchingDBForItems()
    {
        ArrayList arrayList = new ArrayList();

        foreach (global::ItemDataBlock itemDataBlock in global::DatablockDictionary.All)
        {
            if (itemDataBlock is global::BlueprintDataBlock)
            {
                global::BlueprintDataBlock blueprintDataBlock = itemDataBlock as global::BlueprintDataBlock;
                bool flag = true;
                foreach (global::BlueprintDataBlock.IngredientEntry ingredientEntry in blueprintDataBlock.ingredients)
                {
                    int num = 0;
                    global::IInventoryItem inventoryItem = this._inventory.FindItem(ingredientEntry.Ingredient, out num);
                    if (inventoryItem == null || num < ingredientEntry.amount)
                    {
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    arrayList.Add(blueprintDataBlock);
                }
            }
        }
        if (arrayList.Count > 0)
        {
            global::BlueprintDataBlock result = null;
            int num2 = -1;
            foreach (object obj in arrayList)
            {
                global::BlueprintDataBlock blueprintDataBlock2 = (global::BlueprintDataBlock)obj;
                if (blueprintDataBlock2.ingredients.Length > num2)
                {
                    result = blueprintDataBlock2;
                    num2   = blueprintDataBlock2.ingredients.Length;
                }
            }
            return(result);
        }
        return(null);
    }
    // Token: 0x06003CED RID: 15597 RVA: 0x000DA0FC File Offset: 0x000D82FC
    public bool CompleteRepair(global::Inventory ingredientInv)
    {
        if (!this.CanRepair(ingredientInv))
        {
            return(false);
        }
        global::IInventoryItem     repairItem = this.GetRepairItem();
        global::BlueprintDataBlock blueprintDataBlock;

        if (!global::BlueprintDataBlock.FindBlueprintForItem <global::BlueprintDataBlock>(repairItem.datablock, out blueprintDataBlock))
        {
            return(false);
        }
        for (int i = 0; i < blueprintDataBlock.ingredients.Length; i++)
        {
            global::BlueprintDataBlock.IngredientEntry ingredientEntry = blueprintDataBlock.ingredients[i];
            int j = Mathf.RoundToInt((float)blueprintDataBlock.ingredients[i].amount * this.GetResourceScalar());
            if (j > 0)
            {
                while (j > 0)
                {
                    int num = 0;
                    global::IInventoryItem inventoryItem = ingredientInv.FindItem(ingredientEntry.Ingredient, out num);
                    if (inventoryItem == null)
                    {
                        return(false);
                    }
                    if (inventoryItem.Consume(ref j))
                    {
                        ingredientInv.RemoveItem(inventoryItem.slot);
                    }
                }
            }
        }
        float num2 = repairItem.maxcondition - repairItem.condition;
        float num3 = num2 * 0.2f + 0.05f;

        repairItem.SetMaxCondition(repairItem.maxcondition - num3);
        repairItem.SetCondition(repairItem.maxcondition);
        return(true);
    }
    // Token: 0x06002876 RID: 10358 RVA: 0x00093B68 File Offset: 0x00091D68
    public bool SetHeldItem(global::IInventoryItem item)
    {
        if (item == null)
        {
            this.MakeEmpty();
            if (!this.fadingOut)
            {
                this.Opaque();
            }
            return(false);
        }
        this.hasItem = true;
        Texture iconTex = item.datablock.iconTex;

        global::ItemDataBlock.LoadIconOrUnknown <Texture>(item.datablock.icon, ref iconTex);
        this._icon.enabled = true;
        this._myMaterial.Set("_MainTex", iconTex);
        this._itemHolding   = item;
        this.offsetVelocity = (this.offsetPoint = default(Vector2));
        this.Opaque();
        return(true);
    }