Closed Derpius closed 2 years ago
How much detail should be in the extension register list? Name, author, init function or just name and init function? Should VisTrace provide a macro in the include/vistrace.h
file? I was thinking something like this:
#include "vistrace.h"
#include "gmod module base"
LUA_FUNCTION(Init) {
// do init stuff
}
GMOD_MODULE_OPEN() {
VISTRACE_REGISTER_EXTENSION("My Extension", Init)
}
Can simply be a macro that replaces GMOD_MODULE_OPEN
VISTRACE_EXTENSION_OPEN(My Extension) {}
VISTRACE_EXTENSION_CLOSE() {}
I’m gonna be working on this now though so
Is your feature request related to a problem? Please describe. At the moment extensions need to be loaded in a specific order with vistrace to get initialised via the hook.
A more robust method is to add a vistrace.RegisterExtension function that adds init funcs to a list, then on init calls them. If already initialised it would call immediately.
This would also let you see what extensions are loaded