2014-03-14 14:13:41 -04:00
|
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
/*=============================================================================
|
|
|
|
|
FriendsAndChatModule.cpp: Implements the FFriendsAndChatModule.
|
|
|
|
|
=============================================================================*/
|
|
|
|
|
|
|
|
|
|
#include "FriendsAndChatPrivatePCH.h"
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implements the FriendsAndChat module.
|
|
|
|
|
*/
|
|
|
|
|
class FFriendsAndChatModule
|
|
|
|
|
: public IFriendsAndChatModule
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// Begin IFriendsAndChatModule interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void Init( bool bAllowJoinGame ) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
FFriendsAndChatManager::Get()->Init( FriendsListNotificationDelegate );
|
|
|
|
|
FFriendsMessageManager::Get()->Init( FriendsListNotificationDelegate, bAllowJoinGame );
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void SetUnhandledNotification( TSharedRef< FUniqueNetId > NetID ) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
FFriendsMessageManager::Get()->SetUnhandledNotification( NetID );
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual FOnFriendsNotification& OnFriendsListNotification() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return FriendsListNotificationDelegate;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void CreateFriendsListWidget( TSharedPtr<const SWidget> ParentWidget, const FFriendsAndChatStyle* InStyle ) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
FFriendsAndChatManager::Get()->GenerateFriendsWindow( ParentWidget, InStyle );
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual TSharedPtr< SWidget > GenerateFriendsListWidget( const struct FFriendsAndChatStyle* InStyle ) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return FFriendsAndChatManager::Get()->GenerateFriendsListWidget( InStyle );
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void SetInSession( bool bInSession ) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
FFriendsAndChatManager::Get()->SetInSession( bInSession );
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void ClearGameInvites() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
FFriendsMessageManager::Get()->ClearGameInvites();
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual int32 GetFriendCount() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return FFriendsAndChatManager::Get()->GetFriendCount();
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void Logout() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
FFriendsAndChatManager::Get()->Logout();
|
|
|
|
|
FFriendsMessageManager::Get()->Logout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// End IFriendsAndChatModule interface
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// Begin IModuleInterface interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void StartupModule() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
// Make sure the singletons are created
|
|
|
|
|
FFriendsAndChatManager::Get();
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void ShutdownModule() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
FFriendsAndChatManager::Shutdown();
|
|
|
|
|
}
|
|
|
|
|
// End IModuleInterface interface
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// Holds the Notification delegate
|
|
|
|
|
FOnFriendsNotification FriendsListNotificationDelegate;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE( FFriendsAndChatModule, FriendsAndChat );
|