Skip to content

Commit

Permalink
completed porting to 4.23. fixes 20tab#777
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeioris committed Sep 11, 2019
1 parent 57def24 commit 038192d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Source/UnrealEnginePython/Private/Slate/UEPySTextBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ static int ue_py_stext_block_init(ue_PySTextBlock *self, PyObject *args, PyObjec
ue_py_slate_farguments_float("line_height_percentage", LineHeightPercentage);
ue_py_slate_farguments_struct("margin", Margin, FMargin);
ue_py_slate_farguments_float("min_desired_width", MinDesiredWidth);
#if ENGINE_MINOR_VERSION >= 23
ue_py_slate_farguments_event("on_double_clicked", OnDoubleClicked, FPointerEventHandler, OnMouseEvent);
#else
ue_py_slate_farguments_event("on_double_clicked", OnDoubleClicked, FOnClicked, OnClicked);
#endif
ue_py_slate_farguments_flinear_color("shadow_color_and_opacity", ShadowColorAndOpacity);
ue_py_slate_farguments_fvector2d("shadow_offset", ShadowOffset);
ue_py_slate_farguments_text("text", Text);
Expand Down
5 changes: 4 additions & 1 deletion Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,11 @@ class FPythonSlateCommands : public TCommands<FPythonSlateCommands>
virtual void RegisterCommands() override
{
commands = MakeShareable(new FUICommandList);

#if ENGINE_MINOR_VERSION >= 23
MakeUICommand_InternalUseOnly(this, command, nullptr, *name, *name, TCHAR_TO_UTF8(*name), *name, *name, EUserInterfaceActionType::Button, FInputGesture());
#else
UI_COMMAND_Function(this, command, nullptr, *name, *name, TCHAR_TO_UTF8(*name), *name, *name, EUserInterfaceActionType::Button, FInputGesture());
#endif
commands->MapAction(command, FExecuteAction::CreateRaw(this, &FPythonSlateCommands::Callback), FCanExecuteAction());
}

Expand Down
2 changes: 2 additions & 0 deletions Source/UnrealEnginePython/Private/UEPyModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,9 @@ static PyMethodDef ue_PyUObject_methods[] = {
{ "get_raw_animation_data", (PyCFunction)py_ue_anim_sequence_get_raw_animation_data, METH_VARARGS, "" },
{ "get_raw_animation_track", (PyCFunction)py_ue_anim_sequence_get_raw_animation_track, METH_VARARGS, "" },
{ "add_new_raw_track", (PyCFunction)py_ue_anim_sequence_add_new_raw_track, METH_VARARGS, "" },
#if ENGINE_MINOR_VERSION <23
{ "update_compressed_track_map_from_raw", (PyCFunction)py_ue_anim_sequence_update_compressed_track_map_from_raw, METH_VARARGS, "" },
#endif
{ "update_raw_track", (PyCFunction)py_ue_anim_sequence_update_raw_track, METH_VARARGS, "" },
{ "apply_raw_anim_changes", (PyCFunction)py_ue_anim_sequence_apply_raw_anim_changes, METH_VARARGS, "" },
{ "add_key_to_sequence", (PyCFunction)py_ue_anim_add_key_to_sequence, METH_VARARGS, "" },
Expand Down
4 changes: 4 additions & 0 deletions Source/UnrealEnginePython/Private/UObject/UEPyObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,11 @@ PyObject *py_ue_broadcast(ue_PyUObject *self, PyObject *args)

if (auto casted_prop = Cast<UMulticastDelegateProperty>(u_property))
{
#if ENGINE_MINOR_VERSION >= 23
FMulticastScriptDelegate multiscript_delegate = *casted_prop->GetMulticastDelegate(self->ue_object);
#else
FMulticastScriptDelegate multiscript_delegate = casted_prop->GetPropertyValue_InContainer(self->ue_object);
#endif
uint8 *parms = (uint8 *)FMemory_Alloca(casted_prop->SignatureFunction->PropertiesSize);
FMemory::Memzero(parms, casted_prop->SignatureFunction->PropertiesSize);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ static FFoliageInstance* get_foliage_instance(ue_PyFFoliageInstance* self)
}

#if ENGINE_MINOR_VERSION >= 23
auto FoliageInfo = self->foliage_actor->FoliageInfos[self->foliage_type.Get()];
FFoliageInfo& info = info;
FFoliageInfo& info = self->foliage_actor->FoliageInfos[self->foliage_type.Get()].Get();
#else

FFoliageMeshInfo& info = self->foliage_actor->FoliageMeshes[self->foliage_type.Get()].Get();
Expand Down Expand Up @@ -72,7 +71,11 @@ static int py_ue_ffoliage_instance_set_location(ue_PyFFoliageInstance* self, PyO
{
TArray<int32> instances;
instances.Add(self->instance_id);
#if ENGINE_MINOR_VERSION >= 23
FFoliageInfo& info = self->foliage_actor->FoliageInfos[self->foliage_type.Get()].Get();
#else
FFoliageMeshInfo& info = self->foliage_actor->FoliageMeshes[self->foliage_type.Get()].Get();
#endif
info.PreMoveInstances(self->foliage_actor.Get(), instances);
instance->Location = vec->vec;
info.PostMoveInstances(self->foliage_actor.Get(), instances);
Expand All @@ -93,7 +96,11 @@ static int py_ue_ffoliage_instance_set_rotation(ue_PyFFoliageInstance* self, PyO
{
TArray<int32> instances;
instances.Add(self->instance_id);
#if ENGINE_MINOR_VERSION >= 23
FFoliageInfo& info = self->foliage_actor->FoliageInfos[self->foliage_type.Get()].Get();
#else
FFoliageMeshInfo& info = self->foliage_actor->FoliageMeshes[self->foliage_type.Get()].Get();
#endif
info.PreMoveInstances(self->foliage_actor.Get(), instances);
instance->Rotation = rot->rot;
info.PostMoveInstances(self->foliage_actor.Get(), instances);
Expand Down

0 comments on commit 038192d

Please sign in to comment.