UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

127 lines 6.5 kB
import type { ButtonAction } from "isaac-typescript-definitions"; import { Feature } from "../../private/Feature"; export declare class DisableInputs extends Feature { private readonly isActionPressed; private readonly isActionTriggered; private readonly getActionValue; private getReturnValue; /** * Helper function to check if the `ISCFeature.DISABLE_INPUTS` feature is turned on in some * capacity. * * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`. * * @public */ areInputsEnabled(): boolean; /** * Helper function to enable all inputs. Use this function to set things back to normal after * having used one of the other helper functions to disable inputs. * * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`. * * @param key The name of the mod feature that is requesting the enable/disable. For example, if * this was part of the code for a custom enemy called "Super Gaper", then you could * use a key of "SuperGaper". The name is necessary so that multiple mod features can * work in tandem. * @public */ enableAllInputs(key: string): void; /** * Helper function to disable specific inputs, like opening the console. * * This function is variadic, meaning that you can specify as many inputs as you want to disable. * (To disable all inputs, see the `disableAllInputs` function. * * Use the `enableAllInputs` helper function to set things back to normal. * * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`. * * @param key The name of the mod feature that is requesting the enable/disable. For example, if * this was part of the code for a custom enemy called "Super Gaper", then you could * use a key of "SuperGaper". The name is necessary so that multiple mod features can * work in tandem. * @param buttonActions An array of the actions to action. * @public */ disableInputs(key: string, ...buttonActions: readonly ButtonAction[]): void; /** * Helper function to disable all inputs. This is useful because `EntityPlayer.ControlsEnabled` * can be changed by the game under certain conditions. * * Use the `enableAllInputs` helper function to set things back to normal. * * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`. * * @param key The name of the mod feature that is requesting the enable/disable. For example, if * this was part of the code for a custom enemy called "Super Gaper", then you could * use a key of "SuperGaper". The name is necessary so that multiple mod features can * work in tandem. * @public */ disableAllInputs(key: string): void; /** * Helper function to enable all inputs besides the ones provided. This is useful because * `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions. * * Use the `enableAllInputs` helper function to set things back to normal. * * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`. * * @param key The name of the mod feature that is requesting the enable/disable. For example, if * this was part of the code for a custom enemy called "Super Gaper", then you could * use a key of "SuperGaper". The name is necessary so that multiple mod features can * work in tandem. * @param blacklist A set of ButtonActions to disallow. * @public */ enableAllInputsExceptFor(key: string, blacklist: ReadonlySet<ButtonAction>): void; /** * Helper function to disable all inputs besides the ones provided. This is useful because * `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions. * * Use the `enableAllInputs` helper function to set things back to normal. * * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`. * * @param key The name of the mod feature that is requesting the enable/disable. For example, if * this was part of the code for a custom enemy called "Super Gaper", then you could * use a key of "SuperGaper". The name is necessary so that multiple mod features can * work in tandem. * @param whitelist A set of ButtonActions to allow. * @public */ disableAllInputsExceptFor(key: string, whitelist: ReadonlySet<ButtonAction>): void; /** * Helper function to disable only the inputs used for moving the character (or moving the cursor * in the UI). This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game * under certain conditions. * * Use the `enableAllInputs` helper function to set things back to normal. * * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`. * * @param key The name of the mod feature that is requesting the enable/disable. For example, if * this was part of the code for a custom enemy called "Super Gaper", then you could * use a key of "SuperGaper". The name is necessary so that multiple mod features can * work in tandem. * @public */ disableMovementInputs(key: string): void; /** * Helper function to disable only the inputs used for shooting tears. This is useful because * `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions. * * Use the `enableAllInputs` helper function to set things back to normal. * * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`. * * @param key The name of the mod feature that is requesting the enable/disable. For example, if * this was part of the code for a custom enemy called "Super Gaper", then you could * use a key of "SuperGaper". The name is necessary so that multiple mod features can * work in tandem. * @public */ disableShootingInputs(key: string): void; } //# sourceMappingURL=DisableInputs.d.ts.map