diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-11 22:46:43 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-11 22:46:43 +0100 |
commit | 8a33725513d7dae6a0be3b8366976e17661d2e2e (patch) | |
tree | 869a005f794bd4dbbdffcb9313d9d5debe5f8d2a /NorthstarDedicatedTest/concommand.h | |
parent | bd4119d0d70567325e7e979a3305f6d631c98dad (diff) | |
download | NorthstarLauncher-8a33725513d7dae6a0be3b8366976e17661d2e2e.tar.gz NorthstarLauncher-8a33725513d7dae6a0be3b8366976e17661d2e2e.zip |
add proper map autocompletes and maps command
Diffstat (limited to 'NorthstarDedicatedTest/concommand.h')
-rw-r--r-- | NorthstarDedicatedTest/concommand.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/concommand.h b/NorthstarDedicatedTest/concommand.h index 90eb5b01..ca78381b 100644 --- a/NorthstarDedicatedTest/concommand.h +++ b/NorthstarDedicatedTest/concommand.h @@ -72,6 +72,19 @@ inline const char* CCommand::operator[](int nIndex) const return Arg(nIndex); } +//----------------------------------------------------------------------------- +// Called when a ConCommand needs to execute +//----------------------------------------------------------------------------- +typedef void (*FnCommandCallback_t)(const CCommand& command); + +#define COMMAND_COMPLETION_MAXITEMS 64 +#define COMMAND_COMPLETION_ITEM_LENGTH 128 + +//----------------------------------------------------------------------------- +// Returns 0 to COMMAND_COMPLETION_MAXITEMS worth of completion strings +//----------------------------------------------------------------------------- +typedef int (*FnCommandCompletionCallback)(const char* partial, char commands[COMMAND_COMPLETION_MAXITEMS][COMMAND_COMPLETION_ITEM_LENGTH]); + // From r5reloaded class ConCommandBase { @@ -113,8 +126,8 @@ class ConCommand : public ConCommandBase void Init(void); bool IsCommand(void) const; - void* m_pCommandCallback {}; // 0x0040 <- starts from 0x40 since we inherit ConCommandBase. - void* m_pCompletionCallback {}; // 0x0048 <- defaults to sub_180417410 ('xor eax, eax'). + FnCommandCallback_t m_pCommandCallback {}; // 0x0040 <- starts from 0x40 since we inherit ConCommandBase. + FnCommandCompletionCallback m_pCompletionCallback {}; // 0x0048 <- defaults to sub_180417410 ('xor eax, eax'). int m_nCallbackFlags {}; // 0x0050 char pad_0054[4]; // 0x0054 int unk0; // 0x0058 |