Skip to content

Commit aa584e2

Browse files
author
iiDk
committed
5.1.0
1 parent f5e7a42 commit aa584e2

21 files changed

+1495
-618
lines changed

Classes/RigManager.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using BepInEx;
2-
using HarmonyLib;
1+
using HarmonyLib;
32
using Photon.Pun;
43
using Photon.Realtime;
54
using UnityEngine;
@@ -44,7 +43,7 @@ public static VRRig GetClosestVRRig()
4443

4544
public static PhotonView GetPhotonViewFromVRRig(VRRig p)
4645
{
47-
return (PhotonView)Traverse.Create(p).Field("photonView").GetValue();
46+
return GetNetworkViewFromVRRig(p).GetView;
4847
}
4948

5049
public static NetworkView GetNetworkViewFromVRRig(VRRig p)

Menu/Main.cs

Lines changed: 128 additions & 34 deletions
Large diffs are not rendered by default.

Menu/UI.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ private void OnGUI()
213213
{
214214
toadd = TranslateText(toadd);
215215
}
216+
if (inputTextColor != "green")
217+
{
218+
toadd = toadd.Replace(" <color=grey>[</color><color=green>", " <color=grey>[</color><color=" + inputTextColor + ">");
219+
}
216220
if (lowercaseMode)
217221
{
218222
toadd = toadd.ToLower();

Mods/Advantages.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public static void SpamTagSelf()
143143

144144
public static void SpamTagGun()
145145
{
146-
if (rightGrab || Mouse.current.rightButton.isPressed)
146+
if (GetGunInput(false))
147147
{
148148
var GunData = RenderGun();
149149
RaycastHit Ray = GunData.Ray;
@@ -171,7 +171,7 @@ public static void SpamTagGun()
171171
}
172172
}
173173
}
174-
if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed)
174+
if (GetGunInput(true))
175175
{
176176
VRRig possibly = Ray.collider.GetComponentInParent<VRRig>();
177177
if (possibly && possibly != GorillaTagger.Instance.offlineVRRig && !PlayerIsTagged(possibly))
@@ -419,7 +419,7 @@ public static void DisableTagReach()
419419

420420
public static void TagGun()
421421
{
422-
if (rightGrab || Mouse.current.rightButton.isPressed)
422+
if (GetGunInput(false))
423423
{
424424
var GunData = RenderGun();
425425
RaycastHit Ray = GunData.Ray;
@@ -495,7 +495,7 @@ public static void TagGun()
495495
GorillaTagger.Instance.offlineVRRig.enabled = true;
496496
}
497497
}
498-
if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed)
498+
if (GetGunInput(true))
499499
{
500500
VRRig possibly = Ray.collider.GetComponentInParent<VRRig>();
501501
if (possibly && possibly != GorillaTagger.Instance.offlineVRRig && !PlayerIsTagged(possibly))
@@ -527,13 +527,13 @@ public static void TagGun()
527527

528528
public static void UntagGun()
529529
{
530-
if (rightGrab || Mouse.current.rightButton.isPressed)
530+
if (GetGunInput(false))
531531
{
532532
var GunData = RenderGun();
533533
RaycastHit Ray = GunData.Ray;
534534
GameObject NewPointer = GunData.NewPointer;
535535

536-
if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed)
536+
if (GetGunInput(true))
537537
{
538538
VRRig possibly = Ray.collider.GetComponentInParent<VRRig>();
539539
if (possibly && possibly != GorillaTagger.Instance.offlineVRRig && PlayerIsTagged(possibly))
@@ -552,13 +552,13 @@ public static void UntagGun()
552552

553553
public static void FlickTagGun()
554554
{
555-
if (rightGrab || Mouse.current.rightButton.isPressed)
555+
if (GetGunInput(false))
556556
{
557557
var GunData = RenderGun();
558558
RaycastHit Ray = GunData.Ray;
559559
GameObject NewPointer = GunData.NewPointer;
560560

561-
if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed)
561+
if (GetGunInput(true))
562562
{
563563
GorillaLocomotion.Player.Instance.rightControllerTransform.position = Ray.point + new Vector3(0f, 0.3f, 0f);
564564
}
@@ -864,13 +864,13 @@ public static void BattleBalloonSpam()
864864

865865
public static void BattleKillGun()
866866
{
867-
if (rightGrab || Mouse.current.rightButton.isPressed)
867+
if (GetGunInput(false))
868868
{
869869
var GunData = RenderGun();
870870
RaycastHit Ray = GunData.Ray;
871871
GameObject NewPointer = GunData.NewPointer;
872872

873-
if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed)
873+
if (GetGunInput(true))
874874
{
875875
VRRig possibly = Ray.collider.GetComponentInParent<VRRig>();
876876
if (possibly && possibly != GorillaTagger.Instance.offlineVRRig)
@@ -921,13 +921,13 @@ public static void BattleKillAll()
921921

922922
public static void BattleReviveGun()
923923
{
924-
if (rightGrab || Mouse.current.rightButton.isPressed)
924+
if (GetGunInput(false))
925925
{
926926
var GunData = RenderGun();
927927
RaycastHit Ray = GunData.Ray;
928928
GameObject NewPointer = GunData.NewPointer;
929929

930-
if (rightTrigger > 0.5f || Mouse.current.leftButton.isPressed)
930+
if (GetGunInput(true))
931931
{
932932
VRRig possibly = Ray.collider.GetComponentInParent<VRRig>();
933933
if (possibly && possibly != GorillaTagger.Instance.offlineVRRig)

0 commit comments

Comments
 (0)