Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

Commit f5d8296

Browse files
authored
Support static array properties (#95)
* support static array properties * minor extra static array tweaks most notably, actually let floats be set from int values * add optional findall arg to include subclasses * small restructure * fix C4238 allows compiling in conformance mode again probably the same as #88, but this doesn't have as many formatting side effects
1 parent b467bdf commit f5d8296

File tree

6 files changed

+309
-196
lines changed

6 files changed

+309
-196
lines changed

src/CHookManager.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ bool CHookManager::ProcessHooks(UObject* Caller, FFrame& Stack, void* const Resu
9696
}
9797
UnrealSDK::pFrameStep(&Stack, Stack.Object, Frame + Property->Offset_Internal);
9898
}
99-
const bool ret = ProcessHooks(Function->GetObjectName(), Caller, Function, &FStruct{Function, (void *)Frame});
99+
auto FrameStruct = FStruct{ Function, (void*) Frame };
100+
const bool ret = ProcessHooks(Function->GetObjectName(), Caller, Function, &FrameStruct);
100101
//if (!ret) {
101102
// if (ReturnParm)
102103
// {

src/CPythonInterface.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ PYBIND11_EMBEDDED_MODULE(unrealsdk, m)
7171
m.def("LoadPackage", &UnrealSDK::LoadPackage, py::arg("filename"), py::arg("flags") = 0, py::arg("force") = false);
7272
m.def("KeepAlive", &UnrealSDK::KeepAlive);
7373
m.def("GetPackageObject", &UObject::GetPackageObject, py::return_value_policy::reference);
74-
m.def("FindAll", &UObject::FindAll, py::return_value_policy::reference);
74+
m.def("FindAll", &UObject::FindAll, py::arg("InStr"), py::arg("IncludeSubclasses") = false,
75+
py::return_value_policy::reference);
7576
m.def("FindClass", &UObject::FindClass, py::arg("ClassName"), py::arg("Lookup") = false,
7677
py::return_value_policy::reference);
7778
m.def("FindObject", [](char* ClassName, char* ObjectFullName) { return UObject::Find(ClassName, ObjectFullName); },
@@ -134,8 +135,10 @@ void AddToConsoleLog(UConsole* console, FString input)
134135

135136
bool CheckPythonCommand(UObject* caller, UFunction* function, FStruct* params)
136137
{
137-
FString* command = ((FHelper *)params->base)->GetStrProperty(
138-
(UProperty *)params->structType->FindChildByName(FName("command")));
138+
FString* command = ((FHelper*)params->base)->GetStrProperty(
139+
(UProperty*)params->structType->FindChildByName(FName("command")),
140+
0
141+
);
139142
char* input = command->AsString();
140143
if (strncmp("py ", input, 3) == 0)
141144
{

0 commit comments

Comments
 (0)