示例#1
0
    private List <Tab_LivingSkill> DealLivingSkill()                       //打造重新排序
    {
        List <Tab_LivingSkill> liveSkill   = new List <Tab_LivingSkill>(); //未超出等级
        List <Tab_LivingSkill> liveSkillLV = new List <Tab_LivingSkill>(); //超出等级

//		Dictionary<int, List<Tab_LivingSkill>> SkillDic = TableManager.GetLivingSkill ();
//		Tab_LivingSkill obj;
        foreach (KeyValuePair <int, List <Tab_LivingSkill> > pair in TableManager.GetLivingSkill())
        {
            Tab_LivingSkill tabLivingSkill = pair.Value[0];
            if (tabLivingSkill.OpenLevel > Singleton <ObjManager> .Instance.MainPlayer.BaseAttr.Level)
            {
                liveSkillLV.Add(tabLivingSkill);
            }
            else
            {
                liveSkill.Add(tabLivingSkill);
            }
        }
        for (int i = 0; i < liveSkillLV.Count; ++i)
        {
            liveSkill.Add(liveSkillLV[i]);
        }
        return(liveSkill);
    }
 public void InitInfoForStaticProduct(int nFormulaID)
 {
     Tab_LivingSkill tabLivingSkill = TableManager.GetLivingSkillByID(nFormulaID, 0);
     if (tabLivingSkill == null)
     {
         return;
     }
     m_FormulaID = nFormulaID;
     m_NameLabel.text = tabLivingSkill.Name;
     //m_NameLabel2.text = tabLivingSkill.Name;
     m_InfoLabel.text = tabLivingSkill.Info;
     m_ItemSlot.InitInfo_Item(tabLivingSkill.StaticProductItemId, ShowStaticProductTips);
     UpdateEnableState();
 }
    public void InitInfo(int nFormulaID)
    {
        Tab_LivingSkill tabLivingSkill = TableManager.GetLivingSkillByID(nFormulaID, 0);
        if (tabLivingSkill == null)
        {
            return;
        }

        m_FormulaID = nFormulaID;

        m_NameLabel.text = tabLivingSkill.Name;
       // m_NameLabel2.text = tabLivingSkill.Name;
        m_InfoLabel.text = tabLivingSkill.Info;
        m_ItemSlot.InitInfo_Formula(m_FormulaID);
        UpdateEnableState();
    }
示例#4
0
    void BuyItemOpenConsignSale(bool bSuccess, object param)
    {
        if (bSuccess)
        {
            Tab_LivingSkill tabLivingSkill = TableManager.GetLivingSkillByID(m_CurFormulaID, 0);
            if (tabLivingSkill == null)
            {
                return;
            }

            if (ConsignSaleLogic.Instance() != null)
            {
                ConsignSaleLogic.Instance().SearchForAskBuy(tabLivingSkill.Name);
            }
        }
    }
示例#5
0
    public void InitInfo_Formula(int id, OnClick delSlotOnClick = null, string strNum = "", bool showNum = false)
    {
        m_ItemID         = id;
        m_eItemType      = SLOT_TYPE.TYPE_FORMULA;
        m_delSlotOnClick = delSlotOnClick;

        m_NumLabel.gameObject.SetActive(false);

        Tab_LivingSkill tabFormula = TableManager.GetLivingSkillByID(id, 0);

        if (tabFormula == null)
        {
            ClearInfo();
        }
        else
        {
            m_ItemIcon.spriteName = tabFormula.Icon;
            m_ItemIcon.gameObject.SetActive(true);
        }
    }
    void UpdateEnableState()
    {
        Tab_LivingSkill tabLivingSkill = TableManager.GetLivingSkillByID(m_FormulaID, 0);
        if (tabLivingSkill == null)
        {
            return;
        }

        if (Singleton<ObjManager>.Instance.MainPlayer == null)
        {
            return;
        }

        if (Singleton<ObjManager>.Instance.MainPlayer.BaseAttr.Level < tabLivingSkill.OpenLevel)
        {
            m_ItemSlot.ItemSlotDisable();
        }
        else
        {
            m_ItemSlot.ItemSlotEnable();
        }
    }
示例#7
0
    void MakeItem()
    {
        NewPlayerGuidLogic.CloseWindow();
        Tab_LivingSkill tabLivingSkill = TableManager.GetLivingSkillByID(m_CurFormulaID, 0);

        if (tabLivingSkill == null)
        {
            return;
        }

        if (Singleton <ObjManager> .Instance.MainPlayer.BaseAttr.Level < tabLivingSkill.OpenLevel)
        {
            Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{1900}", tabLivingSkill.OpenLevel);

            return;
        }

        bool isBind = false;
        bool isMakeShenQiMoreEquip = false;//神器打造总材料装备是否有多

        m_bIsMakeShenQi = false;
        m_bIsMakeSuit   = false;
        Tab_CommonItem _ShenQiline = TableManager.GetCommonItemByID(tabLivingSkill.StaticProductItemId, 0);

        if (_ShenQiline != null)
        {
            if (_ShenQiline.ClassID == (int)ItemClass.EQUIP && tabLivingSkill.Type == (int)FORMULA_TYPE.TYPE_SUIT)
            {
                m_bIsMakeSuit = true;
            }
            else if (_ShenQiline.ClassID == (int)ItemClass.EQUIP && _ShenQiline.ThirdClassID == (int)EquipThirdClass.SHENQI)
            {
                m_bIsMakeShenQi = true;
            }
        }
        for (int i = 0; i < tabLivingSkill.getStuffIDCount(); i++)
        {
            int nStuffID    = tabLivingSkill.GetStuffIDbyIndex(i);
            int nStuffCount = tabLivingSkill.GetStuffCountbyIndex(i);
            if (nStuffID != GlobeVar.INVALID_ID)
            {
                if (GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(nStuffID) < nStuffCount)
                {
                    Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{1901}");

                    return;
                }
                if (!isBind)
                {
                    if (GameManager.gameManager.PlayerDataPool.BackPack.GetBindItemCountByDataId(nStuffID) > 0)
                    {
                        isBind = true;
                        //m_bisMakeShenUseBind = true;
                    }
                }
                if (m_bIsMakeShenQi)
                {
                    Tab_CommonItem line = TableManager.GetCommonItemByID(nStuffID, 0);
                    if (line != null)
                    {
                        if (line.ClassID == (int)ItemClass.EQUIP && line.ThirdClassID == (int)EquipThirdClass.SHENQI)
                        {
                            m_bIsMakeShenQiByChuanCheng = true; //有材料是神器 则是传承 不是打造
                        }
                        if (GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(nStuffID) > nStuffCount)
                        {
                            if (line.ClassID == (int)ItemClass.EQUIP)
                            {
                                isMakeShenQiMoreEquip = true;
                            }
                        }
                    }
                }

                if (m_bIsMakeSuit)
                {
                    Tab_CommonItem line = TableManager.GetCommonItemByID(nStuffID, 0);
                    if (line != null)
                    {
                        if (GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(nStuffID) > nStuffCount)
                        {
                            if (line.ClassID == (int)ItemClass.EQUIP)
                            {
                                isMakeShenQiMoreEquip = true;
                            }
                        }
                    }
                }
            }
        }

        if (Singleton <ObjManager> .Instance.MainPlayer.BaseAttr.CurStamina < tabLivingSkill.Stamina)
        {
            Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{2139}");

            return;
        }

        if (GameManager.gameManager.PlayerDataPool.BackPack.GetCanContainerSize() <= 0)
        {
            Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{1903}");

            return;
        }

        if (GameManager.gameManager.PlayerDataPool.Money.GetMoney_Coin() < tabLivingSkill.Money)
        {
            Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{1902}");

            return;
        }
        if (m_bIsMakeShenQi || m_bIsMakeSuit)
        {
            if (isMakeShenQiMoreEquip) // 提示有多余的装备 是否确定用当前的装备打造神器
            {
                MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{5068}"), "", MakeShenQi_CurEquip_Ok);
            }
            else if (IsNeedWaringHaveLowShenQiEquip())
            {
                MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{5220}"), "", MakeItemOK, MakeItemCancel);
            }
            else
            {
                MakeItemOK();
            }
        }
        else
        {
            if (isBind)
            {
                MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{2659}"), "", MakeItemOK, MakeItemCancel);
            }
            else
            {
                MakeItemOK();
            }
        }
    }
示例#8
0
    public void OnFormulaChoose(int nFormulaID)
    {
        Tab_LivingSkill tabLivingSkill = TableManager.GetLivingSkillByID(nFormulaID, 0);

        if (tabLivingSkill == null)
        {
            return;
        }

        Utils.CleanGrid(m_StuffGrid);
        int i = 0;

        if (tabLivingSkill.Type == (int)FORMULA_TYPE.TYPE_SHENQI ||
            tabLivingSkill.Type == (int)FORMULA_TYPE.TYPE_SHENJIE ||
            tabLivingSkill.Type == (int)FORMULA_TYPE.TYPE_SUIT)
        {
            for (; i < tabLivingSkill.getStuffIDCount(); i++)
            {
                int        nStuffID  = tabLivingSkill.GetStuffIDbyIndex(i);
                GameObject StuffItem = Utils.BindObjToParent(m_ShenQiStuffItem, m_StuffGrid, i.ToString());
                if (StuffItem != null)
                {
                    if (nStuffID != GlobeVar.INVALID_ID)
                    {
                        UInt64 itemGuid = GameManager.gameManager.PlayerDataPool.BackPack.GetItemGuidByDataID(tabLivingSkill.GetStuffIDbyIndex(i));
                        StuffItem.GetComponent <LivingSkillShenQiStuffLogic>().InitInfo(tabLivingSkill.GetStuffIDbyIndex(i), itemGuid, tabLivingSkill.GetStuffCountbyIndex(i));
                    }
                    else
                    {
                        // init empty
                    }
                }
            }
        }
        else
        {
            for (; i < tabLivingSkill.getStuffIDCount(); i++)
            {
                int        nStuffID  = tabLivingSkill.GetStuffIDbyIndex(i);
                GameObject StuffItem = Utils.BindObjToParent(m_StuffItem, m_StuffGrid, i.ToString());
                if (StuffItem != null)
                {
                    if (nStuffID != GlobeVar.INVALID_ID)
                    {
                        StuffItem.GetComponent <LivingSkillStuffLogic>().InitInfo(tabLivingSkill.GetStuffIDbyIndex(i), tabLivingSkill.GetStuffCountbyIndex(i));
                    }
                    else
                    {
                        // init empty
                        StuffItem.GetComponent <LivingSkillStuffLogic>().InitEmpty();
                    }
                }
            }
        }

        m_StuffGrid.GetComponent <UIGrid>().Reposition();
        //m_StuffGrid.GetComponent<UITopGrid>().Recenter(true);
        m_CurFormulaID = nFormulaID;

        m_PayMoneyLabel.text    = tabLivingSkill.Money.ToString();
        m_PayStaminaLabel.text  = tabLivingSkill.Stamina.ToString();
        m_OutputIcon.spriteName = tabLivingSkill.Icon;

        foreach (LivingSkillFormulaLogic formula in m_FormulaGrid.GetComponentsInChildren <LivingSkillFormulaLogic>())
        {
            if (formula.FormulaID != nFormulaID)
            {
                formula.ChooseCancel();
            }
        }
    }
示例#9
0
    void UpdateLivingSkillInfo(FORMULA_TYPE eType)
    {
        Utils.CleanGrid(m_FormulaGrid);
        Utils.CleanGrid(m_StuffGrid);
        m_FormulaGrid.GetComponent <UITopGrid>().Recenter(true);
        bool bFirstFormula = true;
        int  index         = 0;
        List <Tab_LivingSkill> liveSkill = DealLivingSkill();

        //foreach(KeyValuePair<int, List<Tab_LivingSkill>> pair in TableManager.GetLivingSkill())
        for (int i = 0; i < liveSkill.Count; ++i)
        {
            //Tab_LivingSkill tabLivingSkill = pair.Value[0];
            Tab_LivingSkill tabLivingSkill = liveSkill[i];
            if (tabLivingSkill == null)
            {
                continue;
            }

            if (tabLivingSkill.Type == (int)eType ||
                (eType == FORMULA_TYPE.TYPE_SHENQI && tabLivingSkill.Type == (int)FORMULA_TYPE.TYPE_SHENJIE) //神器页面把神节配方加进来
                )
            {
                //神器配方单独做处理 筛选出自己职业的神器配方
                if (tabLivingSkill.Type == (int)FORMULA_TYPE.TYPE_SHENQI ||
                    tabLivingSkill.Type == (int)FORMULA_TYPE.TYPE_SUIT)
                {
                    Tab_CommonItem _ProductItem = TableManager.GetCommonItemByID(tabLivingSkill.StaticProductItemId, 0);
                    if (_ProductItem == null)
                    {
                        continue;
                    }
                    Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

                    if (_mainPlayer == null)
                    {
                        continue;
                    }
                    //筛选出自己职业的神器配方
                    if (_mainPlayer.Profession != _ProductItem.ProfessionRequire)
                    {
                        continue;
                    }
                }
                // 加载对应分页商品
                //string itemName = index < 10 ? ("0" + index.ToString()) : (index.ToString());
                string     itemName    = tabLivingSkill.SortID > 0 ? tabLivingSkill.SortID.ToString() + tabLivingSkill.Id.ToString() : "99999" + tabLivingSkill.Id.ToString();
                GameObject FormulaItem = Utils.BindObjToParent(m_FormulaItem, m_FormulaGrid, itemName);
                if (FormulaItem == null)
                {
                    continue;
                }

                if (null != FormulaItem.GetComponent <LivingSkillFormulaLogic>())
                {
                    if (tabLivingSkill.StaticProductItemId == -1)
                    {
                        FormulaItem.GetComponent <LivingSkillFormulaLogic>().InitInfo(tabLivingSkill.Id);
                    }
                    else
                    {
                        FormulaItem.GetComponent <LivingSkillFormulaLogic>().InitInfoForStaticProduct(tabLivingSkill.Id);
                    }
                    if (bFirstFormula)
                    {
                        FormulaItem.GetComponent <LivingSkillFormulaLogic>().ChooseFormula();
                        bFirstFormula = false;
                    }
                }

                index++;
            }
        }

        m_FormulaGrid.GetComponent <UIGrid>().Reposition(true);
        m_FormulaGrid.GetComponent <UITopGrid>().Recenter(true);
    }