Guest User

Untitled

a guest
Jul 19th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. // Copyright (c) 2018 The Peacenet & Alkaline Thunder.
  2.  
  3. #pragma once
  4.  
  5. #include "CoreMinimal.h"
  6. #include "Blueprint/UserWidget.h"
  7. #include "Fonts/SlateFontInfo.h"
  8. #include "SPeacegateTerminalWidget.h"
  9. #include "PTerminalWidget.generated.h"
  10.  
  11. //Underlying Slate terminal widget that does all the cool rendering shit.
  12. class SPeacegateTerminalWidget;
  13.  
  14. /**
  15. * Terminal emulator widget for Peacegate OS.
  16. */
  17. UCLASS(meta=(DisplayName="Terminal Emulator"))
  18. class PROJECTOGLOWIA_API UPTerminalWidget : public UUserWidget
  19. {
  20. GENERATED_BODY()
  21.  
  22. public:
  23. DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnStdInCharWrittenEvent, const FText&, Character);
  24. DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnStdInLineWrittenEvent, const FText&, Text);
  25. DECLARE_DYNAMIC_DELEGATE_RetVal(FSlateFontInfo, FGetSlateFontInfo);
  26.  
  27. public:
  28. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Fonts and Colors")
  29. FSlateFontInfo RegularTextFont;
  30.  
  31. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Fonts and Colors")
  32. FSlateFontInfo BoldTextFont;
  33.  
  34. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Fonts and Colors")
  35. FSlateFontInfo ItalicTextFont;
  36.  
  37. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Fonts and Colors")
  38. FSlateFontInfo BoldItalicTextFont;
  39.  
  40. /** The time in milliseconds between each cursor blink. */
  41. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cursor")
  42. float CursorBlinkTimeMS;
  43.  
  44. UPROPERTY()
  45. FGetSlateFontInfo RegularTextFontDelegate;
  46.  
  47. UPROPERTY()
  48. FGetSlateFontInfo BoldTextFontDelegate;
  49.  
  50. UPROPERTY()
  51. FGetSlateFontInfo ItalicTextFontDelegate;
  52.  
  53. UPROPERTY()
  54. FGetSlateFontInfo BoldItalicTextFontDelegate;
  55.  
  56.  
  57. public:
  58. /** Called when a character is written to the standard input stream. */
  59. UPROPERTY(BlueprintAssignable, Category="Widget Event", meta=(DisplayName = "On Standard Input Character Written"))
  60. FOnStdInCharWrittenEvent OnStdInCharWritten;
  61.  
  62. /** Called when a line of text is written to the standard input stream. */
  63. UPROPERTY(BlueprintAssignable, Category = "Widget Event", meta = (DisplayName = "On Standard Input Line Written"))
  64. FOnStdInLineWrittenEvent OnStdInLineWritten;
  65.  
  66.  
  67. virtual void SynchronizeProperties() override;
  68. virtual void ReleaseSlateResources(bool bReleaseChildren) override;
  69.  
  70. #if WITH_EDITOR
  71. virtual const FText GetPaletteCategory() override;
  72. #endif
  73.  
  74. protected:
  75. TSharedPtr<SPeacegateTerminalWidget> MyPeacegateTerminalWidget;
  76.  
  77. PROPERTY_BINDING_IMPLEMENTATION(FSlateFontInfo, RegularTextFont);
  78. PROPERTY_BINDING_IMPLEMENTATION(FSlateFontInfo, BoldTextFont);
  79. PROPERTY_BINDING_IMPLEMENTATION(FSlateFontInfo, ItalicTextFont);
  80. PROPERTY_BINDING_IMPLEMENTATION(FSlateFontInfo, BoldItalicTextFont);
  81. };
Add Comment
Please, Sign In to add comment