Progress toward popping up look-at widgets

This commit is contained in:
2025-03-19 16:01:38 -04:00
parent e470c41e77
commit 27be4ce758
9 changed files with 51 additions and 61 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -57,6 +57,11 @@ enum class ElxLogVerbosity : uint8 {
/** Display Duration: How long to display an error message in the game's viewport.
*
* Note: I know it is not traditional to use underscores in Unreal
* identifiers. However, without the underscores, the symbols aren't
* converted to reasonable human-readable names, and that's the whole point
* of this enum.
*
*/
UENUM(BlueprintType)

View File

@@ -114,7 +114,7 @@ void UK2Node_FormatError::CreateCorrectPins()
if (FindPin(DisplayDurationPinName, EGPD_Input) == nullptr) {
UEdGraphPin *P = CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_Byte, StaticEnum<ElxErrorDisplayDuration>(), DisplayDurationPinName);
P->DefaultValue = TEXT("No Show");
P->DefaultValue = TEXT("No_Show");
P->AutogeneratedDefaultValue = P->DefaultValue;
}

View File

@@ -228,37 +228,23 @@ void UlxLuaCallLibrary::LuaCallProbe(UObject *context, AActor *place) {
}
void UlxLuaCallLibrary::InvokeEngioMove(UObject *context, const FString &action, const FVector &xyz, double facing) {
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
FlxStreamBuffer &sb = mode->LuaCallBegin();
sb.write_string("engio");
sb.write_string("move");
sb.write_simple_dynamic_tag(SimpleDynamicTag::STRING);
sb.write_string(action);
sb.write_simple_dynamic_tag(SimpleDynamicTag::VECTOR);
sb.write_fvector(xyz);
sb.write_simple_dynamic_tag(SimpleDynamicTag::NUMBER);
sb.write_double(facing);
mode->LuaCallEnd(InvocationKind::LUA_INVOKE);
}
ELpxSimpleDynamicTag UlxLuaCallLibrary::LuaCallNextResultType(UObject *context) {
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
FlxStreamBuffer &sb = mode->LuaCallGetResult();
if (sb.empty()) return ELpxSimpleDynamicTag::None;
int64_t total_reads = sb.total_reads();
SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
sb.unread_to(total_reads);
switch (tag) {
case SimpleDynamicTag::STRING: return ELpxSimpleDynamicTag::String;
case SimpleDynamicTag::TOKEN: return ELpxSimpleDynamicTag::Name;
case SimpleDynamicTag::NUMBER: return ELpxSimpleDynamicTag::Float;
case SimpleDynamicTag::VECTOR: return ELpxSimpleDynamicTag::Vector;
case SimpleDynamicTag::BOOLEAN: return ELpxSimpleDynamicTag::Boolean;
default: return ELpxSimpleDynamicTag::None;
}
}
// ELpxSimpleDynamicTag UlxLuaCallLibrary::LuaCallNextResultType(UObject *context) {
// ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
// FlxStreamBuffer &sb = mode->LuaCallGetResult();
// if (sb.empty()) return ELpxSimpleDynamicTag::None;
// int64_t total_reads = sb.total_reads();
// SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
// sb.unread_to(total_reads);
// switch (tag) {
// case SimpleDynamicTag::STRING: return ELpxSimpleDynamicTag::String;
// case SimpleDynamicTag::TOKEN: return ELpxSimpleDynamicTag::Name;
// case SimpleDynamicTag::NUMBER: return ELpxSimpleDynamicTag::Float;
// case SimpleDynamicTag::VECTOR: return ELpxSimpleDynamicTag::Vector;
// case SimpleDynamicTag::BOOLEAN: return ELpxSimpleDynamicTag::Boolean;
// default: return ELpxSimpleDynamicTag::None;
// }
// }
/////////////////////////////////////////////////////////////////
//

View File

@@ -128,69 +128,63 @@ public:
// Functions that do miscellaneous things.
//
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static void LuaCallBegin(UObject *context, const FString &ClassName, const FString &FunctionName);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static void LuaCallInvoke(UObject *context, AActor *Place);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static void LuaCallProbe(UObject *context, AActor *Place);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
static void InvokeEngioMove(UObject *context, const FString &action, const FVector &xyz, double facing);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
static ELpxSimpleDynamicTag LuaCallNextResultType(UObject *context);
//
// Functions that pack arguments into the call buffer.
//
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static void LuaCallArgument_string(UObject *context, const FString &Value);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static void LuaCallArgument_name(UObject *context, const FName &Value);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static void LuaCallArgument_float(UObject *context, double Value);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static void LuaCallArgument_int(UObject *context, int Value);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static void LuaCallArgument_vector(UObject *context, const FVector &Value);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static void LuaCallArgument_vector2d(UObject *context, const FVector2D &Value);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static void LuaCallArgument_boolean(UObject *context, bool Value);
//
// Functions that extract return values from the return buffer.
//
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static FString LuaCallReturnValue_string(UObject *context);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static FName LuaCallReturnValue_name(UObject *context);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static double LuaCallReturnValue_float(UObject *context);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static int LuaCallReturnValue_int(UObject *context);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static FVector LuaCallReturnValue_vector(UObject *context);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static FVector2D LuaCallReturnValue_vector2d(UObject *context);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"), Category = "Luprex|Call Lua Function")
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context", BlueprintInternalUseOnly = "true"), Category = "Luprex|Call Lua Function")
static bool LuaCallReturnValue_boolean(UObject *context);
};

View File

@@ -495,7 +495,7 @@ void UK2Node_LuaCall::GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRe
FText UK2Node_LuaCall::GetMenuCategory() const
{
return FEditorCategoryUtils::GetCommonCategory(FCommonEditorCategory::Text);
return FText::FromString(FString(TEXT("Luprex|Lua")));
}

View File

@@ -142,6 +142,7 @@ void UlxTangible::Destroy() {
}
UlxTangible *UlxTangible::GetActorTangibleQuiet(AActor *actor) {
if (actor == nullptr) return nullptr;
UlxTangibleComponent* comp = actor->GetComponentByClass<UlxTangibleComponent>();
if (comp == nullptr) return nullptr;
return comp->Tangible.Get();
@@ -150,7 +151,11 @@ UlxTangible *UlxTangible::GetActorTangibleQuiet(AActor *actor) {
UlxTangible *UlxTangible::GetActorTangibleOrLog(AActor *actor) {
UlxTangible *tan = GetActorTangibleQuiet(actor);
if (tan == nullptr) {
UE_LOG(LogBlueprint, Error, TEXT("Not a luprex tangible: %s"), *actor->GetName());
if (actor == nullptr) {
UE_LOG(LogBlueprint, Error, TEXT("Not a luprex tangible: passed in a null pointer"));
} else {
UE_LOG(LogBlueprint, Error, TEXT("Not a luprex tangible: %s"), *actor->GetName());
}
}
return tan;
}