Files
UnrealEngineUWP/Engine/Source/Developer/MessageLog/Private/Model/MessageLogListingModel.h
marc audy 4320117e97 Copying //UE4/Dev-Framework to //UE4/Dev-Main (Source: //UE4/Dev-Framework [at] 4343008)
#lockdown Nick.Penwarden
#rb
#rnx

============================
  MAJOR FEATURES & CHANGES
============================

Change 4289396 by Marc.Audy

	Fix get data table row result pin not properly updating if it was split.
	#jira UE-62896

Change 4289407 by Marc.Audy

	Don't allow set member input pin to be split at all
	#jira UE-62924

Change 4291871 by Mieszko.Zielinski

	Exporting EnvQueryGenerator_SimpleGrid with AIMODULE_API #UE4

	#jira UE-62697

Change 4292078 by Marc.Audy

	Fix GetDataTableRow title not updating when changing type

	#jira UE-62896

Change 4292770 by Dan.Oconnor

	Interpreter Optimization 7 of N: CPF_ZeroConstructor assigned for struct properties that that are User Defined Structs

Change 4293207 by Dan.Oconnor

	Interpreter Optimization 8 of N: CPF_IsPlainOldData and CPF_NoDestructor assigned for struct properties that that are User Defined Structs

Change 4297023 by Marc.Audy

	Remove dumb returns

Change 4298303 by Dan.Oconnor

	Fix for issues compiling blueprints after changing a UserDefinedStructure

	#jira UE-63002

Change 4301603 by Phillip.Kavan

	Fix incorrect code generation at cook time when Blueprint nativization is enabled for objects instanced through the editor and assigned to an instanced object reference property.

	Change summary:
	- Modified FEmitDefaultValueHelper::HandleSpecialTypes() to emit runtime code to look for an existing instance of a default subobject only if the 'RF_DefaultSubObject' flag is set on the source instance. This works around instances that return 'true' for IsDefaultSubobject() but were not created with CreateDefaultSubobject() (e.g. - instanced in the editor UI).

	#jira UE-62883

Change 4302720 by Dan.Oconnor

	Prevent user from entering 'None' as parameter name on a blueprint function

	#jira UE-63033

Change 4303695 by Fred.Kimberley

	Don't allow the user to attempt to import a csv unless they've specified the rowstruct for datatables or the interpolation for curve tables.

	#jira UE-62856

Change 4304633 by Ben.Zeigler

	#jira UE-63173 Fix crash ending PIE while a level is waiting to load, SetShouldForceUnloadStreamingLevels now actually force unloads levels

Change 4313208 by Dan.Oconnor

	Warn users when the outputs of a node that is pruned are used

	#jira UE-44518

Change 4313339 by Dan.Oconnor

	Interpreter Optimization 9 of N: Mark ubergraph function as final so that calls to it don't need to search the target object

Change 4313652 by Dan.Oconnor

	Don't warn when a non-pure node that is connected only via its exec is orphaned - fixes overzealous warnings EngineTest

	#jira None

Change 4313661 by Dan.Oconnor

	Comment typo fixes

Change 4313729 by Dan.Oconnor

	Avoid crashing when running the help command for the GenerateBlueprintAPICommandlet

	#jira UE-63283

Change 4318175 by Marc.Audy

	PR #5024: Require BlueprintAssignable delegate parameters to be supported by blueprints (Contributed by slonopotamus)
	#jira UE-635250

Change 4318302 by Marc.Audy

	Use define instead of duplicating text

Change 4318681 by Fred.Kimberley

	Don't allow users to try to rename rows to emtpy strings, whitespace only, or names that have invalid characters.

	#jira UE-63058

Change 4318683 by Fred.Kimberley

	Don't reorder the rowmap when removing a row.

	#jira UE-62754

Change 4318686 by Fred.Kimberley

	Get rid of the failed to import message when cancelling the import of a csv or json file.

	#jira UE-62625

Change 4318689 by Fred.Kimberley

	Back out changelist 4281972

Change 4318713 by Marc.Audy

	Validate CommutativeAssociativeBinaryOperator metadata in UHT and also at the K2Node level in case the function changes to an invalid construct later
	#jira UE-60186

Change 4319363 by Dan.Oconnor

	Warnings and errors generated by macro expansion now include a link back to the macro instance that created the suspect nodes

	#jira None

Change 4319559 by Dan.Oconnor

	PR #5028: UE-63225: Use correct source BP when retrieving the tooltip text (Contributed by projectgheist)

	#jira UE-63225

Change 4323740 by Marc.Audy

	Don't crash if an ICH is (somewhat surprisingly) missing
	#jira UE-63305

Change 4328877 by mason.seay

	BP for pin bug

Change 4336999 by Fred.Kimberley

	Unshelved from pending changelist '4299645':

	PR #5003: Changed SendGameplayEvent()'s category from "Abilities" to "Ability" for consistency (Contributed by rlabrecque)


	#jira UE-63067

Change 4337645 by Marc.Audy

	PR #5049: Make GetPlayerControllerID pure (Contributed by KristofMorva)
	#jira UE-63472

Change 4338211 by Phillip.Kavan

	Fix missing backend support for initializing a container variable (including unconnected function output pins) to a default (literal) value term in nativized Blueprint C++ code.

	Change summary:
	- Added a 'CoerceProperty' argument to FBlueprintCompilerCppBackEnd::TermToText() and FEmitHelper::LiteralTerm(). This is passed through as the LHS term's associated property when compiling 'KCST_Assignment' statements.
	- Modified FEmitHelper::LiteralTerm() to emit an initialization list to C++. This occurs when the RHS of a variable assignment statement is a literal container term, which includes the initialization of K2Node_FunctionResult pins to a default (empty) value.
	- Added FBlueprintCompilerCppBackEnd::TermToText() and FEmitHelper::LiteralTerm() methods that accept a struct value for specifying arguments rather than increasing the number of parameters with default values. Modified the implementations to match.

	#jira UE-48397

Change 4338908 by Marc.Audy

	Don't check when fetching world settings from IsPaused as it is already set up to handle it coming back null
	#jira UE-63583

Change 4339262 by Marc.Audy

	Add comments to ERedirectType

Change 4339718 by Mieszko.Zielinski

	Clearing editor world's EnvironmentQueryManager instace's LocalContextMap whenever a BP finished compiling #UE4

	#jira UE-63481

Change 4340548 by Marc.Audy

	ChildActor's need to be spawned from the ChildActorTemplate otherwise any non-replicated  customized properties will be incorrect on the Client.
	#jira UE-63427

Change 4340756 by Marc.Audy

	Don't allow a new pin to be matched twice
	#jira UE-63504

Change 4342704 by mason.seay

	Updated Pin Testing blueprints

Change 4319930 by Marc.Audy

	Mark FPartyState as a BlueprintType

Change 4329176 by Dan.Oconnor

	Add optional message identifier to tokenized message, use message identifier to facilitate suppressing a new warning in the blueprint compiler, remove the unused (and unusable) FTokenizedMiscData

	#jira None

Change 4337859 by Fred.Kimberley

	Fixing misc restricted gameplay tag UI bugs

	#jira UE-63600, UE-63602, UE-63603

#ROBOMERGE-OWNER: jason.bestimt
#ROBOMERGE-SOURCE: CL 4344176 in //UE4/Main/...
#ROBOMERGE-BOT: DEVVR (Main -> Dev-VR)

[CL 4344180 by marc audy in Dev-VR branch]
2018-09-05 09:57:16 -04:00

160 lines
4.9 KiB
C++

// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Containers/List.h"
#include "Logging/TokenizedMessage.h"
/** Define the container type for all the messages */
typedef TArray< TSharedRef<FTokenizedMessage> > MessageContainer;
/** This class represents a set of rich tokenized messages for a particular system */
class FMessageLogListingModel : public TSharedFromThis< FMessageLogListingModel >
{
protected:
struct FPage
{
FPage( const FText& InTitle )
: Title( InTitle )
{
}
/** The title of this page */
FText Title;
/** The list of messages in this log listing */
MessageContainer Messages;
};
public:
virtual ~FMessageLogListingModel() {}
/**
* Factory method which creates a new FMessageLogListingModel object
*
* @param InLogName The name of the log
*/
static TSharedRef< FMessageLogListingModel > Create( const FName& InLogName )
{
TSharedRef< FMessageLogListingModel > NewLogListing( new FMessageLogListingModel( InLogName ) );
return NewLogListing;
}
/** Broadcasts whenever the message log listing changes */
DECLARE_EVENT( FMessageLogListingModel, FChangedEvent )
FChangedEvent& OnChanged() { return ChangedEvent; }
/** Retrieves the name identifier for this log listing */
const FName& GetName() const { return LogName; }
/** Returns the message at the specified index */
const TSharedPtr<FTokenizedMessage> GetMessageAtIndex( const uint32 PageIndex, const int32 MessageIndex ) const;
/** Gets all messages as a string */
FText GetAllMessagesAsText(const uint32 PageIndex) const;
/** Obtains a const iterator to the message data structure */
MessageContainer::TConstIterator GetMessageIterator(uint32 PageIndex) const;
/** Replaces the message at the given index */
int32 ReplaceMessage( const TSharedRef< FTokenizedMessage >& NewMessage, const uint32 PageIndex, const int32 MessageIndex );
/** Appends a message */
void AddMessage( const TSharedRef< FTokenizedMessage >& NewMessage, bool bMirrorToOutputLog = true );
/** Appends multiple messages */
void AddMessages( const TArray< TSharedRef< FTokenizedMessage > >& NewMessages, bool bMirrorToOutputLog = true );
/** Clears all messages */
void ClearMessages();
/**
* Add a new page. Old pages are only kept around if they contain messages, so if the current
* page is empty, this call does nothing.
* @param InTitle The title that will be displayed for this page.
* @param InMaxPages The maximum number of pages we keep around. If the count is exceeded,
* we discard the oldest page.
*/
void NewPage( const FText& InTitle, uint32 InMaxPages );
/** Get the number of pages contained in this log */
uint32 NumPages() const;
/** Get the number of messages on the passed-in page */
uint32 NumMessages( uint32 PageIndex ) const;
/**
* Get the title of the page at the specified index
* @param PageIndex The index of the page
*/
const FText& GetPageTitle( const uint32 PageIndex ) const;
/** Helper function for RemoveDuplicates(), exposed so the ViewModel can use it too */
static bool AreMessagesEqual(const TSharedRef< FTokenizedMessage >& Message0, const TSharedRef< FTokenizedMessage >& Message1);
/** Remove any messages that are duplicates of one another - O(n) */
void RemoveDuplicates(uint32 PageIndex);
protected:
/** Will broadcast to all registered observers informing them of a change */
virtual void Notify() { ChangedEvent.Broadcast(); }
/** Access the current page (we only add messages to this page */
FPage& CurrentPage() const;
/** Get a page by index - uses cache to speed up linked list access */
FPage* PageAtIndex(const uint32 PageIndex) const;
/** Create a new page if we have one pending */
void CreateNewPageIfRequired();
private:
/**
* FMessageLogListingModel Constructor
*
* @param InLogName The name of the log
*/
FMessageLogListingModel( const FName& InLogName )
: LogName( InLogName )
, bIsPrintingToOutputLog( false )
{
check( LogName != NAME_None );
// create default page
Pages.AddTail(FPage(FText::FromName(LogName)));
CachedPage = &Pages.GetTail()->GetValue();
CachedPageIndex = 0;
}
/** Helper function for AddMessage and AddMessages */
void AddMessageInternal( const TSharedRef<FTokenizedMessage>& NewMessage, bool bMirrorToOutputLog );
private:
/** The name of a pending page */
FText PendingPageName;
/** The cap on the number of pages we have */
uint32 MaxPages;
/** The list of pages in this log listing */
TDoubleLinkedList<FPage> Pages;
/** Name of the listing, for identification */
FName LogName;
/** Delegate to call when data is changed */
FChangedEvent ChangedEvent;
// Are we currently processing the output log mirror? If so, we drop any additional messages we receive, as they are duplicates
bool bIsPrintingToOutputLog;
/** Cached page index */
mutable uint32 CachedPageIndex;
/** Cached page */
mutable FPage* CachedPage;
};