UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LocalMessage.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3//=============================================================================
4// LocalMessage
5//
6// LocalMessages are abstract classes which contain an array of localized text.
7// The PlayerController function ReceiveLocalizedMessage() is used to send messages
8// to a specific player by specifying the LocalMessage class and index. This allows
9// the message to be localized on the client side, and saves network bandwidth since
10// the text is not sent. Actors (such as the GameMode) use one or more LocalMessage
11// classes to send messages.
12//
13//=============================================================================
14
15#pragma once
16
17#include "CoreMinimal.h"
19#include "UObject/Object.h"
20#include "LocalMessage.generated.h"
21
23class APlayerState;
24
26USTRUCT()
28{
29 //always need to be here
31
32 UPROPERTY()
34
35 UPROPERTY()
36 FName MessageType;
37
38 UPROPERTY()
39 int32 MessageIndex;
40
41 UPROPERTY()
42 FString MessageString;
43
44 UPROPERTY()
45 TObjectPtr<APlayerState> RelatedPlayerState_1;
46
47 UPROPERTY()
48 TObjectPtr<APlayerState> RelatedPlayerState_2;
49
50 UPROPERTY()
51 TObjectPtr<UObject> OptionalObject;
52
54};
55
56UCLASS(abstract, MinimalAPI)
58{
61 virtual void ClientReceive(const FClientReceiveData& ClientData) const PURE_VIRTUAL(ULocalMessage::ClientReceive,);
62};
63
64
65
#define PURE_VIRTUAL(func,...)
Definition CoreMiscDefines.h:103
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
Definition PlayerController.h:261
Definition PlayerState.h:42
Definition NameTypes.h:617
Definition LocalMessage.h:58
Definition Object.h:95
Definition LocalMessage.h:28
Definition ObjectPtr.h:488