RSX Code Reference
    Preparing search index...

    Class InspectorFieldBaseAbstract Public Self

    The InspectorFieldBase displays UI elements for a single InspectableProperty. This is a base class that should be specialized for all supported types contained by InspectableProperty. Inspectable fields can and should be created recursively - normally complex types like objects and arrays will contain fields of their own, while primitive types like integer or boolean will consist of only a UI element.

    Hierarchy (View Summary)

    Index
    • Creates a new inspectable field UI for the specified property.

      Parameters

      • context: InspectorContext

        Context shared by all inspectable fields created by the same parent.

      • title: string

        Name of the property, or some other value to set as the title.

      • path: string

        Full path to this property (includes name of this property and all parent properties).

      • type: EnumValue<InspectablePropertyType>

        Type of property this field will be used for displaying.

      • depth: number

        Determines how deep within the inspector nesting hierarchy is this field. Some fields may contain other fields, in which case you should increase this value by one.

      • layout: InspectorFormLayoutSection

        Parent layout that all the field elements will be added to.

      • property: InspectableProperty

        Serializable property referencing the array whose contents to display.

      Returns InspectorFieldBase

    _active: boolean
    _depth: number
    _disabled: boolean
    _formLayoutSection: InspectorFormLayoutSection
    _isReadOnly: boolean
    _name: string
    _path: string
    _title: string
    endUndo: () => void

    Finishes recording an undo command started via startUndoForPath. If any changes are detected on the field an undo command is recorded onto the undo-redo stack, otherwise nothing is done.

    startUndo: () => void

    Zero parameter wrapper for startUndoForPath

    startUndoForPath: (subPath?: string) => void

    Notifies the system to start recording a new undo command. Any changes to the field after this is called will be recorded in the command. User must call endUndo after field is done being changed.

    Type Declaration

      • (subPath?: string): void
      • Parameters

        • OptionalsubPath: string

          Optional path to append to the end of the current field path.

        Returns void

    • get depth(): number

      Gets the depth of the field.

      Returns number

    • get isActive(): boolean

      Activates or deactivates the underlying UI elements.

      Returns boolean

    • set isActive(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isDisabled(): boolean

      Disables or enables the underlying UI elements. Disabled elements cannot be interacted with and have a faded out appearance.

      Returns boolean

    • set isDisabled(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isFocused(): boolean

      Determines if the field is in focused state.

      Returns boolean

    • get isReadOnly(): boolean

      Disables or enables the underlying UI elements. Disabled elements cannot be interacted with and have a faded out appearance.

      Returns boolean

    • set isReadOnly(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get name(): string

      Name portion of the field path.

      Returns string

    • get path(): string

      Returns the path to the field.

      Returns string

    • Virtual

      Destroys all UI elements in the inspectable field.

      Returns void

    • Searches for a child field with the specified path. The path must start with the field that this method is invoked on.

      Parameters

      • path: string

        Path relative to the current field. Path entries are field names separated with /. Fields within categories are placed within a special category group, surrounded by []. Examples: - myField - myObject/myField - myObject/[myCategory]/myField

      Returns InspectorFieldBase

      Matching field if one is found, null otherwise.

    • Virtual

      Searches for a child field with the specified path. The path must start with the field that this method is invoked on.

      Parameters

      • path: string[]

        Path relative to the current field. This should be an array of path elements. Fields within categories are placed within a special category group, surrounded by []. Examples: - ["myField"] - ["myObject", "myField"] - ["myObject", "[myCategory]", "myField"]

      • Optionalchildren: InspectorFieldBase[]

        The children of this field.

      Returns InspectorFieldBase

      Matching field if one is found, null otherwise.

    • Virtual

      Searches and focuses a child field with the specified path. The path must start with the field that this method is invoked on.

      Parameters

      • path: string[]

        Path relative to the current field. This should be an array of path elements. Fields within categories are placed within a special category group, surrounded by []. Examples: - ["myField"] - ["myObject", "myField"] - ["myObject", "[myCategory]", "myField"]

      Returns boolean

      True if a field was focused, false otherwise.

    • Virtual

      Initializes the UI elements for the field.

      Returns any

    • Virtual

      Checks whether the field can focus the given sub field.

      Parameters

      • subFieldName: string

        The name of the sub field to focus. This is a path containing the field name and sub field name.

      Returns boolean

      True, if focusing is possible.

    • Virtual

      Notifies the owning inspector that it needs to be refreshed on the next update loop.

      Returns void

    • Called when this field or a child of this field is focused. Use this to e.g. expand a field foldout to make the child visible.

      Returns void

    • Searches the inspector field hierarchy for fields that are an instance of at least one of the provided types.

      Parameters

      • typeOrTypes: Type | Type[]

        The types to search for.

      • OptionalisRecursive: boolean

        Whether to recusrively search the child fields as well.

      Returns InspectorFieldBase[]

      A list of all fields that match one of the types.

      Fields that are not instantiated yet will not be found. (e.g. Children of an ObjectInspectorField where the foldout hasn't been unfolded yet)

    • Virtual

      Activates or deactivates the underlying UI elements.

      Parameters

      • active: boolean

      Returns void

    • Virtual

      Disables or enables the underlying UI elements. Disabled elements cannot be interacted with and have a faded out appearance.

      Parameters

      • disabled: boolean

      Returns void

    • Virtual

      Moves keyboard focus to this field.

      Parameters

      • OptionalsubFieldName: string

        Name of the sub-field to focus on. Only relevant if the inspectable field represents multiple UI input elements.

      Returns void

    • Virtual

      Set the element read only.

      Parameters

      • readOnly: boolean

        The new read only value

      Returns void

    • Assigns the field value to the underlying property and creates an undo operation.

      Type Parameters

      • T

      Parameters

      Returns void

    • Creates a new inspectable field, automatically detecting the most appropriate implementation for the type contained in the provided serializable property. This may be one of the built-in inspectable field implemetations (like ones for primitives like int or bool), or a user defined implementation defined with a CustomInspectorAttribute attribute.

      Parameters

      • context: InspectorContext

        Context shared by all inspectable fields created by the same parent.

      • title: string

        Name of the property, or some other value to set as the title.

      • path: string

        Full path to this property (includes name of this property and all parent properties).

      • layoutIndex: number

        Index into the parent layout at which to insert the UI elements for the field .

      • depth: number

        Determines how deep within the inspector nesting hierarchy is this field. Some fields may contain other fields, in which case you should increase this value by one.

      • layout: InspectorFormLayoutSection

        Parent layout that all the field elements will be added to.

      • property: InspectableProperty

        Serializable property referencing the array whose contents to display.

      • Optionalparent: InspectorFieldContainer
      • OptionalfnGetParentFieldConditionals: () => InspectorFieldConditionalInfo[]

      Returns InspectorFieldBase

      Inspectable field that can be used for displaying the UI for an InspectableProperty of the provided type.

    • Returns the top-most part of the provided field path. See findPath2 for more information about paths.

      Parameters

      • path: string

        Path to return the sub-path of.

      • count: number

        Number of path elements to retrieve.

      Returns string

      First count elements of the path.

    • A helper function that takes a state by reference. If the state has InspectableState.Modified set, the state is set to InspectableState.NotModified. Returns an object of the oldState (before modifying it) and the newState that should be set on the field.

      This method should usually be used as such:

      Parameters

      Returns { newState: EnumValue<InspectableState>; oldState: EnumValue<InspectableState> }

      An object of the old state of the field and the new state that it should be set to.

      const [oldState, newState] = InspectorField.updateState(this._state);
      this._state = newState;
      return oldState;