从master分支拉取puerts,并拉取v8制品,修改puerts插件部分UE5_5以下兼容的宏代码。保证puerts编译通过。包括
CSharpParamDefaultValueMetas.cs和ubtplugin.csproj和declarationGenerator.cpp和PropertyTranslator.cpp对UserDefinedStruct.h的引用
This commit is contained in:
@@ -379,6 +379,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(typename ArgumentType<T>::type InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
}
|
||||
@@ -418,6 +423,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(typename ArgumentType<T>::type InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
if (&Buf != &(Arg.get()))
|
||||
@@ -452,6 +462,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(typename ArgumentType<T>::type InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
}
|
||||
@@ -476,6 +491,15 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
using BuffType = typename std::remove_const<typename std::remove_reference<T>::type>::type;
|
||||
BuffType Buf;
|
||||
|
||||
void SetArgument(BuffType InArg)
|
||||
{
|
||||
Buf = InArg;
|
||||
Arg = Buf;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
}
|
||||
@@ -501,6 +525,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(typename ArgumentType<T>::type InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
API::UpdateRefValue(context, holder, API::template Converter<typename std::decay<T>::type>::toScript(context, Arg));
|
||||
@@ -527,6 +556,11 @@ private:
|
||||
return Arg ? Arg : &Buf;
|
||||
}
|
||||
|
||||
void SetArgument(BuffType InArg)
|
||||
{
|
||||
Buf = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
API::UpdateRefValue(context, holder, API::template Converter<BuffType>::toScript(context, Buf));
|
||||
@@ -551,6 +585,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(T InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
}
|
||||
@@ -574,6 +613,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(typename ArgumentType<T>::type InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
}
|
||||
@@ -615,7 +659,7 @@ private:
|
||||
{
|
||||
if (argCount <= Pos)
|
||||
{
|
||||
std::get<Pos>(cppArgHolders).Arg = defaultValue;
|
||||
std::get<Pos>(cppArgHolders).SetArgument(defaultValue);
|
||||
}
|
||||
DefaultValueSetter<0, Pos + 1, FullArgs...>::Set(cppArgHolders, argCount, rest...);
|
||||
}
|
||||
@@ -1458,6 +1502,164 @@ struct PropertyWrapper<API, Ret*, Variable>
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename TG, TG, typename Enable = void>
|
||||
struct PropertyGetterWrapper;
|
||||
|
||||
template <typename API, typename Ret, Ret (*fgetter)()>
|
||||
struct PropertyGetterWrapper<API, Ret (*)(), fgetter>
|
||||
{
|
||||
template <typename T>
|
||||
using DecayTypeConverter = typename API::template Converter<typename internal::ConverterDecay<T>::type>;
|
||||
|
||||
static void getter(typename API::CallbackInfoType info)
|
||||
{
|
||||
auto context = API::GetContext(info);
|
||||
API::SetReturn(info, DecayTypeConverter<Ret>::toScript(context, fgetter()));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ret, typename Ins, Ret (Ins::*func)()>
|
||||
struct PropertyGetterWrapper<API, Ret (Ins::*)(), func>
|
||||
{
|
||||
template <typename T>
|
||||
using DecayTypeConverter = typename API::template Converter<typename internal::ConverterDecay<T>::type>;
|
||||
|
||||
static void getter(typename API::CallbackInfoType info)
|
||||
{
|
||||
auto context = API::GetContext(info);
|
||||
auto self = DecayTypeConverter<Ins*>::toCpp(context, API::GetThis(info));
|
||||
if (!self)
|
||||
{
|
||||
API::ThrowException(info, "access a null object");
|
||||
return;
|
||||
}
|
||||
|
||||
API::SetReturn(info, API::template Converter<Ret>::toScript(context, (self->*func)()));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ret, typename Ins, Ret (Ins::*func)() const>
|
||||
struct PropertyGetterWrapper<API, Ret (Ins::*)() const, func>
|
||||
{
|
||||
template <typename T>
|
||||
using DecayTypeConverter = typename API::template Converter<typename internal::ConverterDecay<T>::type>;
|
||||
|
||||
static void getter(typename API::CallbackInfoType info)
|
||||
{
|
||||
auto context = API::GetContext(info);
|
||||
auto self = DecayTypeConverter<Ins*>::toCpp(context, API::GetThis(info));
|
||||
if (!self)
|
||||
{
|
||||
API::ThrowException(info, "access a null object");
|
||||
return;
|
||||
}
|
||||
|
||||
API::SetReturn(info, API::template Converter<Ret>::toScript(context, (self->*func)()));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API>
|
||||
struct PropertyGetterWrapper<API, decltype(nullptr), nullptr>
|
||||
{
|
||||
static void getter(typename API::CallbackInfoType info)
|
||||
{
|
||||
API::ThrowException(info, "not getter for this property!");
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename TS, TS, typename Enable = void>
|
||||
struct PropertySetterWrapper;
|
||||
|
||||
template <typename API, typename TS, void (*fsetter)(TS)>
|
||||
struct PropertySetterWrapper<API, void (*)(TS), fsetter>
|
||||
{
|
||||
template <typename T>
|
||||
using DecayTypeConverter = typename API::template Converter<typename internal::ConverterDecay<T>::type>;
|
||||
|
||||
static void setter(typename API::CallbackInfoType info)
|
||||
{
|
||||
auto context = API::GetContext(info);
|
||||
fsetter(DecayTypeConverter<TS>::toCpp(context, API::GetArg(info, 0)));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename TS, typename Ins, void (Ins::*func)(TS)>
|
||||
struct PropertySetterWrapper<API, void (Ins::*)(TS), func>
|
||||
{
|
||||
template <typename T>
|
||||
using DecayTypeConverter = typename API::template Converter<typename internal::ConverterDecay<T>::type>;
|
||||
|
||||
static void setter(typename API::CallbackInfoType info)
|
||||
{
|
||||
auto context = API::GetContext(info);
|
||||
auto self = DecayTypeConverter<Ins*>::toCpp(context, API::GetThis(info));
|
||||
if (!self)
|
||||
{
|
||||
API::ThrowException(info, "access a null object");
|
||||
return;
|
||||
}
|
||||
|
||||
(self->*func)(DecayTypeConverter<TS>::toCpp(context, API::GetArg(info, 0)));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API>
|
||||
struct PropertySetterWrapper<API, decltype(nullptr), nullptr>
|
||||
{
|
||||
static void setter(typename API::CallbackInfoType info)
|
||||
{
|
||||
API::ThrowException(info, "not setter for this property!");
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename TG, typename TS>
|
||||
struct PropertyGetterSetterInfo;
|
||||
|
||||
template <typename API, typename Ret, typename TS>
|
||||
struct PropertyGetterSetterInfo<API, Ret (*)(), TS>
|
||||
{
|
||||
static const CTypeInfo* info()
|
||||
{
|
||||
return CTypeInfoImpl<Ret, false>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ins, typename Ret, typename TS>
|
||||
struct PropertyGetterSetterInfo<API, Ret (Ins::*)(), TS>
|
||||
{
|
||||
static const CTypeInfo* info()
|
||||
{
|
||||
return CTypeInfoImpl<Ret, false>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ins, typename Ret, typename TS>
|
||||
struct PropertyGetterSetterInfo<API, Ret (Ins::*)() const, TS>
|
||||
{
|
||||
static const CTypeInfo* info()
|
||||
{
|
||||
return CTypeInfoImpl<Ret, false>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ret, typename TG>
|
||||
struct PropertyGetterSetterInfo<API, TG, void (*)(Ret)>
|
||||
{
|
||||
static const CTypeInfo* info()
|
||||
{
|
||||
return CTypeInfoImpl<Ret, false>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ins, typename Ret, typename TG>
|
||||
struct PropertyGetterSetterInfo<API, TG, void (Ins::*)(Ret)>
|
||||
{
|
||||
static const CTypeInfo* info()
|
||||
{
|
||||
return CTypeInfoImpl<Ret, false>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename API, typename RegisterAPI>
|
||||
class ClassDefineBuilder
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user