Пример #1
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);
            }
        }
    }
Пример #2
0
    private void SetGemIcon(int typeId)
    {
        Items items = DataReader <Items> .Get(typeId);

        if (items == null)
        {
            return;
        }
        Image component = this.imgIcon.GetComponent <Image>();

        ResourceManager.SetSprite(component, GameDataUtils.GetItemFrameByColor(items.color));
        Image component2 = this.imgIcon.get_transform().FindChild("imgItem").GetComponent <Image>();

        ResourceManager.SetSprite(component2, GameDataUtils.GetIcon(items.icon));
        Text component3 = this.imgIcon.get_transform().FindChild("texName").GetComponent <Text>();

        component3.set_text(GameDataUtils.GetItemName(items, true));
        Dictionary <string, Color> textColorByQuality = GameDataUtils.GetTextColorByQuality(items.color);

        component3.set_color(textColorByQuality.get_Item("TextColor"));
        this.imgIcon.get_transform().FindChild("texName").GetComponent <Outline>().set_effectColor(textColorByQuality.get_Item("TextOutlineColor"));
        Text component4 = this.imgIcon.get_transform().FindChild("texLv").GetComponent <Text>();

        component4.set_text(string.Empty);
        if (!GemGlobal.IsGemEnoughLv(typeId))
        {
            int roleLvRequire = GemGlobal.GetRoleLvRequire(typeId);
            component4.set_text(string.Format(GameDataUtils.GetChineseContent(509011, false), roleLvRequire));
        }
        base.FindTransform("texDesc").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(items.describeId1, false));
    }
Пример #3
0
    public static string GetEquipItemNameAndLV(int cfgID, bool colorShow = false)
    {
        Items items = DataReader <Items> .Get(cfgID);

        if (items == null)
        {
            return(string.Empty);
        }
        string text = string.Empty;

        if (items.firstType != 1)
        {
            text = GameDataUtils.GetItemName(cfgID, colorShow, 0L);
        }
        else
        {
            zZhuangBeiPeiZhiBiao zZhuangBeiPeiZhiBiao = DataReader <zZhuangBeiPeiZhiBiao> .Get(cfgID);

            text = GameDataUtils.GetItemName(cfgID, colorShow, 0L);
            if (zZhuangBeiPeiZhiBiao != null)
            {
                if (EntityWorld.Instance.EntSelf.Lv >= zZhuangBeiPeiZhiBiao.level)
                {
                    text = text + "  LV." + zZhuangBeiPeiZhiBiao.level;
                }
                else
                {
                    text += string.Format("<color=#ff0000>  LV.{0}</color>", zZhuangBeiPeiZhiBiao.level);
                }
            }
        }
        return(text);
    }
Пример #4
0
 private void ShowRewards(GetPetTaskRewardRes down)
 {
     for (int i = 0; i < down.rewards.get_Count(); i++)
     {
         UIManagerControl.Instance.ShowToastText(GameDataUtils.GetItemName(down.rewards.get_Item(i).cfgId, true, 0L) + "x" + down.rewards.get_Item(i).count);
     }
 }
Пример #5
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);
    }
Пример #6
0
    public void OpenSourceReferenceUI(int itemID, Action action = null)
    {
        string text     = GameDataUtils.GetChineseContent(508022, false);
        string itemName = GameDataUtils.GetItemName(itemID, true, 0L);

        text = string.Format(text, itemName);
        UIManagerControl.Instance.ShowToastText(text);
    }
Пример #7
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));
     }
 }
Пример #8
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));
     }
 }
Пример #9
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;
    }
Пример #10
0
    public static string GetItemName(int cfgId, bool colorShow = true, long num = 0L)
    {
        Items dataItem = DataReader <Items> .Get(cfgId);

        if (num <= 0L)
        {
            return(GameDataUtils.GetItemName(dataItem, colorShow));
        }
        return(GameDataUtils.GetItemNameAndNum(dataItem, colorShow, num));
    }
Пример #11
0
    public void UpdateItem(int onlyId, int id, int itemCount, int count, int reputation, List <NpcExchangeInfo> data)
    {
        this.HideGY();
        this.IconItemId      = id;
        this.OnlyId          = onlyId;
        this.ReputationValue = reputation;
        this.StockCount      = count;
        for (int i = 0; i < this.ImgIconGameObject.get_childCount(); i++)
        {
            Object.Destroy(this.ImgIconGameObject.GetChild(i).get_gameObject());
        }
        GameObject gameObject = ItemShow.ShowItem(this.ImgIconGameObject, id, -1L, false, null, 2001);

        this.TextName.set_text(GameDataUtils.GetItemName(id, false, 0L));
        string text  = string.Empty;
        string text2 = string.Empty;

        this.ImageState1.SetActive(false);
        this.ImageState2.SetActive(false);
        this.ImageState3.SetActive(false);
        if (count == -1)
        {
            text = "声望要求:" + reputation.ToString();
            if (EntityWorld.Instance.EntSelf.Reputation >= (long)reputation)
            {
                bool flag = this.CheckItemEnough(data);
                if (flag)
                {
                    this.ImageState2.SetActive(true);
                }
            }
        }
        else
        {
            if (count < 1)
            {
                this.ImageState3.SetActive(true);
            }
            else if (EntityWorld.Instance.EntSelf.Reputation >= (long)reputation)
            {
                bool flag2 = this.CheckItemEnough(data);
                if (flag2)
                {
                    this.ImageState2.SetActive(true);
                }
            }
            text  = "剩余库存:" + count.ToString();
            text2 = "声望要求:" + reputation.ToString();
        }
        this.TextCount.set_text(text);
        this.TextReputation.set_text(text2);
        this.TextNeedCount.set_text(itemCount.ToString());
        this.ExchangeData = data;
        this.IsCanClick   = true;
    }
Пример #12
0
    public static string GetName(int moneyType)
    {
        string result = "***";
        HuoBi  huoBi  = DataReader <HuoBi> .Get(moneyType);

        if (huoBi != null)
        {
            result = GameDataUtils.GetItemName(huoBi.items, true, 0L);
        }
        return(result);
    }
Пример #13
0
 private void OnUpdateQuestionReward(short state, GuildQuestionRewardNty down = null)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     for (int i = 0; i < down.item.get_Count(); i++)
     {
         UIManagerControl.Instance.ShowToastText(GameDataUtils.GetItemName(down.item.get_Item(i).cfgId, true, down.item.get_Item(i).count), 1f, 1f);
     }
 }
Пример #14
0
 private void ShowExpFloatTips(List <ItemBriefInfo> rewardItems)
 {
     if (rewardItems != null && rewardItems.get_Count() > 0)
     {
         for (int i = 0; i < rewardItems.get_Count(); i++)
         {
             if (rewardItems.get_Item(i).cfgId == 1)
             {
                 string content = GameDataUtils.GetItemName(1, false, 0L) + "+" + Utils.SwitchChineseNumber(rewardItems.get_Item(i).count, 0);
                 FloatTipManager.Instance.AddFloatTip(EntityWorld.Instance.EntSelf.ID, EntityWorld.Instance.EntSelf.Actor.FixTransform, content, "50ff14", false, 1f, 1f, 2.5f, 58f);
                 break;
             }
         }
     }
 }
Пример #15
0
 protected void OnGetCityFakeDrop(short state, PickUpWildBossItemRes down = null)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (down == null)
     {
         return;
     }
     for (int i = 0; i < down.item.get_Count(); i++)
     {
         UIManagerControl.Instance.ShowToastText(GameDataUtils.GetItemName(down.item.get_Item(i).typeId, true, down.item.get_Item(i).count), 1f, 1f);
     }
 }
Пример #16
0
    private void RefreshDetailInfos(List <DetailInfo> detailInfos, List <int> eventIds)
    {
        if (detailInfos == null || detailInfos.get_Count() == 0 || eventIds == null || eventIds.get_Count() == 0)
        {
            return;
        }
        int num = 0;

        while (num < detailInfos.get_Count() && num < eventIds.get_Count())
        {
            DetailInfo detailInfo = detailInfos.get_Item(num);
            if (eventIds.get_Item(num) > 0)
            {
                GuangBoLianJie guangBoLianJie = DataReader <GuangBoLianJie> .Get(eventIds.get_Item(num));

                if (guangBoLianJie != null)
                {
                    detailInfo.type = LinkType.GetDetailType(guangBoLianJie.type);
                    if (detailInfo.type == DetailType.DT.UI)
                    {
                        detailInfo.cfgId = guangBoLianJie.link;
                        detailInfo.label = GameDataUtils.GetChineseContent(guangBoLianJie.name, false);
                    }
                    else if (detailInfo.type == DetailType.DT.Interface)
                    {
                        detailInfo.cfgId = guangBoLianJie.hitEventId;
                        detailInfo.label = GameDataUtils.GetChineseContent(guangBoLianJie.name, false);
                    }
                    else if (detailInfo.type == DetailType.DT.Equipment && eventIds.get_Item(num) == 66)
                    {
                        detailInfo.label = GameDataUtils.GetItemName(detailInfo.cfgId, false, 0L);
                    }
                    if (guangBoLianJie.click == 0)
                    {
                        detailInfo.type = DetailType.DT.Default;
                    }
                }
            }
            else
            {
                detailInfo.type = DetailType.DT.Default;
            }
            num++;
        }
    }
Пример #17
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);
            });
        }
    }
Пример #18
0
    private void SetEnchantmentIcon(int typeId)
    {
        Items items = DataReader <Items> .Get(typeId);

        if (items == null)
        {
            return;
        }
        Transform transform = base.FindTransform("imgGrid0");
        Image     component = transform.GetComponent <Image>();

        ResourceManager.SetSprite(component, GameDataUtils.GetItemFrameByColor(items.color));
        Image component2 = transform.FindChild("imgItem").GetComponent <Image>();

        ResourceManager.SetSprite(component2, GameDataUtils.GetIcon(items.icon));
        Text component3 = transform.FindChild("texName").GetComponent <Text>();

        component3.set_text(GameDataUtils.GetItemName(typeId, true, 0L));
        Dictionary <string, Color> textColorByQuality = GameDataUtils.GetTextColorByQuality(items.color);

        component3.set_color(textColorByQuality.get_Item("TextColor"));
        transform.get_transform().FindChild("texName").GetComponent <Outline>().set_effectColor(textColorByQuality.get_Item("TextOutlineColor"));
        Text component4 = transform.FindChild("texLv").GetComponent <Text>();

        component4.set_text(string.Empty);
        Text component5 = base.FindTransform("texDesc").GetComponent <Text>();
        int  describeId = items.describeId1;

        component5.set_text(GameDataUtils.GetChineseContent(describeId, false));
        string canEnchantmentPosDesc = EquipGlobal.GetCanEnchantmentPosDesc(items.id);
        Text   expr_112 = component5;

        expr_112.set_text(expr_112.get_text() + "\n");
        Text expr_129 = component5;

        expr_129.set_text(expr_129.get_text() + "\n");
        Text expr_140 = component5;

        expr_140.set_text(expr_140.get_text() + "可用部位:" + canEnchantmentPosDesc);
    }
Пример #19
0
 private void OnRechargeSuccessNty(short state, RechargeSuccessNty down = null)
 {
     WaitUI.CloseUI(0u);
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (down != null)
     {
         if (down.item.get_Count() > 0)
         {
             string text = string.Empty;
             for (int i = 0; i < down.item.get_Count(); i++)
             {
                 if (i > 0)
                 {
                     text += ", ";
                 }
                 string text2 = text;
                 text = string.Concat(new object[]
                 {
                     text2,
                     GameDataUtils.GetItemName(down.item.get_Item(i).itemId, true, 0L),
                     "x",
                     down.item.get_Item(i).count
                 });
             }
             DialogBoxUIViewModel.Instance.ShowAsConfirm("充值成功", string.Format(down.info, text), null, "确定", "button_orange_1", null);
         }
         else
         {
             UIManagerControl.Instance.ShowToastText("激活成功");
         }
     }
 }
Пример #20
0
    private string GetLogContent(int type, string roleName, int value, int itemID = 0)
    {
        GongHuiRiZhi gongHuiRiZhi = DataReader <GongHuiRiZhi> .Get(type);

        string result = string.Empty;

        if (gongHuiRiZhi == null)
        {
            return(result);
        }
        switch (type)
        {
        case 1:
        case 2:
        case 3:
            result = string.Format(gongHuiRiZhi.log, roleName);
            break;

        case 4:
        {
            string titleName = GuildManager.Instance.GetTitleName((MemberTitleType.MTT)value);
            result = string.Format(gongHuiRiZhi.log, roleName, titleName);
            break;
        }

        case 5:
            result = gongHuiRiZhi.log;
            break;

        case 6:
        {
            string text = string.Empty;
            text = GameDataUtils.GetItemName(itemID, true, 0L);
            this.itemNameText.set_text(text);
            result = string.Format(gongHuiRiZhi.log, roleName, string.Empty);
            break;
        }

        case 7:
            result = string.Format(gongHuiRiZhi.log, value);
            break;

        case 8:
            result = string.Format(gongHuiRiZhi.log, roleName, value);
            break;

        case 11:
        case 12:
        {
            Items  item    = BackpackManager.Instance.GetItem(itemID);
            string content = string.Empty;
            if (item != null)
            {
                content = GameDataUtils.GetChineseContent(item.name, false);
                this.itemNameText.set_text(GameDataUtils.GetItemName(itemID, true, 0L));
            }
            string     content2 = string.Format(gongHuiRiZhi.log, roleName, string.Empty);
            float      helpTextPreferredWidth  = this.GetHelpTextPreferredWidth(content2);
            float      helpTextPreferredWidth2 = this.GetHelpTextPreferredWidth(content);
            DetailInfo detailInfo = new DetailInfo();
            detailInfo.cfgId = itemID;
            detailInfo.type  = DetailType.DT.Equipment;
            Button2Touch button2Touch = base.get_transform().GetComponentInChildren <Button2Touch>();
            if (button2Touch == null)
            {
                button2Touch = this.GetButtonTouch(itemID);
                button2Touch.SetButton2Touch(null, base.get_transform(), detailInfo, null);
            }
            else
            {
                button2Touch.SetButton2Touch(null, base.get_transform(), detailInfo, null);
            }
            if (button2Touch != null)
            {
                float num = 338f + helpTextPreferredWidth;
                button2Touch.m_myRectTransform.set_anchoredPosition(new Vector2(num, 5f));
                button2Touch.Underline(helpTextPreferredWidth2 + 10f, 30, false);
            }
            result = string.Format(gongHuiRiZhi.log, roleName, string.Empty);
            break;
        }
        }
        return(result);
    }
Пример #21
0
    public void Refresh(int itemId)
    {
        (base.get_transform() as RectTransform).set_anchoredPosition(new Vector2(5000f, 5000f));
        this.BtnUseVisibility = false;
        this.ItemLv           = string.Empty;
        Items item = BackpackManager.Instance.GetItem(itemId);

        if (item != null)
        {
            this.ItemFrame = GameDataUtils.GetItemFrame(item.id);
            this.ItemIcon  = GameDataUtils.GetIcon(item.icon);
            this.ItemName  = GameDataUtils.GetItemName(item, true);
            if (item.minLv > EntityWorld.Instance.EntSelf.Lv)
            {
                this.ItemLv = string.Format(GameDataUtils.GetChineseContent(509011, false), item.minLv);
            }
            string color          = TextColorMgr.GetColor(BackpackManager.Instance.OnGetGoodCount(itemId).ToString(), "ff7d4b", string.Empty);
            string chineseContent = GameDataUtils.GetChineseContent(509010, false);
            this.ItemNum        = TextColorMgr.GetColor(string.Format(chineseContent, " " + color), "eccd9b", string.Empty);
            this.ItemProfession = GameDataUtils.GetItemProfession(item);
            if (item.step <= 0)
            {
                this.ItemStepVisibility = false;
            }
            else
            {
                this.ItemStepVisibility = true;
                this.ItemStepText       = string.Format(GameDataUtils.GetChineseContent(505023, false), item.step);
            }
            this.ExcellentCount = item.gogok;
            this.TextItems.Clear();
            List <string> itemAttr = BackpackManager.Instance.GetItemAttr(item);
            if (itemAttr != null)
            {
                GameObject gameObject = GameObject.Find("Attrs");
                if (gameObject != null)
                {
                    gameObject.GetComponent <Image>().set_enabled(true);
                }
                for (int i = 0; i < itemAttr.get_Count(); i++)
                {
                    this.TextItems.Add(new OOItem2Text
                    {
                        Content = TextColorMgr.GetColor(itemAttr.get_Item(i), "ECCD9B", string.Empty)
                    });
                }
            }
            else
            {
                GameObject gameObject2 = GameObject.Find("Attrs");
                if (gameObject2 != null)
                {
                    gameObject2.GetComponent <Image>().set_enabled(false);
                }
            }
            if (item.describeId1 > 0)
            {
                this.Desc = TextColorMgr.GetColor(GameDataUtils.GetChineseContent(item.describeId1, false), "FF7D4B", string.Empty);
            }
            else
            {
                this.Desc = string.Empty;
            }
            if (item.describeId2 > 0)
            {
                this.AttrDesc = TextColorMgr.GetColor(GameDataUtils.GetChineseContent(item.describeId2, false), "5AB9FF", string.Empty);
            }
            else
            {
                this.AttrDesc = string.Empty;
            }
        }
    }
Пример #22
0
    private void RecvGemSysCompositeRes(short state, GemSysCompositeRes msg = null)
    {
        if (state != 0)
        {
            StateManager.Instance.StateShow(state, 0);
            return;
        }
        if (msg == null)
        {
            return;
        }
        GemSelectUI gemSelectUI = UIManagerControl.Instance.GetUIIfExist("GemSelectUI") as GemSelectUI;

        if (gemSelectUI != null && GemUI.instance != null)
        {
            gemSelectUI.Refresh((int)GemUI.instance.equipCurr, GemUI.instance.slotCurr);
        }
        string text = string.Format(GameDataUtils.GetChineseContent(505157, false), msg.count, GameDataUtils.GetItemName(msg.typeId, true, 0L));

        UIManagerControl.Instance.ShowToastText(text, 2f, 2f);
        EventDispatcher.Broadcast(EventNames.EquipDetailedShouldCheckBadge);
        this.CheckCanShowWearingGemPromoteWay();
    }
Пример #23
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);
    }
Пример #24
0
    public void UpdateUIData(int itemCfgID, string titleName = "", string btnName = "", Action BtnCallBack = null, bool showCloseBtn = false, Action BtnCloseCallBack = null, int depth = 2000)
    {
        this.InitUI();
        FXSpineManager.Instance.DeleteSpine(this.equipFxID, true);
        this.equipFxID = 0;
        Items items = DataReader <Items> .Get(itemCfgID);

        if (items == null)
        {
            Debug.Log("item == null  itemID = " + itemCfgID);
            return;
        }
        this.m_itemID    = itemCfgID;
        this.showUIDepth = depth;
        ResourceManager.SetSprite(this.m_imageFrame, GameDataUtils.GetItemFrame(itemCfgID));
        ResourceManager.SetSprite(this.m_imageIcon, GameDataUtils.GetItemIcon(itemCfgID));
        if (items.step > 0)
        {
            base.FindTransform("ItemStep").get_gameObject().SetActive(true);
            this.itemStepText.set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
        }
        else
        {
            base.FindTransform("ItemStep").get_gameObject().SetActive(false);
        }
        if (items.tab == 2)
        {
            DepthOfUI depthOfUI = base.FindTransform("ItemStep").GetComponent <DepthOfUI>();
            if (depthOfUI == null)
            {
                depthOfUI = base.FindTransform("ItemStep").get_gameObject().AddComponent <DepthOfUI>();
            }
            depthOfUI.SortingOrder = depth + 1;
            DepthOfUI depthOfUI2 = base.FindTransform("ExcellentAttrIconList").GetComponent <DepthOfUI>();
            if (depthOfUI2 == null)
            {
                depthOfUI2 = base.FindTransform("ExcellentAttrIconList").get_gameObject().AddComponent <DepthOfUI>();
            }
            depthOfUI2.SortingOrder = depth + 1;
            DepthOfUI depthOfUI3 = base.FindTransform("ImageBinding").GetComponent <DepthOfUI>();
            if (depthOfUI3 == null)
            {
                depthOfUI3 = base.FindTransform("ImageBinding").get_gameObject().AddComponent <DepthOfUI>();
            }
            depthOfUI3.SortingOrder = depth + 1;
        }
        this.ItemNameContent = GameDataUtils.GetItemName(itemCfgID, true, 0L);
        this.titleText.set_text(titleName);
        this.btnNameText.set_text(btnName);
        if (items != null)
        {
            base.FindTransform("FightingRegion").get_gameObject().SetActive(items.tab == 2);
        }
        if (BtnCallBack != null)
        {
            this.BtnCallBackAction = BtnCallBack;
        }
        this.BtnCloseCallBack = BtnCloseCallBack;
        base.FindTransform("CloseBtn").get_gameObject().SetActive(showCloseBtn);
        GuideManager.Instance.CheckQueue(false, false);
    }
Пример #25
0
    public static string GetGemName(int type, int lv)
    {
        int gemId = GemGlobal.GetGemId(type, lv);

        return(GameDataUtils.GetItemName(gemId, true, 0L));
    }
Пример #26
0
    public static void ItemNotEnoughToLink(int itemID, bool showItemName = true, Action callbck = null, bool Rclose = true)
    {
        int   linkID = 102;
        Items items  = DataReader <Items> .Get(itemID);

        if (items == null)
        {
            return;
        }
        Transform root = UINodesManager.TopUIRoot;
        int       id   = 505103;

        if (items.tab == 4)
        {
            linkID = 7;
            id     = 505104;
        }
        else if (items.id == 2)
        {
            linkID = 29;
        }
        else if (items.id == 11)
        {
            linkID = 18;
            id     = 505104;
        }
        else if (items.id == 37001)
        {
            id   = 505110;
            root = UINodesManager.MiddleUIRoot;
        }
        else if (items.id >= 36200 && items.id <= 36205)
        {
            linkID = 62;
        }
        else if (items.id >= 36206 && items.id <= 36208)
        {
            linkID = 33;
        }
        else if (items.id == 39003)
        {
        }
        if (!SystemConfig.IsOpenPay && (linkID == 62 || linkID == 102))
        {
            string itemName = GameDataUtils.GetItemName(itemID, true, 0L);
            UIManagerControl.Instance.ShowToastText("您所拥有的" + itemName + "不足!!!");
            return;
        }
        string     text       = string.Empty;
        SystemOpen systemOpen = DataReader <SystemOpen> .Get(linkID);

        if (systemOpen != null)
        {
            string text2     = string.Empty;
            string itemName2 = GameDataUtils.GetItemName(itemID, false, 0L);
            text   = GameDataUtils.GetChineseContent(systemOpen.name, false);
            text2  = ((!showItemName) ? "您所拥有的物品不足" : string.Format(GameDataUtils.GetChineseContent(508022, false), itemName2));
            text2 += string.Format("," + GameDataUtils.GetChineseContent(id, false), text);
            DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(621264, false), text2, null, delegate
            {
                if (callbck != null)
                {
                    callbck.Invoke();
                    DialogBoxUIViewModel.Instance.BtnRclose = Rclose;
                }
                else
                {
                    LinkNavigationManager.SystemLink(linkID, true, null);
                }
            }, GameDataUtils.GetChineseContent(505113, false), GameDataUtils.GetChineseContent(505114, false), "button_orange_1", "button_yellow_1", root, true, true);
            DialogBoxUIView.Instance.SetMask(0.7f, true, false);
        }
    }
Пример #27
0
    private string ContentFormat(NewBroadCastInfoPush down = null)
    {
        if (down == null)
        {
            return(string.Empty);
        }
        int            id             = down.id;
        GuangBoNeiRong guangBoNeiRong = DataReader <GuangBoNeiRong> .Get(id);

        if (guangBoNeiRong == null)
        {
            return(string.Empty);
        }
        string chineseContent = GameDataUtils.GetChineseContent(guangBoNeiRong.desc, false);

        if (string.IsNullOrEmpty(chineseContent))
        {
            return(string.Empty);
        }
        List <string> list       = new List <string>();
        List <int>    hitEventId = DataReader <GuangBoNeiRong> .Get(id).hitEventId;

        int count = hitEventId.get_Count();

        if (count >= 1)
        {
            for (int i = 0; i < count; i++)
            {
                int type = DataReader <GuangBoLianJie> .Get(hitEventId.get_Item(i)).type;

                switch (type)
                {
                case 0:
                    list.Add((i >= down.paramters.get_Count()) ? string.Empty : down.paramters.get_Item(i).label);
                    break;

                case 1:
                    list.Add((i >= down.paramters.get_Count()) ? string.Empty : down.paramters.get_Item(i).label);
                    break;

                case 2:
                    list.Add((down.paramters.get_Count() >= i) ? string.Empty : GameDataUtils.GetItemName(down.paramters.get_Item(i).cfgId, false, 0L));
                    break;

                case 3:
                case 4:
                    list.Add(GameDataUtils.GetChineseContent(DataReader <GuangBoLianJie> .Get(hitEventId.get_Item(i)).name, false));
                    break;

                default:
                    Debug.LogError(string.Concat(new object[]
                    {
                        "There is no hitType: ",
                        type,
                        " ,  Broadcast ID: ",
                        id
                    }));
                    list.Add(string.Empty);
                    break;
                }
            }
        }
        string result;

        try
        {
            if (count <= 0)
            {
                result = chineseContent;
            }
            else if (count == 1)
            {
                result = string.Format(chineseContent, list.get_Item(0));
            }
            else if (count == 2)
            {
                result = string.Format(chineseContent, list.get_Item(0), list.get_Item(1));
            }
            else if (count == 3)
            {
                result = string.Format(chineseContent, list.get_Item(0), list.get_Item(1), list.get_Item(2));
            }
            else if (count == 4)
            {
                result = string.Format(chineseContent, new object[]
                {
                    list.get_Item(0),
                    list.get_Item(1),
                    list.get_Item(2),
                    list.get_Item(3)
                });
            }
            else if (count == 5)
            {
                result = string.Format(chineseContent, new object[]
                {
                    list.get_Item(0),
                    list.get_Item(1),
                    list.get_Item(2),
                    list.get_Item(3),
                    list.get_Item(4)
                });
            }
            else
            {
                result = string.Empty;
            }
        }
        catch (Exception ex)
        {
            Debug.LogError(ex.get_Message());
            Debug.LogError(string.Concat(new object[]
            {
                "广播Format出错, _id = ",
                id,
                ", desc = ",
                chineseContent
            }));
            result = string.Empty;
        }
        return(result);
    }
Пример #28
0
    public void SetEquipItemData(EquipSimpleInfo equipSimpleInfo, int hasMaxMoney = 0)
    {
        if (equipSimpleInfo == null)
        {
            return;
        }
        if (!DataReader <zZhuangBeiPeiZhiBiao> .Contains(equipSimpleInfo.cfgId))
        {
            return;
        }
        zZhuangBeiPeiZhiBiao zZhuangBeiPeiZhiBiao = DataReader <zZhuangBeiPeiZhiBiao> .Get(equipSimpleInfo.cfgId);

        Image component = base.FindTransform("ItemFrame").GetComponent <Image>();

        if (component != null)
        {
            ResourceManager.SetSprite(component, GameDataUtils.GetItemFrame(equipSimpleInfo.cfgId));
        }
        Image component2 = base.FindTransform("ItemIcon").GetComponent <Image>();

        if (component2 != null)
        {
            ResourceManager.SetSprite(component2, GameDataUtils.GetItemIcon(equipSimpleInfo.cfgId));
        }
        Text component3 = base.FindTransform("ItemName").GetComponent <Text>();

        if (component3 != null)
        {
            component3.set_text(GameDataUtils.GetItemName(equipSimpleInfo.cfgId, true, 0L));
        }
        Text component4 = base.FindTransform("ItemLv").GetComponent <Text>();

        component4.set_text(zZhuangBeiPeiZhiBiao.level.ToString());
        Text   component5          = base.FindTransform("ItemCareerLimit").GetComponent <Text>();
        string equipOccupationName = EquipGlobal.GetEquipOccupationName(zZhuangBeiPeiZhiBiao.id);

        component5.set_text(equipOccupationName);
        Text component6 = base.FindTransform("ItemFightingScore").GetComponent <Text>();
        Text component7 = base.FindTransform("EquipStepText").GetComponent <Text>();

        component7.set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), zZhuangBeiPeiZhiBiao.step));
        long num = (long)EquipmentManager.Instance.GetEquipFightingByExcellentAttrs(equipSimpleInfo.cfgId, equipSimpleInfo.excellentAttrs);

        if (this.fightingText != null)
        {
            this.fightingText.set_text(num + string.Empty);
        }
        Transform transform = base.FindTransform("BaseAttr");
        Attrs     attrs     = DataReader <Attrs> .Get(zZhuangBeiPeiZhiBiao.attrBaseValue);

        if (attrs != null)
        {
            for (int i = 0; i < attrs.attrs.get_Count(); i++)
            {
                if (i > 2)
                {
                    break;
                }
                long value = (long)attrs.values.get_Item(i);
                transform.FindChild("EquipItem2Text" + i).get_gameObject().SetActive(true);
                transform.FindChild("EquipItem2Text" + i).FindChild("Item2Text").GetComponent <Text>().set_text(AttrUtility.GetStandardAddDesc((GameData.AttrType)attrs.attrs.get_Item(i), value, "ff7d4b"));
            }
            for (int j = attrs.attrs.get_Count(); j < 3; j++)
            {
                transform.FindChild("EquipItem2Text" + j).get_gameObject().SetActive(false);
            }
        }
        Transform transform2 = base.FindTransform("ExcellentAttr");
        Transform transform3 = base.FindTransform("ExcellentAttrIconList");

        transform3.get_gameObject().SetActive(false);
        if (equipSimpleInfo.excellentAttrs.get_Count() > 0)
        {
            transform2.get_gameObject().SetActive(true);
            int k    = 0;
            int num2 = 0;
            while (k < equipSimpleInfo.excellentAttrs.get_Count())
            {
                if (k >= 5)
                {
                    break;
                }
                if (equipSimpleInfo.excellentAttrs.get_Item(k).attrId < 0)
                {
                    transform2.FindChild("EquipItem2Text" + k).get_gameObject().SetActive(false);
                }
                else
                {
                    string excellentTypeColor = EquipGlobal.GetExcellentTypeColor(equipSimpleInfo.excellentAttrs.get_Item(k).color);
                    string text = string.Empty;
                    text = AttrUtility.GetStandardAddDesc(equipSimpleInfo.excellentAttrs.get_Item(k).attrId, equipSimpleInfo.excellentAttrs.get_Item(k).value, excellentTypeColor, excellentTypeColor);
                    transform2.FindChild("EquipItem2Text" + k).get_gameObject().SetActive(true);
                    transform2.FindChild("EquipItem2Text" + k).FindChild("Item2Text").GetComponent <Text>().set_text(text);
                    string excellentRangeText = EquipGlobal.GetExcellentRangeText(equipSimpleInfo.cfgId, equipSimpleInfo.excellentAttrs.get_Item(k).attrId);
                    transform2.FindChild("EquipItem2Text" + k).FindChild("Item2TextRange").GetComponent <Text>().set_text(excellentRangeText);
                    if (equipSimpleInfo.excellentAttrs.get_Item(k).color >= 1f)
                    {
                        transform2.FindChild("EquipItem2Text" + k).FindChild("ItemImg").GetComponent <Image>().set_enabled(true);
                        num2++;
                    }
                    else
                    {
                        transform2.FindChild("EquipItem2Text" + k).FindChild("ItemImg").GetComponent <Image>().set_enabled(false);
                    }
                }
                k++;
            }
            for (int l = k; l < 5; l++)
            {
                transform2.FindChild("EquipItem2Text" + l).get_gameObject().SetActive(false);
            }
            if (num2 > 0)
            {
                if (!transform3.get_gameObject().get_activeSelf())
                {
                    transform3.get_gameObject().SetActive(true);
                }
                for (int m = 0; m < num2; m++)
                {
                    if (num2 >= 3)
                    {
                        break;
                    }
                    transform3.FindChild("Image" + (m + 1)).get_gameObject().SetActive(true);
                }
                for (int n = num2; n < 3; n++)
                {
                    transform3.FindChild("Image" + (n + 1)).get_gameObject().SetActive(false);
                }
            }
        }
        int num3;

        for (num3 = 0; num3 < zZhuangBeiPeiZhiBiao.starNum; num3++)
        {
            this.starTransformList.get_Item(num3).get_gameObject().SetActive(true);
            if (equipSimpleInfo.star > num3)
            {
                this.starTransformList.get_Item(num3).FindChild("OpenStar").get_gameObject().SetActive(true);
                string starLevelSpriteName = this.GetStarLevelSpriteName(equipSimpleInfo.starToMaterial.get_Item(num3));
                ResourceManager.SetSprite(this.starTransformList.get_Item(num3).FindChild("OpenStar").GetComponent <Image>(), ResourceManager.GetIconSprite(starLevelSpriteName));
            }
            else
            {
                this.starTransformList.get_Item(num3).FindChild("OpenStar").get_gameObject().SetActive(false);
            }
        }
        for (int num4 = num3; num4 < this.starTransformList.get_Count(); num4++)
        {
            this.starTransformList.get_Item(num4).get_gameObject().SetActive(false);
        }
        List <int> list = new List <int>();

        list.Add(equipSimpleInfo.cfgId);
        int    equipsTotalPoint = GuildStorageManager.Instance.GetEquipsTotalPoint(list, false);
        string text2            = "x" + equipsTotalPoint;

        if (hasMaxMoney >= equipsTotalPoint)
        {
            this.CostNumText = " " + text2;
        }
        else
        {
            this.CostNumText = " " + TextColorMgr.GetColorByID(text2, 1000007);
        }
        this.CostIconSR = GameDataUtils.GetItemIcon(19);
    }
Пример #29
0
    private void SetEquipSimpleInfoData(long equipId)
    {
        EquipSimpleInfo equipSimpleInfoByEquipID = EquipGlobal.GetEquipSimpleInfoByEquipID(equipId);

        if (equipSimpleInfoByEquipID == null)
        {
            return;
        }
        TaoZhuangDuanZhu equipForgeCfgData = EquipGlobal.GetEquipForgeCfgData(equipId);

        if (equipForgeCfgData != null && equipSimpleInfoByEquipID.suitId > 0)
        {
            ResourceManager.SetSprite(base.FindTransform("ItemFrame").GetComponent <Image>(), ResourceManager.GetIconSprite(equipForgeCfgData.frame));
            base.FindTransform("ItemName").GetComponent <Text>().set_text(TextColorMgr.GetColor(EquipGlobal.GetEquipSuitMarkName(equipSimpleInfoByEquipID.suitId) + GameDataUtils.GetItemName(equipSimpleInfoByEquipID.cfgId, false, 0L), "FF1919", string.Empty));
        }
        Transform transform = base.FindTransform("ImageBinding");

        if (transform != null)
        {
            transform.get_gameObject().SetActive(equipSimpleInfoByEquipID.binding);
        }
    }
Пример #30
0
 public void SetItem(int itemId)
 {
     this.m_Content.set_text(string.Format(GameDataUtils.GetChineseContent(519001, false), GameDataUtils.GetItemName(itemId, true, 0L)));
 }