Пример #1
0
    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();
        }
    }
Пример #2
0
    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);
        }
    }
Пример #3
0
    void UpdateTickBand()
    {
        m_curTimer += Time.deltaTime;
        if (m_curTimer < 1)
        {
            return;
        }

        m_curTimer = 0;
        // 背包物品同步无法做到进化后立即获取,所以在Update里更新。
        if (GameManager.gameManager.PlayerDataPool == null)
        {
            return;
        }
        Games.Item.GameItemContainer backPack = GameManager.gameManager.PlayerDataPool.BackPack;
        if (backPack == null)
        {
            return;
        }
        //         int evoItemCount = backPack.GetItemCountByDataId(28);
        //         labelEvoItemCount.text = StrDictionary.GetClientDictionaryString("#{3231}", evoItemCount);
        UpdateButtonState();
        if (!m_btnClose.isEnabled)
        {
            Utils.SetTimeDiffToLabel(m_btnCLoseLable, BelleData.GetBelleCloseTimeDiff());
        }

        //Utils.SetTimeDiffToLabel(labelNextEvolutionTimeValue, EvolutionTimeDiff());
    }
Пример #4
0
    public void UpdateRemainNum()
    {
        int nShowNum = m_CurRemindNum;

        //nShowNum += RestaurantData.m_restaurantTipsCount;
        nShowNum += BelleData.GetBelleTipCount();
        //nShowNum += GetPartnerTipCount();
        nShowNum += SkillRootLogic.GetCanLevUpSkillCount();
        //nShowNum += GetMasterAndGuildTipCount();
        nShowNum += GetSystemLogicTipCount();         // 系统提示
        nShowNum += GetGemHoleCanOpenCount(1);        //宝石40开孔
        nShowNum += GetGemHoleCanOpenCount(2);        //宝石70开孔
        nShowNum += GetGemHoleCanOpenCount(3);        //宝石90开孔
        nShowNum += GetPartnerSkillCanLevelUpCount(); //宠物技能升级
        if (null != GameManager.gameManager.PlayerDataPool)
        {
            nShowNum += GameManager.gameManager.PlayerDataPool.m_objMountParam.MountRemindFlagCount();
        }

//
//         bool bRet = GameManager.gameManager.PlayerDataPool.CommonData.GetCommondFlag((int)USER_COMMONFLAG.CF_AUTOENHANCE_OPENFLAG);
//         GameManager.gameManager.PlayerDataPool.CommonData.AskSetCommonFlag((int)USER_COMMONFLAG.CF_AUTOENHANCE_OPENFLAG, true
        if (nShowNum > 0 && GameManager.gameManager.RunningScene != (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_FB_CABALINTRO)
        {
            m_RemindNum.SetActive(true);
            //m_RemindNumLabel.text = nShowNum.ToString();
        }
        else
        {
            m_RemindNum.SetActive(false);
        }
    }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_RET_GET_BELLE packet = (GC_RET_GET_BELLE)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            int belleId = packet.Result;

            Tab_Belle belleTab = TableManager.GetBelleByID(belleId, 0);

            if (null == belleTab)
            {
                return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
            }

            BelleData.UpdateGetBelle(packet);
            if (null != BelleInfoWindow.Instance())
            {
                BelleInfoWindow.Instance().ShowBelleInfoWindow(belleTab, true);
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Пример #6
0
    // 阵型按钮点击
    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);
    }
Пример #7
0
    void Start()
    {
        //InitTabInfo
        InitTabBtn();
        CheckNewPlayerGuide();
        BelleData.CleanBelleTip();

        UpdateNewMatrixTip();
    }
Пример #8
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_BELLE_EVOLUTION_RET packet = (GC_BELLE_EVOLUTION_RET)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            BelleData.UpdateEvolutionData(packet);
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Пример #9
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_BELLE_BATTLE_RET packet = (GC_BELLE_BATTLE_RET)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            BelleData.UpdateBattleData(packet);
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Пример #10
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_BELLE_ACTIVEMATRIX_RET packet = (GC_BELLE_ACTIVEMATRIX_RET)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            BelleData.UpdateActiveMatrixData(packet);
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Пример #11
0
    public void SetData(int type, int score, int level, bool setSlider = false)
    {
        if (Singleton <ObjManager> .Instance.MainPlayer == null)
        {
            return;
        }

        if (type > (int)BePowerData.BePowerType.BPTDEFINE_Null &&
            type < (int)BePowerData.BePowerType.BPTDEFINE_MAX)
        {
            BePowerData.BePowerType eType = (BePowerData.BePowerType)type;
            switch (eType)
            {
            case BePowerData.BePowerType.BPTDEFINE_BELLE:
                int bellCombat = BelleData.GetActiveMatrixPowerNum();
                SetLevel(eType, bellCombat, setSlider);
                break;

            case BePowerData.BePowerType.BPTDEFINE_EQUIP:
                int equipCombat = Singleton <ObjManager> .Instance.MainPlayer.GetTotalEquipCombatValue();

                SetLevel(eType, equipCombat, setSlider);
                break;

            case BePowerData.BePowerType.BPTDEFINE_FELLOW:
                int fellowCombat = Singleton <ObjManager> .Instance.MainPlayer.GetTotalFellowCombatValue();

                SetLevel(eType, fellowCombat, setSlider);
                break;

            case BePowerData.BePowerType.BPTDEFINE_GEM:
                int gemCombat = Singleton <ObjManager> .Instance.MainPlayer.GetTotalGemCombatValue();

                SetLevel(eType, gemCombat, setSlider);
                break;

            case BePowerData.BePowerType.BPTDEFINE_SKILL:
                int skillCombat = Singleton <ObjManager> .Instance.MainPlayer.GetTotalStudySkillCombatValue();

                SetLevel(eType, skillCombat, setSlider);
                break;

            case BePowerData.BePowerType.BPTDEFINE_XIAKE:
                int xkCombat = Singleton <ObjManager> .Instance.MainPlayer.GetTotalSwordsManCombat();

                SetLevel(eType, xkCombat, setSlider);
                break;

            default:
                break;
            }
        }
    }
Пример #12
0
    public void UpdateNewMatrixTip()
    {
        if (BelleData.IsAddNewMatrix())
        {
            //Debug.Log("is add matrix is true..........................................................................................................................");
        }
        else
        {
            //  Debug.Log("isnot add matrix is false..........................................................................................................................");
        }

        m_ObjNewMatrixTip.SetActive(BelleData.IsAddNewMatrix());
    }
Пример #13
0
 public void UpdateTapRedPoint()
 {
     BelleData.CalculateCreateNewBelle();
     BelleData.CalculateActiveMatrixIds();
     if (BelleCollectRedPoint != null)
     {
         BelleCollectRedPoint.SetActive(BelleData.RedPointBelleIds.Count > 0);
     }
     if (BelleBattleRedPoint != null)
     {
         int count = GetActiveMatrixCount();
         BelleBattleRedPoint.SetActive(BelleData.RedPointMatrixIds.Count > 0 && count < 2);
     }
 }
Пример #14
0
    /// <summary>
    /// Set  every belle item's data
    /// </summary>
    /// <param name="belleId"></param>
    /// <param name="tabBelle"></param>
    /// <param name="isOwn"></param>
    public void SetData(BelleInfoWindow parentWindow, int belleId, Tab_Belle tabBelle, bool isOwn)
    {
        m_parentWindow  = parentWindow;
        gameObject.name = belleId.ToString();
        if (null == tabBelle)
        {
            return;
        }
        m_belleId = belleId;
        m_isOwn   = isOwn;
        Tab_CommonItem commItem = TableManager.GetCommonItemByID(tabBelle.BelleItemID, 0);

        if (commItem != null)
        {
            m_bellePic.spriteName = commItem.Icon;
        }
        m_belleName.text               = tabBelle.Name;
        m_belleColorLevel.text         = "";
        m_belleSubLevel.text           = "";
        m_edgePic.spriteName           = "";
        m_belleMainColorPic.spriteName = "";
        if (BelleData.OwnedBelleMap.ContainsKey(belleId))
        {
            m_belleColorLevel.text         = BelleData.GetBelleDescByColorLevel(BelleData.OwnedBelleMap[belleId].colorLevel);
            m_belleMainColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(BelleData.OwnedBelleMap[belleId].colorLevel);
            m_belleSubLevel.text           = StrDictionary.GetClientDictionaryString("#{10811}", BelleData.OwnedBelleMap[belleId].subLevel);
            m_belleColorLevel.color        = BelleData.GetBelleColorByColorLevel(BelleData.OwnedBelleMap[belleId].colorLevel);
            m_belleSubLevel.color          = BelleData.GetBelleColorByColorLevel(BelleData.OwnedBelleMap[belleId].colorLevel);
            m_belleName.color    = BelleData.GetBelleColorByColorLevel(BelleData.OwnedBelleMap[belleId].colorLevel);
            m_edgePic.spriteName = BelleData.GetBelleColorNameByColorLevel(BelleData.OwnedBelleMap[belleId].colorLevel);
        }


        m_bellePic.gameObject.SetActive(isOwn);

        //设置当前状态
        ShowCurBelleData(isOwn);

        SetCurBelleItemProcessBar(belleId, tabBelle, isOwn);
        m_curTabBelle = tabBelle;
        m_isOwn       = isOwn;

        //Lock
        m_lockObj.SetActive(!isOwn);

        //更新红点提示
        UpdateRedTipState();
    }
Пример #15
0
    //获取当前可以显示的美人列表,当前阵上的那个美人单独处理
    public List <SelectBelleData> GetSelectBelleListByBelleId()
    {
        List <SelectBelleData> selectBelleDataList = new List <SelectBelleData>();

        foreach (int belleId in TableManager.GetBelle().Keys)
        {
            if (BelleData.OwnedBelleMap.ContainsKey(belleId))
            {
                SelectBelleData selectBelleData = new SelectBelleData();
                selectBelleData.CleanUp();
                selectBelleData.belleID  = belleId;
                selectBelleData.matrixId = BelleData.OwnedBelleMap[belleId].matrixID;
                BelleData.OwnedBelleMap[belleId].UpdateAttrMap();
                selectBelleData.combatValue = BelleData.GetPowerNum(BelleData.OwnedBelleMap[belleId].attrMap);
                bool isAdd = true;
                for (int i = 0; i < hasInMatirxBelles.Count; i++)
                {
                    //已经在当前阵上上阵的就不添加了。
                    if (hasInMatirxBelles[i] == belleId)
                    {
                        isAdd = false;
                    }
                    //羁绊关系添加
                    Tab_Belle _belleTab = TableManager.GetBelleByID(hasInMatirxBelles[i], 0);
                    if (null != _belleTab)
                    {
                        for (int j = 0; j < _belleTab.getAffectionConditonTypeCount(); j++)
                        {
                            if (BELLE_AFFECTION_TYPE == _belleTab.GetAffectionConditonTypebyIndex(j))
                            {
                                int belleIdRelation = _belleTab.GetAffectionConditonValuebyIndex(j);
                                if (belleIdRelation == belleId)
                                {
                                    selectBelleData.isRelationship = true;
                                }
                            }
                        }
                    }
                }
                if (isAdd)
                {
                    selectBelleDataList.Add(selectBelleData);
                }
            }
        }
        selectBelleDataList.Sort();
        return(selectBelleDataList);
    }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_BELLE_CLOSE_RET packet = (GC_BELLE_CLOSE_RET)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            BelleData.UpdateCloseData(packet);
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (_mainPlayer != null)
            {
                _mainPlayer.UpdateBelleShowDelay();
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Пример #17
0
    public void UpdateData()
    {
        if (m_curTabBelle == null)
        {
            return;
        }
        Tab_CommonItem commItem = TableManager.GetCommonItemByID(m_curTabBelle.BelleItemID, 0);

        if (commItem != null)
        {
            m_bellePic.spriteName = commItem.Icon;
        }
        m_belleName.text       = m_curTabBelle.Name;
        m_belleColorLevel.text = "";
        m_belleSubLevel.text   = "";

        bool isOwn = false;

        m_edgePic.spriteName           = "";
        m_belleMainColorPic.spriteName = "";
        if (BelleData.OwnedBelleMap.ContainsKey(m_belleId))
        {
            m_belleColorLevel.text         = BelleData.GetBelleDescByColorLevel(BelleData.OwnedBelleMap[m_belleId].colorLevel);
            m_belleMainColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(BelleData.OwnedBelleMap[m_belleId].colorLevel);
            m_belleSubLevel.text           = StrDictionary.GetClientDictionaryString("#{10811}", BelleData.OwnedBelleMap[m_belleId].subLevel);
            m_belleColorLevel.color        = BelleData.GetBelleColorByColorLevel(BelleData.OwnedBelleMap[m_belleId].colorLevel);
            m_belleSubLevel.color          = BelleData.GetBelleColorByColorLevel(BelleData.OwnedBelleMap[m_belleId].colorLevel);
            m_belleName.color    = BelleData.GetBelleColorByColorLevel(BelleData.OwnedBelleMap[m_belleId].colorLevel);
            isOwn                = true;
            m_edgePic.spriteName = BelleData.GetBelleColorNameByColorLevel(BelleData.OwnedBelleMap[m_belleId].colorLevel);
        }

        m_bellePic.gameObject.SetActive(isOwn);

        //设置当前状态
        ShowCurBelleData(isOwn);

        SetCurBelleItemProcessBar(m_belleId, m_curTabBelle, isOwn);


        //Lock
        m_lockObj.SetActive(!isOwn);

        //红点提示
        UpdateRedTipState();
    }
Пример #18
0
    public List <SelectBelleData> GetSelectBellelistByBelleIds(List <int> belleIds)
    {
        List <SelectBelleData> selectBelleDataList = new List <SelectBelleData>();

        if (belleIds == null && belleIds.Count == 0)
        {
            return(selectBelleDataList);
        }
        foreach (int belleId in TableManager.GetBelle().Keys)
        {
            if (BelleData.OwnedBelleMap.ContainsKey(belleId))
            {
                SelectBelleData selectBelleData = new SelectBelleData();
                selectBelleData.CleanUp();
                selectBelleData.belleID     = belleId;
                selectBelleData.matrixId    = BelleData.OwnedBelleMap[belleId].matrixID;
                selectBelleData.combatValue = BelleData.GetPowerNum(BelleData.OwnedBelleMap[belleId].attrMap);
                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 belleIdRelation = _belleTab.GetAffectionConditonValuebyIndex(j);
                                if (belleIdRelation == belleId)
                                {
                                    selectBelleData.isRelationship = true;
                                }
                            }
                        }
                    }
                }

                selectBelleDataList.Add(selectBelleData);
            }
        }
        selectBelleDataList.Sort();
        return(selectBelleDataList);
    }
Пример #19
0
    /// <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);
    }
    bool ShowBelle(int belleId)
    {
        //背景半身像
        Tab_Belle belle = TableManager.GetBelleByID(belleId, 0);

        if (belle == null)
        {
            return(false);
        }
        Texture belleTextureObj = ResourceManager.LoadResource(BelleData.GetBelleBigTextureName(belle), typeof(Texture)) as Texture;

        if (null != belleTextureObj)
        {
            m_bgTexture.mainTexture = belleTextureObj;
            //m_bgTexture.color = m_disAbleBelleTextTure;
            m_bgTexture.gameObject.SetActive(false);
            //刷新一下,否则这个m_bgTexture不显示
            StartCoroutine(DelayRefreshTexture());
        }
        return(false);
    }
Пример #21
0
    public void UpdateCloseState()
    {
        m_curTimer = 1;
        //小红点更新
        objBelleCloseTip.gameObject.SetActive(BelleData.IsCanCloseFree());
        UpdateTickBand();
        UpdateCloseTimeLabel();
        UpdateCloseProcessBar();
        BelleAttrInfoWindow belleAttrInfoWindow = m_belleAttrWin.GetComponent <BelleAttrInfoWindow>();

        if (belleAttrInfoWindow != null)
        {
            belleAttrInfoWindow.SetBelleAttrData();
        }

        //单个条目红点的更新
        if (BelleInfoWindow.Instance() != null)
        {
            BelleInfoWindow.Instance().UpdateCloseRedTipState();
        }
    }
Пример #22
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);
        }
    }
Пример #23
0
    public void UpdateBelleTip()
    {
        if (m_BelleCountTip == null || !gameObject.activeInHierarchy)
        {
            return;
        }
        if (BelleData.CalculateActiveMatrixIds().Count == 0 && BelleData.CalculateCreateNewBelle().Count == 0)
        {
            m_BelleCountTip.gameObject.SetActive(false);
        }
        else
        {
            m_BelleCountTip.gameObject.SetActive(true);
        }
//         if (BelleData.GetBelleTipCount() > 0)
//         {
//             m_BelleCountTip.gameObject.SetActive(true);
//         }
//         else
//         {
//             m_BelleCountTip.gameObject.SetActive(false);
//         }
    }
Пример #24
0
    void UpdateButtonState()
    {
        m_btnClose.isEnabled = BelleData.GetBelleCloseTimeDiff() <= 0 && BelleData.dayCloseTime < m_maxCloseTime;
        if (m_btnClose.isEnabled)
        {
            m_btnCLoseLable.text = StrDictionary.GetClientDictionaryString("#{3404}");
        }
        else
        {
            m_btnCLoseLable.text = TIME_FORMAT;
        }

        if (BelleData.GetBelleCloseTimeDiff() <= 0 && BelleData.dayCloseTime >= m_maxCloseTime)
        {
            m_btnCLoseLable.text = StrDictionary.GetClientDictionaryString("#{3404}");
        }

        //         if (null != m_curBelleData)
        //         {
        //             Tab_BelleLevelup curTabBelleLevel = TableManager.GetBelleLevelupByID(m_curBelleData.orgLevel, 0);
        //             btnEvolution.isEnabled = curTabBelleLevel != null;
        //         }
    }
Пример #25
0
 private void SetItemInfo(Tab_Belle tb, GameObject go, bool ishasbelle)
 {
     if (go != null && tb != null)
     {
         //if (ishasbelle) {
         UIEventListener.Get(go).onClick += ItemClick;
         //}
         UISprite usbg = go.transform.GetComponent <UISprite>();
         if (usbg != null)
         {
             if (ishasbelle)
             {
                 usbg.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
             }
             else
             {
                 usbg.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
             }
         }
         Transform tf = go.transform.Find("labelName");
         if (tf != null)
         {
             UILabel ul = tf.GetComponent <UILabel>();
             if (ul != null)
             {
                 if (ishasbelle)
                 {
                     ul.text = "[62FE9C]" + tb.Name + "[-]";
                 }
                 else
                 {
                     ul.text = tb.Name;
                 }
             }
         }
         Tab_CommonItem cItem = TableManager.GetCommonItemByID(tb.BelleItemID, 0);
         if (cItem != null)
         {
             tf = go.transform.Find("ItemIcon");
             if (tf != null)
             {
                 UISprite us = tf.GetComponent <UISprite>();
                 if (us != null)
                 {
                     us.spriteName = cItem.Icon;
                     if (ishasbelle)
                     {
                         us.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                     }
                     else
                     {
                         us.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                     }
                 }
             }
         }
         tf = go.transform.Find("QualitySprite");
         if (tf != null)
         {
             UISprite us = tf.GetComponent <UISprite>();
             if (us != null)
             {
                 if (ishasbelle)
                 {
                     us.color      = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                     us.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[BelleData.OwnedBelleMap[tb.Id].colorLevel - 1];//BelleData.GetBelleColorPicByColorLevel(BelleData.OwnedBelleMap[tb.Id].colorLevel);
                 }
                 else
                 {
                     us.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                 }
             }
         }
         tf = go.transform.Find("level");
         if (tf != null)
         {
             UISprite us = tf.GetComponent <UISprite>();
             if (us != null)
             {
                 if (ishasbelle)
                 {
                     us.color      = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                     us.spriteName = BelleData.GetBelleColorPicByColorLevel(BelleData.OwnedBelleMap[tb.Id].colorLevel);
                 }
                 else
                 {
                     us.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                 }
             }
         }
         tf = go.transform.Find("levelnum");
         if (tf != null)
         {
             UILabel ul = tf.GetComponent <UILabel>();
             if (ul != null)
             {
                 if (ishasbelle)
                 {
                     ul.text = "+" + BelleData.OwnedBelleMap[tb.Id].subLevel;
                 }
                 else
                 {
                     ul.text = "";
                 }
             }
         }
     }
 }
Пример #26
0
    /// <summary>
    /// 设置未获取界面数据
    /// </summary>
    public void SetUnOwnBelleInfo()
    {
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

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

            //背景半身像
            UnityEngine.Object belleTextureObj = ResourceManager.LoadResource(BelleData.GetBelleBigTextureName(belleTab), typeof(Texture)) as Texture;
            if (null != belleTextureObj)
            {
                m_belleTextTure.mainTexture = belleTextureObj as Texture;
                m_belleTextTure.color       = m_disAbleBelleTextTure;
            }

            //描述信息
            m_belleDesc.text = belleTab.Introduction;

            //美人小图标
            Tab_CommonItem commItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);
            if (commItem != null)
            {
                m_belleIcon.spriteName = commItem.Icon;
            }

            //美人合成需要的碎片个数
            int belleSubItemId     = belleTab.BelleItemID;
            int belleTotalSubCount = belleTab.BelleItemCount;
            int belleSubItemCount  = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(belleSubItemId);

            m_belleCurCount.text = belleSubItemCount.ToString() + "/" + belleTotalSubCount.ToString();
            /*  m_belleTotalCount.text = belleTotalSubCount.ToString();*/

            belleTotalSubCount      = belleTotalSubCount <= 0 ? 1 : belleTotalSubCount;
            m_processBar.fillAmount = (float)(belleSubItemCount * 1.0 / belleTotalSubCount);

            //按钮文字
            string itemStr = "#{10259}";

            m_redGetBelle.SetActive(false);
            //可合成的提示
            if (belleTotalSubCount > 0 && belleTotalSubCount <= belleSubItemCount)
            {
                itemStr = "#{10260}";
                m_redGetBelle.SetActive(true);
            }
            m_getBelleItemBtn.text = StrDictionary.GetClientDictionaryString(itemStr);

            //属性信息
            for (int i = 0; i < belleTab.getAttrTypeCount(); i++)
            {
                // labelNextAttrValue.text = StrDictionary.GetClientDictionaryString("#{3084}", nextValueAdd, Utils.GetAttrTypeString(curTabBelle.GetAttrTypebyIndex(i)));
                m_AttrTypes[i].text   = Utils.GetAttrTypeString(belleTab.GetAttrTypebyIndex(i));
                m_AttrValues[i].text  = "+" + belleTab.GetAttrValuebyIndex(i);
                m_AttrTypes[i].color  = m_ColorDisable;
                m_AttrValues[i].color = m_ColorDisable;
            }

            if (m_getBelleItemWin != null)
            {
                m_getBelleItemWin.SetActive(false);
            }
        }
    }
    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;
                }
            }
        }
    }
Пример #28
0
    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();
    }
Пример #29
0
 public void UpdateCloseRedTip()
 {
     m_redCloseTipObj.SetActive(BelleData.IsCanCloseFree() && m_isOwn);
 }
    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;
        }
    }