Пример #1
0
    /// <summary>
    /// 设置格子
    /// </summary>
    /// <param name="attr">属性</param>
    /// <param name="totalProtectAttrNum">保护属性总条数</param>
    /// <param name="selectNum">选择数量</param>
    /// <param name="callback"></param>
    public void SetGridView(GameCmd.PairNumber attr, bool select, int fillNum = 0, int needNum = 0
                            , Action <uint> callback = null)
    {
        ResetInfoGrid();
        RuneStone rs = null;
        uint      runeStoneBaseId = 0;

        AttrId = attr.id;
        EquipManager emgr = DataManager.Manager <EquipManager>();

        if (emgr.TryGetRuneStoneIdByEffectId(emgr.TransformAttrToEffectId(attr), out runeStoneBaseId))
        {
            rs = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <RuneStone>(runeStoneBaseId, ItemDefine.ItemDataType.RuneStone);
        }
        else
        {
            Engine.Utility.Log.Error("TryGetRuneStoneIdByEffectId failed attr pair = [id,{0}]-[value,{1}]", attr.id, attr.value);
        }
        m_uint_rsId = rs.BaseId;
        if (null != this.attrDes)
        {
            this.attrDes.text = emgr.GetAttrDes(attr);
        }

        if (null != this.m_labPortectDes)
        {
            this.m_labPortectDes.text = string.Format("消耗符石档次:{0}档", rs.Grade);
        }
        if (null != m_toggle)
        {
            m_toggle.value = select;
        }
        SetIcon(true, rs.Icon);
        SetBorder(true, rs.BorderIcon);
        int holdNum = (int)DataManager.Manager <ItemManager>().GetItemNumByBaseId(runeStoneBaseId);

        SetRuneStoneMask(true, (uint)rs.Grade);
        if (select && fillNum < needNum)
        {
            SetNotEnoughGet(true);
        }
        if (null != m_labNum)
        {
            if (select)
            {
                this.m_labNum.text = ItemDefine.BuilderStringByHoldAndNeedNum((uint)fillNum, (uint)needNum);
            }
            else
            {
                this.m_labNum.text = holdNum.ToString();
            }
        }

        if (this.changeCallback != callback)
        {
            this.changeCallback = callback;
        }
    }
Пример #2
0
    private void SetOpenData()
    {
        if (null == compoundSelectData)
        {
            return;
        }
        SetTransformState(true);
        ResetInfoGrid();
        BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(compoundSelectData.BaseID);
        int      attrNum  = (null != compoundSelectData.Attrs) ? compoundSelectData.Attrs.Count : 0;

        SetIcon(true, baseItem.Icon);
        SetBorder(true, ItemDefine.GetItemBorderIcon((uint)attrNum));
        if (compoundSelectData.IsBind)
        {
            SetBindMask(true);
        }
        if (null != m_TransDatas)
        {
            AttrTransData      temData = null;
            GameCmd.PairNumber pair    = null;
            EquipManager       emgr    = DataManager.Manager <EquipManager>();

            for (int i = 0, max = m_TransDatas.Length; i < max; i++)
            {
                temData = m_TransDatas[i];
                if (temData.Root == null)
                {
                    continue;
                }
                if (null != compoundSelectData.Attrs && compoundSelectData.Attrs.Count > i)
                {
                    if (!temData.Root.gameObject.activeSelf)
                    {
                        temData.Root.gameObject.SetActive(true);
                    }
                    pair = compoundSelectData.Attrs[i];
                    if (null != temData.Grade)
                    {
                        temData.Grade.text = emgr.GetAttrGrade(compoundSelectData.Attrs[i]).ToString();
                    }

                    if (null != temData.Des)
                    {
                        temData.Des.text = emgr.GetAttrDes(compoundSelectData.Attrs[i]);
                    }
                }
                else if (temData.Root.gameObject.activeSelf)
                {
                    temData.Root.gameObject.SetActive(false);
                }
            }
        }
        SetSelect(m_bSelect);
    }
Пример #3
0
    private void ShowUI()
    {
        Equip equip = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId <Equip>(qwThisID);

        if (null == equip)
        {
            return;
        }
        if (null != m_infoGrid)
        {
            m_infoGrid.Reset();
            m_infoGrid.SetIcon(true, equip.Icon);
            m_infoGrid.SetBorder(true, equip.BorderIcon);
            if (equip.IsBind)
            {
                m_infoGrid.SetLockMask(true);
            }
            //m_infoGrid.RegisterUIEventDelegate((eventType, gridData, param) =>
            //{
            //    if (eventType == UIEventType.Click)
            //    {
            //        TipsManager.Instance.ShowItemTips(equip);
            //    }
            //});
        }
        if (null != m_label_EquipName)
        {
            m_label_EquipName.text = equip.Name;
        }

        GameCmd.PairNumber pair                 = null;
        UICompoundAttrGrid tempGrid             = null;
        int          gridCount                  = mlstGrids.Count;
        EquipManager emgr                       = DataManager.Manager <EquipManager>();
        List <GameCmd.PairNumber> additiveAttrs = equip.GetAdditiveAttr();

        for (int i = 0; i < gridCount; i++)
        {
            tempGrid = mlstGrids[i];
            if (null != additiveAttrs && additiveAttrs.Count > i)
            {
                if (!tempGrid.Visible)
                {
                    tempGrid.SetVisible(true);
                }
                pair = additiveAttrs[i];
                tempGrid.SetData(emgr.GetAttrGrade(additiveAttrs[i]), emgr.GetAttrDes(additiveAttrs[i]));
            }
            else if (tempGrid.Visible)
            {
                tempGrid.SetVisible(false);
            }
        }
    }
Пример #4
0
    private void UpdateUI()
    {
        Muhon itemData = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId <Muhon>(blendMuhonId);

        if (null == itemData)
        {
            Engine.Utility.Log.Error("MuhonBlendCompletePanel UpdateUI faield get itemData null");
            return;
        }
        EquipManager emgr = DataManager.Manager <EquipManager>();

        if (null != m_showGrid)
        {
            m_showGrid.SetGridData(blendMuhonId);
        }
        if (null != m_label_EquipName)
        {
            m_label_EquipName.text = itemData.Name;
        }

        //更新属性信息
        List <GameCmd.PairNumber> attrPairs = itemData.GetAdditiveAttr();

        GameCmd.PairNumber pair     = null;
        UIProperyGradeGrid tempGrid = null;
        int gridCount = mlstGrids.Count;

        for (int i = 0; i < gridCount; i++)
        {
            tempGrid = mlstGrids[i];
            if (null != attrPairs && attrPairs.Count > i)
            {
                if (!tempGrid.Visible)
                {
                    tempGrid.SetVisible(true);
                }
                pair = attrPairs[i];
                tempGrid.SetGridView(emgr.GetAttrDes(pair), emgr.GetAttrGrade(pair), emgr.IsAttrGradeMax(pair));
            }
            else if (tempGrid.Visible)
            {
                tempGrid.SetVisible(false);
            }
        }
    }
Пример #5
0
    private void UpdateUI()
    {
        EquipManager emgr     = DataManager.Manager <EquipManager>();
        Muhon        curMuhon = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId <Muhon>(evolveMuhonId);

        if (null == curMuhon || null == curMuhon.Pre)
        {
            TipsManager.Instance.ShowTips("进化完成数据错误!");
            return;
        }

        if (null != mShowGrid)
        {
            mShowGrid.SetGridData(evolveMuhonId);
        }
        if (null != m_label_MuhonName)
        {
            m_label_MuhonName.text = curMuhon.Name;
        }
        if (null != m_label_MuhonLv)
        {
            m_label_MuhonLv.text = DataManager.Manager <TextManager>().GetLocalFormatText(LocalTextType.Local_TXT_Soul_ColorLv
                                                                                          , "", "", curMuhon.Level, curMuhon.MaxLv);
        }

        if (null != m_label_AttrNumPre)
        {
            m_label_AttrNumPre.text = DataManager.Manager <TextManager>()
                                      .GetLocalFormatText(LocalTextType.Local_TXT_Soul_Num, curMuhon.Pre.MuhonAttrUpLimit);
        }

        if (null != m_label_AttrNumCur)
        {
            m_label_AttrNumCur.text = DataManager.Manager <TextManager>()
                                      .GetLocalFormatText(LocalTextType.Local_TXT_Soul_Num, curMuhon.MuhonAttrUpLimit);
        }
        List <EquipDefine.EquipBasePropertyData> curBaseProperyList = emgr.GetWeaponSoulBasePropertyData(curMuhon.BaseId, 1);
        List <EquipDefine.EquipBasePropertyData> preBaseProperyList = emgr.GetWeaponSoulBasePropertyData(curMuhon.Pre.BaseId, (int)curMuhon.Pre.MaxLv);

        EquipDefine.EquipBasePropertyData temp = null;
        Transform tempTrans   = null;
        Vector3   baseLastPos = gapWidget;

        if (null != m_lstBaseAttr)
        {
            for (int i = 0, max = m_lstBaseAttr.Count; i < max; i++)
            {
                tempTrans = m_lstBaseAttr[i];
                if (null == tempTrans)
                {
                    continue;
                }
                if (null != curBaseProperyList && curBaseProperyList.Count > i &&
                    null != preBaseProperyList && preBaseProperyList.Count > i)
                {
                    if (!tempTrans.gameObject.activeSelf)
                    {
                        tempTrans.gameObject.SetActive(true);
                    }
                    tempTrans.Find("Content/Name").GetComponent <UILabel>().text  = curBaseProperyList[i].Name;
                    tempTrans.Find("Content/CurV").GetComponent <UILabel>().text  = preBaseProperyList[i].ToString();
                    tempTrans.Find("Content/NextV").GetComponent <UILabel>().text = curBaseProperyList[i].ToString();
                }
                else
                {
                    if (tempTrans.gameObject.activeSelf)
                    {
                        tempTrans.gameObject.SetActive(false);
                    }
                    if (i == (max - 1))
                    {
                        Vector3 tempV = tempTrans.position;
                        tempV         = tempTrans.TransformPoint(tempV);
                        tempV         = m_scrollview_AttrContent.transform.InverseTransformPoint(tempV);
                        baseLastPos.y = tempV.y;
                    }
                }
            }
        }

        List <GameCmd.PairNumber> addtive = curMuhon.GetAdditiveAttr();

        if (null != m_lstAddtiveAttr)
        {
            for (int i = 0, max = m_lstAddtiveAttr.Count; i < max; i++)
            {
                tempTrans = m_lstAddtiveAttr[i];
                if (null == tempTrans)
                {
                    continue;
                }
                if (null != addtive && addtive.Count > i)
                {
                    if (!tempTrans.gameObject.activeSelf)
                    {
                        tempTrans.gameObject.SetActive(true);
                    }
                    tempTrans.Find("Grade").GetComponent <UILabel>().text = emgr.GetAttrGrade(addtive[i]).ToString();
                    tempTrans.Find("Des").GetComponent <UILabel>().text   = emgr.GetAttrDes(addtive[i]);
                }
                else if (tempTrans.gameObject.activeSelf)
                {
                    tempTrans.gameObject.SetActive(false);
                }
            }
        }

        bool additiveVisible = (null != addtive && addtive.Count != 0);

        if (null != m_trans_AddtiveAttrContent)
        {
            if (m_trans_AddtiveAttrContent.gameObject.activeSelf != additiveVisible)
            {
                m_trans_AddtiveAttrContent.gameObject.SetActive(additiveVisible);
            }

            if (additiveVisible)
            {
                m_trans_AddtiveAttrContent.transform.localPosition = gapWidget;
            }
        }

        if (null != m_scrollview_AttrContent)
        {
            m_scrollview_AttrContent.ResetPosition();
        }
    }
Пример #6
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="none"></param>
    /// <param name="qwThisId"></param>
    /// <param name="index"></param>
    public void SetGridViewData(bool none, uint qwThisId = 0)
    {
        ResetInfoGrid();
        this.m_uint_qwThisId = qwThisId;
        if (null != m_ts_none && m_ts_none.gameObject.activeSelf != none)
        {
            m_ts_none.gameObject.SetActive(none);
        }

        if (null != m_ts_infos && m_ts_infos.gameObject.activeSelf == none)
        {
            m_ts_infos.gameObject.SetActive(!none);
        }
        if (!none)
        {
            ResetInfoGrid();
            Equip equip = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId <Equip>(qwThisId);
            if (null != equip)
            {
                SetBorder(true, equip.BorderIcon);
                SetIcon(true, equip.Icon);
                SetBindMask(equip.IsBind);
            }
            if (null != m_lab_name)
            {
                m_lab_name.text = equip.Name;
            }
            if (null != m_TransDatas)
            {
                EquipManager              emgr          = DataManager.Manager <EquipManager>();
                GameCmd.PairNumber        pair          = null;
                AttrTransData             tempTransData = null;
                List <GameCmd.PairNumber> pairs         = equip.GetAdditiveAttr();
                for (int i = 0, max = m_TransDatas.Length; i < max; i++)
                {
                    tempTransData = m_TransDatas[i];
                    if (null == tempTransData.Root)
                    {
                        continue;
                    }

                    if (null != pairs && pairs.Count > i)
                    {
                        if (!tempTransData.Root.gameObject.activeSelf)
                        {
                            tempTransData.Root.gameObject.SetActive(true);
                        }
                        pair = pairs[i];
                        if (null != tempTransData.Grade)
                        {
                            tempTransData.Grade.text = emgr.GetAttrGrade(pair).ToString();
                        }

                        if (null != tempTransData.Des)
                        {
                            tempTransData.Des.text = emgr.GetAttrDes(pair);
                        }
                    }
                    else if (tempTransData.Root.gameObject.activeSelf)
                    {
                        tempTransData.Root.gameObject.SetActive(false);
                    }
                }
            }
        }
    }