Exemple #1
0
 bool SpecialDialog(Obj_NPC obj)
 {
     if (obj && (obj.BaseAttr.RoleBaseID == GlobeVar.MARRY_NPCID ||
                 obj.BaseAttr.RoleBaseID == GlobeVar.DIVORCE_NPCID ||
                 obj.BaseAttr.RoleBaseID == GlobeVar.PARADE_NPCID)
         )
     {
         MarryRootLogic.ShowMarryDialogUI(obj.BaseAttr.RoleBaseID);
         return(true);
     }
     //如果开关关闭,奖励NPC就按照普通NPC一样对话
     if (obj && obj.BaseAttr.RoleBaseID == GlobeVar.AWARD_NPCID)
     {
         if (!GameManager.gameManager.PlayerDataPool.IsServerFlagOpen(SERVER_FLAGS_ENUM.FLAG_CYFANS))
         {
             return(false);
         }
     }
     //显示带选项的对话框(可选)
     if (obj.DefaultDialogID != -1)
     {
         Tab_NpcDialog _npcDialogInfo = TableManager.GetNpcDialogByID(obj.DefaultDialogID, 0);
         if (_npcDialogInfo != null && _npcDialogInfo.OptionDialogId != -1)
         {
             OptionDialogLogic.ShowOptionDialogUI(obj.DefaultDialogID);
             return(true);
         }
         else
         {
             //LogModule.ErrorLog("Can not find npcDialogInfo: {0} or OptionDialogId == -1", obj.DefaultDialogID);
         }
     }
     return(false);
 }
 void DoShowOptionDialog(int nDialogId)
 {
     CleanUp();
     m_NpcDialogInfo = TableManager.GetNpcDialogByID(nDialogId, 0);
     if (m_NpcDialogInfo != null)
     {
         m_curOptionDialogId = m_NpcDialogInfo.OptionDialogId;
         UpdateNPCInfo();
         UpdateButtons();
     }
 }
 void CleanUp()
 {
     m_NpcDialogInfo = null;
     m_NPCHead.gameObject.SetActive(false);
     m_NPCName.text = "";
     m_NPCTalk.text = "";
     m_Button1.SetActive(false);
     m_Button2.SetActive(false);
     m_Button1Text.text  = "";
     m_Button2Text.text  = "";
     m_curOptionDialogId = -1;
 }
Exemple #4
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);
    }
Exemple #5
0
    void UpdateNPCInfo()
    {
        Obj_NPC TargetNpc = Singleton <DialogCore> .GetInstance().CareNPC;

        if (TargetNpc != null)
        {
            if (TargetNpc.ModelID >= 0)
            {
                Tab_RoleBaseAttr roleBase = TableManager.GetRoleBaseAttrByID(TargetNpc.BaseAttr.RoleBaseID, 0);
                if (roleBase != null)
                {
                    Tab_CharModel charModel = TableManager.GetCharModelByID(TargetNpc.ModelID, 0);
                    if (charModel != null && m_NPCHead && m_NPCName)
                    {
                        m_NPCName.text = roleBase.Name;
                        Texture curTexture = ResourceManager.LoadResource("Texture/MissionRole/" + charModel.NPCSpriteName, typeof(Texture)) as Texture;
                        if (null != curTexture)
                        {
                            m_NPCHead.gameObject.SetActive(true);
                            m_NPCHead.mainTexture = curTexture;
                        }
                        else
                        {
                            m_NPCHead.gameObject.SetActive(false);
                        }
                    }
                }
            }
            Tab_NpcDialog DialogLine = TableManager.GetNpcDialogByID(TargetNpc.DefaultDialogID, 0);
            if (DialogLine != null)
            {
                if (m_NPCTalk)
                {
                    m_NPCTalk.text = StrDictionary.GetClientString_WithNameSex(DialogLine.Dialog);
                }
            }
        }
    }
Exemple #6
0
        public void AddDialogMission()
        {
            Tab_RoleBaseAttr RoleBase = TableManager.GetRoleBaseAttrByID(BaseAttr.RoleBaseID, 0);

            if (RoleBase == null)
            {
                return;
            }

            Tab_NpcDialog DialogLine = TableManager.GetNpcDialogByID(RoleBase.DialogID, 0);

            if (DialogLine != null)
            {
                m_nDefaultDialogID = RoleBase.DialogID;
                for (int i = 0; i < DialogLine.getMissionIDCount(); ++i)
                {
                    int nMissionID = DialogLine.GetMissionIDbyIndex(i);
                    if (nMissionID >= 0)
                    {
                        m_listMissionID.Add(nMissionID);
                    }
                }
            }
        }