SRMP-Public/SRMP/Patches/Patch_BaseUI.cs

26 lines
652 B
C#
Raw Permalink Normal View History

2023-05-29 22:23:11 +02:00
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SRMultiplayer.Packets;
namespace SRMultiplayer.Patches
{
[HarmonyPatch(typeof(BaseUI))]
[HarmonyPatch("Play")]
class BaseUI_Play
{
static void Postfix(BaseUI __instance, SECTR_AudioCue cue)
{
if (!Globals.IsMultiplayer || Globals.HandlePacket) return;
new PacketPlayAudio()
{
CueName = cue.name,
Position = SRSingleton<SceneContext>.Instance.Player.transform.position,
Loop = false
}.Send();
}
}
}