Example #1
0
    private void SetWingPreviewCellL()
    {
        wingLv wingLvInfoPreDifferent = WingManager.GetWingLvInfoPreDifferent(this.m_current_wingId, this.m_wingLvInfoL.lv);

        this.m_goBtnArrowL.SetActive(wingLvInfoPreDifferent.model != this.m_wingLvInfoL.model);
        this.m_WingPreviewCellCurrent.SetRawImage(this.m_wingLvInfoL.model);
        this.m_WingPreviewCellCurrent.SetName(TextColorMgr.GetColorByQuality(this.m_wingLvInfoL.name, this.m_wingLvInfoL.color));
        if (this.m_current_winglevel == 0 || this.m_wingLvInfoL.lv > this.m_current_winglevel)
        {
            this.m_WingPreviewCellCurrent.SetCondition(true, string.Format(GameDataUtils.GetChineseContent(16301, false), this.m_wingLvInfoL.lv));
        }
        else
        {
            this.m_WingPreviewCellCurrent.SetCondition(false, string.Empty);
        }
        if (this.m_current_winglevel == 0 && !WingManager.IsCanActiveWing(this.m_current_wingId))
        {
            wings wingInfo = WingManager.GetWingInfo(this.m_current_wingId);
            this.m_WingPreviewCellCurrent.ShowButtonGet(true);
            this.m_WingPreviewCellCurrent.actionButtonGet = delegate
            {
                this.OnClickBtnGet(wingInfo.activation.get_Item(0).key);
            };
        }
        else
        {
            this.m_WingPreviewCellCurrent.ShowButtonGet(false);
        }
    }
Example #2
0
    private void SetAttrCurr(int wingId, bool isActivation)
    {
        int    wingLv     = WingManager.GetWingLv(wingId);
        wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv);
        Text   component  = base.get_transform().Find("txtName").GetComponent <Text>();

        component.set_text(TextColorMgr.GetColorByQuality(wingLvInfo.name, wingLvInfo.color));
        Image component2 = this.m_btnIcon.GetComponent <Image>();

        ResourceManager.SetSprite(component2, GameDataUtils.GetIcon(wingLvInfo.icon));
        ImageColorMgr.SetImageColor(component2, !isActivation);
        if (wingLv == 0)
        {
            this.m_attrCurr.Find("txtLv").GetComponent <Text>().set_text("激活后");
        }
        else
        {
            this.m_attrCurr.Find("txtLv").GetComponent <Text>().set_text("Lv." + wingLv);
        }
        Attrs attrs = DataReader <Attrs> .Get(wingLvInfo.templateId);

        for (int i = 0; i < 6; i++)
        {
            if (i < attrs.attrs.get_Count())
            {
                Debug.Log(attrs.attrs.get_Item(i) + "=" + (AttrType)attrs.attrs.get_Item(i));
                this.m_attrCurr.Find("txtAttrName" + (i + 1)).get_gameObject().SetActive(true);
                this.m_attrCurr.Find("txtAttrName" + (i + 1)).GetComponent <Text>().set_text(AttrUtility.GetStandardAddDesc(attrs.attrs.get_Item(i), attrs.values.get_Item(i), "ff7d4b"));
            }
            else
            {
                this.m_attrCurr.Find("txtAttrName" + (i + 1)).get_gameObject().SetActive(false);
            }
        }
    }
Example #3
0
 public void Init(int wingId)
 {
     WingGlobal.ResetRawImage();
     if (this.m_WingPreviewCellCurrent != null && this.m_WingPreviewCellCurrent.get_gameObject() != null)
     {
         Object.Destroy(this.m_WingPreviewCellCurrent.get_gameObject());
     }
     if (this.m_WingPreviewCellNext != null && this.m_WingPreviewCellNext.get_gameObject() != null)
     {
         Object.Destroy(this.m_WingPreviewCellNext.get_gameObject());
     }
     this.m_current_wingId    = wingId;
     this.m_current_winglevel = WingManager.GetWingLv(wingId);
     this.m_wingLvInfoL       = WingManager.GetWingLvInfo(this.m_current_wingId, this.m_current_winglevel);
     this.m_wingLvInfoR       = WingManager.GetWingLvInfoNextDifferent(this.m_current_wingId, this.m_current_winglevel);
     if (this.m_wingLvInfoL.model == this.m_wingLvInfoR.model)
     {
         this.m_wingLvInfoL = WingManager.GetWingLvInfoPreDifferent(this.m_current_wingId, this.m_current_winglevel);
     }
     this.m_WingPreviewCellCurrent = WingGlobal.GetOneWingPreview(base.get_transform());
     this.m_WingPreviewCellCurrent.get_transform().set_localPosition(new Vector3(-245f, 0f));
     this.m_WingPreviewCellNext = WingGlobal.GetOneWingPreview(base.get_transform());
     this.m_WingPreviewCellNext.get_transform().set_localPosition(new Vector3(245f, 0f));
     base.get_transform().Find("imgArrow").SetAsLastSibling();
     this.SetWingPreviewCellAll();
 }
Example #4
0
    public static wingLv GetWingLvInfoPreDifferent(int wingId, int wingLv)
    {
        wingLv        wingLvInfo  = WingManager.GetWingLvInfo(wingId, wingLv);
        List <wingLv> wingLvInfos = WingManager.GetWingLvInfos(wingId);
        int           num         = 0;

        for (int i = wingLvInfos.get_Count() - 1; i >= 0; i--)
        {
            wingLv wingLv2 = wingLvInfos.get_Item(i);
            if (wingLv2.lv < wingLv && wingLv2.model != wingLvInfo.model)
            {
                num = wingLv2.model;
                break;
            }
        }
        if (num > 0)
        {
            for (int j = 0; j < wingLvInfos.get_Count(); j++)
            {
                wingLv wingLv3 = wingLvInfos.get_Item(j);
                if (wingLv3.model == num)
                {
                    return(wingLv3);
                }
            }
        }
        return(wingLvInfo);
    }
Example #5
0
    public static long GetCurrentWingFightingValue()
    {
        long num = 0L;

        if (WingManager.wingInfoDict == null)
        {
            return(num);
        }
        using (Dictionary <int, WingInfo> .Enumerator enumerator = WingManager.wingInfoDict.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                KeyValuePair <int, WingInfo> current = enumerator.get_Current();
                int cfgId = current.get_Value().cfgId;
                int lv    = current.get_Value().lv;
                if (cfgId > 0)
                {
                    wingLv wingLvInfo = WingManager.GetWingLvInfo(cfgId, lv);
                    if (wingLvInfo != null)
                    {
                        int   templateId = wingLvInfo.templateId;
                        Attrs attrs      = DataReader <Attrs> .Get(templateId);

                        if (attrs != null)
                        {
                            num += EquipGlobal.CalculateFightingByIDAndValue(attrs.attrs, attrs.values);
                        }
                    }
                }
            }
        }
        return(num);
    }
Example #6
0
    public void InitWithMaxLv(int wingId)
    {
        this.Init(wingId);
        this.mWingPreviewCell.SetCondition(true, "已获得最高级");
        wings  wingInfo   = WingManager.GetWingInfo(wingId);
        int    wingLv     = WingManager.GetWingLv(wingId);
        wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv);

        this.mWingPreviewCell.SetName(TextColorMgr.GetColorByQuality(wingLvInfo.name, wingLvInfo.color));
    }
Example #7
0
    private void OnClickBtnArrowL()
    {
        wingLv wingLvInfoPreDifferent = WingManager.GetWingLvInfoPreDifferent(this.m_current_wingId, this.m_wingLvInfoL.lv);

        if (wingLvInfoPreDifferent.model == this.m_wingLvInfoL.model)
        {
            return;
        }
        this.m_wingLvInfoR = this.m_wingLvInfoL;
        this.m_wingLvInfoL = wingLvInfoPreDifferent;
        WingGlobal.ResetRawImage();
        this.SetWingPreviewCellAll();
    }
Example #8
0
    public static wingLv GetWingLvInfo(int id, int lv)
    {
        List <wingLv> wingLvInfos = WingManager.GetWingLvInfos(id);

        for (int i = 0; i < wingLvInfos.get_Count(); i++)
        {
            wingLv wingLv = wingLvInfos.get_Item(i);
            if (wingLv.lv == lv)
            {
                return(wingLv);
            }
        }
        return(null);
    }
Example #9
0
    public static wingLv GetWingLvInfoNextDifferent(int wingId, int wingLv)
    {
        wingLv        wingLvInfo  = WingManager.GetWingLvInfo(wingId, wingLv);
        List <wingLv> wingLvInfos = WingManager.GetWingLvInfos(wingId);

        for (int i = 0; i < wingLvInfos.get_Count(); i++)
        {
            wingLv wingLv2 = wingLvInfos.get_Item(i);
            if (wingLv2.lv > wingLv && wingLv2.model != wingLvInfo.model)
            {
                return(wingLv2);
            }
        }
        return(wingLvInfo);
    }
Example #10
0
    private void SetWingPreviewCellR()
    {
        wingLv wingLvInfoNextDifferent = WingManager.GetWingLvInfoNextDifferent(this.m_current_wingId, this.m_wingLvInfoR.lv);

        this.m_goBtnArrowR.SetActive(wingLvInfoNextDifferent.model != this.m_wingLvInfoR.model);
        this.m_WingPreviewCellNext.SetRawImage(this.m_wingLvInfoR.model);
        this.m_WingPreviewCellNext.SetName(TextColorMgr.GetColorByQuality(this.m_wingLvInfoR.name, this.m_wingLvInfoR.color));
        if (wingLvInfoNextDifferent.model == this.m_wingLvInfoR.model && WingManager.IsMaxWingLv(this.m_current_wingId, this.m_current_winglevel))
        {
            this.m_WingPreviewCellNext.SetCondition(true, "已获得最高级");
        }
        else
        {
            this.m_WingPreviewCellNext.SetCondition(this.m_wingLvInfoR.lv > this.m_current_winglevel, string.Format(GameDataUtils.GetChineseContent(16301, false), this.m_wingLvInfoR.lv));
        }
        this.m_WingPreviewCellNext.ShowButtonGet(false);
    }
Example #11
0
    public static List <wingLv> GetWingLvInfos(int id)
    {
        List <wingLv> list = new List <wingLv>();

        using (List <wingLv> .Enumerator enumerator = DataReader <wingLv> .DataList.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                wingLv current = enumerator.get_Current();
                if (current.id == id)
                {
                    list.Add(current);
                }
            }
        }
        return(list);
    }
Example #12
0
    public static bool IsCanUpgradeWing(int wingId)
    {
        int wingLv = WingManager.GetWingLv(wingId);

        if (wingLv == 0)
        {
            return(false);
        }
        if (WingManager.IsMaxWingLv(wingId, wingLv))
        {
            return(false);
        }
        wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv + 1);
        int    key        = wingLvInfo.update.get_Item(0).key;
        int    value      = wingLvInfo.update.get_Item(0).value;
        long   num        = BackpackManager.Instance.OnGetGoodCount(key);

        return(num >= (long)value);
    }
Example #13
0
    private void SetAttrNext(int wingId)
    {
        wings  wingInfo   = WingManager.GetWingInfo(wingId);
        int    num        = WingManager.GetWingLv(wingId) + 1;
        wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, num);

        this.m_attrNext.Find("txtLv").GetComponent <Text>().set_text("Lv." + num);
        Attrs attrs = DataReader <Attrs> .Get(wingLvInfo.templateId);

        for (int i = 0; i < 6; i++)
        {
            if (i < attrs.attrs.get_Count())
            {
                this.m_attrNext.Find("txtAttrVal" + (i + 1)).get_gameObject().SetActive(true);
                this.m_attrNext.Find("txtAttrVal" + (i + 1)).GetComponent <Text>().set_text(this.GetFormatAttrValue(attrs.attrs.get_Item(i), (float)attrs.values.get_Item(i)));
            }
            else
            {
                this.m_attrNext.Find("txtAttrVal" + (i + 1)).get_gameObject().SetActive(false);
            }
        }
    }
Example #14
0
    private void SetUpgradeRequire(int wingId)
    {
        int    wingLv        = WingManager.GetWingLv(wingId);
        wingLv wingLvInfo    = WingManager.GetWingLvInfo(wingId, wingLv);
        int    requireItemId = wingLvInfo.update.get_Item(0).key;
        int    value         = wingLvInfo.update.get_Item(0).value;
        long   num           = BackpackManager.Instance.OnGetGoodCount(requireItemId);
        int    icon          = DataReader <Items> .Get(requireItemId).icon;

        string text = num + "/" + value;

        this.m_upgradeRequire.Find("txtProgress").GetComponent <Text>().set_text(text);
        float num2 = Mathf.Min(1f, (float)num / (float)value);

        this.m_upgradeRequire.Find("imgProgress").GetComponent <RectTransform>().set_sizeDelta(new Vector2(205f * num2, 18.9f));
        Button component = this.m_upgradeRequire.GetComponent <Button>();

        component.get_onClick().RemoveAllListeners();
        component.get_onClick().AddListener(delegate
        {
            this.OnClickUpgradeRequire(requireItemId);
        });
    }
Example #15
0
    public static bool IsMaxWingLv(int id, int lv)
    {
        wingLv wingLvInfo = WingManager.GetWingLvInfo(id, lv);

        return(wingLvInfo.nextLv == wingLvInfo.lv);
    }