Working on look-at Widgets, not done yet.

This commit is contained in:
2025-03-17 15:35:51 -04:00
parent c9fd224a38
commit 6b8c86a03c
7 changed files with 107 additions and 60 deletions

View File

@@ -204,7 +204,7 @@ FString UlxLuaCallLibrary::AllFunctionsWithPrefix(const TCHAR *Prefix)
/////////////////////////////////////////////////////////////////
void UlxLuaCallLibrary::LuaCallBegin(UObject *context, const FString &cname, const FString &fname) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetBuffer();
mode->LuaCallBegin();
sb.write_string(cname);
@@ -213,7 +213,7 @@ void UlxLuaCallLibrary::LuaCallBegin(UObject *context, const FString &cname, con
void UlxLuaCallLibrary::LuaCallInvoke(UObject *context, AActor *place) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetBuffer();
CheckNotEmpty(sb);
mode->LuaCallEnd(InvocationKind::LUA_INVOKE, place);
@@ -221,7 +221,7 @@ void UlxLuaCallLibrary::LuaCallInvoke(UObject *context, AActor *place) {
void UlxLuaCallLibrary::LuaCallProbe(UObject *context, AActor *place) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetBuffer();
CheckNotEmpty(sb);
mode->LuaCallEnd(InvocationKind::LUA_PROBE, place);
@@ -229,7 +229,7 @@ void UlxLuaCallLibrary::LuaCallProbe(UObject *context, AActor *place) {
void UlxLuaCallLibrary::InvokeEngioMove(UObject *context, const FString &action, const FVector &xyz, double facing) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallBegin();
sb.write_string("engio");
sb.write_string("move");
@@ -244,7 +244,7 @@ void UlxLuaCallLibrary::InvokeEngioMove(UObject *context, const FString &action,
ELpxSimpleDynamicTag UlxLuaCallLibrary::LuaCallNextResultType(UObject *context) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetResult();
if (sb.empty()) return ELpxSimpleDynamicTag::None;
int64_t total_reads = sb.total_reads();
@@ -267,7 +267,7 @@ ELpxSimpleDynamicTag UlxLuaCallLibrary::LuaCallNextResultType(UObject *context)
/////////////////////////////////////////////////////////////////
void UlxLuaCallLibrary::LuaCallArgument_string(UObject *context, const FString &pstring) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetBuffer();
CheckNotEmpty(sb);
sb.write_simple_dynamic_tag(SimpleDynamicTag::STRING);
@@ -281,7 +281,7 @@ void UlxLuaCallLibrary::LuaCallArgument_name(UObject *context, const FName &pnam
if ((tokvalue == 0) && !namestr.empty()) {
FatalBlueprintError(TEXT("Names passed to lua must be short, and must contain only lowercase and digits"));
}
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetBuffer();
CheckNotEmpty(sb);
sb.write_simple_dynamic_tag(SimpleDynamicTag::TOKEN);
@@ -289,7 +289,7 @@ void UlxLuaCallLibrary::LuaCallArgument_name(UObject *context, const FName &pnam
}
void UlxLuaCallLibrary::LuaCallArgument_float(UObject *context, double pfloat) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetBuffer();
CheckNotEmpty(sb);
sb.write_simple_dynamic_tag(SimpleDynamicTag::NUMBER);
@@ -297,7 +297,7 @@ void UlxLuaCallLibrary::LuaCallArgument_float(UObject *context, double pfloat) {
}
void UlxLuaCallLibrary::LuaCallArgument_int(UObject *context, int value) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetBuffer();
CheckNotEmpty(sb);
sb.write_simple_dynamic_tag(SimpleDynamicTag::NUMBER);
@@ -305,7 +305,7 @@ void UlxLuaCallLibrary::LuaCallArgument_int(UObject *context, int value) {
}
void UlxLuaCallLibrary::LuaCallArgument_vector(UObject *context, const FVector &pvector) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetBuffer();
CheckNotEmpty(sb);
sb.write_simple_dynamic_tag(SimpleDynamicTag::VECTOR);
@@ -313,7 +313,7 @@ void UlxLuaCallLibrary::LuaCallArgument_vector(UObject *context, const FVector &
}
void UlxLuaCallLibrary::LuaCallArgument_vector2d(UObject *context, const FVector2D &pvector) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetBuffer();
CheckNotEmpty(sb);
sb.write_simple_dynamic_tag(SimpleDynamicTag::VECTOR);
@@ -323,7 +323,7 @@ void UlxLuaCallLibrary::LuaCallArgument_vector2d(UObject *context, const FVector
}
void UlxLuaCallLibrary::LuaCallArgument_boolean(UObject *context, bool pbool) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetBuffer();
CheckNotEmpty(sb);
sb.write_simple_dynamic_tag(SimpleDynamicTag::BOOLEAN);
@@ -339,7 +339,7 @@ void UlxLuaCallLibrary::LuaCallArgument_boolean(UObject *context, bool pbool) {
FString UlxLuaCallLibrary::LuaCallReturnValue_string(UObject *context) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetResult();
SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
if (tag != SimpleDynamicTag::STRING) FatalBlueprintError(TEXT("expected lua to return a string"));
@@ -347,7 +347,7 @@ FString UlxLuaCallLibrary::LuaCallReturnValue_string(UObject *context) {
}
FName UlxLuaCallLibrary::LuaCallReturnValue_name(UObject *context) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetResult();
SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
if (tag != SimpleDynamicTag::TOKEN) FatalBlueprintError(TEXT("expected lua to return a name"));
@@ -355,7 +355,7 @@ FName UlxLuaCallLibrary::LuaCallReturnValue_name(UObject *context) {
}
double UlxLuaCallLibrary::LuaCallReturnValue_float(UObject *context) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetResult();
SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
if (tag != SimpleDynamicTag::NUMBER) FatalBlueprintError(TEXT("expected lua to return a float"));
@@ -363,7 +363,7 @@ double UlxLuaCallLibrary::LuaCallReturnValue_float(UObject *context) {
}
int UlxLuaCallLibrary::LuaCallReturnValue_int(UObject *context) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetResult();
SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
if (tag != SimpleDynamicTag::NUMBER) FatalBlueprintError(TEXT("expected lua to return a number"));
@@ -371,7 +371,7 @@ int UlxLuaCallLibrary::LuaCallReturnValue_int(UObject *context) {
}
FVector UlxLuaCallLibrary::LuaCallReturnValue_vector(UObject *context) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetResult();
SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
if (tag != SimpleDynamicTag::VECTOR) FatalBlueprintError(TEXT("expected lua to return a vector"));
@@ -379,7 +379,7 @@ FVector UlxLuaCallLibrary::LuaCallReturnValue_vector(UObject *context) {
}
FVector2D UlxLuaCallLibrary::LuaCallReturnValue_vector2d(UObject *context) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetResult();
SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
if (tag != SimpleDynamicTag::VECTOR) FatalBlueprintError(TEXT("expected lua to return a vector"));
@@ -388,7 +388,7 @@ FVector2D UlxLuaCallLibrary::LuaCallReturnValue_vector2d(UObject *context) {
}
bool UlxLuaCallLibrary::LuaCallReturnValue_boolean(UObject *context) {
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetFromContext(context);
AIntegrationGameModeBase *mode = AIntegrationGameModeBase::GetLuprexGameMode(context);
FlxStreamBuffer &sb = mode->LuaCallGetResult();
SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
if (tag != SimpleDynamicTag::BOOLEAN) FatalBlueprintError(TEXT("expected lua to return a boolean"));