Skip to content

Commit

Permalink
5.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
iiDk committed Dec 13, 2024
1 parent 54ec688 commit 9411c22
Show file tree
Hide file tree
Showing 15 changed files with 437 additions and 58 deletions.
68 changes: 46 additions & 22 deletions Classes/ColorChanger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using iiMenu.Menu;
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
Expand All @@ -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);
}
}

}
}
}
Expand Down
45 changes: 44 additions & 1 deletion Menu/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1803,6 +1803,8 @@ public static void Draw()
pride.wrapMode = TextureWrapMode.Clamp;
}
menuBackground.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
menuBackground.GetComponent<Renderer>().material.SetFloat("_Glossiness", 0f);
menuBackground.GetComponent<Renderer>().material.SetFloat("_Metallic", 0f);
menuBackground.GetComponent<Renderer>().material.color = Color.white;
menuBackground.GetComponent<Renderer>().material.mainTexture = pride;
UnityEngine.Debug.Log("gayed the texture");
Expand All @@ -1815,6 +1817,8 @@ public static void Draw()
trans.wrapMode = TextureWrapMode.Clamp;
}
menuBackground.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
menuBackground.GetComponent<Renderer>().material.SetFloat("_Glossiness", 0f);
menuBackground.GetComponent<Renderer>().material.SetFloat("_Metallic", 0f);
menuBackground.GetComponent<Renderer>().material.color = Color.white;
menuBackground.GetComponent<Renderer>().material.mainTexture = trans;
break;
Expand All @@ -1826,6 +1830,8 @@ public static void Draw()
gay.wrapMode = TextureWrapMode.Clamp;
}
menuBackground.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
menuBackground.GetComponent<Renderer>().material.SetFloat("_Glossiness", 0f);
menuBackground.GetComponent<Renderer>().material.SetFloat("_Metallic", 0f);
menuBackground.GetComponent<Renderer>().material.color = Color.white;
menuBackground.GetComponent<Renderer>().material.mainTexture = gay;
break;
Expand All @@ -1838,6 +1844,8 @@ public static void Draw()
if (doCustomMenuBackground)
{
menuBackground.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
menuBackground.GetComponent<Renderer>().material.SetFloat("_Glossiness", 0f);
menuBackground.GetComponent<Renderer>().material.SetFloat("_Metallic", 0f);
menuBackground.GetComponent<Renderer>().material.color = Color.white;
menuBackground.GetComponent<Renderer>().material.mainTexture = customMenuBackgroundImage;
}
Expand Down Expand Up @@ -3301,6 +3309,25 @@ public static Texture2D LoadTextureFromURL(string resourcePath, string fileName)
return texture;
}

private static Dictionary<Color[], Texture2D> cacheGradients = new Dictionary<Color[], Texture2D> { };
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
Expand Down Expand Up @@ -4001,6 +4028,21 @@ public static List<NetPlayer> InfectedList()
}
}
}
if (gamemode.Contains("ambush") || gamemode.Contains("stealth"))
{
GorillaAmbushManager tagman = GameObject.Find("GT Systems/GameModeSystem/Gorilla Stealth Manager").GetComponent<GorillaAmbushManager>();
if (tagman.isCurrentlyTag)
{
infected.Add(tagman.currentIt);
}
else
{
foreach (NetPlayer plr in tagman.currentInfected)
{
infected.Add(plr);
}
}
}
return infected;
}

Expand Down Expand Up @@ -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 =
Expand Down
11 changes: 5 additions & 6 deletions Mods/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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."},
Expand Down Expand Up @@ -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." },

Expand Down Expand Up @@ -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 <color=grey>[</color><color=green>T</color><color=grey>]</color>", method =() => Overpowered.LagAll(), toolTip = "Lags everybody in the lobby when holding <color=green>trigger</color>."},

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 <color=grey>[</color><color=green>T</color><color=grey>]</color>", method =() => Overpowered.VirtualStumpKickAll(), toolTip = "Kicks everybody in the custom map when holding <color=green>trigger</color>."},
Expand All @@ -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 <color=grey>[</color><color=green>T</color><color=grey>]</color>", 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 <color=grey>[</color><color=green>T</color><color=grey>]</color>", 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."},

Expand Down Expand Up @@ -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."},
},
};
}
Expand Down
12 changes: 12 additions & 0 deletions Mods/Fun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
11 changes: 6 additions & 5 deletions Mods/Important.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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);
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions Mods/Movement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading

0 comments on commit 9411c22

Please sign in to comment.