Skip to content

Commit d77edff

Browse files
author
Roberto De Ioris
committed
backported to 4.15
1 parent 581a279 commit d77edff

11 files changed

Lines changed: 174 additions & 148 deletions

‎Source/UnrealEnginePython/Private/Slate/UEPyFSlateStyleSet.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ static PyObject *py_ue_fslate_style_set_get(ue_PyFSlateStyleSet *self, PyObject
135135
}
136136
else if (ue_py_check_childstruct<FSlateWidgetStyle>(py_type))
137137
{
138+
138139
typedef TFunction<PyObject* (FSlateStyleSet&, FName)> WStyleGetter;
139140
typedef TPair<UScriptStruct*, WStyleGetter> WStylePair;
141+
#if ENGINE_MINOR_VERSION > 15
140142
static const WStylePair validWidgetStyleUStructList[] = {
141143
WStylePair{ FTextBlockStyle::StaticStruct() , WStyleGetter([](FSlateStyleSet& InStyle, FName InName) { return pyGetWidgetStyle<FTextBlockStyle> (InStyle, InName); }) },
142144
WStylePair{ FButtonStyle::StaticStruct() , WStyleGetter([](FSlateStyleSet& InStyle, FName InName) { return pyGetWidgetStyle<FButtonStyle> (InStyle, InName); }) },
@@ -163,6 +165,7 @@ static PyObject *py_ue_fslate_style_set_get(ue_PyFSlateStyleSet *self, PyObject
163165
WStylePair{ FScrollBorderStyle::StaticStruct() , WStyleGetter([](FSlateStyleSet& InStyle, FName InName) { return pyGetWidgetStyle<FScrollBorderStyle> (InStyle, InName); }) },
164166
WStylePair{ FWindowStyle::StaticStruct() , WStyleGetter([](FSlateStyleSet& InStyle, FName InName) { return pyGetWidgetStyle<FWindowStyle> (InStyle, InName); }) },
165167
};
168+
166169

167170
for(WStylePair widgetStyleUStruct : validWidgetStyleUStructList)
168171
{
@@ -172,6 +175,7 @@ static PyObject *py_ue_fslate_style_set_get(ue_PyFSlateStyleSet *self, PyObject
172175
break;
173176
}
174177
}
178+
#endif
175179

176180
if (!ret)
177181
{

‎Source/UnrealEnginePython/Private/Slate/UEPyIStructureDetailsView.cpp‎

Lines changed: 142 additions & 138 deletions
Large diffs are not rendered by default.

‎Source/UnrealEnginePython/Private/Slate/UEPySGraphPanel.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "UnrealEnginePythonPrivatePCH.h"
22

33
#if WITH_EDITOR
4+
#if ENGINE_MINOR_VERSION > 15
45
#include "UEPySGraphPanel.h"
56

67
#define sw_graph_panel StaticCastSharedRef<SGraphPanel>(self->s_nodePanel.s_panel.s_widget)
@@ -134,4 +135,5 @@ void ue_python_init_sgraph_panel(PyObject *ue_module)
134135
PyModule_AddObject(ue_module, "SGraphPanel", (PyObject *)&ue_PySGraphPanelType);
135136
}
136137

138+
#endif
137139
#endif

‎Source/UnrealEnginePython/Private/Slate/UEPySGraphPanel.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "UnrealEnginePython.h"
44

55
#if WITH_EDITOR
6-
#if ENGINE_MINOR_VERSION > 12
6+
#if ENGINE_MINOR_VERSION > 15
77
#include "UEPySNodePanel.h"
88

99
#include "Editor/GraphEditor/Public/SGraphPanel.h"

‎Source/UnrealEnginePython/Private/Slate/UEPySVectorInputBox.cpp‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ PyTypeObject ue_PySVectorInputBoxType = {
4343
static int ue_py_svector_input_box_init(ue_PySVectorInputBox *self, PyObject *args, PyObject *kwargs) {
4444
ue_py_slate_setup_farguments(SVectorInputBox);
4545

46-
#if WITH_KNL_PYEXT
47-
ue_py_slate_farguments_optional_float("delta", Delta);
48-
#endif
49-
#if ENGINE_MINOR_VERSION > 15 || WITH_KNL_PYEXT
46+
#if ENGINE_MINOR_VERSION > 15
5047
ue_py_slate_farguments_optional_bool("allow_spin", AllowSpin);
5148
#endif
5249
ue_py_slate_farguments_optional_bool("allow_responsive_layout", AllowResponsiveLayout);

‎Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,9 @@ void ue_python_init_slate(PyObject *module)
836836

837837
#if WITH_EDITOR
838838
ue_python_init_snode_panel(module);
839+
#if ENGINE_MINOR_VERSION > 15
839840
ue_python_init_sgraph_panel(module);
841+
#endif
840842
ue_python_init_idetails_view(module);
841843
ue_python_init_istructure_details_view(module);
842844
ue_python_init_seditor_viewport(module);

‎Source/UnrealEnginePython/Private/UEPyModule.cpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,10 @@ void unreal_engine_init_py_module()
20502050
PyDict_SetItemString(unreal_engine_dict, "RF_STRONGREFONFRAME" , PyLong_FromUnsignedLongLong((uint64)RF_StrongRefOnFrame ));
20512051
PyDict_SetItemString(unreal_engine_dict, "RF_NONPIEDUPLICATETRANSIENT" , PyLong_FromUnsignedLongLong((uint64)RF_NonPIEDuplicateTransient ));
20522052
PyDict_SetItemString(unreal_engine_dict, "RF_DYNAMIC" , PyLong_FromUnsignedLongLong((uint64)RF_Dynamic ));
2053-
PyDict_SetItemString(unreal_engine_dict, "RF_WILLBELOADED" , PyLong_FromUnsignedLongLong((uint64)RF_WillBeLoaded ));
2053+
2054+
#if ENGINE_MINOR_VERSION > 15
2055+
PyDict_SetItemString(unreal_engine_dict, "RF_WILLBELOADED" , PyLong_FromUnsignedLongLong((uint64)RF_WillBeLoaded ));
2056+
#endif
20542057

20552058
// Properties
20562059
PyDict_SetItemString(unreal_engine_dict, "CPF_CONFIG", PyLong_FromUnsignedLongLong((uint64)CPF_Config));

‎Source/UnrealEnginePython/Private/UEPyUScriptStruct.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
typedef struct
66
{
77
PyObject_HEAD
8-
/* Type-specific fields go here. */
9-
UScriptStruct *u_struct;
8+
/* Type-specific fields go here. */
9+
UScriptStruct *u_struct;
1010
uint8 *data;
1111
} ue_PyUScriptStruct;
1212

‎Source/UnrealEnginePython/Private/UnrealEnginePythonPrivatePCH.h‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
1+
// Copyright 20Tab S.r.l.
2+
3+
#pragma once
24

35
//#define UEPY_MEMORY_DEBUG 1
46
//#define UEPY_THREADING 1
@@ -93,3 +95,11 @@ bool PyUnicodeOrString_Check(PyObject *py_obj);
9395
return PyErr_Format(PyExc_Exception, "uobject is in invalid state");\
9496
Py_INCREF(ret);\
9597
return (PyObject *)ret;
98+
99+
#if ENGINE_MINOR_VERSION < 16
100+
template<class CPPSTRUCT>
101+
struct TStructOpsTypeTraitsBase2 : TStructOpsTypeTraitsBase
102+
{
103+
104+
};
105+
#endif

‎Source/UnrealEnginePython/Private/Wrappers/UEPyESlateEnums.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ void ue_python_init_eslate_enums(PyObject *ue_module)
7676
PyDict_SetItemString(ue_PyESlateEnumsType.tp_dict, enum_name, (PyObject *)native_enum);
7777
};
7878

79+
#if ENGINE_MINOR_VERSION > 15
7980
#define ADD_NATIVE_ENUM(EnumType, EnumVal) add_native_enum(#EnumType "." #EnumVal, (uint8)##EnumType::Type::##EnumVal)
8081
ADD_NATIVE_ENUM(EUserInterfaceActionType, None );
8182
ADD_NATIVE_ENUM(EUserInterfaceActionType, Button );
@@ -84,6 +85,7 @@ void ue_python_init_eslate_enums(PyObject *ue_module)
8485
ADD_NATIVE_ENUM(EUserInterfaceActionType, Check );
8586
ADD_NATIVE_ENUM(EUserInterfaceActionType, CollapsedButton);
8687
#undef ADD_NATIVE_ENUM
88+
#endif
8789

8890
}
8991

0 commit comments

Comments
 (0)