Compare commits
No commits in common. "main" and "1.0.1" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,7 +3,6 @@ project/References/EFT_Managed/*
|
||||
|
||||
# Allow these files, despite the rules above
|
||||
!project/References/EFT_Managed/.keep
|
||||
!project/References/SPT/.keep
|
||||
|
||||
# ---> VisualStudio
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
|
@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Comfort.Common;
|
||||
using SPT.Reflection.Patching;
|
||||
using Aki.Reflection.Patching;
|
||||
using EFT;
|
||||
using EFT.Communications;
|
||||
using EFT.PrefabSettings;
|
||||
@ -24,25 +23,17 @@ namespace Terkoiz.FlareEventNotifier
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
public static void PatchPrefix(FlareEventType flareType, EZoneEventTypeEnumClone eventType, string playerProfileID)
|
||||
public static void PatchPrefix(FlareEventType flareType, EZoneEventTypeEnumClone eventType)
|
||||
{
|
||||
if (flareType != FlareEventType.ExitActivate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (eventType != EZoneEventTypeEnumClone.FiredPlayerAddedInShotList && eventType != EZoneEventTypeEnumClone.PlayerByPartyAddedInShotList)
|
||||
if (eventType == EZoneEventTypeEnumClone.FiredPlayerAddedInShotList || eventType == EZoneEventTypeEnumClone.PlayerByPartyAddedInShotList)
|
||||
{
|
||||
return;
|
||||
NotificationManagerClass.DisplayNotification(new ExfilFlareSuccessNotification());
|
||||
}
|
||||
|
||||
var localPlayer = GetLocalPlayerFromWorld();
|
||||
if (localPlayer != null && localPlayer.ProfileId != playerProfileID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
NotificationManagerClass.DisplayNotification(new ExfilFlareSuccessNotification());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -56,24 +47,9 @@ namespace Terkoiz.FlareEventNotifier
|
||||
FiredPlayerAddedInShotList,
|
||||
PlayerByPartyAddedInShotList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current <see cref="Player"/> instance if it's available
|
||||
/// </summary>
|
||||
/// <returns>Local <see cref="Player"/> instance; returns null if the game is not in raid</returns>
|
||||
private static Player GetLocalPlayerFromWorld()
|
||||
{
|
||||
var gameWorld = Singleton<GameWorld>.Instance;
|
||||
if (gameWorld == null || gameWorld.MainPlayer == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return gameWorld.MainPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
public class ExfilFlareSuccessNotification : NotificationAbstractClass
|
||||
public class ExfilFlareSuccessNotification : NotificationClass
|
||||
{
|
||||
public ExfilFlareSuccessNotification()
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ using JetBrains.Annotations;
|
||||
|
||||
namespace Terkoiz.FlareEventNotifier
|
||||
{
|
||||
[BepInPlugin("com.terkoiz.flareeventnotifier", "Terkoiz.FlareEventNotifier", "1.0.2")]
|
||||
[BepInPlugin("com.terkoiz.flareeventnotifier", "Terkoiz.FlareEventNotifier", "1.0.1")]
|
||||
public class FlareEventNotifierPlugin : BaseUnityPlugin
|
||||
{
|
||||
[UsedImplicitly]
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<Version>1.0.2</Version>
|
||||
<Version>1.0.1</Version>
|
||||
<Authors>Terkoiz</Authors>
|
||||
<RepositoryUrl>https://dev.sp-tarkov.com/Terkoiz/FlareEventNotifier</RepositoryUrl>
|
||||
<PackageLicenseExpression>NCSA</PackageLicenseExpression>
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Aki.Reflection">
|
||||
<HintPath>..\References\SPT\spt-reflection.dll</HintPath>
|
||||
<HintPath>..\References\EFT_Managed\Aki.Reflection.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
|
Reference in New Issue
Block a user