Esempio n. 1
0
        public FavoritesVRMenu(QMNestedButton parent, EthosVRButton config) : base(parent, config.X, config.Y, config.Name, config.Tooltip, GeneralUtils.GetColor(config.ColorScheme.Colors[0]), GeneralUtils.GetColor(config.ColorScheme.Colors[1]), GeneralUtils.GetColor(config.ColorScheme.Colors[2]), GeneralUtils.GetColor(config.ColorScheme.Colors[3]))
        {
            new QMSingleButton(this, 0, 0, "Next", delegate
            {
                //to-do
            }, "Go to the next page", Color.red, Color.white);

            new QMSingleButton(this, 0, 1, "Back", delegate
            {
                //to-do
            }, "Go back to the previous page", Color.red, Color.white);

            new QMSingleButton(this, 5, 0, "Add\nCurrent Avatar", delegate
            {
                var currentAvatar = GeneralWrappers.GetPlayerManager().GetCurrentPlayer().GetAPIAvatar();
                Configuration.GetConfig().ExtendedFavoritedAvatars.Add(new FavoritedAvatar(currentAvatar.name, currentAvatar.id, currentAvatar.authorName, currentAvatar.authorId));
                Configuration.SaveConfiguration();
                GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully added your current Avatar to extended favorites</color>");
            }, "Adds your current avatar to the extended favorites list", Color.red, Color.white);

            new QMSingleButton(this, 5, 1, "Remove\nCurrent Avatar", delegate
            {
                var currentAvatar = GeneralUtils.GetExtendedFavorite(GeneralWrappers.GetPlayerManager().GetCurrentPlayer().GetAPIAvatar().id);
                Configuration.GetConfig().ExtendedFavoritedAvatars.Remove(currentAvatar);
                Configuration.SaveConfiguration();
                GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully removed your current Avatar from extended favorites</color>");
            }, "Removes your current avatar from the extended favorites list", Color.red, Color.white);

            new QMToggleButton(this, 5, -1, "Delete\nMode", delegate
            {
                DeleteMode = true;
            }, "Normal\nMode", delegate
            {
                DeleteMode = false;
            }, "Enable/Disable Delete Mode, with this on, you can remove avatars from this list by just clicking their respective buttons", Color.red, Color.white);

            foreach (var avatar in Configuration.GetConfig().ExtendedFavoritedAvatars)
            {
                if (X == 4)
                {
                    if (Y != 2)
                    {
                        new QMSingleButton(this, X, Y, avatar.Name, delegate
                        {
                            if (DeleteMode)
                            {
                                Configuration.GetConfig().ExtendedFavoritedAvatars.Remove(avatar);
                                Configuration.SaveConfiguration();
                                GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully removed this Avatar from extended favorites</color>");
                            }
                            else
                            {
                                new ApiAvatar()
                                {
                                    id = avatar.ID
                                }.Get(new Action <ApiContainer>(x =>
                                {
                                    PAviSaved.avatar.field_Internal_ApiAvatar_0 = x.Model.Cast <ApiAvatar>(); // can fix better later.
                                    PAviSaved.ChangeToSelectedAvatar();
                                }), null, null, false);
                            }
                        }, $"by {avatar.Author}\nSwitch into this avatar.", Color.red, Color.white);
                        Y++;
                    }
                }
                else
                {
                    new QMSingleButton(this, X, Y, avatar.Name, delegate
                    {
                        if (DeleteMode)
                        {
                            Configuration.GetConfig().ExtendedFavoritedAvatars.Remove(avatar);
                            Configuration.SaveConfiguration();
                            GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully removed this Avatar from extended favorites</color>");
                        }
                        else
                        {
                            new ApiAvatar()
                            {
                                id = avatar.ID
                            }.Get(new Action <ApiContainer>(x =>
                            {
                                PAviSaved.avatar.field_Internal_ApiAvatar_0 = x.Model.Cast <ApiAvatar>(); // can fix better later.
                                PAviSaved.ChangeToSelectedAvatar();
                            }), null, null, false);
                        }
                    }, $"by {avatar.Author}\nSwitch into this avatar.", Color.red, Color.white);
                    X++;
                }
            }
        }
Esempio n. 2
0
        public FavoritesVRMenu(QMNestedButton parent) : base(parent, 4, 1, "Extended\nFavorites", "Open up the extended favorites menu and add more avatars than the default limit of 16", Color.red, Color.white, Color.red, Color.cyan)
        {
            new QMSingleButton(this, 0, 0, "Next", delegate
            {
                //to-do
            }, "Go to the next page", Color.red, Color.white);

            new QMSingleButton(this, 0, 1, "Back", delegate
            {
                //to-do
            }, "Go back to the previous page", Color.red, Color.white);

            new QMSingleButton(this, 5, 0, "Add\nCurrent Avatar", delegate
            {
                var currentAvatar = PlayerWrappers.GetCurrentPlayer().GetAPIAvatar();
                Configuration.GetConfig().ExtendedFavoritedAvatars.Add(new FavoritedAvatar(currentAvatar.name, currentAvatar.id, currentAvatar.authorName, currentAvatar.authorId));
                Configuration.SaveConfiguration();
                GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully added your current Avatar to extended favorites</color>");
            }, "Adds your current avatar to the extended favorites list", Color.red, Color.white);

            new QMSingleButton(this, 5, 1, "Remove\nCurrent Avatar", delegate
            {
                var currentAvatar = GeneralUtils.GetExtendedFavorite(PlayerWrappers.GetCurrentPlayer().GetAPIAvatar().id);
                Configuration.GetConfig().ExtendedFavoritedAvatars.Remove(currentAvatar);
                Configuration.SaveConfiguration();
                GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully removed your current Avatar from extended favorites</color>");
            }, "Removes your current avatar from the extended favorites list", Color.red, Color.white);

            new QMToggleButton(this, 5, -1, "Delete\nMode", delegate
            {
                DeleteMode = true;
            }, "Normal\nMode", delegate
            {
                DeleteMode = false;
            }, "Enable/Disable Delete Mode, with this on, you can remove avatars from this list by just clicking their respective buttons", Color.red, Color.white);

            foreach (var avatar in Configuration.GetConfig().ExtendedFavoritedAvatars)
            {
                if (X == 4)
                {
                    if (Y != 4)
                    {
                        new QMSingleButton(this, X, Y, avatar.Name, delegate
                        {
                            if (DeleteMode)
                            {
                                Configuration.GetConfig().ExtendedFavoritedAvatars.Remove(avatar);
                                Configuration.SaveConfiguration();
                                GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully removed this Avatar from extended favorites</color>");
                            }
                            else
                            {
                                VRC.Core.API.SendRequest($"avatars/{avatar.ID}", VRC.Core.BestHTTP.HTTPMethods.Get, new ApiModelContainer <ApiAvatar>(), null, true, true, 3600f, 2, null);
                                new PageAvatar
                                {
                                    avatar = new SimpleAvatarPedestal
                                    {
                                        field_Internal_ApiAvatar_0 = new ApiAvatar
                                        {
                                            id = avatar.ID
                                        }
                                    }
                                }.ChangeToSelectedAvatar();
                            }
                        }, $"by {avatar.Author}\nSwitch into this avatar.", Color.red, Color.white);
                    }
                    Y++;
                }
                else
                {
                    new QMSingleButton(this, X, Y, avatar.Name, delegate
                    {
                        if (DeleteMode)
                        {
                            Configuration.GetConfig().ExtendedFavoritedAvatars.Remove(avatar);
                            Configuration.SaveConfiguration();
                            GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully removed this Avatar from extended favorites</color>");
                        }
                        else
                        {
                            VRC.Core.API.SendRequest($"avatars/{avatar.ID}", VRC.Core.BestHTTP.HTTPMethods.Get, new ApiModelContainer <ApiAvatar>(), null, true, true, 3600f, 2, null);
                            new PageAvatar
                            {
                                avatar = new SimpleAvatarPedestal
                                {
                                    field_Internal_ApiAvatar_0 = new ApiAvatar
                                    {
                                        id = avatar.ID
                                    }
                                }
                            }.ChangeToSelectedAvatar();
                        }
                    }, $"by {avatar.Author}\nSwitch into this avatar.", Color.red, Color.white);
                    X++;
                }
            }
        }
Esempio n. 3
0
 public UtilsVRMenu(QMNestedButton parent) : base(parent, 1, 1, "Utils", "Extended utilities you can use to manage the game better", Color.red, Color.white, Color.red, Color.cyan)
 {
     new QMToggleButton(this, 1, 0, "Enable\nFlight", delegate
     {
         Physics.gravity     = Vector3.zero;
         GeneralUtils.Flight = true;
         GeneralUtils.ToggleColliders(!GeneralUtils.Flight);
     }, "Disable\nFlight", delegate
     {
         Physics.gravity     = GeneralUtils.SavedGravity;
         GeneralUtils.Flight = false;
         GeneralUtils.ToggleColliders(!GeneralUtils.Flight);
     }, "Toggle Flight and move around within the air with ease!", Color.red, Color.white).setToggleState(GeneralUtils.Flight);
     new QMToggleButton(this, 2, 0, "Enable\nESP", delegate
     {
         GeneralUtils.ESP   = true;
         GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
         for (int i = 0; i < array.Length; i++)
         {
             if (array[i].transform.Find("SelectRegion"))
             {
                 array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.SetColor("_Color", Color.red);
                 array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta);
                 GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
             }
         }
     }, "Disable\nESP", delegate
     {
         GeneralUtils.ESP   = false;
         GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
         for (int i = 0; i < array.Length; i++)
         {
             if (array[i].transform.Find("SelectRegion"))
             {
                 array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.SetColor("_Color", Color.red);
                 array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta);
                 GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
             }
         }
     }, "Decide whether you want the upper game, get an advantage, and see all players anywhere within the world.", Color.red, Color.white).setToggleState(GeneralUtils.ESP);
     new QMSingleButton(this, 3, 0, "Avatar\nBy\nID", delegate
     {
         ConsoleUtil.Info("Enter Avatar ID: ");
         string ID = Console.ReadLine();
         VRC.Core.API.SendRequest($"avatars/{ID}", VRC.Core.BestHTTP.HTTPMethods.Get, new ApiModelContainer <ApiAvatar>(), null, true, true, 3600f, 2, null);
         new PageAvatar
         {
             avatar = new SimpleAvatarPedestal
             {
                 field_Internal_ApiAvatar_0 = new ApiAvatar
                 {
                     id = ID
                 }
             }
         }.ChangeToSelectedAvatar();
         GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully cloned that avatar by It's Avatar ID.</color>");
     }, "Sets your current avatar using an avatar ID.", Color.red, Color.white);
     new QMSingleButton(this, 4, 0, "Join\nBy\nID", delegate
     {
         ConsoleUtil.Info("Enter Instance ID: ");
         string ID = Console.ReadLine();
         Networking.GoToRoom(ID);
     }, "Joins an instance by It's ID.", Color.red, Color.white);
 }
Esempio n. 4
0
        public UtilsVRMenu(QMNestedButton parent, EthosVRButton config) : base(parent, config.X, config.Y, config.Name, config.Tooltip, GeneralUtils.GetColor(config.ColorScheme.Colors[0]), GeneralUtils.GetColor(config.ColorScheme.Colors[1]), GeneralUtils.GetColor(config.ColorScheme.Colors[2]), GeneralUtils.GetColor(config.ColorScheme.Colors[3]))
        {
            new QMToggleButton(this, 1, 0, "Enable\nESP", delegate
            {
                GeneralUtils.ESP   = true;
                GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
                for (int i = 0; i < array.Length; i++)
                {
                    if (array[i].transform.Find("SelectRegion"))
                    {
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.color       = Color.green;
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.color = Color.red;
                        GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
                    }
                }

                foreach (VRCSDK2.VRC_Interactable vrc_Interactable in Resources.FindObjectsOfTypeAll <VRCSDK2.VRC_Interactable>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(vrc_Interactable.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }

                foreach (VRCSDK2.VRC_Pickup vrc_Pickup in Resources.FindObjectsOfTypeAll <VRCSDK2.VRC_Pickup>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(vrc_Pickup.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }

                foreach (PortalInternal portalInternal in Resources.FindObjectsOfTypeAll <PortalInternal>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(portalInternal.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }
            }, "Disable\nESP", delegate
            {
                GeneralUtils.ESP   = false;
                GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
                for (int i = 0; i < array.Length; i++)
                {
                    if (array[i].transform.Find("SelectRegion"))
                    {
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().material.color       = Color.green;
                        array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.color = Color.red;
                        GeneralWrappers.GetHighlightsFX().EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GeneralUtils.ESP);
                    }
                }

                foreach (VRCSDK2.VRC_Interactable vrc_Interactable in Resources.FindObjectsOfTypeAll <VRCSDK2.VRC_Interactable>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(vrc_Interactable.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }

                foreach (VRCSDK2.VRC_Pickup vrc_Pickup in Resources.FindObjectsOfTypeAll <VRCSDK2.VRC_Pickup>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(vrc_Pickup.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }

                foreach (PortalInternal portalInternal in Resources.FindObjectsOfTypeAll <PortalInternal>())
                {
                    GeneralWrappers.GetHighlightsFX().EnableOutline(portalInternal.GetComponentInChildren <Renderer>(), GeneralUtils.ESP);
                }
            }, "Decide whether you want the upper game, get an advantage, and see all players anywhere within the world.", Color.red, Color.white).setToggleState(GeneralUtils.ESP);

            new QMSingleButton(this, 2, 0, "Avatar\nBy\nID", delegate
            {
                ConsoleUtil.Info("Enter Avatar ID: ");
                string ID = Console.ReadLine();
                VRC.Core.API.SendRequest($"avatars/{ID}", VRC.Core.BestHTTP.HTTPMethods.Get, new ApiModelContainer <ApiAvatar>(), null, true, true, 3600f, 2, null);
                new PageAvatar
                {
                    avatar = new SimpleAvatarPedestal
                    {
                        field_Internal_ApiAvatar_0 = new ApiAvatar
                        {
                            id = ID
                        }
                    }
                }.ChangeToSelectedAvatar();
                GeneralWrappers.GetVRCUiPopupManager().AlertPopup("<color=cyan>Success!</color>", "<color=green>Successfully cloned that avatar by It's Avatar ID.</color>");
            }, "Sets your current avatar using an avatar ID.", Color.red, Color.white);

            new QMSingleButton(this, 3, 0, "Join\nBy\nID", delegate
            {
                ConsoleUtil.Info("Enter Instance ID: ");
                string ID = Console.ReadLine();
                Networking.GoToRoom(ID);
            }, "Joins an instance by It's ID.", Color.red, Color.white);

            new QMSingleButton(this, 4, 0, "Copy\nRoom\nID", delegate
            {
                Clipboard.SetText($"{RoomManagerBase.field_Internal_Static_ApiWorld_0.id}:{RoomManagerBase.field_Internal_Static_ApiWorld_0.instanceId}");
            }, "Copies the current instance's ID.", Color.red, Color.white);

            new QMToggleButton(this, 1, 1, "Can't Hear\non Non Friends", delegate
            {
                GeneralUtils.CantHearOnNonFriends = true;
                foreach (var player in GeneralWrappers.GetPlayerManager().GetAllPlayers())
                {
                    if (!APIUser.IsFriendsWith(player.GetAPIUser().id))
                    {
                        player.GetVRCPlayer().field_Internal_Boolean_3 = false;
                    }
                }
            }, "Can Hear\non Non Friends", delegate
            {
                GeneralUtils.CantHearOnNonFriends = false;
                foreach (var player in GeneralWrappers.GetPlayerManager().GetAllPlayers())
                {
                    if (!APIUser.IsFriendsWith(player.GetAPIUser().id))
                    {
                        player.GetVRCPlayer().field_Internal_Boolean_3 = true;
                    }
                }
            }, "Decide whether you want your friends to only hear you in game or not.", Color.red, Color.white).setToggleState(GeneralUtils.CantHearOnNonFriends);

            //new QMToggleButton(this, 2, 1, "Invisible\nOn", delegate
            //{
            //    GeneralUtils.Invisible = true;
            //}, "Invisible\nOff", delegate
            //{
            //    GeneralUtils.Invisible = false;
            //}, "Decide whether you want people to see you in game.", Color.red, Color.white).setToggleState(GeneralUtils.Invisible);
        }