Beispiel #1
0
    public void AddFriend(int id)
    {
        XMLSaver.saveData.instanceID.Add(GetPairID(curUserId, id));
        ChatInstanceData data = new ChatInstanceData();

        data.lastChatTimeStamp = GameManager.Instance.time;
        XMLSaver.saveData.instanceData.Add(data);
        OnFriendsLstChange();
    }
Beispiel #2
0
    //
    public void AddFriend(string name)
    {
        pairId2Instance.Add(GetPairID(curName, name), new ChatInstance());
        XMLSaver.saveData.instanceID.Add(GetPairID(curName, name));
        ChatInstanceData data = new ChatInstanceData();

        data.curNodeId         = 0;
        data.curSectionId      = 0;
        data.lastChatTimeStamp = GameManager.Instance.time;
        XMLSaver.saveData.instanceData.Add(data);
        OnExit();
        OnEnter(curName);
    }
Beispiel #3
0
    public void OnInit(int friendId)
    {
        ChatManager.Instance.curExecuteInstance = this;
        int pairId = ChatManager.Instance.GetPairID(curUserId, friendId);

        this.friendId     = friendId;
        this.friendData   = XMLSaver.saveData.GetAccountData(friendId);
        this.friendName   = friendData.enname;
        curPairID         = pairId;
        saveData          = XMLSaver.saveData.GetInstanceData(curPairID);
        lastChatTimeStamp = saveData.lastChatTimeStamp;
        curSection        = ChatManager.Instance.LoadSectionByID(curPairID, saveData.curSectionId);
        Node front = null;

        if (saveData.curNodeId >= 0)
        {
            curRunningNode = curSection.nodes[saveData.curNodeId];
            front          = curRunningNode.GetFront();
        }
        else if (saveData.curNodeId == ChatManager.finished)
        {
            front = curSection.GetLast();
        }
        else if (saveData.curNodeId == ChatManager.need2Init)
        {
            nextReadNode        = curRunningNode = curSection.GetFirst();
            saveData.curNodeId  = curRunningNode.nodeId;
            saveData.readNodeId = nextReadNode.nodeId;
        }
        if (saveData.readNodeId >= 0)
        {
            nextReadNode = ChatManager.Instance.LoadSectionByID(curPairID, saveData.readSectionId).nodes [saveData.readNodeId];
        }
        else
        {
            //nextReadNode = ChatManager.Instance.LoadSectionByID (curPairID, saveData.curSectionId).GetLast ();
        }
        if (front != null)
        {
            lastSentence = GetLastSentence(front);
        }
        totalRectHeight = saveData.totalRectHeight;
    }
    public void OnInit(string name, string otherName, int pairId)
    {
        userName          = name;
        otherUserName     = otherName;
        curPairID         = pairId;
        saveData          = XMLSaver.saveData.GetInstanceData(curPairID);
        lastChatTimeStamp = saveData.lastChatTimeStamp;
        curSection        = ChatManager.Instance.LoadSectionByID(curPairID, saveData.curSectionId);
        if (saveData.curNodeId != -1)
        {
            curRunningNode = curSection.nodes [saveData.curNodeId];
        }
        Node front = curRunningNode.GetFront();

        if (front != null)
        {
            lastSentence = GetLastSentence(front);
        }
        totalRectHeight = saveData.totalRectHeight;
    }
Beispiel #5
0
 public virtual string GetLastSentence(ChatInstanceData data = null)
 {
     return("");
 }
Beispiel #6
0
 public override string GetLastSentence(ChatInstanceData data = null)
 {
     return("[图片]");
 }
Beispiel #7
0
 public override string GetLastSentence(ChatInstanceData data = null)
 {
     return(labels[data.GetOption(this)]);
 }
Beispiel #8
0
 public override string GetLastSentence(ChatInstanceData data = null)
 {
     return(DialogLine);
 }