Move a lot of EngineWrapper interfaces out of LuprexGameModeBase

This commit is contained in:
2026-02-14 03:35:08 -05:00
parent d046ef8161
commit 2eacc12cad
10 changed files with 155 additions and 165 deletions

View File

@@ -83,3 +83,42 @@ StringViewVec FlxLockedWrapper::GetAnimationQueues(IdView ids) {
}
return result;
}
ElxLuaSyntaxCheck FlxLockedWrapper::ValidateLuaExpr(const FString &Code, FString &ErrorMessage) {
FTCHARToUTF8 UCode(*Code);
uint32_t retpklen;
const char *retpk;
Lockable.Wrapper.play_access(Get(), AccessKind::VALIDATE_LUA_EXPR, 0, UCode.Length(), UCode.Get(), &retpklen, &retpk);
ErrorMessage = FString(retpklen, (const UTF8CHAR*)retpk);
if (ErrorMessage.IsEmpty())
return ElxLuaSyntaxCheck::ValidLua;
if (ErrorMessage == TEXT("slash command"))
return ElxLuaSyntaxCheck::SlashCommand;
if (ErrorMessage == TEXT("white space"))
return ElxLuaSyntaxCheck::Whitespace;
if (ErrorMessage == TEXT("truncated lua"))
return ElxLuaSyntaxCheck::TruncatedLua;
return ElxLuaSyntaxCheck::InvalidLua;
}
void FlxLockedWrapper::ProbeLuaFunction(std::string_view datapk, int64 place_id, TFunction<void(std::string_view)> OnResult) {
if (place_id == 0) place_id = GetActor();
uint32_t retpklen;
const char *retpk;
Lockable.Wrapper.play_access(Get(), AccessKind::PROBE_LUA_CALL, place_id, datapk.size(), datapk.data(), &retpklen, &retpk);
OnResult(std::string_view(retpk, retpklen));
}
void FlxLockedWrapper::InvokeLuaFunction(std::string_view datapk, int64 place_id) {
if (place_id == 0) place_id = GetActor();
uint32_t retpklen;
const char *retpk;
Lockable.Wrapper.play_access(Get(), AccessKind::INVOKE_LUA_CALL, place_id, datapk.size(), datapk.data(), &retpklen, &retpk);
}
void FlxLockedWrapper::InvokeLuaExpr(const FString &Code) {
FTCHARToUTF8 UCode(*Code);
uint32_t retpklen;
const char *retpk;
Lockable.Wrapper.play_access(Get(), AccessKind::INVOKE_LUA_EXPR, 0, UCode.Length(), UCode.Get(), &retpklen, &retpk);
}