Files
UnrealEngineUWP/Engine/Source/Developer/FriendsAndChat/Private/FriendsFontStyleService.cpp

55 lines
1.3 KiB
C++
Raw Normal View History

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "FriendsAndChatPrivatePCH.h"
#include "FriendsFontStyleService.h"
class FFriendsFontStyleServiceImpl
: public FFriendsFontStyleService
{
public:
virtual void SetFontStyles(const FFriendsFontStyle& InFriendsNormalFontStyle) override
{
FriendsNormalFontStyle = InFriendsNormalFontStyle;
}
virtual void SetUserFontSize(EChatFontType::Type InFontSize) override
{
FontSize = InFontSize;
}
virtual FSlateFontInfo GetNormalFont() override
{
if (FontSize == EChatFontType::Large)
{
return FriendsNormalFontStyle.FriendsFontLarge;
}
return FriendsNormalFontStyle.FriendsFontNormal;
}
virtual FSlateFontInfo GetNormalBoldFont() override
{
if (FontSize == EChatFontType::Large)
{
return FriendsNormalFontStyle.FriendsFontLargeBold;
}
return FriendsNormalFontStyle.FriendsFontNormalBold;
}
private:
FFriendsFontStyleServiceImpl()
{
FontSize = EChatFontType::Standard;
}
FFriendsFontStyle FriendsNormalFontStyle;
EChatFontType::Type FontSize;
friend FFriendsFontStyleServiceFactory;
};
TSharedRef< FFriendsFontStyleService > FFriendsFontStyleServiceFactory::Create()
{
TSharedRef< FFriendsFontStyleServiceImpl > StyleService(new FFriendsFontStyleServiceImpl());
return StyleService;
}