示例#1
0
    // Token: 0x06006108 RID: 24840 RVA: 0x00223CC0 File Offset: 0x002220C0
    public void SetupElement(ApiNotification n, QuickMenuSocialElement.IconType icon = QuickMenuSocialElement.IconType.None)
    {
        APIUser cachedUser = APIUser.GetCachedUser(n.senderUserId);

        if (cachedUser != null)
        {
            this.SetupElement(cachedUser, QuickMenuSocialElement.IconType.None);
            this.SetIcon(icon, cachedUser.id);
            this.notification = n;
            this.elementType  = QuickMenuSocialElement.ElementType.Notification;
        }
        else
        {
            APIUser.Fetch(n.senderUserId, delegate(APIUser user)
            {
                this.SetupElement(user, QuickMenuSocialElement.IconType.None);
                this.SetIcon(icon, user.id);
                this.notification = n;
                this.elementType  = QuickMenuSocialElement.ElementType.Notification;
            }, delegate(string obj)
            {
                Debug.LogError(obj);
            });
        }
    }
示例#2
0
        // Token: 0x06006074 RID: 24692 RVA: 0x0021F7B8 File Offset: 0x0021DBB8
        public void SetupWorldInfo(ApiWorld world, ApiWorld.WorldInstance instance = null, bool newInstance = false, bool isPortal = false)
        {
            if (instance == null)
            {
                instance = world.GetBestInstance(null, false);
            }
            this.mWorld           = world;
            this.worldInstance    = instance;
            this.openedFromPortal = isPortal;
            ApiWorld.WorldInstance.AccessType   accessType   = this.worldInstance.GetAccessType();
            ApiWorld.WorldInstance.AccessDetail accessDetail = ApiWorld.WorldInstance.GetAccessDetail(accessType);
            string str = string.Empty;

            this.roomName.text = world.name;
            string instanceCreator = this.worldInstance.GetInstanceCreator();

            str = accessDetail.shortName;
            this.instanceStatus.text = accessDetail.fullName;
            if (accessType == ApiWorld.WorldInstance.AccessType.Public)
            {
                this.roomAuthor.text = world.authorName;
                this.roomOwner.text  = world.authorName;
            }
            else if (accessType == ApiWorld.WorldInstance.AccessType.InviteOnly || accessType == ApiWorld.WorldInstance.AccessType.FriendsOnly || accessType == ApiWorld.WorldInstance.AccessType.FriendsOfGuests)
            {
                this.roomAuthor.text = world.authorName;
                this.roomOwner.text  = "(loading...)";
                APIUser.Fetch(instanceCreator, delegate(APIUser user)
                {
                    this.roomOwner.text = user.displayName;
                }, null);
            }
            this.playerCount.text     = this.worldInstance.count.ToString();
            this.maxPlayers.text      = world.capacity.ToString();
            this.worldInstanceId.text = "#" + this.worldInstance.idOnly + " " + str;
            Downloader.DownloadImage(world.imageUrl, delegate(string downloadedUrl, Texture2D obj)
            {
                this.roomImage.texture = obj;
            }, string.Empty);
            this.isPortalMenu = isPortal;
            this.ConfigureJoinButton(instance.count >= world.capacity, instance.isPublic);
            this.ConfigurePortalButton(accessType, instanceCreator == APIUser.CurrentUser.id, instance.count >= world.capacity, instance.isPublic);
            if (isPortal)
            {
                this.backButton.GetComponentInChildren <Text>().text = "Exit";
                this.backButton.onClick.AddListener(new UnityAction(this.Respawn));
                VRCUiManager.Instance.ShowScreen("UserInterface/MenuContent/Backdrop/Backdrop");
                VRCUiManager.Instance.HideScreen("HEADER");
                QuickMenu.Instance.CanExitWithButton = false;
            }
            else
            {
                this.backButton.onClick.AddListener(new UnityAction(this.BackToWorlds));
                this.backButton.GetComponentInChildren <Text>().text = "Back";
            }
            if (this.il != null)
            {
                this.il.world = world;
                this.il.Refresh();
            }
            if (world.releaseStatus == "public" || world.authorId == APIUser.CurrentUser.id)
            {
                this.newInstanceButton.interactable = true;
            }
            if (instance.count >= world.capacity)
            {
                this.playerCount.text = "Full";
            }
            this.SetCurrentInstanceMessage(string.Empty, false);
            if (RoomManager.inRoom)
            {
                ApiWorld currentRoom = RoomManager.currentRoom;
                if (currentRoom.id == world.id && currentRoom.currentInstanceIdWithTags == this.worldInstance.idWithTags)
                {
                    this.SetCurrentInstanceMessage("You are here", true);
                }
            }
            if (newInstance)
            {
                this.SetCurrentInstanceMessage("NEW INSTANCE", true);
            }
        }
示例#3
0
    // Token: 0x060061A4 RID: 24996 RVA: 0x002275B8 File Offset: 0x002259B8
    protected override void SetPickerContentFromApiModel(VRCUiContentButton content, object am)
    {
        APIUser user = null;

        content.SetDetailShouldShowImage(0, false);
        content.SetDetailShouldShowImage(1, false);
        content.SetDetailShouldShowImage(2, false);
        if (am is ApiNotification)
        {
            ApiNotification notif = (ApiNotification)am;
            user = new APIUser();
            user.Init(notif);
            content.Initialize(user.currentAvatarThumbnailImageUrl, user.displayName, null, notif.id);
            APIUser.Fetch(notif.senderUserId, delegate(APIUser u)
            {
                content.Initialize(u.currentAvatarThumbnailImageUrl, u.displayName, delegate
                {
                    VRCUiPage page = VRCUiManager.Instance.GetPage("UserInterface/MenuContent/Screens/UserInfo");
                    VRCUiManager.Instance.ShowScreen(page);
                    ((PageUserInfo)page).SetupUserInfo(u, PageUserInfo.InfoType.ReceivedFriendRequest, UiUserList.ListType.None);
                    ((PageUserInfo)page).notification = notif;
                }, notif.id);
            }, null);
        }
        else
        {
            user = (APIUser)am;
            content.Initialize(user.currentAvatarThumbnailImageUrl, user.displayName, delegate
            {
                PageUserInfo.InfoType infoType = PageUserInfo.InfoType.NotFriends;
                VRCUiPage page = VRCUiManager.Instance.GetPage("UserInterface/MenuContent/Screens/UserInfo");
                VRCUiManager.Instance.ShowScreen(page);
                bool flag = false;
                if (APIUser.CurrentUser.friends != null)
                {
                    flag = (APIUser.CurrentUser.friends.Find((APIUser u) => u.id == user.id) != null);
                }
                switch (this.listType)
                {
                case UiUserList.ListType.InWorld:
                    if (flag)
                    {
                        infoType = PageUserInfo.InfoType.OnlineFriend;
                    }
                    else
                    {
                        infoType = PageUserInfo.InfoType.NotFriends;
                    }
                    break;

                case UiUserList.ListType.FriendRequests:
                    infoType = PageUserInfo.InfoType.ReceivedFriendRequest;
                    break;

                case UiUserList.ListType.OnlineFriends:
                    infoType = PageUserInfo.InfoType.OnlineFriend;
                    break;

                case UiUserList.ListType.OfflineFriends:
                    infoType = PageUserInfo.InfoType.OfflineFriend;
                    break;

                case UiUserList.ListType.Invites:
                    infoType = PageUserInfo.InfoType.Invited;
                    break;

                case UiUserList.ListType.HelpRequests:
                    infoType = PageUserInfo.InfoType.ReceivedHelpRequest;
                    break;

                case UiUserList.ListType.Search:
                    {
                        Player player = PlayerManager.GetPlayer(user.id);
                        bool flag2    = player != null && player.vrcPlayer != null && player.vrcPlayer.isInvisible;
                        if (flag)
                        {
                            infoType = ((!flag2) ? PageUserInfo.InfoType.OnlineFriend : PageUserInfo.InfoType.OfflineFriend);
                        }
                        else
                        {
                            infoType = PageUserInfo.InfoType.NotFriends;
                        }
                        break;
                    }
                }
                ((PageUserInfo)page).SetupUserInfo(user, infoType, this.listType);
            }, user.id);
        }
        if (this.listType == UiUserList.ListType.FriendRequests)
        {
            content.SetDetailShouldShowImage(2, true);
        }
        else if (ModerationManager.Instance.IsBlocked(user.id))
        {
            content.SetDetailShouldShowImage(1, true);
        }
        else if (APIUser.IsFriendsWith(user.id))
        {
            content.SetDetailShouldShowImage(0, true);
        }
    }