mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 09:35:25 +00:00
Prevent Unfocus if the widget is not focused by the current user
This commit is contained in:
parent
75f38faa81
commit
6af2ba2766
@ -130,7 +130,14 @@ void UFocusableButton::Unfocus() const
|
||||
LocalPlayer->GetControllerId());
|
||||
if (UserIndex.IsSet())
|
||||
{
|
||||
FSlateApplication::Get().ClearUserFocus(UserIndex.GetValue());
|
||||
TSharedPtr<SWidget> SafeWidget = GetCachedWidget();
|
||||
if (SafeWidget.IsValid())
|
||||
{
|
||||
if (SafeWidget->HasUserFocus(UserIndex.GetValue()))
|
||||
{
|
||||
FSlateApplication::Get().ClearUserFocus(UserIndex.GetValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,14 @@ void UFocusableCheckBox::Unfocus() const
|
||||
LocalPlayer->GetControllerId());
|
||||
if (UserIndex.IsSet())
|
||||
{
|
||||
FSlateApplication::Get().ClearUserFocus(UserIndex.GetValue());
|
||||
TSharedPtr<SWidget> SafeWidget = GetCachedWidget();
|
||||
if (SafeWidget.IsValid())
|
||||
{
|
||||
if (SafeWidget->HasUserFocus(UserIndex.GetValue()))
|
||||
{
|
||||
FSlateApplication::Get().ClearUserFocus(UserIndex.GetValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user