diff --git a/Source/StevesUEHelpers/Private/StevesUI/FocusableCheckBox.cpp b/Source/StevesUEHelpers/Private/StevesUI/FocusableCheckBox.cpp index c78d8a3..7d45ccd 100644 --- a/Source/StevesUEHelpers/Private/StevesUI/FocusableCheckBox.cpp +++ b/Source/StevesUEHelpers/Private/StevesUI/FocusableCheckBox.cpp @@ -6,11 +6,18 @@ TSharedRef UFocusableCheckBox::RebuildWidget() { MyCheckbox = SNew(SFocusableCheckBox) .OnCheckStateChanged( BIND_UOBJECT_DELEGATE(FOnCheckStateChanged, SlateOnCheckStateChangedCallback) ) +#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION > 0 .Style(&GetWidgetStyle()) - .HAlign( HorizontalAlignment ) .ClickMethod(GetClickMethod()) .TouchMethod(GetTouchMethod()) .PressMethod(GetPressMethod()) +#else + .Style(&WidgetStyle) + .ClickMethod(ClickMethod) + .TouchMethod(TouchMethod) + .PressMethod(PressMethod) +#endif + .HAlign( HorizontalAlignment ) .IsFocusable(IsFocusable) // Our new events .OnHovered(BIND_UOBJECT_DELEGATE(FSimpleDelegate, SlateHandleHovered)) @@ -34,7 +41,11 @@ TSharedRef UFocusableCheckBox::RebuildWidget() void UFocusableCheckBox::RefreshFocussedStyle_Implementation() { // Copy Widget style but make normal same as hovered +#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION > 0 FocussedStyle = GetWidgetStyle(); +#else + FocussedStyle = WidgetStyle; +#endif FocussedStyle.UncheckedImage = FocussedStyle.UncheckedHoveredImage; FocussedStyle.CheckedImage = FocussedStyle.CheckedHoveredImage; FocussedStyle.UndeterminedImage = FocussedStyle.UndeterminedHoveredImage; @@ -65,7 +76,11 @@ void UFocusableCheckBox::UndoFocusStyle() { if (MyCheckbox.IsValid()) { +#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION > 0 MyCheckbox->SetStyle(&GetWidgetStyle()); +#else + MyCheckbox->SetStyle(&WidgetStyle); +#endif } }