Exemplo n.º 1
0
 void RefreshChatLog(SyncListString.Operation op, int index)
 {
     UIManager.Chat.CurrentChannelText.text = "";
     foreach (string chatline in chatlog)
     {
         string curList = UIManager.Chat.CurrentChannelText.text;
         UIManager.Chat.CurrentChannelText.text = curList + chatline + "\r\n";
     }
 }
Exemplo n.º 2
0
    private void OnChatUpdate(SyncListString.Operation op, int index)
    {
        if (chatLogs.Count == 0)
        {
            scrollText.GetComponent <Text> ().text = "";
        }

        scrollText.GetComponent <Text> ().text += chatLogs [chatLogs.Count - 1] + "\n";
    }
Exemplo n.º 3
0
        private void OnChatUpdated(SyncListString.Operation op, int index)
        {
            var newChat = string.Empty;

            for (int lineIndex = 0; lineIndex < ChatLog.Count; lineIndex++)
            {
                newChat = newChat + ChatLog[lineIndex] + "\n";
            }
            chatHistory.text = newChat;
        }
Exemplo n.º 4
0
    void OnNicknamesChanged(SyncListString.Operation op, int idx)
    {
        List <string> l = new List <string> ();

        foreach (string name in nicknames)
        {
            Debug.Log("list elemnts: " + name);
            l.Add(name);
        }
        dropdown.ClearOptions();
        dropdown.AddOptions(l);
    }
Exemplo n.º 5
0
        // Called when we receive a new message from the server (or ourselves)
        private void OnChatUpdate(
            SyncListString.Operation op, int index, string oldItem, string newItem)
        {
            // Update the UI element
            _messagesText.text += newItem;
            if (_sentMessages.Count > MAX_MESSAGES) /* TODO perhaps also shrink the list */
            {
                _messagesText.text = _messagesText.text.Substring(
                    _messagesText.text.IndexOf("\n") + "\n".Length);
            }

            _messagesText.gameObject.SetActive(true);
            _messagesVisibleRemaining = MESSAGES_VISIBLE_MAX;
        }
Exemplo n.º 6
0
    public void onChangeFindings(SyncListString.Operation op, int index)
    {
        /*if (isServer) {
         *  Debug.Log("Refused server attempt to update client UI.");
         *  return;
         * }*/

        Debug.Log("UPDATE BABY AR HERE");

        if (coreFindings.Count > 0)
        {
            babyBody.GetComponent <BabyChange>().ChangeColor(coreFindings[0]);
            babyHead.GetComponent <BabyChange>().ChangeColor(coreFindings[0]);
        }

        printFindings();
    }
Exemplo n.º 7
0
    //callback we registered for when the syncList changes
    private void OnChatUpdated(SyncListString.Operation op, int index)
    {
        //Checks the teambit and only posts if appropriate
        string newMessage = chatLog [chatLog.Count - 1] + "\n";

        if (newMessage.Substring(0, 1) == "a")
        {
            newMessage       = newMessage.Remove(0, 1);
            newMessage       = "[All] " + newMessage;
            chatWindow.text += newMessage;
        }
        else if (team.Substring(0, 1) == newMessage.Substring(0, 1))
        {
            newMessage       = newMessage.Remove(0, 1);
            newMessage       = "[Team] " + newMessage;
            chatWindow.text += newMessage;
        }
    }
Exemplo n.º 8
0
    private void OnSyncListUpdated(SyncListString.Operation op, int syncListIndex)
    {
        if (op != SyncListString.Operation.OP_SET)
        {
            return;
        }

        int fieldGUIsIndex = 0;
        int fieldCount     = 0;

        for (fieldGUIsIndex = 0; fieldGUIsIndex < this.fieldGUIs.Count; fieldGUIsIndex++)
        {
            fieldCount += fieldGUIs[fieldGUIsIndex].GUIs.Count;

            if (syncListIndex < fieldCount)
            {
                break;
            }
        }

        int fieldIndex = syncListIndex - (fieldCount - this.fieldGUIs[fieldGUIsIndex].GUIs.Count);

        this.fieldGUIs[fieldGUIsIndex].GUIs[fieldIndex].SetSyncValue(this.syncList[syncListIndex]);
    }
Exemplo n.º 9
0
 void UpdateFromServer(SyncListString.Operation op, int index)
 {
     RefreshPlayerListText();
 }
Exemplo n.º 10
0
 public void DeckChanged(SyncListString.Operation op, int index, string oldItem, string newItem)
 {
     // Debug.Log("Deck changed " + op);
 }
Exemplo n.º 11
0
 void PlayersChanged(SyncListString.Operation op, int index, string oldItem, string newItem)
 {
     Debug.Log("list changed " + op);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Updates the player list text when list is changed
 /// </summary>
 void PlayerIdListChanged(SyncListString.Operation op, int itemIndex)
 {
     Debug.Log("Changed the player id list. Current num players: " + _playerUserIdList.Count);
     UpdatePlayerListText();
 }
Exemplo n.º 13
0
 //callback we registered for when the syncList changes
 private void OnChatUpdated(SyncListString.Operation op, int index)
 {
     chatWindow.text += chatLog [chatLog.Count - 1] + "\n";
 }