从master分支拉取puerts,并拉取v8制品,修改puerts插件部分UE5_5以下兼容的宏代码。保证puerts编译通过。包括
CSharpParamDefaultValueMetas.cs和ubtplugin.csproj和declarationGenerator.cpp和PropertyTranslator.cpp对UserDefinedStruct.h的引用
This commit is contained in:
@@ -28,11 +28,12 @@
|
||||
#include "Widgets/Notifications/SNotificationList.h"
|
||||
// #include "Misc/MessageDialog.h"
|
||||
#include "Framework/MultiBox/MultiBoxBuilder.h"
|
||||
#include "Engine/UserDefinedStruct.h"
|
||||
#include "StructUtils/UserDefinedStruct.h"
|
||||
#include "Engine/UserDefinedEnum.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "CodeGenerator.h"
|
||||
#include "JSClassRegister.h"
|
||||
#include "UECompatible.h"
|
||||
#include "Engine/CollisionProfile.h"
|
||||
#if (ENGINE_MAJOR_VERSION >= 5)
|
||||
#include "ToolMenus.h"
|
||||
@@ -1089,7 +1090,10 @@ void FTypeScriptDeclarationGenerator::GatherExtensions(UStruct* Struct, FStringB
|
||||
while (PropertyInfo && PropertyInfo->Name && PropertyInfo->Type)
|
||||
{
|
||||
if (Struct->FindPropertyByName(UTF8_TO_TCHAR(PropertyInfo->Name)))
|
||||
{
|
||||
++PropertyInfo;
|
||||
continue;
|
||||
}
|
||||
Buff << " " << PropertyInfo->Name << ": " << GetNamePrefix(PropertyInfo->Type) << PropertyInfo->Type->Name()
|
||||
<< ";\n";
|
||||
++PropertyInfo;
|
||||
@@ -1366,7 +1370,6 @@ void FTypeScriptDeclarationGenerator::GenEnum(UEnum* Enum)
|
||||
|
||||
void FTypeScriptDeclarationGenerator::GenStruct(UStruct* Struct)
|
||||
{
|
||||
#include "ExcludeStructs.h"
|
||||
FStringBuffer StringBuffer{"", ""};
|
||||
const FString SafeStructName =
|
||||
Struct->IsNative() ? SafeName(Struct->GetName()) : PUERTS_NAMESPACE::FilenameToTypeScriptVariableName(Struct->GetName());
|
||||
@@ -1396,6 +1399,31 @@ void FTypeScriptDeclarationGenerator::GenStruct(UStruct* Struct)
|
||||
|
||||
auto GenConstrutor = [&]()
|
||||
{
|
||||
auto ClassDefinition = PUERTS_NAMESPACE::FindClassByType(Struct);
|
||||
if (ClassDefinition && ClassDefinition->ConstructorInfos)
|
||||
{
|
||||
PUERTS_NAMESPACE::NamedFunctionInfo* ConstructorInfo = ClassDefinition->ConstructorInfos;
|
||||
while (ConstructorInfo && ConstructorInfo->Name && ConstructorInfo->Type)
|
||||
{
|
||||
FStringBuffer Tmp;
|
||||
Tmp << "constructor(";
|
||||
GenArgumentsForFunctionInfo(ConstructorInfo->Type, Tmp);
|
||||
Tmp << ")";
|
||||
StringBuffer << " " << Tmp.Buffer << ";\n";
|
||||
for (unsigned int i = 0; i < ConstructorInfo->Type->ArgumentCount(); i++)
|
||||
{
|
||||
auto argInfo = ConstructorInfo->Type->Argument(i);
|
||||
if (argInfo->IsUEType())
|
||||
{
|
||||
UScriptStruct* UsedStruct = PUERTS_NAMESPACE::FindAnyType<UScriptStruct>(UTF8_TO_TCHAR(argInfo->Name()));
|
||||
if (UsedStruct)
|
||||
Gen(UsedStruct);
|
||||
}
|
||||
}
|
||||
++ConstructorInfo;
|
||||
}
|
||||
return;
|
||||
}
|
||||
FStringBuffer TmpBuff;
|
||||
TmpBuff << "constructor(";
|
||||
bool First = true;
|
||||
|
||||
Reference in New Issue
Block a user