public virtual void Initialize(FriendsHUDView owner) { this.owner = owner; rectTransform = transform as RectTransform; contextMenuPanel.OnBlock += OnPressBlockButton; contextMenuPanel.OnDelete += OnPressDeleteButton; contextMenuPanel.OnPassport += OnPressPassportButton; contextMenuPanel.OnReport += OnPressReportButton; }
protected override IEnumerator SetUp() { yield return(base.SetUp()); controller = new FriendsHUDController(); controller.Initialize(null, null); this.view = controller.view; Assert.IsTrue(view != null, "Friends hud view is null?"); Assert.IsTrue(controller != null, "Friends hud controller is null?"); }
public static FriendEntry FakeAddFriend(FriendsController_Mock controller, FriendsHUDView hudView, string id, FriendshipAction action = FriendshipAction.APPROVED) { UserProfileModel model = new UserProfileModel() { userId = id, name = id, }; UserProfileController.i.AddUserProfileToCatalog(model); controller.RaiseUpdateFriendship(id, action); return(hudView.friendsList.GetEntry(id) as FriendEntry); }
public static IEnumerator FakeAddFriend(FriendsController_Mock controller, FriendsHUDView hudView, string id, FriendshipAction action = FriendshipAction.APPROVED) { UserProfileModel model = new UserProfileModel() { userId = id, name = id, }; UserProfileController.i.AddUserProfileToCatalog(model); controller.RaiseUpdateFriendship(id, action); yield return(new WaitUntil(() => hudView.friendsList.creationQueue.Count == 0)); }
public override void Initialize(FriendsHUDView owner, int preinstantiatedEntries) { base.Initialize(owner, preinstantiatedEntries); onlineFriendsList.toggleTextPrefix = "ONLINE"; offlineFriendsList.toggleTextPrefix = "OFFLINE"; if (ChatController.i != null) { ChatController.i.OnAddMessage -= ChatController_OnAddMessage; ChatController.i.OnAddMessage += ChatController_OnAddMessage; } }
protected override IEnumerator SetUp() { yield return(base.SetUp()); NotificationsController.i.Initialize(new NotificationHUDController()); controller = new FriendsHUDController(); friendsController = new FriendsController_Mock(); controller.Initialize(friendsController, UserProfile.GetOwnUserProfile()); this.view = controller.view; Assert.IsTrue(view != null, "Friends hud view is null?"); Assert.IsTrue(controller != null, "Friends hud controller is null?"); }
public void Initialize(IFriendsController friendsController, UserProfile ownUserProfile) { view = FriendsHUDView.Create(this); this.friendsController = friendsController; if (this.friendsController != null) { this.friendsController.OnUpdateFriendship += OnUpdateFriendship; this.friendsController.OnUpdateUserStatus += OnUpdateUserStatus; this.friendsController.OnFriendNotFound += OnFriendNotFound; } view.friendRequestsList.OnFriendRequestApproved += Entry_OnRequestAccepted; view.friendRequestsList.OnCancelConfirmation += Entry_OnRequestCancelled; view.friendRequestsList.OnRejectConfirmation += Entry_OnRequestRejected; view.friendRequestsList.OnFriendRequestSent += Entry_OnRequestSent; view.friendRequestsList.contextMenuPanel.OnBlock += Entry_OnBlock; view.friendRequestsList.contextMenuPanel.OnPassport += Entry_OnPassport; view.friendsList.OnWhisper += Entry_OnWhisper; view.friendsList.contextMenuPanel.OnBlock += Entry_OnBlock; view.friendsList.contextMenuPanel.OnPassport += Entry_OnPassport; view.friendsList.contextMenuPanel.OnReport += Entry_OnReport; view.friendsList.OnDeleteConfirmation += Entry_OnDelete; if (ownUserProfile != null) { this.ownUserProfile = ownUserProfile; ownUserProfile.OnUpdate += OnUserProfileUpdate; } if (friendsController != null) { if (friendsController.isInitialized) { view.HideSpinner(); } else { view.ShowSpinner(); friendsController.OnInitialized -= FriendsController_OnInitialized; friendsController.OnInitialized += FriendsController_OnInitialized; } } }
public virtual void Initialize(FriendsHUDView owner, int preinstantiatedEntries) { this.owner = owner; friendEntriesPool = PoolManager.i.GetPool(FRIEND_ENTRIES_POOL_NAME + this.name + this.GetInstanceID()); if (friendEntriesPool == null) { friendEntriesPool = PoolManager.i.AddPool( FRIEND_ENTRIES_POOL_NAME + this.name + this.GetInstanceID(), Instantiate(entryPrefab), maxPrewarmCount: preinstantiatedEntries, isPersistent: true); friendEntriesPool.ForcePrewarm(); } rectTransform = transform as RectTransform; contextMenuPanel.OnBlock += OnPressBlockButton; contextMenuPanel.OnUnfriend += OnPressDeleteButton; }
public override void Initialize(FriendsHUDView owner) { base.Initialize(owner); receivedRequestsList.toggleTextPrefix = "RECEIVED"; sentRequestsList.toggleTextPrefix = "SENT"; requestSentNotification.model.timer = owner.notificationsDuration; requestSentNotification.model.groupID = FriendsHUDView.NOTIFICATIONS_ID; friendSearchFailedNotification.model.timer = owner.notificationsDuration; friendSearchFailedNotification.model.groupID = FriendsHUDView.NOTIFICATIONS_ID; acceptedFriendNotification.model.timer = owner.notificationsDuration; acceptedFriendNotification.model.groupID = FriendsHUDView.NOTIFICATIONS_ID; alreadyFriendsNotification.model.timer = owner.notificationsDuration; alreadyFriendsNotification.model.groupID = FriendsHUDView.NOTIFICATIONS_ID; friendSearchInputField.onSubmit.AddListener(SendFriendRequest); friendSearchInputField.onValueChanged.AddListener(OnSearchInputValueChanged); addFriendButton.onClick.AddListener(() => friendSearchInputField.OnSubmit(null)); }
public static FriendEntry GetEntry(FriendsHUDView hudView, string id) { return(hudView.friendsList.GetEntry(id) as FriendEntry); }