Stickers: fixed shader replacement hitting stickers

This commit is contained in:
NotAKidoS 2024-09-10 20:22:26 -05:00
parent 958f07ed08
commit af00f4c6d0
3 changed files with 15 additions and 2 deletions

View file

@ -26,6 +26,7 @@ public class StickerMod : MelonMod
ApplyPatches(typeof(Patches.PlayerSetupPatches)); ApplyPatches(typeof(Patches.PlayerSetupPatches));
ApplyPatches(typeof(Patches.ControllerRayPatches)); ApplyPatches(typeof(Patches.ControllerRayPatches));
ApplyPatches(typeof(Patches.ShaderFilterHelperPatches)); ApplyPatches(typeof(Patches.ShaderFilterHelperPatches));
ApplyPatches(typeof(Patches.CVRToolsPatches));
LoadAssetBundle(); LoadAssetBundle();

View file

@ -1,4 +1,5 @@
using ABI_RC.Core.InteractionSystem; using ABI_RC.Core;
using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core.IO; using ABI_RC.Core.IO;
using ABI_RC.Core.Player; using ABI_RC.Core.Player;
using ABI_RC.Core.Savior; using ABI_RC.Core.Savior;
@ -49,3 +50,14 @@ internal static class ShaderFilterHelperPatches
MetaPort.Instance.settings.SetSettingsBool("ExperimentalShaderLimitEnabled", false); MetaPort.Instance.settings.SetSettingsBool("ExperimentalShaderLimitEnabled", false);
} }
} }
internal static class CVRToolsPatches
{
[HarmonyPrefix]
[HarmonyPatch(typeof(CVRTools), nameof(CVRTools.ReplaceShaders), typeof(Material), typeof(string))]
private static bool Prefix_CVRTools_ReplaceShaders(Material material, string fallbackShaderName = "")
{
if (material == null || material.shader == null) return true;
return material.shader != StickerMod.DecalSimpleShader; // prevent replacing decals with fallback shader
}
}

View file

@ -27,6 +27,6 @@ using System.Reflection;
namespace NAK.Stickers.Properties; namespace NAK.Stickers.Properties;
internal static class AssemblyInfoParams internal static class AssemblyInfoParams
{ {
public const string Version = "1.0.6"; public const string Version = "1.0.7";
public const string Author = "NotAKidoS"; public const string Author = "NotAKidoS";
} }