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"; } }
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"; }
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; }
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); }
// 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; }
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(); }
//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; } }
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]); }
void UpdateFromServer(SyncListString.Operation op, int index) { RefreshPlayerListText(); }
public void DeckChanged(SyncListString.Operation op, int index, string oldItem, string newItem) { // Debug.Log("Deck changed " + op); }
void PlayersChanged(SyncListString.Operation op, int index, string oldItem, string newItem) { Debug.Log("list changed " + op); }
/// <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(); }
//callback we registered for when the syncList changes private void OnChatUpdated(SyncListString.Operation op, int index) { chatWindow.text += chatLog [chatLog.Count - 1] + "\n"; }