SRMP-Public/SRMP/Patches/Patch_BaseUI.cs
2023-05-29 22:23:11 +02:00

26 lines
No EOL
652 B
C#

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();
}
}
}