Move a lot of EngineWrapper interfaces out of LuprexGameModeBase
This commit is contained in:
@@ -187,58 +187,6 @@ void ALuprexGameModeBase::UpdatePossessedTangible() {
|
||||
}
|
||||
}
|
||||
|
||||
UlxLuaValues *ALuprexGameModeBase::LuaCallEnd(AccessKind kind, int64 place_id) {
|
||||
std::string_view datapk = LuaCallBuffer.view();
|
||||
FlxLockedWrapper w(LockableWrapper);
|
||||
if (place_id == 0) place_id = w.GetActor();
|
||||
uint32_t retpklen;
|
||||
const char *retpk;
|
||||
w->play_access(w.Get(), kind, place_id, datapk.size(), datapk.data(), &retpklen, &retpk);
|
||||
if (kind == AccessKind::PROBE_LUA_CALL)
|
||||
{
|
||||
UlxLuaValues *Result = NewObject<UlxLuaValues>(this);
|
||||
Result->Initialize(std::string_view(retpk, retpklen));
|
||||
return Result;
|
||||
}
|
||||
else return nullptr;
|
||||
}
|
||||
|
||||
UlxLuaValues *ALuprexGameModeBase::LuaCallEnd(AccessKind kind) {
|
||||
return LuaCallEnd(kind, int64(0));
|
||||
}
|
||||
|
||||
UlxLuaValues *ALuprexGameModeBase::LuaCallEnd(AccessKind kind, AActor *place) {
|
||||
if (place == nullptr) {
|
||||
return LuaCallEnd(kind, int64(0));
|
||||
} else {
|
||||
UlxTangible *tan = UlxTangible::GetActorTangibleOrLog(place);
|
||||
if (tan == nullptr) {
|
||||
return NewObject<UlxLuaValues>(this);
|
||||
} else {
|
||||
return LuaCallEnd(kind, tan->TangibleId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FString ALuprexGameModeBase::ValidateLuaExpr(const FString &Code)
|
||||
{
|
||||
FTCHARToUTF8 UCode(*Code);
|
||||
FlxLockedWrapper w(LockableWrapper);
|
||||
uint32_t retpklen;
|
||||
const char *retpk;
|
||||
w->play_access(w.Get(), AccessKind::VALIDATE_LUA_EXPR, 0, UCode.Length(), UCode.Get(), &retpklen, &retpk);
|
||||
FString Result(retpklen, (const UTF8CHAR*)retpk);
|
||||
return Result;
|
||||
}
|
||||
|
||||
void ALuprexGameModeBase::InvokeLuaExpr(const FString &Code)
|
||||
{
|
||||
FTCHARToUTF8 UCode(*Code);
|
||||
FlxLockedWrapper w(LockableWrapper);
|
||||
uint32_t retpklen;
|
||||
const char *retpk;
|
||||
w->play_access(w.Get(), AccessKind::INVOKE_LUA_EXPR, 0, UCode.Length(), UCode.Get(), &retpklen, &retpk);
|
||||
}
|
||||
|
||||
void ALuprexGameModeBase::OnWorldPreActorTick(UWorld* InWorld, ELevelTick InLevelTick, float deltaseconds)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user