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 async Task <IActionResult> Putwings([FromRoute] int id, [FromBody] wings wings)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != wings.id)
            {
                return(BadRequest());
            }

            _context.Entry(wings).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!wingsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Beispiel #3
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 #4
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 #5
0
        public async Task <IActionResult> Postwings([FromBody] wings wings)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.wings.Add(wings);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getwings", new { id = wings.id }, wings));
        }
Beispiel #6
0
    public void RefreshWings()
    {
        this.SortWingList();
        int num = 0;

        while (num < this.m_listPool.Items.get_Count() && num < this.m_listDataWings.get_Count())
        {
            wings    dataWings = this.m_listDataWings.get_Item(num);
            WingCell component = this.m_listPool.Items.get_Item(num).GetComponent <WingCell>();
            component.RefreshWing(dataWings);
            num++;
        }
    }
Beispiel #7
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 #8
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 #9
0
    private void InitScrollRect()
    {
        int num = false.CompareTo(true);

        this.SortWingList();
        this.m_listPool.Create(this.m_listDataWings.get_Count(), delegate(int index)
        {
            if (index < this.m_listDataWings.get_Count() && index < this.m_listPool.Items.get_Count())
            {
                wings dataWings    = this.m_listDataWings.get_Item(index);
                WingCell component = this.m_listPool.Items.get_Item(index).GetComponent <WingCell>();
                component.RefreshWing(dataWings);
            }
        });
    }
Beispiel #10
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 #11
0
    public static List <wings> GetSelectWingInfos()
    {
        List <wings> list = new List <wings>();

        using (List <wings> .Enumerator enumerator = DataReader <wings> .DataList.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                wings current = enumerator.get_Current();
                if (current.id != 1)
                {
                    list.Add(current);
                }
            }
        }
        return(list);
    }
Beispiel #12
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 #13
0
    public static bool CheckPage2Badge()
    {
        if (!WingManager.IsSystemOn())
        {
            return(false);
        }
        List <wings> selectWingInfos = WingManager.GetSelectWingInfos();

        using (List <wings> .Enumerator enumerator = selectWingInfos.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                wings current = enumerator.get_Current();
                if (WingManager.IsCanActiveWing(current.id))
                {
                    return(true);
                }
            }
        }
        return(false);
    }
Beispiel #14
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 #15
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();
        }
    }