Esempio n. 1
0
    void DoShowNPCDialog(int nDialogID)
    {
        // 先清理
        CleanUp();

        Tab_NpcDialog DialogLine = TableManager.GetNpcDialogByID(nDialogID, 0);

        if (DialogLine != null)
        {
            m_MissionInfoAward.SetActive(false);
            m_AcceptButton.SetActive(false);
            m_CompleteButton.SetActive(false);
            m_NoAcceptButton.SetActive(false);


            UIManager.CloseUI(UIInfo.MissionInfoController);
            StoryDialogLogic.ShowMissionStory(StrDictionary.GetClientString_WithNameSex(DialogLine.Dialog), true, true);
        }

        GameManager.gameManager.SoundManager.PlaySoundEffect(128);
    }
Esempio n. 2
0
    // 接任务和交任务UI
    public void MissionUI(int nMissionID, MissionUIType type)
    {
        // 先清理
        CleanUp();

        if (nMissionID < 0)
        {
            LogModule.ErrorLog("MissionID: {0} can not less then 0", nMissionID);
            return;
        }
        m_CurMissionID = nMissionID;
        Tab_MissionDictionary MDLine = TableManager.GetMissionDictionaryByID(nMissionID, 0);

        if (MDLine == null)
        {
            LogModule.ErrorLog("Can not find MissionDictionary {0}", nMissionID);
            return;
        }

        m_MissionType = type;
        if (type == MissionUIType.TYPE_ACCETP)
        {
            m_AcceptButton.SetActive(true);
            m_CompleteButton.SetActive(false);
            m_MissionInfoAward.SetActive(true);

            StoryDialogLogic.ShowMissionStory(StrDictionary.GetClientString_WithNameSex(MDLine.MissionDesc), false, false);

            m_CurTalkID = MDLine.AcceptTalkID;
            GameManager.gameManager.SoundManager.PlaySoundEffect(m_CurTalkID);
        }
        else if (type == MissionUIType.TYPE_COMPLETE)
        {
            m_AcceptButton.SetActive(false);
            m_CompleteButton.SetActive(true);
            m_MissionInfoAward.SetActive(true);

            StoryDialogLogic.ShowMissionStory(StrDictionary.GetClientString_WithNameSex(MDLine.MissionDoneDesc), false, false);
        }

        Tab_MissionBase misLine = TableManager.GetMissionBaseByID(nMissionID, 0);

        if (misLine == null)
        {
            LogModule.ErrorLog("Can not find missionBase {0}", nMissionID);
            return;
        }

        if (misLine.MissionType == (int)MISSIONTYPE.MISSION_BRANCH && type == MissionUIType.TYPE_ACCETP)
        {
            m_NoAcceptButton.SetActive(true);
        }
        else
        {
            m_NoAcceptButton.SetActive(false);
        }

        if (misLine.BonusID > -1)
        {
            //显示奖励内容
            Tab_MissionBonus bonusTab = TableManager.GetMissionBonusByID(misLine.BonusID, 0);
            if (bonusTab == null)
            {
                LogModule.ErrorLog("Can not find missionBonus {0}", misLine.BonusID);
            }
            else
            {
                // 最多一共7个奖励 按顺序显示 物品(最多4个) 玩家经验 宠物经验 金钱

                int currentAwardItemIdx = 0;

                // 物品
                if (bonusTab.getToolIDCount() > 0)
                {
                    for (int i = 0; i < bonusTab.getToolIDCount(); i++)
                    {
                        Tab_CommonItem commonItem = TableManager.GetCommonItemByID(bonusTab.GetToolIDbyIndex(i), 0);
                        if (commonItem != null && bonusTab.GetToolNumbyIndex(i) > 0 && currentAwardItemIdx < m_MissionBonusItemSlot.Length)
                        {
                            int nItemCount = bonusTab.GetToolNumbyIndex(i);
                            m_MissionBonusItemSlot[currentAwardItemIdx].gameObject.SetActive(true);
                            m_MissionBonusItemSlot[currentAwardItemIdx].InitInfo_Item(commonItem.Id, ItemSlotLogic.OnClickOpenTips, nItemCount > 1 ? nItemCount.ToString() : "", nItemCount > 1);
                            currentAwardItemIdx += 1;
                        }
                    }
                }

                // 玩家经验
                if (bonusTab.Exp > 0 && currentAwardItemIdx < m_MissionBonusItemSlot.Length)
                {
                    m_MissionBonusItemSlot[currentAwardItemIdx].gameObject.SetActive(true);
                    m_MissionBonusItemSlot[currentAwardItemIdx].InitInfo_PlayerExp(bonusTab.Exp.ToString());
                    currentAwardItemIdx += 1;
                }

                // 宠物经验
                if (bonusTab.FellowExp > 0 && currentAwardItemIdx < m_MissionBonusItemSlot.Length)
                {
                    m_MissionBonusItemSlot[currentAwardItemIdx].gameObject.SetActive(true);
                    m_MissionBonusItemSlot[currentAwardItemIdx].InitInfo_FellowExp(bonusTab.FellowExp.ToString());
                    currentAwardItemIdx += 1;
                }

                // 金钱 金币和绑定点券 一般不会共存
                if (bonusTab.Money > 0 && currentAwardItemIdx < m_MissionBonusItemSlot.Length)
                {
                    m_MissionBonusItemSlot[currentAwardItemIdx].gameObject.SetActive(true);
                    m_MissionBonusItemSlot[currentAwardItemIdx].InitInfo_Coin(null, bonusTab.Money.ToString(), true);
                    currentAwardItemIdx += 1;
                }
                if (bonusTab.BindYuanBao > 0 && currentAwardItemIdx < m_MissionBonusItemSlot.Length)
                {
                    m_MissionBonusItemSlot[currentAwardItemIdx].gameObject.SetActive(true);
                    m_MissionBonusItemSlot[currentAwardItemIdx].InitInfo_YuanbaoBind(null, bonusTab.BindYuanBao.ToString(), true);
                    currentAwardItemIdx += 1;
                }

                if (m_MissionItemGrid)
                {
                    m_MissionItemGrid.Reposition();
                }
            }
        }

        GameManager.gameManager.SoundManager.PlaySoundEffect(128);
#if BOBJOYSTICK
        RefreshJoyGUI(type);
#endif
    }