Navigation
API > API/Plugins > API/Plugins/ModelingComponents
A simple manager class to track transactions that will be open for a duration of time, e.g. during a mouse drag, within a single tool or mechanic. Provides some error checking to help catch cases where we open without closing or close without opening, or if we nest opening more transactions than expected. One way these can be used is to keep a transaction open during a mouse drag interaction as a way to prevent the user from undoing during the mouse drag. Otherwise, undoing during a mouse drag can cause bugs in many tools if they are not careful to undo any pending work in OnTerminateDragSequence.
| Name | FLongTransactionTracker |
| Type | class |
| Header File | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/TransactionUtil.h |
| Include Path | #include "TransactionUtil.h" |
Syntax
class FLongTransactionTracker
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FLongTransactionTracker
(
int32 MaxOpen |
TransactionUtil.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FLongTransactionTracker() |
TransactionUtil.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| MaxOpen | int32 | Maximum number of long transactions we allow to be open at once before triggering an ensure() | TransactionUtil.h | |
| OpenCount | int32 | Current number of open long transactions we are tracking. (Note only the first will actually call BeginUndoTransaction) | TransactionUtil.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Close
(
UInteractiveToolManager* ToolManager |
Close a single long transaction. Expect that at least one is open. | TransactionUtil.h | |
void CloseAll
(
UInteractiveToolManager* ToolManager |
Close any/all open transactions as part of shutdown of the owning tool/mechanic. Always safe to call on shutdown; OK if none are open. | TransactionUtil.h | |
void Open
(
FText TransactionName, |
Open a single long transaction. | TransactionUtil.h |