public IEnumerator refreshCommentList() { ServerCall getCommentsCall = new ServerCall(ServerInteract.INSTANCE.GetCommentsOnGlyph(currentGlyph)); yield return(StartCoroutine(getCommentsCall.call())); if (getCommentsCall.ReturnException != null) { throw getCommentsCall.ReturnException; } else { GlyphComment.GlyphCommentList glyphComments = (GlyphComment.GlyphCommentList)getCommentsCall.ObjectResponse; foreach (GlyphComment comment in glyphComments.comments) { GameObject go = Instantiate(commentListItemPrefab); CommentListItem listItem = go.GetComponent <CommentListItem> (); listItem.SetComment(comment, currentGlyph); commentList.addElement((ScrollableList.ListGameObject)listItem); } } yield return("Done"); }
public void refreshList() { searchList.removeAllElements(); foreach (User user in searchedUsers) { ScrollableList.ListGameObject listObject; if (!LoggedInUser.GetLoggedInUser().HasFriendship(user)) { GameObject go = Instantiate(userSearchItemPrefab); SearchUserNotFriendListItem newItem = go.GetComponent <SearchUserNotFriendListItem> (); newItem.SetSearchedUser(user); newItem.userProfile = userProfile; listObject = (ScrollableList.ListGameObject)newItem; } else { GameObject go = Instantiate(friendSearchItemPrefab); SearchUserIsFriendListItem newItem = go.GetComponent <SearchUserIsFriendListItem> (); newItem.SetSearchedUser(user); newItem.userProfile = userProfile; listObject = (ScrollableList.ListGameObject)newItem; } searchList.addElement(listObject); } searchList.sortList(); }
private void setListToAccepted() { friendsList.removeAllElements(); List <Friendship> accepted = LoggedInUser.GetLoggedInUser().GetAcceptedFriendships(); foreach (Friendship friend in accepted) { GameObject go = Instantiate(approvedFriendPrefab); AcceptedFriendListItem newItem = go.GetComponent <AcceptedFriendListItem> (); newItem.SetFriendship(friend); newItem.userProfile = userProfile; friendsList.addElement((ScrollableList.ListGameObject)newItem); Debug.LogError(friend.ToString()); } }
private void refreshList() { searchList.removeAllElements(); foreach (User user in searchedUsers) { GameObject go = Instantiate(sharedWithItemPrefab); GlyphSharedWithListItem newItem = go.GetComponent <GlyphSharedWithListItem> (); newItem.statusPanel = statusPanel; newItem.SetGlyphShareValues(currentGlyph, user); searchList.addElement((ScrollableList.ListGameObject)newItem); } }