Beispiel #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);
        }
    }
Beispiel #2
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));
    }
Beispiel #3
0
    public void InitWithNotActive(int wingId)
    {
        this.Init(wingId);
        wings wingInfo = WingManager.GetWingInfo(wingId);

        this.mWingPreviewCell.ShowButtonGet(true);
        this.mWingPreviewCell.actionButtonGet = delegate
        {
            this.OnClickBtnGet(wingInfo.activation.get_Item(0).key);
        };
    }
Beispiel #4
0
 public static int GetWingModel(int wingId, int wingLv)
 {
     if (wingId == 0)
     {
         return(0);
     }
     if (wingId == 1)
     {
         return(WingManager.GetWingLvInfo(wingId, wingLv).model);
     }
     return(WingManager.GetWingInfo(wingId).model);
 }
Beispiel #5
0
    private void SetActiveRequire(int wingId)
    {
        wings wingInfo = WingManager.GetWingInfo(wingId);
        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;

        float num2 = Mathf.Min(1f, (float)num / (float)value);

        this.m_activeRequire.Find("imgProgress").GetComponent <RectTransform>().set_sizeDelta(new Vector2(205f * num2, 18.9f));
        string text = num + "/" + value;

        this.m_activeRequire.Find("txtProgress").GetComponent <Text>().set_text(text);
    }
Beispiel #6
0
    private void Init(int wingId)
    {
        WingGlobal.ResetRawImage();
        if (this.mWingPreviewCell != null && this.mWingPreviewCell.get_gameObject() != null)
        {
            Object.Destroy(this.mWingPreviewCell.get_gameObject());
        }
        wings wingInfo  = WingManager.GetWingInfo(wingId);
        int   wingLv    = WingManager.GetWingLv(wingId);
        int   wingModel = WingManager.GetWingModel(wingId, wingLv);

        this.mWingPreviewCell = WingGlobal.GetOneWingPreview(base.get_transform());
        this.mWingPreviewCell.SetRawImage(wingModel);
        this.mWingPreviewCell.SetName(TextColorMgr.GetColorByQuality(wingInfo.name, wingInfo.color));
    }
Beispiel #7
0
    public static bool IsCanActiveWing(int id)
    {
        int wingLv = WingManager.GetWingLv(id);

        if (wingLv != 0)
        {
            return(false);
        }
        wings wingInfo = WingManager.GetWingInfo(id);
        int   key      = wingInfo.activation.get_Item(0).key;
        int   value    = wingInfo.activation.get_Item(0).value;
        long  num      = BackpackManager.Instance.OnGetGoodCount(key);

        return(num >= (long)value);
    }
Beispiel #8
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));
            }
        }
    }
Beispiel #9
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);
            }
        }
    }
Beispiel #10
0
    private void OnWingInfoChangeNty(short state, WingInfoChangeNty msg = null)
    {
        if (state != 0)
        {
            StateManager.Instance.StateShow(state, 0);
            return;
        }
        int cfgId = msg.wingInfo.cfgId;

        WingManager.wingInfoDict.set_Item(cfgId, msg.wingInfo);
        if (WingManager.wingInfoDict.get_Item(cfgId).overdueUtc == -1)
        {
            WingManager.wingInfoDict.Remove(cfgId);
            wings  wingInfo = WingManager.GetWingInfo(cfgId);
            string text     = string.Format(GameDataUtils.GetChineseContent(237031, false), wingInfo.name);
            UIManagerControl.Instance.ShowToastText(text, 2f, 2f);
        }
        WingSelectUI wingSelectUI = UIManagerControl.Instance.GetUIIfExist("WingSelectUI") as WingSelectUI;

        if (wingSelectUI != null)
        {
            wingSelectUI.RefreshWings();
        }
    }
Beispiel #11
0
 public static bool IsTimeLimitWing(int wingId)
 {
     return(WingManager.GetWingInfo(wingId).time > 0);
 }