Beispiel #1
0
 // Token: 0x060000CF RID: 207 RVA: 0x00007DFC File Offset: 0x00005FFC
 public static void DeleteAvatar(ApiAvatar avatar)
 {
     avatar.Delete(delegate(ApiContainer s)
     {
         Console.WriteLine("Avatar deleted.");
     }, delegate(ApiContainer e)
     {
         Console.WriteLine("Error deleting avatar: {0}", e.Error);
     });
 }
Beispiel #2
0
 static void smethod_46(string string_0, Action action_0, Action <string> action_1)
 {
     ApiAvatar.Delete(string_0, action_0, action_1);
 }
Beispiel #3
0
        public void Update()
        {
            APIUser   selectedUser = QuickMenu.Instance.SelectedUser;
            VRCPlayer vrcLocal     = PlayerManager.GetCurrentPlayer().vrcPlayer;


            if (selectedUser != null && !Event.current.control)
            {
                VRCPlayer vrcSelected = PlayerManager.GetPlayer(selectedUser.id).vrcPlayer;

                if (Input.GetMouseButtonDown(1))
                {
                    System.Console.WriteLine("Copied {0}'s avatar!", selectedUser.displayName);
                    User.CurrentUser.SetCurrentAvatar(vrcSelected.GetApiAvatar());
                }

                if (Input.GetMouseButtonDown(2))
                {
                    ApiAvatar apiAvatar  = vrcSelected.GetApiAvatar();
                    ApiAvatar apiAvatar2 = new ApiAvatar();
                    Cheat.SetForegroundWindow(Cheat.GetConsoleWindow());

                    System.Console.Write("Enter avatar's name: ");
                    string avatarName = System.Console.ReadLine();

                    System.Console.Write("Enter image URL: ");
                    string avatarImageURL = System.Console.ReadLine();

                    System.Console.Write("Enter avatar description: ");
                    string avatarDesc = System.Console.ReadLine();

                    apiAvatar2.Init(User.CurrentUser, avatarName, avatarImageURL, apiAvatar.assetUrl, avatarDesc, apiAvatar.tags, apiAvatar.unityPackageUrl);
                    apiAvatar2.Save(MainClass.avatarSaved, MainClass.avatarError);
                }

                if (Input.GetKeyDown(KeyCode.T))
                {
                    PlayerManager.GetCurrentPlayer().transform.position = vrcSelected.transform.position;
                    PlayerManager.GetCurrentPlayer().transform.rotation = vrcSelected.transform.rotation;
                }

                if (Input.GetKeyDown(KeyCode.N))
                {
                    PhotonNetwork.playerName = selectedUser.displayName;

                    Hashtable propertiesToSet = new Hashtable
                    {
                        {
                            "userId",
                            User.CurrentUser.id
                        }
                    };

                    PhotonNetwork.player.SetCustomProperties(propertiesToSet, null, false);
                }
            }

            else if (Event.current.control)
            {
                if (Input.GetKeyDown(KeyCode.N))
                {
                    Cheat.SetForegroundWindow(Cheat.GetConsoleWindow());
                    System.Console.Write("Enter new name: ");
                    PhotonNetwork.playerName = System.Console.ReadLine();

                    Hashtable propertiesToSet2 = new Hashtable
                    {
                        {
                            "userId",
                            User.CurrentUser.id
                        }
                    };

                    PhotonNetwork.player.SetCustomProperties(propertiesToSet2, null, false);
                }

                if (Input.GetKeyDown(KeyCode.B))
                {
                    ApiAvatar apiAvatar = vrcLocal.GetApiAvatar();

                    System.Console.Write("Enter image URL: ");

                    apiAvatar.imageUrl = System.Console.ReadLine();

                    apiAvatar.Save(MainClass.avatarSaved, MainClass.avatarError);

                    selectedUser.SetCurrentAvatar(apiAvatar);
                }

                if (Input.GetKeyDown(KeyCode.G))
                {
                    Cheat.Class6 @class = new Cheat.Class6();
                    System.Console.Clear();
                    System.Console.WriteLine(string.Join(", ", PlayerManager.GetAllPlayers().Select(new Func <Player, string>(Cheat.MainClass.getDisplayName)).ToArray <string>()));
                    Cheat.SetForegroundWindow(Cheat.GetConsoleWindow());
                    System.Console.Write("Teleport to: ");
                    @class.string_0 = System.Console.ReadLine().ToLower();
                    if (@class.string_0 != string.Empty)
                    {
                        Player player = PlayerManager.GetAllPlayers().FirstOrDefault(new Func <Player, bool>(@class.method_0));
                        if (player != null)
                        {
                            System.Console.WriteLine("Teleporting to {0}", player.user.displayName);
                            PlayerManager.GetCurrentPlayer().transform.position = player.transform.position;
                            PlayerManager.GetCurrentPlayer().transform.rotation = player.transform.rotation;
                        }
                    }
                }

                if (Input.GetKeyDown(KeyCode.Delete))
                {
                    System.Console.WriteLine("Avatar(\"{0}\", {1}) deleted!", User.CurrentUser.apiAvatar.name, User.CurrentUser.apiAvatar.id);
                    ApiAvatar.Delete(User.CurrentUser.apiAvatar.id, new Action(Cheat.MainClass.avatarDel), new Action <string>(Cheat.MainClass.avatarDelError));
                }

                if (Input.GetKeyDown(KeyCode.M))
                {
                    new Thread(new ThreadStart(Cheat.MainClass.pickupItemsToMe)).Start();
                }

                if (Input.GetKeyDown(KeyCode.B))
                {
                    ApiAvatar avatar = vrcLocal.GetApiAvatar();

                    System.Console.WriteLine(avatar.name + ":" + avatar.assetUrl + ":" + avatar.assetVersion + ":" + avatar.authorId + ":" + avatar.authorName + ":" + avatar.id + ":" + avatar.imageUrl);
                }

                if (Input.GetMouseButtonDown(2))
                {
                    System.Console.Write("Enter avatar ID: ");
                    Cheat.SetForegroundWindow(Cheat.GetConsoleWindow());
                    ApiAvatar.Fetch(System.Console.ReadLine(), Cheat.MainClass.saveAvatar, Cheat.MainClass.method_16);
                }

                if (Input.GetKeyDown(KeyCode.O))
                {
                    Cheat.FollowUser followUser = new Cheat.FollowUser();
                    Cheat.SetForegroundWindow(Cheat.GetConsoleWindow());
                    System.Console.Write("Follow: ");
                    followUser.UserName = System.Console.ReadLine();
                    APIUser.FetchUsers(followUser.UserName, followUser.onSuccess, Cheat.MainClass.fetchUserErr);
                }

                if (Input.GetKeyDown(KeyCode.F))
                {
                    this.speedhack = !this.speedhack;
                    if (this.speedhack)
                    {
                        this.vector3_0  = Physics.gravity;
                        Physics.gravity = Vector3.zero;
                    }
                    else
                    {
                        Physics.gravity = this.vector3_0;
                    }
                }

                if (Input.GetKeyDown(KeyCode.R))
                {
                    this.flyMode = !this.flyMode;
                }
            }

            if (this.locomotionInputController == null)
            {
                this.locomotionInputController = vrcLocal.GetComponent <LocomotionInputController>();
                this.vrcmotionState            = (VRCMotionState)typeof(LocomotionInputController).GetField("motionState", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this.locomotionInputController);
            }

            bool key = Input.GetKey(KeyCode.LeftShift);

            if (this.speedhack)
            {
                this.vrcmotionState.Reset();
                Vector3 position = vrcLocal.transform.position;

                if (Input.GetKey(KeyCode.E))
                {
                    vrcLocal.transform.position = new Vector3(position.x, position.y + (float)(key ? 15 : 4) * Time.deltaTime, position.z);
                }

                if (Input.GetKey(KeyCode.Q))
                {
                    vrcLocal.transform.position = new Vector3(position.x, position.y - (float)(key ? 15 : 4) * Time.deltaTime, position.z);
                }
            }

            this.locomotionInputController.strafeSpeed = (float)(this.speedhack ? (key ? 15 : 4) : (key ? 8 : 2));
            this.locomotionInputController.runSpeed    = (float)(this.speedhack ? 15 : 4);

            if (this.flyMode && DateTime.Now.Millisecond % 500 <= 10)
            {
                if (this.randomName)
                {
                    PhotonNetwork.playerName = Path.GetRandomFileName();
                    Hashtable propertiesToSet3 = new Hashtable
                    {
                        {
                            "userId",
                            User.CurrentUser.id
                        }
                    };
                    PhotonNetwork.player.SetCustomProperties(propertiesToSet3, null, false);
                    this.randomName = false;
                    return;
                }
            }
            else
            {
                this.randomName = true;
            }
        }
Beispiel #4
0
    bool OnGUIUserInfo()
    {
        if (!RemoteConfig.IsInitialized())
        {
            RemoteConfig.Init();
        }

        if (APIUser.IsLoggedInWithCredentials && uploadedWorlds != null && uploadedAvatars != null)
        {
            EditorGUILayout.LabelField(string.Format(fetchingWorlds != null ? "Fetching Worlds... {0}" : "{0} Worlds", uploadedWorlds.Count.ToString()), EditorStyles.helpBox);
            EditorGUILayout.LabelField(string.Format(fetchingAvatars != null ? "Fetching Avatars... {0}" : "{0} Avatars", uploadedAvatars.Count.ToString()), EditorStyles.helpBox);

            scrollPos = EditorGUILayout.BeginScrollView(scrollPos);

            if (uploadedWorlds.Count > 0)
            {
                EditorGUILayout.Space();

                EditorGUILayout.LabelField("Worlds", EditorStyles.boldLabel);
                EditorGUILayout.Space();
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Name", EditorStyles.boldLabel, GUILayout.Width(200));
                EditorGUILayout.LabelField("Image", EditorStyles.boldLabel, GUILayout.Width(75));
                EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));
                //EditorGUILayout.LabelField("Version", EditorStyles.boldLabel, GUILayout.Width (75));
                EditorGUILayout.LabelField("Release Status", EditorStyles.boldLabel, GUILayout.Width(100));
                EditorGUILayout.EndHorizontal();

                List <ApiWorld> tmpWorlds = new List <ApiWorld>();

                if (uploadedWorlds.Count > 0)
                {
                    tmpWorlds = new List <ApiWorld>(uploadedWorlds);
                }

                foreach (ApiWorld w in tmpWorlds)
                {
                    if (justDeletedContents != null && justDeletedContents.Contains(w.id))
                    {
                        uploadedWorlds.Remove(w);
                        continue;
                    }

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField(w.name, GUILayout.Width(200));
                    if (ImageCache.ContainsKey(w.id))
                    {
                        if (GUILayout.Button(ImageCache[w.id], GUILayout.Height(100), GUILayout.Width(100)))
                        {
                            Application.OpenURL(w.imageUrl);
                        }
                    }
                    else
                    {
                        if (GUILayout.Button("", GUILayout.Height(100), GUILayout.Width(100)))
                        {
                            Application.OpenURL(w.imageUrl);
                        }
                    }
                    EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));
                    EditorGUILayout.LabelField(w.releaseStatus, GUILayout.Width(100));
                    EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));
                    if (GUILayout.Button("Copy ID", GUILayout.Width(75)))
                    {
                        TextEditor te = new TextEditor();
                        te.text = w.id;
                        te.SelectAll();
                        te.Copy();
                    }
                    if (GUILayout.Button("Delete", GUILayout.Width(75)))
                    {
                        if (EditorUtility.DisplayDialog("Delete " + w.name + "?", "Are you sure you want to delete " + w.name + "? This cannot be undone.", "Delete", "Cancel"))
                        {
                            ApiWorld.Delete(w.id, null, null);
                            uploadedWorlds.RemoveAll(world => world.id == w.id);
                            if (ImageCache.ContainsKey(w.id))
                            {
                                ImageCache.Remove(w.id);
                            }

                            if (justDeletedContents == null)
                            {
                                justDeletedContents = new List <string>();
                            }
                            justDeletedContents.Add(w.id);
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                }
            }

            if (uploadedAvatars.Count > 0)
            {
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Avatars", EditorStyles.boldLabel);
                EditorGUILayout.Space();

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Name", EditorStyles.boldLabel, GUILayout.Width(200));
                EditorGUILayout.LabelField("Image", EditorStyles.boldLabel, GUILayout.Width(75));
                EditorGUILayout.EndHorizontal();

                List <ApiAvatar> tmpAvatars = new List <ApiAvatar>();

                if (uploadedAvatars.Count > 0)
                {
                    tmpAvatars = new List <ApiAvatar>(uploadedAvatars);
                }

                if (justUpdatedAvatars != null)
                {
                    foreach (ApiAvatar a in justUpdatedAvatars)
                    {
                        int index = tmpAvatars.FindIndex((av) => av.id == a.id);
                        if (index != -1)
                        {
                            tmpAvatars[index] = a;
                        }
                    }
                }

                foreach (ApiAvatar a in tmpAvatars)
                {
                    if (justDeletedContents != null && justDeletedContents.Contains(a.id))
                    {
                        uploadedAvatars.Remove(a);
                        continue;
                    }

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField(a.name, GUILayout.Width(200));
                    if (ImageCache.ContainsKey(a.id))
                    {
                        if (GUILayout.Button(ImageCache[a.id], GUILayout.Height(100), GUILayout.Width(100)))
                        {
                            Application.OpenURL(a.imageUrl);
                        }
                    }
                    else
                    {
                        if (GUILayout.Button("", GUILayout.Height(100), GUILayout.Width(100)))
                        {
                            Application.OpenURL(a.imageUrl);
                        }
                    }
                    EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));
                    EditorGUILayout.LabelField(a.releaseStatus, GUILayout.Width(100));
                    EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));

                    string oppositeReleaseStatus = a.releaseStatus == "public" ? "private" : "public";
                    if (GUILayout.Button("Make " + oppositeReleaseStatus, GUILayout.Width(100)))
                    {
                        a.releaseStatus = oppositeReleaseStatus;

                        a.Save(true, delegate(ApiModel model)
                        {
                            ApiAvatar savedBP = (ApiAvatar)model;

                            if (justUpdatedAvatars == null)
                            {
                                justUpdatedAvatars = new List <ApiAvatar>();
                            }
                            justUpdatedAvatars.Add(savedBP);

                            EditorUtility.DisplayDialog("Avatar Updated", "Avatar made " + savedBP.releaseStatus, "OK");
                        },
                               delegate(string error)
                        {
                            Debug.LogError(error);
                            EditorUtility.DisplayDialog("Avatar Updated", "Failed to change avatar release status", "OK");
                        });
                    }

                    if (GUILayout.Button("Copy ID", GUILayout.Width(75)))
                    {
                        TextEditor te = new TextEditor();
                        te.text = a.id;
                        te.SelectAll();
                        te.Copy();
                    }

                    if (GUILayout.Button("Delete", GUILayout.Width(75)))
                    {
                        if (EditorUtility.DisplayDialog("Delete " + a.name + "?", "Are you sure you want to delete " + a.name + "? This cannot be undone.", "Delete", "Cancel"))
                        {
                            ApiAvatar.Delete(a.id, null, null);
                            uploadedAvatars.RemoveAll(avatar => avatar.id == a.id);
                            if (ImageCache.ContainsKey(a.id))
                            {
                                ImageCache.Remove(a.id);
                            }

                            if (justDeletedContents == null)
                            {
                                justDeletedContents = new List <string>();
                            }
                            justDeletedContents.Add(a.id);
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                }
            }

            EditorGUILayout.EndScrollView();

            return(true);
        }
        else
        {
            return(false);
        }
    }
    bool OnGUIUserInfo()
    {
        if (!RemoteConfig.IsInitialized())
        {
            RemoteConfig.Init();
        }

        CheckLogin();

        if (APIUser.IsLoggedInWithCredentials)
        {
            scrollPos = EditorGUILayout.BeginScrollView(scrollPos);

            EditorGUILayout.Space();

            if (uploadedWorlds == null)
            {
                EditorGUILayout.EndScrollView();
                return(true);
            }

            EditorGUILayout.LabelField("Worlds", EditorStyles.boldLabel);
            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Name", EditorStyles.boldLabel, GUILayout.Width(200));
            EditorGUILayout.LabelField("Image", EditorStyles.boldLabel, GUILayout.Width(75));
            EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));
            //EditorGUILayout.LabelField("Version", EditorStyles.boldLabel, GUILayout.Width (75));
            EditorGUILayout.LabelField("Release Status", EditorStyles.boldLabel, GUILayout.Width(100));
            EditorGUILayout.EndHorizontal();

            List <ApiWorld> tmpWorlds = new List <ApiWorld>();

            if (uploadedWorlds != null)
            {
                tmpWorlds = new List <ApiWorld>(uploadedWorlds);
            }

            foreach (ApiWorld w in tmpWorlds)
            {
                if (justDeletedContents != null && justDeletedContents.Contains(w.id))
                {
                    continue;
                }

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(w.name, GUILayout.Width(200));
                if (worldImages != null && worldImages.ContainsKey(w.id))
                {
                    if (GUILayout.Button(worldImages[w.id], GUILayout.Height(100), GUILayout.Width(100)))
                    {
                        Application.OpenURL(w.imageUrl);
                    }
                }
                else
                {
                    GUILayout.Label("No Image", GUILayout.Height(100), GUILayout.Width(100));
                }
                EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));
                EditorGUILayout.LabelField(w.releaseStatus, GUILayout.Width(100));
                EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));
                if (GUILayout.Button("Copy ID", GUILayout.Width(75)))
                {
                    TextEditor te = new TextEditor();
                    te.text = w.id;
                    te.SelectAll();
                    te.Copy();
                }
                if (GUILayout.Button("Delete", GUILayout.Width(75)))
                {
                    if (EditorUtility.DisplayDialog("Delete " + w.name + "?", "Are you sure you want to delete " + w.name + "? This cannot be undone.", "Delete", "Cancel"))
                    {
                        ApiWorld.Delete(w.id, null, null);
                        uploadedWorlds.RemoveAll(world => world.id == w.id);

                        if (justDeletedContents == null)
                        {
                            justDeletedContents = new List <string>();
                        }
                        justDeletedContents.Add(w.id);
                    }
                }
                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Avatars", EditorStyles.boldLabel);
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Name", EditorStyles.boldLabel, GUILayout.Width(200));
            EditorGUILayout.LabelField("Image", EditorStyles.boldLabel, GUILayout.Width(75));
            EditorGUILayout.EndHorizontal();

            List <ApiAvatar> tmpAvatars = new List <ApiAvatar>();

            if (uploadedAvatars != null)
            {
                tmpAvatars = new List <ApiAvatar>(uploadedAvatars);
            }

            foreach (ApiAvatar a in tmpAvatars)
            {
                if (justDeletedContents != null && justDeletedContents.Contains(a.id))
                {
                    continue;
                }

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(a.name, GUILayout.Width(200));
                if (avatarImages != null && avatarImages.ContainsKey(a.id))
                {
                    if (GUILayout.Button(avatarImages[a.id], GUILayout.Height(100), GUILayout.Width(100)))
                    {
                        Application.OpenURL(a.imageUrl);
                    }
                }
                else
                {
                    GUILayout.Label("No Image", GUILayout.Height(100), GUILayout.Width(100));
                }
                EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));

                if (GUILayout.Button("Copy ID", GUILayout.Width(75)))
                {
                    TextEditor te = new TextEditor();
                    te.text = a.id;
                    te.SelectAll();
                    te.Copy();
                }

                if (GUILayout.Button("Delete", GUILayout.Width(75)))
                {
                    if (EditorUtility.DisplayDialog("Delete " + a.name + "?", "Are you sure you want to delete " + a.name + "? This cannot be undone.", "Delete", "Cancel"))
                    {
                        ApiAvatar.Delete(a.id, null, null);
                        uploadedAvatars.RemoveAll(avatar => avatar.id == a.id);

                        if (justDeletedContents == null)
                        {
                            justDeletedContents = new List <string>();
                        }
                        justDeletedContents.Add(a.id);
                    }
                }
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndScrollView();

            return(true);
        }
        else
        {
            return(false);
        }
    }
    bool OnGUIUserInfo()
    {
        if (!RemoteConfig.IsInitialized())
        {
            RemoteConfig.Init();
        }

        if (!APIUser.IsLoggedInWithCredentials && APIUser.IsCached)
        {
            APIUser.CachedLogin(null, null, false);
        }

        GUILayout.Label("Account Info", EditorStyles.boldLabel);
        if (APIUser.IsLoggedInWithCredentials)
        {
            GUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Logged in as " + APIUser.CurrentUser.displayName);
            if (GUILayout.Button("Logout"))
            {
                APIUser.Logout();
                GUILayout.EndHorizontal();
                return(false);
            }
            else
            {
                GUILayout.EndHorizontal();
                GUILayout.Label("Developer Status: " + APIUser.CurrentUser.developerType);

                if (APIUser.CurrentUser.developerType == APIUser.DeveloperType.Internal)
                {
                    string apiMessage = ApiModel.IsDevApi() ? "Dev" : "Release";
                    GUILayout.Label("API: " + apiMessage);
                }


                scrollPos = EditorGUILayout.BeginScrollView(scrollPos);

                EditorGUILayout.Space();

                if (uploadedWorlds == null)
                {
                    EditorGUILayout.EndScrollView();
                    return(true);
                }

                EditorGUILayout.LabelField("Worlds", EditorStyles.boldLabel);
                EditorGUILayout.Space();
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Name", EditorStyles.boldLabel, GUILayout.Width(200));
                EditorGUILayout.LabelField("Image", EditorStyles.boldLabel, GUILayout.Width(75));
                EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));
                //EditorGUILayout.LabelField("Version", EditorStyles.boldLabel, GUILayout.Width (75));
                EditorGUILayout.LabelField("Release Status", EditorStyles.boldLabel, GUILayout.Width(100));
                EditorGUILayout.EndHorizontal();

                List <ApiWorld> tmpWorlds = new List <ApiWorld>();

                if (uploadedWorlds != null)
                {
                    tmpWorlds = new List <ApiWorld>(uploadedWorlds);
                }

                foreach (ApiWorld w in tmpWorlds)
                {
                    if (justDeletedContents != null && justDeletedContents.Contains(w.id))
                    {
                        continue;
                    }

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField(w.name, GUILayout.Width(200));
                    if (worldImages != null && worldImages.ContainsKey(w.id))
                    {
                        if (GUILayout.Button(worldImages[w.id], GUILayout.Height(100), GUILayout.Width(100)))
                        {
                            Application.OpenURL(w.imageUrl);
                        }
                    }
                    else
                    {
                        GUILayout.Label("No Image", GUILayout.Height(100), GUILayout.Width(100));
                    }
                    EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));
                    EditorGUILayout.LabelField(w.releaseStatus, GUILayout.Width(100));
                    EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));
                    if (GUILayout.Button("Copy ID", GUILayout.Width(75)))
                    {
                        TextEditor te = new TextEditor();
                        te.text = w.id;
                        te.SelectAll();
                        te.Copy();
                    }
                    if (GUILayout.Button("Delete", GUILayout.Width(75)))
                    {
                        if (EditorUtility.DisplayDialog("Delete " + w.name + "?", "Are you sure you want to delete " + w.name + "? This cannot be undone.", "Delete", "Cancel"))
                        {
                            ApiWorld.Delete(w.id, null, null);
                            uploadedWorlds.RemoveAll(world => world.id == w.id);

                            if (justDeletedContents == null)
                            {
                                justDeletedContents = new List <string>();
                            }
                            justDeletedContents.Add(w.id);
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Avatars", EditorStyles.boldLabel);
                EditorGUILayout.Space();

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Name", EditorStyles.boldLabel, GUILayout.Width(200));
                EditorGUILayout.LabelField("Image", EditorStyles.boldLabel, GUILayout.Width(75));
                EditorGUILayout.EndHorizontal();

                List <ApiAvatar> tmpAvatars = new List <ApiAvatar>();

                if (uploadedAvatars != null)
                {
                    tmpAvatars = new List <ApiAvatar>(uploadedAvatars);
                }

                foreach (ApiAvatar a in tmpAvatars)
                {
                    if (justDeletedContents != null && justDeletedContents.Contains(a.id))
                    {
                        continue;
                    }

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField(a.name, GUILayout.Width(200));
                    if (avatarImages != null && avatarImages.ContainsKey(a.id))
                    {
                        if (GUILayout.Button(avatarImages[a.id], GUILayout.Height(100), GUILayout.Width(100)))
                        {
                            Application.OpenURL(a.imageUrl);
                        }
                    }
                    else
                    {
                        GUILayout.Label("No Image", GUILayout.Height(100), GUILayout.Width(100));
                    }
                    EditorGUILayout.LabelField("", EditorStyles.boldLabel, GUILayout.Width(50));

                    if (GUILayout.Button("Copy ID", GUILayout.Width(75)))
                    {
                        TextEditor te = new TextEditor();
                        te.text = a.id;
                        te.SelectAll();
                        te.Copy();
                    }

                    if (GUILayout.Button("Delete", GUILayout.Width(75)))
                    {
                        if (EditorUtility.DisplayDialog("Delete " + a.name + "?", "Are you sure you want to delete " + a.name + "? This cannot be undone.", "Delete", "Cancel"))
                        {
                            ApiAvatar.Delete(a.id, null, null);
                            uploadedAvatars.RemoveAll(avatar => avatar.id == a.id);

                            if (justDeletedContents == null)
                            {
                                justDeletedContents = new List <string>();
                            }
                            justDeletedContents.Add(a.id);
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.EndScrollView();

                return(true);
            }
        }
        else
        {
            VRC.Core.ApiModel.ResetApi();

            username = EditorGUILayout.TextField("Username", username);
            password = EditorGUILayout.PasswordField("Password", password);

            if (GUILayout.Button("Sign In"))
            {
                APIUser.Login(username, password,
                              delegate(APIUser user)
                {
                    UnityEditor.EditorUtility.ClearProgressBar();
                    FetchWorldData();
                },
                              delegate(string message)
                {
                    VRC.Core.Logger.Log("Error logging in - " + message);
                    UnityEditor.EditorUtility.ClearProgressBar();
                    UnityEditor.EditorUtility.DisplayDialog("Error logging in", message, "Okay");
                }
                              );
                UnityEditor.EditorUtility.DisplayProgressBar("Logging in!", "Hang tight...", 0.5f);
            }
            if (GUILayout.Button("Sign up"))
            {
                Application.OpenURL("http://www.vrchat.net/auth/register");
            }
            return(false);
        }
    }