Upload from upload_mods.ps1
This commit is contained in:
16
Harmony/Init.cs
Normal file
16
Harmony/Init.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Reflection;
|
||||
|
||||
public class CustomMuzzleFlashInit : IModApi
|
||||
{
|
||||
private static bool inited = false;
|
||||
public void InitMod(Mod _modInstance)
|
||||
{
|
||||
if (inited)
|
||||
return;
|
||||
inited = true;
|
||||
Log.Out(" Loading Patch: " + GetType());
|
||||
var harmony = new HarmonyLib.Harmony(GetType().ToString());
|
||||
harmony.PatchAll(Assembly.GetExecutingAssembly());
|
||||
}
|
||||
}
|
||||
|
||||
27
Harmony/Patches.cs
Normal file
27
Harmony/Patches.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using HarmonyLib;
|
||||
|
||||
[HarmonyPatch]
|
||||
class MuzzlePatch
|
||||
{
|
||||
[HarmonyPatch(typeof(ItemActionAttack), nameof(ItemActionAttack.ReadFrom))]
|
||||
[HarmonyPostfix]
|
||||
private static void Postfix_ReadFrom_ItemActionAttack(DynamicProperties _props)
|
||||
{
|
||||
if (_props.Values.ContainsKey("Particles_muzzle_fire") && !ParticleEffect.IsAvailable(_props.Values["Particles_muzzle_fire"]))
|
||||
{
|
||||
ParticleEffect.LoadAsset(_props.Values["Particles_muzzle_fire"]);
|
||||
}
|
||||
if (_props.Values.ContainsKey("Particles_muzzle_fire_fpv") && !ParticleEffect.IsAvailable(_props.Values["Particles_muzzle_fire_fpv"]))
|
||||
{
|
||||
ParticleEffect.LoadAsset(_props.Values["Particles_muzzle_fire_fpv"]);
|
||||
}
|
||||
if (_props.Values.ContainsKey("Particles_muzzle_smoke") && !ParticleEffect.IsAvailable(_props.Values["Particles_muzzle_smoke"]))
|
||||
{
|
||||
ParticleEffect.LoadAsset(_props.Values["Particles_muzzle_smoke"]);
|
||||
}
|
||||
if (_props.Values.ContainsKey("Particles_muzzle_smoke_fpv") && !ParticleEffect.IsAvailable(_props.Values["Particles_muzzle_smoke_fpv"]))
|
||||
{
|
||||
ParticleEffect.LoadAsset(_props.Values["Particles_muzzle_smoke_fpv"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user