Space Plunder
Loading...
Searching...
No Matches
ChatSystemComponent.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 "Components/ActorComponent.h"
7#include "Data/BaseData.h"
9#include "ChatSystemComponent.generated.h"
10
11
12
13UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent))
14class CHATSYSTEM_API UChatSystemComponent : public UActorComponent//, public IChatInterface
15{
16 GENERATED_BODY()
17
18public:
19 UChatSystemComponent();
20
21 UFUNCTION(BlueprintCallable, Category="Chat System")
22 void ToggleChatWindow(bool bOpen);
23 UFUNCTION(BlueprintCallable, Category="Chat System")
24 void SetPlayerUserProfile(FUserProfile UserProfile);
25 UFUNCTION(BlueprintCallable, Category="Chat System")
26 void SetOwnerPlayerController(APlayerController* OwnerController){OwnerPlayerController = OwnerController;};
27
28 UFUNCTION(BlueprintCallable, Category="Chat System")
29 void SetChatBoxWidget(class UChatBoxWidget* ChatBox){ChatBoxWidget = ChatBox;};
30 UFUNCTION(BlueprintPure, BlueprintCallable, Category="Chat System")
31 bool GetIsChatBoxOpen() const {return bChatOpen;};
32
33 UFUNCTION(BlueprintCallable, Category="Chat System")
34 void ComponentSetup();
35
36
37protected:
38 UFUNCTION(Server, Reliable, Category="Chat System")
39 void ServerEnterText(const FString& Message, EChatSystemMessageType MessageType,const FString& PlayerName, EChatSystemCategory Category);
40 UFUNCTION(NetMulticast, Reliable, Category="Chat System")
41 void MulticastSendMessage(const FString& Text, EChatSystemMessageType MessageType,const FString& PlayerName, EChatSystemCategory Category);
42 UFUNCTION(BlueprintCallable, Category="Chat System")
43 void EnterText(const FString& Message, EChatSystemMessageType MessageType, EChatSystemCategory Category);
44
45 UFUNCTION(BlueprintCallable, Category="Chat System")
46 void CreateChatOverlayWidget();
47
48 //- Commands //
49 UFUNCTION(BlueprintCallable, Category="Chat System")
50 void ExecuteCommand(const EChatSystemCommandType CommandType, const FString& Argument);
51
52 UFUNCTION(BlueprintCallable, Category="Chat System|Commands")
53 void ClearChat() const;
54 UFUNCTION(BlueprintCallable, Category="Chat System|Commands")
55 void ShowHelpCommands();
56 UFUNCTION(BlueprintCallable, Category="Chat System|Commands")
57 void MutePlayer(const FString& Argument);
58
59 UFUNCTION(BlueprintCallable, Category="Chat System|Commands")
60 void SendTeamMessage(const FString& Argument);
61 UFUNCTION(BlueprintCallable, Category="Chat System|Commands")
62 void SendPrivateMessage(const FString& Argument);
63 UFUNCTION(BlueprintCallable, Category="Chat System|Commands")
64 void SendDirectMessage(const FString& Argument);
65 UFUNCTION(BlueprintCallable, Category="Chat System|Commands")
66 void SendGuildMessage(const FString& Argument);
67
68 UFUNCTION(BlueprintCallable, Category="Chat System|Commands")
69 void SendServerCommand(const FString& Argument);
70 UFUNCTION(BlueprintCallable, Category="Chat System|Commands")
71 void SendClientCommand(const FString& Argument);
72
73
74
75 UFUNCTION(BlueprintCallable, Category="Chat System")
76 void SendWelcomeMessage();
77
78 UFUNCTION(BlueprintCallable, Category="Chat System")
79 bool GetPlayerProfile();
80
81 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Chat System|Hint")
82 FString OpenChatText;
83 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Hint")
84 FString OpenChatHintStart = "Press";
85 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Hint")
86 FString OpenChatHintEnd = "To Open Chat";
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Hint")
88 FString OpenChatKey = "[Enter]";
89 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Join Message")
90 FString JoinMessageText = "Welcome to the server!";
91 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Join Message")
92 FString HelpText = "Commands \n /Help - Show Commands \n /Clear - Clear Chat \n /Server - Server Function \n /Client - Client Only Function \n /Direct [Player] - Direct Message Player \n /Private [Players] - Private message players \n /Team - Message Only Team \n /Guild - Message only Guild";
93 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Widget")
94 float TextLifetime = 15.0f;
95
96 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Join Message")
97 bool bShowWelcomeMessage = false;
98
99 //- ERROR CODE //
100 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Chat System|Player")
101 FUserProfile PlayerProfile;
102
103 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Chat System|Player")
104 class UChatBoxWidget* ChatBoxWidget;
105
106 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Chat System|Player")
107 bool bUsesHUDWidgets = true;
108 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Chat System|Debugging")
109 bool bDebuggingMode = false;
110
111
112
113private:
114
115 UFUNCTION()
116 void SendChatMessage(FString Text, EChatSystemMessageType MessageType, FString PlayerName, EChatSystemCategory Category);
117
118 bool bChatOpen = false;
119
120
121 UPROPERTY()
122 APlayerController* OwnerPlayerController;
123
124 UPROPERTY(EditAnywhere, Category="Chat System|Widget")
125 TSubclassOf<class UChatBoxWidget> ChatBoxWidgetClass;
126 UPROPERTY(EditAnywhere, Category="Chat System|Widget")
127 TSubclassOf<class UChatTextWidget> ChatTextWidgetClass;
128
129};
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 BaseData.h:1239