Giter Site home page Giter Site logo

debugmenu_mh's Introduction

debugmenu_mh

image

It's a port of aap's debug menu for Manhunt, useful thing in terms of convenience. Adds simple gui for various things (almost like imgui).

How to install

Put debugmenu.dll for your game into the game's root directory. Plugins that make use of it will load it so DON'T rename the file.

How to control

  • Ctrl-M toggles the debug menu
  • Arrow Up/Down moves the selection
  • Enter/Backspace enters/exists a submenu
  • Arrow Left/Right changes values/executes commands
  • the mouse is pretty intuitive

How to use (for programmers)

Include debugmenu_public.h in your plugin, define 'DebugMenuAPI gDebugMenuAPI' globally somewhere and load the debugmenu.dll by calling 'bool DebugMenuLoad(void)', which loads all function pointers and returns whether the library could be loaded. NB: it is NOT recommended to do this from DllMain. Hook an early function and do it from there!

Integer variables can be added to the menu with functions of this type:

MenuEntry *DebugMenuAdd(const char *path, const char *name, INT *ptr, TriggerFunc triggerFunc, INT step, INT lowerBound, INT upperBound, const char **strings)

where INT stands for all common integer types. Path is a path in the menu in the form "menu|submenu1|submenu2", name is the name of the entry you want to add. Ptr is a pointer to the variable, triggerFunc is a function that is called when the value was changed (can be NULL). Step, lowerBound and upperBound control how the variable's value is changed. Strings is an array of strings that are displayed instead of the numbers (for enums). DebugMenuAddVarBool8/16/32 is provided for convenience, but just calls the respective INT function.

MenuEntry *DebugMenuAdd(const char *path, const char *name, FLOAT *ptr, TriggerFunc triggerFunc, FLOAT step, FLOAT lowerBound, FLOAT upperBound) Similarly adds floats and doubles but you can't display strings with them.

MenuEntry *DebugMenuAddCmd(const char *path, const char *name, TriggerFunc triggerFunc) registers a function that is called from the menu, no values are changed.

void DebugMenuEntrySetWrap(MenuEntry *e, bool wrap) sets whether values should wrap around at the ends. (when e == NULL, this does nothing)

void DebugMenuEntrySetStrings(MenuEntry *e, const char **strings) changes the strings for a variable. (when e == NULL, this does nothing)

debugmenu_mh's People

Contributors

aap avatar fire-head avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.