Exemple #1
0
        /// <summary>
        /// 获取指定链接下的图片(默认随机获取某个分类下的第一页图片)
        /// </summary>
        /// <param name="url">请求地址</param>
        /// <param name="cid">指定分类</param>
        /// <returns></returns>
        public List <Belle> GetListBelle(string url = "", int cid = 0)
        {
            // 如果不显式声明cid 则赋值随机
            if (cid == 0)
            {
                cid = Ids[new Random().Next(Ids.Length)];
            }

            // 豆瓣地址
            var address = string.IsNullOrWhiteSpace(url) ? "https://www.dbmeinv.com/index.htm?cid=" + cid : url;

            // 请求豆辨网
            var document = GetHtmlDocumet(address);

            // 根据class获取html元素
            var cells = document.QuerySelectorAll(".panel-body li");

            // We are only interested in the text - select it with LINQ
            List <Belle> list = new List <Belle>();

            foreach (var item in cells)
            {
                var belle = new Belle
                {
                    Title    = item.QuerySelector("img").GetAttribute("title"),
                    ImageUrl = item.QuerySelector("img").GetAttribute("src")
                };
                list.Add(belle);
            }
            return(list);
        }
    private void GetBelleFragmentNum(out int have, out int need)
    {
        have = 0;
        need = 0;
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }
        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }
        Belle curBelleData = null;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
        }
        if (null == curBelleData)
        {
            return;
        }
        Tab_BelleLevelup curTabBelleLevelup = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);

        if (null != curTabBelleLevelup && curTabBelleLevelup.getConsumeTypeCount() > 0)
        {
            need = curTabBelleLevelup.GetConsumeNumbyIndex(0);
        }
        BelleData.OwnedBelleAbsorbNum.TryGetValue(belleTab.Id, out have);
    }
    public void SetCombatValue()
    {
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

            if (null == belleTab)
            {
                LogModule.ErrorLog("BelleInfoWindow.Instance().CurSellectedBelleData is null!");
                return;
            }

            Belle curBelleData = null;
            if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            }

            if (null == curBelleData)
            {
                return;
            }
            curBelleData.UpdateAttrMap();
            m_battleValue.text = BelleData.GetPowerNum(curBelleData.attrMap).ToString();
        }
    }
    public void updateBelleColor()
    {
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

            if (null == belleTab)
            {
                LogModule.ErrorLog("BelleInfoWindow.Instance().CurSellectedBelleData is null!");
                return;
            }

            Belle curBelleData = null;
            if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            }

            if (null == curBelleData)
            {
                return;
            }
            //品阶
            m_curBelleMainColor.text          = BelleData.GetBelleDescByColorLevel(curBelleData.colorLevel);
            m_curBelleMainColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(curBelleData.colorLevel);
            m_curBelleSubColor.text           = StrDictionary.GetClientDictionaryString("#{10811}", curBelleData.subLevel);
            m_curBelleMainColor.color         = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);
            m_curBelleSubColor.color          = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);

            m_belleName.color = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);
        }
    }
    /// <summary>
    /// 亲密进度条更新
    /// </summary>
    public void UpdateCloseProcessBar()
    {
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

            if (null == belleTab)
            {
                LogModule.ErrorLog("BelleInfoWindow.Instance().CurSellectedBelleData is null!");
                return;
            }

            Belle curBelleData = null;
            if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                ;
            }
            {
                curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            }
            //亲密等级
            m_curCloseLevel.text    = curBelleData.closeLevel.ToString();
            m_nextAddAttrValue.text = Utils.GetAttrTypeString(belleTab.CloseAddAttrType) + curBelleData.nextCloseAttrValue.ToString();
            m_curFavorValue.text    = curBelleData.favourValue.ToString() + "/" + curBelleData.maxFavourValue.ToString();

            m_processBar.fillAmount = curBelleData.maxFavourValue == 0 ? 0f : curBelleData.favourValue * 1.0f / curBelleData.maxFavourValue;
        }
    }
    // 阵型按钮点击
    public void OnMatrixButtonClick(int matrixIndex)
    {
        if (BelleController.Instance() == null || BelleMatrixWindow.Instance() == null)
        {
            LogModule.ErrorLog("BelleController.Instance() == null || BelleMatrixWindow.Instance() == null");
            return;
        }

        if (null == BelleMatrixWindow.Instance().CurSelectMatrix)
        {
            return;
        }

        if (matrixIndex < 0)
        {
            return;
        }

        int curMatrixID = Int32.Parse(BelleMatrixWindow.Instance().CurSelectMatrix.gameObject.name);


        if (!BelleData.OwnedMatrixMap.ContainsKey(curMatrixID))
        {
            LogModule.ErrorLog("can not find matrixid in data" + curMatrixID);
            return;
        }

        Tab_BelleMatrix curTabMatrix = TableManager.GetBelleMatrixByID(curMatrixID, 0);

        if (null == curTabMatrix)
        {
            LogModule.ErrorLog("can not find cur matrix id :" + curMatrixID.ToString());
            return;
        }

        Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer;

        if (!BelleData.OwnedMatrixMap.ContainsKey(curMatrixID) || null == mainPlayer || mainPlayer.BaseAttr.Level < curTabMatrix.OpenLevel)
        {
            return;
        }
        this.m_curMatrixIndex = matrixIndex;
        if (matrixIndex >= 0 && matrixIndex < m_MatrixBelleInfos.Length)
        {
            m_selectBelleData.CleanUp();
            m_selectBelleData.belleID       = m_MatrixBelleInfos[matrixIndex].belleID;
            m_selectBelleData.matrixId      = curMatrixID;
            m_selectBelleData.isInCurMatrix = true;
            if (BelleData.OwnedBelleMap.ContainsKey(m_MatrixBelleInfos[matrixIndex].belleID))
            {
                Belle belle = BelleData.OwnedBelleMap[m_MatrixBelleInfos[matrixIndex].belleID];
                if (null != belle)
                {
                    m_selectBelleData.combatValue = BelleData.GetPowerNum(belle.attrMap);
                }
            }
        }
        m_myBelleWindow.SetActive(true);
    }
    /// <summary>
    /// 进化按钮响应函数
    /// </summary>
    void OnEvolutionClick()
    {
        // Debug.Log("OnEvolution .........................");


        if (null == BelleInfoWindow.Instance())
        {
            return;
        }

        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }

        Belle curBelleData = null;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
        }
        if (null == curBelleData)
        {
            return;
        }
        SetEvaWinData(curBelleData);

        //         Tab_BelleLevelup curTabBelleLevelup = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);
        //         Tab_BelleLevelup nextTabBelleLevelup = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel + 1, 0);
        //         string strTip = "";
        //
        //         if (null != curTabBelleLevelup && nextTabBelleLevelup != null)
        //         {
        //             string attrTypeName = BelleData.GetBelleDescByColorLevel(nextTabBelleLevelup.MainLevel);
        //             strTip = StrDictionary.GetClientDictionaryString("#{1404}", attrTypeName, nextTabBelleLevelup.SubLevel, curTabBelleLevelup.GetConsumeNumbyIndex(0), curTabBelleLevelup.GetConsumeNumbyIndex(1));
        //         }
        //
        //
        //         MessageBoxLogic.OpenOKCancelBox(strTip, "", DoEvlolution);

        m_EvaluWin.SetActive(true);
    }
    /// <summary>
    /// 进化确认界面数据填充
    /// </summary>
    /// <param name="belle"></param>
    public void SetEvaWinData(Belle curBelleData)
    {
        if (null == curBelleData)
        {
            return;
        }

        m_EvaCurMianColor.text          = BelleData.GetBelleDescByColorLevel(curBelleData.colorLevel);
        m_EvaCurMianColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(curBelleData.colorLevel);
        m_EvaCurSubColor.text           = StrDictionary.GetClientDictionaryString("#{10811}", curBelleData.subLevel);
        // m_EvaCurMianColor.color = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);
        // m_EvaCurSubColor.color = m_EvaCurMianColor.color;

        Tab_BelleLevelup curTabBelleLevelup  = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);
        Tab_BelleLevelup nextTabBelleLevelup = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel + 1, 0);

        if (null != curTabBelleLevelup && nextTabBelleLevelup != null)
        {
            m_EvaNextMainColor.text = BelleData.GetBelleDescByColorLevel(nextTabBelleLevelup.MainLevel);

            m_EvaNextMainColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(curBelleData.colorLevel);
            m_EvaNextSubColor.text           = StrDictionary.GetClientDictionaryString("#{10811}", nextTabBelleLevelup.SubLevel);
            //  m_EvaNextMainColor.color = BelleData.GetBelleColorByColorLevel(nextTabBelleLevelup.MainLevel);
            //m_EvaNextSubColor.color = m_EvaNextMainColor.color;

            //消耗类型图片 理论上应该消耗的统一接口,这里先这么着吧,改动不会经常改

            Tab_CommonItem item1 = TableManager.GetCommonItemByID(curTabBelleLevelup.GetConsumeSubTypebyIndex(0), 0);
            if (item1 != null)
            {
                m_EvaCostItem_1_Icon.spriteName = item1.Icon;
            }

            m_EvaCostItem_1_Count.text = curTabBelleLevelup.GetConsumeNumbyIndex(0).ToString();
            m_EvaCostItem_2_Count.text = curTabBelleLevelup.GetConsumeNumbyIndex(1).ToString();
            //
            //             string attrTypeName = BelleData.GetBelleDescByColorLevel(nextTabBelleLevelup.MainLevel);
            //             strTip = StrDictionary.GetClientDictionaryString("#{1404}", attrTypeName, nextTabBelleLevelup.SubLevel, curTabBelleLevelup.GetConsumeNumbyIndex(0), curTabBelleLevelup.GetConsumeNumbyIndex(1));
        }
        // MessageBoxLogic.OpenOKCancelBox(strTip, "", DoEvlolution);
    }
Exemple #9
0
    public void UpdateRedTipState()
    {
        m_redItemTipObj.SetActive(false);
        m_redTipObj.SetActive(false);
        m_redCloseTipObj.SetActive(false);
        m_redEvoTipObj.SetActive(false);
        //red tip
        PlayerData _playerData = GameManager.gameManager.PlayerDataPool;

        if (null != _playerData && _playerData.BelleConfigData != null)
        {
            string belleGetBits  = _playerData.BelleConfigData.BelleGetBits;
            string belleItemBits = _playerData.BelleConfigData.BelleItemBits;
            string belleEvoBits  = _playerData.BelleConfigData.BelleCanEvoBeits;

            if (null != belleGetBits && m_belleId >= 0 && m_belleId < belleGetBits.Length && m_isOwn)
            {
                m_redTipObj.SetActive(belleGetBits[m_belleId] == '1');
            }

            if (null != belleItemBits && m_belleId >= 0 && m_belleId < belleItemBits.Length && !m_isOwn)
            {
                m_redItemTipObj.SetActive(belleItemBits[m_belleId] == '1');
            }

            if (null != belleEvoBits && m_belleId >= 0 && m_belleId < belleEvoBits.Length && m_isOwn)
            {
                if (BelleData.OwnedBelleMap.ContainsKey(m_belleId))
                {
                    Belle belle = BelleData.OwnedBelleMap[m_belleId];
                    if (belle != null && !belle.IsMaxLevel())
                    {
                        m_redEvoTipObj.SetActive(belleEvoBits[m_belleId] == '1');
                    }
                }
            }
            m_redCloseTipObj.SetActive(BelleData.IsCanCloseFree() && m_isOwn);
        }
    }
Exemple #10
0
        /// <summary>
        /// 获取指定链接下的图片(默认随机获取某个分类下的第一页图片)
        /// </summary>
        /// <param name="url">请求地址</param>
        /// <returns></returns>
        public List <Belle> GetListBelle(string url)
        {
            // send request
            var document = GetHtmlDocument(url);

            // get document by class
            var cells = document.QuerySelectorAll(".panel-body li");

            // We are only interested in the text - select it with LINQ
            List <Belle> list = new List <Belle>();

            foreach (var item in cells)
            {
                var belle = new Belle
                {
                    Title    = item.QuerySelector("img").GetAttribute("title"),
                    ImageUrl = item.QuerySelector("img").GetAttribute("src")
                };
                list.Add(belle);
            }
            return(list);
        }
    /// <summary>
    /// 获得美人成功后的回调函数,更新界面
    /// </summary>
    public void OnGetBelleUpdateWinInfo()
    {
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }

        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }

        Belle curBelleData = null;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
        }
        if (null == curBelleData)
        {
            return;
        }
        else
        {
            if (BelleInfoWindow.Instance() != null)
            {
                BelleInfoWindow.Instance().UpdateScrollViewList();
                BelleInfoWindow.Instance().ShowBelleInfoWindow(belleTab, true);
            }
        }

        //合成红点提示消失
        m_redGetBelle.SetActive(false);
    }
Exemple #12
0
    /// <summary>
    /// 设置基本属性界面
    /// </summary>
    public void SetBelleAttrData()
    {
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }

        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }

        Belle curBelleData = null;
        bool  bOwned       = false;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            bOwned       = true;
        }
        if (null == curBelleData)
        {
            return;
        }

//         Tab_CommonItem commItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);
//         if (commItem != null)
//             m_bellePic.spriteName = commItem.Icon;
//         //美人等级
//         m_belleLevel.text = StrDictionary.GetClientDictionaryString("#{1308}", BelleData.GetBelleDescByColorLevel(curBelleData.colorLevel), curBelleData.subLevel);
//         m_belleLevel.color = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);

        //  UpdateEvalutionInfo();
        curBelleData.UpdateAttrMap();
        int nextAttrTypeIndex      = curBelleData.GetNextLevelAttrType(curBelleData.orgLevel + 1);
        int nextAttrValue          = curBelleData.GetNextLevelAttrValue(curBelleData.orgLevel + 1);
        Tab_BelleLevelup belleLevL = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);

        if (null == belleLevL)
        {
            return;
        }
        //美人属性值
        for (int i = 0; i < belleTab.getAttrTypeCount(); i++)
        {
            m_shrapPic[i].gameObject.SetActive(false);
            m_defaultText[i].gameObject.SetActive(true);
            m_nextValues[i].text    = "";
            m_attrTypeNames[i].text = Utils.GetAttrTypeString(belleTab.GetAttrTypebyIndex(i));

            int closeValue = 0;
            //亲密值
            if (belleTab.GetAttrTypebyIndex(i) == belleTab.CloseAddAttrType)
            {
                closeValue = curBelleData.closeAddValue;
            }
            //非第六条属性,受颜色等级控制
            if (i != belleTab.getAttrTypeCount() - 1)
            {
                if (i < curBelleData.colorLevel)
                {
                    m_attrValues[i].text = "+" + (belleLevL.GetAttrValuebyIndex(i) /*+ closeValue*/);
                }
                else
                {
                    m_attrValues[i].text = "+" + (belleTab.GetAttrValuebyIndex(i) /*+ closeValue*/);
                }
            }
            else //第六条属性,不受颜色等级控制
            {
                m_attrValues[i].text = "+" + ((curBelleData.IsMaxLevel()? belleLevL.GetAttrValuebyIndex(i):belleTab.GetAttrValuebyIndex(i)) /*+ closeValue*/);
                m_attrTypeNames[i].gameObject.SetActive(false);
            }

            //亲密值
            if (i == 0)
            {
                m_closeValueText.text = StrDictionary.GetClientDictionaryString("#{10817}", closeValue);
                m_closeValueText.gameObject.SetActive(closeValue > 0);
            }

            if (belleTab.getAttrTypeCount() - 1 != i && nextAttrTypeIndex == i)
            {
                //  LogModule.DebugLog("nextAttrType ===    " + nextAttrType + "   BelleTab.getAttrTypeByIndex " + i + "  " + belleTab.GetAttrTypebyIndex(i));
                if (i < curBelleData.colorLevel && nextAttrValue > 0)
                {
                    m_nextValues[i].text = "+" + nextAttrValue.ToString();
                    m_shrapPic[i].gameObject.SetActive(true);
                }
                else
                {
                    m_nextValues[i].text = "";
                }
            }
            else
            {
                m_shrapPic[i].gameObject.SetActive(false);
                m_nextValues[i].text = "";
            }

            if (null != curBelleData && bOwned)
            {
                if (i != belleTab.getAttrTypeCount() - 1)
                {
                    m_attrTypeNames[i].color = i < curBelleData.colorLevel ? m_ColorHighlight : m_ColorDisable;
                    m_attrValues[i].color    = i < curBelleData.colorLevel ? m_ColorHighlight : m_ColorDisable;
//                     m_nextValues[i].color = i < curBelleData.colorLevel ? m_ColorHighlight : m_ColorDisable;

                    m_defaultText[i].gameObject.SetActive(i >= curBelleData.colorLevel);
                }
                else
                {
                    m_attrTypeNames[i].color = curBelleData.IsMaxLevel() ? m_ColorHighlight : m_ColorDisable;
                    m_attrValues[i].color    = curBelleData.IsMaxLevel() ? m_ColorHighlight : m_ColorDisable;
//                     m_nextValues[i].color = curBelleData.IsMaxLevel() ? m_ColorHighlight : m_ColorDisable;
                    m_defaultText[i].gameObject.SetActive(!curBelleData.IsMaxLevel());
                }
            }
            else
            {
                m_attrTypeNames[i].color = m_ColorDisable;
                m_attrValues[i].color    = m_ColorDisable;
//                 m_nextValues[i].color = m_ColorDisable;
                m_shrapPic[i].gameObject.SetActive(false);
                m_defaultText[i].gameObject.SetActive(true);
                m_nextValues[i].text = "";
            }
        }
        //回调的时候等级变化,需要设置战力值
        //   SetCombatValue();
        //触发更新Item数量
        //据策划说,没有第六条属性
        m_attrTypeNames[5].gameObject.SetActive(false);
        m_attrValues[5].gameObject.SetActive(false);
        m_nextValues[5].gameObject.SetActive(false);
        m_shrapPic[5].gameObject.SetActive(false);
        m_defaultText[5].gameObject.SetActive(false);
        //
    }
    public void SetData(SelectMyBelleTOMatrixWindow parentWindow, SelectBelleData recommonBelleData, int index)
    {
        this.parentWindow        = parentWindow;
        this.gameObject.name     = index.ToString();
        this.m_RecommonBelleData = recommonBelleData;

        if (null == recommonBelleData)
        {
            return;
        }

        if (!BelleData.OwnedBelleMap.ContainsKey(recommonBelleData.belleID))
        {
            return;
        }
        Tab_Belle _belle = TableManager.GetBelleByID(recommonBelleData.belleID, 0);

        if (null == _belle)
        {
            return;
        }

        m_belleName.text = _belle.Name;
        Tab_CommonItem commItem = TableManager.GetCommonItemByID(_belle.BelleItemID, 0);

        if (commItem == null)
        {
            return;
        }


        m_belleIcon.spriteName = commItem.Icon;
        if (m_QualitySprite != null && BelleData.OwnedBelleMap.ContainsKey(recommonBelleData.belleID))
        {
            m_QualitySprite.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[BelleData.OwnedBelleMap[recommonBelleData.belleID].colorLevel - 1];
        }

        m_relationshipIcon.gameObject.SetActive(recommonBelleData.isRelationship);
        Belle belle = BelleData.OwnedBelleMap[recommonBelleData.belleID];

        if (null == belle)
        {
            return;
        }
        this.myBelle       = belle;
        m_combatValue.text = recommonBelleData.combatValue.ToString();


        m_belleMainColor.text          = BelleData.GetBelleDescByColorLevel(belle.colorLevel);
        m_belleMainColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(belle.colorLevel);
        m_belleSubColor.text           = StrDictionary.GetClientDictionaryString("#{10811}", belle.subLevel);
        m_belleMainColor.color         = BelleData.GetBelleColorByColorLevel(belle.colorLevel);
        m_belleSubColor.color          = BelleData.GetBelleColorByColorLevel(belle.colorLevel);

        if (belle.matrixIndex != -1 && belle.matrixID != -1)
        {
            if (BelleData.OwnedBelleMap.ContainsKey(recommonBelleData.belleID))
            {
                Tab_BelleMatrix _matrix = TableManager.GetBelleMatrixByID(belle.matrixID, 0);
                if (null == _matrix)
                {
                    return;
                }

                //在阵上但不在当前阵上的 都上阵
                if (!recommonBelleData.isInCurMatrix)
                {
                    m_isInMatirx.text = StrDictionary.GetClientDictionaryString("#{10403}", _matrix.Name);

                    m_notInMatrix.gameObject.SetActive(false);
                    m_OnMatrixBtnText.text         = StrDictionary.GetClientDictionaryString("#{10404}");
                    m_OnMatrixBtnSprite.spriteName = BLUE_SPRITE_NORMAL_NAME;
                    m_OnMatrixBtn.normalSprite     = BLUE_SPRITE_NORMAL_NAME;
                    m_OnMatrixBtn.pressedSprite    = BLUE_SPRITE_PRESSED_NAME;
                    m_OnMatrixBtn.hoverSprite      = BLUE_SPRITE_NORMAL_NAME;
                }
                else
                {
                    m_isInMatirx.gameObject.SetActive(false);
                    m_notInMatrix.gameObject.SetActive(false);
                    m_inCurMatrix.gameObject.SetActive(true);
                    m_OnMatrixBtnText.text = StrDictionary.GetClientDictionaryString("#{10405}");

                    m_OnMatrixBtnSprite.spriteName = RED_SPRITE_NORMAL_NAME;
                    m_OnMatrixBtn.normalSprite     = RED_SPRITE_NORMAL_NAME;
                    m_OnMatrixBtn.pressedSprite    = RED_SPRITE_PRESSED_NAME;
                    m_OnMatrixBtn.hoverSprite      = RED_SPRITE_NORMAL_NAME;
                }
            }
        }
        else
        {
            if (!recommonBelleData.isInCurMatrix)
            {
                m_isInMatirx.gameObject.SetActive(false);
                m_isInMatirx.text      = StrDictionary.GetClientDictionaryString("#{10402}");
                m_OnMatrixBtnText.text = StrDictionary.GetClientDictionaryString("#{10404}");
                m_notInMatrix.gameObject.SetActive(true);
            }
            m_OnMatrixBtnSprite.spriteName = BLUE_SPRITE_NORMAL_NAME;
            m_OnMatrixBtn.normalSprite     = BLUE_SPRITE_NORMAL_NAME;
            m_OnMatrixBtn.pressedSprite    = BLUE_SPRITE_PRESSED_NAME;
            m_OnMatrixBtn.hoverSprite      = BLUE_SPRITE_NORMAL_NAME;
        }
    }
    void OnEnable()
    {
        if (!IsInit && ItemPerObj != null)
        {
            m_AttrDic.Clear();
            IsInit = true;
            int  hasCount  = 0;
            bool iscontain = true;
            bool isEnough  = true;
            Dictionary <int, List <Tab_Belle> > allDataDic = TableManager.GetBelle();
            if (allDataDic != null && GridParent != null)
            {
                foreach (KeyValuePair <int, List <Tab_Belle> > pair in allDataDic)
                {
                    GameObject go = GameObject.Instantiate(ItemPerObj) as GameObject;
                    if (go != null)
                    {
                        go.transform.name          = pair.Key.ToString();
                        go.transform.parent        = GridParent;
                        go.transform.localPosition = Vector3.zero;
                        go.transform.localScale    = Vector3.one;
                        m_GoFindIdDic.Add(go, pair.Key);
                        iscontain = BelleData.OwnedBelleMap.ContainsKey(pair.Key);
                        if (!iscontain)
                        {
                            go.transform.name = "z" + go.transform.name;
                        }

                        isEnough = BelleData.RedPointBelleIds.Contains(pair.Key);                        //魔灵碎片是否足够生成魂器
                        if (isEnough)
                        {
                            go.transform.name = "y" + go.transform.name;
                        }


                        SetItemInfo(pair.Value[0], go, iscontain);
                        if (iscontain)
                        {
                            ++hasCount;
                            Belle curBelleData = BelleData.OwnedBelleMap[pair.Key];
                            curBelleData.UpdateAttrMap();
                            Dictionary <int, int> attrDic = curBelleData.attrMap;
                            foreach (KeyValuePair <int, int> attrpair in attrDic)
                            {
                                if (m_AttrDic.ContainsKey(attrpair.Key))
                                {
                                    m_AttrDic[attrpair.Key] += attrpair.Value;
                                }
                                else
                                {
                                    m_AttrDic.Add(attrpair.Key, attrpair.Value);
                                }
                            }
                            m_CombatAllValue += BelleData.GetPowerNum(curBelleData.attrMap);
                        }
                    }
                }
                Transform tf = transform.Find("labelBattle");
                if (tf != null)
                {
                    UILabel ul = tf.GetComponent <UILabel>();
                    if (ul != null)
                    {
                        ul.text = m_CombatAllValue.ToString();
                    }
                }
                tf = transform.Find("ProcessBar/processbarFront");
                if (tf != null)
                {
                    UISprite us = tf.GetComponent <UISprite>();
                    if (us != null)
                    {
                        us.fillAmount = (float)hasCount / allDataDic.Count;
                    }
                }
                if (CollectLabelLeft != null && CollectLabelRight != null)
                {
                    CollectLabelLeft.text  = hasCount.ToString();
                    CollectLabelRight.text = allDataDic.Count.ToString();
                }
                if (AttrTypeName.Length == AttrData.Length)
                {
                    int labelcount = AttrData.Length;
                    int num        = 0;
                    foreach (KeyValuePair <int, int> attrdicpair in m_AttrDic)
                    {
                        if (num < labelcount && AttrTypeName[num] != null && AttrData[num] != null)
                        {
                            AttrTypeName[num].text = GCGame.Utils.GetAttrTypeString(attrdicpair.Key);
                            AttrData[num].text     = "+" + attrdicpair.Value;
                            AttrTypeName[num].gameObject.SetActive(true);
                            AttrData[num].gameObject.SetActive(true);
                            ++num;
                        }
                    }
                    for (int start = num; start < labelcount; ++start)
                    {
                        if (AttrTypeName[start] != null && AttrData[start] != null)
                        {
                            AttrTypeName[start].gameObject.SetActive(false);
                            AttrData[start].gameObject.SetActive(false);
                        }
                    }
                }
                UIGrid ug = GridParent.GetComponent <UIGrid>();
                if (ug != null)
                {
                    ug.repositionNow = true;
                }
            }
            ShowDefaultModel();
        }
        BelleItemsShowRedPoint();
    }
    public void UpdateEvalutionInfo()
    {
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }

        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }

        Belle curBelleData = null;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
        }
        if (null == curBelleData)
        {
            return;
        }
        int belleSubItemId     = belleTab.BelleItemID;
        int belleTotalSubCount = 0;
        int belleCoinCount     = 0;
        Tab_BelleLevelup curTabBelleLevelup = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);

        if (null != curTabBelleLevelup && curTabBelleLevelup.getConsumeTypeCount() > 0)
        {
            belleTotalSubCount = curTabBelleLevelup.GetConsumeNumbyIndex(0);
            belleCoinCount     = curTabBelleLevelup.GetConsumeNumbyIndex(1);
        }

        if (GameManager.gameManager.PlayerDataPool == null)
        {
            return;
        }
        Games.Item.GameItemContainer backPack = GameManager.gameManager.PlayerDataPool.BackPack;
        if (backPack == null)
        {
            return;
        }
        int belleSubItemCount = backPack.GetItemCountByDataId(belleSubItemId);
        int have = 0; int need = 0;

        GetBelleFragmentNum(out have, out need);
        m_curBelleItemCount.text = have.ToString() + "/" + need.ToString();
        if (need > 0)
        {
            BelleFragmentUS.transform.localScale = new Vector3((float)have / need, 1f, 1f);
        }
        Tab_CommonItem commItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);

        if (commItem != null)
        {
            m_curBelleItemIcon.spriteName = commItem.Icon;
        }
        if (belleSubItemCount < belleTotalSubCount)
        {
            m_curBelleEvaluteLab.text = StrDictionary.GetClientDictionaryString("#{10812}");
            messageBtn.functionName   = "OnGetItem";
            evoRedTipObj.gameObject.SetActive(false);
            if (BelleConfig.GetBelleEvoBitByIndex(belleTab.Id))
            {
                BelleConfig.SetBelleEvoCountByBit(belleTab.Id, '0');
            }
        }
        else
        {
            m_curBelleEvaluteLab.text = StrDictionary.GetClientDictionaryString("#{10813}");
            messageBtn.functionName   = "OnEvolutionClick";
            evoRedTipObj.gameObject.SetActive(!curBelleData.IsMaxLevel());
        }

        BelleData.m_belleEvoCount = BelleConfig.GetBelleEvoCount();
        //最大等级的一个判断


        m_EvaluBtnObj.SetActive(!curBelleData.IsMaxLevel());
        m_EvaluMaxLabel.gameObject.SetActive(curBelleData.IsMaxLevel());
    }
    public List <RecommondBelleData> GetRecommondBellesByBelleId(List <int> belleIds)
    {
        List <int> retBelles = new List <int>();
        List <RecommondBelleData> RecommBelleDataList = new List <RecommondBelleData>();

        if (belleIds == null || belleIds.Count == 0)
        {
            return(RecommBelleDataList);
        }

        //find has relationship belleIds with belleIds that has in Matrix and is owned!
        HashSet <int> hasRelationShipSets = new HashSet <int>();

        for (int i = 0; i < belleIds.Count; i++)
        {
            Tab_Belle _belleTab = TableManager.GetBelleByID(belleIds[i], 0);
            if (null != _belleTab)
            {
                for (int j = 0; j < _belleTab.getAffectionConditonTypeCount(); j++)
                {
                    if (BELLE_AFFECTION_TYPE == _belleTab.GetAffectionConditonTypebyIndex(j))
                    {
                        int belleId = _belleTab.GetAffectionConditonValuebyIndex(j);
                        if (BelleData.OwnedBelleMap.ContainsKey(belleId) && !retBelles.Contains(belleId) && !belleIds.Contains(belleId))
                        {
                            retBelles.Add(belleId);
                            if (!hasRelationShipSets.Contains(belleId))
                            {
                                hasRelationShipSets.Add(belleId);
                            }
                        }
                    }
                }
            }
        }

        //在加上那些跟当前美人没有亲密关系,但拥有的美人但没有上阵的
        foreach (var belle in BelleData.OwnedBelleMap)
        {
            if (!retBelles.Contains(belle.Value.id) && !belleIds.Contains(belle.Value.id) && belle.Value.matrixID == -1 && belle.Value.matrixIndex == -1)
            {
                retBelles.Add(belle.Value.id);
            }
        }

        //Debug 一下数据////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        string str = "";

        for (int i = 0; i < retBelles.Count; i++)
        {
            str += retBelles[i] + " ";
        }
        LogModule.DebugLog(str);
        if (retBelles.Count > 0)
        {
            for (int i = 0; i < retBelles.Count; i++)
            {
                if (BelleData.OwnedBelleMap.ContainsKey(retBelles[i]))
                {
                    RecommondBelleData _recommonData = new RecommondBelleData();
                    _recommonData.CleanUp();
                    Belle _belle = BelleData.OwnedBelleMap[retBelles[i]];
                    _recommonData.BelleID         = _belle.id;
                    _recommonData.isMatrix        = _belle.matrixID != -1 ? 1 : 0;
                    _recommonData.hasRelationship = hasRelationShipSets.Contains(retBelles[i])? 1 : 0;
                    _belle.UpdateAttrMap();
                    _recommonData.combatValue = BelleData.GetPowerNum(_belle.attrMap);
                    if (!RecommBelleDataList.Contains(_recommonData))
                    {
                        RecommBelleDataList.Add(_recommonData);
                    }
                }
            }
        }
        RecommBelleDataList.Sort();
        return(RecommBelleDataList);
    }
Exemple #17
0
        /// <summary>
        /// 获取指定链接下的图片(默认随机获取某个分类下的第一页图片)
        /// </summary>
        /// <param name="url">请求地址</param>
        /// <returns></returns>
        public List <Belle> GetListBelle(string url = "")
        {
            var flag = url.IsNullOrWhiteSpace();

            try
            {
                // 实例化Random
                var rand = new Random();

                //生成一个随机数
                var rnd = rand.Next(1, Categorys.Length);

                // 地址 todo:第一页不存在list_index_index
                var address = flag ? string.Format(Address, Categorys[rnd], rnd + 1, 2) : url;

                // 根据class获取html元素 todo:选择器错误 应该是每张图片
                var cells = GetHtmlString(address).QuerySelectorAll(".list-left dd");

                // We are only interested in the text - select it with LINQ
                List <Belle> list = new List <Belle>();

                //
                var ii = 0;
                foreach (var item in cells)
                {
                    var title     = item.QuerySelector("a").TextContent;
                    var detailUrl = item.QuerySelector("a").GetAttribute("href");

                    // 再次请求地址
                    var detailDoc = GetHtmlString(detailUrl);

                    // 图片页数
                    var pageNum = detailDoc.QuerySelectorAll(".page-ch").First().TextContent.Replace("页", "").Replace("共", "").ToInt(-1);

                    // 强行20页
                    pageNum = pageNum > 20 ? 20 : pageNum;
                    if (pageNum > 0)
                    {
                        //
                        var belle = new Belle();
                        belle.Title = title;

                        string nextUrl = string.Empty;
                        for (int i = 0; i < pageNum; i++)
                        {
                            //IHtmlDocument result = new HtmlDocument();
                            if (i == 0)
                            {
                                nextUrl = detailUrl;
                            }
                            else
                            {
                                if (!nextUrl.IsNullOrWhiteSpace() && nextUrl.Contains("_"))
                                {
                                    nextUrl = nextUrl.Split('_')[0] + "_" + (i + 1) + ".html";
                                }
                                else
                                {
                                    nextUrl = nextUrl.Replace(".html", "_" + (i + 1) + ".html");
                                }
                            }
                            var nextDoc = GetHtmlString(nextUrl);
                            var result  = nextUrl
                                          + "-"
                                          + nextDoc
                                          .QuerySelector("body > div.content > div.content-pic > a > img")
                                          .GetAttribute("src");
                            belle.ImageUrls.Add(result);
                        }
                        list.Add(belle);
                    }
                    if (flag)
                    {
                        break;
                    }
                    // 遍历太多了 太卡了(对方服务器卡)  只取20条
                    ii++;
                    if (ii > 5)
                    {
                        break;
                    }
                }
                return(list);
            }
            catch (Exception ex)
            {
                NewLife.Log.XTrace.LogPath = "D:\\Log";
                NewLife.Log.XTrace.WriteLine(" {0}获取图片链接失败 {1} 路径{2} 堆栈{3}", url, ex.Message, ex.Source, ex.StackTrace);
                return(new List <Belle>()
                {
                    new Belle()
                    {
                        Title = "发生错误" + ex.Message,
                        ImageUrls =
                        {
                            "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=915737035,1612513878&fm=27&gp=0.jpg"
                        }
                    }
                });
            }
        }
    public void SetRelationshipInfo()
    {
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }

        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }

        Belle curBelleData = null;
        bool  bOwned       = false;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            bOwned       = true;
        }

        for (int i = 0; i < m_belleNames.Length; i++)
        {
            if (i < belleTab.getAffectionGainsTypeCount())
            {
                Tab_Belle targetBelle = TableManager.GetBelleByID(belleTab.GetAffectionConditonValuebyIndex(i), 0);
                if (null == targetBelle)
                {
                    continue;
                }

                UnityEngine.Object belleTextureObj = ResourceManager.LoadResource(BelleData.GetBelleBigTextureName(targetBelle), typeof(Texture)) as Texture;
                if (null != belleTextureObj)
                {
                    m_bellePics[i].mainTexture = belleTextureObj as Texture;
                    // m_bellePics[i].color = m_ColorDisable;
                }
                //目标美人图片
                //  Tab_CommonItem commItem = TableManager.GetCommonItemByID(targetBelle.BelleItemID, 0);
                // if (commItem != null)
                //     m_bellePics[i].spriteName = commItem.Icon;
                //目标美人名字
                m_belleNames[i].text  = targetBelle.Name;
                m_belleNames[i].color = m_ColorDisable;

                //当前美人情缘名称
                m_relationNames[i].text  = belleTab.GetAffectionNamebyIndex(i);
                m_relationNames[i].color = m_ColorDisable;

                //当前美人加成属性描述
                m_attrDescs[i].text  = belleTab.GetAffectionDescbyIndex(i);
                m_attrDescs[i].color = m_ColorDisable;

                if (null != curBelleData && bOwned)
                {
                    int curBelleMatrixID = curBelleData.matrixID;
                    if (curBelleMatrixID < 0)
                    {
                        continue;
                    }

                    if (!BelleData.OwnedMatrixMap.ContainsKey(curBelleMatrixID))
                    {
                        continue;
                    }

                    if (!BelleData.OwnedMatrixMap[curBelleMatrixID].isActive)
                    {
                        continue;
                    }

                    bool bActive = false;

                    // 同上阵
                    int targetBelleID = belleTab.GetAffectionConditonValuebyIndex(i);
                    if (BelleData.OwnedBelleMap.ContainsKey(targetBelleID))
                    {
                        if (BelleData.OwnedBelleMap[targetBelleID].matrixID == curBelleData.matrixID)
                        {
                            bActive = true;
                        }
                    }

                    m_belleNames[i].color    = bActive ? m_belleNameHighlight : m_ColorDisable;
                    m_relationNames[i].color = bActive ? m_relationNameHightlight : m_ColorDisable;
                    m_attrDescs[i].color     = bActive ? m_attrDescHightlight : m_ColorDisable;
                }
            }
        }
    }
    public void UpdateBelleFragmentInfo()
    {
        InitTab();
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

            if (null == belleTab)
            {
                //LogModule.ErrorLog("BelleInfoWindow.Instance().CurSellectedBelleData is null!");
                return;
            }

            Belle curBelleData = null;
            if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            }

            if (null == curBelleData)
            {
                return;
            }

            //碎片信息
            UpdateEvalutionInfo();
            {
                m_curTimer = 1;
                //小红点更新
                objBelleCloseTip.gameObject.SetActive(BelleData.IsCanCloseFree());
                UpdateTickBand();
                UpdateCloseTimeLabel();
                UpdateCloseProcessBar();
                //单个条目红点的更新
                if (BelleInfoWindow.Instance() != null)
                {
                    BelleInfoWindow.Instance().UpdateCloseRedTipState();
                }
            }
            SetCombatValue();
            //最大等级的一个判断
            m_EvaluBtnObj.SetActive(!curBelleData.IsMaxLevel());
            m_EvaluMaxLabel.gameObject.SetActive(curBelleData.IsMaxLevel());

            m_belleDescText.text = belleTab.Introduction;
            if (HeadTone != null)
            {
                Tab_CommonItem cItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);
                if (cItem != null)
                {
                    UISprite us = HeadTone.GetComponent <UISprite>();
                    if (us != null)
                    {
                        us.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[belleTab.Quality - 1];
                    }
                    Transform tf = HeadTone.transform.Find("Head");
                    if (tf != null)
                    {
                        UISprite us1 = tf.GetComponent <UISprite>();
                        if (us1 != null)
                        {
                            us1.spriteName = cItem.Icon;
                        }
                    }
                    tf = HeadTone.transform.Find("tone");
                    if (tf != null)
                    {
                        UISprite us2 = tf.GetComponent <UISprite>();
                        if (us2 != null)
                        {
                            us2.spriteName = BelleData.GetBelleColorPicByColorLevel(BelleData.OwnedBelleMap[belleTab.Id].colorLevel);
                        }
                    }
                }
            }
        }
    }
    public bool SetMatrixInfo(int matrixID)
    {
        if (!BelleData.OwnedMatrixMap.ContainsKey(matrixID))
        {
            return(false);
        }
        BelleMatrix curMatrix = BelleData.OwnedMatrixMap[matrixID];

        if (curMatrix == null)
        {
            return(false);
        }
        Tab_BelleMatrix curBelleMatrix = TableManager.GetBelleMatrixByID(curMatrix.id, 0);

        if (null == curBelleMatrix)
        {
            LogModule.ErrorLog("BelleMatrix not defined");
            return(false);
        }

        List <int> matrixLayout = GetLayOutByMatrixLayout(curBelleMatrix.Layout);

        LogModule.DebugLog("matrixLayout                           ======================= " + matrixLayout.ToArray().ToString());
        if (null == matrixLayout || null == m_BelleBandBtns || matrixLayout.Count != m_BelleBandBtns.Length)
        {
            LogModule.ErrorLog("matrixLayout.Count  " + matrixLayout.Count + " m_BelleBandBtns.Length " + m_BelleBandBtns.Length);
            LogModule.ErrorLog("BelleMatrix id == " + curBelleMatrix.Id + " Layout " + curBelleMatrix.Layout + "is wrong! ");
            return(false);
        }

        m_MatrixBelleInfos = new MatrixBelleInfo[m_BelleBandBtns.Length];

        if (null == m_MatrixBelleInfos)
        {
            LogModule.ErrorLog("m_MatrixBelleInfos is created failed!");
            return(false);
        }

        m_curMatrixCanPutBelles = 0;
        //初始化默认图标都为+号,使当前的阵法的布局正确显示出来
        for (int i = 0; i < matrixLayout.Count && i < m_BelleBandBtns.Length; i++)
        {
            m_MatrixBelleInfos[i].CleanUp();
            m_BelleBandBtns[i].gameObject.SetActive(matrixLayout[i] == 1);
            if (m_BelleBandBtns[i].gameObject.activeSelf)
            {
                //默认都为+
                m_BelleBandBtns[i].SetIconName(null, false, -1, i);
            }
            if (matrixLayout[i] == 1)
            {
                m_MatrixBelleInfos[i].canPutFlag = 1;
                m_curMatrixCanPutBelles++;
            }
        }

        //判断当前阵法布局可放的美人数量是否合法
        if (m_curMatrixCanPutBelles <= 0 || m_curMatrixCanPutBelles > m_BelleBandBtns.Length)
        {
            LogModule.ErrorLog("curMatrixCanPutBellles is null or out of the max = " + m_BelleBandBtns.Length);
            return(false);
        }

        if (!BelleData.OwnedMatrixMap.ContainsKey(matrixID))
        {
            return(false);
        }

        //开始正式放美人到阵上
        m_hasBattleCount = 0;
        for (int i = 0; i < curMatrix.belleIDs.Length; ++i)
        {
            if (BelleData.OwnedBelleMap.ContainsKey(curMatrix.belleIDs[i]))
            {
                Belle curBelle = BelleData.OwnedBelleMap[curMatrix.belleIDs[i]];
                if (curBelle.matrixID != matrixID)
                {
                    LogModule.WarningLog("matrix ID data error: matrixID :" + matrixID.ToString() + "belleMatrixID: " + curBelle.matrixID.ToString());
                    continue;
                }

                int curMatrixIndex = curBelle.matrixIndex;
                if (curMatrixIndex >= m_BelleBandBtns.Length)
                {
                    LogModule.WarningLog("curMatrixIndex is big than curMatrix layout count " + curMatrixIndex.ToString());
                    continue;
                }

                //该位置是否可放置美人加个判断
                if (curMatrixIndex < 0 || curMatrixIndex >= m_MatrixBelleInfos.Length || m_MatrixBelleInfos[curMatrixIndex].canPutFlag == 0)
                {
                    LogModule.ErrorLog("CurMatrixIndex " + curMatrixIndex + " is invalid!");
                    continue;
                }

                Tab_Belle curTabBelle = TableManager.GetBelleByID(curMatrix.belleIDs[i], 0);
                if (null == curTabBelle)
                {
                    continue;
                }
                Tab_CommonItem commItem = TableManager.GetCommonItemByID(curTabBelle.BelleItemID, 0);
                if (null == commItem)
                {
                    continue;
                }
                m_BelleBandBtns[curMatrixIndex].SetIconName(commItem.Icon, false, curTabBelle.Id, curMatrixIndex);
                m_MatrixBelleInfos[curMatrixIndex].belleID     = curTabBelle.Id;
                m_MatrixBelleInfos[curMatrixIndex].isRecommond = false;
                m_hasBattleCount++;
            }
        }
        ////////////////////////////////////////////////////////////////////////////////////////////
        //当前已经上阵的美人ID列表
        hasInMatirxBelles.Clear();
        for (int i = 0; i < m_MatrixBelleInfos.Length; i++)
        {
            if (m_MatrixBelleInfos[i].canPutFlag == 1 && m_MatrixBelleInfos[i].belleID != -1 && !m_MatrixBelleInfos[i].isRecommond)
            {
                hasInMatirxBelles.Add(m_MatrixBelleInfos[i].belleID);
            }
        }

        //Debug一下数据
        LogModule.DebugLog(hasInMatirxBelles.ToString());

        //推荐不要了
//          recomonBelleDatas = GetRecommondBellesByBelleId(hasInMatirxBelles);
//
        SelectBelleList = GetSelectBelleListByBelleId();
//         //如果有美人在阵上,并且没有占满就推荐跟他有情缘关系的美人,
//         if (m_hasBattleCount > 0 && m_hasBattleCount < m_curMatrixCanPutBelles && recomonBelleDatas != null)
//         {
//             //当前阵法剩余空位
//             int remainCount = m_curMatrixCanPutBelles - m_hasBattleCount;
//
//             for (int i = 0, j = 0; i < m_MatrixBelleInfos.Length; i++)
//             {
//                 if (m_MatrixBelleInfos[i].canPutFlag == 1 && m_MatrixBelleInfos[i].belleID == -1)
//                 {
//                     if (j >= 0 && j < remainCount && j < recomonBelleDatas.Count)
//                     {
//                         RecommondBelleData _recommonBellData = recomonBelleDatas[j];
//                         if (m_hasBattleCount < m_curMatrixCanPutBelles)
//                         {
//                             m_MatrixBelleInfos[i].belleID = recomonBelleDatas[j++].BelleID;
//                             m_MatrixBelleInfos[i].isRecommond = true;
//                         }
//                     }
//                 }
//             }
//         }
//
//         //推荐的美人界面设置
//         for (int i = 0; i < m_MatrixBelleInfos.Length; i++)
//         {
//             if (m_MatrixBelleInfos[i].canPutFlag == 1 && m_MatrixBelleInfos[i].belleID != -1 && m_MatrixBelleInfos[i].isRecommond)
//             {
//                 if (BelleData.OwnedBelleMap.ContainsKey(m_MatrixBelleInfos[i].belleID))
//                 {
//                     Belle curBelle = BelleData.OwnedBelleMap[m_MatrixBelleInfos[i].belleID];
//
//                     Tab_Belle curTabBelle = TableManager.GetBelleByID(m_MatrixBelleInfos[i].belleID, 0);
//                     if (null == curTabBelle)
//                     {
//                         continue;
//                     }
//                     Tab_CommonItem commItem = TableManager.GetCommonItemByID(curTabBelle.BelleItemID, 0);
//                     if (null == commItem)
//                     {
//                         continue;
//                     }
//                     m_BelleBandBtns[i].SetIconName(commItem.Icon, true, curTabBelle.Id, i);
//                 }
//             }
//         }
        return(true);
    }
    public void SetData()
    {
        InitTab();
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

            if (null == belleTab)
            {
                //LogModule.ErrorLog("BelleInfoWindow.Instance().CurSellectedBelleData is null!");
                return;
            }

            Belle curBelleData = null;
            if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            }

            if (null == curBelleData)
            {
                return;
            }
            //名字
            m_belleName.text  = belleTab.Name;
            m_belleName.color = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);
            //战力
            curBelleData.UpdateAttrMap();
            m_battleValue.text = BelleData.GetPowerNum(curBelleData.attrMap).ToString();

            //品阶
            m_curBelleMainColor.text          = BelleData.GetBelleDescByColorLevel(curBelleData.colorLevel);
            m_curBelleMainColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(curBelleData.colorLevel);
            m_curBelleSubColor.text           = StrDictionary.GetClientDictionaryString("#{10811}", curBelleData.subLevel);
            m_curBelleMainColor.color         = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);
            m_curBelleSubColor.color          = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);

            //碎片信息
            UpdateEvalutionInfo();
            //半身像
            UnityEngine.Object belleTextureObj = ResourceManager.LoadResource(BelleData.GetBelleBigTextureName(belleTab), typeof(Texture)) as Texture;
            if (null != belleTextureObj)
            {
                m_bellePic.mainTexture = belleTextureObj as Texture;
            }

            //属性界面
            BelleAttrInfoWindow belleAttrInfoWindow = m_belleAttrWin.GetComponent <BelleAttrInfoWindow>();
            if (belleAttrInfoWindow != null)
            {
                belleAttrInfoWindow.SetBelleAttrData();
            }
            UpdateCloseState();

            SetCombatValue();

            //最大等级的一个判断
            m_EvaluBtnObj.SetActive(!curBelleData.IsMaxLevel());
            m_EvaluMaxLabel.gameObject.SetActive(curBelleData.IsMaxLevel());

            m_belleDescText.text = belleTab.Introduction;
            int count = ForeordinationHead.Length;
            for (int i = 0; i < count; ++i)
            {
                if (ForeordinationHead[i] != null)
                {
                    if (i < belleTab.getAffectionConditonValueCount())
                    {
                        int id = belleTab.GetAffectionConditonValuebyIndex(i);
                        ForeordinationHead[i].SetActive(true);
                        bool      isHas          = BelleData.OwnedBelleMap.ContainsKey(id);
                        Tab_Belle affectionbelle = TableManager.GetBelleByID(id, 0);
                        if (affectionbelle != null)
                        {
                            Tab_CommonItem cItem = TableManager.GetCommonItemByID(affectionbelle.BelleItemID, 0);
                            if (cItem != null)
                            {
                                UISprite us = ForeordinationHead[i].GetComponent <UISprite>();
                                if (us != null)
                                {
                                    us.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[cItem.Quality - 1];
                                    if (isHas)
                                    {
                                        us.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                                    }
                                    else
                                    {
                                        us.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                                    }
                                }
                                Transform tf = ForeordinationHead[i].transform.Find("Head");
                                if (tf != null)
                                {
                                    UISprite usc = tf.GetComponent <UISprite>();
                                    if (usc != null)
                                    {
                                        usc.spriteName = cItem.Icon;
                                        if (isHas)
                                        {
                                            usc.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                                        }
                                        else
                                        {
                                            usc.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        ForeordinationHead[i].SetActive(false);
                    }
                }
            }
            if (HeadTone != null)
            {
                Tab_CommonItem cItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);
                if (cItem != null)
                {
                    UISprite us = HeadTone.GetComponent <UISprite>();
                    if (us != null)
                    {
                        us.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[belleTab.Quality - 1];
                    }
                    Transform tf = HeadTone.transform.Find("Head");
                    if (tf != null)
                    {
                        UISprite us1 = tf.GetComponent <UISprite>();
                        if (us1 != null)
                        {
                            us1.spriteName = cItem.Icon;
                        }
                    }
                    tf = HeadTone.transform.Find("tone");
                    if (tf != null)
                    {
                        UISprite us2 = tf.GetComponent <UISprite>();
                        if (us2 != null)
                        {
                            us2.spriteName = BelleData.GetBelleColorPicByColorLevel(BelleData.OwnedBelleMap[belleTab.Id].colorLevel);
                        }
                    }
                }
            }
        }
    }