Beispiel #1
0
    private void SetItem(Items dataItem, int itemNum, int money_type, int group_price)
    {
        if (dataItem == null)
        {
            return;
        }
        this.m_group_price = group_price;
        this.m_money_type  = money_type;
        long num = BackpackManager.Instance.OnGetGoodCount(dataItem.id);

        this.ItemFrame = GameDataUtils.GetItemFrame(dataItem.id);
        this.ItemIcon  = GameDataUtils.GetIcon(dataItem.icon);
        this.ItemName  = GameDataUtils.GetItemName(dataItem, true);
        this.ItemDesc  = GameDataUtils.GetItemDescWithTab(dataItem, "6c4734");
        this.BuyCount  = string.Empty + itemNum;
        if (dataItem.firstType == 1)
        {
            this.ItemProfessionName = "职业:";
            this.ItemProfession     = GameDataUtils.GetItemProfession(dataItem);
            this.ItemFightingName   = "战力评分:";
            this.ItemFighting       = EquipmentManager.Instance.GetEquipFightingByItemID(dataItem.id).ToString();
            zZhuangBeiPeiZhiBiao zZhuangBeiPeiZhiBiao = DataReader <zZhuangBeiPeiZhiBiao> .Get(dataItem.id);

            if (zZhuangBeiPeiZhiBiao != null)
            {
                if (EntityWorld.Instance.EntSelf.Lv >= zZhuangBeiPeiZhiBiao.level)
                {
                    this.ItemNumName = "穿戴等级:";
                    this.ItemOwn     = "    " + zZhuangBeiPeiZhiBiao.level.ToString();
                }
                else
                {
                    this.ItemNumName = "<color=#ff0000>穿戴等级不足</color>";
                    this.ItemOwn     = string.Empty;
                }
            }
        }
        else
        {
            this.ItemNumName        = "数量:";
            this.ItemProfessionName = string.Empty;
            this.ItemProfession     = string.Empty;
            this.ItemOwn            = num.ToString();
            this.ItemFightingName   = GameDataUtils.GetItemProfession(dataItem);
            this.ItemFighting       = string.Empty;
        }
        this.CostIcon = MoneyType.GetIcon(money_type);
        this.Input    = 1.ToString();
        this.SetMoney(1);
        bool flag = false;

        this.DefenceVisible = flag;
        flag = flag;
        this.AttackVisible = flag;
        flag = flag;
        this.DodgeVisible   = flag;
        this.AttrTxtVisible = flag;
        this.AttackTxtNum   = string.Empty;
        this.DefenceTxtNum  = string.Empty;
        this.DodgeTxtNum    = string.Empty;
        int attId = dataItem.atti;

        if (dataItem.firstType == 5)
        {
            attId = GemGlobal.GetAttrId(dataItem.id);
        }
        List <string> itemAttrText = this.GetItemAttrText(attId);
        int           attrs_count  = 0;

        if (itemAttrText != null)
        {
            this.AttrTxtVisible = true;
            attrs_count         = itemAttrText.get_Count();
            for (int i = 0; i < itemAttrText.get_Count(); i++)
            {
                switch (i)
                {
                case 0:
                    this.AttackVisible = true;
                    this.AttackTxtNum  = itemAttrText.get_Item(0);
                    break;

                case 1:
                    this.DodgeVisible = true;
                    this.DodgeTxtNum  = itemAttrText.get_Item(1);
                    break;

                case 2:
                    this.DefenceVisible = true;
                    this.DefenceTxtNum  = itemAttrText.get_Item(2);
                    break;
                }
            }
        }
        BuyUIView.Instance.SetAutoLayOut(attrs_count, this.BuyNumberAdjustOn);
    }