示例#1
0
    // Token: 0x060061C9 RID: 25033 RVA: 0x00227FC8 File Offset: 0x002263C8
    protected override void SetPickerContentFromApiModel(VRCUiContentButton content, object am)
    {
        ApiWorld.WorldInstance wi = (ApiWorld.WorldInstance)am;
        string detail             = (wi.count <= 0) ? string.Empty : wi.count.ToString();

        ApiWorld.WorldInstance.AccessType   accessType   = wi.GetAccessType();
        ApiWorld.WorldInstance.AccessDetail accessDetail = ApiWorld.WorldInstance.GetAccessDetail(accessType);
        Action action = null;

        if (accessType == ApiWorld.WorldInstance.AccessType.PrivatePopCounter)
        {
            content.EnableDetail(0, false);
            content.SetDetailShouldShowImage(1, false);
            content.EnableDetail(2, false);
            content.EnableDetail(4, true);
            content.SetDetailText(5, detail);
        }
        else
        {
            content.EnableDetail(0, true);
            content.SetDetailText(0, detail);
            content.SetDetailShouldShowImage(1, true);
            if (wi.count >= this.world.capacity)
            {
            }
            content.EnableDetail(2, true);
            content.SetDetailText(3, "#" + wi.idOnly + " " + accessDetail.shortName);
            content.EnableDetail(4, false);
            action = delegate
            {
                this.ShowWorldInstanceDetails(this.world, wi);
            };
        }
        content.Initialize(this.world.thumbnailImageUrl, this.world.name, action, this.world.id);
    }
示例#2
0
 // Token: 0x06005938 RID: 22840 RVA: 0x001EF878 File Offset: 0x001EDC78
 private void SetupPortalName(string name, ApiWorld.WorldInstance winst, ApiWorld world, string creator)
 {
     if (this.portalMarker != null)
     {
         this.portalMarker.roomName = name;
     }
     if (!string.IsNullOrEmpty(name) && winst != null && base.transform != null)
     {
         string text = name;
         if (world.capacity > 1)
         {
             text = text + " #" + winst.idOnly;
         }
         if (!string.IsNullOrEmpty(creator))
         {
             text = text + "\n" + creator;
         }
         ApiWorld.WorldInstance.AccessType   accessType   = winst.GetAccessType();
         ApiWorld.WorldInstance.AccessDetail accessDetail = ApiWorld.WorldInstance.GetAccessDetail(accessType);
         text = text + "\n" + accessDetail.shortName;
         Transform transform = base.transform.Find("NameTag/TextMesh");
         if (transform != null)
         {
             TextMeshPro component = transform.GetComponent <TextMeshPro>();
             if (component != null)
             {
                 component.text = text;
             }
         }
     }
 }
示例#3
0
        // Token: 0x060050BA RID: 20666 RVA: 0x001B969C File Offset: 0x001B7A9C
        private void Update()
        {
            string text = string.Empty;

            switch (this.dataType)
            {
            case DebugDisplayText.DataType.FPS:
                text = Mathf.CeilToInt(1f / Time.smoothDeltaTime).ToString();
                break;

            case DebugDisplayText.DataType.Ping:
                if (PhotonNetwork.connectedAndReady)
                {
                    text = "Png: " + PhotonNetwork.GetPing().ToString();
                }
                break;

            case DebugDisplayText.DataType.World:
                if (RoomManager.inRoom)
                {
                    ApiWorld.WorldInstance.AccessDetail accessDetail = ApiWorld.WorldInstance.GetAccessDetail(RoomManager.currentRoom.currentInstanceAccess);
                    text = string.Concat(new object[]
                    {
                        RoomManager.currentRoom.name,
                        ":",
                        RoomManager.currentRoom.currentInstanceIdOnly,
                        " ",
                        accessDetail.shortName,
                        " v",
                        RoomManager.currentRoom.version
                    });
                }
                else
                {
                    text = string.Empty;
                }
                break;

            case DebugDisplayText.DataType.BuildNum:
                text = "Build " + VRCApplicationSetup.Instance.buildNumber;
                break;
            }
            this.text.text = text;
        }
示例#4
0
        // Token: 0x0600629E RID: 25246 RVA: 0x00232B18 File Offset: 0x00230F18
        private void RefreshRoomData()
        {
            string text = "You Are In: ";

            if (RoomManager.currentRoom != null)
            {
                ApiWorld.WorldInstance.AccessDetail accessDetail = ApiWorld.WorldInstance.GetAccessDetail(RoomManager.currentRoom.currentInstanceAccess);
                string text2 = text;
                text = string.Concat(new string[]
                {
                    text2,
                    RoomManager.currentRoom.name,
                    " #",
                    RoomManager.currentRoom.currentInstanceIdOnly,
                    " ",
                    accessDetail.shortName
                });
            }
            this.roomNameText.text = text;
        }
示例#5
0
 static string smethod_5(ApiWorld.WorldInstance.AccessDetail accessDetail_0)
 {
     return(accessDetail_0.fullName);
 }
示例#6
0
        // Token: 0x0600603A RID: 24634 RVA: 0x0021DD74 File Offset: 0x0021C174
        public void SetupUserInfo(APIUser u, PageUserInfo.InfoType infoType, UiUserList.ListType listType = UiUserList.ListType.None)
        {
            this.SetUserRelationshipState(infoType);
            this.ClearRoomInfo();
            this.user          = u;
            this.userName.text = this.user.displayName;
            if (!string.IsNullOrEmpty(this.user.currentAvatarImageUrl))
            {
                Downloader.DownloadImage(this.user.currentAvatarImageUrl, delegate(string downloadedUrl, Texture2D obj)
                {
                    this.avatarImage.texture = obj;
                }, string.Empty);
            }
            this.SetupModButtons();
            this.onlineStatusText.text = string.Empty;
            switch (this.state)
            {
            case PageUserInfo.InfoType.NotFriends:
            {
                this.worldImage.transform.parent.gameObject.SetActive(true);
                Player player = PlayerManager.GetPlayer(this.user.id);
                bool   flag   = player != null && player.vrcPlayer != null && player.vrcPlayer.isInvisible;
                if (listType == UiUserList.ListType.InWorld && !flag)
                {
                    if (RoomManager.currentRoom != null && !string.IsNullOrEmpty(RoomManager.currentRoom.imageUrl))
                    {
                        this.DownloadAndSetWorldImage(RoomManager.currentRoom.imageUrl);
                    }
                    this.onlineStatusText.text = "online in current world";
                }
                this.SetupFriendButton("Friend");
                break;
            }

            case PageUserInfo.InfoType.OnlineFriend:
                this.worldImage.transform.parent.gameObject.SetActive(true);
                this.worldList.ownerId = this.user.id;
                this.worldScroller.SetActive(true);
                this.SetIcon(QuickMenuSocialElement.IconType.Friend, u.id);
                this.SetupJoinButton("Join", false);
                this.SetupInviteButton("Invite", false);
                if (listType == UiUserList.ListType.InWorld)
                {
                    if (RoomManager.currentRoom != null && !string.IsNullOrEmpty(RoomManager.currentRoom.imageUrl))
                    {
                        this.DownloadAndSetWorldImage(RoomManager.currentRoom.imageUrl);
                    }
                    this.onlineStatusText.text = "online in current world";
                }
                else if (!string.IsNullOrEmpty(this.user.location))
                {
                    string text = this.user.location.Split(new char[]
                    {
                        ':'
                    })[0];
                    string instanceId = this.user.location.Split(new char[]
                    {
                        ':'
                    })[1];
                    if (text == "local")
                    {
                        this.onlineStatusText.text = "online in local test world";
                    }
                    else
                    {
                        ApiWorld.Fetch(text, delegate(ApiWorld world)
                        {
                            ApiWorld.WorldInstance worldInstance = new ApiWorld.WorldInstance(instanceId, 0);
                            bool flag2 = APIUser.CurrentUser.id == worldInstance.GetInstanceCreator();
                            ApiWorld.WorldInstance.AccessType accessType     = worldInstance.GetAccessType();
                            ApiWorld.WorldInstance.AccessDetail accessDetail = ApiWorld.WorldInstance.GetAccessDetail(accessType);
                            if (accessType == ApiWorld.WorldInstance.AccessType.Public)
                            {
                                this.DownloadAndSetWorldImage(world.imageUrl);
                                this.userLocation = world;
                                if (world.id == RoomManager.currentRoom.id && worldInstance.idWithTags == RoomManager.currentRoom.currentInstanceIdWithTags)
                                {
                                    this.onlineStatusText.text = "online in same world";
                                }
                                else
                                {
                                    this.onlineStatusText.text = string.Concat(new string[]
                                    {
                                        "online in ",
                                        world.name,
                                        "\n<i>",
                                        accessDetail.fullName.ToLower(),
                                        "</i>"
                                    });
                                    this.SetupJoinButton("Join", true);
                                    this.SetupInviteButton("Invite", this.CanInviteHere());
                                }
                            }
                            else if (accessType == ApiWorld.WorldInstance.AccessType.FriendsOfGuests)
                            {
                                this.DownloadAndSetWorldImage(world.imageUrl);
                                this.userLocation = world;
                                if (world.id == RoomManager.currentRoom.id && worldInstance.idWithTags == RoomManager.currentRoom.currentInstanceIdWithTags)
                                {
                                    this.onlineStatusText.text = "online in same world";
                                }
                                else
                                {
                                    this.onlineStatusText.text = string.Concat(new string[]
                                    {
                                        "online in ",
                                        world.name,
                                        "\n<i>",
                                        accessDetail.fullName.ToLower(),
                                        "</i>"
                                    });
                                    this.SetupJoinButton("Join", true);
                                    this.SetupInviteButton("Invite", this.CanInviteHere());
                                }
                            }
                            else if (accessType == ApiWorld.WorldInstance.AccessType.FriendsOnly)
                            {
                                this.DownloadAndSetWorldImage(world.imageUrl);
                                this.userLocation = world;
                                if (world.id == RoomManager.currentRoom.id && worldInstance.idWithTags == RoomManager.currentRoom.currentInstanceIdWithTags)
                                {
                                    this.onlineStatusText.text = "online in same world";
                                }
                                else
                                {
                                    this.onlineStatusText.text = string.Concat(new string[]
                                    {
                                        "online in ",
                                        world.name,
                                        "\n<i>",
                                        accessDetail.fullName.ToLower(),
                                        "</i>"
                                    });
                                    this.SetupJoinButton("Join", flag2 || this.user.id == worldInstance.GetInstanceCreator());
                                    this.SetupInviteButton("Invite", this.CanInviteHere());
                                }
                            }
                            else if (accessType == ApiWorld.WorldInstance.AccessType.InviteOnly)
                            {
                                if (flag2)
                                {
                                    this.DownloadAndSetWorldImage(world.imageUrl);
                                    this.userLocation = world;
                                }
                                else
                                {
                                    this.worldImage.texture = this.avatarImage.texture;
                                    this.userLocation       = null;
                                }
                                if (world.id == RoomManager.currentRoom.id && worldInstance.idWithTags == RoomManager.currentRoom.currentInstanceIdWithTags)
                                {
                                    this.onlineStatusText.text = "online in same world";
                                }
                                else
                                {
                                    this.onlineStatusText.text = "online in " + accessDetail.fullName.ToLower() + " world";
                                    if (flag2)
                                    {
                                        this.SetupJoinButton("Join", true);
                                    }
                                    else
                                    {
                                        this.SetupJoinButton("Req Invite", this.user.id == worldInstance.GetInstanceCreator());
                                    }
                                    this.SetupInviteButton("Invite", this.CanInviteHere());
                                }
                            }
                        }, delegate(string obj)
                        {
                            Debug.LogError(obj);
                        });
                    }
                }
                break;

            case PageUserInfo.InfoType.OfflineFriend:
                this.onlineStatusText.text = "offline";
                this.worldList.ownerId     = this.user.id;
                this.worldScroller.SetActive(true);
                this.SetIcon(QuickMenuSocialElement.IconType.Friend, u.id);
                break;

            case PageUserInfo.InfoType.ReceivedFriendRequest:
                this.notificationMessageText.text = this.user.displayName + " wants to be your friend";
                this.SetIcon(QuickMenuSocialElement.IconType.FriendRequest, u.id);
                break;

            case PageUserInfo.InfoType.ReceivedHelpRequest:
                this.notificationMessageText.text = this.user.displayName + " needs help";
                this.SetIcon(QuickMenuSocialElement.IconType.HelpRequest, u.id);
                break;
            }
            this.SetupBlockButton();
            this.SetupVoteToKickButton();
            this.SetupMuteButton();
        }
示例#7
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);
            }
        }