NQualityOfLife.PatchIfEnabled - Niilo007/RimWorld-NQoL GitHub Wiki

PatchIfEnabled

Related:


C#

public PatchIfEnabledAttribute(string settingKey, bool alwaysEnabled = false)
{

}
public PatchIfEnabledAttribute(string settingKey, string orSettingKey, bool alwaysEnabled = false)
{

}
public PatchIfEnabledAttribute(string settingKey, string orSettingKey, string setTo, bool alwaysEnabled = false)
{

}
public PatchIfEnabledAttribute(params string[] anySettingKey)
{

}
public PatchIfEnabledAttribute(bool alwaysEnabled, string message = "debug always enabled")
{

}

Usage

The PatchIfEnabled attribute can be used to conditionally apply the harmony patch that it is on.


Errors


Examples

Used In Example:

[PatchIfEnabled("NiilosQoL_Settings_Ancient_Radiation")]
[HarmonyPatch(typeof(Rimatomics.DubUtils), nameof(Rimatomics.DubUtils.applyRads), MethodType.Normal)]
internal sealed class NQoL_FixRimAtomicsLogSpam : HarmonyPatch
{

}