mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 17:45:23 +00:00
Add Blueprint library func "SetFocusWidget"; improved focus setting without casting
This commit is contained in:
parent
cb561f190a
commit
01bf2d3a40
@ -2,3 +2,10 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "StevesBPL.h"
|
#include "StevesBPL.h"
|
||||||
|
|
||||||
|
#include "StevesUI/StevesUI.h"
|
||||||
|
|
||||||
|
void UStevesBPL::SetWidgetFocus(UWidget* Widget)
|
||||||
|
{
|
||||||
|
SetWidgetFocusProperly(Widget);
|
||||||
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "StevesMathHelpers.h"
|
#include "StevesMathHelpers.h"
|
||||||
#include "StevesBPL.generated.h"
|
#include "StevesBPL.generated.h"
|
||||||
|
|
||||||
|
class UWidget;
|
||||||
/**
|
/**
|
||||||
* Blueprint library exposing various things in a Blueprint-friendly way e.g. using by-value FVectors so they can
|
* Blueprint library exposing various things in a Blueprint-friendly way e.g. using by-value FVectors so they can
|
||||||
* be entered directly if required, rather than const& as in C++. Also use degrees not radians.
|
* be entered directly if required, rather than const& as in C++. Also use degrees not radians.
|
||||||
@ -32,5 +33,14 @@ public:
|
|||||||
{
|
{
|
||||||
return StevesMathHelpers::SphereOverlapCone(ConeOrigin, ConeDir, FMath::DegreesToRadians(ConeAngle*0.5f), Distance, SphereCentre, SphereRadius);
|
return StevesMathHelpers::SphereOverlapCone(ConeOrigin, ConeDir, FMath::DegreesToRadians(ConeAngle*0.5f), Distance, SphereCentre, SphereRadius);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the focus to a given widget "properly", which means that if this is a widget derived
|
||||||
|
* from UFocusableWidget, it calls SetFocusProperly on it which allows a customised implementation.
|
||||||
|
* @param Widget The widget to give focus to
|
||||||
|
*/
|
||||||
|
UFUNCTION(BlueprintCallable, Category="StevesUEHelpers|UI")
|
||||||
|
static void SetWidgetFocus(UWidget* Widget);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user