Skip to content

Commit

Permalink
4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
iiDk committed Sep 7, 2024
1 parent 50c6022 commit d340dba
Show file tree
Hide file tree
Showing 34 changed files with 1,263 additions and 1,092 deletions.
6 changes: 6 additions & 0 deletions Classes/ColorChanger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public override void Update()
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);
Expand All @@ -56,6 +61,7 @@ public override void Update()
public Color32 color;
public bool timeBased = true;
public bool isRainbow = false;
public bool isPastelRainbow = false;
public bool isEpileptic = false;
public bool isMonkeColors = false;
}
Expand Down
8 changes: 4 additions & 4 deletions Classes/RigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace iiMenu.Classes
{
internal class RigManager
{
public static VRRig GetVRRigFromPlayer(Player p)
public static VRRig GetVRRigFromPlayer(NetPlayer p)
{
return GorillaGameManager.instance.FindPlayerVRRig(p);
}
Expand Down Expand Up @@ -58,15 +58,15 @@ public static Photon.Realtime.Player GetRandomPlayer(bool includeSelf)
}
}

public static Photon.Realtime.Player GetPlayerFromVRRig(VRRig p)
public static NetPlayer GetPlayerFromVRRig(VRRig p)
{
//return GetPhotonViewFromVRRig(p).Owner;
return p.Creator;
}

public static Photon.Realtime.Player GetPlayerFromID(string id)
public static NetPlayer GetPlayerFromID(string id)
{
Photon.Realtime.Player found = null;
NetPlayer found = null;
foreach (Photon.Realtime.Player target in PhotonNetwork.PlayerList)
{
if (target.UserId == id)
Expand Down
391 changes: 274 additions & 117 deletions Menu/Main.cs

Large diffs are not rendered by default.

37 changes: 12 additions & 25 deletions Menu/UI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ private void OnGUI()
GUI.skin.button.fontStyle = activeFontStyle;
GUI.skin.label.fontStyle = activeFontStyle;

GUI.color = GetBGColor(0f);
GUI.backgroundColor = GetBGColor(0f);
Color victimColor = GetIndex("Swap GUI Colors").enabled ? GetBDColor(0f) : GetBGColor(0f);

GUI.color = victimColor;
GUI.backgroundColor = victimColor;

string roomText = "Not connected to room";
try
Expand All @@ -81,7 +83,7 @@ private void OnGUI()
{
roomText = "Connected to room "+PhotonNetwork.CurrentRoom.Name;
}
} catch { } // shitty ass code
} catch { }
GUI.Label(new Rect(10, Screen.height - 35, Screen.width, 40), roomText);

try
Expand All @@ -92,24 +94,7 @@ private void OnGUI()
}
}
catch { }
/* pointless unoptimized shitstack
try
{
if (icon != null)
{
Color[] pixels = icon.GetPixels();
for (int i = 0; i < pixels.Length; i++)
{
float alpha = pixels[i].a;
Color bgc = GetBGColor(0f);
pixels[i] = new Color(bgc.r, bgc.g, bgc.b, alpha);
}

icon.SetPixels(pixels);
icon.Apply();
}
} catch { }
*/
try
{
if (icon != null)
Expand All @@ -131,7 +116,6 @@ private void OnGUI()
GUI.Box(new Rect(Screen.width - 250, 10, 240, 120), "", GUI.skin.box);

inputText = GUI.TextField(new Rect(Screen.width - 200, 20, 180, 20), inputText);
// inputText = inputText.ToUpper(); i dont need this

r = GUI.TextField(new Rect(Screen.width - 240, 20, 30, 20), r);

Expand Down Expand Up @@ -175,7 +159,6 @@ private void OnGUI()
} else
{
string toJoin = inputText.Replace("\\n", "\n");
iiMenu.Mods.Important.CreateRoom(toJoin, true);
PhotonNetworkController.Instance.AttemptToJoinSpecificRoom(toJoin, JoinType.Solo);
}

Expand All @@ -184,12 +167,11 @@ private void OnGUI()
{
PhotonNetwork.Disconnect();
rejRoom = inputText;
//rejDebounce = Time.time + 0.25f;
}

try
{
GUI.color = GetBGColor(0f);
GUI.color = victimColor;
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
GUILayout.Space(5f);
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
Expand All @@ -205,7 +187,12 @@ private void OnGUI()
{
if (v.enabled)
{
alphabetized.Add((v.overlapText == null) ? v.buttonText : v.overlapText);
string toadd = (v.overlapText == null) ? v.buttonText : v.overlapText;
if (lowercaseMode)
{
toadd = toadd.ToLower();
}
alphabetized.Add(toadd);
}
} catch { }
}
Expand Down
82 changes: 57 additions & 25 deletions Mods/Advantages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ public static void UntagAll()
{
if (!PhotonNetwork.IsMasterClient)
{
if (!GetIndex("Disable Auto Anti Ban").enabled)
{
Overpowered.FastMaster();
}
NotifiLib.SendNotification("<color=grey>[</color><color=red>ERROR</color><color=grey>]</color> <color=white>You are not master client.</color>");
}
else
{
Expand All @@ -126,10 +123,7 @@ public static void SpamTagSelf()
{
if (!PhotonNetwork.IsMasterClient)
{
if (!GetIndex("Disable Auto Anti Ban").enabled)
{
Overpowered.FastMaster();
}
NotifiLib.SendNotification("<color=grey>[</color><color=red>ERROR</color><color=grey>]</color> <color=white>You are not master client.</color>");
}
else
{
Expand Down Expand Up @@ -159,10 +153,7 @@ public static void SpamTagGun()
{
if (!PhotonNetwork.IsMasterClient)
{
if (!GetIndex("Disable Auto Anti Ban").enabled)
{
Overpowered.FastMaster();
}
NotifiLib.SendNotification("<color=grey>[</color><color=red>ERROR</color><color=grey>]</color> <color=white>You are not master client.</color>");
}
else
{
Expand Down Expand Up @@ -207,10 +198,7 @@ public static void SpamTagAll()
{
if (!PhotonNetwork.IsMasterClient)
{
if (!GetIndex("Disable Auto Anti Ban").enabled)
{
Overpowered.FastMaster();
}
NotifiLib.SendNotification("<color=grey>[</color><color=red>ERROR</color><color=grey>]</color> <color=white>You are not master client.</color>");
}
else
{
Expand All @@ -235,10 +223,7 @@ public static void TagLag()
{
if (!PhotonNetwork.IsMasterClient)
{
if (!GetIndex("Disable Auto Anti Ban").enabled)
{
Overpowered.FastMaster();
}
NotifiLib.SendNotification("<color=grey>[</color><color=red>ERROR</color><color=grey>]</color> <color=white>You are not master client.</color>");
}
else
{
Expand Down Expand Up @@ -295,6 +280,34 @@ public static void ChangeTagAuraRange()
GetIndex("ctaRange").overlapText = "Change Tag Aura Distance <color=grey>[</color><color=green>"+names[tagAuraIndex]+"</color><color=grey>]</color>";
}

public static int tagRangeIndex = 0;
private static float tagReachDistance = 0.3f;
public static void ChangeTagReachDistance()
{
tagRangeIndex++;
if (tagRangeIndex > 3)
{
tagRangeIndex = 0;
}
string[] names = new string[]
{
"Unnoticable",
"Normal",
"Far",
"Maximum"
};
float[] distances = new float[]
{
0.3f,
0.5f,
1f,
3f
};

tagReachDistance = distances[tagRangeIndex];
GetIndex("ctrRange").overlapText = "Change Tag Reach Distance <color=grey>[</color><color=green>" + names[tagRangeIndex] + "</color><color=grey>]</color>";
}

public static void PhysicalTagAura()
{
foreach (VRRig vrrig in GorillaParent.instance.vrrigs)
Expand Down Expand Up @@ -354,6 +367,28 @@ public static void JoystickTagAura()
}
}

public static void TagReach()
{
if (PlayerIsTagged(GorillaTagger.Instance.offlineVRRig))
{
Patches.SphereCastPatch.patchEnabled = true;
Patches.SphereCastPatch.overrideRadius = tagReachDistance;
if (GetIndex("Visualize Tag Reach").enabled)
{
VisualizeAura(GorillaTagger.Instance.leftHandTransform.position, tagReachDistance, GetBGColor(0f));
VisualizeAura(GorillaTagger.Instance.rightHandTransform.position, tagReachDistance, GetBGColor(0f));
}
} else
{
Patches.SphereCastPatch.patchEnabled = false;
}
}

public static void DisableTagReach()
{
Patches.SphereCastPatch.patchEnabled = false;
}

/*public static void RPCTagAura()
{
if (PlayerIsTagged(GorillaTagger.Instance.offlineVRRig))
Expand Down Expand Up @@ -508,10 +543,7 @@ public static void UntagGun()
RemoveInfected(RigManager.GetPlayerFromVRRig(possibly));
} else
{
if (!GetIndex("Disable Auto Anti Ban").enabled)
{
Overpowered.FastMaster();
}
NotifiLib.SendNotification("<color=grey>[</color><color=red>ERROR</color><color=grey>]</color> <color=white>You are not master client.</color>");
}
}
}
Expand Down Expand Up @@ -626,7 +658,7 @@ public static void TagAll()
public static void HuntTagAll()
{
GorillaHuntManager sillyComputer = GorillaGameManager.instance.gameObject.GetComponent<GorillaHuntManager>();
Photon.Realtime.Player target = sillyComputer.GetTargetOf(PhotonNetwork.LocalPlayer);
NetPlayer target = sillyComputer.GetTargetOf(PhotonNetwork.LocalPlayer);
if (!GorillaLocomotion.Player.Instance.disableMovement)
{
VRRig vrrig = RigManager.GetVRRigFromPlayer(target);
Expand Down
Loading

0 comments on commit d340dba

Please sign in to comment.