Skip to content

Commit 1b2b081

Browse files
committed
New macros
TODO: .externalcfgs in AMLMods = AMLMods/_game_/configs
1 parent c214a75 commit 1b2b081

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobject appContext;
5252
JNIEnv* env;
5353

5454
// Main
55-
static ModInfo modinfoLocal("net.rusjj.aml", "AML Core", "1.3.0", "RusJJ aka [-=KILL MAN=-]");
55+
static ModInfo modinfoLocal("net.rusjj.aml", "AML Core", "1.3.1", "RusJJ aka [-=KILL MAN=-]");
5656
ModInfo* amlmodinfo = &modinfoLocal;
5757
static Config cfgLocal("ModLoaderCore");
5858
Config* cfg = &cfgLocal;

mod/amlmod.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
static Config cfgLocal(#_guid); \
4242
Config* cfg = &cfgLocal;
4343

44+
#define MYMODCFGNAME(_guid, _name, _version, _author, _cfgname) \
45+
MYMOD(_guid, _name, _version, _author); \
46+
static Config cfgLocal(#_cfgname); \
47+
Config* cfg = &cfgLocal;
48+
4449
#define NEEDGAME(_pkg_name) \
4550
extern "C" const char* __INeedASpecificGame() {return #_pkg_name;}
4651

@@ -61,9 +66,31 @@
6166
{"", ""} }; \
6267
extern "C" ModInfoDependency* __GetDepsList() { return &g_listDependencies[0]; }
6368

69+
/* Macros to stop forgetting stuff! */
70+
#define ON_MOD_PRELOAD() \
71+
extern "C" void OnModPreLoad()
72+
73+
#define ON_MOD_LOAD() \
74+
extern "C" void OnModLoad()
75+
76+
#define ON_ALL_MODS_LOAD() \
77+
extern "C" void OnAllModsLoaded()
78+
79+
#define ON_MOD_UNLOAD() \
80+
extern "C" void OnModUnload() /*Not guaranteed*/
81+
82+
#define ON_GAME_CRASH() \
83+
extern "C" void OnGameCrash(const char* library, int sig, int code, uintptr_t libaddr, mcontext_t* mcontext) /*Not guaranteed*/
84+
85+
#define UPDATER_URL() \
86+
extern "C" const char* OnUpdaterURLRequested()
87+
88+
#define ON_NEW_INTERFACE() \
89+
extern "C" void OnInterfaceAdded(const char* name, const void* ptr)
90+
6491

6592

66-
#define MINIMUM_MD5_BUF_SIZE 33
93+
#define MINIMUM_MD5_BUF_SIZE ( 32 + 1 )
6794

6895
struct MemChunk_t
6996
{

0 commit comments

Comments
 (0)