Skip to content

Commit

Permalink
5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
iiDk committed Dec 2, 2024
1 parent f5e7a42 commit aa584e2
Show file tree
Hide file tree
Showing 21 changed files with 1,495 additions and 618 deletions.
5 changes: 2 additions & 3 deletions Classes/RigManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BepInEx;
using HarmonyLib;
using HarmonyLib;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
Expand Down Expand Up @@ -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)
Expand Down
162 changes: 128 additions & 34 deletions Menu/Main.cs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Menu/UI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ private void OnGUI()
{
toadd = TranslateText(toadd);
}
if (inputTextColor != "green")
{
toadd = toadd.Replace(" <color=grey>[</color><color=green>", " <color=grey>[</color><color=" + inputTextColor + ">");
}
if (lowercaseMode)
{
toadd = toadd.ToLower();
Expand Down
24 changes: 12 additions & 12 deletions Mods/Advantages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -171,7 +171,7 @@ public static void SpamTagGun()
}
}
}
if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed)
if (GetGunInput(true))
{
VRRig possibly = Ray.collider.GetComponentInParent<VRRig>();
if (possibly && possibly != GorillaTagger.Instance.offlineVRRig && !PlayerIsTagged(possibly))
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<VRRig>();
if (possibly && possibly != GorillaTagger.Instance.offlineVRRig && !PlayerIsTagged(possibly))
Expand Down Expand Up @@ -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<VRRig>();
if (possibly && possibly != GorillaTagger.Instance.offlineVRRig && PlayerIsTagged(possibly))
Expand All @@ -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);
}
Expand Down Expand Up @@ -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<VRRig>();
if (possibly && possibly != GorillaTagger.Instance.offlineVRRig)
Expand Down Expand Up @@ -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<VRRig>();
if (possibly && possibly != GorillaTagger.Instance.offlineVRRig)
Expand Down
Loading

0 comments on commit aa584e2

Please sign in to comment.