Adding to debug - TheMulhima/HollowKnight.DebugMod GitHub Wiki
Here, we'll try our best to explain how to add your own items to debug! For more examples, see this file.
- Reference DebugMod.dll from mods folder (Note: if you follow steps here, the mod won't fail to load if debug isn't present)
- In the mod's initialize add this code to check if debug exists:
if (AppDomain.CurrentDomain.GetAssemblies().Select(theName => theName.GetName().Name).Contains("DebugMod"))
{
AddStuffToDebug();
};
- In the
AddStuffToDebugfunction, add the code to make stuff appear in Debug.
- Construct a public class that has a
public staticfunction for each of the keys you wanna add. These functions must be annotated with[BindableMethod(name = "name", category = "cat")]. - In the
AddStuffToDebugfunction add this line:
DebugMod.DebugMod.AddToKeyBindList(typeof(TheClassYouMadeinStep1));
- In
AddStuffToDebugAdd this line to register a button in the top menu that when pressed, will expand a panel
DebugMod.TopMenu.AddNewMenuToTopMenu(MenuName);
- To add buttons to the panel, you have 2 options, Add Text buttons or add image buttons
- To add text buttons do
DebugMod.TopMenu.AddTextToMenuButton(MenuName, buttonName, Unity<string> OnClikedFunction, Y_Pos);. For reference, all text panels in debug use Y_Pos 30, 60, 90.... and so on. Max shouldn't be bigger than 357 - To add image buttons call on
DebugMod.TopMenu.AddImageToMenuButton();. For a guide on how to use this, see how it is done in Debug Item Panel