class MAGES::SceneGraph::Editor::ActionReferenceCatalog

Overview

The UI free half of the ActionReference picker: it enumerates the actions a reference may point at, and turns a stored ID into the text the field should show. More…

class ActionReferenceCatalog
{
public:
    // fields

    static const string NoneLabel = "None";

    // methods

    static List<ActionReferenceEntry> FromGraphData(GraphData graph, object owner);

    static List<ActionReferenceEntry> FromSceneGraphData(
        SceneGraphData graph,
        BaseActionData owner
    );

    static ActionReferenceDisplay ResolveDisplay(
        string id,
        string cachedName,
        IReadOnlyList<ActionReferenceEntry> catalog
    );
};

Detailed Documentation

The UI free half of the ActionReference picker: it enumerates the actions a reference may point at, and turns a stored ID into the text the field should show.

Kept separate from ActionReferencePropertyDrawer so the parts with rules in them - which actions are candidates, and what a dangling ID looks like - can be tested without an editor window.

Fields

static const string NoneLabel = "None"

The text shown, and the entry offered, for a reference that points at nothing.

Methods

static List<ActionReferenceEntry> FromGraphData(GraphData graph, object owner)

Enumerate the actions of a version 2 graph.

Parameters:

graph

The graph being edited.

owner

The action that holds the reference, excluded from the result. May be null.

Returns:

The candidate actions, sorted by name, or null if graph is null.

static List<ActionReferenceEntry> FromSceneGraphData(
    SceneGraphData graph,
    BaseActionData owner
)

Enumerate the actions reachable from the root of a version 1 graph.

Parameters:

graph

The graph to walk.

owner

The action that holds the reference, excluded from the result. May be null.

Returns:

The candidate actions, sorted by name, or null if graph is null.

static ActionReferenceDisplay ResolveDisplay(
    string id,
    string cachedName,
    IReadOnlyList<ActionReferenceEntry> catalog
)

Work out what an ActionReference field should show.

Parameters:

id

The stored ID.

cachedName

The stored display name.

catalog

The candidates, or null when no catalog could be built.

Returns:

The state, the text, and the name that should be cached for this reference.