Skip to content

Commit

Permalink
V1.2.0 Model Update
Browse files Browse the repository at this point in the history
Changed the 3D model for Grongle to the original Grongle model by staircase
  • Loading branch information
NotMageLock committed May 23, 2024
1 parent b1fb8ff commit 54b2654
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 7 deletions.
2 changes: 1 addition & 1 deletion GravGrongle/ButtonOTL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class ButtonOTL : MonoBehaviour
public Vector3 pos;

public static ButtonOTL Instance;
public void Start()
public void Start() //Initial position for the button
{
Vector3 newPosition = new Vector3(-65.3796f, 11.9504f, -81.414f);
transform.position = newPosition;
Expand Down
4 changes: 0 additions & 4 deletions GravGrongle/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

namespace GravGrongle
{
/// <summary>
/// This class handles applying harmony patches to the game.
/// You should not need to modify this class.
/// </summary>
public class HarmonyPatches
{
private static Harmony instance;
Expand Down
87 changes: 87 additions & 0 deletions GravGrongle/Networking.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using ExitGames.Client.Photon;
using Photon.Pun;
using Photon.Realtime;
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;

namespace GravGrongle
{
internal class Networking : MonoBehaviourPunCallbacks //Huge thanks to HuskyGT for networking the mod
{
internal const byte grabCode = 87;
internal const byte releaseCode = 88;
internal const byte teleportCode = 89;
void Awake()
{
PhotonNetwork.NetworkingClient.EventReceived += OnEvent;
}

private void OnEvent(EventData data)
{
switch(data.Code)
{
case grabCode:
break;
case releaseCode:
break;
case teleportCode:
break;
default:
break;
}
}

internal static void SendGrabEvent(bool IsLeftHand)
{
var Actors = GetModUsersActors();
SendRaiseEvent(grabCode, IsLeftHand, Actors);
}
internal static int[] GetModUsersActors()
{
List<int> actors = new List<int>();
foreach (var player in PhotonNetwork.PlayerListOthers)
{
if (player.CustomProperties.ContainsKey("GravGrongle") && player.CustomProperties["GravGrongle"].ToString() == PluginInfo.Version)
{
actors.Add(player.ActorNumber);
}
}
return actors.ToArray();
}
internal static void SendRaiseEvent(byte code, object contents)
{
if (!PhotonNetwork.InRoom)
return;

var raiseEventOptions = new RaiseEventOptions()
{
Receivers = ReceiverGroup.All
};
PhotonNetwork.RaiseEvent(code, contents, raiseEventOptions, SendOptions.SendReliable);
}
internal static void SendRaiseEvent(byte code, object contents, params int[] targetActors)
{
if (!PhotonNetwork.InRoom)
return;

var raiseEventOptions = new RaiseEventOptions()
{
TargetActors = targetActors
};
PhotonNetwork.RaiseEvent(code, contents, raiseEventOptions, SendOptions.SendReliable);
}
internal static void SendRaiseEvent(byte code, object contents, ReceiverGroup receivers)
{
if (!PhotonNetwork.InRoom)
return;

var raiseEventOptions = new RaiseEventOptions()
{
Receivers = receivers
};
PhotonNetwork.RaiseEvent(code, contents, raiseEventOptions, SendOptions.SendReliable);
}
}
}
2 changes: 1 addition & 1 deletion GravGrongle/OTL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class OTL : MonoBehaviour
public Vector3 pos;

public static OTL Instance;
public void Start()
public void Start() //Initial position for Grongle
{
Vector3 newPosition = new Vector3(-65.3796f, 11.814f, -81.414f);
transform.position = newPosition;
Expand Down
1 change: 1 addition & 0 deletions GravGrongle/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void OnEnable()
void OnDisable()
{
HarmonyPatches.RemoveHarmonyPatches();
Debug.Log("I don't think that'll do anything (GRONGLE 4EVER!");
}

public static GameObject gronglePrefab;
Expand Down
2 changes: 1 addition & 1 deletion GravGrongle/PluginInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class PluginInfo
{
public const string GUID = "com.magelock.gorillatag.gravgrongle";
public const string Name = "GravGrongle";
public const string Version = "1.1.0";
public const string Version = "1.0.0";
}
}
Binary file modified GravGrongle/Resources/gronglebundle
Binary file not shown.

0 comments on commit 54b2654

Please sign in to comment.