Darktide-Mod-Framework/vmf/scripts
FireSiku 06b23556a3 Implementing new hook system.
Changes includes:
- No longer relies on any globals.
- No longer uses loadstrings, or recreate the hook chain frivolously.
- Adding :before() and :after() which will call the func before and after the function call.
- Added :rawhook() that imitate the old 'back' functionality, by replacing the original function at the "end" of the chain.

- Refactoring to only fetch original function once.
- Refactor to use a single internal _registry table.

- registry.hooks[hook_type] are now using metatable to automatically generate tables.
- Rawhooks now have their own specialized hooks, that will call the original if disabled.
- Make sure rawhooks are limited to one per function.

- No longer has the ability to overwrite hooks. We remove a table lookup from every hook call and make the code more straightforward.
- The functionality of overwriting a hook is not used in any mods. Any code that would require this can simply be written in a better way without bogging down the whole system for everyone.
2018-06-07 18:07:24 -04:00
..
mods/vmf Implementing new hook system. 2018-06-07 18:07:24 -04:00