diff --git a/.gitea/issue_template/bug_report.yml b/.gitea/issue_template/bug_report.yml new file mode 100644 index 0000000..72a8d05 --- /dev/null +++ b/.gitea/issue_template/bug_report.yml @@ -0,0 +1,41 @@ +name: Bug Report +about: Report a crash, error, or unexpected behavior +labels: + - bug +body: + - type: dropdown + id: launcher + attributes: + label: Launcher + options: + - WoW.exe (direct) + - VanillaFixes.exe + - Other + default: 0 + validations: + required: true + - type: dropdown + id: platform + attributes: + label: Platform + options: + - Windows + - Linux (Wine) + - macOS (Wine/CrossOver) + default: 0 + validations: + required: true + - type: textarea + id: description + attributes: + label: Bug Report + description: Attach your WeirdUtils DLL(s) and crash log (.txt from Errors/ folder) by dragging them into this box. + value: | + ## What happened? + + ## Steps to reproduce: + + ## Other DLLs loaded (nampower, SuperWoW, UnitXP, etc.): + + validations: + required: true diff --git a/.gitea/issue_template/config.yml b/.gitea/issue_template/config.yml new file mode 100644 index 0000000..8005e32 --- /dev/null +++ b/.gitea/issue_template/config.yml @@ -0,0 +1,2 @@ +blank_issues_enabled: false +contact_links: [] diff --git a/.gitea/issue_template/other.yml b/.gitea/issue_template/other.yml new file mode 100644 index 0000000..4866319 --- /dev/null +++ b/.gitea/issue_template/other.yml @@ -0,0 +1,10 @@ +name: Feature Request / Question +about: Suggest a feature or ask a question +body: + - type: textarea + id: description + attributes: + label: Description + description: What would you like to see, or what question do you have? + validations: + required: true diff --git a/weirdutils_api.h b/weirdutils_api.h new file mode 100644 index 0000000..72e0ed8 --- /dev/null +++ b/weirdutils_api.h @@ -0,0 +1,77 @@ +/* + * weirdutils_api.h - Runtime Module Control API for WeirdUtils + * + * Header-only, no .lib needed. Include this file and call the inline + * wrappers; they resolve the DLL exports at runtime via GetModuleHandleA + * and GetProcAddress. Returns 0 / no-ops if WeirdUtils is not loaded. + * + * Usage: + * #include "weirdutils_api.h" + * + * if (WeirdUtils_IsModuleActive("transmogfix")) + * WeirdUtils_DisableModule("transmogfix"); + */ + +#ifndef WEIRDUTILS_API_H +#define WEIRDUTILS_API_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---- Function pointer typedefs ---- */ + +typedef int (__cdecl *WeirdUtils_IsModuleActiveFn)(const char *name); +typedef int (__cdecl *WeirdUtils_DisableModuleFn)(const char *name); +typedef int (__cdecl *WeirdUtils_DisableAllFn)(void); + +/* ---- DLL auto-discovery ---- */ + +static const char *const WeirdUtils__DllNames[] = { + "weirdutils.dll", + "pngscreenshots.dll", + "transmogfix.dll", + "customassets.dll", + "logsessions.dll", + "healtextfix.dll", + "bigcursor.dll", + "minimapicons.dll", + NULL +}; + +static FARPROC WeirdUtils__Resolve(const char *func_name) { + int i; + for (i = 0; WeirdUtils__DllNames[i] != NULL; ++i) { + HMODULE hMod = GetModuleHandleA(WeirdUtils__DllNames[i]); + if (hMod) { + FARPROC proc = GetProcAddress(hMod, func_name); + if (proc) return proc; + } + } + return NULL; +} + +/* ---- Inline wrappers (no-op if DLL not loaded) ---- */ + +static int WeirdUtils_IsModuleActive(const char *name) { + WeirdUtils_IsModuleActiveFn fn = (WeirdUtils_IsModuleActiveFn)WeirdUtils__Resolve("WeirdUtils_IsModuleActive"); + return fn ? fn(name) : 0; +} + +static int WeirdUtils_DisableModule(const char *name) { + WeirdUtils_DisableModuleFn fn = (WeirdUtils_DisableModuleFn)WeirdUtils__Resolve("WeirdUtils_DisableModule"); + return fn ? fn(name) : 0; +} + +static int WeirdUtils_DisableAll(void) { + WeirdUtils_DisableAllFn fn = (WeirdUtils_DisableAllFn)WeirdUtils__Resolve("WeirdUtils_DisableAll"); + return fn ? fn() : 0; +} + +#ifdef __cplusplus +} +#endif + +#endif /* WEIRDUTILS_API_H */