Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
ScpVoiceChat Feature
Browse files Browse the repository at this point in the history
  • Loading branch information
xNexusACS authored Oct 30, 2022
1 parent fb5d961 commit e6def1e
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 32 deletions.
7 changes: 0 additions & 7 deletions ExiledUtils_REMAKE/EventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ public void OnAddingTarget(AddingTargetEventArgs ev)
ev.Scp096.ShowHint(plugin.Config.AddingTarget096Hint, plugin.Config.AddingTargetHintDuration);
ev.Target.ShowHint(plugin.Config.AddingTargetHint, plugin.Config.AddingTargetHintDuration);
}
public void OnEnteringEnvironmentalHazard(EnteringEnvironmentalHazardEventArgs ev)
{
if (ev.EnvironmentalHazard is TantrumEnvironmentalHazard hazard)
{
hazard.SCPImmune = MainClass.hub.Config.SCPInmuneToTantrum;
}
}
public void OnFlippingCoin(FlippingCoinEventArgs ev)
{
if (plugin.Config.EnableCoinFeatures)
Expand Down
48 changes: 28 additions & 20 deletions ExiledUtils_REMAKE/ExiledUtils_REMAKE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,48 +31,54 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\..\Desktop\EXILED VISUAL STUDIO\EXILED 5\5.2\dependencies\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\Desktop\EXILED VISUAL STUDIO\EXILED 5\5.1.0\Assembly-CSharp-Publicized.dll</HintPath>
<HintPath>..\..\..\..\Desktop\EXILED VISUAL STUDIO\EXILED 5\5.2\Assembly-CSharp-PublicizedX.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.5.3.1\lib\net472\Assembly-CSharp-Publicized.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\CommandSystem.Core.dll</HintPath>
<HintPath>..\packages\EXILED.5.3.1\lib\net472\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.API, Version=5.3.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\Exiled.API.dll</HintPath>
<Reference Include="Exiled.API, Version=5.3.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.1\lib\net472\Exiled.API.dll</HintPath>
</Reference>
<Reference Include="Exiled.Bootstrap, Version=5.3.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\Exiled.Bootstrap.dll</HintPath>
<Reference Include="Exiled.Bootstrap, Version=5.3.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.1\lib\net472\Exiled.Bootstrap.dll</HintPath>
</Reference>
<Reference Include="Exiled.CreditTags, Version=5.3.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\Exiled.CreditTags.dll</HintPath>
<Reference Include="Exiled.CreditTags, Version=5.3.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.1\lib\net472\Exiled.CreditTags.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomItems, Version=5.3.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\Exiled.CustomItems.dll</HintPath>
<Reference Include="Exiled.CustomItems, Version=5.3.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.1\lib\net472\Exiled.CustomItems.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomRoles, Version=5.3.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\Exiled.CustomRoles.dll</HintPath>
<Reference Include="Exiled.CustomRoles, Version=5.3.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.1\lib\net472\Exiled.CustomRoles.dll</HintPath>
</Reference>
<Reference Include="Exiled.Events, Version=5.3.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\Exiled.Events.dll</HintPath>
<Reference Include="Exiled.Events, Version=5.3.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.1\lib\net472\Exiled.Events.dll</HintPath>
</Reference>
<Reference Include="Exiled.Loader, Version=5.3.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\Exiled.Loader.dll</HintPath>
<Reference Include="Exiled.Loader, Version=5.3.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.1\lib\net472\Exiled.Loader.dll</HintPath>
</Reference>
<Reference Include="Exiled.Permissions, Version=5.3.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\Exiled.Permissions.dll</HintPath>
<Reference Include="Exiled.Permissions, Version=5.3.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.1\lib\net472\Exiled.Permissions.dll</HintPath>
</Reference>
<Reference Include="Exiled.Updater, Version=3.1.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\Exiled.Updater.dll</HintPath>
<HintPath>..\packages\EXILED.5.3.1\lib\net472\Exiled.Updater.dll</HintPath>
</Reference>
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\Steam Biblioteca\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Mirror.dll</HintPath>
</Reference>
<Reference Include="NorthwoodLib, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.5.3.0\lib\net472\NorthwoodLib.dll</HintPath>
<HintPath>..\packages\EXILED.5.3.1\lib\net472\NorthwoodLib.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -95,9 +101,11 @@
<Compile Include="Enums\VersionType.cs" />
<Compile Include="EventHandlers.cs" />
<Compile Include="MainClass.cs" />
<Compile Include="Patches\ScpVoiceChatPatch.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
14 changes: 9 additions & 5 deletions ExiledUtils_REMAKE/MainClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using ExiledUtilsRemake_Scp049Handler = Exiled.Events.Handlers.Scp049;
using ExiledUtilsRemake_Scp106Handler = Exiled.Events.Handlers.Scp106;
using ExiledUtils_REMAKE.Enums;
using HarmonyLib;

namespace ExiledUtils_REMAKE
{
Expand All @@ -14,11 +15,13 @@ public class MainClass : Plugin<Config>
public override string Author { get; } = "xNexus-ACS";
public override string Name { get; } = "ExiledUtils-Remake";
public override string Prefix { get; } = "exiled_utils_remake";
public override Version Version { get; } = new Version(4, 0, 0);
public override Version Version { get; } = new Version(4, 1, 0);
public override Version RequiredExiledVersion { get; } = new Version(5, 3, 0);
public const VersionType type = VersionType.Remake;

private static Harmony harmony;

public EventHandlers Ev;
public EventHandlers Ev { get; private set; }

public override void OnEnabled()
{
Expand All @@ -29,10 +32,11 @@ public override void OnEnabled()

Ev = new EventHandlers(this);
hub = this;
harmony = new Harmony($"exiledutils-remake");
harmony.PatchAll();

ExiledUtilsRemake_PlayerHandler.UsingRadioBattery += Ev.OnUsingRadioBattery;
ExiledUtilsRemake_PlayerHandler.Shooting += Ev.OnShooting;
ExiledUtilsRemake_PlayerHandler.EnteringEnvironmentalHazard += Ev.OnEnteringEnvironmentalHazard;
ExiledUtilsRemake_PlayerHandler.FlippingCoin += Ev.OnFlippingCoin;
ExiledUtilsRemake_PlayerHandler.UsingMicroHIDEnergy += Ev.OnUsingMicroEnergy;
ExiledUtilsRemake_PlayerHandler.PreAuthenticating += Ev.OnPreAuthenticating;
Expand All @@ -47,17 +51,17 @@ public override void OnDisabled()
{
ExiledUtilsRemake_PlayerHandler.UsingRadioBattery -= Ev.OnUsingRadioBattery;
ExiledUtilsRemake_PlayerHandler.Shooting -= Ev.OnShooting;
ExiledUtilsRemake_PlayerHandler.EnteringEnvironmentalHazard -= Ev.OnEnteringEnvironmentalHazard;
ExiledUtilsRemake_PlayerHandler.FlippingCoin -= Ev.OnFlippingCoin;
ExiledUtilsRemake_PlayerHandler.UsingMicroHIDEnergy -= Ev.OnUsingMicroEnergy;
ExiledUtilsRemake_PlayerHandler.PreAuthenticating -= Ev.OnPreAuthenticating;
ExiledUtilsRemake_PlayerHandler.Dying -= Ev.OnDying;
ExiledUtilsRemake_Scp096Handler.AddingTarget -= Ev.OnAddingTarget;
ExiledUtilsRemake_Scp049Handler.FinishingRecall -= Ev.OnRevived;
ExiledUtilsRemake_Scp049Handler.StartingRecall -= Ev.OnReviving;

Ev = null;
hub = null;
harmony.UnpatchAll(harmony.Id);
base.OnDisabled();
}
}
Expand Down
16 changes: 16 additions & 0 deletions ExiledUtils_REMAKE/Patches/ScpVoiceChatPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Exiled.API.Features;
using HarmonyLib;

namespace ExiledUtils_REMAKE.Patches
{
[HarmonyPatch(typeof(Radio), nameof(Radio.UserCode_CmdSyncTransmissionStatus))]
public class ScpVoiceChatPatch
{
public static bool Prefix(Radio __instance, bool b)
{
if (Player.Get(__instance._hub).IsScp)
__instance._dissonanceSetup.MimicAs939 = b;
return true;
}
}
}

0 comments on commit e6def1e

Please sign in to comment.