MunitionExpert: add toggle for colorizing backgrounds
This commit is contained in:
parent
d91be0d666
commit
40cd708ebb
@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<AssemblyName>IcyClawz.MunitionsExpert</AssemblyName>
|
||||
<Version>1.1.0</Version>
|
||||
<Version>1.1.1</Version>
|
||||
<RootNamespace>IcyClawz.MunitionsExpert</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
using Aki.Reflection.Patching;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using EFT.HandBook;
|
||||
using EFT.InventoryLogic;
|
||||
using EFT.UI;
|
||||
@ -11,11 +12,14 @@ using UnityEngine;
|
||||
|
||||
namespace IcyClawz.MunitionsExpert
|
||||
{
|
||||
[BepInPlugin("com.IcyClawz.MunitionsExpert", "IcyClawz.MunitionsExpert", "1.1.0")]
|
||||
[BepInPlugin("com.IcyClawz.MunitionsExpert", "IcyClawz.MunitionsExpert", "1.1.1")]
|
||||
public class Plugin : BaseUnityPlugin
|
||||
{
|
||||
internal static ConfigEntry<bool> ColorizeItemBackgrounds;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
ColorizeItemBackgrounds = Config.Bind("General", "Colorize Icon Backgrounds", true);
|
||||
IconCache.Initialize();
|
||||
new StaticIconsPatch().Enable();
|
||||
new AmmoTemplatePatch().Enable();
|
||||
@ -78,7 +82,10 @@ namespace IcyClawz.MunitionsExpert
|
||||
[PatchPrefix]
|
||||
private static void PatchPrefix(ref ItemView __instance)
|
||||
{
|
||||
__instance.OverrideColor(__instance.Item);
|
||||
if (Plugin.ColorizeItemBackgrounds.Value)
|
||||
{
|
||||
__instance.OverrideColor(__instance.Item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +97,10 @@ namespace IcyClawz.MunitionsExpert
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(ref EntityIcon __instance, Item item)
|
||||
{
|
||||
__instance.OverrideColor(item);
|
||||
if (Plugin.ColorizeItemBackgrounds.Value)
|
||||
{
|
||||
__instance.OverrideColor(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user