More work on the LuaCall interface

This commit is contained in:
2024-09-04 23:15:13 -04:00
parent 8c75a5f826
commit ede234fc8a
5 changed files with 37 additions and 49 deletions

View File

@@ -46,15 +46,22 @@ public:
// Assemble a lua call. To call into lua:
//
// * Use LuaCallBegin
// * Get the lua call buffer.
// * Add a class name and a function name to the buffer.
// * Add parameters to the buffer.
// * Use LuaCallInvoke.
// * Get the lua call buffer:
// - add a class name
// - add a function name
// - add function parameters
// * Use LuaCallEnd.
// * Get the lua call result.
// - parse out any return values
//
void LuaCallBegin() { LuaCallBuffer.clear(); }
FlxStreamBuffer &LuaCallBegin() { LuaCallBuffer.clear(); return LuaCallBuffer; }
FlxStreamBuffer &LuaCallGetBuffer() { return LuaCallBuffer; }
void LuaCallInvoke(AActor *place);
void LuaCallEnd(InvocationKind kind);
void LuaCallEnd(InvocationKind kind, int64 place_id);
void LuaCallEnd(InvocationKind kind, AActor *place);
FlxStreamBuffer &LuaCallGetResult() { return LuaCallResult; }
void LuaCallClear() { LuaCallBuffer.clear(); LuaCallResult.clear(); }
// Execute a debugging command, typed on the GUI.
void ExecuteDebuggingCommand(FlxLockedWrapper &w, const FString &fs);
@@ -89,6 +96,7 @@ public:
// The Lua Call assembly buffer.
FlxStreamBuffer LuaCallBuffer;
FlxStreamBuffer LuaCallResult;
// This utility runs the luprex update and socket update in a thread.
FTriggeredTask LuprexUpdateTask;