Files
UnrealEngineUWP/Engine/Source/Editor/MaterialEditor/Private/MaterialExpressionClasses.h
Michael Schoell db9c8e2240 UProperty and UFunction metadata for Category can now be localized and have improved FText usage throughout the editor (Blueprints, Behavior Trees, Materials, etc).
Big conversion of FStrings and FNames to FText.

Version bump to move some MaterialFunction UProperty from a TArray<FString> to TArray<FText> (some Engine assets are older than being allowed to auto-convert the UProperty)

Auto conversion of FName to FText (and back) now supported (as well as TArrays of those types).

Searching categories by both the localized string and the source string is now supported in Blueprints.

#jira UE-14481 - We are missing ability to translate node categories

#codereview Justin.Sargent

[CL 2542875 by Michael Schoell in Main branch]
2015-05-08 10:46:42 -04:00

71 lines
1.9 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MaterialEditor.h"
class MaterialExpressionClasses
{
public:
/** Gets singleton instance */
static MaterialExpressionClasses* Get();
/**
* Checks if the given expression is in the favorites list...
*
* @param InExpression The expression to check for.
*
* @return bool true if it's in the list, false if not.
*/
bool IsMaterialExpressionInFavorites(UMaterialExpression* InExpression);
/**
* Remove the expression from the favorites menu list.
*/
void RemoveMaterialExpressionFromFavorites(UClass* InExpression);
/**
* Add the expression to the favorites menu list.
*/
void AddMaterialExpressionToFavorites(UClass* InExpression);
/** array of UMaterialExpression-derived classes, shared between all material editor instances. */
TArray<struct FMaterialExpression> AllExpressionClasses;
TArray<struct FMaterialExpression> FavoriteExpressionClasses;
/** array of UMaterialExpression-derived classes, shared between all material editor instances. */
TArray<struct FCategorizedMaterialExpressionNode> CategorizedExpressionClasses;
TArray<struct FMaterialExpression> UnassignedExpressionClasses;
private:
MaterialExpressionClasses();
virtual ~MaterialExpressionClasses();
/**
*
*/
const UStruct* GetExpressionInputStruct();
/**
* Grab the expression array for the given category.
*
* @param InCategoryName The category to retrieve
* @param bCreate If true, create the entry if not found.
*
* @return The category node.
*/
struct FCategorizedMaterialExpressionNode* GetCategoryNode(const FText& InCategoryName, bool bCreate);
/**
* Initializes the list of UMaterialExpression-derived classes shared between all material editor instances.
*/
void InitMaterialExpressionClasses();
/**
* true if the list of UMaterialExpression-derived classes shared between material
* editors has already been created.
*/
bool bInitialized;
};