Beispiel #1
0
    private void SetShoppingUnit1(OOShoppingUnit gridData, CommodityInfo commodityInfo)
    {
        int itemId      = commodityInfo.itemId;
        int commodityId = commodityInfo.commodityId;

        gridData.iId = commodityId;
        if (commodityInfo.sell)
        {
            gridData.EnableBtnBuy   = false;
            gridData.ItemFlagIconBg = true;
            gridData.ItemFlagIcon   = ResourceManager.GetIconSprite("font_yishouwan");
        }
        else
        {
            gridData.EnableBtnBuy   = true;
            gridData.ItemFlagIconBg = false;
            gridData.ItemFlagIcon   = ResourceManagerBase.GetNullSprite();
        }
        int num = commodityInfo.unitPrice * commodityInfo.itemNum;

        if ((long)num > MoneyType.GetNum(commodityInfo.moneyType))
        {
            gridData.PriceNow = "x" + num;
        }
        else
        {
            gridData.PriceNow = "x" + num;
        }
        gridData.ItemFrame = GameDataUtils.GetItemFrame(itemId);
        gridData.ItemIcon  = GameDataUtils.GetItemIcon(itemId);
        gridData.ItemName  = GameDataUtils.GetEquipItemNameAndLV(itemId, false);
        gridData.ItemNum   = string.Empty + commodityInfo.itemNum;
        gridData.CoinIcon  = MoneyType.GetIcon(commodityInfo.moneyType);
        gridData.PriceOld  = string.Empty;
    }
Beispiel #2
0
    public void RefreshUI(int equipid)
    {
        if (!this.isInit)
        {
            this.InitUI();
        }
        Items items = DataReader <Items> .Get(equipid);

        if (items == null)
        {
            return;
        }
        this.equipID = equipid;
        ResourceManager.SetSprite(this.ImageFrame, GameDataUtils.GetItemFrame(this.equipID));
        ResourceManager.SetSprite(this.ImageIcon, GameDataUtils.GetItemIcon(this.equipID));
        if (items.step <= 0)
        {
            base.FindTransform("ItemStep").get_gameObject().SetActive(false);
        }
        else
        {
            base.FindTransform("ItemStep").get_gameObject().SetActive(true);
            if (this.ItemStepText != null)
            {
                this.ItemStepText.set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
            }
        }
    }
Beispiel #3
0
    private void SetMailItems(List <DetailInfo> items, int drawMark)
    {
        this.MailItems.Clear();
        for (int i = 0; i < items.get_Count(); i++)
        {
            DetailInfo  detailInfo  = items.get_Item(i);
            OOItem2Draw oOItem2Draw = new OOItem2Draw();
            Items       items2      = DataReader <Items> .Get(detailInfo.cfgId);

            if (items2 != null)
            {
                oOItem2Draw.ID        = items2.id;
                oOItem2Draw.FrameIcon = GameDataUtils.GetItemFrame(items2.id);
                oOItem2Draw.ItemIcon  = GameDataUtils.GetIcon(items2.icon);
                oOItem2Draw.ItemName  = Utils.GetItemNum(items2.id, detailInfo.num);
            }
            else
            {
                oOItem2Draw.ID       = 0;
                oOItem2Draw.ItemIcon = ResourceManagerBase.GetNullSprite();
                oOItem2Draw.ItemName = string.Empty;
            }
            this.MailItems.Add(oOItem2Draw);
        }
    }
Beispiel #4
0
    private void SetScroll(int rootTypeId, int branchTypeId)
    {
        for (int i = 0; i < this.gridLayoutGroup.get_transform().get_childCount(); i++)
        {
            Transform child = this.gridLayoutGroup.get_transform().GetChild(i);
            Object.Destroy(child.get_gameObject());
        }
        List <int> genealogy = this.GetGenealogy(rootTypeId, branchTypeId);

        using (List <int> .Enumerator enumerator = genealogy.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                int        current            = enumerator.get_Current();
                GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("GemNavCell");
                instantiate2Prefab.get_transform().SetParent(this.gridLayoutGroup.get_transform(), false);
                instantiate2Prefab.get_transform().FindChild("ImageSelectBG").get_gameObject().SetActive(false);
                instantiate2Prefab.set_name(current.ToString());
                instantiate2Prefab.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickTopGridItem);
                Image component  = instantiate2Prefab.get_transform().FindChild("ImageFrame").GetComponent <Image>();
                Image component2 = instantiate2Prefab.get_transform().FindChild("ImageIcon").GetComponent <Image>();
                ResourceManager.SetSprite(component, GameDataUtils.GetItemFrame(current));
                ResourceManager.SetSprite(component2, GemGlobal.GetIconSprite(current));
                if (current == genealogy.get_Item(genealogy.get_Count() - 1))
                {
                    instantiate2Prefab.get_transform().FindChild("ImageArrow").get_gameObject().SetActive(false);
                }
                if (current == branchTypeId)
                {
                    instantiate2Prefab.get_transform().FindChild("ImageSelectBG").get_gameObject().SetActive(true);
                }
            }
        }
    }
Beispiel #5
0
    public void ShowAccessChannels(int itemId, Action closeCallback = null)
    {
        this._ActionClose = closeCallback;
        this.AccessChannelUIItems.Clear();
        Items items = DataReader <Items> .Get(itemId);

        if (items == null)
        {
            return;
        }
        this.ItemIcon   = GameDataUtils.GetIcon(items.icon);
        this.ItemIconBg = GameDataUtils.GetItemFrame(items.id);
        this.ItemName   = GameDataUtils.GetItemName(items, true);
        List <int> getType = items.getType;

        for (int i = 0; i < getType.get_Count(); i++)
        {
            ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(getType.get_Item(i));

            if (zhuXianPeiZhi != null)
            {
                OOAccessChannelUIItem o = new OOAccessChannelUIItem
                {
                    InstanceId = getType.get_Item(i),
                    Icon       = ResourceManager.GetIconSprite("i32300_s"),
                    Title      = GameDataUtils.GetChineseContent(zhuXianPeiZhi.name, false),
                    TitleDesc  = TextColorMgr.GetColor(GameDataUtils.GetChineseContent(DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi.chapterId).chapterName, false), "fefedc", string.Empty)
                };
                this.AccessChannelUIItems.Add(o);
            }
        }
    }
Beispiel #6
0
    public void SetItem(int itemID, long num)
    {
        if (DataReader <Items> .Contains(itemID))
        {
            Items items = DataReader <Items> .Get(itemID);

            ResourceManager.SetSprite(this.BattleBackpackItemFrame, GameDataUtils.GetItemFrame(items));
            ResourceManager.SetSprite(this.BattleBackpackItemIcon, GameDataUtils.GetIcon(items.icon));
            this.BattleBackpackItemNum.set_text((num != 0L) ? num.ToString() : string.Empty);
            if (items.step > 0)
            {
                this.BattleBackpackItemStep.SetActive(true);
                this.BattleBackpackItemStepNum.set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
            }
            else
            {
                this.BattleBackpackItemStep.SetActive(false);
            }
        }
        else
        {
            ResourceManager.SetCodeSprite(this.BattleBackpackItemFrame, "frame_icon_white");
            ResourceManager.SetCodeSprite(this.BattleBackpackItemIcon, string.Empty);
            this.BattleBackpackItemNum.set_text(string.Empty);
            this.BattleBackpackItemStep.SetActive(false);
        }
    }
Beispiel #7
0
 public void UpdateItemData(ItemBriefInfo itemInfo)
 {
     if (!this.isInit)
     {
         this.InitUI();
     }
     if (itemInfo != null && DataReader <Items> .Contains(itemInfo.cfgId))
     {
         this.m_SpecialItemInfo = itemInfo;
         this.isSpecialItem     = true;
         if (this.itemRootNullObj.get_activeSelf())
         {
             this.itemRootNullObj.SetActive(false);
         }
         if (!this.itemRootObj.get_activeSelf())
         {
             this.itemRootObj.SetActive(true);
         }
         if (this.itemStepObj.get_activeSelf())
         {
             this.itemRootObj.SetActive(false);
         }
         ResourceManager.SetSprite(this.itemIconImg, GameDataUtils.GetItemIcon(itemInfo.cfgId));
         ResourceManager.SetSprite(this.itemFrameImg, GameDataUtils.GetItemFrame(itemInfo.cfgId));
         this.itemNumText.set_text(itemInfo.count + string.Empty);
     }
     this.Selected = false;
 }
 internal void SetData(int id, long num)
 {
     this.item = BackpackManager.Instance.GetItem(id);
     ResourceManager.SetSprite(this.icon, GameDataUtils.GetIcon(this.item.icon));
     ResourceManager.SetSprite(this.frame, GameDataUtils.GetItemFrame(this.item.id));
     this.gooNum.set_text(num.ToString());
 }
Beispiel #9
0
    private OOShoppingUnit2 GetShoppingUnit2(CommodityInfo commodityInfo)
    {
        int             itemId         = commodityInfo.itemId;
        int             commodityId    = commodityInfo.commodityId;
        OOShoppingUnit2 oOShoppingUnit = new OOShoppingUnit2();

        oOShoppingUnit.iId = commodityId;
        if (commodityInfo.sell)
        {
            oOShoppingUnit.EnableBtnBuy   = false;
            oOShoppingUnit.ItemFlagIconBg = true;
            oOShoppingUnit.ItemFlagIcon   = ResourceManager.GetIconSprite("font_yishouwan");
        }
        else
        {
            oOShoppingUnit.EnableBtnBuy   = true;
            oOShoppingUnit.ItemFlagIconBg = false;
            oOShoppingUnit.ItemFlagIcon   = ResourceManagerBase.GetNullSprite();
        }
        int num = commodityInfo.unitPrice * commodityInfo.itemNum;

        if ((long)num > MoneyType.GetNum(commodityInfo.moneyType))
        {
            oOShoppingUnit.PriceNow = "x" + num;
        }
        else
        {
            oOShoppingUnit.PriceNow = "x" + num;
        }
        oOShoppingUnit.ItemFrame = GameDataUtils.GetItemFrame(itemId);
        oOShoppingUnit.ItemIcon  = GameDataUtils.GetItemIcon(itemId);
        oOShoppingUnit.ItemName  = GameDataUtils.GetEquipItemNameAndLV(itemId, false);
        oOShoppingUnit.ItemNum   = string.Empty + commodityInfo.itemNum;
        oOShoppingUnit.CoinIcon  = MoneyType.GetIcon(commodityInfo.moneyType);
        oOShoppingUnit.PriceOld  = string.Empty;
        ShangPinBiao shangPinBiao = DataReader <ShangPinBiao> .Get(commodityInfo.commodityId);

        if (shangPinBiao != null)
        {
            if (shangPinBiao.pvpLevel > 0)
            {
                oOShoppingUnit.PVPIcon = ResourceManager.GetIconSprite(PVPManager.Instance.GetGetIntegralByLevel(shangPinBiao.pvpLevel, false));
                JingJiChangFenDuan jingJiChangFenDuan = DataReader <JingJiChangFenDuan> .Get(shangPinBiao.pvpLevel);

                if (jingJiChangFenDuan != null)
                {
                    oOShoppingUnit.PVPName = GameDataUtils.GetChineseContent(jingJiChangFenDuan.name, false);
                }
                oOShoppingUnit.TipShow = (shangPinBiao.pvpLevel > PVPManager.Instance.GetIntegralLevel().id);
            }
            else
            {
                oOShoppingUnit.PVPIcon = ResourceManagerBase.GetNullSprite();
                oOShoppingUnit.PVPName = string.Empty;
                oOShoppingUnit.TipShow = false;
            }
        }
        return(oOShoppingUnit);
    }
 public void SetData(int itemId, long num)
 {
     this.mItemId = itemId;
     ResourceManager.SetSprite(this.mItemFrame, GameDataUtils.GetItemFrame(this.mItemId));
     ResourceManager.SetSprite(this.mItemIcon, GameDataUtils.GetItemIcon(this.mItemId));
     this.mItemIcon.SetNativeSize();
     this.mTxNumber.set_text(num.ToString());
 }
Beispiel #11
0
    public void SetUI(MonthSign monthSign, bool haveSign, bool canSign, bool canResign, int day)
    {
        this.monthSignCache = monthSign;
        this.dayindex       = day + 1;
        this.TextDay.set_text(string.Format("第{0}天", this.dayindex.ToString()));
        Items items = DataReader <Items> .Get(monthSign.itemId);

        ResourceManager.SetSprite(this.ImageIcon, GameDataUtils.GetIcon(items.icon));
        this.ImageIcon.SetNativeSize();
        ResourceManager.SetSprite(this.ImageFrame, GameDataUtils.GetItemFrame(items.id));
        if (monthSign.itemNum <= 1)
        {
            this.TextNum.get_gameObject().SetActive(false);
        }
        else
        {
            this.TextNum.get_gameObject().SetActive(true);
            this.TextNum.set_text(monthSign.itemNum.ToString());
        }
        if (monthSign.doubleMinVip != 0)
        {
            this.Vip.get_gameObject().SetActive(true);
            string text = "V" + monthSign.doubleMinVip + GameDataUtils.GetChineseContent(502207, false);
            this.VipText.set_text(text);
        }
        else
        {
            this.Vip.get_gameObject().SetActive(false);
        }
        this.state = MonthSignInChildItem.MonthSignInChildItemState.None;
        this.BtnRewardDetail.set_enabled(true);
        this.ResignIn.get_gameObject().SetActive(false);
        this.ItemSelect.get_gameObject().SetActive(false);
        this.CanSignObj.SetActive(false);
        if (haveSign)
        {
            this.ItemSelect.get_gameObject().SetActive(true);
            this.state = MonthSignInChildItem.MonthSignInChildItemState.HaveSign;
        }
        else if (canSign)
        {
            this.state = MonthSignInChildItem.MonthSignInChildItemState.CanSign;
        }
        else if (canResign)
        {
            this.ResignIn.get_gameObject().SetActive(true);
            this.state = MonthSignInChildItem.MonthSignInChildItemState.CanResign;
        }
        if (canSign)
        {
            this.ShowFx(true);
            this.CanSignObj.SetActive(true);
        }
        else
        {
            this.ShowFx(false);
        }
    }
    private OOXShoppingUnit GetItem2Normal(int storeId, StoreGoodsInfo sgi)
    {
        OOXShoppingUnit oOXShoppingUnit = new OOXShoppingUnit();

        oOXShoppingUnit.iStoreId = storeId;
        oOXShoppingUnit.iId      = sgi.iId;
        int itemId = sgi.itemId;

        oOXShoppingUnit.ItemFrame = GameDataUtils.GetItemFrame(itemId);
        oOXShoppingUnit.ItemIcon  = GameDataUtils.GetItemIcon(itemId);
        oOXShoppingUnit.ItemName  = GameDataUtils.GetEquipItemNameAndLV(itemId, false);
        if (sgi.stockCfg == -1)
        {
            oOXShoppingUnit.ItemNum    = string.Empty;
            oOXShoppingUnit.ItemFlagOn = false;
        }
        else
        {
            int num = Mathf.Max(0, sgi.stockCfg - sgi.buyTimes);
            oOXShoppingUnit.ItemNum = num + "/" + sgi.stockCfg;
            if (num > 0 && XMarketManager.Instance.GetCurrentShopCanBuyMax() > 0)
            {
                oOXShoppingUnit.ItemFlagOn = false;
            }
            else
            {
                oOXShoppingUnit.ItemFlagOn = true;
            }
        }
        if (sgi.extraInfo.vipLvLmt > 0 && sgi.extraInfo.vipLvLmt > EntityWorld.Instance.EntSelf.VipLv)
        {
            oOXShoppingUnit.LockTip      = string.Format(GameDataUtils.GetChineseContent(508054, false), sgi.extraInfo.vipLvLmt);
            oOXShoppingUnit.PriceNowIcon = ResourceManagerBase.GetNullSprite();
            oOXShoppingUnit.PriceNow     = string.Empty;
        }
        else
        {
            oOXShoppingUnit.LockTip      = string.Empty;
            oOXShoppingUnit.PriceNowIcon = MoneyType.GetIcon(sgi.moneyType);
            oOXShoppingUnit.PriceNow     = "x" + BaseMarketManager.CurrentManagerInstance.GetCommodityPrice(sgi.iId, 1);
        }
        if (!oOXShoppingUnit.ItemFlagOn && sgi.extraInfo.discountIds.get_Count() > 0)
        {
            oOXShoppingUnit.DiscountOn = true;
            SZheKouPeiZhi sZheKouPeiZhi = DataReader <SZheKouPeiZhi> .Get(this.GetDiscountNow(sgi));

            if (sZheKouPeiZhi != null)
            {
                oOXShoppingUnit.DiscountNumber = GameDataUtils.GetChineseContent(sZheKouPeiZhi.icon, false);
            }
        }
        else
        {
            oOXShoppingUnit.DiscountOn = false;
        }
        oOXShoppingUnit.ItemFlagOwnOn = false;
        return(oOXShoppingUnit);
    }
Beispiel #13
0
 public static void SetItem(int cfgId, Image itemFrame, Image itemIcon, Text itemName = null, bool showNameColor = true)
 {
     ResourceManager.SetSprite(itemFrame, GameDataUtils.GetItemFrame(cfgId));
     ResourceManager.SetSprite(itemIcon, GameDataUtils.GetItemIcon(cfgId));
     if (itemName != null)
     {
         itemName.set_text(GameDataUtils.GetItemName(cfgId, showNameColor, 0L));
     }
 }
Beispiel #14
0
 public static void SetItem(Items dataItem, Image itemFrame, Image itemIcon, Text itemName = null, bool showNameColor = true)
 {
     ResourceManager.SetSprite(itemFrame, GameDataUtils.GetItemFrame(dataItem));
     ResourceManager.SetSprite(itemIcon, GameDataUtils.GetItemIcon(dataItem));
     if (itemName != null)
     {
         itemName.set_text(GameDataUtils.GetItemName(dataItem, showNameColor));
     }
 }
Beispiel #15
0
    public void UdateRewardItem(int itemId, int num)
    {
        Items item = BackpackManager.Instance.GetItem(itemId);

        if (item == null)
        {
            Debug.LogError("尼玛!这个物品不存在了ID:" + itemId);
            return;
        }
        ResourceManager.SetSprite(this.frame, GameDataUtils.GetItemFrame(itemId));
        ResourceManager.SetSprite(this.icon, GameDataUtils.GetIcon(item.littleIcon));
        this.textNum.set_text("x" + string.Concat(num));
    }
 private GameObject RefreshReward(GameObject go, int id, int num)
 {
     ResourceManager.SetSprite(go.GetComponent <Image>(), GameDataUtils.GetItemFrame(id));
     ResourceManager.SetSprite(go.get_transform().FindChild("Image").GetComponent <Image>(), GameDataUtils.GetItemIcon(id));
     if (num > 1)
     {
         go.get_transform().FindChild("Text").GetComponent <Text>().set_text(num.ToString());
     }
     go.GetComponent <ButtonCustom>().onClickCustom = delegate(GameObject o)
     {
         ItemTipUIViewModel.ShowItem(id, null);
     };
     go.SetActive(true);
     return(go);
 }
Beispiel #17
0
    private void RefreshItemShows()
    {
        this.ItemShows.Clear();
        for (int i = 0; i < this.ItemShowIds.get_Count(); i++)
        {
            Items items = DataReader <Items> .Get(this.ItemShowIds.get_Item(i));

            if (items != null)
            {
                OOItem2Show oOItem2Show = new OOItem2Show();
                oOItem2Show.id    = items.id;
                oOItem2Show.Frame = GameDataUtils.GetItemFrame(items.id);
                oOItem2Show.Icon  = GameDataUtils.GetIcon(items.icon);
                this.ItemShows.Add(oOItem2Show);
            }
        }
    }
Beispiel #18
0
    private GameObject CreateRewards(int id, long num)
    {
        GameObject go = this.GetUnusedItem();

        if (go == null)
        {
            go = ResourceManager.GetInstantiate2Prefab("TaskRewardItem");
            go.GetComponent <Button>().get_onClick().AddListener(delegate
            {
                int num2 = int.Parse(go.get_name());
                if (num2 != 1)
                {
                    ItemTipUIViewModel.ShowItem(num2, null);
                }
            });
            UGUITools.SetParent(this.mGrid, go, false);
            this.mItems.Add(go);
        }
        go.set_name(id.ToString());
        ResourceManager.SetSprite(go.GetComponent <Image>(), GameDataUtils.GetItemFrame(id));
        ResourceManager.SetSprite(go.get_transform().FindChild("Image").GetComponent <Image>(), GameDataUtils.GetItemIcon(id));
        string text = num.ToString();

        if (id == 1)
        {
            text = AttrUtility.GetExpValueStr(num);
        }
        else if (id == 2)
        {
            text = AttrUtility.GetGoldValueStr(num);
        }
        go.get_transform().FindChild("Text").GetComponent <Text>().set_text(text);
        Items items = DataReader <Items> .Get(id);

        if (items == null || items.step <= 0)
        {
            go.get_transform().FindChild("ItemStep").get_gameObject().SetActive(false);
        }
        else
        {
            go.get_transform().FindChild("ItemStep").get_gameObject().SetActive(true);
            go.get_transform().FindChild("ItemStep").FindChild("ItemStepText").GetComponent <Text>().set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
        }
        go.SetActive(true);
        return(go);
    }
    private OOXShoppingUnit GetItem2Fashion(int storeId, StoreGoodsInfo sgi)
    {
        OOXShoppingUnit oOXShoppingUnit = new OOXShoppingUnit();

        oOXShoppingUnit.iStoreId = storeId;
        oOXShoppingUnit.iId      = sgi.iId;
        int itemId = sgi.itemId;

        oOXShoppingUnit.ItemFrame     = GameDataUtils.GetItemFrame(itemId);
        oOXShoppingUnit.ItemIcon      = GameDataUtils.GetItemIcon(itemId);
        oOXShoppingUnit.ItemName      = GameDataUtils.GetEquipItemNameAndLV(itemId, false);
        oOXShoppingUnit.ItemNum       = string.Empty;
        oOXShoppingUnit.ItemFlagOn    = false;
        oOXShoppingUnit.LockTip       = string.Empty;
        oOXShoppingUnit.PriceNowIcon  = MoneyType.GetIcon(sgi.moneyType);
        oOXShoppingUnit.PriceNow      = "x" + BaseMarketManager.CurrentManagerInstance.GetCommodityPrice(sgi.iId, 1);
        oOXShoppingUnit.DiscountOn    = false;
        oOXShoppingUnit.ItemFlagOwnOn = FashionManager.Instance.IsHasEternalFashion(sgi.iId);
        return(oOXShoppingUnit);
    }
Beispiel #20
0
    public void SetTreasure(int vipLevel, VipXiaoGuo dataVIPEffect)
    {
        this.ObatinItems.Clear();
        this.ObatinSpecialItems.Clear();
        List <VipBoxItemInfo> vIPBox = VIPManager.Instance.GetVIPBox(dataVIPEffect.effect);

        if (vIPBox != null)
        {
            for (int i = 0; i < vIPBox.get_Count(); i++)
            {
                VipBoxItemInfo vipBoxItemInfo = vIPBox.get_Item(i);
                OOItem2Draw    oOItem2Draw    = new OOItem2Draw();
                oOItem2Draw.BgShow    = true;
                oOItem2Draw.ID        = vipBoxItemInfo.itemId;
                oOItem2Draw.FrameIcon = GameDataUtils.GetItemFrame(vipBoxItemInfo.itemId);
                oOItem2Draw.ItemIcon  = GameDataUtils.GetItemIcon(vipBoxItemInfo.itemId);
                oOItem2Draw.ItemName  = Utils.GetItemNum(vipBoxItemInfo.itemId, (long)vipBoxItemInfo.itemCount);
                this.ObatinItems.Add(oOItem2Draw);
            }
        }
    }
Beispiel #21
0
    private void SetOneItemIcon(int buttonIndex, int itemId)
    {
        Image component = this.btnGrids[buttonIndex].get_transform().FindChild("imgFrame").GetComponent <Image>();

        ResourceManager.SetSprite(component, GameDataUtils.GetItemFrame(itemId));
        Image component2 = this.btnGrids[buttonIndex].get_transform().FindChild("imgFrame").FindChild("imgItem").GetComponent <Image>();

        ResourceManager.SetSprite(component2, GemGlobal.GetIconSprite(itemId));
        Text component3 = this.btnGrids[buttonIndex].get_transform().FindChild("texName").GetComponent <Text>();

        component3.set_text(GemGlobal.GetName(itemId));
        Text component4 = this.btnGrids[buttonIndex].get_transform().FindChild("texLv").GetComponent <Text>();

        if (GemGlobal.IsGemEnoughLv(itemId))
        {
            component4.set_text(string.Empty);
        }
        else
        {
            component4.set_text("等级需求: " + GemGlobal.GetRoleLvRequire(itemId));
        }
        this.InitTexAttrs(buttonIndex, itemId);
    }
Beispiel #22
0
    private GameObject CreateRewards(int id, long value)
    {
        GameObject go = this.GetUnusedItem();

        if (go == null)
        {
            go = ResourceManager.GetInstantiate2Prefab("TramcarRewardItem");
            go.GetComponent <Button>().get_onClick().AddListener(delegate
            {
                int num = int.Parse(go.get_name());
                if (num != 1)
                {
                    ItemTipUIViewModel.ShowItem(num, null);
                }
            });
            UGUITools.SetParent(this.mRewardPanel, go, false);
            this.mRewardList.Add(go);
        }
        go.set_name(id.ToString());
        ResourceManager.SetSprite(go.GetComponent <Image>(), GameDataUtils.GetItemFrame(id));
        ResourceManager.SetSprite(go.get_transform().FindChild("Image").GetComponent <Image>(), GameDataUtils.GetItemIcon(id));
        go.get_transform().FindChild("Text").GetComponent <Text>().set_text(Utils.SwitchChineseNumber(value, 1));
        Items items = DataReader <Items> .Get(id);

        if (items == null || items.step <= 0)
        {
            go.get_transform().FindChild("ItemStep").get_gameObject().SetActive(false);
        }
        else
        {
            go.get_transform().FindChild("ItemStep").get_gameObject().SetActive(true);
            go.get_transform().FindChild("ItemStep").FindChild("ItemStepText").GetComponent <Text>().set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
        }
        go.SetActive(true);
        return(go);
    }
    private void SetRewardItem(List <DropItem> itemList)
    {
        this.Items.Clear();
        this.Item2s.Clear();
        if (itemList == null)
        {
            return;
        }
        int num = itemList.get_Count() / 2;

        for (int i = 0; i < itemList.get_Count(); i++)
        {
            int   typeId             = itemList.get_Item(i).typeId;
            long  count              = itemList.get_Item(i).count;
            Items item               = BackpackManager.Instance.GetItem(typeId);
            OOBattlePassUIDropItem o = new OOBattlePassUIDropItem
            {
                ItemId  = item.id,
                Icon    = GameDataUtils.GetIcon(item.icon),
                IconBg  = GameDataUtils.GetItemFrame(item.id),
                GoodNum = count.ToString()
            };
            if (itemList.get_Count() <= 4)
            {
                this.Items.Add(o);
            }
            else if (i < num)
            {
                this.Items.Add(o);
            }
            else
            {
                this.Item2s.Add(o);
            }
        }
    }
Beispiel #24
0
    public void UpdateItem2Checks()
    {
        this.Item2Checks.Clear();
        List <Goods> bag = BackpackManager.Instance.Bag;

        for (int i = 0; i < bag.get_Count(); i++)
        {
            int itemId = bag.get_Item(i).GetItemId();
            if (this.IsItemCanShow(itemId))
            {
                Items items = DataReader <Items> .Get(itemId);

                if (items != null)
                {
                    OOItem2Check oOItem2Check = new OOItem2Check();
                    oOItem2Check.id              = items.id;
                    oOItem2Check.Frame           = GameDataUtils.GetItemFrame(items.id);
                    oOItem2Check.Icon            = GameDataUtils.GetIcon(items.icon);
                    oOItem2Check.CheckVisibility = ChatUIViewModel.Instance.IsItemInShow(items.id);
                    this.Item2Checks.Add(oOItem2Check);
                }
            }
        }
    }
    protected void SetRewardItem(List <KeyValuePair <int, long> > item)
    {
        this.Items.Clear();
        this.Item2s.Clear();
        if (item == null)
        {
            return;
        }
        int num = item.get_Count() / 2;

        for (int i = 0; i < item.get_Count(); i++)
        {
            int   key   = item.get_Item(i).get_Key();
            long  value = item.get_Item(i).get_Value();
            Items item2 = BackpackManager.Instance.GetItem(key);
            OOBattlePassUIDropItem o = new OOBattlePassUIDropItem
            {
                ItemId  = item2.id,
                Icon    = GameDataUtils.GetIcon(item2.icon),
                IconBg  = GameDataUtils.GetItemFrame(item2.id),
                GoodNum = value.ToString()
            };
            if (item.get_Count() <= 4)
            {
                this.Items.Add(o);
            }
            else if (i < num)
            {
                this.Items.Add(o);
            }
            else
            {
                this.Item2s.Add(o);
            }
        }
    }
Beispiel #26
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);
    }
Beispiel #27
0
    public void UpdateEquipItemData(EquipSimpleInfo equipSimpleInfo)
    {
        if (!this.isInit)
        {
            this.InitUI();
        }
        if (equipSimpleInfo != null && DataReader <zZhuangBeiPeiZhiBiao> .Contains(equipSimpleInfo.cfgId))
        {
            this.m_EquipSimpleInfo = equipSimpleInfo;
            this.isSpecialItem     = false;
            if (this.itemRootNullObj.get_activeSelf())
            {
                this.itemRootNullObj.SetActive(false);
            }
            if (!this.itemRootObj.get_activeSelf())
            {
                this.itemRootObj.SetActive(true);
            }
            if (!this.itemStepObj.get_activeSelf())
            {
                this.itemStepObj.SetActive(true);
            }
            ResourceManager.SetSprite(this.itemIconImg, GameDataUtils.GetItemIcon(equipSimpleInfo.cfgId));
            this.itemNumText.set_text(string.Empty);
            zZhuangBeiPeiZhiBiao zZhuangBeiPeiZhiBiao = DataReader <zZhuangBeiPeiZhiBiao> .Get(equipSimpleInfo.cfgId);

            this.itemStepNumText.set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), zZhuangBeiPeiZhiBiao.step));
            TaoZhuangDuanZhu equipForgeCfgData = EquipGlobal.GetEquipForgeCfgData(equipSimpleInfo.equipId);
            if (equipForgeCfgData != null && equipSimpleInfo.suitId > 0)
            {
                ResourceManager.SetSprite(base.FindTransform("ItemFrame").GetComponent <Image>(), ResourceManager.GetIconSprite(equipForgeCfgData.frame));
            }
            else
            {
                ResourceManager.SetSprite(this.itemFrameImg, GameDataUtils.GetItemFrame(equipSimpleInfo.cfgId));
            }
            int num = 0;
            if (equipSimpleInfo.excellentAttrs != null)
            {
                for (int i = 0; i < equipSimpleInfo.excellentAttrs.get_Count(); i++)
                {
                    if (equipSimpleInfo.excellentAttrs.get_Item(i).attrId > 0 && equipSimpleInfo.excellentAttrs.get_Item(i).color >= 1f)
                    {
                        num++;
                    }
                }
            }
            for (int j = 0; j < num; j++)
            {
                if (j >= 3)
                {
                    break;
                }
                base.FindTransform("ExcellentAttrIconList").FindChild("Image" + (j + 1)).get_gameObject().SetActive(true);
            }
            for (int k = num; k < 3; k++)
            {
                base.FindTransform("ExcellentAttrIconList").FindChild("Image" + (k + 1)).get_gameObject().SetActive(false);
            }
        }
        this.Selected = false;
    }
Beispiel #28
0
    public void UpdateItem(int id)
    {
        this.RewardItems.get_gameObject().SetActive(true);
        this.id   = id;
        this.data = DataReader <Achievement> .Get(id);

        AchievementItemInfo achievementItemInfo = AchievementManager.Instance.AllIdList.get_Item(id);

        this.state = achievementItemInfo.isAccept;
        if (this.data.icon > 0)
        {
            ResourceManager.SetSprite(this.Icon, GameDataUtils.GetIcon(this.data.icon));
        }
        this.Name.set_text(GameDataUtils.GetChineseContent(this.data.name, false));
        string text       = GameDataUtils.GetChineseContent(this.data.introduction, false);
        int    linkSystem = this.data.linkSystem;

        switch (linkSystem)
        {
        case 5:
            goto IL_E8;

        case 6:
        case 7:
IL_C5:
            switch (linkSystem)
            {
            case 15:
            case 19:
                goto IL_E8;

            case 17:
                text = "配置表被删,找策划哥!(通关主线副本第X章第X节XXX)";
                goto IL_158;
            }
            text = string.Format(text, this.data.size.get_Item(0));
            goto IL_158;

        case 8:
        case 9:
            text = "配置表被删,找策划哥!(通关精英副本第X章第X节XXX)";
            goto IL_158;
        }
        goto IL_C5;
IL_E8:
        text = string.Format(text, this.data.size.get_Item(0), this.data.size.get_Item(1));
IL_158:
        this.NameDes.set_text(text);
        int num = achievementItemInfo.completeProgress.get_Item(0);

        if (this.data.schedule == -1)
        {
            this.ProgressText.get_gameObject().SetActive(false);
        }
        else
        {
            this.ProgressText.get_gameObject().SetActive(true);
            this.ProgressText.set_text(string.Concat(new object[]
            {
                string.Empty,
                num,
                "/",
                this.data.schedule
            }));
        }
        IEnumerator enumerator = this.RewardItems.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                Transform transform = (Transform)enumerator.get_Current();
                Object.Destroy(transform.get_gameObject());
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        if (this.data.dropId > 0)
        {
            List <DiaoLuoZu> itemList = DropUtil.GetItemList(this.data.dropId);
            for (int i = 0; i < itemList.get_Count(); i++)
            {
                DiaoLuoZu  diaoLuoZu  = itemList.get_Item(i);
                GameObject gameObject = Object.Instantiate <GameObject>(this.itemPrefab);
                ResourceManager.SetInstantiateUIRef(gameObject, null);
                gameObject.SetActive(true);
                gameObject.get_transform().SetParent(this.RewardItems);
                gameObject.get_transform().set_localScale(new Vector3(1f, 1f, 1f));
                gameObject.get_transform().set_localPosition(new Vector3(0f, 0f, 0f));
                gameObject.get_transform().set_localEulerAngles(new Vector3(0f, 0f, 0f));
                ResourceManager.SetSprite(gameObject.get_transform().FindChild("Frame").GetComponent <Image>(), GameDataUtils.GetItemFrame(diaoLuoZu.itemId));
                ResourceManager.SetSprite(gameObject.get_transform().FindChild("Icon").GetComponent <Image>(), GameDataUtils.GetIcon(DataReader <Items> .Get(diaoLuoZu.itemId).littleIcon));
                gameObject.get_transform().FindChild("Num").GetComponent <Text>().set_text("x" + diaoLuoZu.maxNum.ToString());
            }
        }
        this.FinishImg.get_gameObject().SetActive(false);
        this.RewardBtn.get_gameObject().SetActive(false);
        this.GotoBtn.get_gameObject().SetActive(false);
        if (this.data.go != -1 && this.state == 0)
        {
            this.GotoBtn.get_gameObject().SetActive(true);
        }
        else if (this.state == 1)
        {
            this.RewardBtn.get_gameObject().SetActive(true);
        }
        else if (this.state == 2)
        {
            this.FinishImg.get_gameObject().SetActive(true);
            this.RewardItems.get_gameObject().SetActive(false);
        }
    }
    public void SetItem(int itemId, bool isHave)
    {
        this.mItemId = itemId;
        Image component = base.get_transform().FindChild("RewardItemIcon").GetComponent <Image>();

        ResourceManager.SetSprite(component, GameDataUtils.GetItemIcon(this.mItemId));
        component.SetNativeSize();
        ResourceManager.SetSprite(base.get_transform().FindChild("RewardItemFrame").GetComponent <Image>(), GameDataUtils.GetItemFrame(this.mItemId));
        base.get_transform().FindChild("Select").get_gameObject().SetActive(isHave);
        Items items = DataReader <Items> .Get(itemId);

        if (items == null || items.step <= 0)
        {
            base.get_transform().FindChild("ItemStep").get_gameObject().SetActive(false);
        }
        else
        {
            base.get_transform().FindChild("ItemStep").get_gameObject().SetActive(true);
            base.get_transform().FindChild("ItemStep").FindChild("ItemStepText").GetComponent <Text>().set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
        }
    }
    private void SetItem(int index, int itemID, int Count)
    {
        Transform transform = base.FindTransform("ItemShow" + (index + 1));

        if (transform == null)
        {
            return;
        }
        if (DataReader <Items> .Get(itemID) == null)
        {
            return;
        }
        ResourceManager.SetSprite(transform.FindChild("ImageBackground").GetComponent <Image>(), GameDataUtils.GetItemFrame(itemID));
        ResourceManager.SetSprite(transform.FindChild("Icon").GetComponent <Image>(), GameDataUtils.GetItemIcon(itemID));
        transform.FindChild("Num").GetComponent <Text>().set_text(Count.ToString());
    }