Lua Console Overhaul in progress

This commit is contained in:
2025-12-09 02:42:13 -05:00
parent a242244f9c
commit 2d1def8dc6
10 changed files with 105 additions and 63 deletions

View File

@@ -5,7 +5,6 @@
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "lpx-enginewrapper.hpp"
#include "ConsoleOutput.h"
#include "StringDecoder.h"
#include "TangibleManager.h"
#include "AssetLookup.h"
@@ -59,11 +58,7 @@ public:
// Set the entire contents of the console output box.
UFUNCTION(BlueprintImplementableEvent, Category = "Luprex|Miscellaneous")
void ConsoleSetOutput(const FString& text);
// This is called by the GUI whenever the user hits enter.
UFUNCTION(BlueprintCallable, Category = "Luprex|Miscellaneous")
void ConsoleSendInput(const FString& text);
void ConsoleAddOutput(const FString& text);
UFUNCTION(BlueprintCallable, Category = "Luprex|Miscellaneous")
int64 GetPlayerId();
@@ -94,7 +89,11 @@ public:
void LookAtChanged();
// Assemble a lua call. To call into lua:
// Assemble a lua call. Note that this is the lowest-level interface.
// These functions are wrapped by the functions in UlxLuaCallLibrary,
// and those in turn are wrapped by the K2Node "LuaInvoke" and "LuaProbe".
//
// At this level, the process of calling Lua is:
//
// * Use LuaCallBegin
// * Get the lua call buffer:
@@ -102,8 +101,7 @@ public:
// - add a function name
// - add function parameters
// * Use LuaCallEnd.
// * Get the lua call result.
// - parse out any return values
// * Process any return values in the UlxLuaValues array.
//
FlxStreamBuffer &LuaCallBegin() { LuaCallBuffer.clear(); return LuaCallBuffer; }
FlxStreamBuffer &LuaCallGetBuffer() { return LuaCallBuffer; }
@@ -112,8 +110,13 @@ public:
UlxLuaValues *LuaCallEnd(AccessKind kind, AActor *place);
void LuaCallClear() { LuaCallBuffer.clear(); }
// Execute a debugging command, typed on the GUI.
void ExecuteDebuggingCommand(FlxLockedWrapper &w, const FString &fs);
// Validate some lua code. Returns an error message.
// If the lua is well-formed, the error message is the
// empty string. The syntax of the code is checked using
// an otherwise empty lua interpreter, so this is purely
// a syntax check.
//
FString LuaValidate(const FString &Code);
// Get the Asset Lookup table.
const UlxAssetLookup *GetAssetLookup() const { return AssetLookup; }
@@ -162,9 +165,6 @@ public:
UPROPERTY(EditAnywhere, Category="Debugging Tools")
ElxLogVerbosity BreakToDebuggerLogVerbosity;
// This stores the entire text currently visible in the console.
FlxConsoleOutput ConsoleOutput;
// The Luprex EngineWrapper, with a Mutex to protect it.
// To access it, construct a FlxLockedWrapper.
FlxLockableWrapper LockableWrapper;