Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Copyright (c) 2018 The Peacenet & Alkaline Thunder.
- #pragma once
- #include "CoreMinimal.h"
- #include "Blueprint/UserWidget.h"
- #include "Fonts/SlateFontInfo.h"
- #include "SPeacegateTerminalWidget.h"
- #include "PTerminalWidget.generated.h"
- //Underlying Slate terminal widget that does all the cool rendering shit.
- class SPeacegateTerminalWidget;
- /**
- * Terminal emulator widget for Peacegate OS.
- */
- UCLASS(meta=(DisplayName="Terminal Emulator"))
- class PROJECTOGLOWIA_API UPTerminalWidget : public UUserWidget
- {
- GENERATED_BODY()
- public:
- DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnStdInCharWrittenEvent, const FText&, Character);
- DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnStdInLineWrittenEvent, const FText&, Text);
- DECLARE_DYNAMIC_DELEGATE_RetVal(FSlateFontInfo, FGetSlateFontInfo);
- public:
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Fonts and Colors")
- FSlateFontInfo RegularTextFont;
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Fonts and Colors")
- FSlateFontInfo BoldTextFont;
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Fonts and Colors")
- FSlateFontInfo ItalicTextFont;
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Fonts and Colors")
- FSlateFontInfo BoldItalicTextFont;
- /** The time in milliseconds between each cursor blink. */
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cursor")
- float CursorBlinkTimeMS;
- UPROPERTY()
- FGetSlateFontInfo RegularTextFontDelegate;
- UPROPERTY()
- FGetSlateFontInfo BoldTextFontDelegate;
- UPROPERTY()
- FGetSlateFontInfo ItalicTextFontDelegate;
- UPROPERTY()
- FGetSlateFontInfo BoldItalicTextFontDelegate;
- public:
- /** Called when a character is written to the standard input stream. */
- UPROPERTY(BlueprintAssignable, Category="Widget Event", meta=(DisplayName = "On Standard Input Character Written"))
- FOnStdInCharWrittenEvent OnStdInCharWritten;
- /** Called when a line of text is written to the standard input stream. */
- UPROPERTY(BlueprintAssignable, Category = "Widget Event", meta = (DisplayName = "On Standard Input Line Written"))
- FOnStdInLineWrittenEvent OnStdInLineWritten;
- virtual void SynchronizeProperties() override;
- virtual void ReleaseSlateResources(bool bReleaseChildren) override;
- #if WITH_EDITOR
- virtual const FText GetPaletteCategory() override;
- #endif
- protected:
- TSharedPtr<SPeacegateTerminalWidget> MyPeacegateTerminalWidget;
- PROPERTY_BINDING_IMPLEMENTATION(FSlateFontInfo, RegularTextFont);
- PROPERTY_BINDING_IMPLEMENTATION(FSlateFontInfo, BoldTextFont);
- PROPERTY_BINDING_IMPLEMENTATION(FSlateFontInfo, ItalicTextFont);
- PROPERTY_BINDING_IMPLEMENTATION(FSlateFontInfo, BoldItalicTextFont);
- };
Add Comment
Please, Sign In to add comment