public static void direct_menu_clone()
        {
            var qmenu = utils.get_quick_menu();

            if (qmenu != null)
            {
                var screensmenu = qmenu.transform.Find("UserInteractMenu");
                if (screensmenu != null && utils.get_quick_menu().field_Private_APIUser_0 != null)
                {
                    var userInfo = qmenu.get_selected_player();
                    if (userInfo != null && userInfo.prop_VRCAvatarManager_0 != null)
                    {
                        UserInteractMenu userInteractMenu = utils.get_interact_menu();
                        if (userInteractMenu != null && userInfo.prop_VRCAvatarManager_0.field_Private_ApiAvatar_0.releaseStatus == "public")
                        {
                            userInteractMenu.cloneAvatarButton.GetComponentInChildren <UnityEngine.UI.Text>().text = "Clone\nReady!";
                            userInteractMenu.cloneAvatarButton.interactable = true;
                        }
                        else
                        {
                            userInteractMenu.cloneAvatarButton.GetComponentInChildren <UnityEngine.UI.Text>().text = "Can't\nClone\nPrivate!";
                            userInteractMenu.cloneAvatarButton.interactable = false;
                        }
                    }
                }
            }
        }
Exemple #2
0
 private static bool CloneAvatarPrefix(ref UserInteractMenu __instance)
 {
     try
     {
         if (GeneralUtils.ForceClone)
         {
             if (__instance.menuController.activeAvatar.releaseStatus != "private")
             {
                 bool flag2 = !__instance.menuController.activeUser.allowAvatarCopying;
                 if (flag2)
                 {
                     __instance.cloneAvatarButton.gameObject.SetActive(true);
                     __instance.cloneAvatarButton.interactable = true;
                     __instance.cloneAvatarButtonText.color    = new Color(0.8117647f, 0f, 0f, 1f);
                     return(false);
                 }
                 else
                 {
                     __instance.cloneAvatarButton.gameObject.SetActive(true);
                     __instance.cloneAvatarButton.interactable = true;
                     __instance.cloneAvatarButtonText.color    = new Color(0.470588237f, 0f, 0.8117647f, 1f);
                     return(false);
                 }
             }
         }
     }
     catch { }
     return(true);
 }
        private static bool CloneAvatarPrefix(ref UserInteractMenu __instance)
        {
            bool flag = __instance.menuController.activeAvatar.releaseStatus == "private";
            bool result;

            if (flag)
            {
                __instance.cloneAvatarButton.gameObject.SetActive(true);
                __instance.cloneAvatarButton.interactable = false;
                __instance.cloneAvatarButtonText.color    = Color.cyan;
                __instance.cloneAvatarButton.onClick.AddListener(delegate
                {
                    /*
                     * var avi = QuickMenuStuff.GetQuickMenuInstance().GetSelectedPlayer().vrcPlayer.GetAvatar();
                     *
                     * if (VRCTrackingManager.IsInVRMode())
                     * {
                     *  avi.SaveAvatar(PlayerManager.GetCurrentPlayer().GetAPIUser(), avi.name, avi.description, avi.imageUrl);
                     * }
                     * else
                     * {
                     *  Console.WriteLine("Avatar Name? ");
                     *  string name = Console.ReadLine();
                     *  Console.WriteLine("Description? ");
                     *  string description = Console.ReadLine();
                     *
                     *  avi.SaveAvatar(PlayerManager.GetCurrentPlayer().GetAPIUser(), name, description, avi.imageUrl);
                     * }
                     */
                });
                result = false;
            }
            else
            {
                bool flag2 = !__instance.menuController.activeUser.allowAvatarCopying;
                if (flag2)
                {
                    __instance.cloneAvatarButton.gameObject.SetActive(true);
                    __instance.cloneAvatarButton.interactable = true;
                    __instance.cloneAvatarButtonText.color    = new Color(0.8117647f, 0f, 0f, 1f);
                    result = false;
                }
                else
                {
                    __instance.cloneAvatarButton.gameObject.SetActive(true);
                    __instance.cloneAvatarButton.interactable = true;
                    __instance.cloneAvatarButtonText.color    = new Color(0.470588237f, 0f, 0.8117647f, 1f);
                    result = false;
                }
            }
            return(result);
        }
Exemple #4
0
        public override void OnUpdate()
        {
            if (PlayerWrappers.GetCurrentPlayer() != null)
            {
                if (PlayerWrappers.GetCurrentPlayer().GetComponent <PlayerModComponentJump>() != null)
                {
                    PlayerWrappers.GetCurrentPlayer().gameObject.AddComponent <PlayerModComponentJump>();
                }
            }

            if (Input.GetKeyDown(KeyCode.F10))
            {
                GlobalUtils.DirectionalFlight = !GlobalUtils.DirectionalFlight;
                Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav;
                if (!GlobalUtils.DirectionalFlight)
                {
                    GlobalUtils.ToggleColliders(true);
                }
                UIButtons.ToggleUIButton(0, GlobalUtils.DirectionalFlight);
                MelonModLogger.Log($"Flight has been {(GlobalUtils.DirectionalFlight ? "Enabled" : "Disabled")}.");
            }
            if (Input.GetKeyDown(KeyCode.F11))
            {
                GlobalUtils.SelectedPlayerESP = !GlobalUtils.SelectedPlayerESP;
                MelonModLogger.Log($"Selected ESP has been {(GlobalUtils.SelectedPlayerESP ? "Enabled" : "Disabled")}.");
                UIButtons.ToggleUIButton(1, GlobalUtils.SelectedPlayerESP);
                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>().sharedMaterial.SetColor("_Color", Color.magenta);
                        HighlightsFX.prop_HighlightsFX_0.EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GlobalUtils.SelectedPlayerESP);
                    }
                }

                foreach (VRC_Pickup pickup in Resources.FindObjectsOfTypeAll <VRC_Pickup>())
                {
                    if (pickup.gameObject.transform.Find("SelectRegion"))
                    {
                        pickup.gameObject.transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta);
                        Wrappers.GetHighlightsFX().EnableOutline(pickup.gameObject.transform.Find("SelectRegion").GetComponent <Renderer>(), GlobalUtils.SelectedPlayerESP);
                    }
                }
            }

            if (GlobalUtils.DirectionalFlight)
            {
                GameObject gameObject   = Wrappers.GetPlayerCamera();
                var        currentSpeed = (Input.GetKey(KeyCode.LeftShift) ? 16f : 8f);
                var        player       = PlayerWrappers.GetCurrentPlayer();

                if (Input.GetKey(KeyCode.W))
                {
                    player.transform.position += gameObject.transform.forward * currentSpeed * Time.deltaTime;
                }
                if (Input.GetKey(KeyCode.A))
                {
                    player.transform.position += player.transform.right * -1f * currentSpeed * Time.deltaTime;
                }
                if (Input.GetKey(KeyCode.S))
                {
                    player.transform.position += gameObject.transform.forward * -1f * currentSpeed * Time.deltaTime;
                }
                if (Input.GetKey(KeyCode.D))
                {
                    player.transform.position += player.transform.right * currentSpeed * Time.deltaTime;
                }
                if (Input.GetKey(KeyCode.Space))
                {
                    player.transform.position += player.transform.up * currentSpeed * Time.deltaTime;
                }
                if (Math.Abs(Input.GetAxis("Joy1 Axis 2")) > 0f)
                {
                    player.transform.position += gameObject.transform.forward * currentSpeed * Time.deltaTime * (Input.GetAxis("Joy1 Axis 2") * -1f);
                }
                if (Math.Abs(Input.GetAxis("Joy1 Axis 1")) > 0f)
                {
                    player.transform.position += gameObject.transform.right * currentSpeed * Time.deltaTime * Input.GetAxis("Joy1 Axis 1");
                }
            }

            if (GlobalUtils.ForceClone)
            {
                if (UnityEngine.Object.FindObjectOfType <UserInteractMenu>() != null)
                {
                    if (CachedUserInteract == null)
                    {
                        CachedUserInteract = UnityEngine.Object.FindObjectOfType <UserInteractMenu>();
                    }

                    if (CachedUserInteract.menuController.activeUser != null)
                    {
                        if (CachedUserInteract.menuController.activeAvatar.releaseStatus == "private")
                        {
                            CachedUserInteract.cloneAvatarButtonText.color = Color.red;
                            CachedUserInteract.cloneAvatarButtonText.text  = "Private\nAvatar";
                            CachedUserInteract.menuController.activeUser.allowAvatarCopying = false;
                            CachedUserInteract.cloneAvatarButton.interactable = false;
                        }
                        else if (!CachedUserInteract.menuController.activeUser.allowAvatarCopying)
                        {
                            CachedUserInteract.cloneAvatarButtonText.color = Color.cyan;
                            CachedUserInteract.cloneAvatarButtonText.text  = "Force\nClone";
                            CachedUserInteract.menuController.activeUser.allowAvatarCopying = true;
                            CachedUserInteract.cloneAvatarButton.interactable = true;
                        }
                        else
                        {
                            CachedUserInteract.cloneAvatarButtonText.color = Color.white;
                            CachedUserInteract.cloneAvatarButtonText.text  = "Clone\nAvatar";
                        }
                    }
                }
            }
        }