Space Plunder
Loading...
Searching...
No Matches
ChatBoxWidget.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Blueprint/UserWidget.h"
7#include "Data/ChatData.h"
8#include "ChatBoxWidget.generated.h"
9
10
12DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnExecuteCommand, const EChatSystemCommandType, CommandType, const FString&, Argument);
13DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnSendMessage,const FString&, Message, EChatSystemMessageType, MessageType, EChatSystemCategory, ChatType);
14
15UCLASS()
16class CHATSYSTEM_API UChatBoxWidget : public UUserWidget
17{
18 GENERATED_BODY()
19
20
21public:
22 UPROPERTY(BlueprintAssignable, Category="Chat System|Widget")
23 FOnChatToggled OnChatToggled;
24 UPROPERTY(BlueprintAssignable, Category="Chat System|Widget")
25 FOnExecuteCommand OnExecuteCommand;
26 UPROPERTY(BlueprintAssignable, Category="Chat System|Widget")
27 FOnSendMessage OnSendMessage;
28
29 virtual void NativeConstruct() override;
30
31 void SetHintChatText(FString HintText);
32
33 UFUNCTION()
34 void OnSentChatMessage(const FString& Text);
35
36 UFUNCTION(BlueprintCallable, Category="Chat System|Widget")
37 void ToggleChat(bool bOpen);
38
39 UFUNCTION(BlueprintImplementableEvent, Category="Chat System|Widget")
40 void MessageReceived();
41
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Widget")
44
45 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Widget")
46 FString CommandsPrefix = "/";
47 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Widget")
48 TArray<FString> AllChatCommands;
49 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Widget")
50 FString CleanCommandString;
51 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Widget")
52 FString RawCommandString;
53
54
55 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
56 class UScrollBox* ChatScrollBox;
57 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
58 class UChatTextFieldWidget* ChatTextFieldWidget;
59protected:
60
61
62 bool GetCommandAndArguments(const FString& Text, EChatSystemCommandType& Command, FString& Arguments);
63};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnExecuteCommand, const EChatSystemCommandType, CommandType, const FString &, Argument)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnSendMessage, const FString &, Message, EChatSystemMessageType, MessageType, EChatSystemCategory, ChatType)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnChatToggled, bool, bOpen)
EChatSystemCategory
Definition ChatData.h:14
EChatSystemMessageType
Definition ChatData.h:25
EChatSystemCommandType
Definition ChatData.h:37
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition ChatBoxWidget.h:17
Definition ChatTextFieldWidget.h:15