39 #define TSC_NAME_TO_HEX(A,B,C) (int(A) | (int(B) << 8) | (int(C) << 16))
53 typedef void(*
TSCRunFunc)(
int& x,
int& y,
int& z,
int& w,
bool& bExit,
int& iError);
119 mDesc = strdup(pDesc);
149 CSM_LogError(
"Mod/TextScript",
"Failed to register TextScript command <%.3s!", walk->mCommand);
159 #ifdef _TEXT_SCRIPT_FILE_
168 #define DEFINE_TEXTSCRIPT_COMMAND(NAMEA, NAMEB, NAMEC, SHORTHAND_DESC, DESC, ARGS) \
169 extern void __declspec(dllexport) __##NAMEA##NAMEB##NAMEC##__RUNFUNC__(int& x, int& y, int& z, int& w, bool& bExit, int& iError);\
170 static ModTextScriptCommand __CMD_##NAMEA##NAMEB##NAMEC##(&__##NAMEA##NAMEB##NAMEC##__RUNFUNC__, #@NAMEA, #@NAMEB, #@NAMEC, SHORTHAND_DESC, DESC, ARGS);\
171 void __##NAMEA##NAMEB##NAMEC##__RUNFUNC__(int& x, int& y, int& z, int& w, bool& bExit, int& iError)
173 #define TGetMyChar (*gCurrentPtrData.Char)
174 #define TGetGameFlags (*gCurrentPtrData.GameFlags)
175 #define TGetPlayer gCurrentPtrData.Player
176 #define TGetClient gCurrentPtrData.Client
177 #define TGetKey (*gCurrentPtrData.Key)
178 #define TGetKeyTrg (*gCurrentPtrData.KeyTrg)
Automatically sets up every textscript command in the mod after calling ModTextScriptCommand::Init().
Definition: ModTextScriptCommand.h:43
TSCRunFunc mExecute
Execute function.
Definition: ModTextScriptCommand.h:69
char * mArguments
This command's arguments.
Definition: ModTextScriptCommand.h:87
char * mShortDesc
This command's shorthand descriptor.
Definition: ModTextScriptCommand.h:79
ModTextScriptCommand()
Blank constructor, for sorted bin list.
Definition: ModTextScriptCommand.h:93
char mCommand[4]
This command's identifier.
Definition: ModTextScriptCommand.h:75
void(* TSCRunFunc)(int &x, int &y, int &z, int &w, bool &bExit, int &iError)
Run a TextScriptCommand object's code.
Definition: ModTextScriptCommand.h:53
char * mDesc
This command's descriptor.
Definition: ModTextScriptCommand.h:83
CAVESTORY_MOD_API BOOL CSM_RegisterTextScriptCommand(const char *pCmdName, const char *pShortDesc, const char *pDesc, const char *pArgs, void(*pFuncPtr)(int &, int &, int &, int &, bool &, int &))
Register a textscript command.
#define CSM_LogError(pCategory, pFormat,...)
Log an error message to the console & to the log file (if one is open).
Definition: CSMAPI_functions.h:110
static void Init()
Initialize the text script commands.
Definition: ModTextScriptCommand.h:142
~ModTextScriptCommand()
Deconstructor.
Definition: ModTextScriptCommand.h:128