-
Notifications
You must be signed in to change notification settings - Fork 7
CLEO 5 SDK
BOOL WINAPI CLEO_RegisterOpcode(WORD opcode, _pOpcodeHandler callback);
Registers a custom CLEO opcode with the specified opcode value and handler function.
CRunningScript* WINAPI CLEO_CreateCustomScript(CRunningScript* fromThread, const char* script_name, int label);
Creates a custom script thread.
CRunningScript* WINAPI CLEO_GetLastCreatedCustomScript();
Returns the last created custom script thread.
void WINAPI CLEO_AddScriptDeleteDelegate(FuncScriptDeleteDelegateT func);
Adds a script deletion delegate function.
void WINAPI CLEO_RemoveScriptDeleteDelegate(FuncScriptDeleteDelegateT func);
Removes a script deletion delegate function.
void WINAPI CLEO_GetScriptInfoStr(CRunningScript* thread, bool currLineInfo, char* buf, DWORD bufSize);
Retrieves information about the script for error and log messages.
eCLEO_Version WINAPI CLEO_GetScriptVersion(const CRunningScript* thread);
Returns the CLEO version used for a specific script, considering compatibility mode.
void WINAPI CLEO_SetThreadCondResult(CRunningScript* thread, BOOL result);
Sets the condition result for a script thread.
void WINAPI CLEO_ThreadJumpAtLabelPtr(CRunningScript* thread, int labelPtr);
Jumps to a specific label in a script thread.
extern SCRIPT_VAR* opcodeParams;
extern SCRIPT_VAR* missionLocals;
External variables to access opcode parameters and mission-local variables.
eDataType WINAPI CLEO_GetOperandType(const CRunningScript* thread);
Peeks at the parameter data type in a script thread.
DWORD WINAPI CLEO_GetVarArgCount(CRunningScript* thread);
Peeks at the count of variable arguments in a script thread.
SCRIPT_VAR* WINAPI CLEO_GetPointerToScriptVariable(CRunningScript* thread);
Returns a pointer to the variable data in a script thread, advancing the script to the next parameter.
void WINAPI CLEO_RetrieveOpcodeParams(CRunningScript* thread, int count);
Reads and stores multiple parameters in the opcodeParams array.
DWORD WINAPI CLEO_GetIntOpcodeParam(CRunningScript* thread);
Retrieves an integer parameter from a script thread.
float WINAPI CLEO_GetFloatOpcodeParam(CRunningScript* thread);
Retrieves a floating-point parameter from a script thread.
LPSTR WINAPI CLEO_ReadStringOpcodeParam(CRunningScript* thread, char* buf = nullptr, int bufSize = 0);
Reads a string parameter from a script thread.
LPSTR WINAPI CLEO_ReadStringPointerOpcodeParam(CRunningScript* thread, char* buf = nullptr, int bufSize = 0);
Reads a string parameter from a script thread, exactly the same as CLEO_ReadStringOpcodeParam.
char* WINAPI CLEO_ReadParamsFormatted(CRunningScript* thread, const char* format, char* buf = nullptr, int bufSize = 0);
Consumes all variable-argument parameters in a script thread based on a format and stores them in a buffer.
void WINAPI CLEO_SkipOpcodeParams(CRunningScript* thread, int count);
Skips a specified number of parameters in a script thread without reading them.
void WINAPI CLEO_SkipUnusedVarArgs(CRunningScript* thread);
Skips any unused variable arguments for var-args opcodes.
void WINAPI CLEO_RecordOpcodeParams(CRunningScript* thread, int count);
Writes multiple parameters from the opcodeParams array.
void WINAPI CLEO_SetIntOpcodeParam(CRunningScript* thread, DWORD value);
Sets an integer parameter.
void WINAPI CLEO_SetFloatOpcodeParam(CRunningScript* thread, float value);
Sets a floating-point parameter.
void WINAPI CLEO_WriteStringOpcodeParam(CRunningScript* thread, const char* str);
Writes a string parameter.
BOOL WINAPI CLEO_GetScriptDebugMode(const CRunningScript* thread);
Checks if debug mode features are enabled for a script.
void WINAPI CLEO_SetScriptDebugMode(CRunningScript* thread, BOOL enabled);
Enables or disables debug mode for a script.
DWORD WINAPI CLEO_GetVersion();
Returns the version of the CLEO plugin.
eGameVersion WINAPI CLEO_GetGameVersion();
Returns the game version for which CLEO is configured.
DWORD WINAPI CLEO_GetScriptTextureById(CRunningScript* thread, int id);
Retrieves a script texture by ID.
HSTREAM WINAPI CLEO_GetInternalAudioStream(CRunningScript* thread, DWORD stream);
Gets an internal audio stream.
void WINAPI CLEO_Log(eLogLevel level, const char* msg);
Adds a message to the log with the specified log level.
void WINAPI CLEO_RegisterCallback(eCallbackId id, void* func);
Registers a callback function for a specific event identified by eCallbackId.
void WINAPI CLEO_ResolvePath(CRunningScript* thread, char* inOutPath, DWORD pathMaxLen);
Converts a path to an absolute file system path.