Skip to content

Commit 097f08e

Browse files
author
Roberto De Ioris
committed
added support for 4.19
1 parent d5eb520 commit 097f08e

File tree

12 files changed

+188
-1
lines changed

12 files changed

+188
-1
lines changed

Source/UnrealEnginePython/Private/Blueprint/UEPyEdGraphPin.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,27 @@ static PyMethodDef ue_PyEdGraphPin_methods[] = {
7979
};
8080

8181
static PyObject *py_ue_edgraphpin_get_name(ue_PyEdGraphPin *self, void *closure) {
82+
#if ENGINE_MINOR_VERSION > 18
83+
return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinName.ToString())));
84+
#else
8285
return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinName)));
86+
#endif
8387
}
8488

8589
static PyObject *py_ue_edgraphpin_get_category(ue_PyEdGraphPin *self, void *closure) {
90+
#if ENGINE_MINOR_VERSION > 18
91+
return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinType.PinCategory.ToString())));
92+
#else
8693
return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinType.PinCategory)));
94+
#endif
8795
}
8896

8997
static PyObject *py_ue_edgraphpin_get_sub_category(ue_PyEdGraphPin *self, void *closure) {
98+
#if ENGINE_MINOR_VERSION > 18
99+
return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinType.PinSubCategory.ToString())));
100+
#else
90101
return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->pin->PinType.PinSubCategory)));
102+
#endif
91103
}
92104

93105
static PyObject *py_ue_edgraphpin_get_default_value(ue_PyEdGraphPin *self, void *closure) {
@@ -139,7 +151,11 @@ static PyGetSetDef ue_PyEdGraphPin_getseters[] = {
139151
static PyObject *ue_PyEdGraphPin_str(ue_PyEdGraphPin *self)
140152
{
141153
return PyUnicode_FromFormat("<unreal_engine.EdGraphPin {'name': '%s', 'type': '%s'}>",
154+
#if ENGINE_MINOR_VERSION > 18
155+
TCHAR_TO_UTF8(*self->pin->PinName.ToString()), TCHAR_TO_UTF8(*self->pin->PinType.PinCategory.ToString()));
156+
#else
142157
TCHAR_TO_UTF8(*self->pin->PinName), TCHAR_TO_UTF8(*self->pin->PinType.PinCategory));
158+
#endif
143159
}
144160

145161
static PyTypeObject ue_PyEdGraphPinType = {

Source/UnrealEnginePython/Private/ConsoleManager/UEPyIConsoleManager.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,23 @@ static PyObject *py_ue_iconsole_manager_add_history_entry(PyObject *cls, PyObjec
1212
return nullptr;
1313
}
1414

15+
#if ENGINE_MINOR_VERSION > 18
16+
IConsoleManager::Get().AddConsoleHistoryEntry(TEXT(""), UTF8_TO_TCHAR(entry));
17+
#else
1518
IConsoleManager::Get().AddConsoleHistoryEntry(UTF8_TO_TCHAR(entry));
19+
#endif
1620

1721
Py_RETURN_NONE;
1822
}
1923

2024
static PyObject *py_ue_iconsole_manager_get_history(PyObject *cls, PyObject * args)
2125
{
2226
TArray<FString> history;
27+
#if ENGINE_MINOR_VERSION > 18
28+
IConsoleManager::Get().GetConsoleHistory(TEXT(""), history);
29+
#else
2330
IConsoleManager::Get().GetConsoleHistory(history);
31+
#endif
2432
PyObject *py_history = PyList_New(0);
2533
for (FString item : history)
2634
{

Source/UnrealEnginePython/Private/PythonFunction.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ void UPythonFunction::SetPyCallable(PyObject *callable)
1010
}
1111

1212

13+
#if ENGINE_MINOR_VERSION > 18
14+
void UPythonFunction::CallPythonCallable(UObject *Context, FFrame& Stack, RESULT_DECL)
15+
#else
1316
void UPythonFunction::CallPythonCallable(FFrame& Stack, RESULT_DECL)
17+
#endif
1418
{
1519

1620
FScopePythonGIL gil;

Source/UnrealEnginePython/Private/Slate/UEPySPythonEditorViewport.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@ TSharedRef<FEditorViewportClient> SPythonEditorViewport::MakeEditorViewportClien
334334

335335
FExposureSettings settings;
336336
settings.bFixed = true;
337+
#if ENGINE_MINOR_VERSION > 18
338+
settings.FixedEV100 = 0;
339+
#else
337340
settings.LogOffset = 0;
341+
#endif
338342

339343
client->ExposureSettings = settings;
340344

Source/UnrealEnginePython/Private/UEPyModule.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,7 +3558,11 @@ UFunction *unreal_engine_add_function(UClass *u_class, char *name, PyObject *py_
35583558
function->FunctionFlags = function_flags;
35593559
#endif
35603560

3561+
#if ENGINE_MINOR_VERSION > 18
3562+
function->SetNativeFunc((FNativeFuncPtr)&UPythonFunction::CallPythonCallable);
3563+
#else
35613564
function->SetNativeFunc((Native)&UPythonFunction::CallPythonCallable);
3565+
#endif
35623566

35633567
function->Next = u_class->Children;
35643568

0 commit comments

Comments
 (0)