Rearrange all Blueprint functions into better categories

This commit is contained in:
2024-09-24 18:58:13 -04:00
parent b2aa395c8d
commit 0b7049cf5a
7 changed files with 137 additions and 90 deletions

View File

@@ -6,7 +6,7 @@
#include "IntegrationGameModeBase.h"
#define DEFAULT_BLUEPRINT (TEXT("TangibleStaticMesh"))
#define LOCTEXT_NAMESPACE "Tangible"
#define LOCTEXT_NAMESPACE "Luprex Tangible"
UlxTangible::UlxTangible()
{
@@ -176,42 +176,3 @@ void UlxTangible::SetAutoFinish(AActor *target, const FString &action, const FVe
tan->AnimTracker.SetAutoFinish(action, xyz);
}
void UlxTangible::Assert(bool condition, const FString &message) {
if (!condition) {
FBlueprintExceptionInfo ExceptionInfo(EBlueprintExceptionType::FatalError, FText::FromString(message));
FBlueprintCoreDelegates::ThrowScriptException(FFrame::GetThreadLocalTopStackFrame()->Object, *FFrame::GetThreadLocalTopStackFrame(), ExceptionInfo);
}
}
void UlxTangible::CallFunctionByName(UObject *object, const FString &namepart1, const FString &namepart2, const FString &fallback) {
FString fullname = namepart1 + namepart2;
if (!IsValid(object)) {
const FBlueprintExceptionInfo ExceptionInfo(
EBlueprintExceptionType::FatalError,
LOCTEXT("CallFunctionByName_ObjectIsNotValid", "In CallFunctionByName, object passed in is not valid.")
);
FBlueprintCoreDelegates::ThrowScriptException(FFrame::GetThreadLocalTopStackFrame()->Object, *FFrame::GetThreadLocalTopStackFrame(), ExceptionInfo);
return;
}
UFunction* function = object->FindFunction(FName(*fullname));
if (function == nullptr) {
function = object->FindFunction(FName(*fallback));
if (function == nullptr) {
const FBlueprintExceptionInfo ExceptionInfo(
EBlueprintExceptionType::FatalError,
LOCTEXT("CallFunctionByName_NoSuchFunction", "In CallFunctionByName, cannot find the named function or the fallback function.")
);
FBlueprintCoreDelegates::ThrowScriptException(FFrame::GetThreadLocalTopStackFrame()->Object, *FFrame::GetThreadLocalTopStackFrame(), ExceptionInfo);
return;
}
}
if (function->ParmsSize != 0) {
const FBlueprintExceptionInfo ExceptionInfo(
EBlueprintExceptionType::FatalError,
LOCTEXT("CallFunctionByName_FunctionHasParameters", "CallFunctionByName can only call functions that have no parameters and no return values.")
);
FBlueprintCoreDelegates::ThrowScriptException(FFrame::GetThreadLocalTopStackFrame()->Object, *FFrame::GetThreadLocalTopStackFrame(), ExceptionInfo);
return;
}
object->ProcessEvent(function, nullptr);
}