Files
UnrealEngineUWP/Engine/Source/Editor/UnrealEd/Private/GrassRenderingNotification.cpp
Jack Porter 7db2b69955 Automatically flush landscape grass when changing or recompiling the material
Automatically generate grass maps for all components, streaming in textures and weightmaps where needed
Status window when building grass maps
Grass data is now shared between Editor and PIE
Fixed issue where it didn't wait for streaming after updating grass map after painting landscape

[CL 2425895 by Jack Porter in Main branch]
2015-01-30 11:17:08 -05:00

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);
}
}