Files
UnrealEngineUWP/Engine/Source/Developer/FriendsAndChat/Private/Models/ChatItemViewModel.cpp
Ben Zeigler 02a9e1dd4e Merging Dev -> Main using UE4-Fortnite-To-UE4 from CL 2340802
Includes following engine changes:

Getting display metrics only once at construct time when using SSafeZone. GetDisplayMetrics is expensive in Windows so it is impractical to call it every frame.
- Some AI API improvements, mostly switchig pointer function parameters to references.
- minor refactor of UCrowdFollowingComponent's queryinf functions:
    - IsCrowd*Enabled functions refactored to  IsCrowd*Active
    - implemented IsCrowd*Enabled that return acrual values of relevant properties
- Added a function to CrowdManager to query for location of agents neighbouring given agent
Added support for PS4 touchpad-based cursor
You can now choose to skip synchronously scanning for asset data in object libraries and just use the data that is currently in the asset registry. The data will be refereshed automatically later once the global scan completes. The only applies to non-commandlet editor instances.
Crash fixes for trying to access NULL Metal surfaces on IOS
Slate: Cleaned up some atlas code related to padding and corrected some comments

[CL 2347323 by Ben Zeigler in Main branch]
2014-11-03 15:47:28 -05:00

88 lines
1.7 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "FriendsAndChatPrivatePCH.h"
#include "ChatItemViewModel.h"
class FChatItemViewModelImpl
: public FChatItemViewModel
{
public:
~FChatItemViewModelImpl()
{
Uninitialize();
}
virtual FText GetMessage() override
{
return ChatMessage->Message;
}
virtual const EChatMessageType::Type GetMessageType() const override
{
return ChatMessage->MessageType;
}
virtual FText GetMessageTypeText() override
{
return EChatMessageType::ToText(ChatMessage->MessageType);
}
virtual FText GetFriendID() override
{
return ChatMessage->FriendID;
}
virtual FText GetMessageTime() override
{
return ChatMessage->MessageTimeText;
}
virtual FSlateColor GetDisplayColor() override
{
// TODO: Add chat colors to style
switch(ChatMessage->MessageType)
{
case EChatMessageType::Global: return FLinearColor::White; break;
case EChatMessageType::Whisper: return FLinearColor::Yellow; break;
case EChatMessageType::Party: return FLinearColor::Green; break;
default:
return FLinearColor::Gray;
}
}
const bool IsFromSelf() const override
{
return ChatMessage->bIsFromSelf;
}
private:
void Initialize()
{
}
void Uninitialize()
{
}
FChatItemViewModelImpl(TSharedRef<FChatMessage> ChatMessage)
: ChatMessage(ChatMessage)
{
}
private:
TSharedRef<FChatMessage> ChatMessage;
private:
friend FChatItemViewModelFactory;
};
TSharedRef< FChatItemViewModel > FChatItemViewModelFactory::Create(
const TSharedRef<FChatMessage>& ChatMessage)
{
TSharedRef< FChatItemViewModelImpl > ViewModel(new FChatItemViewModelImpl(ChatMessage));
ViewModel->Initialize();
return ViewModel;
}