You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
35 lines
1.3 KiB
C++
35 lines
1.3 KiB
C++
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||
|
|
|
||
|
|
#include "UnrealEd.h"
|
||
|
|
#include "GlobalEditorNotification.h"
|
||
|
|
#include "Landscape.h"
|
||
|
|
#include "SNotificationList.h"
|
||
|
|
|
||
|
|
/** Notification class for grassmmap rendering. */
|
||
|
|
class FGrassRenderingNotificationImpl : public FGlobalEditorNotification
|
||
|
|
{
|
||
|
|
protected:
|
||
|
|
/** FGlobalEditorNotification interface */
|
||
|
|
virtual bool ShouldShowNotification(const bool bIsNotificationAlreadyActive) const override;
|
||
|
|
virtual void SetNotificationText(const TSharedPtr<SNotificationItem>& InNotificationItem) const override;
|
||
|
|
};
|
||
|
|
|
||
|
|
/** Global notification object. */
|
||
|
|
FGrassRenderingNotificationImpl GGrassRenderingNotification;
|
||
|
|
|
||
|
|
bool FGrassRenderingNotificationImpl::ShouldShowNotification(const bool bIsNotificationAlreadyActive) const
|
||
|
|
{
|
||
|
|
return ALandscapeProxy::TotalComponentsNeedingGrassMapRender > 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
void FGrassRenderingNotificationImpl::SetNotificationText(const TSharedPtr<SNotificationItem>& InNotificationItem) const
|
||
|
|
{
|
||
|
|
if (ALandscapeProxy::TotalComponentsNeedingGrassMapRender > 0)
|
||
|
|
{
|
||
|
|
FFormatNamedArguments Args;
|
||
|
|
Args.Add(TEXT("OutstandingGrassMaps"), FText::AsNumber(ALandscapeProxy::TotalComponentsNeedingGrassMapRender));
|
||
|
|
const FText ProgressMessage = FText::Format(NSLOCTEXT("GrassMapRender", "GrassMapRenderFormat", "Building Grass Maps ({OutstandingGrassMaps})"), Args);
|
||
|
|
InNotificationItem->SetText(ProgressMessage);
|
||
|
|
}
|
||
|
|
}
|