Skip to content

Commit 3173145

Browse files
author
Roberto De Ioris
committed
fixes for 4.12
1 parent fa47c36 commit 3173145

6 files changed

Lines changed: 15 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ static int ue_py_spython_combo_box_init(ue_PySPythonComboBox *self, PyObject *ar
127127
#endif
128128
ue_py_slate_farguments_struct("foreground_color", ForegroundColor, FSlateColor);
129129
ue_py_slate_farguments_optional_bool("has_down_arrow", HasDownArrow);
130+
#if ENGINE_MINOR_VERSION > 12
130131
ue_py_slate_farguments_optional_struct_ptr("item_style", ItemStyle, FTableRowStyle);
132+
#endif
131133
ue_py_slate_farguments_optional_float("max_list_height", MaxListHeight);
132134
ue_py_slate_farguments_optional_enum("method", Method, EPopupMethod);
133135
ue_py_slate_farguments_optional_struct("pressed_sound_override", PressedSoundOverride, FSlateSound);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,16 @@ static int ue_py_spython_list_view_init(ue_PySPythonListView *self, PyObject *ar
107107
ue_py_slate_farguments_optional_enum("allow_overscroll", AllowOverscroll, EAllowOverscroll);
108108
ue_py_slate_farguments_optional_bool("clear_selection_on_click", ClearSelectionOnClick);
109109
ue_py_slate_farguments_optional_enum("consume_mouse_wheel", ConsumeMouseWheel, EConsumeMouseWheel);
110+
#if ENGINE_MINOR_VERSION > 12
110111
ue_py_slate_farguments_optional_bool("handle_gamepad_events", HandleGamepadEvents);
112+
#endif
111113
ue_py_slate_farguments_float("item_height", ItemHeight);
112114
ue_py_slate_farguments_event("on_generate_row", OnGenerateRow, TSlateDelegates<TSharedPtr<FPythonItem>>::FOnGenerateRow, GenerateRow);
113115
ue_py_slate_farguments_event("on_selection_changed", OnSelectionChanged, TSlateDelegates<TSharedPtr<FPythonItem>>::FOnSelectionChanged, OnSelectionChanged);
114116
ue_py_slate_farguments_enum("selection_mode", SelectionMode, ESelectionMode::Type);
117+
#if ENGINE_MINOR_VERSION > 12
115118
ue_py_slate_farguments_optional_float("wheel_scroll_multiplier", WheelScrollMultiplier);
119+
#endif
116120

117121
ue_py_snew(SPythonListView, s_list_view.s_table_view_base.s_compound_widget.s_widget);
118122
return 0;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ static int ue_py_spython_tree_view_init(ue_PySPythonTreeView *self, PyObject *ar
7979
ue_py_slate_farguments_event("on_generate_row", OnGenerateRow, TSlateDelegates<TSharedPtr<FPythonItem>>::FOnGenerateRow, GenerateRow);
8080
ue_py_slate_farguments_event("on_selection_changed", OnSelectionChanged, TSlateDelegates<TSharedPtr<FPythonItem>>::FOnSelectionChanged, OnSelectionChanged);
8181
ue_py_slate_farguments_enum("selection_mode", SelectionMode, ESelectionMode::Type);
82+
#if ENGINE_MINOR_VERSION > 12
8283
ue_py_slate_farguments_optional_float("wheel_scroll_multiplier", WheelScrollMultiplier);
84+
#endif
8385
ue_py_slate_farguments_event("on_get_children", OnGetChildren, TSlateDelegates<TSharedPtr<FPythonItem>>::FOnGetChildren, GetChildren);
8486

8587
ue_py_snew(SPythonTreeView, s_tree_view.s_list_view.s_table_view_base.s_compound_widget.s_widget);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ static PyObject *py_ue_swidget_set_enabled(ue_PySWidget *self, PyObject * args)
5656
return (PyObject *)self;
5757
}
5858

59+
#if ENGINE_MINOR_VERSION > 12
5960
static PyObject *py_ue_swidget_bind_on_mouse_button_down(ue_PySWidget *self, PyObject * args) {
6061
PyObject *py_callable;
6162
if (!PyArg_ParseTuple(args, "O:bind_on_mouse_button_down", &py_callable)) {
@@ -143,7 +144,7 @@ static PyObject *py_ue_swidget_bind_on_mouse_move(ue_PySWidget *self, PyObject *
143144
Py_INCREF(self);
144145
return (PyObject *)self;
145146
}
146-
147+
#endif
147148

148149

149150
static PyObject *py_ue_swidget_has_keyboard_focus(ue_PySWidget *self, PyObject * args) {
@@ -173,10 +174,12 @@ static PyMethodDef ue_PySWidget_methods[] = {
173174
{ "set_cursor", (PyCFunction)py_ue_swidget_set_cursor, METH_VARARGS, "" },
174175
{ "set_enabled", (PyCFunction)py_ue_swidget_set_enabled, METH_VARARGS, "" },
175176
{ "has_keyboard_focus", (PyCFunction)py_ue_swidget_has_keyboard_focus, METH_VARARGS, "" },
177+
#if ENGINE_MINOR_VERSION > 12
176178
{ "bind_on_mouse_button_down", (PyCFunction)py_ue_swidget_bind_on_mouse_button_down, METH_VARARGS, "" },
177179
{ "bind_on_mouse_button_up", (PyCFunction)py_ue_swidget_bind_on_mouse_button_down, METH_VARARGS, "" },
178180
{ "bind_on_mouse_double_click", (PyCFunction)py_ue_swidget_bind_on_mouse_double_click, METH_VARARGS, "" },
179181
{ "bind_on_mouse_move", (PyCFunction)py_ue_swidget_bind_on_mouse_move, METH_VARARGS, "" },
182+
#endif
180183
{ NULL } /* Sentinel */
181184
};
182185

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ static int ue_py_swindow_init(ue_PySWindow *self, PyObject *args, PyObject *kwar
142142
ue_py_slate_farguments_optional_float("min_width", MinWidth);
143143
ue_py_slate_farguments_optional_bool("sane_window_placement", SaneWindowPlacement);
144144
ue_py_slate_farguments_optional_fvector2d("screen_position", ScreenPosition);
145+
#if ENGINE_MINOR_VERSION > 12
145146
ue_py_slate_farguments_optional_bool("should_preserve_aspect_ratio", ShouldPreserveAspectRatio);
147+
#endif
146148
#if ENGINE_MINOR_VERSION > 15
147149
ue_py_slate_farguments_optional_enum("sizing_rule", SizingRule, ESizingRule);
148150
#else

‎Source/UnrealEnginePython/Private/UnrealEnginePython.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void FUnrealEnginePythonModule::StartupModule()
218218
StyleSet->SetContentRoot(IPluginManager::Get().FindPlugin("UnrealEnginePython")->GetBaseDir() / "Resources");
219219
StyleSet->Set("ClassThumbnail.PythonScript", new FSlateImageBrush(StyleSet->RootToContentDir("Icon128.png"), FVector2D(128.0f, 128.0f)));
220220
FSlateStyleRegistry::RegisterSlateStyle(*StyleSet.Get());
221-
#if ENGINE_MINOR_VERSION < 13
221+
#if ENGINE_MINOR_VERSION == 13
222222
FClassIconFinder::RegisterIconSource(StyleSet.Get());
223223
#endif
224224
#endif

0 commit comments

Comments
 (0)