Exemple #1
0
    /// <summary>
    /// 创建左侧grid
    /// </summary>
    void CreateMissionGrid(MissionPanelPageEnum pageEnum)
    {
        taskTypeList.Clear();

        List <QuestTraceInfo> taskList = null;

        List <int> list = new List <int>();

        for (int i = (int)MissionEnum.None + 1; i < (int)MissionEnum.Max; i++)
        {
            MissionEnum missionType = (MissionEnum)i;
            uint        index       = (uint)i;
            taskList = GetQuestListByType(missionType);
            if (taskList != null && taskList.Count > 0)
            {
                taskTypeList.Add(missionType);
                list.Add(taskList.Count);
            }
        }

        if (pageEnum == MissionPanelPageEnum.Page_已接)
        {
            m_scrollview_alreadyDoMission.gameObject.SetActive(true);
            m_scrollview_canDoMission.gameObject.SetActive(false);
            m_secondsTabAlreadyDoMissionCreator.CreateGrids(list);
        }
        else if (pageEnum == MissionPanelPageEnum.Page_可接)
        {
            m_scrollview_alreadyDoMission.gameObject.SetActive(false);
            m_scrollview_canDoMission.gameObject.SetActive(true);
            m_secondsTabCanDoMissionCreator.CreateGrids(list);
        }
    }
Exemple #2
0
    /// <summary>
    /// 生成宝石数据UI
    /// </summary>
    private void BuildGemDataUI()
    {
        m_emActiveGemType = GameCmd.GemType.GemType_None;
        if (null != mSecondsTabCreator)
        {
            //1、获取补一个不为空宝石类型
            GameCmd.GemType nextActiveGemType          = GameCmd.GemType.GemType_None;
            List <int>      secondTabDatas             = new List <int>();
            UISecondTabCreatorBase.SecondsTabData data = null;
            GemInlayUpdateData updateData = null;
            for (int i = 0; i < mlstCanInlayGemType.Count; i++)
            {
                updateData = GetGemInlayUpdateData(mlstCanInlayGemType[i]);
                if (null == updateData)
                {
                    continue;
                }

                secondTabDatas.Add(updateData.Count);
                if (updateData.Count != 0 &&
                    nextActiveGemType == GameCmd.GemType.GemType_None)
                {
                    nextActiveGemType = mlstCanInlayGemType[i];
                }
            }
            mSecondsTabCreator.CreateGrids(secondTabDatas);

            //2、展开当前活跃宝石列表,并生成UI
            SetActiveGemType(nextActiveGemType);
        }
    }
Exemple #3
0
    /// <summary>
    /// 创建左侧页签
    /// </summary>
    void CreateTitleGrids()
    {
        List <int> list = new List <int>();

        Dictionary <uint, List <uint> > .Enumerator enumerator = m_titleDic.GetEnumerator();
        while (enumerator.MoveNext())
        {
            list.Add(enumerator.Current.Value.Count);
        }

        m_secondsTabCreator.CreateGrids(list);
    }
Exemple #4
0
    void CreateLeftGrid()
    {
        List <int> list = new List <int>();

        Dictionary <uint, Dictionary <uint, List <uint> > > .Enumerator enumerator = m_dicGrowUp.GetEnumerator();
        while (enumerator.MoveNext())
        {
            Dictionary <uint, List <uint> > dic = enumerator.Current.Value;
            list.Add(dic.Keys.Count);
        }

        m_SecondTabCreator.CreateGrids(list);
    }
Exemple #5
0
    /// <summary>
    /// 创建左侧组队活动目标grid
    /// </summary>
    void CreateActivityGrid()
    {
        List <int> list = new List <int>();

        m_dicActivity = DataManager.Manager <TeamDataManager>().GetConvenientTeamActivityDic();
        Dictionary <uint, List <uint> > .Enumerator enumerator = m_dicActivity.GetEnumerator();
        while (enumerator.MoveNext())
        {
            list.Add(enumerator.Current.Value.Count);
        }

        m_secondsTabCreator.CreateGrids(list);

        SetStartSelectGrid(); //初始选中
    }
Exemple #6
0
    void InitWidgets()
    {
        if (null == mSecondTabCreator)
        {
            if (null != m_scrollview_TypeScrollView && null == mSecondTabCreator)
            {
                mSecondTabCreator = m_scrollview_TypeScrollView.GetComponent <UISecondTabCreatorBase>();
                if (null == mSecondTabCreator)
                {
                    mSecondTabCreator = m_scrollview_TypeScrollView.gameObject.AddComponent <UISecondTabCreatorBase>();
                }
                if (null != mSecondTabCreator)
                {
//                     GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject;
//                     GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uisecondtypegrid) as GameObject;
                    mSecondTabCreator.Initialize <UISecondTypeGrid>(m_trans_UICtrTypeGrid.gameObject, m_widget_UISecondTypeGrid.gameObject
                                                                    , OnUpdateGridData, OnUpdateSecondTabGrid, OnGridUIEventDlg);
                }
            }
        }
        if (null != mSecondTabCreator)
        {
            List <int> secondTabsNums = new List <int>();
            achieveDic = achievementManager.GetAchieveTypeData();
            if (null == mlstFirstTabIds)
            {
                mlstFirstTabIds = new List <uint>();
            }
            mlstFirstTabIds.Clear();
            if (m_uintDic == null)
            {
                m_uintDic = new Dictionary <uint, List <uint> >();
            }
            List <AchievementDataBase> temp = new List <AchievementDataBase>();
            List <uint> secIDs = new List <uint>();
            foreach (var i in achieveDic)
            {
                if (!mlstFirstTabIds.Contains(i.Key))
                {
                    mlstFirstTabIds.Add(i.Key);
                }
                secIDs.Clear();
                for (int m = 0; m < i.Value.Count; m++)
                {
                    for (int a = 0; a < i.Value.Count; a++)
                    {
                        if (m_uintDic.ContainsKey(i.Key))
                        {
                            m_uintDic[i.Key].Add(i.Value[a].childType);
                        }
                        else
                        {
                            List <uint> li = new List <uint>();
                            li.Add(i.Value[a].childType);
                            m_uintDic.Add(i.Key, li);
                        }
                    }
                }
                secondTabsNums.Add(i.Value.Count);
            }
            if (null != mSecondTabCreator)
            {
                mSecondTabCreator.CreateGrids(secondTabsNums);
            }
        }
        if (null != m_ctor_AchievementScrollView)
        {
            m_ctor_AchievementScrollView.Initialize <UIAchievemenGrid>(m_trans_UIAchievemenGrid.gameObject, OnUpdateGridData, OnGridUIEventDlg);
        }
    }
Exemple #7
0
    /// <summary>
    /// 初始化
    /// </summary>
    private void InitWidgets()
    {
        if (initWidgets)
        {
            return;
        }
        initWidgets = true;

        m_mgr = DataManager.Manager <ComposeManager>();
        Transform clone = null;

        if (null != m_trans_UIIFGTarget && null == m_targetNeedGrid)
        {
            clone = m_trans_UIIFGTarget.GetChild(0);
            if (null != clone)
            {
                m_targetNeedGrid = clone.GetComponent <UIComposeNeedGrid>();
                if (null == m_targetNeedGrid)
                {
                    m_targetNeedGrid = clone.gameObject.AddComponent <UIComposeNeedGrid>();
                }
            }
            m_targetNeedGrid.RegisterUIEventDelegate(OnGridEventDlg);
        }

        if (null != m_trans_UIIFGCost1 && null == m_costNeedGrid1)
        {
            clone = m_trans_UIIFGCost1.GetChild(0);
            if (null != clone)
            {
                Util.AddChildToTarget(m_trans_UIIFGCost1, clone);
                m_costNeedGrid1 = clone.GetComponent <UIComposeNeedGrid>();
                if (null == m_costNeedGrid1)
                {
                    m_costNeedGrid1 = clone.gameObject.AddComponent <UIComposeNeedGrid>();
                }
            }
            m_costNeedGrid1.RegisterUIEventDelegate(OnGridEventDlg);
        }

        if (null != m_trans_UIIFGCost2 && null == m_costNeedGrid2)
        {
            clone = m_trans_UIIFGCost2.GetChild(0);
            if (null != clone)
            {
                Util.AddChildToTarget(m_trans_UIIFGCost2, clone);
                m_costNeedGrid2 = clone.GetComponent <UIComposeNeedGrid>();
                if (null == m_costNeedGrid2)
                {
                    m_costNeedGrid2 = clone.gameObject.AddComponent <UIComposeNeedGrid>();
                }
            }
            m_costNeedGrid2.RegisterUIEventDelegate(OnGridEventDlg);
        }

        if (null != m_trans_UIIFGCost3 && null == m_costNeedGrid3)
        {
            clone = m_trans_UIIFGCost3.GetChild(0);
            if (null != clone)
            {
                Util.AddChildToTarget(m_trans_UIIFGCost3, clone);
                m_costNeedGrid3 = clone.GetComponent <UIComposeNeedGrid>();
                if (null == m_costNeedGrid3)
                {
                    m_costNeedGrid3 = clone.gameObject.AddComponent <UIComposeNeedGrid>();
                }
            }
            m_costNeedGrid3.RegisterUIEventDelegate(OnGridEventDlg);
        }

        if (null != m_trans_UIIFGCost4 && null == m_costNeedGrid4)
        {
            clone = m_trans_UIIFGCost4.GetChild(0);
            if (null != clone)
            {
                Util.AddChildToTarget(m_trans_UIIFGCost4, clone);
                m_costNeedGrid4 = clone.GetComponent <UIComposeNeedGrid>();
                if (null == m_costNeedGrid4)
                {
                    m_costNeedGrid4 = clone.gameObject.AddComponent <UIComposeNeedGrid>();
                }
            }
            m_costNeedGrid4.RegisterUIEventDelegate(OnGridEventDlg);
        }

        if (null != m_trans_UIIFGCost5 && null == m_costNeedGrid5)
        {
            clone = m_trans_UIIFGCost5.GetChild(0);
            if (null != clone)
            {
                Util.AddChildToTarget(m_trans_UIIFGCost5, clone);
                m_costNeedGrid5 = clone.GetComponent <UIComposeNeedGrid>();
                if (null == m_costNeedGrid5)
                {
                    m_costNeedGrid5 = clone.gameObject.AddComponent <UIComposeNeedGrid>();
                }
            }
            m_costNeedGrid5.RegisterUIEventDelegate(OnGridEventDlg);
        }

        if (null != m_trans_SingleCompoundCurrency && null == m_composeSingleC)
        {
            m_composeSingleC = m_trans_SingleCompoundCurrency.GetComponent <UICurrencyGrid>();
            if (null == m_composeSingleC)
            {
                m_composeSingleC = m_trans_SingleCompoundCurrency.gameObject.AddComponent <UICurrencyGrid>();
            }
        }
        if (null != m_trans_CompoundAllCurrency && null == m_composeAllC)
        {
            m_composeAllC = m_trans_CompoundAllCurrency.GetComponent <UICurrencyGrid>();
            if (null == m_composeAllC)
            {
                m_composeAllC = m_trans_CompoundAllCurrency.gameObject.AddComponent <UICurrencyGrid>();
            }
        }


        //构建1级2级分类页签
        if (null != m_scrollview_TypeScrollView && null == mSecondTabCreator)
        {
            mSecondTabCreator = m_scrollview_TypeScrollView.GetComponent <UISecondTabCreatorBase>();
            if (null != mSecondTabCreator)
            {
                GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject;
                GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uisecondtypegrid) as GameObject;
                mSecondTabCreator.Initialize <UISecondTypeGrid>(cloneFTemp, cloneSTemp
                                                                , OnGridUpdate, OnUpdateSecondTabGrid, OnGridEventDlg);
            }
        }

        if (null == mlstFirstTabIds)
        {
            mlstFirstTabIds = new List <uint>();
        }
        mlstFirstTabIds.Clear();

        List <CategoryTypeData> firstTabDatas = new List <CategoryTypeData>();

        firstTabDatas = m_mgr.GetCategoryTypeDatasByFirstType();
        if (null == firstTabDatas ||
            firstTabDatas.Count == 0)
        {
            Engine.Utility.Log.Error("ComposePanel InitWidgets Error,get cateoryTypeData null");
            return;
        }

        firstTabDatas.Sort((left, right) =>
        {
            return((int)left.m_uint_categoryId - (int)right.m_uint_categoryId);
        });
        List <int>       secondTabsNums = new List <int>();
        CategoryTypeData ctData         = null;
        int num = 0;

        for (int i = 0; i < firstTabDatas.Count; i++)
        {
            ctData = firstTabDatas[i];
            num    = (null != ctData) ? ctData.Count : 0;
            secondTabsNums.Add(num);
            if (!mlstFirstTabIds.Contains(firstTabDatas[i].m_uint_categoryId))
            {
                mlstFirstTabIds.Add(firstTabDatas[i].m_uint_categoryId);
            }
        }

        if (null != mSecondTabCreator)
        {
            mSecondTabCreator.CreateGrids(secondTabsNums);
        }

        SetSelectFirstType(0, true);
        UpdateCanComposeRedPoint();
    }
Exemple #8
0
    protected override void OnLoading()
    {
        base.OnLoading();
        List <BibleDataBase> list = GameTableManager.Instance.GetTableList <BibleDataBase>();

        for (int i = 0; i < list.Count; i++)
        {
            if (!bibleDic.ContainsKey(list[i].firID))
            {
                temp = new List <BibleDataBase>();
                temp.Add(list[i]);
                bibleDic.Add(list[i].firID, temp);
            }
            else
            {
                bibleDic[list[i].firID].Add(list[i]);
            }
        }
        if (m_scrollview_TypeScrollView != null)
        {
            if (mSecondTabCreator == null)
            {
                mSecondTabCreator = m_scrollview_TypeScrollView.gameObject.AddComponent <UISecondTabCreatorBase>();
            }
            if (null != mSecondTabCreator)
            {
//                 GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject;
//                 GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uisecondtypegrid) as GameObject;
                mSecondTabCreator.Initialize <UISecondTypeGrid>(m_trans_UICtrTypeGrid.gameObject, m_widget_UISecondTypeGrid.gameObject
                                                                , onUpdateGrid, OnUpdateSecondTabGrid, OnGridUIEvent);
            }
            List <int> secondTabsNums = new List <int>();
            if (null == mlstFirstTabIds)
            {
                mlstFirstTabIds = new List <uint>();
            }
            if (m_dic == null)
            {
                m_dic = new Dictionary <uint, List <uint> >();
            }
            mlstFirstTabIds.Clear();
            m_dic.Clear();
            foreach (var i in bibleDic)
            {
                mlstFirstTabIds.Add(i.Key);
                secondTabsNums.Add(i.Value.Count);
                for (int a = 0; a < i.Value.Count; a++)
                {
                    if (m_dic.ContainsKey(i.Key))
                    {
                        m_dic[i.Key].Add(i.Value[a].secID);
                    }
                    else
                    {
                        List <uint> li = new List <uint>();
                        li.Add(i.Value[a].secID);
                        m_dic.Add(i.Key, li);
                    }
                }
            }
            if (null != mSecondTabCreator)
            {
                mSecondTabCreator.CreateGrids(secondTabsNums);
            }
        }
        ParseFromFile();
    }
Exemple #9
0
    protected override void OnLoading()
    {
        base.OnLoading();
        stRequestOrderListRelationUserCmd_C cmd = new stRequestOrderListRelationUserCmd_C();
        OrderListType xx = (OrderListType)Enum.Parse(typeof(OrderListType), "OrderListType_Level");

        cmd.type = xx;
        NetService.Instance.Send(cmd);
        Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.RANKDATAREFRESH, EventCallBack);
        rankDic = DataManager.Manager <RankManager>().GetRankDataByFirstType();
        //GameObject obj = UIManager.GetResGameObj(GridID.Uirankgrid) as GameObject;
        if (m_ctor_RankScroll != null)
        {
            m_ctor_RankScroll.RefreshCheck();
            m_ctor_RankScroll.Initialize <UIRankGrid>(m_trans_UIRankGrid.gameObject, OnRankGridDataUpdate, OnRankGridUIEvent);
        }
        if (mSecondTabCreator == null)
        {
            if (null != m_scrollview_TypeScrollView && null == mSecondTabCreator)
            {
                mSecondTabCreator = m_scrollview_TypeScrollView.GetComponent <UISecondTabCreatorBase>();
                if (null == mSecondTabCreator)
                {
                    mSecondTabCreator = m_scrollview_TypeScrollView.gameObject.AddComponent <UISecondTabCreatorBase>();
                }
                if (null != mSecondTabCreator)
                {
//                     GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject;
//                     GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uisecondtypegrid) as GameObject;
                    mSecondTabCreator.Initialize <UISecondTypeGrid>(m_trans_UICtrTypeGrid.gameObject, m_widget_UISecondTypeGrid.gameObject
                                                                    , OnRankGridDataUpdate, OnUpdateSecondTabGrid, OnRankGridUIEvent);
                }
            }
        }
        List <int> secondTabsNums = new List <int>();

        if (null == mlstFirstTabIds)
        {
            mlstFirstTabIds = new List <uint>();
        }
        if (m_dic == null)
        {
            m_dic = new Dictionary <uint, List <uint> >();
        }
        mlstFirstTabIds.Clear();
        m_dic.Clear();
        foreach (var i in rankDic)
        {
            mlstFirstTabIds.Add(i.Key);
            secondTabsNums.Add(i.Value.Count);
            for (int a = 0; a < i.Value.Count; a++)
            {
                if (m_dic.ContainsKey(i.Key))
                {
                    m_dic[i.Key].Add(i.Value[a].childID);
                }
                else
                {
                    List <uint> li = new List <uint>();
                    li.Add(i.Value[a].childID);
                    m_dic.Add(i.Key, li);
                }
            }
        }
        if (null != mSecondTabCreator)
        {
            mSecondTabCreator.CreateGrids(secondTabsNums);
        }
    }