Class FZagalaSpecFeatureEditorContext#

Inheritance Relationships#

Base Type#

  • public TSharedFromThis< FZagalaSpecFeatureEditorContext >

Class Documentation#

class FZagalaSpecFeatureEditorContext : public TSharedFromThis<FZagalaSpecFeatureEditorContext>#

The state shared by the tabs of a feature editor: the feature, the rows of its document and the selected row.

The context is the only thing the tabs need to know about each other: the document tab writes the selection and reads the rows, the details tab reads the selection. Rows are rebuilt from the feature with the module’s feature layout whenever the feature changes.

Public Functions

explicit FZagalaSpecFeatureEditorContext(UObject *InFeature, FNotifyHook *InNotifyHook = nullptr)#
Parameters:
  • InFeature – The feature (an object implementing IZagalaSpecFeature) being edited.

  • InNotifyHook – Notified when a property is changed through the details panel; may be null. Not owned.

~FZagalaSpecFeatureEditorContext()#

Cancels a pending rebuild and stops listening to the editor settings.

TWeakObjectPtr<UObject> GetFeature() const#

Returns the feature being edited.

Returns:

The feature; may be invalid if it was destroyed.

FNotifyHook *GetNotifyHook() const#

Returns the object that is notified of property changes made through the details panel.

Returns:

The notify hook; may be null.

void ClearNotifyHook()#

Stops notifying the hook.

Called by the owner of the hook before it is destroyed.

FZagalaSpecFeatureEditorSelection &GetSelection()#

Returns the selection shared by the tabs.

Returns:

The selection.

TSharedRef<FZagalaSpecScenarioCheckerRegistry> GetScenarioCheckers() const#

Returns the scenario checkers of the editor.

They live as long as the editor, so check results are kept while it is open.

Returns:

The checkers.

const TArray<FZagalaSpecDocumentRowPtr> &GetRows() const#

Returns the rows of the document.

Returns:

The rows built by the last RebuildRows.

void RebuildRows()#

Builds the rows now with the feature layout of FZagalaSpecEditorModule, restores the selection (the first row if nothing was selected) and broadcasts OnRowsChanged.

void RequestRebuild()#

Asks for a rebuild on the next tick.

Several requests before the tick give a single rebuild, and it is safe to call while a widget that the rebuild replaces is still handling an event.

void HandleObjectReplaced(UObject *NewObject)#

Called when an object of the feature was replaced (e.g.

a step with a step of another type). The document is rebuilt, and the selection follows the replaced object.

Parameters:

NewObject – The object that replaced the old one.

Public Members

FSimpleMulticastDelegate OnRowsChanged#

Broadcast after the rows were rebuilt (and the selection restored).