Show / Hide Table of Contents

Class ModHooks

Inheritance
object
ModHooks
Namespace: Modding
Assembly: HollowKnight.dll
Syntax
public class ModHooks

Methods

| Edit this page View Source

GetAllMods(bool, bool)

Returns an iterator over all mods.

Declaration
public static IEnumerable<IMod> GetAllMods(bool onlyEnabled = false, bool allowLoadError = false)
Parameters
Type Name Description
bool onlyEnabled

Should the iterator only contain enabled mods.

bool allowLoadError

Should the iterator contain mods which have load errors.

Returns
Type Description
IEnumerable<IMod>
| Edit this page View Source

ModEnabled(ITogglableMod)

Gets if the mod is currently enabled.

Declaration
public static bool ModEnabled(ITogglableMod mod)
Parameters
Type Name Description
ITogglableMod mod

The togglable mod to check.

Returns
Type Description
bool
| Edit this page View Source

ModEnabled(string)

Gets if a mod is currently enabled.

Declaration
public static bool ModEnabled(string name)
Parameters
Type Name Description
string name

The name of the mod to check.

Returns
Type Description
bool
| Edit this page View Source

ModEnabled(Type)

Gets if a mod is currently enabled.

Declaration
public static bool ModEnabled(Type type)
Parameters
Type Name Description
Type type

The type of the mod to check.

Returns
Type Description
bool
| Edit this page View Source

OnHeroUpdate()

Called whenever the hero updates

Declaration
public static void OnHeroUpdate()
Remarks

HeroController.Update

| Edit this page View Source

OnSavegameLoad(int)

Called directly after a save has been loaded

Declaration
public static void OnSavegameLoad(int id)
Parameters
Type Name Description
int id
Remarks

GameManager.LoadGame

| Edit this page View Source

OnSavegameSave(int)

Called directly after a save has been saved

Declaration
public static void OnSavegameSave(int id)
Parameters
Type Name Description
int id
Remarks

GameManager.SaveGame

Events

| Edit this page View Source

AfterAttackHook

Called at the end of the attack function

Declaration
public static event Action<AttackDirection> AfterAttackHook
Event Type
Type Description
Action<AttackDirection>
Remarks

HeroController.Attack

| Edit this page View Source

AfterPlayerDeadHook

Called after the player dies

Declaration
public static event Action AfterPlayerDeadHook
Event Type
Type Description
Action
Remarks

GameManager.PlayerDead

| Edit this page View Source

AfterSaveGameClearHook

Called after a game has been cleared from a slot.

Declaration
public static event Action<int> AfterSaveGameClearHook
Event Type
Type Description
Action<int>
| Edit this page View Source

AfterSavegameLoadHook

Called directly after a save has been loaded. Allows for accessing SaveGame instance.

Declaration
public static event Action<SaveGameData> AfterSavegameLoadHook
Event Type
Type Description
Action<SaveGameData>
Remarks

GameManager.LoadGame

| Edit this page View Source

AfterTakeDamageHook

Called at the end of the take damage function

Declaration
public static event AfterTakeDamageHandler AfterTakeDamageHook
Event Type
Type Description
AfterTakeDamageHandler
| Edit this page View Source

ApplicationQuitHook

Called when the game is fully closed

Declaration
public static event Action ApplicationQuitHook
Event Type
Type Description
Action
Remarks

GameManager.OnApplicationQuit

| Edit this page View Source

AttackHook

Called whenever the player attacks

Declaration
public static event Action<AttackDirection> AttackHook
Event Type
Type Description
Action<AttackDirection>
Remarks

HeroController.Attack

| Edit this page View Source

BeforePlayerDeadHook

Called when the player dies

Declaration
public static event Action BeforePlayerDeadHook
Event Type
Type Description
Action
Remarks

GameManager.PlayerDead

| Edit this page View Source

BeforeSavegameSaveHook

Called directly before save has been saved to allow for changes to the data before persisted.

Declaration
public static event Action<SaveGameData> BeforeSavegameSaveHook
Event Type
Type Description
Action<SaveGameData>
Remarks

GameManager.SaveGame

| Edit this page View Source

BlueHealthHook

Called whenever blue health is updated

Declaration
public static event Func<int> BlueHealthHook
Event Type
Type Description
Func<int>
| Edit this page View Source

CharmUpdateHook

Called after player values for charms have been set

Declaration
public static event CharmUpdateHandler CharmUpdateHook
Event Type
Type Description
CharmUpdateHandler
Remarks

HeroController.CharmUpdate

| Edit this page View Source

DashPressedHook

Called whenever the dash key is pressed. Returns whether or not to override normal dash functionality - if true, preventing a normal dash

Declaration
public static event Func<bool> DashPressedHook
Event Type
Type Description
Func<bool>
Remarks

HeroController.LookForQueueInput

| Edit this page View Source

DashVectorHook

Called during dash function to change velocity

Declaration
public static event Func<Vector2, Vector2> DashVectorHook
Event Type
Type Description
Func<Vector2, Vector2>

A changed vector.

Remarks

HeroController.Dash

| Edit this page View Source

DoAttackHook

Called at the start of the DoAttack function

Declaration
public static event Action DoAttackHook
Event Type
Type Description
Action
| Edit this page View Source

DrawBlackBordersHook

Called when a SceneManager calls DrawBlackBorders and creates boarders for a scene. You may use or modify the bounds of an area of the scene with these.

Declaration
public static event Action<List<GameObject>> DrawBlackBordersHook
Event Type
Type Description
Action<List<GameObject>>
Remarks

SceneManager.DrawBlackBorders

| Edit this page View Source

FinishedLoadingModsHook

Event invoked when mods have finished loading. If modloading has already finished, subscribers will be invoked immediately.

Declaration
public static event Action FinishedLoadingModsHook
Event Type
Type Description
Action
| Edit this page View Source

GetPlayerBoolHook

Called when anything in the game tries to get a bool from player data

Declaration
public static event GetBoolProxy GetPlayerBoolHook
Event Type
Type Description
GetBoolProxy
Remarks

PlayerData.GetBool

| Edit this page View Source

GetPlayerFloatHook

Called when anything in the game tries to get a float from player data

Declaration
public static event GetFloatProxy GetPlayerFloatHook
Event Type
Type Description
GetFloatProxy
Remarks

PlayerData.GetFloat

| Edit this page View Source

GetPlayerIntHook

Called when anything in the game tries to get an int from player data

Declaration
public static event GetIntProxy GetPlayerIntHook
Event Type
Type Description
GetIntProxy
Remarks

PlayerData.GetInt

| Edit this page View Source

GetPlayerStringHook

Called when anything in the game tries to get a string from player data

Declaration
public static event GetStringProxy GetPlayerStringHook
Event Type
Type Description
GetStringProxy
Remarks

PlayerData.GetString

| Edit this page View Source

GetPlayerVariableHook

Called when anything in the game tries to get a generic variable from player data

Declaration
public static event GetVariableProxy GetPlayerVariableHook
Event Type
Type Description
GetVariableProxy
Remarks

PlayerData.GetVariable

| Edit this page View Source

GetPlayerVector3Hook

Called when anything in the game tries to get a Vector3 from player data

Declaration
public static event GetVector3Proxy GetPlayerVector3Hook
Event Type
Type Description
GetVector3Proxy
Remarks

PlayerData.GetVector3

| Edit this page View Source

HeroUpdateHook

Called whenever the hero updates

Declaration
public static event Action HeroUpdateHook
Event Type
Type Description
Action
Remarks

HeroController.Update

| Edit this page View Source

LanguageGetHook

Called whenever localization specific strings are requested

Declaration
public static event LanguageGetProxy LanguageGetHook
Event Type
Type Description
LanguageGetProxy
Remarks

N/A

| Edit this page View Source

NewGameHook

Called whenever a new game is started

Declaration
public static event Action NewGameHook
Event Type
Type Description
Action
Remarks

GameManager.LoadFirstScene

| Edit this page View Source

SavegameClearHook

Called before a save file is deleted

Declaration
public static event Action<int> SavegameClearHook
Event Type
Type Description
Action<int>
Remarks

GameManager.ClearSaveFile

| Edit this page View Source

SavegameLoadHook

Called directly after a save has been loaded

Declaration
public static event Action<int> SavegameLoadHook
Event Type
Type Description
Action<int>
Remarks

GameManager.LoadGame

| Edit this page View Source

SavegameSaveHook

Called directly after a save has been saved

Declaration
public static event Action<int> SavegameSaveHook
Event Type
Type Description
Action<int>
Remarks

GameManager.SaveGame

| Edit this page View Source

SetPlayerBoolHook

Called when anything in the game tries to set a bool in player data

Declaration
public static event SetBoolProxy SetPlayerBoolHook
Event Type
Type Description
SetBoolProxy
Remarks

PlayerData.SetBool

| Edit this page View Source

SetPlayerFloatHook

Called when anything in the game tries to set a float in player data

Declaration
public static event SetFloatProxy SetPlayerFloatHook
Event Type
Type Description
SetFloatProxy
Remarks

PlayerData.SetFloat

| Edit this page View Source

SetPlayerIntHook

Called when anything in the game tries to set an int in player data

Declaration
public static event SetIntProxy SetPlayerIntHook
Event Type
Type Description
SetIntProxy
Remarks

PlayerData.SetInt

| Edit this page View Source

SetPlayerStringHook

Called when anything in the game tries to set a string in player data

Declaration
public static event SetStringProxy SetPlayerStringHook
Event Type
Type Description
SetStringProxy
Remarks

PlayerData.SetString

| Edit this page View Source

SetPlayerVariableHook

Called when anything in the game tries to set a generic variable in player data

Declaration
public static event SetVariableProxy SetPlayerVariableHook
Event Type
Type Description
SetVariableProxy
Remarks

PlayerData.SetVariable

| Edit this page View Source

SetPlayerVector3Hook

Called when anything in the game tries to set a Vector3 in player data

Declaration
public static event SetVector3Proxy SetPlayerVector3Hook
Event Type
Type Description
SetVector3Proxy
Remarks

PlayerData.SetVector3

| Edit this page View Source

SlashHitHook

Called whenever nail strikes something

Declaration
public static event SlashHitHandler SlashHitHook
Event Type
Type Description
SlashHitHandler
| Edit this page View Source

TakeDamageHook

Called when damage is dealt to the player

Declaration
public static event TakeDamageProxy TakeDamageHook
Event Type
Type Description
TakeDamageProxy
Remarks

HeroController.TakeDamage

| Edit this page View Source

TakeHealthHook

Called when health is taken from the player

Declaration
public static event TakeHealthProxy TakeHealthHook
Event Type
Type Description
TakeHealthProxy
Remarks

HeroController.TakeHealth

Extension Methods

ReflectionUtilities.ReflectCallMethod(object, string, object[], BindingFlags)
ReflectionUtilities.ReflectGetField(object, string, BindingFlags)
ReflectionUtilities.ReflectGetMethod(object, string, BindingFlags)
ReflectionUtilities.ReflectGetProperty(object, string, BindingFlags)
ReflectionUtilities.ReflectSetField(object, string, object, BindingFlags)
ReflectionUtilities.ReflectSetProperty(object, string, object, BindingFlags)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾