From aa584e231f4c00027f6fa445beacfe544eba5df3 Mon Sep 17 00:00:00 2001 From: iiDk <@> Date: Sun, 1 Dec 2024 20:19:58 -0500 Subject: [PATCH] 5.1.0 --- Classes/RigManager.cs | 5 +- Menu/Main.cs | 162 +++++++-- Menu/UI.cs | 4 + Mods/Advantages.cs | 24 +- Mods/Buttons.cs | 106 ++++-- Mods/Experimental.cs | 126 ++++--- Mods/Fun.cs | 219 ++++++++---- Mods/Miscellaneous.cs | 12 +- Mods/Movement.cs | 303 ++++++++++++---- Mods/Overpowered.cs | 732 ++++++++++++++++++++++++--------------- Mods/Projectiles.cs | 26 +- Mods/Safety.cs | 40 +++ Mods/Settings.cs | 115 +++++- Mods/Sound.cs | 40 ++- Mods/Visuals.cs | 23 +- Notifications/Library.cs | 8 + Patches/GrabPatch.cs | 23 ++ Patches/RequestPatch.cs | 79 +++++ Patches/Safety.cs | 61 ++-- Plugin.cs | 3 +- PluginInfo.cs | 2 +- 21 files changed, 1495 insertions(+), 618 deletions(-) create mode 100644 Patches/GrabPatch.cs create mode 100644 Patches/RequestPatch.cs diff --git a/Classes/RigManager.cs b/Classes/RigManager.cs index fddd61f..dd21301 100644 --- a/Classes/RigManager.cs +++ b/Classes/RigManager.cs @@ -1,5 +1,4 @@ -using BepInEx; -using HarmonyLib; +using HarmonyLib; using Photon.Pun; using Photon.Realtime; using UnityEngine; @@ -44,7 +43,7 @@ public static VRRig GetClosestVRRig() public static PhotonView GetPhotonViewFromVRRig(VRRig p) { - return (PhotonView)Traverse.Create(p).Field("photonView").GetValue(); + return GetNetworkViewFromVRRig(p).GetView; } public static NetworkView GetNetworkViewFromVRRig(VRRig p) diff --git a/Menu/Main.cs b/Menu/Main.cs index 17ce6de..e96701c 100644 --- a/Menu/Main.cs +++ b/Menu/Main.cs @@ -7,7 +7,6 @@ using HarmonyLib; using iiMenu.Classes; using iiMenu.Mods; -using iiMenu.Mods.Spammers; using iiMenu.Notifications; using Photon.Pun; using Photon.Realtime; @@ -22,14 +21,12 @@ using System.Threading.Tasks; using TMPro; using UnityEngine; -using UnityEngine.Experimental.AI; using UnityEngine.InputSystem; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.UI; using UnityEngine.XR; using Valve.VR; -using WebSocketSharp; using static iiMenu.Classes.RigManager; /* @@ -100,6 +97,13 @@ public static void Prefix() { joystickButtonSelected = 0; } + if (physicalMenu) + { + if (buttonCondition) + physicalOpenPosition = Vector3.zero; + + buttonCondition = true; + } buttonCondition = buttonCondition || isKeyboardCondition; buttonCondition = buttonCondition && !lockdown; buttonCondition = buttonCondition || isSearching; @@ -598,7 +602,7 @@ public static void Prefix() UnityEngine.Debug.Log("Could not load preferences"); } } - LoadServerData(); + CoroutineManager.RunCoroutine(LoadServerData(false)); } } catch { } @@ -613,6 +617,44 @@ public static void Prefix() } catch { } + // Gradually reload data to ensure updated admin list + try + { + if (nextTimeUntilReload > 0f) + { + if (Time.time > nextTimeUntilReload) + { + nextTimeUntilReload = Time.time + 60f; + CoroutineManager.RunCoroutine(LoadServerData(true)); + } + } else + { + nextTimeUntilReload = Time.time + 60f; + } + } catch { } + + // Remove physical menu reference if too far away + if (physicalMenu && menu != null) + { + try + { + if (Vector3.Distance(GorillaTagger.Instance.bodyCollider.transform.position, menu.transform.position) < 1.5f) + { + if (reference == null) + { + CreateReference(); + } + } else + { + if (reference != null) + { + UnityEngine.Object.Destroy(reference); + reference = null; + } + } + } catch { } + } + // Ghostview try { @@ -1335,6 +1377,10 @@ private static void AddButton(float offset, int buttonIndex, ButtonInfo method) { text2.text = TranslateText(text2.text); } + if (inputTextColor != "green") + { + text2.text = text2.text.Replace(" [", " ["); + } if (lowercaseMode) { text2.text = text2.text.ToLower(); @@ -2464,6 +2510,18 @@ public static void RecenterMenu() { isOnPC = false; } + + if (physicalMenu) + { + if (physicalOpenPosition == Vector3.zero) + { + physicalOpenPosition = menu.transform.position; + physicalOpenRotation = menu.transform.rotation; + } + + menu.transform.position = physicalOpenPosition; + menu.transform.rotation = physicalOpenRotation; + } } private static void AddPageButtons() @@ -3288,20 +3346,29 @@ public static string GetHttp(string url) return html; } + private static Vector3 GunPositionSmoothed = Vector3.zero; public static (RaycastHit Ray, GameObject NewPointer) RenderGun() { - Physics.Raycast(GorillaTagger.Instance.rightHandTransform.position - (legacyGunDirection ? GorillaTagger.Instance.rightHandTransform.up : Vector3.zero), legacyGunDirection ? -GorillaTagger.Instance.rightHandTransform.up : GorillaTagger.Instance.rightHandTransform.forward, out var Ray, 512f, NoInvisLayerMask()); + Physics.Raycast(SwapGunHand ? (GorillaTagger.Instance.leftHandTransform.position - (legacyGunDirection ? GorillaTagger.Instance.leftHandTransform.up / 4f : Vector3.zero)) : (GorillaTagger.Instance.rightHandTransform.position - (legacyGunDirection ? GorillaTagger.Instance.rightHandTransform.up / 4f : Vector3.zero)), SwapGunHand ? (legacyGunDirection ? -GorillaTagger.Instance.leftHandTransform.up : GorillaTagger.Instance.leftHandTransform.forward) : (legacyGunDirection ? -GorillaTagger.Instance.rightHandTransform.up : GorillaTagger.Instance.rightHandTransform.forward), out var Ray, 512f, NoInvisLayerMask()); if (shouldBePC) { Ray ray = TPC.ScreenPointToRay(Mouse.current.position.ReadValue()); Physics.Raycast(ray, out Ray, 512f, NoInvisLayerMask()); } + Vector3 StartPosition = SwapGunHand ? GorillaTagger.Instance.leftHandTransform.position : GorillaTagger.Instance.rightHandTransform.position; + Vector3 EndPosition = isCopying ? whoCopy.transform.position : Ray.point; + if (SmoothGunPointer) + { + GunPositionSmoothed = Vector3.Lerp(GunPositionSmoothed, EndPosition, Time.deltaTime * 4f); + EndPosition = GunPositionSmoothed; + } + GameObject NewPointer = GameObject.CreatePrimitive(PrimitiveType.Sphere); NewPointer.GetComponent().material.shader = Shader.Find("GUI/Text Shader"); - NewPointer.GetComponent().material.color = (isCopying || (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed)) ? GetBDColor(0f) : GetBRColor(0f); + NewPointer.GetComponent().material.color = (isCopying || GetGunInput(true)) ? GetBDColor(0f) : GetBRColor(0f); NewPointer.transform.localScale = smallGunPointer ? new Vector3(0.1f, 0.1f, 0.1f) : new Vector3(0.2f, 0.2f, 0.2f); - NewPointer.transform.position = isCopying ? whoCopy.transform.position : Ray.point; + NewPointer.transform.position = EndPosition; if (disableGunPointer) { NewPointer.GetComponent().enabled = false; @@ -3322,19 +3389,29 @@ public static (RaycastHit Ray, GameObject NewPointer) RenderGun() liner.endWidth = 0.025f; liner.positionCount = 2; liner.useWorldSpace = true; - liner.SetPosition(0, GorillaTagger.Instance.rightHandTransform.position); - liner.SetPosition(1, isCopying ? whoCopy.transform.position : Ray.point); + liner.SetPosition(0, StartPosition); + liner.SetPosition(1, EndPosition); UnityEngine.Object.Destroy(line, Time.deltaTime); } return (Ray, NewPointer); } - public static void LoadServerData() + public static bool GetGunInput(bool isShooting) + { + if (isShooting) + return (SwapGunHand ? leftTrigger > 0.5f : rightTrigger > 0.5f) || Mouse.current.leftButton.isPressed; + else + return (SwapGunHand ? leftGrab : rightGrab) || Mouse.current.rightButton.isPressed; + } + + public static float nextTimeUntilReload = -1f; + private static bool hasWarnedVersionBefore = false; + private static bool hasadminedbefore = false; + public static System.Collections.IEnumerator LoadServerData(bool reloading) { try { - UnityEngine.Debug.Log("Loading data from GitHub"); WebRequest request = WebRequest.Create("https://raw.githubusercontent.com/iiDk-the-actual/ModInfo/main/iiMenu_ServerData.txt"); WebResponse response = request.GetResponse(); Stream data = response.GetResponseStream(); @@ -3343,7 +3420,7 @@ public static void LoadServerData() { html = sr.ReadToEnd(); } - UnityEngine.Debug.Log("Data received"); + shouldAttemptLoadData = false; string[] Data = html.Split("\n"); @@ -3352,30 +3429,37 @@ public static void LoadServerData() serverLink = Data[3]; } - if (Data[0] != PluginInfo.Version) + if (!hasWarnedVersionBefore) { - if (!isBetaTestVersion) - { - UnityEngine.Debug.Log("Version is outdated"); - Important.JoinDiscord(); - NotifiLib.SendNotification("[OUTDATED] You are using an outdated version of the menu. Please update to " + Data[0] + ".", 10000); - } else + if (Data[0] != PluginInfo.Version) { - UnityEngine.Debug.Log("Version is outdated, but user is on beta"); - NotifiLib.SendNotification("[BETA] You are using a testing build of the menu. The latest release build is " + Data[0] + ".", 10000); + if (!isBetaTestVersion) + { + hasWarnedVersionBefore = true; + UnityEngine.Debug.Log("Version is outdated"); + Important.JoinDiscord(); + NotifiLib.SendNotification("[OUTDATED] You are using an outdated version of the menu. Please update to " + Data[0] + ".", 10000); + } + else + { + hasWarnedVersionBefore = true; + UnityEngine.Debug.Log("Version is outdated, but user is on beta"); + NotifiLib.SendNotification("[BETA] You are using a testing build of the menu. The latest release build is " + Data[0] + ".", 10000); + } } - } else - { - if (isBetaTestVersion) + else { - UnityEngine.Debug.Log("Version is outdated, user is on early build of latest"); - Important.JoinDiscord(); - NotifiLib.SendNotification("[OUTDATED] You are using a testing build of the menu. Please update to " + Data[0] + ".", 10000); + if (isBetaTestVersion) + { + hasWarnedVersionBefore = true; + UnityEngine.Debug.Log("Version is outdated, user is on early build of latest"); + Important.JoinDiscord(); + NotifiLib.SendNotification("[OUTDATED] You are using a testing build of the menu. Please update to " + Data[0] + ".", 10000); + } } } if (Data[0] == "lockdown") { - UnityEngine.Debug.Log("Version is on lockdown"); NotifiLib.SendNotification("[LOCKDOWN] " + Data[2], 10000); bgColorA = Color.red; bgColorB = Color.red; @@ -3392,18 +3476,17 @@ public static void LoadServerData() } try { - if (admins.ContainsKey(PhotonNetwork.LocalPlayer.UserId)) + if (admins.ContainsKey(PhotonNetwork.LocalPlayer.UserId) && !hasadminedbefore) { + hasadminedbefore = true; SetupAdminPanel(admins[PhotonNetwork.LocalPlayer.UserId]); - } else - { - Buttons.buttons[23] = new ButtonInfo[] { }; } } catch { } motdTemplate = Data[2]; } catch { } + yield return null; } public static void SetupAdminPanel(string playername) @@ -3459,6 +3542,11 @@ public static string GetFileExtension(string fileName) return fileName.ToLower().Split(".")[fileName.Split(".").Length - 1]; } + public static string RemoveLastDirectory(string directory) + { + return directory == "" || directory.LastIndexOf('/') <= 0 ? "" : directory.Substring(0, directory.LastIndexOf('/')); + } + public static string RemoveFileExtension(string file) { int index = 0; @@ -4770,6 +4858,9 @@ public static void OnLaunch() public static bool doButtonsVibrate = true; public static bool joystickMenu = false; + public static bool physicalMenu = false; + public static Vector3 physicalOpenPosition = Vector3.zero; + public static Quaternion physicalOpenRotation = Quaternion.identity; public static bool joystickOpen = false; public static int joystickButtonSelected = 0; public static string joystickSelectedButton = ""; @@ -4796,10 +4887,12 @@ public static void OnLaunch() public static bool checkMode = false; public static bool lastChecker = false; + public static bool SmoothGunPointer = false; public static bool smallGunPointer = false; public static bool disableGunPointer = false; public static bool disableGunLine = false; public static bool legacyGunDirection = false; + public static bool SwapGunHand = false; public static int fontCycle = 0; public static int fontStyleType = 2; @@ -4844,10 +4937,10 @@ public static void OnLaunch() "If you get banned while using this, it's your responsibility."; public static bool shouldBePC = false; - public static bool rightPrimary = false; - public static bool rightSecondary = false; public static bool leftPrimary = false; public static bool leftSecondary = false; + public static bool rightPrimary = false; + public static bool rightSecondary = false; public static bool leftGrab = false; public static bool rightGrab = false; public static float leftTrigger = 0f; @@ -5175,6 +5268,7 @@ public static void OnLaunch() public static float startY = -1f; public static bool lowercaseMode = false; + public static string inputTextColor = "green"; public static bool annoyingMode = false; // Build with this enabled for a surprise public static string[] facts = new string[] { diff --git a/Menu/UI.cs b/Menu/UI.cs index 0c2c570..dc78d7c 100644 --- a/Menu/UI.cs +++ b/Menu/UI.cs @@ -213,6 +213,10 @@ private void OnGUI() { toadd = TranslateText(toadd); } + if (inputTextColor != "green") + { + toadd = toadd.Replace(" [", " ["); + } if (lowercaseMode) { toadd = toadd.ToLower(); diff --git a/Mods/Advantages.cs b/Mods/Advantages.cs index 008afec..0178c81 100644 --- a/Mods/Advantages.cs +++ b/Mods/Advantages.cs @@ -143,7 +143,7 @@ public static void SpamTagSelf() public static void SpamTagGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -171,7 +171,7 @@ public static void SpamTagGun() } } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig && !PlayerIsTagged(possibly)) @@ -419,7 +419,7 @@ public static void DisableTagReach() public static void TagGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -495,7 +495,7 @@ public static void TagGun() GorillaTagger.Instance.offlineVRRig.enabled = true; } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig && !PlayerIsTagged(possibly)) @@ -527,13 +527,13 @@ public static void TagGun() public static void UntagGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig && PlayerIsTagged(possibly)) @@ -552,13 +552,13 @@ public static void UntagGun() public static void FlickTagGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GorillaLocomotion.Player.Instance.rightControllerTransform.position = Ray.point + new Vector3(0f, 0.3f, 0f); } @@ -864,13 +864,13 @@ public static void BattleBalloonSpam() public static void BattleKillGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -921,13 +921,13 @@ public static void BattleKillAll() public static void BattleReviveGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) diff --git a/Mods/Buttons.cs b/Mods/Buttons.cs index d302b8e..1800f93 100644 --- a/Mods/Buttons.cs +++ b/Mods/Buttons.cs @@ -14,7 +14,7 @@ public class Buttons new ButtonInfo[] { // Main Stuff [0] new ButtonInfo { buttonText = "Join Discord", method =() => Important.JoinDiscord(), isTogglable = false, toolTip = "Invites you to join the ii's Stupid Mods Discord server."}, new ButtonInfo { buttonText = "Settings", method =() => Settings.EnableSettings(), isTogglable = false, toolTip = "Opens the settings menu."}, - + new ButtonInfo { buttonText = "Favorite Mods", method =() => Settings.EnableFavorites(), isTogglable = false, toolTip = "Opens your favorite mods. Favorite mods with left grip."}, new ButtonInfo { buttonText = "Enabled Mods", method =() => Settings.EnableEnabled(), isTogglable = false, toolTip = "Shows all mods you have enabled."}, new ButtonInfo { buttonText = "Room Mods", method =() => Settings.EnableRoom(), isTogglable = false, toolTip = "Opens the room mods."}, @@ -49,17 +49,17 @@ public class Buttons new ButtonInfo { buttonText = "Both Hands", enableMethod =() => Settings.BothHandsOn(), disableMethod =() => Settings.BothHandsOff(), toolTip = "Puts the menu on your both of your hands."}, new ButtonInfo { buttonText = "One Handed Menu", enableMethod =() => Settings.BarkMenuOn(), disableMethod =() => Settings.BarkMenuOff(), toolTip = "Makes the menu open in front of you, so you can use it with one hand."}, - new ButtonInfo { buttonText = "Joystick Menu", enableMethod =() => Settings.JoystickMenuOn(), disableMethod =() => Settings.JoystickMenuOff(), toolTip = "Makes the menu like Colossal, click your joysticks to open, joysticks to move between mods and pages, and click your left joystick to toggle a mod."}, - new ButtonInfo { buttonText = "Inner Outline Menu", toolTip = "Gives the menu an outline on the inside."}, - new ButtonInfo { buttonText = "Outline Menu", enableMethod =() => Settings.OutlineMenuOn(), disableMethod =() => Settings.OutlineMenuOff(), toolTip = "Gives the menu objects an outline."}, - new ButtonInfo { buttonText = "Wrist Menu", enableMethod =() => Settings.WristThingOn(), disableMethod =() => Settings.WristThingOff(), toolTip = "Makes the menu like a weird wrist watch, click your hand to open it."}, - new ButtonInfo { buttonText = "Watch Menu", enableMethod =() => Settings.WatchMenuOn(), disableMethod =() => Settings.WatchMenuOff(), toolTip = "Makes the menu like pocket watch, click your joystick to toggle, and move your joystick to select a mod."}, + new ButtonInfo { buttonText = "Joystick Menu", enableMethod =() => Settings.JoystickMenuOn(), disableMethod =() => Settings.JoystickMenuOff(), toolTip = "Makes the menu into something like Colossal, click your joysticks to open, joysticks to move between mods and pages, and click your left joystick to toggle a mod."}, + new ButtonInfo { buttonText = "Physical Menu", enableMethod =() => Settings.PhysicalMenuOn(), disableMethod =() => Settings.PhysicalMenuOff(), toolTip = "Freezes the menu in world space."}, + new ButtonInfo { buttonText = "Wrist Menu", enableMethod =() => Settings.WristThingOn(), disableMethod =() => Settings.WristThingOff(), toolTip = "Turns the menu into a weird wrist watch, click your hand to open it."}, + new ButtonInfo { buttonText = "Watch Menu", enableMethod =() => Settings.WatchMenuOn(), disableMethod =() => Settings.WatchMenuOff(), toolTip = "Turns the menu into a watch, click your joystick to toggle, and move your joystick to select a mod."}, new ButtonInfo { buttonText = "Shiny Menu", enableMethod =() => Settings.ShinyMenu(), disableMethod =() => Settings.NoShinyMenu(), toolTip = "Makes the menu's textures use the old shader."}, new ButtonInfo { buttonText = "Thick Menu", enableMethod =() => Settings.ThinMenuOn(), disableMethod =() => Settings.ThinMenuOff(), toolTip = "Makes the menu thin."}, new ButtonInfo { buttonText = "Long Menu", enableMethod =() => Settings.LongMenuOn(), disableMethod =() => Settings.LongMenuOff(), toolTip = "Makes the menu long."}, new ButtonInfo { buttonText = "Flip Menu", enableMethod =() => Settings.FlipMenu(), disableMethod =() => Settings.NonFlippedMenu(), toolTip = "Flips the menu to the back of your hand."}, - new ButtonInfo { buttonText = "Change Menu Language", overlapText = "Change Menu Language [English]", method =() => Settings.ChangeMenuLanguage(), isTogglable = false, toolTip = "Changes the language of the menu."}, + new ButtonInfo { buttonText = "Outline Menu", enableMethod =() => Settings.OutlineMenuOn(), disableMethod =() => Settings.OutlineMenuOff(), toolTip = "Gives the menu objects an outline."}, + new ButtonInfo { buttonText = "Inner Outline Menu", toolTip = "Gives the menu an outline on the inside."}, new ButtonInfo { buttonText = "Freeze Player in Menu", method =() => Settings.FreezePlayerInMenu(), enableMethod =() => Settings.FreezePlayerInMenuEnabled(), toolTip = "Freezes your character when inside the menu."}, new ButtonInfo { buttonText = "Freeze Rig in Menu", method =() => Settings.FreezeRigInMenu(), disableMethod =() => Movement.EnableRig(), toolTip = "Freezes your rig when inside the menu."}, @@ -70,13 +70,14 @@ public class Buttons new ButtonInfo { buttonText = "Dynamic Animations", enableMethod =() => Settings.DynamicAnimations(), disableMethod =() => Settings.NoDynamicAnimations(), toolTip = "Adds more animations to the menu, giving you a better sense of control."}, new ButtonInfo { buttonText = "Dynamic Sounds", enableMethod =() => Settings.DynamicSounds(), disableMethod =() => Settings.NoDynamicSounds(), toolTip = "Adds more sounds to the menu, giving you a better sense of control."}, - new ButtonInfo { buttonText = "Voice Commands", enableMethod =() => Settings.VoiceRecognitionOn(), disableMethod =() => Settings.VoiceRecognitionOff(), toolTip = "Enable and disable sounds with your voice. Activate it like how you would any other voice assistant, like \"Jarvis\"."}, + new ButtonInfo { buttonText = "Voice Commands", enableMethod =() => Settings.VoiceRecognitionOn(), disableMethod =() => Settings.VoiceRecognitionOff(), toolTip = "Enable and disable sounds with your voice. Activate it like how you would any other voice assistant, such as \"Jarvis\"."}, new ButtonInfo { buttonText = "Chain Voice Commands", toolTip = "Makes voice commands chain together, so you don't have to repeatedly ask it to listen to you."}, new ButtonInfo { buttonText = "Annoying Mode", enableMethod =() => Settings.AnnoyingModeOn(), disableMethod =() => Settings.AnnoyingModeOff(), toolTip = "Turns on the April Fools 2024 settings."}, new ButtonInfo { buttonText = "Lowercase Mode", enableMethod =() => Settings.LowercaseMode(), disableMethod =() => Settings.NoLowercaseMode(), toolTip = "Makes the entire menu's text lowercase."}, new ButtonInfo { buttonText = "Overflow Mode", enableMethod =() => Settings.OverflowMode(), disableMethod =() => Settings.NoOverflowMode(), toolTip = "Makes the entire menu's text overflow."}, + new ButtonInfo { buttonText = "Change Menu Language", overlapText = "Change Menu Language [English]", method =() => Settings.ChangeMenuLanguage(), isTogglable = false, toolTip = "Changes the language of the menu."}, new ButtonInfo { buttonText = "Change Menu Theme", method =() => Settings.ChangeMenuTheme(), isTogglable = false, toolTip = "Changes the theme of the menu."}, new ButtonInfo { buttonText = "Custom Menu Theme", enableMethod =() => Settings.CustomMenuTheme(), disableMethod =() => Settings.FixTheme(), toolTip = "Changes the theme of the menu to a custom one."}, new ButtonInfo { buttonText = "Change Custom Menu Theme", method =() => Settings.ChangeCustomMenuTheme(), isTogglable = false, toolTip = "Changes the theme of custom the menu."}, @@ -85,25 +86,28 @@ public class Buttons new ButtonInfo { buttonText = "Change Arrow Type", method =() => Settings.ChangeArrowType(), isTogglable = false, toolTip = "Changes the type of arrows on the page buttons."}, new ButtonInfo { buttonText = "Change Font Type", method =() => Settings.ChangeFontType(), isTogglable = false, toolTip = "Changes the type of font."}, new ButtonInfo { buttonText = "Change Font Style Type", method =() => Settings.ChangeFontStyleType(), isTogglable = false, toolTip = "Changes the style of the font."}, + new ButtonInfo { buttonText = "Change Input Text Color", overlapText = "Change Input Text Color [Green]", method =() => Settings.ChangeInputTextColor(), isTogglable = false, toolTip = "Changes the color of the input indicator next to the buttons."}, new ButtonInfo { buttonText = "Change PC Menu Background", method =() => Settings.ChangePCUI(), isTogglable = false, toolTip = "Changes the background of the PC ui."}, new ButtonInfo { buttonText = "Change Notification Time", overlapText = "Change Notification Time [1]", method =() => Settings.ChangeNotificationTime(), isTogglable = false, toolTip = "Changes the time before a notification is removed."}, new ButtonInfo { buttonText = "Change Pointer Position", method =() => Settings.ChangePointerPosition(), isTogglable = false, toolTip = "Changes the position of the pointer."}, new ButtonInfo { buttonText = "Swap GUI Colors", toolTip = "Swaps the GUI colors to the enabled color, for darker themes."}, + new ButtonInfo { buttonText = "Swap Gun Hand", enableMethod =() => Settings.EnableSwapGunHand(), disableMethod =() => Settings.DisableSwapGunHand(), toolTip = "Swaps the hand gun mods work with."}, new ButtonInfo { buttonText = "Small Gun Pointer", enableMethod =() => Settings.SmallGunPointer(), disableMethod =() => Settings.BigGunPointer(), toolTip = "Makes the ball at the end of every gun mod smaller."}, + new ButtonInfo { buttonText = "Smooth Gun Pointer", enableMethod =() => Settings.DoSmoothGunPointer(), disableMethod =() => Settings.NoSmoothGunPointer(), toolTip = "Makes the ball at the end of every gun mod smoother."}, new ButtonInfo { buttonText = "Disable Gun Pointer", enableMethod =() => Settings.NoGunPointer(), disableMethod =() => Settings.YesGunPointer(), toolTip = "Disables the ball at the end of every gun mod."}, new ButtonInfo { buttonText = "Disable Gun Line", enableMethod =() => Settings.NoGunLine(), disableMethod =() => Settings.YesGunLine(), toolTip = "Disables the gun from your hand to the end of every gun mod."}, new ButtonInfo { buttonText = "Legacy Gun Direction", enableMethod =() => Settings.LegacyGunDirection(), disableMethod =() => Settings.NewGunDirection(), toolTip = "Makes the guns come out of the bottom of your hand instead of your thumb."}, - new ButtonInfo { buttonText = "Checkbox Buttons", enableMethod =() => Settings.CheckboxButtons(), disableMethod =() => Settings.CheckboxButtonsOff(), toolTip = "Makes the buttons like checkboxes."}, + new ButtonInfo { buttonText = "Checkbox Buttons", enableMethod =() => Settings.CheckboxButtons(), disableMethod =() => Settings.CheckboxButtonsOff(), toolTip = "Turns the buttons into checkboxes."}, new ButtonInfo { buttonText = "cbsound", overlapText = "Change Button Sound [Wood]", method =() => Settings.ChangeButtonSound(), isTogglable = false, toolTip = "Changes the button click sound."}, new ButtonInfo { buttonText = "cbvol", overlapText = "Change Button Volume [4]", method =() => Settings.ChangeButtonVolume(), isTogglable = false, toolTip = "Changes the volume of the buttons."}, new ButtonInfo { buttonText = "Serversided Button Sounds", toolTip = "Lets everyone in the the room hear the buttons."}, new ButtonInfo { buttonText = "Disable Button Vibration", enableMethod =() => Settings.DisableButtonVibration(), disableMethod =() => Settings.EnableButtonVibration(), toolTip = "Disables the slight vibration that happens when you click a button."}, new ButtonInfo { buttonText = "Clear Notifications on Disconnect", toolTip = "Clears all notifications on disconnect."}, - new ButtonInfo { buttonText = "Hide Notifications on Camera", toolTip = "Makes notifications only render in VR."}, + new ButtonInfo { buttonText = "Hide Notifications on Camera", overlapText = "Streamer Mode Notifications", toolTip = "Makes notifications only render in VR."}, new ButtonInfo { buttonText = "Disable Notifications", enableMethod =() => Settings.DisableNotifications(), disableMethod =() => Settings.EnableNotifications(), toolTip = "Disables all notifications."}, new ButtonInfo { buttonText = "Disable Enabled GUI", overlapText = "Disable Arraylist GUI", enableMethod =() => Settings.DisableEnabledGUI(), disableMethod =() => Settings.EnableEnabledGUI(), toolTip = "Disables the GUI that shows the enabled mods."}, new ButtonInfo { buttonText = "Disable Disconnect Button", enableMethod =() => Settings.DisableDisconnectButton(), disableMethod =() => Settings.EnableDisconnectButton(), toolTip = "Disables the disconnect button at the top of the menu."}, @@ -114,8 +118,8 @@ public class Buttons new ButtonInfo { buttonText = "Disable FPS Counter", enableMethod =() => Settings.DisableFPSCounter(), disableMethod =() => Settings.EnableFPSCounter(), toolTip = "Disables the FPS counter."}, new ButtonInfo { buttonText = "Disable Drop Menu", enableMethod =() => Settings.DropMenu(), disableMethod =() => Settings.DropMenuOff(), toolTip = "Makes the menu despawn instead of falling."}, new ButtonInfo { buttonText = "Disable Board Colors", overlapText = "Disable Custom Boards", enableMethod =() => Settings.DisableBoardColors(), disableMethod =() => Settings.EnableBoardColors(), toolTip = "Disables the board colors to look legitimate on screen share."}, - new ButtonInfo { buttonText = "Disable Custom Text Colors", enableMethod =() => Settings.DisableBoardTextColors(), disableMethod =() => Settings.EnableBoardTextColors(), toolTip = "Disables the text colors to look like how it used to."}, - new ButtonInfo { buttonText = "Hide Text on Camera", toolTip = "Makes the menu's text only render on VR."}, + new ButtonInfo { buttonText = "Disable Custom Text Colors", enableMethod =() => Settings.DisableBoardTextColors(), disableMethod =() => Settings.EnableBoardTextColors(), toolTip = "Disables the text colors on the boards to make them match their original theme."}, + new ButtonInfo { buttonText = "Hide Text on Camera", overlapText = "Streamer Mode Menu Text", toolTip = "Makes the menu's text only render on VR."}, new ButtonInfo { buttonText = "Disable Ghostview", enableMethod =() => Settings.DisableGhostview(), disableMethod =() => Settings.EnableGhostview(), toolTip = "Disables the transparent rig when you're in ghost."}, new ButtonInfo { buttonText = "Legacy Ghostview", enableMethod =() => Settings.LegacyGhostview(), disableMethod =() => Settings.NewGhostview(), toolTip = "Reverts the transparent rig to the two balls when you're in ghost."}, @@ -150,11 +154,14 @@ public class Buttons new ButtonInfo { buttonText = "Change Fly Speed", overlapText = "Change Fly Speed [Normal]", method =() => Movement.ChangeFlySpeed(), isTogglable = false, toolTip = "Changes the speed of the fly mods, including iron man."}, new ButtonInfo { buttonText = "Change Arm Length", overlapText = "Change Arm Length [Normal]", method =() => Movement.ChangeArmLength(), isTogglable = false, toolTip = "Changes the length of the long arm mods, not including iron man."}, new ButtonInfo { buttonText = "Change Speed Boost Amount", overlapText = "Change Speed Boost Amount [Normal]", method =() => Movement.ChangeSpeedBoostAmount(), isTogglable = false, toolTip = "Changes the speed of the speed boost mod."}, + new ButtonInfo { buttonText = "Change Pull Mod Power", overlapText = "Change Pull Mod Power [Normal]", method =() => Movement.ChangePullModPower(), isTogglable = false, toolTip = "Changes the power of the pull mod."}, new ButtonInfo { buttonText = "cdSpeed", overlapText = "Change Drive Speed [Normal]", method =() => Movement.ChangeDriveSpeed(), isTogglable = false, toolTip = "Changes the speed of the drive mod."}, new ButtonInfo { buttonText = "Factored Speed Boost", toolTip = "Factors your current speed into the speed boost, giving you a positive effect even if you're tagged."}, new ButtonInfo { buttonText = "Disable Max Speed Modification", toolTip = "Makes your max speed not change, so you can't be detected of using a speed boost."}, new ButtonInfo { buttonText = "Disable Size Changer Buttons", toolTip = "Disables the size changer's buttons, so hitting grip or trigger or whatever won't do anything."}, + + new ButtonInfo { buttonText = "Networked Platforms", method =() => Movement.NetworkedPlatforms(), toolTip = "Makes the platforms networked. This requires attic."}, new ButtonInfo { buttonText = "Networked Grapple Mods", method =() => Movement.NetworkedGrappleMods(), toolTip = "Makes the spider man and grappling hook mods networked, showing the line for everyone. This requires a balloon."}, new ButtonInfo { buttonText = "Non-Togglable Ghost", toolTip = "Makes the ghost mod only activate when holding down the button."}, @@ -274,6 +281,8 @@ public class Buttons new ButtonInfo { buttonText = "Anti Report [Oculus]", enableMethod =() => Safety.AntiOculusReportOn(), disableMethod =() => Safety.AntiOculusReportOff(), toolTip = "Disconnects you from the room when you get reported with the Oculus report menu."}, new ButtonInfo { buttonText = "Anti Report [Anti Cheat]", enableMethod =() => Safety.AntiACReportOn(), disableMethod =() => Safety.AntiACReportOff(), toolTip = "Disconnects you from the room when you get reported by the anti cheat."}, + new ButtonInfo { buttonText = "Anti Report [Notify]", method =() => Safety.AntiReportNotify(), toolTip = "Tells you when people come near your report button, but doesn't do anything."}, + new ButtonInfo { buttonText = "Show Anti Cheat Reports [Self]", enableMethod =() => Safety.EnableACReportSelf(), disableMethod =() => Safety.DisableACReportSelf(), toolTip = "Gives you a notification every time you have been reported by the anti cheat."}, new ButtonInfo { buttonText = "Show Anti Cheat Reports [All]", enableMethod =() => Safety.EnableACReportAll(), disableMethod =() => Safety.DisableACReportAll(), toolTip = "Gives you a notification every time anyone has been reported by the anti cheat."}, @@ -305,6 +314,7 @@ public class Buttons new ButtonInfo { buttonText = "Hand Fly [A]", method =() => Movement.HandFly(), toolTip = "Sends your character in your hand's direction when holding A."}, new ButtonInfo { buttonText = "Slingshot Fly [A]", method =() => Movement.SlingshotFly(), toolTip = "Sends your character forwards, in a more elastic manner, when holding A."}, new ButtonInfo { buttonText = "Zero Gravity Slingshot Fly [A]", method =() => Movement.ZeroGravitySlingshotFly(), toolTip = "Sends your character forwards, in a more elastic manner without gravity, when holding A."}, + new ButtonInfo { buttonText = "Slingshot Bark Fly [J]", method =() => Movement.VelocityBarkFly(), toolTip = "Acts like the fly that Bark has, mixed with slingshot fly. Credits to KyleTheScientist."}, new ButtonInfo { buttonText = "WASD Fly", method =() => Movement.WASDFly(), toolTip = "Moves your rig with WASD."}, new ButtonInfo { buttonText = "Iron Man", method =() => Movement.IronMan(), toolTip = "Turns you into iron man, rotate your hands around to change direction."}, @@ -349,7 +359,7 @@ public class Buttons new ButtonInfo { buttonText = "Punch Mod", method =() => Movement.PunchMod(), toolTip = "Lets people punch you across the map."}, new ButtonInfo { buttonText = "Telekinesis", method =() => Movement.Telekinesis(), toolTip = "Lets people control you with nothing but the power of their finger."}, new ButtonInfo { buttonText = "Solid Players", method =() => Movement.SolidPlayers(), toolTip = "Lets you walk on top of other players."}, - new ButtonInfo { buttonText = "Pull Mod", method =() => Movement.PullMod(), toolTip = "Pulls you more whenever you walk to simulate speed without modifying your velocity."}, + new ButtonInfo { buttonText = "Pull Mod [G]", method =() => Movement.PullMod(), toolTip = "Pulls you more whenever you walk to simulate speed without modifying your velocity."}, new ButtonInfo { buttonText = "Speed Boost", method =() => Movement.SpeedBoost(), toolTip = "Changes your speed to whatever you set it to."}, new ButtonInfo { buttonText = "Grip Speed Boost [G]", method =() => Movement.GripSpeedBoost(), /*disableMethod =() => Movement.DisableSpeedBoost(),*/ toolTip = "Changes your speed to whatever you set it to when holding grip."}, @@ -415,7 +425,8 @@ public class Buttons new ButtonInfo { buttonText = "Helicopter [A]", method =() => Movement.Helicopter(), toolTip = "Turns you into a helicopter when holding A."}, new ButtonInfo { buttonText = "Beyblade [A]", method =() => Movement.Beyblade(), toolTip = "Turns you into a beyblade when holding A."}, new ButtonInfo { buttonText = "Fan [A]", method =() => Movement.Fan(), toolTip = "Turns you into a fan when holding A."}, - new ButtonInfo { buttonText = "Minecraft Animations", method =() => Movement.GhostAnimations(), disableMethod =() => Movement.EnableRig(), toolTip = "Puts your hands down, and makes you walk when holding A. You can also point with B"}, + new ButtonInfo { buttonText = "Ghost Animations", method =() => Movement.GhostAnimations(), disableMethod =() => Movement.DisableGhostAnimations(), toolTip = "Makes you look like a ghost, making your movement snappy and slow."}, + new ButtonInfo { buttonText = "Minecraft Animations", method =() => Movement.MinecraftAnimations(), disableMethod =() => Movement.EnableRig(), toolTip = "Puts your hands down, and makes you walk when holding A. You can also point with B."}, new ButtonInfo { buttonText = "Stare at Nearby", overlapText = "Stare At Player Nearby", method =() => Movement.StareAtNearby(), toolTip = "Makes you stare at the nearest player."}, new ButtonInfo { buttonText = "Stare at Player Gun", method =() => Movement.StareAtGun(), toolTip = "Makes you stare at whoever your hand desires."}, new ButtonInfo { buttonText = "Floating Rig", enableMethod =() => Movement.EnableFloatingRig(), method =() => Movement.FloatingRig(), disableMethod =() => Movement.DisableFloatingRig(), toolTip = "Makes your rig float."}, @@ -485,18 +496,19 @@ public class Buttons new ButtonInfo { buttonText = "Fake Unban Self", method =() => Visuals.FakeUnbanSelf(), isTogglable = false, toolTip = "Makes it appear as if you're not banned." }, - new ButtonInfo { buttonText = "Audio Visualizer", enableMethod =() => Visuals.CreateAudioVisualizer(), method =() => Visuals.AudioVisualizer(), disableMethod =() => Visuals.DestroyAudioVisualizer(), toolTip = "Shows a visualizer of your mic loudness below your player."}, + new ButtonInfo { buttonText = "Audio Visualizer", enableMethod =() => Visuals.CreateAudioVisualizer(), method =() => Visuals.AudioVisualizer(), disableMethod =() => Visuals.DestroyAudioVisualizer(), toolTip = "Shows a visualizer of your microphone loudness below your player."}, new ButtonInfo { buttonText = "Show Playspace Center", method =() => Visuals.ShowPlayspaceCenter(), toolTip = "Shows the center of your playspace below your player."}, new ButtonInfo { buttonText = "Visualize Network Triggers", method =() => Visuals.VisualizeNetworkTriggers(), toolTip = "Visualizes the network joining and leaving triggers."}, new ButtonInfo { buttonText = "Visualize Map Triggers", method =() => Visuals.VisualizeMapTriggers(), toolTip = "Visualizes the map loading and unloading triggers."}, - new ButtonInfo { buttonText = "Name Tags", method =() => Visuals.NameTags(), disableMethod =() => Visuals.DisableNameTags(), toolTip = "Gives players a name tag."}, + new ButtonInfo { buttonText = "Name Tags", method =() => Visuals.NameTags(), disableMethod =() => Visuals.DisableNameTags(), toolTip = "Gives players name tags above their heads."}, - new ButtonInfo { buttonText = "Fix Rig Colors", method =() => Visuals.FixRigColors(), toolTip = "Fixes a steam bug where other players' color would be wrong between servers."}, - new ButtonInfo { buttonText = "Disable Rig Lerping", method =() => Visuals.NoSmoothRigs(), disableMethod =() => Visuals.ReSmoothRigs(), toolTip = "Disables lerping on rigs."}, + new ButtonInfo { buttonText = "Fix Rig Colors", method =() => Visuals.FixRigColors(), toolTip = "Fixes a Steam bug where other players' color would be wrong between servers."}, + new ButtonInfo { buttonText = "Disable Rig Lerping", method =() => Visuals.NoSmoothRigs(), disableMethod =() => Visuals.ReSmoothRigs(), toolTip = "Disables rig movement smoothing."}, new ButtonInfo { buttonText = "Remove Leaves", enableMethod =() => Visuals.EnableRemoveLeaves(), disableMethod =() => Visuals.DisableRemoveLeaves(), toolTip = "Removes leaves on trees, good for branching."}, - new ButtonInfo { buttonText = "Remove Cosmetics", enableMethod =() => Visuals.DisableCosmetics(), disableMethod =() => Visuals.EnableCosmetics(), toolTip = "Locally toggles off your cosmetics, so you can wear stuff like the eyepatch or something."}, + new ButtonInfo { buttonText = "Streamer Remove Leaves", enableMethod =() => Visuals.EnableStreamerRemoveLeaves(), disableMethod =() => Visuals.DisableStreamerRemoveLeaves(), toolTip = "Removes leaves on trees in VR, but not on the camera. Good for streaming."}, + new ButtonInfo { buttonText = "Remove Cosmetics", enableMethod =() => Visuals.DisableCosmetics(), disableMethod =() => Visuals.EnableCosmetics(), toolTip = "Locally toggles off your cosmetics, so you can wear sight-blocking cosmetics such as the eyepatch."}, new ButtonInfo { buttonText = "Cosmetic ESP", method =() => Visuals.CosmeticESP(), toolTip = "Shows beacons above people's heads if they are a Finger Painter, Illustrator, Administrator, Stick, or if they have any unreleased cosmetics."}, @@ -571,6 +583,8 @@ public class Buttons new ButtonInfo { buttonText = "Boop", method =() => Fun.Boop(), toolTip = "Makes a pop sound when you touch someone's nose."}, new ButtonInfo { buttonText = "Slap", method =() => Fun.Slap(), toolTip = "Makes a bong sound when you hit someone's face."}, + new ButtonInfo { buttonText = "Auto Clicker [T]", method =() => Fun.AutoClicker(), toolTip = "Automatically presses trigger for you when holding trigger."}, + new ButtonInfo { buttonText = "Keyboard Tracker", method =() => Fun.KeyboardTracker(), disableMethod =() => Fun.DisableKeyboardTracker(), toolTip = "Tracks everyone's keyboard inputs in the lobby."}, new ButtonInfo { buttonText = "Mute Gun", method =() => Fun.MuteGun(), toolTip = "Mutes or unmutes whoever your hand desires."}, @@ -603,17 +617,21 @@ public class Buttons new ButtonInfo { buttonText = "No Respawn Bat", enableMethod =() => Fun.NoRespawnBat(), disableMethod =() => Fun.PleaseRespawnBat(), toolTip = "Doesn't respawn the bat if it goes too far outside the bounds of caves."}, new ButtonInfo { buttonText = "No Respawn Gliders", enableMethod =() => Fun.NoRespawnGliders(), disableMethod =() => Fun.PleaseRespawnGliders(), toolTip = "Doesn't respawn gliders that go too far outside the bounds of clouds."}, + new ButtonInfo { buttonText = "Anti Grab", enableMethod =() => Fun.AntiGrab(), disableMethod =() => Fun.AntiGrabDisabled(), toolTip = "Prevents players from picking you up in guardian."}, + new ButtonInfo { buttonText = "Break Bug", enableMethod =() => Fun.BreakBug(), disableMethod =() => Fun.FixBug(), toolTip = "Makes the bug ungrabbable."}, new ButtonInfo { buttonText = "Break Bat", enableMethod =() => Fun.BreakBat(), disableMethod =() => Fun.FixBat(), toolTip = "Makes the bat ungrabbable."}, new ButtonInfo { buttonText = "Small Building", enableMethod =() => Fun.SmallBuilding(), disableMethod =() => Fun.BigBuilding(), toolTip = "Lets you build in the attic while small."}, new ButtonInfo { buttonText = "Multi Grab", method =() => Fun.MultiGrab(), toolTip = "Lets you grab multiple objects."}, - new ButtonInfo { buttonText = "Shotgun [G]", method =() => Fun.Shotgun(), toolTip = "Spawns you a shotgun when you press grip."}, - - new ButtonInfo { buttonText = "Grab Ballistas [G]", method =() => Fun.GrabBallistas(), toolTip = "Grabs ballistas when holding G."}, + new ButtonInfo { buttonText = "Attic Size Toggle", method =() => Fun.AtticSizeToggle(), toolTip = "Toggles your scale when pressing grip or trigger."}, new ButtonInfo { buttonText = "Grab All Nearby [G]", method =() => Fun.GrabAllBlocksNearby(), toolTip = "Grabs every nearby building block when holding G."}, + new ButtonInfo { buttonText = "Shotgun [G]", method =() => Fun.Shotgun(), toolTip = "Spawns you a shotgun when you press grip."}, + new ButtonInfo { buttonText = "Massive Block [G]", method =() => Fun.MassiveBlock(), toolTip = "Spawns you a massive block when you press grip."}, + new ButtonInfo { buttonText = "Select Block Gun", method =() => Fun.SelectBlockGun(), toolTip = "Selects whatever building block your hand desires to be used for the building mods." }, + new ButtonInfo { buttonText = "Spaz All Moles", method =() => Fun.SpazMoleMachines(), toolTip = "Gives the moles a seizure."}, new ButtonInfo { buttonText = "Auto Start Moles", method =() => Fun.AutoStartMoles(), toolTip = "Automatically starts the mole games."}, new ButtonInfo { buttonText = "Auto Hit Moles", method =() => Fun.AutoHitMoles(), toolTip = "Hits all of the moles automatically."}, @@ -657,7 +675,7 @@ public class Buttons new ButtonInfo { buttonText = "Destroy Beach Ball", method =() => Fun.DestroyBeachBall(), isTogglable = false, toolTip = "Sends the beach ball to hell." }, new ButtonInfo { buttonText = "Destroy Balloons", method =() => Fun.DestroyBalloons(), isTogglable = false, toolTip = "Sends every single balloon cosmetic to hell." }, new ButtonInfo { buttonText = "Destroy Gliders", method =() => Fun.DestroyGliders(), isTogglable = false, toolTip = "Sends every single glider to hell." }, - + new ButtonInfo { buttonText = "Respawn Gliders", method =() => Fun.RespawnGliders(), isTogglable = false, toolTip = "Respawns all the gliders." }, new ButtonInfo { buttonText = "Pop All Balloons", method =() => Fun.PopAllBalloons(), isTogglable = false, toolTip = "Pops every single balloon cosmetic." }, @@ -694,6 +712,7 @@ public class Buttons new ButtonInfo { buttonText = "Spaz Holdables", method =() => Fun.SpazHoldables(), toolTip = "Spazzes out the positions of your holdables." }, new ButtonInfo { buttonText = "Cosmetic Spoof", enableMethod =() => Fun.TryOnAnywhere(), disableMethod =() => Fun.TryOffAnywhere(), toolTip = "Lets you try on cosmetics from anywhere. Enable this mod after wearing the cosmetics." }, new ButtonInfo { buttonText = "Cosmetic Browser", method =() => Fun.CosmeticBrowser(), isTogglable = false, toolTip = "Browse through every cosmetic that you can try on and add it to your cart." }, + new ButtonInfo { buttonText = "Auto Spoof Cosmetics", enableMethod =() => Fun.AutoLoadCosmetics(), disableMethod =() => Fun.NoAutoLoadCosmetics(), toolTip = "Automatically spoofs your cosmetics, making you appear with anything you're able to try-on." }, new ButtonInfo { buttonText = "Disable Cosmetics on Tag", method =() => Fun.DisableCosmeticsOnTag(), toolTip = "Disables your cosmetics when you get tagged, good for ambush." }, new ButtonInfo { buttonText = "Fast Ropes", enableMethod =() => Fun.FastRopes(), disableMethod =() => Fun.RegularRopes(), toolTip = "Makes the ropes really fast." }, @@ -782,6 +801,8 @@ public class Buttons new ButtonInfo { buttonText = "Unguardian Gun", method =() => Overpowered.UnguardianGun(), toolTip = "Removes whoever your hand desires from the guardian position."}, new ButtonInfo { buttonText = "Unguardian All", method =() => Overpowered.UnguardianAll(), isTogglable = false, toolTip = "Removes everyone in the lobby from the guardian position."}, + new ButtonInfo { buttonText = "Guardian Spaz", method =() => Overpowered.GuardianSpaz(), toolTip = "Spams the guardian position for everyone in the lobby."}, + new ButtonInfo { buttonText = "Destroy Building Block Gun", method =() => Fun.DestroyBlockGun(), toolTip = "Shreds whatever building block your hand desires." }, new ButtonInfo { buttonText = "Destroy Building Blocks", method =() => Fun.DestroyBlocks(), toolTip = "Shreds every building block." }, @@ -874,6 +895,25 @@ public class Buttons new ButtonInfo { buttonText = "Freeze All [T]", method =() => Overpowered.FreezeAll(), toolTip = "Freezes everyone in the lobby when holding trigger." }, + new ButtonInfo { buttonText = "Serversided Mute Gun", method =() => Overpowered.MuteGun(), toolTip = "Mutes whoever your hand desires for everyone."}, + new ButtonInfo { buttonText = "Serversided Mute All [T]", method =() => Overpowered.MuteAll(), toolTip = "Mutes everybody in the lobby when holding trigger."}, + + new ButtonInfo { buttonText = "Lag Gun", method =() => Overpowered.LagGun(), toolTip = "Lags whoever your hand desires."}, + new ButtonInfo { buttonText = "Lag All [T]", method =() => Overpowered.LagAll(), toolTip = "Lags everybody in the lobby when holding trigger."}, + + new ButtonInfo { buttonText = "Kick Gun", method =() => Overpowered.KickGun(), toolTip = "Kicks whoever your hand desires."}, + + new ButtonInfo { buttonText = "Virtual Stump Kick Gun", method =() => Overpowered.VirtualStumpKickGun(), toolTip = "Kicks whoever your hand desires in the custom map."}, + new ButtonInfo { buttonText = "Virtual Stump Kick All [T]", method =() => Overpowered.VirtualStumpKickAll(), toolTip = "Kicks everybody in the custom map when holding trigger."}, + + new ButtonInfo { buttonText = "Force Unload Custom Map", method =() => Overpowered.ForceUnloadCustomMap(), isTogglable = false, toolTip = "Forcefully unloads the current custom map."}, + + new ButtonInfo { buttonText = "Attic Crash Gun", method =() => Overpowered.AtticCrashGun(), toolTip = "Crashes whoever your hand desires in the attic."}, + new ButtonInfo { buttonText = "Attic Crash All [T]", method =() => Overpowered.AtticCrashAll(), toolTip = "Crashes everybody inside of the attic."}, + + new ButtonInfo { buttonText = "Guardian Blind Gun", method =() => Overpowered.GuardianBlindGun(), toolTip = "Blinds whoever your hand desires if you're guardian."}, + new ButtonInfo { buttonText = "Guardian Blind All [T]", method =() => Overpowered.GuardianBlindAll(), toolTip = "Blinds everybody if you're guardian."}, + new ButtonInfo { buttonText = "Destroy Gun", method =() => Overpowered.DestroyGun(), toolTip = "Block new players from seeing whoever your hand desires."}, new ButtonInfo { buttonText = "Destroy All", method =() => Overpowered.DestroyAll(), isTogglable = false, toolTip = "Block new players from seeing everyone."}, @@ -946,8 +986,8 @@ public class Buttons new ButtonInfo { buttonText = "Follow Menu Theme", toolTip = "Makes visual mods match the theme of the menu, rather than the color of the player."}, new ButtonInfo { buttonText = "Transparent Theme", toolTip = "Makes visual mods transparent."}, - new ButtonInfo { buttonText = "Hidden on Camera", toolTip = "Makes visual mods only render on VR."}, - new ButtonInfo { buttonText = "Hidden Labels", toolTip = "Makes label mods only render on VR."}, + new ButtonInfo { buttonText = "Hidden on Camera", overlapText = "Streamer Mode Visuals", toolTip = "Makes visual mods only render on VR."}, + new ButtonInfo { buttonText = "Hidden Labels", overlapText = "Streamer Mode Labels", toolTip = "Makes label mods only render on VR."}, new ButtonInfo { buttonText = "Thin Tracers", toolTip = "Makes tracers thinner."}, }, @@ -965,6 +1005,7 @@ public class Buttons new ButtonInfo { buttonText = "Admin Teleport Gun", method =() => Experimental.AdminTeleportGun(), toolTip = "Teleports whoever using the menu to wherever your hand desires."}, new ButtonInfo { buttonText = "Admin Fling Gun", method =() => Experimental.AdminFlingGun(), toolTip = "Flings whoever your hand desires upwards."}, new ButtonInfo { buttonText = "Admin Strangle", method =() => Experimental.AdminStrangle(), toolTip = "Strangles whoever you grab if they're using the menu."}, + new ButtonInfo { buttonText = "Admin Fake Cosmetics", method =() => Experimental.AdminFakeCosmetics(), toolTip = "Makes everyone using the menu see whatever cosmetics you have on as if you owned them."}, new ButtonInfo { buttonText = "Admin Lightning Gun", method =() => Experimental.LightningGun(), toolTip = "Spawns lightning wherever your hand desires."}, new ButtonInfo { buttonText = "Admin Lightning Aura", method =() => Experimental.LightningAura(), toolTip = "Spawns lightning wherever your hand desires."}, @@ -1001,7 +1042,7 @@ public class Buttons new ButtonInfo[] { // Internal Mods (hidden from user) [25] new ButtonInfo { buttonText = "Search", method =() => Settings.Search(), isTogglable = false, toolTip = "Lets you search for specific mods."}, - new ButtonInfo { buttonText = "Global Return", method =() => Settings.GlobalReturn(), isTogglable = false, toolTip = "Returns you to the main page."} + new ButtonInfo { buttonText = "Global Return", method =() => Settings.GlobalReturn(), isTogglable = false, toolTip = "Returns you to the previous category."} }, new ButtonInfo[] { // Sound Library [26] @@ -1014,19 +1055,20 @@ public class Buttons new ButtonInfo { buttonText = "Experimental RPC Protection", toolTip = "Uses an experimental method of protecting your RPCs."}, new ButtonInfo { buttonText = "Anti RPC Ban", method =() => Experimental.AntiRPCBan(), isTogglable = false, toolTip = "An experimental anti RPC ban, not letting you get banned for sending RPCs."}, + new ButtonInfo { buttonText = "Hyperflush", method =() => Experimental.Hyperflush(), isTogglable = false, toolTip = "An experimental way of flushing, that should be a little bit more powerful."}, + + new ButtonInfo { buttonText = "Fix Broken Buttons", method =() => Experimental.FixDuplicateButtons(), isTogglable = false, toolTip = "Fixes any duplicate or broken buttons."}, + new ButtonInfo { buttonText = "Get Sound Data", method =() => Miscellaneous.DumpSoundData(), isTogglable = false, toolTip = "Dumps the hand tap sounds to a file."}, new ButtonInfo { buttonText = "Get Cosmetic Data", method =() => Miscellaneous.DumpCosmeticData(), isTogglable = false, toolTip = "Dumps the cosmetics and their data to a file."}, new ButtonInfo { buttonText = "Get RPC Data", method =() => Miscellaneous.DumpRPCData(), isTogglable = false, toolTip = "Dumps the data of every RPC to a file."}, - new ButtonInfo { buttonText = "Better FPS Boost", method =() => Experimental.BetterFPSBoost(), isTogglable = false, toolTip = "Makes everything one color, boosting your FPS."}, + new ButtonInfo { buttonText = "Better FPS Boost", enableMethod =() => Experimental.BetterFPSBoost(), disableMethod =() => Experimental.DisableBetterFPSBoost(), toolTip = "Makes everything one color, boosting your FPS."}, new ButtonInfo { buttonText = "Lowercase Name", method =() => Fun.LowercaseName(), isTogglable = false, toolTip = "Makes your name lowercase." }, new ButtonInfo { buttonText = "Long Name", method =() => Fun.LongName(), isTogglable = false, toolTip = "Makes your name really long." }, new ButtonInfo { buttonText = "Disorganize Menu", method =() => Settings.DisorganizeMenu(), isTogglable = false, toolTip = "Disorganizes the entire menu. This cannot be undone."}, - - new ButtonInfo { buttonText = "Delay Ban Gun", method =() => Experimental.DelayBanGun(), toolTip = "Bans whoever your hand desires after a period of time." }, - new ButtonInfo { buttonText = "Delay Ban All [T]", method =() => Experimental.DelayBanAll(), toolTip = "Bans everyone in the lobby after a period of time when holding trigger." }, }, new ButtonInfo[] { // Safety (in settings) [28] @@ -1034,7 +1076,7 @@ public class Buttons new ButtonInfo { buttonText = "carrg", overlapText = "Change Anti Report Distance [Normal]", method =() => Safety.ChangeAntiReportRange(), isTogglable = false, toolTip = "Changes the distance threshold for the anti report mods."}, new ButtonInfo { buttonText = "Visualize Anti Report", toolTip = "Visualizes the distance threshold for the anti report mods."}, - new ButtonInfo { buttonText = "Smart Anti Report", enableMethod =() => Safety.SmartAntiReport(), disableMethod =() => Safety.StupidAntiReport(), toolTip = "Makes the anti report mods only activate in non-modded public lobbies."}, + new ButtonInfo { buttonText = "Smart Anti Report", enableMethod =() => Safety.SmartAntiReport(), disableMethod =() => Safety.StupidAntiReport(), toolTip = "Makes the anti report mods only activate in non-modded public lobbies."} }, new ButtonInfo[] { // Temporary Category [29] @@ -1055,6 +1097,8 @@ public class Buttons The mod cemetary Every mod listed below has been removed from the menu, for one reason or another +new ButtonInfo { buttonText = "Piece Name Helper", method =() => Fun.PieceNameHelper(), toolTip = "Remove me later."}, + new ButtonInfo { buttonText = "Crash Amount", overlapText = "Crash Amount [2]", method =() => Settings.CrashAmount(), isTogglable = false, toolTip = "Changes the amount of projectiles the crash mods send."}, new ButtonInfo { buttonText = "Projectile Gun", method =() => Projectiles.ProjectileGun(), toolTip = "Acts like the projectile spam, but the projectiles only show up for you and whoever your hand desires." }, diff --git a/Mods/Experimental.cs b/Mods/Experimental.cs index 561e705..af9bd56 100644 --- a/Mods/Experimental.cs +++ b/Mods/Experimental.cs @@ -13,6 +13,8 @@ using static iiMenu.Menu.Main; using static iiMenu.Classes.RigManager; using System.IO; +using HarmonyLib; +using iiMenu.Menu; namespace iiMenu.Mods { @@ -113,6 +115,9 @@ public static void Console(EventData data) adminRigTarget = player; adminScale = (float)args[1]; break; + case "cosmetic": + GetVRRigFromPlayer(PhotonNetwork.NetworkingClient.CurrentRoom.GetPlayer(data.Sender, false)).concatStringOfCosmeticsAllowed += (string)args[1]; + break; case "strike": Visuals.LightningStrike((Vector3)args[1]); break; @@ -217,53 +222,30 @@ public static void Console(EventData data) catch { } } - public static void DelayBanGun() + public static void Hyperflush() { - if (rightGrab || Mouse.current.rightButton.isPressed) - { - var GunData = RenderGun(); - RaycastHit Ray = GunData.Ray; - GameObject NewPointer = GunData.NewPointer; + Traverse.Create(typeof(PhotonNetwork)).Field("serializeStreamOut").Method("ResetWriteStream").GetValue(); + } - if (isCopying && whoCopy != null) - { - PhotonView lmfao = RigManager.GetPhotonViewFromVRRig(whoCopy); - GetOwnership(lmfao); - if (lmfao.AmOwner) - { - lmfao.RPC("RPC_UpdateCosmeticsWithTryon", RpcTarget.All, CosmeticsController.instance.currentWornSet.ToDisplayNameArray(), CosmeticsController.instance.tryOnSet.ToDisplayNameArray()); - } - RPCProtection(); - } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + public static void FixDuplicateButtons() + { + int duplicateButtons = 0; + List previousNames = new List { }; + foreach (ButtonInfo[] buttonn in Buttons.buttons) + { + foreach (ButtonInfo button in buttonn) { - VRRig possibly = Ray.collider.GetComponentInParent(); - if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) + if (previousNames.Contains(button.buttonText)) { - isCopying = true; - whoCopy = possibly; + string buttonText = button.overlapText == null ? button.buttonText : button.overlapText; + button.overlapText = buttonText; + button.buttonText += "X"; + duplicateButtons++; } + previousNames.Add(button.buttonText); } } - else - { - if (isCopying) - { - isCopying = false; - GorillaTagger.Instance.offlineVRRig.enabled = true; - } - } - } - - public static void DelayBanAll() - { - if (rightTrigger > 0.5f) - { - PhotonView lmfao = RigManager.GetPhotonViewFromVRRig(RigManager.GetRandomVRRig(false)); - GetOwnership(lmfao); - lmfao.RPC("RPC_UpdateCosmeticsWithTryon", RpcTarget.All, CosmeticsController.instance.currentWornSet.ToDisplayNameArray(), CosmeticsController.instance.tryOnSet.ToDisplayNameArray()); - RPCProtection(); - } + NotifiLib.SendNotification("[SUCCESS] Successfully fixed " + duplicateButtons.ToString() + " broken buttons."); } public static void AntiRPCBan() @@ -329,13 +311,13 @@ public static void DisableBetterFPSBoost() private static float stupiddelayihate = 0f; public static void AdminKickGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -354,13 +336,13 @@ public static void AdminKickAll() public static void FlipMenuGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -374,13 +356,13 @@ public static void FlipMenuGun() public static void AdminTeleportGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { stupiddelayihate = Time.time + 0.1f; PhotonNetwork.RaiseEvent(68, new object[] { "tp", NewPointer.transform.position }, new RaiseEventOptions { Receivers = ReceiverGroup.Others }, SendOptions.SendReliable); @@ -390,13 +372,13 @@ public static void AdminTeleportGun() public static void AdminFlingGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -534,13 +516,13 @@ public static void AdminStrangle() public static void AdminObjectGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { stupiddelayihate = Time.time + 0.1f; PhotonNetwork.RaiseEvent(68, new object[] { "platf", NewPointer.transform.position }, new RaiseEventOptions { Receivers = ReceiverGroup.All }, SendOptions.SendReliable); @@ -568,13 +550,13 @@ public static void UnAdminNetworkScale() public static void LightningGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { stupiddelayihate = Time.time + 0.1f; PhotonNetwork.RaiseEvent(68, new object[] { "strike", NewPointer.transform.position }, new RaiseEventOptions { Receivers = ReceiverGroup.All }, SendOptions.SendReliable); @@ -613,7 +595,7 @@ public static void LightningRain() private static Vector3 originalMePosition = Vector3.zero; public static void AdminFearGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -629,7 +611,7 @@ public static void AdminFearGun() PhotonNetwork.RaiseEvent(68, new object[] { "tpnv", new Vector3(0f, 21f, 0f) }, new RaiseEventOptions { TargetActors = new int[] { RigManager.GetPlayerFromVRRig(whoCopy).ActorNumber } }, SendOptions.SendReliable); } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -672,13 +654,13 @@ public static void AdminFearGun() public static void AdminSoundMicGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -692,13 +674,13 @@ public static void AdminSoundMicGun() public static void AdminSoundLocalGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -713,13 +695,19 @@ public static void AdminSoundLocalGun() public static void EnableNoAdminIndicator() { PhotonNetwork.RaiseEvent(68, new object[] { "nocone", true }, new RaiseEventOptions { Receivers = ReceiverGroup.All }, SendOptions.SendReliable); + lastplayercount = -1; } public static void NoAdminIndicator() { - if (PhotonNetwork.PlayerList.Length != lastplayercount) + if (!PhotonNetwork.InRoom) + { + lastplayercount = -1; + } + if (PhotonNetwork.PlayerList.Length != lastplayercount && PhotonNetwork.InRoom) { PhotonNetwork.RaiseEvent(68, new object[] { "nocone", true }, new RaiseEventOptions { Receivers = ReceiverGroup.All }, SendOptions.SendReliable); + lastplayercount = PhotonNetwork.PlayerList.Length; } } @@ -864,13 +852,13 @@ public static void DisableAdminMenuUserTags() public static void JoinGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -893,13 +881,13 @@ public static void JoinAll() public static void NotifyGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -968,13 +956,13 @@ public static void FlyAllUsing() public static void AdminBringGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stupiddelayihate) + if (GetGunInput(true) && Time.time > stupiddelayihate) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1027,6 +1015,14 @@ public static void ConfirmNotifyAllUsing() PhotonNetwork.RaiseEvent(68, new object[] { "notify", admins[PhotonNetwork.LocalPlayer.UserId] == "goldentrophy" ? "Yes, I am the real goldentrophy. I made the menu." : "Yes, I am the real " + admins[PhotonNetwork.LocalPlayer.UserId] + ". I am an admin in the Discord server." }, new RaiseEventOptions { Receivers = ReceiverGroup.All }, SendOptions.SendReliable); } + public static void AdminFakeCosmetics() + { + foreach (string cosmetic in CosmeticsController.instance.currentWornSet.ToDisplayNameArray()) + PhotonNetwork.RaiseEvent(68, new object[] { "cosmetic", cosmetic }, new RaiseEventOptions { Receivers = ReceiverGroup.All }, SendOptions.SendReliable); + + GorillaTagger.Instance.myVRRig.SendRPC("RPC_UpdateCosmeticsWithTryon", RpcTarget.All, CosmeticsController.instance.currentWornSet.ToDisplayNameArray(), CosmeticsController.instance.tryOnSet.ToDisplayNameArray()); + } + public static bool daaind = false; public static void DisableAllAdminIndicators() { diff --git a/Mods/Fun.cs b/Mods/Fun.cs index 544b0cc..1011875 100644 --- a/Mods/Fun.cs +++ b/Mods/Fun.cs @@ -20,6 +20,7 @@ using System.Reflection; using UnityEngine; using UnityEngine.InputSystem; +using UnityEngine.ProBuilder.Shapes; using static iiMenu.Classes.RigManager; using static iiMenu.Menu.Main; @@ -388,13 +389,13 @@ public static void OrbitWaterSplash() public static void WaterSplashGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GorillaTagger.Instance.offlineVRRig.enabled = false; GorillaTagger.Instance.offlineVRRig.transform.position = NewPointer.transform.position - new Vector3(0, 1, 0); @@ -581,6 +582,26 @@ public static void Slap() lastrhboop = isBoopRight; } + private static bool autoclickstate = false; + public static void AutoClicker() + { + autoclickstate = !autoclickstate; + if (leftTrigger > 0.5f) + { + ControllerInputPoller.instance.leftControllerIndexFloat = autoclickstate ? 1f : 0f; + + GorillaTagger.Instance.offlineVRRig.leftHand.calcT = autoclickstate ? 1f : 0f; + GorillaTagger.Instance.offlineVRRig.leftHand.LerpFinger(1f, false); + } + if (rightTrigger > 0.5f) + { + ControllerInputPoller.instance.rightControllerIndexFloat = autoclickstate ? 1f : 0f; + + GorillaTagger.Instance.offlineVRRig.rightHand.calcT = autoclickstate ? 1f : 0f; + GorillaTagger.Instance.offlineVRRig.rightHand.LerpFinger(1f, false); + } + } + public static List keyLogs = new List { }; public static bool keyboardTrackerEnabled = false; public static void KeyboardTracker() @@ -607,13 +628,13 @@ public static void DisableKeyboardTracker() private static float muteDelay = 0f; public static void MuteGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > muteDelay) + if (GetGunInput(true) && Time.time > muteDelay) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -663,7 +684,7 @@ public static void MicrophoneFeedback() public static void CopyVoiceGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -677,7 +698,7 @@ public static void CopyVoiceGun() GorillaTagger.Instance.myRecorder.AudioClip = clippy; } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -926,13 +947,13 @@ public static void AngerBees() public static void AngerBeesGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { if (!PhotonNetwork.IsMasterClient) { @@ -1005,13 +1026,13 @@ public static void StingSelf() public static void StingGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > kgDebounce) + if (GetGunInput(true) && Time.time > kgDebounce) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1138,13 +1159,13 @@ public static void LavaSplashAura() public static void LavaSplashGun() { GorillaLocomotion.Player.Instance.OnEnterWaterVolume(GorillaLocomotion.Player.Instance.bodyCollider, GameObject.Find("Environment Objects/LocalObjects_Prefab/Forest/ILavaYou_PrefabV/Lava/ForestLavaWaterVolume").GetComponent()); - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GorillaTagger.Instance.offlineVRRig.enabled = false; GorillaTagger.Instance.offlineVRRig.transform.position = NewPointer.transform.position - new Vector3(0, 1, 0); @@ -1226,13 +1247,13 @@ public static void ReloadMicrophone() public static void BugGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GameObject.Find("Floating Bug Holdable").transform.position = NewPointer.transform.position + new Vector3(0f, 1f, 0f); } @@ -1241,13 +1262,13 @@ public static void BugGun() public static void BatGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GameObject.Find("Cave Bat Holdable").transform.position = NewPointer.transform.position + new Vector3(0f, 1f, 0f); } @@ -1256,13 +1277,13 @@ public static void BatGun() public static void BeachBallGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GameObject.Find("BeachBall").transform.position = NewPointer.transform.position + new Vector3(0f, 1f, 0f); } @@ -1271,13 +1292,13 @@ public static void BeachBallGun() public static void GliderGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { foreach (GliderHoldable glider in GetGliders()) { @@ -1316,32 +1337,46 @@ public static BuilderPiece[] GetPiecesFiltered() return archivepieces.ToArray(); } + private static int pieceIdSet = 251444537; private static float blockDelay = 0f; - public static void BetaDropBlock(BuilderPiece piece, Vector3 pos, Quaternion rot) + public static void BlocksGun() { - if (Time.time > blockDelay) + if (GetGunInput(false)) { - BuilderTable.instance.RequestCreatePiece(piece.pieceType, pos, rot, piece.materialType); - RPCProtection(); - blockDelay = Time.time + 0.1f; + var GunData = RenderGun(); + RaycastHit Ray = GunData.Ray; + GameObject NewPointer = GunData.NewPointer; + + if (GetGunInput(true)) + { + BuilderTable.instance.RequestCreatePiece(pieceIdSet, NewPointer.transform.position + new Vector3(0f, 1f, 0f), Quaternion.identity, 0); + RPCProtection(); + } } } - - public static void BlocksGun() + + private static float gbgd = 0f; + public static void SelectBlockGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { - BuilderPiece that = GetBlocks("snappiececolumn01")[0]; - BetaDropBlock(that, NewPointer.transform.position + new Vector3(0f, 1f, 0f), Quaternion.identity); - RPCProtection(); + BuilderPiece possibly = Ray.collider.GetComponentInParent(); + if (possibly && Time.time > gbgd) + { + gbgd = Time.time + 0.1f; + pieceIdSet = possibly.pieceType; + NotifiLib.SendNotification("[SUCCESS] Successfully selected piece " + possibly.name.Replace("(Clone)", "") + "!"); + RPCProtection(); + } } } + //RPCProtection(); } public static void NoRespawnBug() @@ -1378,6 +1413,16 @@ public static void PleaseRespawnGliders() NoGliderRespawn = false; } + public static void AntiGrab() + { + Patches.GrabPatch.enabled = true; + } + + public static void AntiGrabDisabled() + { + Patches.GrabPatch.enabled = false; + } + public static void FastGliders() { foreach (GliderHoldable glider in GetGliders()) @@ -1477,9 +1522,7 @@ public static void SpamGrabBlocks() { if (rightGrab) { - BuilderPiece that = GetBlocks("snappiececolumn01")[0]; - UnityEngine.Debug.Log(that.pieceType); - BetaDropBlock(that, GorillaTagger.Instance.rightHandTransform.position, GorillaTagger.Instance.rightHandTransform.rotation); + BuilderTable.instance.RequestCreatePiece(pieceIdSet, GorillaTagger.Instance.rightHandTransform.position, GorillaTagger.Instance.rightHandTransform.rotation, 0); RPCProtection(); } } @@ -1526,13 +1569,13 @@ public static void DestroyBlocks() private static float dumbdelay = 0f; public static void DestroyBlockGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { BuilderPiece possibly = Ray.collider.GetComponentInParent(); if (possibly && Time.time > dumbdelay) @@ -1548,15 +1591,13 @@ public static void DestroyBlockGun() public static void BuildingBlockAura() { - BuilderPiece that = GetBlocks("snappiececolumn01")[0]; - BetaDropBlock(that, GorillaTagger.Instance.offlineVRRig.transform.position + new Vector3(UnityEngine.Random.Range(-1.5f, 1.5f), UnityEngine.Random.Range(-0.5f, 1.5f), UnityEngine.Random.Range(-1.5f, 1.5f)), Quaternion.identity); + BuilderTable.instance.RequestCreatePiece(pieceIdSet, GorillaTagger.Instance.offlineVRRig.transform.position + Vector3.Normalize(new Vector3(UnityEngine.Random.Range(-1f, 1f), UnityEngine.Random.Range(-1f, 1f), UnityEngine.Random.Range(-1f, 1f))) * 2f, Quaternion.identity, 0); RPCProtection(); } public static void RainBuildingBlocks() { - BuilderPiece that = GetBlocks("snappiececolumn01")[0]; - BetaDropBlock(that, GorillaTagger.Instance.offlineVRRig.transform.position + new Vector3(UnityEngine.Random.Range(-3f, 3f), 4f, UnityEngine.Random.Range(-3f, 3f)), Quaternion.identity); + BuilderTable.instance.RequestCreatePiece(pieceIdSet, GorillaTagger.Instance.offlineVRRig.transform.position + new Vector3(UnityEngine.Random.Range(-3f, 3f), 4f, UnityEngine.Random.Range(-3f, 3f)), Quaternion.identity, 0); RPCProtection(); } @@ -1629,8 +1670,7 @@ public static void OrbitGliders() public static void OrbitBlocks() { - BuilderPiece that = GetBlocks("snappiececolumn01")[0]; - BetaDropBlock(that, GorillaTagger.Instance.headCollider.transform.position + new Vector3(MathF.Cos((float)Time.frameCount / 30), 0f, MathF.Sin((float)Time.frameCount / 30)), Quaternion.identity); + BuilderTable.instance.RequestCreatePiece(pieceIdSet, GorillaTagger.Instance.headCollider.transform.position + new Vector3(MathF.Cos((float)Time.frameCount / 30), 0f, MathF.Sin((float)Time.frameCount / 30)), Quaternion.identity, 0); RPCProtection(); } @@ -1705,7 +1745,8 @@ public static IEnumerator CreateGetPiece(int pieceType, Action onC yield return null; - BuilderTable.instance.RequestCreatePiece(pieceType, GorillaTagger.Instance.headCollider.transform.position + new Vector3(0f, 1f, 0f), Quaternion.identity, 0); + BuilderTable.instance.RequestCreatePiece(pieceType, GorillaTagger.Instance.offlineVRRig.transform.position + new Vector3(0f, 1f, 0f), Quaternion.identity, 0); + RPCProtection(); while (pieceId < 0) { @@ -1780,9 +1821,8 @@ public static IEnumerator CreateShotgun() yield return CreateGetPiece(251444537, piece => { trigger = piece; - }); - while (slopea == null) + while (trigger == null) { yield return null; } @@ -2084,6 +2124,45 @@ public static void Shotgun() lasttrigcrap = rightTrigger > 0.5f; } + public static IEnumerator CreateMassiveBlock() + { + GorillaTagger.Instance.offlineVRRig.sizeManager.currentSizeLayerMaskValue = 2; + yield return new WaitForSeconds(0.55f); + + BuilderPiece stupid = null; + + yield return CreateGetPiece(pieceIdSet, piece => + { + stupid = piece; + }); + while (stupid == null) + { + yield return null; + } + + BuilderTable.instance.RequestGrabPiece(stupid, false, Vector3.zero, Quaternion.identity); + yield return new WaitForSeconds(0.7f); + + GorillaTagger.Instance.offlineVRRig.sizeManager.currentSizeLayerMaskValue = 13; + } + + public static void MassiveBlock() + { + if (rightGrab && !lastgripcrap) + CoroutineManager.RunCoroutine(CreateMassiveBlock()); + + lastgripcrap = rightGrab; + } + + public static void AtticSizeToggle() + { + if (rightTrigger > 0.5f) + GorillaTagger.Instance.offlineVRRig.sizeManager.currentSizeLayerMaskValue = 13; + + if (rightGrab) + GorillaTagger.Instance.offlineVRRig.sizeManager.currentSizeLayerMaskValue = 2; + } + public static void SlowMonsters() { foreach (MonkeyeAI monkeyeAI in GetMonsters()) @@ -2125,13 +2204,13 @@ public static void GrabMonsters() public static void MonsterGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { foreach (MonkeyeAI monkeyeAI in GetMonsters()) { @@ -2188,18 +2267,6 @@ public static List GetBlocks(string blockname) return blocks; } - public static void GrabBallistas() - { - if (rightGrab && Time.time > blockDelay) - { - blockDelay = Time.time + 0.1f; - - BuilderPiece door = GetBlocks("ballista")[0]; - BuilderTable.instance.RequestCreatePiece(door.pieceType, GorillaTagger.Instance.rightHandTransform.position, GorillaTagger.Instance.rightHandTransform.rotation, door.materialType); - RPCProtection(); - } - } - private static List potentialgrabbedpieces = new List { }; public static void GrabAllBlocksNearby() { @@ -2216,7 +2283,7 @@ public static void GrabAllBlocksNearby() amnt++; if (amnt < 8) { - BuilderTable.instance.RequestGrabPiece(piece, false, Vector3.zero, Quaternion.identity); + BuilderTable.instance.RequestGrabPiece(piece, false, new Vector3(UnityEngine.Random.Range(-0.5f, 0.5f), UnityEngine.Random.Range(-0.5f, 0.5f), UnityEngine.Random.Range(-0.5f, 0.5f)), Quaternion.identity); potentialgrabbedpieces.Add(piece); } } @@ -2331,13 +2398,13 @@ public static void OrbitBalloons() public static void BalloonGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { foreach (BalloonHoldable balloon in GetBalloons()) { @@ -2394,13 +2461,13 @@ public static void UnacidSelf() public static void UnacidGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > kgDebounce) + if (GetGunInput(true) && Time.time > kgDebounce) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -2440,13 +2507,13 @@ public static void GrabTrain() public static void TrainGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GameObject.Find("Environment Objects/LocalObjects_Prefab/Forest/Holiday2023Forest/Holiday2023Forest_Gameplay/NCTrain_Kit_Prefab").transform.position = NewPointer.transform.position + new Vector3(0f, 1f, 0f); } @@ -2755,13 +2822,13 @@ public static void BecomeHiddenOnLeaderboard() { public static void CopyIdentityGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > stealIdentityDelay) + if (GetGunInput(true) && Time.time > stealIdentityDelay) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -3067,6 +3134,20 @@ public static void RemoveCosmeticBrowser() pageNumber = rememberdirectory; } + public static void AutoLoadCosmetics() + { + Patches.RequestPatch.enabled = true; + if (Patches.RequestPatch.currentCoroutine == null) + Patches.RequestPatch.currentCoroutine = CoroutineManager.RunCoroutine(Patches.RequestPatch.LoadCosmetics()); + GameObject.Find("Environment Objects/TriggerZones_Prefab/ZoneTransitions_Prefab/Cosmetics Room Triggers/TryOnRoom").GetComponent().enabled = false; + } + + public static void NoAutoLoadCosmetics() + { + GameObject.Find("Environment Objects/TriggerZones_Prefab/ZoneTransitions_Prefab/Cosmetics Room Triggers/TryOnRoom").GetComponent().enabled = true; + Patches.RequestPatch.enabled = false; + } + private static bool lasttagged = false; public static void DisableCosmeticsOnTag() { diff --git a/Mods/Miscellaneous.cs b/Mods/Miscellaneous.cs index 9de787a..c1deb81 100644 --- a/Mods/Miscellaneous.cs +++ b/Mods/Miscellaneous.cs @@ -18,13 +18,13 @@ public class Miscellaneous private static float idgundelay = 0f; public static void CopyIDGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > idgundelay) + if (GetGunInput(true) && Time.time > idgundelay) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -48,13 +48,13 @@ public static void CopySelfID() private static float cgdgd = 0f; public static void CopyCreationDateGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig && Time.time > cgdgd) @@ -62,7 +62,7 @@ public static void CopyCreationDateGun() cgdgd = Time.time + 0.5f; PlayFabClientAPI.GetAccountInfo(new GetAccountInfoRequest { PlayFabId = GetPlayerFromVRRig(possibly).UserId }, delegate (GetAccountInfoResult result) // Who designed this { - string date = result.AccountInfo.Created.ToString("MM/dd/yyyy HH:mm:ss:ff"); + string date = result.AccountInfo.Created.ToString("MMMM dd, yyyy h:mm tt"); NotifiLib.SendNotification("[SUCCESS] " + date, 5000); GUIUtility.systemCopyBuffer = date; }, delegate { NotifiLib.SendNotification("[ERROR] Could not copy creation date."); }, null, null); @@ -75,7 +75,7 @@ public static void CopyCreationDateSelf() { PlayFabClientAPI.GetAccountInfo(new GetAccountInfoRequest { PlayFabId = PhotonNetwork.LocalPlayer.UserId }, delegate (GetAccountInfoResult result) // Who designed this { - string date = result.AccountInfo.Created.ToString("MM/dd/yyyy HH:mm:ss:ff"); + string date = result.AccountInfo.Created.ToString("MMMM dd, yyyy h:mm tt"); NotifiLib.SendNotification("[SUCCESS] " + date, 5000); GUIUtility.systemCopyBuffer = date; }, delegate { NotifiLib.SendNotification("[ERROR] Could not copy creation date."); }, null, null); diff --git a/Mods/Movement.cs b/Mods/Movement.cs index 00cc668..929669d 100644 --- a/Mods/Movement.cs +++ b/Mods/Movement.cs @@ -3,6 +3,7 @@ using GorillaLocomotion.Climbing; using GorillaLocomotion.Swimming; using GorillaNetworking; +using GorillaTagScripts; using HarmonyLib; using iiMenu.Classes; using iiMenu.Menu; @@ -18,6 +19,7 @@ using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.Rendering; +using UnityEngine.Tilemaps; using UnityEngine.XR.Interaction.Toolkit; using Valve.VR; using static iiMenu.Classes.RigManager; @@ -442,7 +444,7 @@ public static void ChangeSpeedBoostAmount() public static void PlatformSpam() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (rightGrab) { GameObject platform = GameObject.CreatePrimitive(PrimitiveType.Cube); UnityEngine.Object.Destroy(platform.GetComponent()); @@ -458,13 +460,13 @@ public static void PlatformSpam() public static void PlatformGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GameObject platform = GameObject.CreatePrimitive(PrimitiveType.Cube); UnityEngine.Object.Destroy(platform.GetComponent()); @@ -578,6 +580,14 @@ public static void BarkFly() rb.velocity = Vector3.Lerp(rb.velocity, velocity, 0.12875f); } + public static void VelocityBarkFly() + { + if ((Mathf.Abs(SteamVR_Actions.gorillaTag_LeftJoystick2DAxis.axis.x) > 0.3 || Mathf.Abs(SteamVR_Actions.gorillaTag_LeftJoystick2DAxis.axis.y) > 0.3) || (Mathf.Abs(SteamVR_Actions.gorillaTag_RightJoystick2DAxis.axis.x) > 0.3 || Mathf.Abs(SteamVR_Actions.gorillaTag_RightJoystick2DAxis.axis.y) > 0.3)) + { + BarkFly(); + } + } + public static void HandFly() { if (rightPrimary) @@ -1102,6 +1112,41 @@ public static void NetworkedGrappleMods() } } + private static bool lastWasGrab = false; + private static bool lastWasRightGrab = false; + public static void NetworkedPlatforms() + { + if (GetIndex("Platforms").enabled) + { + if (leftGrab && !lastWasGrab) + { + CoroutineManager.RunCoroutine(CreateLeftPlatform()); + } + if (rightGrab && !lastWasRightGrab) + { + CoroutineManager.RunCoroutine(CreateRightPlatform()); + } + lastWasGrab = leftGrab; + lastWasRightGrab = rightGrab; + } + } + + public static IEnumerator CreateLeftPlatform() + { + yield return Fun.CreateGetPiece(1924370326, piece => + { + BuilderTable.instance.RequestGrabPiece(piece, true, new Vector3(-0.03f, -0.03f, -0.27f), new Quaternion(-0.6f, 0.5f, -0.4f, 0.5f)); + }); + } + + public static IEnumerator CreateRightPlatform() + { + yield return Fun.CreateGetPiece(1924370326, piece => + { + BuilderTable.instance.RequestGrabPiece(piece, false, new Vector3(0.03f, -0.03f, -0.27f), new Quaternion(0.5f, -0.6f, -0.5f, 0.4f)); + }); + } + public static void UpAndDown() { if ((rightTrigger > 0.5f) || rightGrab) @@ -1338,7 +1383,13 @@ public static void EnterTeleportToPlayer() List tpbuttons = new List { new ButtonInfo { buttonText = "Exit Teleport to Player", method = () => ExitTeleportToPlayer(), isTogglable = false, toolTip = "Returns you back to the movement mods." } }; foreach (Player plr in PhotonNetwork.PlayerListOthers) { - tpbuttons.Add(new ButtonInfo { buttonText = "TeleportPlayer"+tpbuttons.Count.ToString(), overlapText = ToTitleCase(plr.NickName), method = () => TeleportToPlayer(plr), isTogglable = false, toolTip = "Teleports you to " + ToTitleCase(plr.NickName) + "." }); + string clrtxt = "#ffffff"; + try + { + clrtxt = ColorToHex(GetVRRigFromPlayer(plr).playerColor); + } + catch { } + tpbuttons.Add(new ButtonInfo { buttonText = "TeleportPlayer"+tpbuttons.Count.ToString(), overlapText = ""+ToTitleCase(plr.NickName)+"", method = () => TeleportToPlayer(plr), isTogglable = false, toolTip = "Teleports you to " + ToTitleCase(plr.NickName) + "." }); } Buttons.buttons[29] = tpbuttons.ToArray(); } @@ -1434,6 +1485,12 @@ public static void ExitTeleportToPlayer() "Environment Objects/TriggerZones_Prefab/ZoneTransitions_Prefab/Regional Transition/BayouOnly", "Environment Objects/TriggerZones_Prefab/JoinRoomTriggers_Prefab/JoinPublicRoom - BayouComputer2" }, + new string[] // Bayou + { + "Virtual Stump", + "VSTUMP", + "VSTUMP" + }, }; foreach (string[] Data in mapData) { @@ -1444,19 +1501,30 @@ public static void ExitTeleportToPlayer() public static void TeleportToMap(string zone, string pos) { - GameObject.Find(zone).GetComponent().OnBoxTriggered(); - TeleportPlayer(GameObject.Find(pos).transform.position); + if (zone == "VSTUMP") + { + ModIOLoginTeleporter tele = GameObject.Find("Environment Objects/LocalObjects_Prefab/City_WorkingPrefab/Arcade_prefab/MainRoom/VRArea/ModIOArcadeTeleporter/TeleportTriggers_1/VRHeadsetTrigger_1").GetComponent(); + + tele.gameObject.transform.parent.parent.parent.parent.parent.parent.gameObject.SetActive(true); + tele.gameObject.transform.parent.parent.parent.parent.gameObject.SetActive(true); + + tele.LoginAndTeleport(); + } else + { + GameObject.Find(zone).GetComponent().OnBoxTriggered(); + TeleportPlayer(GameObject.Find(pos).transform.position); + } } public static void TeleportGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > teleDebounce) + if (GetGunInput(true) && Time.time > teleDebounce) { closePosition = Vector3.zero; TeleportPlayer(NewPointer.transform.position + new Vector3(0f, 1f, 0f)); @@ -1468,13 +1536,13 @@ public static void TeleportGun() public static void Airstrike() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > teleDebounce) + if (GetGunInput(true) && Time.time > teleDebounce) { GorillaLocomotion.Player.Instance.GetComponent().velocity = new Vector3(0f, -20f, 0f); TeleportPlayer(NewPointer.transform.position + new Vector3(0f, 30f, 0f)); @@ -1797,13 +1865,13 @@ public static void EnableRig() public static void RigGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GorillaTagger.Instance.offlineVRRig.enabled = false; GorillaTagger.Instance.offlineVRRig.transform.position = NewPointer.transform.position + new Vector3(0, 1, 0); @@ -1981,34 +2049,18 @@ public static void FreezeRigBody() } } - private static bool offsethaschanged = false; - private static Vector3 lastlefthandoffset = Vector3.zero; - private static Vector3 lastrighthandoffset = Vector3.zero; - public static void FakeOculusMenu() // Finally got around to making this look real + public static void FakeOculusMenu() // I swear I thought the oculus menu had their arms crossed { if (leftPrimary) { Safety.NoFinger(); - GorillaLocomotion.Player.Instance.leftControllerTransform.rotation = Camera.main.transform.rotation * Quaternion.Euler(0f, 100f, 0f); - GorillaLocomotion.Player.Instance.rightControllerTransform.rotation = Camera.main.transform.rotation * Quaternion.Euler(0f, -100f, 0f); - if (!offsethaschanged) - { - lastlefthandoffset = GorillaLocomotion.Player.Instance.leftHandOffset; - lastrighthandoffset = GorillaLocomotion.Player.Instance.rightHandOffset; - offsethaschanged = true; - } - GorillaLocomotion.Player.Instance.leftHandOffset = new Vector3(-0.02f, -0.052f, -0.056f); - GorillaLocomotion.Player.Instance.rightHandOffset = new Vector3(0.02f, -0.052f, -0.056f); - } else - { - if (offsethaschanged) - { - GorillaLocomotion.Player.Instance.leftHandOffset = lastlefthandoffset; - GorillaLocomotion.Player.Instance.rightHandOffset = lastrighthandoffset; - offsethaschanged = false; - } + GorillaLocomotion.Player.Instance.inOverlay = true; + GorillaLocomotion.Player.Instance.leftControllerTransform.localPosition = new Vector3(238f, -90f, 0f); + GorillaLocomotion.Player.Instance.rightControllerTransform.localPosition = new Vector3(-190f, 90f, 0f); + GorillaLocomotion.Player.Instance.leftControllerTransform.rotation = Camera.main.transform.rotation * Quaternion.Euler(-55f, 90f, 0f); + GorillaLocomotion.Player.Instance.rightControllerTransform.rotation = Camera.main.transform.rotation * Quaternion.Euler(-55f, -49f, 0f); } - GorillaLocomotion.Player.Instance.inOverlay = leftPrimary; + } public static void FakeReportMenu() @@ -2242,10 +2294,118 @@ public static void Fan() } } + private static Vector3 headPos = Vector3.zero; + private static Vector3 headRot = Vector3.zero; + + private static Vector3 handPos_L = Vector3.zero; + private static Vector3 handRot_L = Vector3.zero; + + private static Vector3 handPos_R = Vector3.zero; + private static Vector3 handRot_R = Vector3.zero; + public static void GhostAnimations() { GorillaTagger.Instance.offlineVRRig.enabled = false; + if (headPos == Vector3.zero) + headPos = GorillaTagger.Instance.headCollider.transform.position; + if (headRot == Vector3.zero) + headRot = GorillaTagger.Instance.headCollider.transform.rotation.eulerAngles; + + if (handPos_L == Vector3.zero) + handPos_L = GorillaTagger.Instance.leftHandTransform.transform.position; + if (handRot_L == Vector3.zero) + handRot_L = GorillaTagger.Instance.leftHandTransform.transform.rotation.eulerAngles; + + if (handPos_R == Vector3.zero) + handPos_R = GorillaTagger.Instance.rightHandTransform.transform.position; + if (handRot_R == Vector3.zero) + handRot_R = GorillaTagger.Instance.rightHandTransform.transform.rotation.eulerAngles; + + float positionSpeed = 0.01f; + float rotationSpeed = 2.0f; + float positionThreshold = 0.05f; + float rotationThreshold = 11.5f; + if (Vector3.Distance(headPos, GorillaTagger.Instance.headCollider.transform.position) > positionThreshold) + headPos += Vector3.Normalize(GorillaTagger.Instance.headCollider.transform.position - headPos) * positionSpeed; + + if (Quaternion.Angle(Quaternion.Euler(headRot), GorillaTagger.Instance.headCollider.transform.rotation) > rotationThreshold) + headRot = Quaternion.RotateTowards(Quaternion.Euler(headRot), GorillaTagger.Instance.headCollider.transform.rotation, rotationSpeed).eulerAngles; + + if (Vector3.Distance(handPos_L, GorillaTagger.Instance.leftHandTransform.transform.position) > positionThreshold) + handPos_L += Vector3.Normalize(GorillaTagger.Instance.leftHandTransform.transform.position - handPos_L) * positionSpeed; + + if (Quaternion.Angle(Quaternion.Euler(handRot_L), GorillaTagger.Instance.leftHandTransform.transform.rotation) > rotationThreshold) + handRot_L = Quaternion.RotateTowards(Quaternion.Euler(handRot_L), GorillaTagger.Instance.leftHandTransform.transform.rotation, rotationSpeed).eulerAngles; + + if (Vector3.Distance(handPos_R, GorillaTagger.Instance.rightHandTransform.transform.position) > positionThreshold) + handPos_R += Vector3.Normalize(GorillaTagger.Instance.rightHandTransform.transform.position - handPos_R) * positionSpeed; + + if (Quaternion.Angle(Quaternion.Euler(handRot_R), GorillaTagger.Instance.rightHandTransform.transform.rotation) > rotationThreshold) + handRot_R = Quaternion.RotateTowards(Quaternion.Euler(handRot_R), GorillaTagger.Instance.rightHandTransform.transform.rotation, rotationSpeed).eulerAngles; + + + + GorillaTagger.Instance.offlineVRRig.transform.position = headPos - new Vector3(0f, 0.15f, 0f); + try + { + GorillaTagger.Instance.myVRRig.transform.position = headPos - new Vector3(0f, 0.15f, 0f); + } + catch { } + + GorillaTagger.Instance.offlineVRRig.transform.rotation = Quaternion.Euler(new Vector3(0f, headRot.y, 0f)); + try + { + GorillaTagger.Instance.myVRRig.transform.rotation = Quaternion.Euler(new Vector3(0f, headRot.y, 0f)); + } + catch { } + + GorillaTagger.Instance.offlineVRRig.head.rigTarget.transform.rotation = Quaternion.Euler(headRot); + + GorillaTagger.Instance.offlineVRRig.leftHand.rigTarget.transform.position = handPos_L; + GorillaTagger.Instance.offlineVRRig.rightHand.rigTarget.transform.position = handPos_R; + + GorillaTagger.Instance.offlineVRRig.leftHand.rigTarget.transform.rotation = Quaternion.Euler(handRot_L); + GorillaTagger.Instance.offlineVRRig.rightHand.rigTarget.transform.rotation = Quaternion.Euler(handRot_R); + + GorillaTagger.Instance.offlineVRRig.leftIndex.calcT = leftTrigger; + GorillaTagger.Instance.offlineVRRig.leftMiddle.calcT = leftGrab ? 1 : 0; + GorillaTagger.Instance.offlineVRRig.leftThumb.calcT = leftPrimary || leftSecondary ? 1 : 0; + + GorillaTagger.Instance.offlineVRRig.leftIndex.LerpFinger(1f, false); + GorillaTagger.Instance.offlineVRRig.leftMiddle.LerpFinger(1f, false); + GorillaTagger.Instance.offlineVRRig.leftThumb.LerpFinger(1f, false); + + GorillaTagger.Instance.offlineVRRig.rightIndex.calcT = rightTrigger; + GorillaTagger.Instance.offlineVRRig.rightMiddle.calcT = rightGrab ? 1 : 0; + GorillaTagger.Instance.offlineVRRig.rightThumb.calcT = rightPrimary || rightSecondary ? 1 : 0; + + GorillaTagger.Instance.offlineVRRig.rightIndex.LerpFinger(1f, false); + GorillaTagger.Instance.offlineVRRig.rightMiddle.LerpFinger(1f, false); + GorillaTagger.Instance.offlineVRRig.rightThumb.LerpFinger(1f, false); + + + FixRigHandRotation(); + } + + public static void DisableGhostAnimations() + { + headPos = Vector3.zero; + headRot = Vector3.zero; + + handPos_L = Vector3.zero; + handRot_L = Vector3.zero; + + handPos_R = Vector3.zero; + handRot_R = Vector3.zero; + + GorillaTagger.Instance.offlineVRRig.enabled = true; + } + + public static void MinecraftAnimations() + { + GorillaTagger.Instance.offlineVRRig.enabled = false; + GorillaTagger.Instance.offlineVRRig.transform.position = GorillaTagger.Instance.bodyCollider.transform.position + new Vector3(0f, 0.15f, 0f); try { @@ -2290,7 +2450,7 @@ public static void StareAtNearby() public static void StareAtGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -2301,7 +2461,7 @@ public static void StareAtGun() GorillaTagger.Instance.offlineVRRig.headConstraint.LookAt(whoCopy.headMesh.transform.position); GorillaTagger.Instance.offlineVRRig.head.rigTarget.LookAt(whoCopy.headMesh.transform.position); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -2661,14 +2821,41 @@ public static void SolidPlayers() } } - public static bool lasttouchleft = false; - public static bool lasttouchright = false; + public static int pullPowerInt = 0; + public static void ChangePullModPower() + { + float[] powers = new float[] + { + 0.05f, + 0.1f, + 0.2f, + 0.4f + }; + string[] powerNames = new string[] + { + "Normal", + "Medium", + "Strong", + "Powerful" + }; + pullPowerInt++; + if (pullPowerInt > powers.Length - 1) + { + pullPowerInt = 0; + } + pullPower = powers[pullPowerInt]; + GetIndex("Change Pull Mod Power").overlapText = "Change Pull Mod Power [" + powerNames[pullPowerInt] + "]"; + } + + private static float pullPower = 0.05f; + private static bool lasttouchleft = false; + private static bool lasttouchright = false; public static void PullMod() { if (((!GorillaLocomotion.Player.Instance.wasLeftHandTouching && lasttouchleft) || (!GorillaLocomotion.Player.Instance.wasRightHandTouching && lasttouchright)) && rightGrab) { Vector3 vel = GorillaLocomotion.Player.Instance.GetComponent().velocity; - GorillaLocomotion.Player.Instance.transform.position += new Vector3(vel.x / 20f, 0f, vel.z / 20f); + GorillaLocomotion.Player.Instance.transform.position += new Vector3(vel.x * pullPower, 0f, vel.z * pullPower); } lasttouchleft = GorillaLocomotion.Player.Instance.wasLeftHandTouching; lasttouchright = GorillaLocomotion.Player.Instance.wasRightHandTouching; @@ -3023,7 +3210,7 @@ public static void FastSwim() public static void PiggybackGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -3034,7 +3221,7 @@ public static void PiggybackGun() TeleportPlayer(whoCopy.transform.position + new Vector3(0f, 0.5f, 0f)); GorillaLocomotion.Player.Instance.GetComponent().velocity = Vector3.zero; } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -3055,7 +3242,7 @@ public static void PiggybackGun() public static void CopyMovementGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -3100,7 +3287,7 @@ public static void CopyMovementGun() GorillaTagger.Instance.offlineVRRig.head.rigTarget.transform.rotation = whoCopy.headMesh.transform.rotation; } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -3122,7 +3309,7 @@ public static void CopyMovementGun() public static void FollowPlayerGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -3174,7 +3361,7 @@ public static void FollowPlayerGun() GorillaTagger.Instance.offlineVRRig.rightMiddle.LerpFinger(1f, false); GorillaTagger.Instance.offlineVRRig.rightThumb.LerpFinger(1f, false); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -3196,7 +3383,7 @@ public static void FollowPlayerGun() public static void OrbitPlayerGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -3242,7 +3429,7 @@ public static void OrbitPlayerGun() GorillaTagger.Instance.offlineVRRig.rightMiddle.LerpFinger(1f, false); GorillaTagger.Instance.offlineVRRig.rightThumb.LerpFinger(1f, false); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -3264,7 +3451,7 @@ public static void OrbitPlayerGun() public static void JumpscareGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -3315,7 +3502,7 @@ public static void JumpscareGun() GorillaTagger.Instance.offlineVRRig.rightMiddle.LerpFinger(1f, false); GorillaTagger.Instance.offlineVRRig.rightThumb.LerpFinger(1f, false); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -3337,7 +3524,7 @@ public static void JumpscareGun() public static void AnnoyPlayerGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -3398,7 +3585,7 @@ public static void AnnoyPlayerGun() GorillaTagger.Instance.offlineVRRig.PlayHandTapLocal(91, false, 999999f); }*/ } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -3420,7 +3607,7 @@ public static void AnnoyPlayerGun() public static void ConfusePlayerGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -3452,7 +3639,7 @@ public static void ConfusePlayerGun() splashDel = Time.time + 0.1f; } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -3474,7 +3661,7 @@ public static void ConfusePlayerGun() public static void IntercourseGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -3563,7 +3750,7 @@ public static void IntercourseGun() } } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -3585,7 +3772,7 @@ public static void IntercourseGun() public static void HeadGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -3650,7 +3837,7 @@ public static void HeadGun() } } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) diff --git a/Mods/Overpowered.cs b/Mods/Overpowered.cs index 93e96a4..c59e948 100644 --- a/Mods/Overpowered.cs +++ b/Mods/Overpowered.cs @@ -1,21 +1,15 @@ using ExitGames.Client.Photon; using GorillaGameModes; using GorillaLocomotion.Gameplay; -using GorillaNetworking; -using GorillaTag.Cosmetics; using GorillaTagScripts; using HarmonyLib; using iiMenu.Classes; using iiMenu.Notifications; -using Meta.WitAi; using Photon.Pun; using Photon.Realtime; -using System; using System.Collections; -using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; -using UnityEngine.ProBuilder.Shapes; using static iiMenu.Classes.RigManager; using static iiMenu.Menu.Main; @@ -70,13 +64,13 @@ public static void GuardianSelf() public static void GuardianGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > kgDebounce) + if (GetGunInput(true) && Time.time > kgDebounce) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -135,13 +129,13 @@ public static void UnguardianSelf() public static void UnguardianGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > kgDebounce) + if (GetGunInput(true) && Time.time > kgDebounce) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -181,6 +175,21 @@ public static void UnguardianAll() else { NotifiLib.SendNotification("[ERROR] You are not master client."); } } + private static float guardianspazdelay = 0f; + private static bool lastGuardianThing = false; + public static void GuardianSpaz() + { + if (Time.time > guardianspazdelay) + { + guardianspazdelay = Time.time + 0.1f; + lastGuardianThing = !lastGuardianThing; + if (lastGuardianThing) + GuardianAll(); + else + UnguardianAll(); + } + } + public static void AlwaysGuardian() { if (PhotonNetwork.IsMasterClient) @@ -273,13 +282,13 @@ public static void BetaSetVelocityTargetGroup(RpcTarget victim, Vector3 velocity public static void GrabGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > kgDebounce) + if (GetGunInput(true) && Time.time > kgDebounce) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -326,13 +335,13 @@ public static void GrabAll() public static void ReleaseGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > kgDebounce) + if (GetGunInput(true) && Time.time > kgDebounce) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -379,18 +388,18 @@ public static void ReleaseAll() public static void FlingGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > kgDebounce) + if (GetGunInput(true) && Time.time > kgDebounce) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) { - BetaSetVelocityPlayer(GetPlayerFromVRRig(possibly), new Vector3(0f, 500f, 0f) ); + BetaSetVelocityPlayer(GetPlayerFromVRRig(possibly), new Vector3(0f, 19.9f, 0f) ); RPCProtection(); kgDebounce = Time.time + 0.1f; } @@ -406,7 +415,7 @@ public static void FlingAll() GorillaGuardianManager gman = GameObject.Find("GT Systems/GameModeSystem/Gorilla Guardian Manager").GetComponent(); if (gman.IsPlayerGuardian(NetworkSystem.Instance.LocalPlayer)) { - BetaSetVelocityTargetGroup(RpcTarget.Others, new Vector3(0f, 500f, 0f)); + BetaSetVelocityTargetGroup(RpcTarget.Others, new Vector3(0f, 19.9f, 0f)); RPCProtection(); } else @@ -416,9 +425,10 @@ public static void FlingAll() } } + public static void SpazPlayerGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -433,7 +443,7 @@ public static void SpazPlayerGun() kgDebounce = Time.time + 0.1f; } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -462,14 +472,405 @@ public static void SpazAllPlayers() } } - public static void PhysicalFreezeGun() + private static float miniaturedelay = 0f; + private static float lastBeforeClearTime = -1f; + public static void AtticCrashGun() + { + if (GetGunInput(false)) + { + var GunData = RenderGun(); + RaycastHit Ray = GunData.Ray; + GameObject NewPointer = GunData.NewPointer; + + if (isCopying && whoCopy != null) + { + if (Time.time > miniaturedelay) + { + miniaturedelay = Time.time + 0.022f; + BuilderTable.instance.RequestCreatePiece(1700948013, whoCopy.headMesh.transform.position, Quaternion.identity, 0); + BuilderTable.instance.RequestCreatePiece(1700948013, whoCopy.rightHandTransform.position, Quaternion.identity, 0); + BuilderTable.instance.RequestCreatePiece(1700948013, whoCopy.leftHandTransform.position, Quaternion.identity, 0); + BuilderTable.instance.RequestCreatePiece(1700948013, whoCopy.transform.position, Quaternion.identity, 0); + } + + if (Time.time > lastBeforeClearTime) + { + RPCProtection(); + foreach (BuilderPiece piece in GetPieces()) + { + if (piece.pieceType == 1700948013) + piece.gameObject.SetActive(false); + } + lastBeforeClearTime = Time.time + 1f; + } + } + if (GetGunInput(true)) + { + VRRig possibly = Ray.collider.GetComponentInParent(); + if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) + { + isCopying = true; + whoCopy = possibly; + } + } + } + else + { + if (isCopying) + { + isCopying = false; + } + } + } + + public static void AtticCrashAll() + { + if (rightTrigger > 0.5f) + { + if (Time.time > miniaturedelay) + { + miniaturedelay = Time.time + 0.022f; + for (int i = 0; i < 4; i++) + { + BuilderTable.instance.RequestCreatePiece(1700948013, GorillaTagger.Instance.headCollider.transform.position, Quaternion.identity, 0); + } + } + + if (Time.time > lastBeforeClearTime) + { + RPCProtection(); + foreach (BuilderPiece piece in GetPieces()) + { + if (piece.pieceType == 1700948013) + piece.gameObject.SetActive(false); + } + lastBeforeClearTime = Time.time + 1f; + } + } + } + + private static float delaything = 0f; + public static void GuardianBlindGun() + { + if (GetGunInput(false)) + { + var GunData = RenderGun(); + RaycastHit Ray = GunData.Ray; + GameObject NewPointer = GunData.NewPointer; + + if (GetGunInput(true) && Time.time > delaything) + { + VRRig possibly = Ray.collider.GetComponentInParent(); + if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) + { + delaything = Time.time + 0.1f; + RigManager.GetNetworkViewFromVRRig(possibly).SendRPC("GrabbedByPlayer", GetPlayerFromVRRig(possibly), new object[] { true, false, false }); + RigManager.GetNetworkViewFromVRRig(possibly).SendRPC("DroppedByPlayer", GetPlayerFromVRRig(possibly), new object[] { new Vector3(0f, float.NaN, 0f) }); + } + } + } + } + + public static void GuardianBlindAll() + { + if (rightTrigger > 0.5f) + { + if (Time.time > delaything) + { + delaything = Time.time + 0.1f; + foreach (VRRig player in GorillaParent.instance.vrrigs) + { + RigManager.GetNetworkViewFromVRRig(player).SendRPC("GrabbedByPlayer", RpcTarget.Others, new object[] { true, false, false }); + RigManager.GetNetworkViewFromVRRig(player).SendRPC("DroppedByPlayer", RpcTarget.Others, new object[] { new Vector3(0f, float.NaN, 0f) }); + } + } + } + } + + // Hi skids :3 + // If you take this code you like giving sloppy wet kisses to cute boys >_< + // I gotta stop + + public static void MuteGun() + { + if (GetGunInput(false)) + { + var GunData = RenderGun(); + RaycastHit Ray = GunData.Ray; + GameObject NewPointer = GunData.NewPointer; + + if (isCopying && whoCopy != null) + { + if (Time.time > delaything) + { + delaything = Time.time + 0.027f; + PhotonNetwork.RaiseEvent(0, null, new RaiseEventOptions + { + CachingOption = EventCaching.DoNotCache, + TargetActors = new int[] + { + whoCopy.OwningNetPlayer.ActorNumber + } + }, SendOptions.SendReliable); + + NetworkView view = RigManager.GetNetworkViewFromVRRig(whoCopy); + view.GetView.ControllerActorNr = PhotonNetwork.LocalPlayer.ActorNumber; + + PhotonNetwork.Destroy(view.GetView); // Trust + } + } + if (GetGunInput(true)) + { + VRRig possibly = Ray.collider.GetComponentInParent(); + if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) + { + isCopying = true; + whoCopy = possibly; + } + } + } + else + { + if (isCopying) + { + isCopying = false; + } + } + } + + public static void MuteAll() + { + if (rightTrigger > 0.5f) + { + if (Time.time > delaything) + { + delaything = Time.time + 0.05f; + PhotonNetwork.RaiseEvent(0, null, new RaiseEventOptions + { + CachingOption = EventCaching.DoNotCache, + Receivers = ReceiverGroup.Others + }, SendOptions.SendReliable); + + foreach (VRRig player in GorillaParent.instance.vrrigs) + { + NetworkView view = RigManager.GetNetworkViewFromVRRig(player); + view.GetView.ControllerActorNr = PhotonNetwork.LocalPlayer.ActorNumber; + + PhotonNetwork.Destroy(view.GetView); // Trust + } + } + } + } + + // Huge thanks to kingofnetflix + public static void LagGun() { + if (GetGunInput(false)) + { + var GunData = RenderGun(); + RaycastHit Ray = GunData.Ray; + GameObject NewPointer = GunData.NewPointer; + + if (isCopying && whoCopy != null) + { + if (Time.time > delaything) + { + delaything = Time.time + 0.3f; + PhotonView photonView = GameObject.Find("WorldShareableCosmetic").GetComponent().guard.photonView; + for (int i = 0; i < 100; i++) + { + photonView.RPC("OnMasterClientAssistedTakeoverRequest", NetPlayerToPlayer(GetPlayerFromVRRig(whoCopy)), new object[2]); + } + } + } + if (GetGunInput(true)) + { + VRRig possibly = Ray.collider.GetComponentInParent(); + if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) + { + RPCProtection(); + isCopying = true; + whoCopy = possibly; + } + } + } + else + { + if (isCopying) + { + RPCProtection(); + isCopying = false; + } + } + } + + public static void LagAll() + { + if (rightTrigger > 0.5f) + { + if (Time.time > delaything) + { + delaything = Time.time + 0.3f; + PhotonView photonView = GameObject.Find("WorldShareableCosmetic").GetComponent().guard.photonView; + for (int i = 0; i < 100; i++) + { + photonView.RPC("OnMasterClientAssistedTakeoverRequest", RpcTarget.Others, new object[2]); + } + } + } + } + + public static IEnumerator KickRig(VRRig FUCKER) + { + Traverse.Create(GameObject.Find("PhotonMono").GetComponent()).Field("nextSendTickCountOnSerialize").SetValue((int)(Time.realtimeSinceStartup * 9999f)); + yield return new WaitForSeconds(0.5f); + for (int i = 0; i < 3950; i++) + { + // What is this + PhotonView photonView = GetPhotonViewFromVRRig(FUCKER); + ExitGames.Client.Photon.Hashtable rpcHash = new ExitGames.Client.Photon.Hashtable + { + { 0, photonView.ViewID }, + { 2, (int)(PhotonNetwork.ServerTimestamp + -int.MaxValue) }, + { 3, "RPC_RequestMaterialColor" }, + { 4, new object[] { NetPlayerToPlayer(GetPlayerFromVRRig(FUCKER)) } }, + { 5, (byte)91 } + }; + PhotonNetwork.NetworkingClient.LoadBalancingPeer.OpRaiseEvent(200, rpcHash, new RaiseEventOptions + { + Receivers = ReceiverGroup.Others, + InterestGroup = photonView.Group + }, new SendOptions + { + Reliability = true, + DeliveryMode = DeliveryMode.ReliableUnsequenced, + Encrypt = false + }); + } + } + + private static Coroutine KVCoroutine = null; + private static string ihavediahrrea = ""; + public static void KickGun() + { + if (!PhotonNetwork.InRoom) + { + Traverse.Create(GameObject.Find("PhotonMono").GetComponent()).Field("nextSendTickCountOnSerialize").SetValue((int)(Time.realtimeSinceStartup * 1000f)); + } if (rightGrab || Mouse.current.rightButton.isPressed) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; + if (isCopying && whoCopy != null) + { + if (!PhotonNetwork.InRoom) + { + isCopying = false; + whoCopy = null; + SetTick(1000f); + NotifiLib.SendNotification("[ERROR] You have been kicked for sending too many RPCs, you will reconnect shortly."); + rejRoom = ihavediahrrea; + } + if (GetPlayerFromVRRig(whoCopy) == null) + { + isCopying = false; + whoCopy = null; + SetTick(1000f); + NotifiLib.SendNotification("[SUCCESS] Player has been kicked!"); + rejRoom = ihavediahrrea; + } + } + if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && !isCopying) + { + VRRig possibly = Ray.collider.GetComponentInParent(); + if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) + { + isCopying = true; + whoCopy = possibly; + KVCoroutine = CoroutineManager.RunCoroutine(KickRig(whoCopy)); + SetTick(9999f); + NotifiLib.SendNotification("[KICK] Player is being kicked..."); + } + } + } else + { + if (isCopying) + { + isCopying = false; + CoroutineManager.EndCoroutine(KVCoroutine); + SetTick(1000f); + } + } + } + + public static void SetTick(float tick) + { + Traverse.Create(GameObject.Find("PhotonMono").GetComponent()).Field("nextSendTickCountOnSerialize").SetValue((int)(Time.realtimeSinceStartup * tick)); + } + + // I see you + public static void ForceUnloadCustomMap() + { + delaything = Time.time + 0.1f; + PhotonView goldentrophy = GameObject.Find("Environment Objects/LocalObjects_Prefab/VirtualStump_CustomMapLobby/ModIOMapsTerminal/NetworkObject").GetComponent(); + + goldentrophy.RPC("UnloadMapRPC", RpcTarget.All, new object[] { }); + RPCProtection(); + } + + // Don't steal this + public static void VirtualStumpKickGun() + { + if (GetGunInput(false)) + { + var GunData = RenderGun(); + RaycastHit Ray = GunData.Ray; + GameObject NewPointer = GunData.NewPointer; + + if (GetGunInput(true) && Time.time > delaything) + { + VRRig possibly = Ray.collider.GetComponentInParent(); + if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) + { + delaything = Time.time + 0.1f; + PhotonView goldentrophy = GameObject.Find("Environment Objects/LocalObjects_Prefab/VirtualStump_CustomMapLobby/ModIOMapsTerminal/NetworkObject").GetComponent(); + + goldentrophy.RPC("SetRoomMapRPC", NetPlayerToPlayer(GetPlayerFromVRRig(possibly)), new object[] { UnityEngine.Random.Range(-99999L, 99999L) }); + goldentrophy.RPC("UnloadMapRPC", NetPlayerToPlayer(GetPlayerFromVRRig(possibly)), new object[] { }); + RPCProtection(); + } + } + } + } + + // Or I will kill you + public static void VirtualStumpKickAll() + { + if (rightTrigger > 0.5f) + { + if (Time.time > delaything) + { + delaything = Time.time + 0.1f; + + PhotonView goldentrophy = GameObject.Find("Environment Objects/LocalObjects_Prefab/VirtualStump_CustomMapLobby/ModIOMapsTerminal/NetworkObject").GetComponent(); + + goldentrophy.RPC("SetRoomMapRPC", RpcTarget.Others, new object[] { UnityEngine.Random.Range(-99999L, 99999L) }); + goldentrophy.RPC("UnloadMapRPC", RpcTarget.Others, new object[] { }); + RPCProtection(); + } + } + } + + public static void PhysicalFreezeGun() + { + if (GetGunInput(false)) + { + var GunData = RenderGun(); + RaycastHit Ray = GunData.Ray; + GameObject NewPointer = GunData.NewPointer; + if (isCopying && whoCopy != null) { if (Time.time > kgDebounce) @@ -479,7 +880,7 @@ public static void PhysicalFreezeGun() kgDebounce = Time.time + 0.1f; } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -510,7 +911,7 @@ public static void PhysicalFreezeAll() public static void BringGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -525,7 +926,7 @@ public static void BringGun() kgDebounce = Time.time + 0.1f; } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -563,7 +964,7 @@ public static void BringAll() private static float thingdeb = 0f; public static void GiveFlyGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -581,7 +982,7 @@ public static void GiveFlyGun() thingdeb = Time.time + 0.1f; } } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -781,13 +1182,13 @@ public static void SafetyBubble() public static void BringAllGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { if (Time.time > kgDebounce) { @@ -849,13 +1250,13 @@ public static void EffectSpamHands() public static void EffectSpamGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GorillaGuardianManager gman = GameObject.Find("GT Systems/GameModeSystem/Gorilla Guardian Manager").GetComponent(); if (Time.time > slamDel) @@ -877,243 +1278,6 @@ public static void EffectSpamGun() } } - //float num = Mathf.Min(Time.time - (float)Traverse.Create(gzm).Field("_lastTappedTime").GetValue(), (float)Traverse.Create(gzm).Field("activationTimePerTap").GetValue()); - - /*public static void StartMoonEvent() - { - GreyZoneManager gzm = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/GreyZoneManager").GetComponent(); - if (PhotonNetwork.IsMasterClient) - { - gzm.ActivateGreyZoneAuthority(); - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - - public static void EndMoonEvent() - { - GreyZoneManager gzm = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/GreyZoneManager").GetComponent(); - if (PhotonNetwork.IsMasterClient) - { - gzm.DeactivateGreyZoneAuthority(); - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - - private static float lastidiotstupidlaaa = 0f; - public static void FlashScreen() - { - GreyZoneManager gzm = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/GreyZoneManager").GetComponent(); - if (PhotonNetwork.IsMasterClient) - { - if (Time.time > lastidiotstupidlaaa) - { - lastidiotstupidlaaa = Time.time + 0.1f; - if (gzm.GreyZoneActive) - { - gzm.DeactivateGreyZoneAuthority(); - } else - { - gzm.ActivateGreyZoneAuthority(); - } - } - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - - public static void SpawnBlueLucy() - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - hgc.timeGongStarted = Time.time; - hgc.currentState = HalloweenGhostChaser.ChaseState.Gong; - hgc.isSummoned = false; - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - - public static void SpawnRedLucy() - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - hgc.timeGongStarted = Time.time; - hgc.currentState = HalloweenGhostChaser.ChaseState.Gong; - hgc.isSummoned = true; - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - - public static void DespawnLucy() - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - hgc.currentState = HalloweenGhostChaser.ChaseState.Dormant; - hgc.isSummoned = false; - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - - public static void LucyChaseSelf() - { - if (rightGrab || Mouse.current.rightButton.isPressed) - { - var GunData = RenderGun(); - RaycastHit Ray = GunData.Ray; - GameObject NewPointer = GunData.NewPointer; - - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - VRRig possibly = Ray.collider.GetComponentInParent(); - if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) - { - hgc.currentState = HalloweenGhostChaser.ChaseState.Chasing; - hgc.targetPlayer = NetworkSystem.Instance.LocalPlayer; - hgc.followTarget = GorillaTagger.Instance.offlineVRRig.transform; - } - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - } - } - - public static void LucyChaseGun() - { - if (rightGrab || Mouse.current.rightButton.isPressed) - { - var GunData = RenderGun(); - RaycastHit Ray = GunData.Ray; - GameObject NewPointer = GunData.NewPointer; - - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - VRRig possibly = Ray.collider.GetComponentInParent(); - if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) - { - hgc.currentState = HalloweenGhostChaser.ChaseState.Chasing; - hgc.targetPlayer = GetPlayerFromVRRig(possibly); - hgc.followTarget = possibly.transform; - } - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - } - } - - public static void LucyAttackSelf() - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - hgc.currentState = HalloweenGhostChaser.ChaseState.Grabbing; - hgc.grabTime = Time.time; - hgc.targetPlayer = NetworkSystem.Instance.LocalPlayer; - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - - public static void LucyAttackGun() - { - if (rightGrab || Mouse.current.rightButton.isPressed) - { - var GunData = RenderGun(); - RaycastHit Ray = GunData.Ray; - GameObject NewPointer = GunData.NewPointer; - - if (isCopying && whoCopy != null) - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - if (Time.time > hgc.grabTime + hgc.grabDuration + 0.1f) - { - hgc.currentState = HalloweenGhostChaser.ChaseState.Grabbing; - hgc.grabTime = Time.time; - hgc.targetPlayer = GetPlayerFromVRRig(whoCopy); - } - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) - { - VRRig possibly = Ray.collider.GetComponentInParent(); - if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) - { - isCopying = true; - whoCopy = possibly; - } - } - } - else - { - if (isCopying) - { - isCopying = false; - } - } - } - - private static float lasttimethingblahblabhabja = 0f; - public static void SpazLucy() - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - if (Time.time > lasttimethingblahblabhabja) - { - hgc.timeGongStarted = hgc.timeGongStarted == 0f ? Time.time : 0f; - hgc.currentState = HalloweenGhostChaser.ChaseState.Gong; - hgc.isSummoned = true; - lasttimethingblahblabhabja = Time.time + 0.1f; - } - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - - public static void AnnoyingLucy() - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - if (Time.time > lasttimethingblahblabhabja) - { - hgc.timeGongStarted = Time.time; - hgc.grabTime = Time.time; - hgc.currentState = hgc.currentState == HalloweenGhostChaser.ChaseState.Gong ? HalloweenGhostChaser.ChaseState.Grabbing : HalloweenGhostChaser.ChaseState.Gong; - hgc.targetPlayer = GetRandomPlayer(true); - lasttimethingblahblabhabja = Time.time + 0.1f; - } - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - - public static void FastLucy() - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - hgc.currentSpeed = 10f; - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - } - - public static void SlowLucy() - { - HalloweenGhostChaser hgc = GameObject.Find("Environment Objects/05Maze_PersistentObjects/Halloween2024_PersistentObjects/Halloween Ghosts/Lucy/Halloween Ghost/FloatingChaseSkeleton").GetComponent(); - if (hgc.IsMine) - { - hgc.currentSpeed = 1f; - } - else { NotifiLib.SendNotification("[ERROR] You are not master client."); } - }*/ - public static void SpawnSecondLook() { GameObject secondlook = GameObject.Find("Environment Objects/05Maze_PersistentObjects/MinesSecondLookSkeleton"); @@ -1187,13 +1351,13 @@ public static void FreezeAll() public static void DestroyGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > kgDebounce) + if (GetGunInput(true) && Time.time > kgDebounce) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1278,13 +1442,13 @@ public static void BetaSetStatus(int state, RaiseEventOptions balls) public static void SlowGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > kgDebounce) + if (GetGunInput(true) && Time.time > kgDebounce) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1310,13 +1474,13 @@ public static void SlowAll() public static void VibrateGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > kgDebounce) + if (GetGunInput(true) && Time.time > kgDebounce) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1342,13 +1506,13 @@ public static void VibrateAll() public static void GliderBlindGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1411,7 +1575,7 @@ public static void GliderBlindAll() public static void BreakAudioGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -1427,7 +1591,7 @@ public static void BreakAudioGun() }); RPCProtection(); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1477,13 +1641,13 @@ public static void BreakAudioAll() public static void SpazRopeGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GorillaRopeSwing possibly = Ray.collider.GetComponentInParent(); if (possibly && Time.time > RopeDelay) @@ -1504,7 +1668,7 @@ public static void SpazAllRopes() RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > RopeDelay) + if (GetGunInput(true) && Time.time > RopeDelay) { RopeDelay = Time.time + 0.25f; foreach (GorillaRopeSwing rope in GetRopes()) @@ -1552,13 +1716,13 @@ public static void ConfusingRopes() public static void FlingRopeGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { GorillaRopeSwing possibly = Ray.collider.GetComponentInParent(); if (possibly) @@ -1572,13 +1736,13 @@ public static void FlingRopeGun() public static void FlingAllRopesGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; GameObject NewPointer = GunData.NewPointer; - if ((rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) && Time.time > RopeDelay) + if (GetGunInput(true) && Time.time > RopeDelay) { RopeDelay = Time.time + 0.25f; foreach (GorillaRopeSwing rope in GetRopes()) diff --git a/Mods/Projectiles.cs b/Mods/Projectiles.cs index 048dc15..f28d255 100644 --- a/Mods/Projectiles.cs +++ b/Mods/Projectiles.cs @@ -59,7 +59,7 @@ public static void BetaFireProjectile(string projectileName, Vector3 position, V } catch (Exception e) { UnityEngine.Debug.Log(e.Message); } if (projDebounceType > 0f && !nodelay) { - projDebounce = Time.time + projDebounceType + 0.1f; + projDebounce = Time.time + projDebounceType + 0.07f; } } } @@ -342,7 +342,7 @@ public static void ProjectileSpam() public static void GiveProjectileSpamGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -454,7 +454,7 @@ public static void GiveProjectileSpamGun() BetaFireProjectile(projectilename, startpos, charvel, new Color(randa / 255f, randb / 255f, randc / 255f)); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -999,7 +999,7 @@ public static void ServersidedTracers() public static void UrineGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -1012,7 +1012,7 @@ public static void UrineGun() BetaFireProjectile("SnowballLeft", startpos, charvel, new Color(255f, 255f, 0f, 1f)); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1034,7 +1034,7 @@ public static void UrineGun() public static void FecesGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -1047,7 +1047,7 @@ public static void FecesGun() BetaFireProjectile("SnowballLeft", startpos, charvel, new Color32(99, 43, 0, 255)); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1069,7 +1069,7 @@ public static void FecesGun() public static void SemenGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -1082,7 +1082,7 @@ public static void SemenGun() BetaFireProjectile("SnowballLeft", startpos, charvel, new Color(255f, 255f, 255f, 1f)); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1104,7 +1104,7 @@ public static void SemenGun() public static void VomitGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -1117,7 +1117,7 @@ public static void VomitGun() BetaFireProjectile("SnowballLeft", startpos, charvel, new Color(0f, 255f, 0f, 1f)); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) @@ -1139,7 +1139,7 @@ public static void VomitGun() public static void SpitGun() { - if (rightGrab || Mouse.current.rightButton.isPressed) + if (GetGunInput(false)) { var GunData = RenderGun(); RaycastHit Ray = GunData.Ray; @@ -1152,7 +1152,7 @@ public static void SpitGun() BetaFireProjectile("SnowballLeft", startpos, charvel, new Color(0f, 255f, 255f, 1f)); } - if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed) + if (GetGunInput(true)) { VRRig possibly = Ray.collider.GetComponentInParent(); if (possibly && possibly != GorillaTagger.Instance.offlineVRRig) diff --git a/Mods/Safety.cs b/Mods/Safety.cs index 6706ff0..d7de127 100644 --- a/Mods/Safety.cs +++ b/Mods/Safety.cs @@ -232,6 +232,46 @@ public static void AntiReportJoinRandom() catch { } // Not connected } + private static float delaysonospam = 0f; + public static void AntiReportNotify() + { + try + { + if (Time.time > delaysonospam) + { + foreach (GorillaPlayerScoreboardLine line in GorillaScoreboardTotalUpdater.allScoreboardLines) + { + if (line.linePlayer == NetworkSystem.Instance.LocalPlayer) + { + Transform report = line.reportButton.gameObject.transform; + if (GetIndex("Visualize Anti Report").enabled) + { + VisualizeAura(report.position, threshold, Color.red); + } + foreach (VRRig vrrig in GorillaParent.instance.vrrigs) + { + if (vrrig != GorillaTagger.Instance.offlineVRRig) + { + float D1 = Vector3.Distance(vrrig.rightHandTransform.position, report.position); + float D2 = Vector3.Distance(vrrig.leftHandTransform.position, report.position); + + if (D1 < threshold || D2 < threshold) + { + if (!smartarp || (smartarp && PhotonNetwork.CurrentRoom.IsVisible && !PhotonNetwork.CurrentRoom.CustomProperties.ToString().Contains("MODDED"))) + { + delaysonospam = Time.time + 0.1f; + NotifiLib.SendNotification("[ANTI-REPORT] " + GetPlayerFromVRRig(vrrig).NickName + " is reporting you."); + } + } + } + } + } + } + } + } + catch { } // Not connected + } + public static void AntiReportFRT(Player subject, bool doNotification = true) { if (!smartarp || (smartarp && PhotonNetwork.CurrentRoom.IsVisible && !PhotonNetwork.CurrentRoom.CustomProperties.ToString().Contains("MODDED"))) diff --git a/Mods/Settings.cs b/Mods/Settings.cs index fe74608..19213f9 100644 --- a/Mods/Settings.cs +++ b/Mods/Settings.cs @@ -1,5 +1,4 @@ using GorillaNetworking; -using HarmonyLib; using iiMenu.Classes; using iiMenu.Menu; using iiMenu.Mods.Spammers; @@ -11,7 +10,6 @@ using System.Linq; using System.Reflection; using System.Text.RegularExpressions; -using TMPro; using UnityEngine; using UnityEngine.UI; using UnityEngine.Windows.Speech; @@ -441,6 +439,18 @@ public static void OutlineMenuOn() shouldOutline = true; } + public static void PhysicalMenuOn() + { + physicalMenu = true; + physicalOpenPosition = Vector3.zero; + } + + public static void PhysicalMenuOff() + { + physicalMenu = false; + physicalOpenPosition = Vector3.zero; + } + public static void OutlineMenuOff() { shouldOutline = false; @@ -574,7 +584,7 @@ public static void ChangeMenuLanguage() public static void ChangeMenuTheme() { themeType++; - if (themeType > 52) + if (themeType > 54) { themeType = 1; } @@ -816,7 +826,7 @@ public static void ChangeMenuTheme() textColor = Color.blue; textClicked = Color.black; break; - case 22: // Blurple Fade + case 22: // Purple Fade bgColorA = new Color32(119, 0, 255, 255); bgColorB = Color.black; buttonDefaultA = Color.black; @@ -1157,6 +1167,28 @@ public static void ChangeMenuTheme() textColor = new Color32(144, 144, 144, 255); textClicked = Color.white; break; + case 53: // Rose (Solace) + bgColorA = new Color32(176, 12, 64, 255); + bgColorB = new Color32(176, 12, 64, 255); + buttonDefaultA = new Color32(140, 10, 51, 255); + buttonDefaultB = new Color32(140, 10, 51, 255); + buttonClickedA = new Color32(250, 2, 81, 255); + buttonClickedB = new Color32(250, 2, 81, 255); + titleColor = Color.white; + textColor = Color.white; + textClicked = Color.white; + break; + case 54: // Tenacity (Solace) + bgColorA = new Color32(124, 25, 194, 255); + bgColorB = new Color32(124, 25, 194, 255); + buttonDefaultA = new Color32(88, 9, 145, 255); + buttonDefaultB = new Color32(88, 9, 145, 255); + buttonClickedA = new Color32(136, 9, 227, 255); + buttonClickedB = new Color32(136, 9, 227, 255); + titleColor = Color.white; + textColor = Color.white; + textClicked = Color.white; + break; } } @@ -1938,6 +1970,49 @@ public static void ChangeFontStyleType() activeFontStyle = (FontStyle)fontStyleType; } + public static int inputTextColorInt = 3; + public static void ChangeInputTextColor() + { + string[] textColors = new string[] + { + "Red", + "Orange", + "Yellow", + "Green", + "Blue", + "Cyan", + "Purple", + "Pink", + "White", + "Grey", + "Black", + "Rose" + }; + string[] realinputcolor = new string[] + { + "red", + "#ff8000", + "yellow", + "green", + "blue", + "cyan", + "#7700ff", + "magenta", + "white", + "grey", + "black", + "#ff005d" + }; + inputTextColorInt++; + if (inputTextColorInt > realinputcolor.Length - 1) + { + inputTextColorInt = 0; + } + + inputTextColor = realinputcolor[inputTextColorInt]; + GetIndex("Change Input Text Color").overlapText = "Change Input Text Color [" + textColors[inputTextColorInt] + "]"; + } + public static void ChangePCUI() { pcbg++; @@ -1976,6 +2051,16 @@ public static void ChangePointerPosition() try { reference.transform.localPosition = pointerOffset; } catch { } } + public static void EnableSwapGunHand() + { + SwapGunHand = true; + } + + public static void DisableSwapGunHand() + { + SwapGunHand = false; + } + public static void SmallGunPointer() { smallGunPointer = true; @@ -1986,6 +2071,16 @@ public static void BigGunPointer() smallGunPointer = false; } + public static void DoSmoothGunPointer() + { + SmoothGunPointer = true; + } + + public static void NoSmoothGunPointer() + { + SmoothGunPointer = false; + } + public static void NoGunPointer() { disableGunPointer = true; @@ -2445,7 +2540,7 @@ public static string SavePreferencesToText() } } - string ihateyouguys = platformMode + seperator + platformShape + seperator + flySpeedCycle + seperator + longarmCycle + seperator + speedboostCycle + seperator + projmode + seperator + trailmode + seperator + shootCycle + seperator + pointerIndex + seperator + tagAuraIndex + seperator + notificationDecayTime + seperator + fontStyleType + seperator + arrowType + seperator + pcbg + seperator + internetTime + seperator + hotkeyButton + seperator + buttonClickIndex + seperator + buttonClickVolume + seperator + Safety.antireportrangeindex + seperator + Advantages.tagRangeIndex + seperator + Sound.BindMode + seperator + Movement.driveInt + seperator + langInd; + string ihateyouguys = platformMode + seperator + platformShape + seperator + flySpeedCycle + seperator + longarmCycle + seperator + speedboostCycle + seperator + projmode + seperator + trailmode + seperator + shootCycle + seperator + pointerIndex + seperator + tagAuraIndex + seperator + notificationDecayTime + seperator + fontStyleType + seperator + arrowType + seperator + pcbg + seperator + internetTime + seperator + hotkeyButton + seperator + buttonClickIndex + seperator + buttonClickVolume + seperator + Safety.antireportrangeindex + seperator + Advantages.tagRangeIndex + seperator + Sound.BindMode + seperator + Movement.driveInt + seperator + langInd + seperator + inputTextColorInt + seperator + Movement.pullPowerInt; string finaltext = text + "\n" + @@ -2618,6 +2713,10 @@ public static void LoadPreferencesFromText(string text) Movement.ChangeDriveSpeed(); langInd = int.Parse(data[22]) - 1; ChangeMenuLanguage(); + inputTextColorInt = int.Parse(data[23]) - 1; + ChangeInputTextColor(); + Movement.pullPowerInt = int.Parse(data[24]) - 1; + Movement.ChangePullModPower(); } catch { UnityEngine.Debug.Log("Save file out of date"); } pageButtonType = int.Parse(textData[3]) - 1; @@ -2733,7 +2832,8 @@ public static void ChangeButtonSound() 66, 66, 66, - 106 + 106, + 189 }; string[] buttonSoundNames = new string[] { @@ -2748,7 +2848,8 @@ public static void ChangeButtonSound() "Rec Room", "Watch", "Membrane", - "Jar" + "Jar", + "Wall" }; buttonClickIndex++; diff --git a/Mods/Sound.cs b/Mods/Sound.cs index 6d65ca0..9175d53 100644 --- a/Mods/Sound.cs +++ b/Mods/Sound.cs @@ -21,6 +21,7 @@ public class Sound { public static bool LoopAudio = false; public static int BindMode = 0; + public static string Subdirectory = ""; public static void LoadSoundboard() { buttonsType = 18; @@ -29,9 +30,9 @@ public static void LoadSoundboard() { Directory.CreateDirectory("iisStupidMenu"); } - if (!Directory.Exists("iisStupidMenu/Sounds")) + if (!Directory.Exists("iisStupidMenu/Sounds" + Subdirectory)) { - Directory.CreateDirectory("iisStupidMenu/Sounds"); + Directory.CreateDirectory("iisStupidMenu/Sounds" + Subdirectory); } List enabledSounds = new List { }; foreach (ButtonInfo binfo in Buttons.buttons[18]) @@ -41,13 +42,28 @@ public static void LoadSoundboard() enabledSounds.Add(binfo.overlapText); } } - List soundbuttons = new List { new ButtonInfo { buttonText = "Exit Soundboard", method = () => Settings.EnableFun(), isTogglable = false, toolTip = "Returns you back to the fun mods." } }; + List soundbuttons = new List { }; + if (Subdirectory != "") + soundbuttons.Add(new ButtonInfo { buttonText = "Exit Parent Directory", overlapText = "Exit " + Subdirectory.Split("/")[Subdirectory.Split("/").Length - 1], method = () => Sound.ExitParentDirectory(), isTogglable = false, toolTip = "Returns you back to the last folder." }); + + soundbuttons.Add(new ButtonInfo { buttonText = "Exit Soundboard", method = () => Settings.EnableFun(), isTogglable = false, toolTip = "Returns you back to the fun mods." }); int index = 0; - string[] files = Directory.GetFiles("iisStupidMenu/Sounds"); + + string[] folders = Directory.GetDirectories("iisStupidMenu/Sounds" + Subdirectory); + foreach (string folder in folders) + { + index++; + int substringLength = ("iisStupidMenu/Sounds" + Subdirectory + "/").Length; + string FolderName = folder.Replace("\\", "/").Substring(substringLength); + soundbuttons.Add(new ButtonInfo { buttonText = "SoundboardFolder" + index.ToString(), overlapText = "▶ " + FolderName, method = () => OpenFolder(folder.Substring(21)), isTogglable = false, toolTip = "Opens the " + FolderName + " folder."}); + } + + index = 0; + string[] files = Directory.GetFiles("iisStupidMenu/Sounds" + Subdirectory); foreach (string file in files) { index++; - string FileName = file.Replace("\\", "/").Substring(21); + string FileName = file.Replace("\\", "/").Substring(21 + Subdirectory.Length); if (BindMode > 0) { string soundName = RemoveFileExtension(FileName).Replace("_", " "); @@ -75,6 +91,18 @@ public static void LoadSoundboard() Buttons.buttons[18] = soundbuttons.ToArray(); } + public static void ExitParentDirectory() + { + Subdirectory = RemoveLastDirectory(Subdirectory); + LoadSoundboard(); + } + + public static void OpenFolder(string folder) + { + Subdirectory = "/" + folder; + LoadSoundboard(); + } + public static void LoadSoundLibrary() { buttonsType = 26; @@ -97,7 +125,7 @@ public static void LoadSoundLibrary() public static void DownloadSound(string name, string url) { - string filename = "Sounds/" + name + "." + GetFileExtension(url); + string filename = "Sounds" + Subdirectory + "/" + name + "." + GetFileExtension(url); if (File.Exists("iisStupidMenu/"+filename)) { File.Delete("iisStupidMenu/" + filename); diff --git a/Mods/Visuals.cs b/Mods/Visuals.cs index 4f23529..fa163ca 100644 --- a/Mods/Visuals.cs +++ b/Mods/Visuals.cs @@ -633,6 +633,27 @@ public static void DisableRemoveLeaves() leaves.Clear(); } + public static void EnableStreamerRemoveLeaves() + { + foreach (GameObject g in Resources.FindObjectsOfTypeAll()) + { + if (g.activeSelf && (g.name.Contains("leaves_green") || g.name.Contains("fallleaves"))) + { + g.layer = 16; + leaves.Add(g); + } + } + } + + public static void DisableStreamerRemoveLeaves() + { + foreach (GameObject l in leaves) + { + l.layer = 0; + } + leaves.Clear(); + } + /* public static void EnableRemoveCherryBlossoms() { @@ -888,7 +909,7 @@ public static void CasualTracers() if (vrrig != GorillaTagger.Instance.offlineVRRig) { GameObject line = new GameObject("Line"); - if (GetIndex("Hidden on Camera").enabled) { line.layer = 19; } + //if (GetIndex("Hidden on Camera").enabled) { line.layer = 19; } LineRenderer liner = line.AddComponent(); UnityEngine.Color thecolor = vrrig.playerColor; if (GetIndex("Follow Menu Theme").enabled) { thecolor = GetBGColor(0f); } diff --git a/Notifications/Library.cs b/Notifications/Library.cs index ad95530..9124c10 100644 --- a/Notifications/Library.cs +++ b/Notifications/Library.cs @@ -118,6 +118,10 @@ private void FixedUpdate() { buttonText = TranslateText(buttonText); } + if (inputTextColor != "green") + { + buttonText = buttonText.Replace(" [", " ["); + } if (lowercaseMode) { buttonText = buttonText.ToLower(); @@ -174,6 +178,10 @@ public static void SendNotification(string NotificationText, int clearTime = -1) { NotificationText = TranslateText(NotificationText); } + if (inputTextColor != "green") + { + NotificationText = NotificationText.Replace("", ""); + } NotifiLib.NotifiText.text = NotifiLib.NotifiText.text + NotificationText; if (lowercaseMode) { diff --git a/Patches/GrabPatch.cs b/Patches/GrabPatch.cs new file mode 100644 index 0000000..7fae0a6 --- /dev/null +++ b/Patches/GrabPatch.cs @@ -0,0 +1,23 @@ +using GorillaExtensions; +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Text; + +namespace iiMenu.Patches +{ + [HarmonyPatch(typeof(VRRig), "GrabbedByPlayer")] + public class GrabPatch + { + public static bool enabled = false; + + public static bool Prefix(VRRig __instance, VRRig grabbedByRig, bool grabbedBody, bool grabbedLeftHand, bool grabbedWithLeftHand) + { + if (enabled && __instance == GorillaTagger.Instance.offlineVRRig) + { + return false; + } + return true; + } + } +} diff --git a/Patches/RequestPatch.cs b/Patches/RequestPatch.cs new file mode 100644 index 0000000..619a3c4 --- /dev/null +++ b/Patches/RequestPatch.cs @@ -0,0 +1,79 @@ +using GorillaNetworking; +using HarmonyLib; +using iiMenu.Classes; +using Photon.Pun; +using System; +using System.Collections; +using TMPro; +using UnityEngine; +using UnityEngine.ProBuilder.MeshOperations; +using static GorillaNetworking.CosmeticsController; + +namespace iiMenu.Patches +{ + [HarmonyPatch(typeof(VRRig), "RequestCosmetics")] + public class RequestPatch + { + public static bool enabled = false; + public static Coroutine currentCoroutine = null; + + public static bool Prefix(VRRig __instance, PhotonMessageInfoWrapped info) + { + if (__instance == GorillaTagger.Instance.offlineVRRig) + { + if (enabled) + { + if (CosmeticsController.hasInstance) + { + if (CosmeticsController.instance.isHidingCosmeticsFromRemotePlayers) + GorillaTagger.Instance.myVRRig.SendRPC("RPC_HideAllCosmetics", info.Sender, Array.Empty()); + else + if (currentCoroutine == null) + currentCoroutine = CoroutineManager.RunCoroutine(LoadCosmetics()); + } + return false; + } + } + return true; + } + + private static string[] archiveCosmetics = null; + public static IEnumerator LoadCosmetics() + { + if (PhotonNetwork.InRoom) + { + Vector3 target = GameObject.Find("Environment Objects/TriggerZones_Prefab/ZoneTransitions_Prefab/Cosmetics Room Triggers/TryOnRoom").transform.position - new Vector3(0f, GameObject.Find("Environment Objects/TriggerZones_Prefab/ZoneTransitions_Prefab/Cosmetics Room Triggers/TryOnRoom").transform.localScale.y / 3f, 0f); + + string[] spamarray = new string[] { "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU.", "LMAJU." }; + + GorillaTagger.Instance.offlineVRRig.enabled = false; + GorillaTagger.Instance.offlineVRRig.transform.position = target; + + archiveCosmetics = CosmeticsController.instance.currentWornSet.ToDisplayNameArray(); + CosmeticsController.instance.currentWornSet = new CosmeticsController.CosmeticSet(spamarray, CosmeticsController.instance); + + Vector3 point = GorillaTagger.Instance.bodyCollider.transform.position; + while (Vector3.Distance(point, target) > 0.2f) + { + point = Vector3.Lerp(point, target, GorillaTagger.Instance.offlineVRRig.lerpValueBody * 0.3f); + yield return null; + } + yield return new WaitForSeconds(0.1f); + + GorillaTagger.Instance.myVRRig.SendRPC("RPC_UpdateCosmeticsWithTryon", RpcTarget.Others, new object[] { spamarray, CosmeticsController.instance.currentWornSet.ToDisplayNameArray() }); + GorillaTagger.Instance.offlineVRRig.enabled = true; + yield return new WaitForSeconds(0.1f); + + CosmeticsController.instance.currentWornSet = new CosmeticsController.CosmeticSet(archiveCosmetics, CosmeticsController.instance); + GorillaTagger.Instance.offlineVRRig.LocalUpdateCosmeticsWithTryon(CosmeticsController.instance.currentWornSet, CosmeticsController.instance.tryOnSet); + + float delay = Time.time + 30f; + while (Time.time < delay || PhotonNetwork.InRoom) + { + yield return null; + } + currentCoroutine = null; + } + } + } +} diff --git a/Patches/Safety.cs b/Patches/Safety.cs index 9ccdbd5..cb298ac 100644 --- a/Patches/Safety.cs +++ b/Patches/Safety.cs @@ -1,4 +1,5 @@ -using GorillaTag; +using GorillaExtensions; +using GorillaTag; using HarmonyLib; using iiMenu.Notifications; using Photon.Pun; @@ -199,41 +200,49 @@ private static bool Prefix() } } - [HarmonyPatch(typeof(RequestableOwnershipGuard), "OwnershipRequested")] + [HarmonyPatch(typeof(VRRig), "DroppedByPlayer")] public class AntiCrashPatch { - public static bool Prefix(RequestableOwnershipGuard __instance, string nonce, PhotonMessageInfo info) + public static bool Prefix(VRRig __instance, VRRig grabbedByRig, Vector3 throwVelocity) { - if (AntiCrashToggle) + if (AntiCrashToggle && __instance == GorillaTagger.Instance.offlineVRRig && !GTExt.IsValid(throwVelocity)) { - NetPlayer player = NetworkSystem.Instance.GetPlayer(info.Sender); - if (info.Sender == PhotonNetwork.LocalPlayer) - { - return false; - } - - bool shouldrequest = true; - using (List.Enumerator enumerator = __instance.callbacksList.GetEnumerator()) - { - while (enumerator.MoveNext()) - { - if (!enumerator.Current.OnOwnershipRequest(player)) - { - shouldrequest = false; - } - } - } - if (!shouldrequest) - { - return false; - } - __instance.TransferOwnership(player, nonce); return false; } return true; } } + [HarmonyPatch(typeof(RequestableOwnershipGuard), "OwnershipRequested")] + public class AntiCrashPatch2 + { + public static bool Prefix() + { + List callTimestamps = new List(); + + DateTime now = DateTime.Now; + callTimestamps.Add(now); + callTimestamps.RemoveAll(t => (now - t).TotalSeconds > 2); + + return callTimestamps.Count > 10; + } + } + + [HarmonyPatch(typeof(RequestableOwnershipGuard), "OnMasterClientAssistedTakeoverRequest")] + public class AntiCrashPatch3 + { + public static bool Prefix() + { + List callTimestamps = new List(); + + DateTime now = DateTime.Now; + callTimestamps.Add(now); + callTimestamps.RemoveAll(t => (now - t).TotalSeconds > 2); + + return callTimestamps.Count > 10; + } + } + [HarmonyPatch(typeof(PlayFabClientAPI), "UpdateUserTitleDisplayName")] // Credits to Shiny for letting me use this public class NamePatch { diff --git a/Plugin.cs b/Plugin.cs index bd7cb2f..b182ae0 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -1,11 +1,10 @@ using BepInEx; using System; -using System.ComponentModel; using UnityEngine; namespace iiMenu { - [Description(PluginInfo.Description)] + [System.ComponentModel.Description(PluginInfo.Description)] [BepInPlugin(PluginInfo.GUID, PluginInfo.Name, PluginInfo.Version)] public class Plugin : BaseUnityPlugin { diff --git a/PluginInfo.cs b/PluginInfo.cs index 6cc65a6..f8d52c1 100644 --- a/PluginInfo.cs +++ b/PluginInfo.cs @@ -5,6 +5,6 @@ public class PluginInfo public const string GUID = "org.iidk.gorillatag.iimenu"; public const string Name = "ii's Stupid Menu"; public const string Description = "Created by @goldentrophy with love <3"; - public const string Version = "5.0.0"; + public const string Version = "5.1.0"; } }