Prompt widget is pretty good now

This commit is contained in:
2026-05-04 15:52:05 -04:00
parent 3e7e6a2ae4
commit 78c85660c9
3 changed files with 38 additions and 20 deletions

View File

@@ -5,6 +5,7 @@
#include "Components/Widget.h"
#include "InputCoreTypes.h"
#include "Widgets/SOverlay.h"
#include "Widgets/Layout/SBox.h"
#include "Widgets/Layout/SScaleBox.h"
#include "PromptWidget.generated.h"
@@ -39,6 +40,9 @@ public:
UPROPERTY(EditAnywhere, Setter, Category="Prompt")
FLinearColor GlyphColor = FLinearColor::White;
UPROPERTY(EditAnywhere, Setter, Category="Prompt")
bool Depressed = false;
public:
UFUNCTION(BlueprintCallable, Category="Prompt")
void SetKeys(FKey InGamepadKey, FKey InKeyboardKey);
@@ -55,6 +59,9 @@ public:
UFUNCTION(BlueprintCallable, Category="Prompt")
void SetSize(FVector2D InSize);
UFUNCTION(BlueprintCallable, Category="Prompt")
void SetDepressed(bool InDepressed);
UFUNCTION()
void OnHardwareDeviceChanged(const FPlatformUserId UserId, const FInputDeviceId DeviceId);
@@ -65,10 +72,12 @@ protected:
private:
FSlateBrush MyBrush;
TSharedPtr<SBox> MyBox;
TSharedPtr<SOverlay> MyOverlay;
TSharedPtr<SImage> MyImage;
TSharedPtr<SScaleBox> MyScaleBox;
TSharedPtr<STextBlock> MyGlyph;
SOverlay::FOverlaySlot* MyImageSlot = nullptr;
SOverlay::FOverlaySlot* MyGlyphSlot = nullptr;
FBox2f GetIconUVs(int32 IconIndex);