|
|
|
|
| #pragma once
|
|
|
| #include "Components/Widget.h"
|
| #include "Styling/SlateTypes.h"
|
| #include "SubtitleDisplaySubsystem.h"
|
|
|
| #include "SubtitleDisplay.generated.h"
|
|
|
| #define UE_API GAMESUBTITLES_API
|
|
|
| class USubtitleDisplayOptions;
|
|
|
| struct FSubtitleFormat;
|
|
|
| UCLASS(MinimalAPI, BlueprintType, Blueprintable, meta = (DisableNativeTick))
|
| class USubtitleDisplay : public UWidget
|
| {
|
| GENERATED_UCLASS_BODY()
|
|
|
| public:
|
| UPROPERTY(EditAnywhere, Category = "Display Info")
|
| FSubtitleFormat Format;
|
|
|
| UPROPERTY(EditAnywhere, Category = "Display Info")
|
| TObjectPtr<USubtitleDisplayOptions> Options;
|
|
|
|
|
| UPROPERTY(EditAnywhere, Category="Display Info")
|
| float WrapTextAt;
|
|
|
| UFUNCTION(BlueprintCallable, Category = Subtitles, Meta = (Tooltip = "True if there are subtitles currently. False if the subtitle text is empty."))
|
| UE_API bool HasSubtitles() const;
|
|
|
|
|
| UPROPERTY(EditAnywhere, Category="Preview")
|
| bool bPreviewMode;
|
|
|
|
|
| UPROPERTY(EditAnywhere, Category="Preview")
|
| FText PreviewText;
|
|
|
| public:
|
|
|
|
|
| UE_API virtual void SynchronizeProperties() override;
|
| UE_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
|
| #if WITH_EDITOR
|
| UE_API virtual void ValidateCompiledDefaults(class IWidgetCompilerLog& CompileLog) const;
|
| #endif
|
|
|
|
|
| protected:
|
|
|
|
|
| UE_API virtual TSharedRef<class SWidget> RebuildWidget() override;
|
|
|
|
|
| UE_API void HandleSubtitleDisplayOptionsChanged(const FSubtitleFormat& InDisplayFormat);
|
|
|
| private:
|
|
|
| void RebuildStyle();
|
|
|
| private:
|
|
|
| UPROPERTY(Transient)
|
| FTextBlockStyle GeneratedStyle;
|
|
|
| UPROPERTY(Transient)
|
| FSlateBrush GeneratedBackgroundBorder;
|
|
|
|
|
| TSharedPtr<class SSubtitleDisplay> SubtitleWidget;
|
| };
|
|
|
| #undef UE_API
|
|
|