コード例 #1
0
    private void CreateAttr(int key, int value, bool isShowNext = false, int nextValue = 0)
    {
        GameObject gameObject = this.mAttrList.Find((GameObject e) => e.get_name() == "Unused");

        if (gameObject == null)
        {
            gameObject = Object.Instantiate <GameObject>(this.mGoAttrPrefab);
            UGUITools.SetParent(this.mAttrPanel, gameObject, false);
            this.mAttrList.Add(gameObject);
        }
        gameObject.get_gameObject().set_name(key.ToString());
        gameObject.get_gameObject().SetActive(true);
        gameObject.get_transform().FindChild("Attr").GetComponentInChildren <Text>().set_text(AttrUtility.GetStandardDesc(key, value, "ff7d4b"));
        GameObject gameObject2 = gameObject.get_transform().FindChild("Next").get_gameObject();

        if (isShowNext)
        {
            gameObject2.SetActive(true);
            gameObject2.GetComponentInChildren <Text>().set_text(AttrUtility.GetAttrValueDisplay(key, nextValue));
        }
        else
        {
            gameObject2.SetActive(false);
        }
    }
コード例 #2
0
 private void RefreshUI()
 {
     if (EntityWorld.Instance.EntSelf != null)
     {
         this.SetGold(EntityWorld.Instance.EntSelf.Gold);
         this.SetDiamond(EntityWorld.Instance.EntSelf.Diamond);
         this.SetStrength(EntityWorld.Instance.EntSelf.Energy);
         this.Gold     = AttrUtility.GetAttrValueDisplay(AttrType.Gold, EntityWorld.Instance.EntSelf.Gold);
         this.Diamond  = EntityWorld.Instance.EntSelf.Diamond.ToString();
         this.Strength = string.Format("{0}/{1}", EntityWorld.Instance.EntSelf.Energy, EntityWorld.Instance.EntSelf.EnergyLmt);
     }
 }
コード例 #3
0
    private void RefreshUIByCfg()
    {
        this.UpdateRewardItems();
        JunTuanZhanJiangLi junTuanZhanJiangLi = DataReader <JunTuanZhanJiangLi> .Get(1);

        if (junTuanZhanJiangLi != null)
        {
            int      title    = junTuanZhanJiangLi.Title;
            ChengHao chengHao = DataReader <ChengHao> .Get(title);

            if (chengHao != null && chengHao.displayWay == 2)
            {
                ResourceManager.SetSprite(this.titleImg, GameDataUtils.GetIcon(chengHao.icon));
                List <int> attrs = DataReader <Attrs> .Get(chengHao.gainProperty).attrs;

                List <int> values = DataReader <Attrs> .Get(chengHao.gainProperty).values;

                string text = string.Empty;
                int    num  = (attrs.get_Count() <= 2) ? attrs.get_Count() : 2;
                for (int i = 0; i < num; i++)
                {
                    if (i >= values.get_Count())
                    {
                        break;
                    }
                    string text2 = text;
                    text = string.Concat(new string[]
                    {
                        text2,
                        AttrUtility.GetAttrName((GameData.AttrType)attrs.get_Item(i)),
                        ": <color=#47eb1b>+",
                        AttrUtility.GetAttrValueDisplay(attrs.get_Item(i), values.get_Item(i)),
                        "</color>"
                    });
                    if (i < num - 1)
                    {
                        text += "\n";
                    }
                }
                this.titleAttrName.set_text(text);
            }
        }
    }
コード例 #4
0
 public static string GetDesc(AttrType type, long value, string hyphen, string typeColor, string valueColor, bool isHyphenAccordWithType)
 {
     if (isHyphenAccordWithType)
     {
         return(string.Format("{0}{1}", TextColorMgr.GetColor(string.Format("{0}{1}", AttrUtility.GetAttrName(type), hyphen), typeColor, string.Empty), TextColorMgr.GetColor(AttrUtility.GetAttrValueDisplay(type, value), valueColor, string.Empty)));
     }
     return(string.Format("{0}{1}", TextColorMgr.GetColor(AttrUtility.GetAttrName(type), typeColor, string.Empty), TextColorMgr.GetColor(string.Format("{0}{1}", hyphen, AttrUtility.GetAttrValueDisplay(type, value)), valueColor, string.Empty)));
 }
コード例 #5
0
 public static string GetColonAttrValueDisplay(int typeNum, long value)
 {
     return(AttrUtility.GetAttrValueDisplay(typeNum, value, ":"));
 }
コード例 #6
0
 public static string GetAddAttrValueDisplay(int typeNum, int value)
 {
     return(AttrUtility.GetAttrValueDisplay(typeNum, value, "+"));
 }
コード例 #7
0
 public static string GetAttrValueDisplay(int typeNum, long value, string hyphen)
 {
     return(string.Format("{0}{1}", hyphen, AttrUtility.GetAttrValueDisplay((AttrType)typeNum, value)));
 }
コード例 #8
0
 public static string GetAttrValueDisplay(int typeNum, long value)
 {
     return(AttrUtility.GetAttrValueDisplay((AttrType)typeNum, value));
 }
コード例 #9
0
 public static string GetGoldValueStr(long value)
 {
     return(AttrUtility.GetAttrValueDisplay(AttrType.Gold, value));
 }
コード例 #10
0
    private void SetEquipItemData(int equipItemID, int equipLV = 0)
    {
        FXSpineManager.Instance.DeleteSpine(this.equipFxID, true);
        this.equipFxID = 0;
        if (this.DepthValue < 3000)
        {
            this.DepthValue = 3000;
        }
        zZhuangBeiPeiZhiBiao data = DataReader <zZhuangBeiPeiZhiBiao> .Get(equipItemID);

        if (data == null)
        {
            return;
        }
        Dictionary <string, string> equipIconNamesByEquipDataID = EquipGlobal.GetEquipIconNamesByEquipDataID(equipItemID, true);

        ResourceManager.SetSprite(base.FindTransform("ItemFrame").GetComponent <Image>(), ResourceManager.GetIconSprite(equipIconNamesByEquipDataID.get_Item("IconFrameName")));
        ResourceManager.SetSprite(base.FindTransform("ItemIcon").GetComponent <Image>(), ResourceManager.GetIconSprite(equipIconNamesByEquipDataID.get_Item("IconName")));
        DepthOfUI depthOfUI = base.FindTransform("EquipStepImg").GetComponent <DepthOfUI>();

        if (depthOfUI == null)
        {
            depthOfUI = base.FindTransform("EquipStepImg").get_gameObject().AddComponent <DepthOfUI>();
        }
        depthOfUI.SortingOrder = this.DepthValue + 2;
        DepthOfUI depthOfUI2 = base.FindTransform("EquipStepText").GetComponent <DepthOfUI>();

        if (depthOfUI2 == null)
        {
            depthOfUI2 = base.FindTransform("EquipStepText").get_gameObject().AddComponent <DepthOfUI>();
        }
        depthOfUI2.SortingOrder = this.DepthValue + 2;
        DepthOfUI depthOfUI3 = base.FindTransform("ExcellentAttrIconList").GetComponent <DepthOfUI>();

        if (depthOfUI3 == null)
        {
            depthOfUI3 = base.FindTransform("ExcellentAttrIconList").get_gameObject().AddComponent <DepthOfUI>();
        }
        depthOfUI3.SortingOrder = this.DepthValue + 2;
        DepthOfUI depthOfUI4 = base.FindTransform("ImageBinding").GetComponent <DepthOfUI>();

        if (depthOfUI4 == null)
        {
            depthOfUI4 = base.FindTransform("ImageBinding").get_gameObject().AddComponent <DepthOfUI>();
        }
        depthOfUI4.SortingOrder = this.DepthValue + 2;
        base.FindTransform("ImageBinding").get_gameObject().SetActive(false);
        base.FindTransform("ExcellentAttrIconList").get_gameObject().SetActive(false);
        base.FindTransform("EquipStepText").GetComponent <Text>().set_text(equipIconNamesByEquipDataID.get_Item("EquipStep"));
        base.FindTransform("ItemName").GetComponent <Text>().set_text(equipIconNamesByEquipDataID.get_Item("ItemName"));
        int color = DataReader <Items> .Get(equipItemID).color;

        Dictionary <string, Color> textColorByQuality = GameDataUtils.GetTextColorByQuality(color);

        base.FindTransform("ItemNum").GetComponent <Text>().set_text(string.Empty);
        if (this.IsWearing)
        {
            if (equipLV > 0)
            {
                base.FindTransform("ItemNum").GetComponent <Text>().set_text("+" + equipLV.ToString());
                base.FindTransform("ItemNum").GetComponent <Text>().set_color(textColorByQuality.get_Item("TextColor"));
                base.FindTransform("ItemNum").GetComponent <Outline>().set_effectColor(textColorByQuality.get_Item("TextOutlineColor"));
            }
            else
            {
                base.FindTransform("ItemNum").GetComponent <Text>().set_text(string.Empty);
            }
        }
        base.FindTransform("ItemLv").GetComponent <Text>().set_text(data.level.ToString());
        string equipOccupationName = EquipGlobal.GetEquipOccupationName(data.id);

        base.FindTransform("ItemCareerLimit").GetComponent <Text>().set_text(equipOccupationName);
        base.FindTransform("AdvancedTipText").GetComponent <Text>().set_text(string.Empty);
        int i;

        for (i = 0; i < data.starNum; i++)
        {
            this.starTransformList.get_Item(i).get_gameObject().SetActive(true);
            this.starTransformList.get_Item(i).FindChild("OpenStar").get_gameObject().SetActive(false);
        }
        for (int j = i; j < this.starTransformList.get_Count(); j++)
        {
            this.starTransformList.get_Item(j).get_gameObject().SetActive(false);
        }
        Attrs attrs = DataReader <Attrs> .Get(data.attrBaseValue);

        Attrs attrs2 = DataReader <Attrs> .Get(data.attrGrowValue);

        int      key      = 0;
        EquipLib equipLib = EquipmentManager.Instance.equipmentData.equipLibs.Find((EquipLib a) => a.type == (EquipLibType.ELT)data.position);

        equipLV = equipLib.lv;
        if (EquipmentManager.Instance.dicEquips.ContainsKey(equipLib.wearingId))
        {
            key = EquipmentManager.Instance.dicEquips.get_Item(equipLib.wearingId).cfgId;
        }
        zZhuangBeiPeiZhiBiao zZhuangBeiPeiZhiBiao = DataReader <zZhuangBeiPeiZhiBiao> .Get(key);

        if (attrs != null)
        {
            for (int k = 0; k < attrs.attrs.get_Count(); k++)
            {
                if (k > 2)
                {
                    break;
                }
                long value = (long)attrs.values.get_Item(k);
                this.BaseAttr.FindChild("EquipItem2Text" + k).get_gameObject().SetActive(true);
                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Item2Text").GetComponent <Text>().set_text(AttrUtility.GetStandardAddDesc((GameData.AttrType)attrs.attrs.get_Item(k), value, "ff7d4b"));
                if (attrs2 != null)
                {
                    int  num    = attrs2.values.get_Item(k) * equipLV;
                    long value2 = (long)num;
                    this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Item2TextRange").GetComponent <Text>().set_text("(强化 +" + AttrUtility.GetAttrValueDisplay((GameData.AttrType)attrs2.attrs.get_Item(k), value2) + ")");
                    if (!this.IsWearing)
                    {
                        if (zZhuangBeiPeiZhiBiao != null)
                        {
                            Attrs attrs3 = DataReader <Attrs> .Get(zZhuangBeiPeiZhiBiao.attrGrowValue);

                            float num2 = (float)(attrs3.values.get_Item(k) * equipLV);
                            if (num2 > (float)num)
                            {
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrup").get_gameObject().SetActive(false);
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrdown").get_gameObject().SetActive(true);
                            }
                            else if (num2 == (float)num)
                            {
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrup").get_gameObject().SetActive(false);
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrdown").get_gameObject().SetActive(false);
                            }
                            else
                            {
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrup").get_gameObject().SetActive(true);
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrdown").get_gameObject().SetActive(false);
                            }
                        }
                    }
                    else
                    {
                        this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrup").get_gameObject().SetActive(false);
                        this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrdown").get_gameObject().SetActive(false);
                    }
                }
            }
            for (int l = attrs.attrs.get_Count(); l < 3; l++)
            {
                this.BaseAttr.FindChild("EquipItem2Text" + l).get_gameObject().SetActive(false);
            }
        }
    }
コード例 #11
0
    public void UpdateItem(bool isOwn, TitleInfo ti)
    {
        this.isOwn = isOwn;
        ChengHao chengHao = DataReader <ChengHao> .Get(ti.titleId);

        if (chengHao.displayWay == 1)
        {
            this.Title.set_text(GameDataUtils.GetChineseContent(chengHao.icon, false));
            this.TitleImage.get_gameObject().SetActive(false);
            this.Title.get_gameObject().SetActive(true);
        }
        else if (chengHao.displayWay == 2)
        {
            ResourceManager.SetSprite(this.TitleImage, GameDataUtils.GetIcon(chengHao.icon));
            this.TitleImage.get_gameObject().SetActive(true);
            this.Title.get_gameObject().SetActive(false);
        }
        this.id       = ti.titleId;
        this.duration = chengHao.duration;
        for (int i = 0; i < 4; i++)
        {
            this.Bonuses[i].SetActive(false);
        }
        List <int> attrs = DataReader <Attrs> .Get(chengHao.gainProperty).attrs;

        List <int> values = DataReader <Attrs> .Get(chengHao.gainProperty).values;

        for (int j = 0; j < attrs.get_Count(); j++)
        {
            this.Bonuses[j].SetActive(true);
            this.Bonuses[j].get_transform().Find("BonusesDesc0").GetComponent <Text>().set_text(AttrUtility.GetAttrName((GameData.AttrType)attrs.get_Item(j)));
            this.Bonuses[j].get_transform().Find("BonusesNum0").GetComponent <Text>().set_text("+" + AttrUtility.GetAttrValueDisplay((GameData.AttrType)attrs.get_Item(j), values.get_Item(j)));
        }
        this.time = TimeManager.Instance.CalculateLocalServerTimeBySecond(ti.remainTime);
        string chineseContent = GameDataUtils.GetChineseContent(chengHao.gainIntroduction, false);
        string text           = GameDataUtils.GetChineseContent(chengHao.introduction, false);
        string text2          = null;
        int    condition      = chengHao.condition;

        if (condition != 2)
        {
            if (condition != 10)
            {
                text2 = chengHao.size.ToString();
            }
            else
            {
                int chapterOrder = DataReader <ZhuXianZhangJiePeiZhi> .Get(DataReader <ZhuXianPeiZhi> .Get(chengHao.size).chapterId).chapterOrder;

                int instance = DataReader <ZhuXianPeiZhi> .Get(chengHao.size).instance;

                string chineseContent2 = GameDataUtils.GetChineseContent(DataReader <ZhuXianPeiZhi> .Get(chengHao.size).name, false);
                text = string.Format(text, chapterOrder, instance, chineseContent2);
            }
        }
        else
        {
            text2 = GameDataUtils.GetChineseContent(DataReader <JingJiChangFenDuan> .Get(chengHao.size).name, false);
        }
        if (text2 != null)
        {
            text2 = "<color=#ff7d4b>" + text2 + "</color>";
            text  = string.Format(text, text2);
        }
        if (chengHao.schedule == -1)
        {
            this.ConditionOwn.set_text(chineseContent);
            this.Condition.set_text(text);
        }
        else
        {
            int num = 0;
            if (TitleManager.Instance.idProcessMap.ContainsKey(ti.titleId))
            {
                num = TitleManager.Instance.idProcessMap.get_Item(ti.titleId);
            }
            if (num > chengHao.schedule)
            {
                num = chengHao.schedule;
            }
            this.ConditionOwn.set_text(chineseContent);
            this.Condition.set_text(string.Concat(new object[]
            {
                text,
                "(",
                num,
                "/",
                chengHao.schedule,
                ")"
            }));
        }
        this.ConditionOwn.get_transform().get_parent().get_gameObject().SetActive(isOwn);
        this.Condition.get_transform().get_parent().get_gameObject().SetActive(!isOwn);
        if (ti.lookFlag)
        {
            this.New.SetActive(false);
        }
        else
        {
            this.New.SetActive(true);
        }
        if (ti.titleId == TitleManager.Instance.OwnCurrId)
        {
            this.Wear.SetActive(true);
        }
        else
        {
            this.Wear.SetActive(false);
        }
        this.NoHave.SetActive(!isOwn);
        this.RefreshTime();
    }
コード例 #12
0
 private static string GetExpValueStr(long value)
 {
     return(AttrUtility.GetAttrValueDisplay(AttrType.Exp, value));
 }