update 1.1.0
This commit is contained in:
parent
377dbee800
commit
1ac27f7afb
@ -7,7 +7,6 @@ namespace SkinHide.Patches
|
|||||||
{
|
{
|
||||||
public class BotOwnerPatch : ModulePatch
|
public class BotOwnerPatch : ModulePatch
|
||||||
{
|
{
|
||||||
|
|
||||||
protected override MethodBase GetTargetMethod()
|
protected override MethodBase GetTargetMethod()
|
||||||
{
|
{
|
||||||
return typeof(BotOwner).GetMethod("method_4", PatchConstants.PrivateFlags);
|
return typeof(BotOwner).GetMethod("method_4", PatchConstants.PrivateFlags);
|
||||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||||
//通过使用 "*",如下所示:
|
//通过使用 "*",如下所示:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.1.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.1.0.0")]
|
||||||
|
@ -37,6 +37,10 @@
|
|||||||
<AssemblyOriginatorKeyFile>kmyuhkyuk.pfx</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>kmyuhkyuk.pfx</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="0Harmony, Version=2.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>R:\Battlestate Games\Client.0.12.12.15.17349\BepInEx\core\0Harmony.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Aki.Reflection">
|
<Reference Include="Aki.Reflection">
|
||||||
<HintPath>R:\Battlestate Games\Client.0.12.12.15.17349\EscapeFromTarkov_Data\Managed\Aki.Reflection.dll</HintPath>
|
<HintPath>R:\Battlestate Games\Client.0.12.12.15.17349\EscapeFromTarkov_Data\Managed\Aki.Reflection.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using SkinHide.Patches;
|
using SkinHide.Patches;
|
||||||
|
using EFT;
|
||||||
using EFT.Visual;
|
using EFT.Visual;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace SkinHide
|
namespace SkinHide
|
||||||
{
|
{
|
||||||
[BepInPlugin("com.kmyuhkyuk.SkinHide", "kmyuhkyuk-SkinHide", "1.0.0")]
|
[BepInPlugin("com.kmyuhkyuk.SkinHide", "kmyuhkyuk-SkinHide", "1.1.0")]
|
||||||
public class SkinHidePlugin : BaseUnityPlugin
|
public class SkinHidePlugin : BaseUnityPlugin
|
||||||
{
|
{
|
||||||
public static GameObject Player;
|
public static GameObject Player;
|
||||||
@ -24,22 +25,27 @@ namespace SkinHide
|
|||||||
|
|
||||||
public HashSet<GameObject> PlayerSkinGameObject = new HashSet<GameObject>();
|
public HashSet<GameObject> PlayerSkinGameObject = new HashSet<GameObject>();
|
||||||
|
|
||||||
|
public HashSet<GameObject> PlayerDressGameObject = new HashSet<GameObject>();
|
||||||
|
|
||||||
public static List <GameObject> Bot = new List<GameObject>();
|
public static List <GameObject> Bot = new List<GameObject>();
|
||||||
|
|
||||||
public SkinDress[] BotSkinDress;
|
|
||||||
|
|
||||||
public Dress[] BotDress;
|
|
||||||
|
|
||||||
public HashSet<GameObject> BotSkinGameObject = new HashSet<GameObject>();
|
public HashSet<GameObject> BotSkinGameObject = new HashSet<GameObject>();
|
||||||
|
|
||||||
|
public HashSet<GameObject> BotDressGameObject = new HashSet<GameObject>();
|
||||||
|
|
||||||
public static ConfigEntry<bool> KeyPlayerSkinHide { get; set; }
|
public static ConfigEntry<bool> KeyPlayerSkinHide { get; set; }
|
||||||
public static ConfigEntry<bool> KeyBotSkinHide { get; set; }
|
public static ConfigEntry<bool> KeyBotSkinHide { get; set; }
|
||||||
|
|
||||||
|
public static ConfigEntry<bool> KeyBotSkinHideShutDown { get; set; }
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
Logger.LogInfo("Loaded: kmyuhkyuk-SkinHide");
|
Logger.LogInfo("Loaded: kmyuhkyuk-SkinHide");
|
||||||
KeyPlayerSkinHide = Config.Bind<bool>("玩家服装隐藏 Player Skin Hide", "开关 Swithc", false);
|
|
||||||
KeyBotSkinHide = Config.Bind<bool>("Bot服装隐藏 Bot Skin Hide", "开关 Swithc", false);
|
string SkinHide = "Skin Hide";
|
||||||
|
KeyPlayerSkinHide = Config.Bind<bool>(SkinHide, "玩家服装隐藏 Player Skin Hide", false);
|
||||||
|
KeyBotSkinHide = Config.Bind<bool>(SkinHide, "Bot服装隐藏 Bot Skin Hide", false);
|
||||||
|
KeyBotSkinHideShutDown = Config.Bind<bool>(SkinHide, "Bot服装隐藏功能关闭 Bot Skin Hide Function Shut Down", false, "Many Bot corpse will cause lag, turn the switch off Bot Skin Scan.");
|
||||||
|
|
||||||
new PlayerModelViewPatch().Enable();
|
new PlayerModelViewPatch().Enable();
|
||||||
new GamePlayerOwnerPatch().Enable();
|
new GamePlayerOwnerPatch().Enable();
|
||||||
@ -74,10 +80,10 @@ namespace SkinHide
|
|||||||
if (Player != null)
|
if (Player != null)
|
||||||
{
|
{
|
||||||
//Get Player all SkinDress and Dress
|
//Get Player all SkinDress and Dress
|
||||||
PlayerSkinDress = Player.GetComponentsInChildren<SkinDress>();
|
PlayerSkinDress = Player.transform.Find("Player/Mesh").gameObject.GetComponentsInChildren<SkinDress>();
|
||||||
PlayerDress = Player.GetComponentsInChildren<Dress>();
|
PlayerDress = Player.transform.Find("Player/Root_Joint").gameObject.GetComponentsInChildren<Dress>();
|
||||||
|
|
||||||
//False SkinDress and Dress GameObject
|
//False SkinDress GameObject
|
||||||
if (PlayerSkinDress != null)
|
if (PlayerSkinDress != null)
|
||||||
{
|
{
|
||||||
foreach (SkinDress skindress in PlayerSkinDress)
|
foreach (SkinDress skindress in PlayerSkinDress)
|
||||||
@ -89,65 +95,161 @@ namespace SkinHide
|
|||||||
{
|
{
|
||||||
foreach (Dress dress in PlayerDress)
|
foreach (Dress dress in PlayerDress)
|
||||||
{
|
{
|
||||||
PlayerSkinGameObject.Add(dress.gameObject);
|
PlayerDressGameObject.Add(dress.gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//false or true SkinDress and Dress GameObject
|
//Hide Dress GameObject
|
||||||
|
if (PlayerDressGameObject != null)
|
||||||
|
{
|
||||||
|
List<GameObject> Loot = new List<GameObject>();
|
||||||
|
|
||||||
|
foreach (GameObject dress in PlayerDressGameObject)
|
||||||
|
{
|
||||||
|
MeshRenderer[] MeshRenderer = dress.GetComponentsInChildren<MeshRenderer>();
|
||||||
|
|
||||||
|
//Loot False Hide
|
||||||
|
if (dress != null && dress.GetComponentInParent<GamePlayerOwner>() != null)
|
||||||
|
{
|
||||||
|
foreach (MeshRenderer mesh in MeshRenderer)
|
||||||
|
{
|
||||||
|
mesh.enabled = !KeyPlayerSkinHide.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (MeshRenderer mesh in MeshRenderer)
|
||||||
|
{
|
||||||
|
mesh.enabled = true;
|
||||||
|
}
|
||||||
|
Loot.Add(dress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loot != null)
|
||||||
|
{
|
||||||
|
PlayerDressGameObject.ExceptWith(Loot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//False or true SkinDress and Dress GameObject
|
||||||
if (PlayerSkinGameObject != null)
|
if (PlayerSkinGameObject != null)
|
||||||
{
|
{
|
||||||
|
List<GameObject> Loot = new List<GameObject>();
|
||||||
|
|
||||||
foreach (GameObject skin in PlayerSkinGameObject)
|
foreach (GameObject skin in PlayerSkinGameObject)
|
||||||
|
{
|
||||||
|
if (skin != null && skin.GetComponentInParent<GamePlayerOwner>() != null)
|
||||||
{
|
{
|
||||||
skin.SetActive(!KeyPlayerSkinHide.Value);
|
skin.SetActive(!KeyPlayerSkinHide.Value);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
skin.SetActive(true);
|
||||||
|
|
||||||
|
Loot.Add(skin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loot != null)
|
||||||
|
{
|
||||||
|
PlayerSkinGameObject.ExceptWith(Loot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Quit Raid Clear GameObject List
|
//Quit Raid Clear GameObject List
|
||||||
PlayerSkinGameObject.Clear();
|
PlayerSkinGameObject.Clear();
|
||||||
|
PlayerDressGameObject.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Clear List null Bot
|
//Clear List null Bot
|
||||||
Bot.RemoveAll(x => x == null);
|
Bot.RemoveAll(x => x == null);
|
||||||
//Bot Skin Hide
|
//Bot Skin Hide
|
||||||
if (Bot.Count > 0)
|
if (Bot != null && !KeyBotSkinHideShutDown.Value)
|
||||||
{
|
{
|
||||||
//Get Bot all SkinDress and Dress
|
//Get Bot all SkinDress and Dress
|
||||||
foreach (GameObject bot in Bot)
|
foreach (GameObject bot in Bot)
|
||||||
{
|
{
|
||||||
BotSkinDress = bot.GetComponentsInChildren<SkinDress>();
|
SkinDress[] botskindress = bot.transform.Find("Player/Mesh").gameObject.GetComponentsInChildren<SkinDress>();
|
||||||
BotDress = bot.GetComponentsInChildren<Dress>();
|
|
||||||
|
foreach (SkinDress skinDress in botskindress)
|
||||||
|
{
|
||||||
|
BotSkinGameObject.Add(skinDress.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BotSkinDress != null)
|
Dress[] botDress = bot.transform.Find("Player/Root_Joint").gameObject.GetComponentsInChildren<Dress>();
|
||||||
|
|
||||||
|
foreach (Dress Dress in botDress)
|
||||||
{
|
{
|
||||||
foreach (SkinDress botskindess in BotSkinDress)
|
BotDressGameObject.Add(Dress.gameObject);
|
||||||
{
|
|
||||||
BotSkinGameObject.Add(botskindess.gameObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (BotDress != null)
|
|
||||||
{
|
|
||||||
foreach (Dress botdess in BotDress)
|
|
||||||
{
|
|
||||||
BotSkinGameObject.Add(botdess.gameObject);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//False or true SkinDress and Dress GameObject
|
//Hide Dress GameObject
|
||||||
|
if (BotDressGameObject != null)
|
||||||
|
{
|
||||||
|
List<GameObject> Loot = new List<GameObject>();
|
||||||
|
|
||||||
|
foreach (GameObject botdress in BotDressGameObject)
|
||||||
|
{
|
||||||
|
MeshRenderer[] MeshRenderer = botdress.GetComponentsInChildren<MeshRenderer>();
|
||||||
|
|
||||||
|
//Loot False Hide
|
||||||
|
if (botdress.GetComponentInParent<BotOwner>() != null)
|
||||||
|
{
|
||||||
|
foreach (MeshRenderer botmesh in MeshRenderer)
|
||||||
|
{
|
||||||
|
botmesh.enabled = !KeyBotSkinHide.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (MeshRenderer botmesh in MeshRenderer)
|
||||||
|
{
|
||||||
|
botmesh.enabled = true;
|
||||||
|
}
|
||||||
|
Loot.Add(botdress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loot != null)
|
||||||
|
{
|
||||||
|
BotDressGameObject.ExceptWith(Loot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//False or true SkinDress GameObject
|
||||||
if (BotSkinGameObject != null)
|
if (BotSkinGameObject != null)
|
||||||
{
|
{
|
||||||
|
List<GameObject> Loot = new List<GameObject>();
|
||||||
|
|
||||||
foreach (GameObject botskin in BotSkinGameObject)
|
foreach (GameObject botskin in BotSkinGameObject)
|
||||||
|
{
|
||||||
|
if (botskin.GetComponentInParent<BotOwner>() != null)
|
||||||
{
|
{
|
||||||
botskin.SetActive(!KeyBotSkinHide.Value);
|
botskin.SetActive(!KeyBotSkinHide.Value);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
botskin.SetActive(true);
|
||||||
|
|
||||||
|
Loot.Add(botskin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loot != null)
|
||||||
|
{
|
||||||
|
BotSkinGameObject.ExceptWith(Loot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Quit Raid Clear GameObject List
|
//Quit Raid Clear GameObject List
|
||||||
BotSkinGameObject.Clear();
|
BotSkinGameObject.Clear();
|
||||||
|
BotDressGameObject.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user