Skip to content

Commit

Permalink
Disable component locally on load
Browse files Browse the repository at this point in the history
  • Loading branch information
Banane9 committed Apr 15, 2022
1 parent 2b3088c commit 3b656b9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions PacifistAprilFoolsExplosion/PacifistAprilFoolsExplosion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ public class PacifistAprilFoolsExplosion : NeosMod

private const string explosionSlotName = "Explosion";

[AutoRegisterConfigKey]
private static ModConfigurationKey<bool> DisableExplosion = new ModConfigurationKey<bool>("DisableExplosion", "Disable the Violent Explosion component locally when it's loaded.", () => true);

/*
[AutoRegisterConfigKey]
private static ModConfigurationKey<bool> HideFlames = new ModConfigurationKey<bool>("HideFlames", "Hide the Violent Explosion's flame particles.", () => true);
[AutoRegisterConfigKey]
private static ModConfigurationKey<bool> MuteBloating = new ModConfigurationKey<bool>("MuteBloating", "Mute the Violent Explosion's bloating sound effect.", () => false);
[AutoRegisterConfigKey]
private static ModConfigurationKey<bool> MuteExplosion = new ModConfigurationKey<bool>("MuteExplosion", "Mute the Violent Explosion's explosion sound effect.", () => true);
private static ModConfigurationKey<bool> MuteExplosion = new ModConfigurationKey<bool>("MuteExplosion", "Mute the Violent Explosion's explosion sound effect.", () => true);*/

public override string Author => "Banane9";
public override string Link => "https://github.com/Banane9/NeosPacifistAprilFoolsExplosion";
Expand All @@ -49,7 +53,7 @@ private static class ViolentAprilFoolsExplosionPatch
[HarmonyPatch("OnAwake")]
private static void OnAwakePostfix(ViolentAprilFoolsExplosion __instance)
{
__instance.RunInUpdates(2, () => __instance.Enabled = false);
__instance.RunInUpdates(2, () => ValueUserOverride.OverrideForUser(__instance.EnabledField, __instance.World.LocalUser, !Config.GetValue(DisableExplosion)));
}
}

Expand Down

0 comments on commit 3b656b9

Please sign in to comment.