UpgradeMod
Functions
Section titled “Functions”upgradeMod()
Section titled “upgradeMod()”upgradeMod<
T>(modVanilla,features?,debug?,timeThreshold?):ModUpgradedWithFeatures<T>
Defined in: packages/isaacscript-common/src/core/upgradeMod.ts:40
Use this function to enable the custom callbacks and other optional features provided by
isaacscript-common.
For example:
const modVanilla = RegisterMod("My Mod", 1);const mod = upgradeMod(modVanilla);
// Subscribe to vanilla callbacks.mod.AddCallback(ModCallback.POST_UPDATE, postUpdate);
// Subscribe to custom callbacks.mod.AddCallbackCustom(ModCallbackCustom.POST_ITEM_PICKUP, postItemPickup);Type Parameters
Section titled “Type Parameters”T extends readonly ISCFeature[] = never[]
Parameters
Section titled “Parameters”modVanilla
Section titled “modVanilla”Mod
The mod object returned by the RegisterMod function.
features?
Section titled “features?”ISCFeatureTuple<T> = ...
Optional. An array containing the optional standard library features that you want to enable, if any. Default is an empty array.
debug?
Section titled “debug?”boolean = false
Optional. Whether to log additional output when a callback is fired. Default is false.
timeThreshold?
Section titled “timeThreshold?”float
Optional. If provided, will only log callbacks that take longer than the specified number of seconds (if the “–luadebug” launch flag is turned on) or milliseconds (if the “–luadebug” launch flag is turned off).
Returns
Section titled “Returns”ModUpgradedWithFeatures<T>
The upgraded mod object.
