Пример #1
0
    public void UpdateItem(int indexId, int dropId, int title, int flag)
    {
        XDict <int, long> rewardItems = FirstPayManager.Instance.GetRewardItems(dropId);
        int  num;
        long num2;

        if (rewardItems != null && rewardItems.Count > 0)
        {
            num  = rewardItems.ElementKeyAt(0);
            num2 = rewardItems.ElementValueAt(0);
        }
        else
        {
            num  = 41000;
            num2 = 30L;
        }
        ResourceManager.SetSprite(this.imgIcon, GameDataUtils.GetItemIcon(num));
        this.imgIcon.SetNativeSize();
        this.textDay.set_text(GameDataUtils.GetChineseContent(title, false));
        this.textName.set_text(GameDataUtils.GetItemName(num, false, 0L));
        this.textCount.set_text(num2.ToString());
        this.itemId     = indexId;
        this.IconItemId = num;
        this.UpdateItemState(flag);
        base.get_transform().FindChild("BtnRect").GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickGet);
    }
Пример #2
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;
 }
Пример #3
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;
    }
Пример #4
0
 protected override void InitUI()
 {
     base.InitUI();
     this.storageLogListSR           = base.FindTransform("StorageLogListSR").GetComponent <ScrollRect>();
     this.noGuildStorageTipObj       = base.FindTransform("NoGuildStorageLog").get_gameObject();
     this.btnDecompose               = base.FindTransform("BtnDecompose").GetComponent <ButtonCustom>();
     this.btnDecompose.onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickDecompose);
     this.btnDonate = base.FindTransform("BtnDonate").GetComponent <ButtonCustom>();
     this.btnDonate.onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickDonate);
     this.btnOk = base.FindTransform("BtnOK").GetComponent <ButtonCustom>();
     this.btnOk.onClickCustom     = new ButtonCustom.VoidDelegateObj(this.OnClickBtnOK);
     this.btnCancle               = base.FindTransform("BtnCancel").GetComponent <ButtonCustom>();
     this.btnCancle.onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnCancle);
     this.coinImg            = base.FindTransform("Coin01Icon").GetComponent <Image>();
     this.coinNumText        = base.FindTransform("Coin01Num").GetComponent <Text>();
     this.storageNumText     = base.FindTransform("StorageNum").GetComponent <Text>();
     this.changeNumText      = base.FindTransform("HadChangedNum").GetComponent <Text>();
     this.storageBagListPool = base.FindTransform("BagListPool").GetComponent <ListPool>();
     this.storageBagListPool.Clear();
     this.storageLogListPool = base.FindTransform("LogListPool").GetComponent <ListPool>();
     this.storageLogListPool.Clear();
     ResourceManager.SetSprite(this.coinImg, GameDataUtils.GetItemIcon(19));
     this.selectDecomposeEquips = new List <EquipSimpleInfo>();
     this.selectDecomposeEquips.Clear();
     if (this.noGuildStorageTipObj != null && this.noGuildStorageTipObj.get_activeSelf())
     {
         this.noGuildStorageTipObj.SetActive(false);
     }
 }
Пример #5
0
    private void RefrshRewardItems(List <DropItem> rewardItems)
    {
        int i = 0;

        if (rewardItems != null)
        {
            while (i < rewardItems.get_Count())
            {
                long count  = rewardItems.get_Item(i).count;
                int  typeId = rewardItems.get_Item(i).typeId;
                if (i < this.rewardItemsList.get_Count())
                {
                    GameObject gameObject = this.rewardItemsList.get_Item(i).get_gameObject();
                    if (gameObject != null && !gameObject.get_activeSelf())
                    {
                        gameObject.SetActive(true);
                    }
                    Text component = this.rewardItemsList.get_Item(i).FindChild("TextReward").GetComponent <Text>();
                    component.set_text(Utils.SwitchChineseNumber(count, 0) + string.Empty);
                    Image component2 = this.rewardItemsList.get_Item(i).FindChild("ImageReward").GetComponent <Image>();
                    ResourceManager.SetSprite(component2, GameDataUtils.GetItemIcon(typeId));
                }
                i++;
            }
        }
        for (int j = i; j < 3; j++)
        {
            GameObject gameObject2 = this.rewardItemsList.get_Item(j).get_gameObject();
            if (gameObject2 != null && gameObject2.get_activeSelf())
            {
                gameObject2.SetActive(false);
            }
        }
    }
Пример #6
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));
            }
        }
    }
Пример #7
0
    public void UpdateBossItemData(JunTuanBOSSMoXing guildBossData)
    {
        if (!this.isInit)
        {
            this.InitUI();
        }
        this.guildBossCfgData = guildBossData;
        if (guildBossData == null)
        {
            return;
        }
        this.bossNameText.set_text(string.Empty);
        Monster monster = DataReader <Monster> .Get(this.guildBossCfgData.bossId);

        if (monster != null)
        {
            this.callBossName = GameDataUtils.GetChineseContent(monster.name, false);
            this.bossNameText.set_text(this.callBossName);
        }
        ResourceManager.SetIconSprite(this.bossStepNumImg, "shuzi_jie_" + this.guildBossCfgData.rank);
        ResourceManager.SetSprite(this.bossIconImg, ResourceManager.GetIconSprite(this.guildBossCfgData.picture));
        this.GetCallCostItemAndNum();
        if (this.callCostItemID > 0)
        {
            ResourceManager.SetSprite(this.costIconImg, GameDataUtils.GetItemIcon(this.callCostItemID));
        }
        this.costNumText.set_text("x" + this.callCostNum);
    }
Пример #8
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);
    }
Пример #9
0
 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());
 }
Пример #10
0
    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);
    }
Пример #11
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));
     }
 }
Пример #12
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));
     }
 }
Пример #13
0
    public void OpenTreasure(int vipLevel, VipXiaoGuo dataVIPEffect)
    {
        if (!TreasureUIViewModel.IsTreasureValid(vipLevel, dataVIPEffect))
        {
            TreasureUIView.Instance.Show(false);
            return;
        }
        UIManagerControl.Instance.OpenUI("TreasureUI", UINodesManager.NormalUIRoot, false, UIType.NonPush);
        this.ObatinItems.Clear();
        this.SpecialItemText = string.Empty;
        this.VIPEffect       = dataVIPEffect;
        this.VIPLevel10      = GameDataUtils.GetNumIcon10(vipLevel, NumType.Yellow_light);
        this.VIPLevel1       = GameDataUtils.GetNumIcon1(vipLevel, NumType.Yellow_light);
        this.BtnOKText       = GameDataUtils.GetChineseContent(508009, false);
        if (dataVIPEffect.value2 > 0 && dataVIPEffect.value3 > 0)
        {
            this.ConsumeOn   = true;
            this.ConsumeIcon = GameDataUtils.GetItemIcon(dataVIPEffect.value2);
            this.ConsumeNum  = dataVIPEffect.value3.ToString();
        }
        else
        {
            this.ConsumeOn = false;
        }
        string text = string.Empty;
        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);
                if (SpecialItem.IsSpecial(vipBoxItemInfo.itemId))
                {
                    string colorByID = TextColorMgr.GetColorByID("x" + vipBoxItemInfo.itemCount, 405);
                    if (string.IsNullOrEmpty(text))
                    {
                        text = GameDataUtils.GetItemName(vipBoxItemInfo.itemId, true, 0L) + colorByID;
                    }
                    else
                    {
                        text = text + ", " + GameDataUtils.GetItemName(vipBoxItemInfo.itemId, true, 0L) + colorByID;
                    }
                }
                else
                {
                    OOItem2Draw oOItem2Draw = new OOItem2Draw();
                    oOItem2Draw.ID       = vipBoxItemInfo.itemId;
                    oOItem2Draw.ItemIcon = GameDataUtils.GetItemIcon(vipBoxItemInfo.itemId);
                    oOItem2Draw.ItemName = Utils.GetItemNum(vipBoxItemInfo.itemId, (long)vipBoxItemInfo.itemCount);
                    this.ObatinItems.Add(oOItem2Draw);
                }
            }
        }
        this.SpecialItemText = text;
    }
Пример #14
0
    public static SpriteRenderer GetIcon(int moneyType)
    {
        if (DataReader <HuoBi> .Contains(moneyType))
        {
            HuoBi huoBi = DataReader <HuoBi> .Get(moneyType);

            return(GameDataUtils.GetItemIcon(huoBi.items));
        }
        return(ResourceManagerBase.GetNullSprite());
    }
    public void UpdateItem(DiscountItemsInfo info, int type)
    {
        this.currentDiscountItemsInfo = info;
        this.currentShangPinId        = info.id;
        this.selectType = type;
        base.get_transform().FindChild("ButtonChangePro").GetComponent <ButtonCustom>().get_gameObject().SetActive(false);
        ShangPin shangPin = DataReader <ShangPin> .Get(this.currentShangPinId);

        if (shangPin != null)
        {
            List <int> discount = shangPin.discount;
            if (discount.get_Count() > 0)
            {
                base.get_transform().FindChild("MinZheKouValue").GetComponent <Text>().set_text(string.Format(GameDataUtils.GetChineseContent(1006008, false), (float)discount.get_Item(discount.get_Count() - 1) / 10f));
            }
            else
            {
                base.get_transform().FindChild("MinZheKouValue").GetComponent <Text>().set_text(string.Empty);
            }
            base.get_transform().FindChild("ItemFlag").get_gameObject().SetActive(info.num <= 0);
            this.productSum.set_text(Utils.SwitchChineseNumber((long)info.num, 1));
            ResourceManager.SetSprite(this.imgIcon, GameDataUtils.GetItemIcon(shangPin.goodsPool));
            this.textCount.set_text("x" + shangPin.diamond);
            Items items = DataReader <Items> .Get(shangPin.goodsPool);

            if (items != null)
            {
                this.productName.set_text(GameDataUtils.GetChineseContent(items.name, false));
            }
            else
            {
                Debug.LogWarning("Items表没有此数据" + shangPin.goodsPool);
            }
            int   count = shangPin.discount.get_Count();
            float num   = (float)shangPin.discount.get_Item(count - 1);
            float num2  = info.discount / 10f;
            if (num2 < 10f)
            {
                int num3 = (int)Math.Ceiling((double)((float)shangPin.diamond * (num2 / 10f)));
                this.textCount.set_text("x" + num3);
                this.zhekouValue.set_text(num2 + "折");
                this.zhekouBg.get_gameObject().SetActive(true);
            }
            else
            {
                this.zhekouBg.get_gameObject().SetActive(false);
            }
        }
        else
        {
            Debug.LogWarning("ShangPin表没有此数据" + this.currentShangPinId);
        }
    }
Пример #16
0
    public void MoveTo(int offset, int icon, string text, bool isEnd)
    {
        ResourceManager.SetSprite(this.mDisplayItemUnitIcon, GameDataUtils.GetItemIcon(icon));
        this.mDisplayItemUnitText.set_text(text);
        float num      = this.mTweenPositionEnd.y - this.mTweenPositionOffset.y * (float)offset;
        float duration = num / 500f;

        this.mBaseTweenPostion.MoveTo(new Vector3(this.mTweenPositionOffset.x, num, this.mTweenPositionOffset.z), duration, delegate
        {
            DisplayItemManager.Instance.MoveToEnd(this, isEnd);
        });
    }
Пример #17
0
    public void RefreshInfo(int itemID, int maxNum, int price, int money_type, string btnName, string titleName)
    {
        this.ResetBuyRequire();
        this.BtnOKName   = btnName;
        this.BuyMaxCount = maxNum;
        int   itemNum  = 1;
        Items dataItem = DataReader <Items> .Get(itemID);

        this.SetItem(dataItem, itemNum, money_type, price);
        this.CostIcon = GameDataUtils.GetItemIcon(money_type);
        this.Input    = 1.ToString();
        this.SetMoney(1);
    }
Пример #18
0
    public void SetRewardItem(int itemId, long num = -1L, long uid = 0L)
    {
        this.m_itemId = itemId;
        this.m_uId    = uid;
        Image component = base.get_transform().FindChild("RewardItemIcon").GetComponent <Image>();

        ResourceManager.SetSprite(component, GameDataUtils.GetItemIcon(this.m_itemId));
        ResourceManager.SetSprite(base.get_transform().FindChild("RewardItemFrame").GetComponent <Image>(), GameDataUtils.GetItemFrame(this.m_itemId));
        if (num <= 0L)
        {
            base.get_transform().FindChild("RewardItemText").GetComponent <Text>().set_text(string.Empty);
        }
        else
        {
            base.get_transform().FindChild("RewardItemText").GetComponent <Text>().set_text(Utils.GetItemNum(itemId, num));
        }
        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));
        }
        if (items == null || items.gogok <= 0)
        {
            base.get_transform().FindChild("ItemExcellentAttrIconList").get_gameObject().SetActive(false);
        }
        else
        {
            base.get_transform().FindChild("ItemExcellentAttrIconList").get_gameObject().SetActive(true);
            base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image1").GetComponent <Image>().set_enabled(items.gogok >= 1);
            base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image2").GetComponent <Image>().set_enabled(items.gogok >= 2);
            base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image3").GetComponent <Image>().set_enabled(items.gogok >= 3);
        }
        if (items != null && items.tab == 2)
        {
            int excellentAttrsCountByColor = EquipGlobal.GetExcellentAttrsCountByColor(uid, 1f);
            if (excellentAttrsCountByColor > 0)
            {
                base.get_transform().FindChild("ItemExcellentAttrIconList").get_gameObject().SetActive(true);
                base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image1").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 1);
                base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image2").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 2);
                base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image3").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 3);
            }
        }
    }
Пример #19
0
    public void RefreshWing(wings dataWings)
    {
        this.wingId = dataWings.id;
        base.get_transform().set_name(dataWings.id.ToString());
        this.ResetAll();
        this.PlayCanActiveSpine();
        wings wingInfo = WingManager.GetWingInfo(this.wingId);

        this.m_lblWingName.set_text(TextColorMgr.GetColorByQuality(wingInfo.name, wingInfo.color));
        ResourceManager.SetSprite(this.m_spWingIcon, GameDataUtils.GetIcon(wingInfo.icon));
        if (WingManager.GetWingLv(this.wingId) == 0)
        {
            ImageColorMgr.SetImageColor(this.m_spWingIcon, true);
            int  key   = wingInfo.activation.get_Item(0).key;
            int  value = wingInfo.activation.get_Item(0).value;
            long num   = BackpackManager.Instance.OnGetGoodCount(key);
            int  icon  = DataReader <Items> .Get(key).icon;

            ResourceManager.SetSprite(this.m_spimgIcon, GameDataUtils.GetItemIcon(key));
            this.m_spimgIcon.SetNativeSize();
            this.m_activeRequire.get_gameObject().SetActive(true);
            this.m_lblProgress.set_text(num + "/" + value);
            float num2 = Mathf.Clamp01((float)num / (float)value);
            this.m_imgProgress.set_sizeDelta(new Vector2(180f * num2, 18.9f));
            if (WingSelectUI.IsTimeLimitWing(this.wingId))
            {
                this.m_imgTimeLimit.get_gameObject().SetActive(true);
            }
        }
        else
        {
            ImageColorMgr.SetImageColor(this.m_spBackground, false);
            ImageColorMgr.SetImageColor(this.m_spWingIcon, false);
            if (this.wingId == EntityWorld.Instance.EntSelf.Decorations.wingId)
            {
                this.m_imgHighlight.get_gameObject().SetActive(true);
            }
            if (WingSelectUI.IsTimeLimitWing(this.wingId))
            {
                this.m_imgTimeLimit.get_gameObject().SetActive(true);
                this.m_txtTimeLimit.get_gameObject().SetActive(true);
                this.m_txtTimeLimit.set_text(WingSelectUI.GetWingRemainTime(this.wingId));
            }
        }
    }
Пример #20
0
    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);
    }
Пример #21
0
    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));
        }
    }
Пример #22
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);
            }
        }
    }
Пример #23
0
    private void SetRewardItems(List <ItemBriefInfo> rewardItems, List <ItemBriefInfo> rewardItemsExt)
    {
        int i = 0;

        if (rewardItems != null)
        {
            while (i < rewardItems.get_Count())
            {
                long num   = rewardItems.get_Item(i).count;
                int  cfgId = rewardItems.get_Item(i).cfgId;
                long uId   = rewardItems.get_Item(i).uId;
                if (rewardItemsExt != null && i < rewardItemsExt.get_Count())
                {
                    num += rewardItemsExt.get_Item(i).count;
                }
                if (i < this.rewardItemsList.get_Count())
                {
                    GameObject gameObject = this.rewardItemsList.get_Item(i).get_gameObject();
                    if (gameObject != null && !gameObject.get_activeSelf())
                    {
                        gameObject.SetActive(true);
                    }
                    Text component = this.rewardItemsList.get_Item(i).FindChild("TextReward").GetComponent <Text>();
                    component.set_text(num + string.Empty);
                    Image component2 = this.rewardItemsList.get_Item(i).FindChild("ImageReward").GetComponent <Image>();
                    ResourceManager.SetSprite(component2, GameDataUtils.GetItemIcon(cfgId));
                }
                i++;
            }
        }
        for (int j = i; j < 3; j++)
        {
            GameObject gameObject2 = this.rewardItemsList.get_Item(j).get_gameObject();
            if (gameObject2 != null && gameObject2.get_activeSelf())
            {
                gameObject2.SetActive(false);
            }
        }
    }
Пример #24
0
    private void SetSkillUpgradeItem(int itemId, int num)
    {
        Image component = base.FindTransform("GoldIcon").GetComponent <Image>();

        ResourceManager.SetSprite(component, GameDataUtils.GetItemIcon(itemId));
        Text component2 = base.FindTransform("GoldNum").GetComponent <Text>();

        if (EntityWorld.Instance.EntSelf.SkillPoint >= (long)num)
        {
            component2.set_text(EntityWorld.Instance.EntSelf.SkillPoint + "/" + num);
        }
        else
        {
            component2.set_text(string.Concat(new object[]
            {
                "<color=red>",
                EntityWorld.Instance.EntSelf.SkillPoint,
                "/",
                num,
                "</color>"
            }));
        }
    }
Пример #25
0
    public void UpdateItem(GrowUpPlanDataUnite itemData)
    {
        this.typeId = itemData.typeId;
        this.roleLv = itemData.condition;
        ResourceManager.SetSprite(this.imgIcon, GameDataUtils.GetItemIcon(itemData.itemId));
        string text = "x" + itemData.count;

        this.textCount.set_text(text);
        string text2 = string.Format(GameDataUtils.GetChineseContent(513175, false), itemData.condition);

        this.textCondition.set_text(text2);
        int state = itemData.state;

        if (state == 1)
        {
            this.btnGet.get_gameObject().SetActive(true);
            this.btnGet.set_enabled(false);
            this.imgGrey.get_gameObject().SetActive(true);
            this.imgHaveGet.get_gameObject().SetActive(false);
            this.textBtnGet.set_text(GameDataUtils.GetChineseContent(513176, false));
        }
        else if (state == 2)
        {
            this.btnGet.get_gameObject().SetActive(true);
            this.btnGet.set_enabled(true);
            this.imgGrey.get_gameObject().SetActive(false);
            this.imgHaveGet.get_gameObject().SetActive(false);
            this.textBtnGet.set_text(GameDataUtils.GetChineseContent(513177, false));
        }
        else
        {
            this.btnGet.get_gameObject().SetActive(false);
            this.imgHaveGet.get_gameObject().SetActive(true);
        }
        base.get_transform().FindChild("BtnGet").GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickGet);
    }
Пример #26
0
    public void updateItemLogoByItemId(bool isShowButton, int productId = -1)
    {
        int key = ActivityTossDiscountManager.Instance.CurrentShangPinId;

        if (productId != -1)
        {
            key = productId;
        }
        ShangPin shangPin = null;

        if (DataReader <ShangPin> .Contains(key))
        {
            shangPin = DataReader <ShangPin> .Get(key);
        }
        if (shangPin != null)
        {
            base.FindTransform("ButtonAlert").GetComponent <ButtonCustom>().get_gameObject().SetActive(isShowButton);
            base.FindTransform("ButtonSelectAlert").GetComponent <ButtonCustom>().get_gameObject().SetActive(!isShowButton);
            ResourceManager.SetSprite(base.FindTransform("ButtonAlert").FindChild("SelectProLogo2").GetComponent <Image>(), GameDataUtils.GetItemIcon(shangPin.goodsPool));
            Items items = DataReader <Items> .Get(shangPin.goodsPool);

            if (items != null)
            {
                base.FindTransform("ButtonAlert").FindChild("Name").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(items.name, false));
            }
            else
            {
                Debug.LogWarning("Items表没有此数据" + shangPin.goodsPool);
            }
        }
        base.FindTransform("ButtonAlert").FindChild("SelectProTitle").GetComponent <Text>().get_gameObject().SetActive(shangPin == null);
    }
Пример #27
0
    private GameObject CreateRewards(int id, long value)
    {
        GameObject go = this.GetUnusedItem();

        if (go == null)
        {
            go = ResourceManager.GetInstantiate2Prefab("TaskRewardItem");
            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);
    }
Пример #28
0
    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());
    }
Пример #29
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;
    }
Пример #30
0
    public void ShowRewardList(int targetValue)
    {
        AcItemInfo acItemInfo = null;

        for (int i = 0; i < this.boxListInfo.get_Count(); i++)
        {
            if (this.boxListInfo.get_Item(i).targetVal == targetValue)
            {
                acItemInfo = this.boxListInfo.get_Item(i);
                break;
            }
        }
        if (acItemInfo == null)
        {
            Debug.LogError("Thers is no exist targetValue:" + targetValue);
            return;
        }
        this.ClearRewardItems();
        this.SetBtnGet(acItemInfo.status, acItemInfo.targetVal);
        string text = acItemInfo.targetVal.ToString();

        this.conditionText.set_text("累计充值" + text + "钻石可获得奖励:");
        Vector2 sizeDelta = new Vector2((float)(105 * acItemInfo.items.get_Count()), 110f);

        this.rewardList.GetComponent <RectTransform>().set_sizeDelta(sizeDelta);
        for (int j = 0; j < acItemInfo.items.get_Count(); j++)
        {
            int        itemId             = acItemInfo.items.get_Item(j).itemCfgId;
            int        itemNum            = acItemInfo.items.get_Item(j).itemNum;
            GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("GiftRewardItem");
            this.RewardItems.Add(instantiate2Prefab);
            Transform transform = instantiate2Prefab.get_transform();
            transform.SetParent(this.rewardList.get_transform(), false);
            instantiate2Prefab.SetActive(true);
            ResourceManager.SetSprite(transform.FindChild("Frame").GetComponent <Image>(), GameDataUtils.GetItemFrame(itemId));
            ResourceManager.SetSprite(transform.FindChild("Icon").GetComponent <Image>(), GameDataUtils.GetItemIcon(itemId));
            transform.FindChild("Name").GetComponent <Text>().set_text(GameDataUtils.GetItemName(itemId, true, 0L));
            transform.FindChild("Num").GetComponent <Text>().set_text(itemNum.ToString());
            transform.GetComponent <ButtonCustom>().get_onClick().AddListener(delegate
            {
                this.OnClickItem(itemId);
            });
        }
    }