You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
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]
154 lines
4.5 KiB
C++
154 lines
4.5 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "FriendsAndChatPrivatePCH.h"
|
|
#include "ChatItemViewModel.h"
|
|
#include "ChatViewModel.h"
|
|
|
|
class FChatViewModelImpl
|
|
: public FChatViewModel
|
|
{
|
|
public:
|
|
|
|
virtual TArray< TSharedRef<class FChatItemViewModel > >& GetFilteredChatList() override
|
|
{
|
|
return FilteredChatLists;
|
|
}
|
|
|
|
virtual void HandleSelectionChanged(TSharedPtr<FChatItemViewModel> ItemSelected, ESelectInfo::Type SelectInfo) override
|
|
{
|
|
if( ItemSelected.IsValid())
|
|
{
|
|
SetChatChannel(ItemSelected->GetMessageType());
|
|
if(SelectedChatChannel == EChatMessageType::Whisper)
|
|
{
|
|
SelectedFriend = ItemSelected->GetFriendID();
|
|
}
|
|
}
|
|
}
|
|
|
|
virtual FText GetViewGroupText() const override
|
|
{
|
|
return EChatMessageType::ToText(SelectedViewChannel);
|
|
}
|
|
|
|
virtual FText GetChatGroupText() const override
|
|
{
|
|
return SelectedChatChannel == EChatMessageType::Whisper ? SelectedFriend : EChatMessageType::ToText(SelectedChatChannel);
|
|
}
|
|
|
|
virtual void EnumerateChatChannelOptionsList(TArray<EChatMessageType::Type>& OUTChannelType) override
|
|
{
|
|
OUTChannelType.Add(EChatMessageType::Global);
|
|
OUTChannelType.Add(EChatMessageType::Party);
|
|
}
|
|
|
|
virtual void SetChatChannel(const EChatMessageType::Type NewOption) override
|
|
{
|
|
SelectedChatChannel = NewOption;
|
|
}
|
|
|
|
virtual void SetViewChannel(const EChatMessageType::Type NewOption) override
|
|
{
|
|
SelectedViewChannel = NewOption;
|
|
SelectedChatChannel = NewOption;
|
|
FilterChatList();
|
|
}
|
|
|
|
virtual void SendMessage(const FText NewMessage) override
|
|
{
|
|
TSharedPtr< FChatMessage > FriendItem = MakeShareable(new FChatMessage());
|
|
FriendItem->FriendID = SelectedFriend;
|
|
FriendItem->Message = NewMessage;
|
|
FriendItem->MessageType = SelectedChatChannel;
|
|
FriendItem->MessageTimeText = FText::AsTime(FDateTime::Now());
|
|
FriendItem->bIsFromSelf = true;
|
|
ChatLists.Add(FChatItemViewModelFactory::Create(FriendItem.ToSharedRef()));
|
|
FilterChatList();
|
|
}
|
|
|
|
DECLARE_DERIVED_EVENT(FChatViewModelImpl , FChatViewModel::FChatListUpdated, FChatListUpdated);
|
|
virtual FChatListUpdated& OnChatListUpdated() override
|
|
{
|
|
return ChatListUpdatedEvent;
|
|
}
|
|
|
|
~FChatViewModelImpl()
|
|
{
|
|
Uninitialize();
|
|
}
|
|
|
|
|
|
private:
|
|
void Initialize()
|
|
{
|
|
// Create some fake data. TODO: Hook up to chat message discovery once OSS system is ready. Probably just registed for callbacks
|
|
TSharedPtr< FChatMessage > FriendItem = MakeShareable(new FChatMessage());
|
|
FriendItem->FriendID = FText::FromString("Bob");
|
|
FriendItem->Message = FText::FromString("How are you");
|
|
FriendItem->MessageType = EChatMessageType::Whisper;
|
|
FriendItem->MessageTimeText = FText::AsTime(FDateTime::Now());
|
|
FriendItem->bIsFromSelf = false;
|
|
ChatLists.Add(FChatItemViewModelFactory::Create(FriendItem.ToSharedRef()));
|
|
|
|
TSharedPtr< FChatMessage > FriendItem1 = MakeShareable(new FChatMessage());
|
|
FriendItem1->FriendID = FText::FromString("Dave");
|
|
FriendItem1->Message = FText::FromString("Join the game test test test test test test test!");
|
|
FriendItem1->MessageType = EChatMessageType::Party;
|
|
FriendItem1->MessageTimeText = FText::AsTime(FDateTime::Now());
|
|
FriendItem1->bIsFromSelf = false;
|
|
ChatLists.Add(FChatItemViewModelFactory::Create(FriendItem1.ToSharedRef()));
|
|
|
|
TSharedPtr< FChatMessage > FriendItem2 = MakeShareable(new FChatMessage());
|
|
FriendItem2->FriendID = FText::FromString("JB");
|
|
FriendItem2->Message = FText::FromString("Hello");
|
|
FriendItem2->MessageType = EChatMessageType::Global;
|
|
FriendItem2->MessageTimeText = FText::AsTime(FDateTime::Now());
|
|
FriendItem2->bIsFromSelf = false;
|
|
ChatLists.Add(FChatItemViewModelFactory::Create(FriendItem2.ToSharedRef()));
|
|
|
|
FilterChatList();
|
|
}
|
|
|
|
void Uninitialize()
|
|
{
|
|
}
|
|
|
|
|
|
void FilterChatList()
|
|
{
|
|
FilteredChatLists.Empty();
|
|
for (const auto& ChatItem : ChatLists)
|
|
{
|
|
if(ChatItem->GetMessageType() <= SelectedViewChannel)
|
|
{
|
|
FilteredChatLists.Add(ChatItem);
|
|
}
|
|
}
|
|
ChatListUpdatedEvent.Broadcast();
|
|
}
|
|
|
|
FChatViewModelImpl()
|
|
: SelectedViewChannel(EChatMessageType::Global)
|
|
, SelectedChatChannel(EChatMessageType::Global)
|
|
, SelectedFriend(FText::GetEmpty())
|
|
{
|
|
}
|
|
|
|
private:
|
|
friend FChatViewModelFactory;
|
|
|
|
TArray<TSharedRef<FChatItemViewModel> > ChatLists;
|
|
TArray<TSharedRef<FChatItemViewModel> > FilteredChatLists;
|
|
FChatListUpdated ChatListUpdatedEvent;
|
|
|
|
EChatMessageType::Type SelectedViewChannel;
|
|
EChatMessageType::Type SelectedChatChannel;
|
|
FText SelectedFriend;
|
|
};
|
|
|
|
TSharedRef< FChatViewModel > FChatViewModelFactory::Create()
|
|
{
|
|
TSharedRef< FChatViewModelImpl > ViewModel(new FChatViewModelImpl());
|
|
ViewModel->Initialize();
|
|
return ViewModel;
|
|
} |