From 9411c229cdbb2f298aaefaf10d7e62694aa388e9 Mon Sep 17 00:00:00 2001 From: iiDk <@> Date: Fri, 13 Dec 2024 17:14:42 -0500 Subject: [PATCH] 5.1.3 --- Classes/ColorChanger.cs | 68 ++++++--- Menu/Main.cs | 45 +++++- Mods/Buttons.cs | 11 +- Mods/Fun.cs | 12 ++ Mods/Important.cs | 11 +- Mods/Movement.cs | 6 +- Mods/Overpowered.cs | 21 ++- Mods/Settings.cs | 12 +- Mods/Visuals.cs | 2 +- Patches/ColorPatch.cs | 6 +- Patches/MicPatch.cs | 4 +- Patches/Safety.cs | 13 +- Patches/UnlimitPatches.cs | 280 ++++++++++++++++++++++++++++++++++++++ Plugin.cs | 2 +- PluginInfo.cs | 2 +- 15 files changed, 437 insertions(+), 58 deletions(-) create mode 100644 Patches/UnlimitPatches.cs diff --git a/Classes/ColorChanger.cs b/Classes/ColorChanger.cs index 57fef3c..72ede1c 100644 --- a/Classes/ColorChanger.cs +++ b/Classes/ColorChanger.cs @@ -1,4 +1,5 @@ -using System; +using iiMenu.Menu; +using System; using System.Collections.Generic; using System.Text; using UnityEngine; @@ -19,39 +20,62 @@ public override void Update() base.Update(); if (colors != null) { - if (!isMonkeColors) + if (!iiMenu.Menu.Main.dynamicGradients) { - if (timeBased) + if (!isMonkeColors) { - //color = colors.Evaluate(progress); - color = colors.Evaluate((Time.time / 2f) % 1); + if (timeBased) + { + //color = colors.Evaluate(progress); + color = colors.Evaluate((Time.time / 2f) % 1); + } + if (isRainbow) + { + float h = (Time.frameCount / 180f) % 1f; + color = UnityEngine.Color.HSVToRGB(h, 1f, 1f); + } + if (isPastelRainbow) + { + float h = (Time.frameCount / 180f) % 1f; + color = UnityEngine.Color.HSVToRGB(h, 0.3f, 1f); + } + if (isEpileptic) + { + color = new Color32((byte)UnityEngine.Random.Range(0, 255), (byte)UnityEngine.Random.Range(0, 255), (byte)UnityEngine.Random.Range(0, 255), 255); + } + gameObjectRenderer.material.color = color; } - if (isRainbow) + else { - float h = (Time.frameCount / 180f) % 1f; - color = UnityEngine.Color.HSVToRGB(h, 1f, 1f); - } - if (isPastelRainbow) - { - float h = (Time.frameCount / 180f) % 1f; - color = UnityEngine.Color.HSVToRGB(h, 0.3f, 1f); - } - if (isEpileptic) - { - color = new Color32((byte)UnityEngine.Random.Range(0, 255), (byte)UnityEngine.Random.Range(0, 255), (byte)UnityEngine.Random.Range(0, 255), 255); + if (!Menu.Main.PlayerIsTagged(GorillaTagger.Instance.offlineVRRig)) + { + gameObjectRenderer.material.color = GorillaTagger.Instance.offlineVRRig.mainSkin.material.color; + } + else + { + gameObjectRenderer.material.color = new Color32(255, 111, 0, 255); + } + } - gameObjectRenderer.material.color = color; } else { - if (!Menu.Main.PlayerIsTagged(GorillaTagger.Instance.offlineVRRig)) + if (colors.colorKeys[0].color == colors.colorKeys[1].color) { - gameObjectRenderer.material.color = GorillaTagger.Instance.offlineVRRig.mainSkin.material.color; + gameObjectRenderer.material.color = colors.colorKeys[0].color; } else { - gameObjectRenderer.material.color = new Color32(255, 111, 0, 255); + if (gameObjectRenderer.material.shader.name != "Universal Render Pipeline/Lit") + { + gameObjectRenderer.material = new Material(Shader.Find("Universal Render Pipeline/Lit")); + + gameObjectRenderer.material.SetFloat("_Glossiness", 0f); + gameObjectRenderer.material.SetFloat("_Metallic", 0f); + + + gameObjectRenderer.material.mainTexture = iiMenu.Menu.Main.GetGradientTexture(colors.colorKeys[0].color, colors.colorKeys[1].color); + } } - } } } diff --git a/Menu/Main.cs b/Menu/Main.cs index f51b593..ea0b565 100644 --- a/Menu/Main.cs +++ b/Menu/Main.cs @@ -238,7 +238,7 @@ public static void Prefix() if (v.name.Contains("forestatlas")) { indexOfThatThing++; - if (indexOfThatThing == 4) + if (indexOfThatThing == 2) { UnityEngine.Debug.Log("Board found"); found2 = true; @@ -1803,6 +1803,8 @@ public static void Draw() pride.wrapMode = TextureWrapMode.Clamp; } menuBackground.GetComponent().material.shader = Shader.Find("Universal Render Pipeline/Lit"); + menuBackground.GetComponent().material.SetFloat("_Glossiness", 0f); + menuBackground.GetComponent().material.SetFloat("_Metallic", 0f); menuBackground.GetComponent().material.color = Color.white; menuBackground.GetComponent().material.mainTexture = pride; UnityEngine.Debug.Log("gayed the texture"); @@ -1815,6 +1817,8 @@ public static void Draw() trans.wrapMode = TextureWrapMode.Clamp; } menuBackground.GetComponent().material.shader = Shader.Find("Universal Render Pipeline/Lit"); + menuBackground.GetComponent().material.SetFloat("_Glossiness", 0f); + menuBackground.GetComponent().material.SetFloat("_Metallic", 0f); menuBackground.GetComponent().material.color = Color.white; menuBackground.GetComponent().material.mainTexture = trans; break; @@ -1826,6 +1830,8 @@ public static void Draw() gay.wrapMode = TextureWrapMode.Clamp; } menuBackground.GetComponent().material.shader = Shader.Find("Universal Render Pipeline/Lit"); + menuBackground.GetComponent().material.SetFloat("_Glossiness", 0f); + menuBackground.GetComponent().material.SetFloat("_Metallic", 0f); menuBackground.GetComponent().material.color = Color.white; menuBackground.GetComponent().material.mainTexture = gay; break; @@ -1838,6 +1844,8 @@ public static void Draw() if (doCustomMenuBackground) { menuBackground.GetComponent().material.shader = Shader.Find("Universal Render Pipeline/Lit"); + menuBackground.GetComponent().material.SetFloat("_Glossiness", 0f); + menuBackground.GetComponent().material.SetFloat("_Metallic", 0f); menuBackground.GetComponent().material.color = Color.white; menuBackground.GetComponent().material.mainTexture = customMenuBackgroundImage; } @@ -3301,6 +3309,25 @@ public static Texture2D LoadTextureFromURL(string resourcePath, string fileName) return texture; } + private static Dictionary cacheGradients = new Dictionary { }; + public static Texture2D GetGradientTexture(Color colorA, Color colorB) + { + if (cacheGradients.ContainsKey(new Color[] { colorA, colorB })) + return cacheGradients[new Color[] { colorA, colorB }]; + + Texture2D txt2d = new Texture2D(128, 128); + for (int i = 1; i <= 128; i++) + { + for (int j = 1; j <= 128; j++) + { + Color clr = Color.Lerp(colorA, colorB, i / 128f); + txt2d.SetPixel(i, j, clr); + } + } + txt2d.Apply(); + return txt2d; + } + public static void RPCProtection() { try @@ -4001,6 +4028,21 @@ public static List InfectedList() } } } + if (gamemode.Contains("ambush") || gamemode.Contains("stealth")) + { + GorillaAmbushManager tagman = GameObject.Find("GT Systems/GameModeSystem/Gorilla Stealth Manager").GetComponent(); + if (tagman.isCurrentlyTag) + { + infected.Add(tagman.currentIt); + } + else + { + foreach (NetPlayer plr in tagman.currentInfected) + { + infected.Add(plr); + } + } + } return infected; } @@ -4924,6 +4966,7 @@ public static void OnLaunch() public static bool dynamicSounds = false; public static bool dynamicAnimations = false; + public static bool dynamicGradients = false; public static string lastClickedName = ""; public static string ascii = diff --git a/Mods/Buttons.cs b/Mods/Buttons.cs index c1a7f9b..7703cec 100644 --- a/Mods/Buttons.cs +++ b/Mods/Buttons.cs @@ -70,6 +70,7 @@ public class Buttons new ButtonInfo { buttonText = "Custom Menu Name", enableMethod =() => Settings.CustomMenuName(), disableMethod =() => Settings.NoCustomMenuName(), toolTip = "Changes the name of the menu to whatever. You can change the text inside of your Gorilla Tag files (iisStupidMenu/iiMenu_CustomMenuName.txt)."}, 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 Gradients", enableMethod =() => Settings.DynamicGradients(), disableMethod =() => Settings.NoDynamicGradients(), toolTip = "Makes gradients dynamic, showing you the full gradient instead of a pulsing color."}, 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, 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."}, @@ -805,6 +806,7 @@ public class Buttons new ButtonInfo { buttonText = "Guardian Spaz", method =() => Overpowered.GuardianSpaz(), toolTip = "Spams the guardian position for everyone in the lobby."}, + new ButtonInfo { buttonText = "Unlimited Building", enableMethod =() => Fun.UnlimitedBuilding(), disableMethod =() => Fun.DisableUnlimitedBuilding(), toolTip = "Unlimits building, disabling drop zones and letting you place on people's plots." }, 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." }, @@ -903,7 +905,7 @@ public class Buttons 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 = "Kick Gun", method =() => Overpowered.KickGun(), disableMethod =() => Overpowered.DisableKickGun(), 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."}, @@ -913,9 +915,6 @@ public class Buttons 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."}, @@ -1093,9 +1092,9 @@ public class Buttons }, new ButtonInfo[] { // Overpowered (in Settings) [31] - new ButtonInfo { buttonText = "Exit Overpowered Settings", method =() => Settings.EnableSettings(), isTogglable = false, toolTip = "Returns you back to the settings menu."} + new ButtonInfo { buttonText = "Exit Overpowered Settings", method =() => Settings.EnableSettings(), isTogglable = false, toolTip = "Returns you back to the settings menu."}, - // What a lone category + new ButtonInfo { buttonText = "Disable Kick Gun Reconnect", toolTip = "Disables automatically reconnecting to the room when the kick gun fails."}, }, }; } diff --git a/Mods/Fun.cs b/Mods/Fun.cs index 1011875..1ae5dbb 100644 --- a/Mods/Fun.cs +++ b/Mods/Fun.cs @@ -1566,6 +1566,18 @@ public static void DestroyBlocks() } } + public static void UnlimitedBuilding() + { + BuilderPieceInteractor.instance.maxHoldablePieceStackCount = int.MaxValue; + Patches.UnlimitPatches.enabled = true; + } + + public static void DisableUnlimitedBuilding() + { + BuilderPieceInteractor.instance.maxHoldablePieceStackCount = 50; + Patches.UnlimitPatches.enabled = false; + } + private static float dumbdelay = 0f; public static void DestroyBlockGun() { diff --git a/Mods/Important.cs b/Mods/Important.cs index c5f0dea..c449fd5 100644 --- a/Mods/Important.cs +++ b/Mods/Important.cs @@ -126,7 +126,7 @@ public static void JoinRandomR() public static void CreateRoom(string roomName, bool isPublic) // Once again thanks to Shiny for discovering a thing that doesn't work anymore { - PhotonNetworkController.Instance.currentJoinTrigger = GorillaComputer.instance.GetJoinTriggerForZone("forest"); + //PhotonNetworkController.Instance.currentJoinTrigger = GorillaComputer.instance.GetJoinTriggerForZone("forest"); UnityEngine.Debug.Log((string)typeof(PhotonNetworkController).GetField("platformTag", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(PhotonNetworkController.Instance)); RoomConfig roomConfig = new RoomConfig() { @@ -137,7 +137,8 @@ public static void JoinRandomR() CustomProps = new ExitGames.Client.Photon.Hashtable() { { "gameMode", PhotonNetworkController.Instance.currentJoinTrigger.GetFullDesiredGameModeString() }, - { "platform", (string)typeof(PhotonNetworkController).GetField("platformTag", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(PhotonNetworkController.Instance) } + { "platform", (string)typeof(PhotonNetworkController).GetField("platformTag", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(PhotonNetworkController.Instance) }, + { "queueName", GorillaComputer.instance.currentQueue } } }; NetworkSystem.Instance.ConnectToRoom(roomName, roomConfig); @@ -283,15 +284,15 @@ public static void CopyPlayerPosition() GUIUtility.systemCopyBuffer = text; } - + // The oldest bug in this menu: I enabled the AFK kick when turning on ANTI afk. I'm killing myself public static void EnableAntiAFK() { - PhotonNetworkController.Instance.disableAFKKick = false; + PhotonNetworkController.Instance.disableAFKKick = true; } public static void DisableAntiAFK() { - PhotonNetworkController.Instance.disableAFKKick = true; + PhotonNetworkController.Instance.disableAFKKick = false; } public static void DisableNetworkTriggers() diff --git a/Mods/Movement.cs b/Mods/Movement.cs index a2e1d66..01d07a4 100644 --- a/Mods/Movement.cs +++ b/Mods/Movement.cs @@ -1281,17 +1281,17 @@ public static void NoTagFreeze() public static void LowGravity() { - GorillaLocomotion.Player.Instance.bodyCollider.attachedRigidbody.AddForce(Vector3.up * (Time.deltaTime * (6.66f / Time.deltaTime)), ForceMode.Acceleration); + GorillaLocomotion.Player.Instance.bodyCollider.attachedRigidbody.AddForce(Vector3.up * (Time.unscaledDeltaTime * (6.66f / Time.unscaledDeltaTime)), ForceMode.Acceleration); } public static void ZeroGravity() { - GorillaLocomotion.Player.Instance.bodyCollider.attachedRigidbody.AddForce(Vector3.up * (Time.deltaTime * (9.81f / Time.deltaTime)), ForceMode.Acceleration); + GorillaLocomotion.Player.Instance.bodyCollider.attachedRigidbody.AddForce(Vector3.up * (Time.unscaledDeltaTime * (9.81f / Time.unscaledDeltaTime)), ForceMode.Acceleration); } public static void HighGravity() { - GorillaLocomotion.Player.Instance.bodyCollider.attachedRigidbody.AddForce(Vector3.down * (Time.deltaTime * (7.77f / Time.deltaTime)), ForceMode.Acceleration); + GorillaLocomotion.Player.Instance.bodyCollider.attachedRigidbody.AddForce(Vector3.down * (Time.unscaledDeltaTime * (7.77f / Time.unscaledDeltaTime)), ForceMode.Acceleration); } public static void ReverseGravity() diff --git a/Mods/Overpowered.cs b/Mods/Overpowered.cs index 9460fa5..bde77b7 100644 --- a/Mods/Overpowered.cs +++ b/Mods/Overpowered.cs @@ -9,6 +9,7 @@ using Photon.Realtime; using Photon.Voice.PUN; using System.Collections; +using System.Reflection; using UnityEngine; using UnityEngine.InputSystem; using static iiMenu.Classes.RigManager; @@ -551,6 +552,7 @@ public static void AtticCrashAll() } private static float delaything = 0f; + // Hi skids :3 // If you take this code you like giving sloppy wet kisses to cute boys >_< // I gotta stop @@ -627,6 +629,7 @@ public static void MuteAll() } // Huge thanks to kingofnetflix + private static float flushDelay = 0f; public static void LagGun() { if (GetGunInput(false)) @@ -645,6 +648,11 @@ public static void LagGun() FriendshipGroupDetection.Instance.photonView.RPC("NotifyNoPartyToMerge", NetPlayerToPlayer(GetPlayerFromVRRig(whoCopy)), new object[] { null }); } } + if (Time.time > flushDelay) + { + flushDelay = Time.time + 0.5f; + RPCProtection(); + } } if (GetGunInput(true)) { @@ -680,6 +688,11 @@ public static void LagAll() FriendshipGroupDetection.Instance.photonView.RPC("NotifyNoPartyToMerge", RpcTarget.Others, new object[] { null }); } } + if (Time.time > flushDelay) + { + flushDelay = Time.time + 0.5f; + RPCProtection(); + } } } @@ -734,8 +747,11 @@ public static void KickGun() 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 (!GetIndex("Disable Kick Gun Reconnect").enabled) + { + NotifiLib.SendNotification("[ERROR] You have been kicked for sending too many RPCs, you will reconnect shortly."); + rejRoom = ihavediahrrea; + } try { CoroutineManager.EndCoroutine(KVCoroutine); } catch { } } if (GetPlayerFromVRRig(whoCopy) == null) @@ -744,7 +760,6 @@ public static void KickGun() whoCopy = null; SetTick(1000f); NotifiLib.SendNotification("[SUCCESS] Player has been kicked!"); - rejRoom = ihavediahrrea; try { CoroutineManager.EndCoroutine(KVCoroutine); } catch { } } } diff --git a/Mods/Settings.cs b/Mods/Settings.cs index 7721c93..ff199b7 100644 --- a/Mods/Settings.cs +++ b/Mods/Settings.cs @@ -2356,13 +2356,23 @@ public static void NoDynamicAnimations() dynamicAnimations = false; } + public static void DynamicGradients() + { + dynamicGradients = true; + } + + public static void NoDynamicGradients() + { + dynamicGradients = false; + } + // Thanks to https://github.com/kingofnetflix/BAnANA for inspiration and support with voice recognition // No, it's not skidded, read the debunk: https://pastebin.com/raw/dj55QNyC private static KeywordRecognizer mainPhrases; private static KeywordRecognizer modPhrases; public static void VoiceRecognitionOn() { - mainPhrases = new KeywordRecognizer(new string[] { "jarvis", "ii", "i i", "eye eye", "siri", "google", "alexa", "dummy", "computer", "stinky", "silly", "stupid", "console" }); + mainPhrases = new KeywordRecognizer(new string[] { "jarvis", "ii", "i i", "eye eye", "siri", "google", "alexa", "dummy", "computer", "stinky", "silly", "stupid", "console", "go go gadget" }); mainPhrases.OnPhraseRecognized += ModRecognition; mainPhrases.Start(); } diff --git a/Mods/Visuals.cs b/Mods/Visuals.cs index fa163ca..fffc5b7 100644 --- a/Mods/Visuals.cs +++ b/Mods/Visuals.cs @@ -909,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/Patches/ColorPatch.cs b/Patches/ColorPatch.cs index f0f1514..baeefa2 100644 --- a/Patches/ColorPatch.cs +++ b/Patches/ColorPatch.cs @@ -15,11 +15,7 @@ public static bool Prefix(VRRig __instance, int askingPlayerID, PhotonMessageInf { if (nameSpoofEnabled) { - try - { - iiMenu.Mods.Safety.SpoofName(); - } - catch { } + return false; } if (patchEnabled) { diff --git a/Patches/MicPatch.cs b/Patches/MicPatch.cs index 0540d9c..a5d9117 100644 --- a/Patches/MicPatch.cs +++ b/Patches/MicPatch.cs @@ -4,12 +4,12 @@ namespace iiMenu.Patches { - [HarmonyPatch(typeof(GorillaSpeakerLoudness), "InvokeUpdate")] + [HarmonyPatch(typeof(GorillaSpeakerLoudness), "UpdateLoudness")] public class MicPatch { public static bool returnAsNone = false; - private static bool Prefix(GorillaSpeakerLoudness __instance, bool ___isMicEnabled, bool ___isSpeaking, float ___loudness) + private static bool Prefix(GorillaSpeakerLoudness __instance, ref bool ___isMicEnabled, ref bool ___isSpeaking, ref float ___loudness) { if (returnAsNone && __instance.gameObject.name == "Local Gorilla Player") { diff --git a/Patches/Safety.cs b/Patches/Safety.cs index ead55d2..6872ed7 100644 --- a/Patches/Safety.cs +++ b/Patches/Safety.cs @@ -216,16 +216,15 @@ public static bool Prefix(VRRig __instance, VRRig grabbedByRig, Vector3 throwVel [HarmonyPatch(typeof(RequestableOwnershipGuard), "OwnershipRequested")] public class AntiCrashPatch2 { - private static List callTimestamps = new List(); + private static List callTimestamps = new List(); public static bool Prefix() { if (AntiCrashToggle) { - DateTime now = DateTime.Now; - callTimestamps.Add(now); - callTimestamps.RemoveAll(t => (now - t).TotalSeconds > 1); + callTimestamps.Add(Time.time); + callTimestamps.RemoveAll(t => (Time.time - t) > 1); - return callTimestamps.Count > 15; + return callTimestamps.Count < 15; } return true; } @@ -242,7 +241,7 @@ public static bool Prefix(VRRig __instance) callTimestamps.Add(Time.time); callTimestamps.RemoveAll(t => (Time.time - t) > 1); - return callTimestamps.Count > 15; + return callTimestamps.Count < 15; } return true; } @@ -259,7 +258,7 @@ public static bool Prefix(VRRig __instance) callTimestamps.Add(Time.time); callTimestamps.RemoveAll(t => (Time.time - t) > 1); - return callTimestamps.Count > 15; + return callTimestamps.Count < 15; } return true; } diff --git a/Patches/UnlimitPatches.cs b/Patches/UnlimitPatches.cs new file mode 100644 index 0000000..afeaeb0 --- /dev/null +++ b/Patches/UnlimitPatches.cs @@ -0,0 +1,280 @@ +using GorillaExtensions; +using GorillaTagScripts; +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Text; + +namespace iiMenu.Patches +{ + public class UnlimitPatches + { + public static bool enabled = false; + + [HarmonyPatch(typeof(BuilderPiece), "CanPlayerGrabPiece")] + public class UnlimitPatch1 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderPiece), "CanPlayerAttachPieceToPiece")] + public class UnlimitPatch2 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderPiecePrivatePlot), "CanPlayerAttachToPlot")] + public class UnlimitPatch3 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderPiecePrivatePlot), "CanPlayerAttachToPlot")] + public class UnlimitPatch4 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderPiecePrivatePlot), "CanPlayerGrabFromPlot")] + public class UnlimitPatch5 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidateAttachPieceParams")] + public class UnlimitPatch6 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidateCreatePieceParams")] + public class UnlimitPatch7 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidateDropPieceParams")] + public class UnlimitPatch8 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidateDropPieceState")] + public class UnlimitPatch9 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidateFunctionalPieceState")] + public class UnlimitPatch10 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidateGrabPieceParams")] + public class UnlimitPatch11 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidateGrabPieceState")] + public class UnlimitPatch12 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidateGrabPieceState")] + public class UnlimitPatch13 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidatePieceWorldTransform")] + public class UnlimitPatch14 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidatePieceWorldTransform")] + public class UnlimitPatch15 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidatePlacePieceParams")] + public class UnlimitPatch16 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidatePlacePieceState")] + public class UnlimitPatch17 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = true; + return false; + } + return true; + } + } + + [HarmonyPatch(typeof(BuilderTable), "ValidateRepelPiece")] + public class UnlimitPatch18 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = false; + return false; + } + return true; + } + } + /* + [HarmonyPatch(typeof(BuilderTable), "HasEnoughResources")] + public class UnlimitPatch19 + { + public static bool Prefix(ref bool __result) + { + if (enabled) + { + __result = false; + return false; + } + return true; + } + }*/ + } +} diff --git a/Plugin.cs b/Plugin.cs index b182ae0..c99f02f 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -13,7 +13,7 @@ private void Start() // To that one dude that uses SMI to inject my menu, it's t Console.Title = "ii's Stupid Menu // Build " + PluginInfo.Version; iiMenu.Patches.Menu.ApplyHarmonyPatches(); - GameObject Loading = new GameObject(); + GameObject Loading = new GameObject("ii"); Loading.AddComponent(); Loading.AddComponent(); Loading.AddComponent(); diff --git a/PluginInfo.cs b/PluginInfo.cs index 4276340..0f66a7d 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.1.2"; + public const string Version = "5.1.3"; } }