1111#include " PackageTools.h"
1212#endif
1313
14+ #if ENGINE_MINOR_VERSION >= 18
15+ #include " HAL/PlatformApplicationMisc.h"
16+ #endif
17+
1418
1519PyObject *py_unreal_engine_log (PyObject * self, PyObject * args)
1620{
@@ -165,12 +169,20 @@ PyObject *py_unreal_engine_get_up_vector(PyObject * self, PyObject * args)
165169
166170PyObject *py_unreal_engine_get_content_dir (PyObject * self, PyObject * args)
167171{
172+ #if ENGINE_MINOR_VERSION >= 18
173+ return PyUnicode_FromString (TCHAR_TO_UTF8 (*FPaths::ProjectContentDir ()));
174+ #else
168175 return PyUnicode_FromString (TCHAR_TO_UTF8 (*FPaths::GameContentDir ()));
176+ #endif
169177}
170178
171179PyObject *py_unreal_engine_get_game_saved_dir (PyObject * self, PyObject * args)
172180{
181+ #if ENGINE_MINOR_VERSION >= 18
182+ return PyUnicode_FromString (TCHAR_TO_UTF8 (*FPaths::ProjectSavedDir ()));
183+ #else
173184 return PyUnicode_FromString (TCHAR_TO_UTF8 (*FPaths::GameSavedDir ()));
185+ #endif
174186}
175187
176188PyObject * py_unreal_engine_get_game_user_developer_dir (PyObject *, PyObject *)
@@ -1237,13 +1249,21 @@ PyObject *py_unreal_engine_clipboard_copy(PyObject * self, PyObject * args)
12371249 return nullptr ;
12381250 }
12391251
1252+ #if ENGINE_MINOR_VERSION >= 18
1253+ FPlatformApplicationMisc::ClipboardCopy (UTF8_TO_TCHAR (text));
1254+ #else
12401255 FGenericPlatformMisc::ClipboardCopy (UTF8_TO_TCHAR (text));
1256+ #endif
12411257 Py_RETURN_NONE;
12421258}
12431259
12441260PyObject *py_unreal_engine_clipboard_paste (PyObject * self, PyObject * args)
12451261{
12461262 FString clipboard;
1263+ #if ENGINE_MINOR_VERSION >= 18
1264+ FPlatformApplicationMisc::ClipboardPaste (clipboard);
1265+ #else
12471266 FGenericPlatformMisc::ClipboardPaste (clipboard);
1267+ #endif
12481268 return PyUnicode_FromString (TCHAR_TO_UTF8 (*clipboard));
12491269}
0 commit comments