public override void Process()
        {
            if (result == END_ERROR)
            {
                return;
            }

            GameEventDispatcher.Inst.dispatchEvent(GameEventID.UI_ChapterBoxGot, boxnum);

            List <int> _temp = dropidlist.ToList <int>();

            for (int i = 0; i < _temp.Count; i++)
            {
                InnerdropTemplate _it = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(_temp[i]);
                if (_it == null)
                {
                    continue;
                }
                //新手引导先关
                if (_it.getInnerdropid() == 1211010001)
                {
                    if (_it.getObjectid() == 1400000009)
                    {
                        //新手引导相关 介绍经验结晶用途(强制)
                        if (GuideManager.GetInstance().IsContentGuideID(200501) == false)
                        {
                            GuideManager.GetInstance().ShowGuideWithIndex(200501, ShowNewGuide);
                        }
                    }
                }
            }
        }
    public void SetData(int[] innerDropIds)
    {
        ClearItems();

        //for (int i = 0, j = innerDropIds.Length; i < j;  i++)
        //{
        //    InnerdropTemplate value = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(innerDropIds[i]);
        //    if (value == null) continue;

        //    Sprite icon = DynamicItem.GetSprite(value.getObjectid());

        //    RewardViewItemUI ui = GenerateItemUI(value.getDropnum(), icon);
        //    if (ui != null)
        //    {
        //        mItemsList.Add(ui);
        //    }
        //}

        for (int i = 0, j = innerDropIds.Length; i < j; i++)
        {
            foreach (int k in DataTemplate.GetInstance().m_InnerdropTable.GetDataKeys())
            {
                InnerdropTemplate _it = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(k);

                if (_it == null)
                {
                    continue;
                }

                if (_it.getInnerdropid() == innerDropIds[i])
                {
                    //Sprite icon = DynamicItem.GetSprite(_it.getObjectid());

                    //RewardBoxItemUI ui = GenerateItemUI(_it.getDropnum(), icon);
                    //if (ui != null)
                    //{
                    //    mItemsList.Add(ui);
                    //}

                    UniversalItemCell cell = UniversalItemCell.GenerateItem(mListTrans);
                    cell.InitByID(_it.getObjectid(), _it.getDropnum());
                    if (cell != null)
                    {
                        mItemsList.Add(cell);
                    }
                }
            }
        }
    }
Beispiel #3
0
    public void SetData(int[] innerDropIds, int starNum)
    {
        ClearItems();

        for (int i = 0, j = innerDropIds.Length; i < j; i++)
        {
            foreach (int k in DataTemplate.GetInstance().m_InnerdropTable.GetDataKeys())
            {
                InnerdropTemplate _it = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(k);

                if (_it == null)
                {
                    continue;
                }

                if (_it.getInnerdropid() == innerDropIds[i])
                {
                    //Sprite icon = DynamicItem.GetSprite(_it.getObjectid());

                    //RewardBoxItemUI ui = GenerateItemUI(_it.getDropnum(), icon);
                    //if (ui != null)
                    //{
                    //    mItemsList.Add(ui);
                    //}

                    UniversalItemCell cell = UniversalItemCell.GenerateItem(mListTrans);
                    cell.InitByID(_it.getObjectid(), _it.getDropnum());
                    if (cell != null)
                    {
                        mItemsList.Add(cell);
                    }
                }
            }
        }

        mDetailTxt.ShowRichText(string.Format(GameUtils.getString("maoxianguanka7"), starNum));
    }
Beispiel #4
0
    public void Show(UI_LivenessBoxItem item)
    {
        if (item == null)
        {
            return;
        }
        itm     = item;
        itemNum = heroNum = 0;
        if (item.canOpen())
        {
            if (!item.isOpend())
            {
                mHeader.text = "奖励确认";
                mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_xuanze");
                mCloseText.text            = GameUtils.getString("common_button_receive");//领  取
            }
            else
            {
                InterfaceControler.GetInst().AddMsgBox("已领取过该奖励", this.gameObject.transform);
                return;
            }
        }
        else
        {
            mHeader.text = GameUtils.getString("activity_content1");
            mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_xuanze");
            mCloseText.text            = GameUtils.getString("common_button_close"); //关  闭
        }

        int id = DataTemplate.GetInstance().m_GameConfig.getActivitymission_reward_drop()[item.Index];

        int[] innerdropList = ((NormaldropTemplate)DataTemplate.GetInstance().m_NormaldropTable.getTableData(id)).getInnerdrop();
        Dictionary <int, IExcelBean> innerIExcel = DataTemplate.GetInstance().m_InnerdropTable.getData();

        mDropList.Clear();
        //for (int i = 0; i < innerdropList.Length; i++)
        //{
        //    Debug.Log(111);
        //    foreach (var value in innerIExcel.Values)
        //    {
        //        if (((InnerdropTemplate)value).getInnerdropid() == innerdropList[i])
        //        {
        //            mDropList.Add((InnerdropTemplate)value);

        //            int itemid = ((InnerdropTemplate)value).getObjectid();
        //            int type = itemid / 1000000;
        //            if (type == (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RUNE)
        //                itemNum++;
        //            if (type == (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_HERO)
        //                heroNum++;
        //        }
        //    }
        //}
        for (int i = 0, j = innerdropList.Length; i < j; i++)
        {
            foreach (int k in DataTemplate.GetInstance().m_InnerdropTable.GetDataKeys())
            {
                InnerdropTemplate _it = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(k);

                if (_it == null)
                {
                    continue;
                }

                if (_it.getInnerdropid() == innerdropList[i])
                {
                    mDropList.Add(_it);
                }
            }
        }
        CreatBoxItem();
    }
        //public bool isReward(int difficulttype, int rewardnum)
        //{
        //    int reward = 0;
        //    if (difficulttype == 1)
        //    {
        //        reward = rewardnum % 10;
        //    }
        //    else if (difficulttype == 2)
        //    {
        //        reward = rewardnum % 100 / 10;
        //    }
        //    else if (difficulttype == 3)
        //    {
        //        reward = rewardnum / 100;
        //    }
        //    return reward != 0;
        //}

        public void UpdateShow()
        {
            //Debug.Log(mGrid.transform.position);
            //mGrid.transform.position = new Vector3(-225.4f, -4.7f, -263.4f);
            //与服务器交互显示所得物品
            //UI_SelectFightArea sfight = UI_SelectFightArea.Inst;
            int chapterId   = ObjectSelf.GetInstance().GetCurChapterID();
            int difficultLv = ObjectSelf.GetInstance().CurChapterLevel;
            ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(chapterId);

            if (chapterT != null)
            {
                int total    = 0;
                int curstart = 0;

                StageModule.GetCurTotalStarsCount(chapterT, (EM_STAGE_DIFFICULTTYPE)difficultLv, out curstart, out total);

                if (curstart >= total)
                {
                    //TODO 宝箱弹窗
                    //if (isReward(difficultLv, sfight.iTotalCharpter[sfight.iChapterID].m_bRewardGot))
                    if (StageModule.isReward(difficultLv, ObjectSelf.GetInstance().BattleStageData.GetRewardGot(chapterId)))
                    {
                        mHeader.text = GameUtils.getString("fight_bosbox_content");
                        mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze");
                        //mCloseText.text = "关  闭";
                        mCloseText.text = GameUtils.getString("common_button_close");
                    }
                    else
                    {
                        mHeader.text = GameUtils.getString("sign_content5");
                        mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze");
                        //mCloseText.text = "领  取";
                        mCloseText.text = GameUtils.getString("common_button_receive");
                    }
                }
                else
                {
                    mHeader.text = GameUtils.getString("fight_bosbox_content");
                    mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze");
                    //mCloseText.text = "关  闭";
                    mCloseText.text = GameUtils.getString("common_button_close");
                }
                innerdropIDList.Clear();
                //int[] chapterDropList = ((ChapterinfoTemplate)DataTemplate.GetInstance().m_ChapterTable.getTableData(sfight.iChapterID)).getChapterDrop();
                //int chapterDropID = chapterDropList[difficultLv - 1];
                //int[] innerdropList = ((NormaldropTemplate)DataTemplate.GetInstance().m_NormaldropTable.getTableData(chapterDropID)).getInnerdrop();
                //Dictionary<int, IExcelBean> innerIExcel = DataTemplate.GetInstance().m_InnerdropTable.getData();
                ////List<InnerdropTemplate> innerdropIDList = new List<InnerdropTemplate>();
                //for (int i = 0; i < innerdropList.Length; i++)
                //{
                //    foreach (var item in innerIExcel.Values)
                //    {
                //        if (((InnerdropTemplate)item).getInnerdropid() == innerdropList[i])
                //        {
                //            innerdropIDList.Add((InnerdropTemplate)item);
                //        }
                //    }
                //}

                //ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(ObjectSelf.GetInstance().GetCurChapterID());
                //if (chapterT == null)
                //{
                //    LogSystem.LogManager.LogToFile("战斗奖励界面失败---ChapterinfoTemplate is NULL. id=" + chapterId);
                //    return;
                //}
                int dropId = difficultLv - 1;

                if (chapterT.getChapterDrop().Length <= 0)
                {
                    LogSystem.LogManager.LogToFile("战斗奖励界面失败---ChapterinfoTemplate 中章节掉落包数组是空的. id=" + chapterId);
                    return;
                }

                int chapterDropId          = chapterT.getChapterDrop()[dropId];
                NormaldropTemplate normalT = DataTemplate.GetInstance().GetNormaldropTemplateById(chapterDropId);
                if (normalT == null)
                {
                    LogSystem.LogManager.LogToFile("战斗奖励界面失败---ChapterinfoTemplate is NULL. id=" + chapterDropId);
                    return;
                }
                int[] innerDropList = normalT.getInnerdrop();
                for (int i = 0, j = innerDropList.Length; i < j; i++)
                {
                    foreach (int k in DataTemplate.GetInstance().m_InnerdropTable.GetDataKeys())
                    {
                        InnerdropTemplate _it = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(k);

                        if (_it == null)
                        {
                            continue;
                        }

                        if (_it.getInnerdropid() == innerDropList[i])
                        {
                            innerdropIDList.Add(k);
                        }
                    }
                }
            }
            //char[] sfightList = sfight.iTotalCharpter[sfight.iChapterID].m_bRewardGot.ToString().ToCharArray();
            else
            {
                mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze");
                //mCloseText.text = "关  闭";
                mCloseText.text = GameUtils.getString("common_button_close");
                for (int i = 0; i < UI_SacredAltar._instance.m_FallItemList.Count; i++)
                {
                    //InnerdropTemplate item = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(UI_SacredAltar._instance.m_FallItemList[i]);
                    //InnerdropTemplate item = DataTemplate.GetInstance().GetInnerdropTemplateById(UI_SacredAltar._instance.m_FallItemList[i]);
                    innerdropIDList.Add(UI_SacredAltar._instance.m_FallItemList[i]);
                }
            }

            for (int i = 0; i < innerdropIDList.Count; i++)
            {
                m_Cell = UniversalItemCell.GenerateItem(mGrid.transform);

                InnerdropTemplate value = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(innerdropIDList[i]);
                if (value == null)
                {
                    return;
                }

                int itemid = value.getObjectid();//掉落物ID
                int type   = value.getObjectid() / 1000000;
                m_Cell.AddClickListener(ShowItemPreviewUIHandler);

                switch (type)
                {
                case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RES:
                    ResourceindexTemplate _temp_res = (ResourceindexTemplate)DataTemplate.GetInstance().m_ResourceindexTemplate.getTableData(itemid);
                    if (_temp_res != null)
                    {
                        m_Cell.InitByID(itemid, value.getDropnum());
                        m_Cell.SetText(GameUtils.getString(_temp_res.getName()), "", "");
                    }
                    break;

                case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RUNE:     //符文
                {
                    ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid);
                    if (itemTable != null)
                    {
                        m_Cell.InitByID(itemid, -1);
                        m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", "");
                    }
                }
                break;

                case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_COMMON:
                {
                    ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid);
                    if (itemTable != null)
                    {
                        m_Cell.InitByID(itemid, value.getDropnum());
                        m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", "");
                    }
                }
                break;

                case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_HERO:
                {
                    HeroTemplate hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(itemid);
                    if (hero != null)
                    {
                        m_Cell.InitByID(itemid, value.getDropnum());
                        m_Cell.SetText(GameUtils.getString(hero.getTitleID()), "", "");
                    }
                }
                break;

                default:
                    break;
                }
            }
        }