import Common5 from "../../Platform/th/Common5"; import User from "../../FrameWork/User/User"; import PrefabManage, { GameType } from "../PrefabManager/PrefabManage"; import ChatDialog from "./ChatDialog"; import { ryw_Event } from "../../FrameWork/Event/EventEnum"; import EventMgr from "../../FrameWork/Event/EventMgr"; const {ccclass, property} = cc._decorator; @ccclass export default class ChatManager{ //获取名字对应的json名 public static getJsonByName(personName){ for(var i=0;i -1 ){ return true }else{ return false } } public static refreshChatConfigByTimeLine(curDay){ //遍历所有配置 // let chatPeriodTab = User.getChatPeriodTab() let chatPersonConfig = Common5.chatPersonConfig //console.log(chatPersonConfig,'chatPersonConfig') for(var i=0;i 0){ // //可以出现的天数 // if(!chatPersonConfig[i].hasOwnProperty('showDay')){ // continue; // } // let showDay = chatPersonConfig[i].showDay for(var j=0;j= day ){ // this.reloadChatPersonConfig(chatPersonConfig[i].jsonName) this.setSingleChatStatus(chatPersonConfig[i].type,chatPersonConfig[i].jsonName,dayIndexStr[j],false) } } } } } //设置单个聊天的状态(生成到内存中) public static setSingleChatStatus(type,jsonName,indexStr,bFinish){ //先判断类型 if(!this.isChatTypeIncludeEventIndex(type,indexStr)){ return } if(!User.checkIsIncludeIndexStr(jsonName,indexStr)){ this.setChatRecordData(jsonName,indexStr,bFinish) console.log('Event_HasNewMsg11') EventMgr.emitEvent_custom(ryw_Event.Event_HasNewMsg,true); } } public static setChatRecordData(jsonName,indexStr,bFinish){ User.setChatRecordData(jsonName,indexStr,bFinish) } //获取特定聊天人的json public static getPersonConfig(jsonName){ return Common5.allJuQingChatConfig[jsonName] } //获取chatPerson public static getChatPerson(jsonName){ } public static getChatMsgByIndex(chatConfig, index){ for(let i=0;i= (chatPerson.showDay[i]+chatPeriodTab.curDay)){ // if((chatPerson.showDay[i]+chatPeriodTab.curDay) > saveDay){ // let firstChatId = 0 // for(var j=0;j{ prefabNode.getComponent(ChatDialog).enterDialog(jsonName,indexStr,()=>{ console.log("关闭聊天的回调") }) }) // } // ChatManager.reloadChatPersonConfig(jsonName,loadFinishCallFunc) } public static getAllChatRecordData(){ return User.getAllChatRecordData() } public static getChatRecordDataByJson(jsonName){ let recordData = this.getAllChatRecordData() return recordData[jsonName] } }