You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
[INTEGRATE] Merging using UE4-To-UE4-LauncherDev, integrate all up to cl 2496104 from the LauncherDev branch. updated friends and chat module, lib curl updates, portal related fixes
[CL 2499790 by Carlos Cuello in Main branch]
This commit is contained in:
committed by
Carlos.Cuello@epicgames.com
parent
4c32e9b533
commit
65c6b1a695
@@ -0,0 +1,95 @@
|
||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "FriendsAndChatPrivatePCH.h"
|
||||
#include "ClanViewModel.h"
|
||||
#include "ClanListViewModel.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FriendsAndChat"
|
||||
|
||||
class FClanListViewModelImpl : public FClanListViewModel
|
||||
{
|
||||
public:
|
||||
|
||||
FClanListViewModelImpl(const TSharedRef<FClanViewModel>& ClanViewModel, EClanDisplayLists::Type ListType)
|
||||
: ViewModel(ClanViewModel)
|
||||
, ListType(ListType)
|
||||
{
|
||||
}
|
||||
|
||||
~FClanListViewModelImpl()
|
||||
{
|
||||
Uninitialize();
|
||||
}
|
||||
|
||||
virtual const TArray<TSharedRef<IClanInfo>>& GetClanList() const override
|
||||
{
|
||||
return ClanList;
|
||||
}
|
||||
|
||||
virtual FText GetListCountText() const override
|
||||
{
|
||||
return FText::AsNumber(ClanList.Num());
|
||||
}
|
||||
|
||||
virtual int32 GetListCount() const override
|
||||
{
|
||||
return ClanList.Num();
|
||||
}
|
||||
|
||||
virtual const FText GetListName() const override
|
||||
{
|
||||
return EClanDisplayLists::ToFText(ListType);
|
||||
}
|
||||
|
||||
virtual const EClanDisplayLists::Type GetListType() const override
|
||||
{
|
||||
return ListType;
|
||||
}
|
||||
|
||||
virtual EVisibility GetListVisibility() const override
|
||||
{
|
||||
return ClanList.Num() > 0 ? EVisibility::Visible : EVisibility::Collapsed;
|
||||
}
|
||||
|
||||
DECLARE_DERIVED_EVENT(FClanListViewModelImpl, FClanListViewModel::FClanListUpdated, FClanListUpdated);
|
||||
virtual FClanListUpdated& OnClanListUpdated() override
|
||||
{
|
||||
return ClanListUpdatedEvent;
|
||||
}
|
||||
|
||||
private:
|
||||
void Initialize()
|
||||
{
|
||||
RefreshClanList();
|
||||
}
|
||||
|
||||
void Uninitialize()
|
||||
{
|
||||
}
|
||||
|
||||
void RefreshClanList()
|
||||
{
|
||||
ViewModel->EnumerateJoinedClans(ClanList);
|
||||
ClanListUpdatedEvent.Broadcast();
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
const TSharedRef<FClanViewModel> ViewModel;
|
||||
const EClanDisplayLists::Type ListType;
|
||||
|
||||
/** Holds the list of clans. */
|
||||
TArray<TSharedRef<IClanInfo>> ClanList;
|
||||
FClanListUpdated ClanListUpdatedEvent;
|
||||
|
||||
friend FClanListViewModelFactory;
|
||||
};
|
||||
|
||||
TSharedRef< FClanListViewModel > FClanListViewModelFactory::Create(const TSharedRef<class FClanViewModel>& ClanViewModel, EClanDisplayLists::Type ListType)
|
||||
{
|
||||
TSharedRef< FClanListViewModelImpl > ViewModel(new FClanListViewModelImpl(ClanViewModel, ListType));
|
||||
ViewModel->Initialize();
|
||||
return ViewModel;
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
Reference in New Issue
Block a user